@bedrock-rbx/ocale 0.1.0-beta.13 → 0.1.0-beta.15
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/README.md +128 -0
- package/dist/badges.d.mts +1 -1
- package/dist/badges.mjs +3 -2
- package/dist/badges.mjs.map +1 -1
- package/dist/developer-products.d.mts +1 -1
- package/dist/developer-products.mjs +4 -3
- package/dist/developer-products.mjs.map +1 -1
- package/dist/game-passes.d.mts +1 -1
- package/dist/game-passes.mjs +4 -3
- package/dist/game-passes.mjs.map +1 -1
- package/dist/index.d.mts +3 -12
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/luau-execution.d.mts +3 -3
- package/dist/luau-execution.mjs +5 -4
- package/dist/luau-execution.mjs.map +1 -1
- package/dist/places.d.mts +2 -2
- package/dist/places.mjs +5 -4
- package/dist/places.mjs.map +1 -1
- package/dist/{poll-timeout-Dg_QFEqi.mjs → poll-timeout-DMS4UPro.mjs} +2 -2
- package/dist/{poll-timeout-Dg_QFEqi.mjs.map → poll-timeout-DMS4UPro.mjs.map} +1 -1
- package/dist/{polling-BMrYajok.d.mts → polling-Vn5MT-fh.d.mts} +38 -9
- package/dist/{polling-BMrYajok.d.mts.map → polling-Vn5MT-fh.d.mts.map} +1 -1
- package/dist/{polling-helpers-QGjvYq3c.mjs → polling-helpers-B35M3ViY.mjs} +166 -54
- package/dist/{polling-helpers-QGjvYq3c.mjs.map → polling-helpers-B35M3ViY.mjs.map} +1 -1
- package/dist/{price-information-DIrvwCmd.mjs → price-information-DT7_QJN-.mjs} +2 -2
- package/dist/{price-information-DIrvwCmd.mjs.map → price-information-DT7_QJN-.mjs.map} +1 -1
- package/dist/{rate-limit-D1q2Js-z.mjs → rate-limit-nY4BF079.mjs} +19 -2
- package/dist/rate-limit-nY4BF079.mjs.map +1 -0
- package/dist/{resource-client-D6Efj9fU.mjs → resource-client-CG9-BG81.mjs} +67 -237
- package/dist/resource-client-CG9-BG81.mjs.map +1 -0
- package/dist/retry-BzX29aw_.mjs +333 -0
- package/dist/retry-BzX29aw_.mjs.map +1 -0
- package/dist/retry-CXnj3gXI.d.mts +163 -0
- package/dist/retry-CXnj3gXI.d.mts.map +1 -0
- package/dist/storage.d.mts +2 -27
- package/dist/storage.d.mts.map +1 -1
- package/dist/storage.mjs +3 -2
- package/dist/storage.mjs.map +1 -1
- package/dist/testing.d.mts +1 -1
- package/dist/testing.mjs +1 -1
- package/dist/{types-CwtZT1ek.d.mts → types-rzs1NB-j.d.mts} +12 -2
- package/dist/{types-CwtZT1ek.d.mts.map → types-rzs1NB-j.d.mts.map} +1 -1
- package/dist/universes.d.mts +1 -1
- package/dist/universes.mjs +4 -3
- package/dist/universes.mjs.map +1 -1
- package/dist/{validation-DkL5KQqz.mjs → validation-CGsK8aey.mjs} +2 -2
- package/dist/{validation-DkL5KQqz.mjs.map → validation-CGsK8aey.mjs.map} +1 -1
- package/package.json +3 -3
- package/dist/permission-error-DOVtNq3A.mjs +0 -46
- package/dist/permission-error-DOVtNq3A.mjs.map +0 -1
- package/dist/rate-limit-BYuizHoD.d.mts +0 -92
- package/dist/rate-limit-BYuizHoD.d.mts.map +0 -1
- package/dist/rate-limit-D1q2Js-z.mjs.map +0 -1
- package/dist/resource-client-D6Efj9fU.mjs.map +0 -1
package/dist/storage.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.mjs","names":["SECONDS_PER_MINUTE","PATH_PATTERN","makeSpec","#inner","#inner"],"sources":["../src/domains/cloud-v2/memory-store-queues/builders.ts","../src/domains/cloud-v2/memory-store-queues/operations.ts","../src/domains/cloud-v2/memory-store-queues/parsers.ts","../src/resources/storage/queues-group.ts","../src/domains/cloud-v2/memory-store-sorted-maps/builders.ts","../src/domains/cloud-v2/memory-store-sorted-maps/operations.ts","../src/domains/cloud-v2/memory-store-sorted-maps/parsers.ts","../src/resources/storage/sorted-maps-group.ts","../src/resources/storage/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../client/types.ts\";\nimport type {\n\tDequeueQueueItemsParameters,\n\tDiscardQueueItemsParameters,\n\tEnqueueQueueItemParameters,\n} from \"./types.ts\";\n\n/**\n * Builds a `POST` request for the Open Cloud\n * `Cloud_CreateMemoryStoreQueueItem` endpoint. Serializes the optional\n * `ttl` field as a Google protobuf `Duration` string in seconds (`\"30s\"`)\n * to match the wire contract.\n *\n * @param parameters - Universe and queue identifiers, the opaque payload,\n * and optional priority and TTL.\n * @returns A pure {@link HttpRequest} describing the enqueue call.\n */\nexport function buildEnqueueRequest(parameters: EnqueueQueueItemParameters): HttpRequest {\n\tconst { data, priority, queueId, ttl, universeId } = parameters;\n\tconst body: Record<string, unknown> = { data };\n\tif (priority !== undefined) {\n\t\tbody[\"priority\"] = priority;\n\t}\n\n\tif (ttl !== undefined) {\n\t\tbody[\"ttl\"] = `${ttl}s`;\n\t}\n\n\treturn {\n\t\tbody,\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${universeId}/memory-store/queues/${queueId}/items`,\n\t};\n}\n\n/**\n * Builds a `GET` request for the Open Cloud\n * `Cloud_ReadMemoryStoreQueueItems` endpoint. The `:read` suffix is a\n * custom-method marker; the call is HTTP `GET` despite the AIP-136\n * convention that custom methods use `POST`. Parameters travel as query\n * string only; there is no request body.\n *\n * `invisibilityWindow` is serialized as a Google protobuf `Duration`\n * string in seconds (`\"30s\"`), matching the wire contract.\n *\n * @param parameters - Universe and queue identifiers, plus optional\n * `count`, `allOrNothing`, and `invisibilityWindow`.\n * @returns A pure {@link HttpRequest} describing the dequeue call.\n */\nexport function buildDequeueRequest(parameters: DequeueQueueItemsParameters): HttpRequest {\n\tconst query = new URLSearchParams();\n\tif (parameters.count !== undefined) {\n\t\tquery.append(\"count\", String(parameters.count));\n\t}\n\n\tif (parameters.allOrNothing !== undefined) {\n\t\tquery.append(\"allOrNothing\", String(parameters.allOrNothing));\n\t}\n\n\tif (parameters.invisibilityWindow !== undefined) {\n\t\tquery.append(\"invisibilityWindow\", `${parameters.invisibilityWindow}s`);\n\t}\n\n\tconst queryString = query.toString();\n\tconst { queueId, universeId } = parameters;\n\tconst base = `/cloud/v2/universes/${universeId}/memory-store/queues/${queueId}/items:read`;\n\treturn {\n\t\tmethod: \"GET\",\n\t\turl: queryString === \"\" ? base : `${base}?${queryString}`,\n\t};\n}\n\n/**\n * Builds a `POST` request for the Open Cloud\n * `Cloud_DiscardMemoryStoreQueueItems` endpoint. The request body uses\n * `{ readId }`, matching the schema (the dequeue *response* uses `id`,\n * but the discard *request* matches the schema and is not patched).\n *\n * @param parameters - Universe and queue identifiers, plus the\n * `readId` returned from a prior dequeue.\n * @returns A pure {@link HttpRequest} describing the discard call.\n */\nexport function buildDiscardRequest(parameters: DiscardQueueItemsParameters): HttpRequest {\n\tconst { queueId, readId, universeId } = parameters;\n\treturn {\n\t\tbody: { readId },\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${universeId}/memory-store/queues/${queueId}/items:discard`,\n\t};\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst ENQUEUE_PER_MINUTE = 1_000_000;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for enqueueing a memory-store queue item,\n * from the Open Cloud OpenAPI schema (1,000,000 requests per minute per\n * API key owner). Keyed independently from the dequeue and discard\n * operations so the three do not share a queue; upstream quota\n * accounting is documented per-operation, and the conservative default\n * is fewer cross-method contention surprises.\n */\nexport const ENQUEUE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: ENQUEUE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-queues.enqueue\",\n});\n\n/**\n * Scopes required to enqueue a memory-store queue item, sourced from\n * `x-roblox-scopes` on the `Cloud_CreateMemoryStoreQueueItem` operation\n * in the vendored OpenAPI schema.\n */\nexport const ENQUEUE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"memory-store.queue:add\",\n]);\n\nconst DEQUEUE_PER_MINUTE = 1_000_000;\n\n/**\n * Per-second request ceiling for dequeueing memory-store queue items,\n * from the Open Cloud OpenAPI schema (1,000,000 requests per minute\n * per API key owner). Keyed independently from enqueue and discard.\n */\nexport const DEQUEUE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: DEQUEUE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-queues.dequeue\",\n});\n\n/**\n * Scopes required to dequeue memory-store queue items, sourced from\n * `x-roblox-scopes` on the `Cloud_ReadMemoryStoreQueueItems` operation\n * in the vendored OpenAPI schema.\n */\nexport const DEQUEUE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"memory-store.queue:dequeue\",\n]);\n\nconst DISCARD_PER_MINUTE = 1_000_000;\n\n/**\n * Per-second request ceiling for discarding (acknowledging) memory-store\n * queue items, from the Open Cloud OpenAPI schema (1,000,000 requests\n * per minute per API key owner). Keyed independently from enqueue and\n * dequeue.\n */\nexport const DISCARD_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: DISCARD_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-queues.discard\",\n});\n\n/**\n * Scopes required to discard memory-store queue items, sourced from\n * `x-roblox-scopes` on the `Cloud_DiscardMemoryStoreQueueItems`\n * operation in the vendored OpenAPI schema.\n */\nexport const DISCARD_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"memory-store.queue:discard\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { DequeueResult, QueueItem } from \"./types.ts\";\nimport type { MemoryStoreQueueItemWire } from \"./wire.ts\";\n\nconst PATH_PATTERN = /^cloud\\/v2\\/universes\\/(\\d+)\\/memory-store\\/queues\\/([^/]+)\\/items\\/([^/]+)$/;\nconst MALFORMED_QUEUE_ITEM_MESSAGE = \"Malformed memory-store queue item response\";\nconst MALFORMED_DEQUEUE_MESSAGE = \"Malformed memory-store dequeue response\";\n\n/**\n * Parses a successful memory-store queue-item response body (the\n * `Cloud_CreateMemoryStoreQueueItem` happy path) into the public\n * {@link QueueItem} shape.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link QueueItem}, or an\n * {@link ApiError} when the body does not match the wire schema.\n */\nexport function parseQueueItemResponse(response: HttpResponse): Result<QueueItem, ApiError> {\n\tconst item = wireBodyToQueueItem(response.body);\n\tif (item === undefined) {\n\t\treturn malformedQueueItem(response.status);\n\t}\n\n\treturn { data: item, success: true };\n}\n\n/**\n * Parses a successful `Cloud_ReadMemoryStoreQueueItems` response body\n * into the public {@link DequeueResult} shape. Each item in the\n * `queueItems` array is validated through the same path-and-shape\n * checks as {@link parseQueueItemResponse}; a malformed entry rejects\n * the whole response.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link DequeueResult},\n * or an {@link ApiError} when the response shape is wrong.\n */\nexport function parseDequeueResponse(response: HttpResponse): Result<DequeueResult, ApiError> {\n\tconst { body, status: statusCode } = response;\n\tif (!isRecord(body)) {\n\t\treturn malformedDequeue(statusCode);\n\t}\n\n\tconst { id, queueItems } = body;\n\tif (typeof id !== \"string\") {\n\t\treturn malformedDequeue(statusCode);\n\t}\n\n\tif (queueItems !== undefined && queueItems !== null && !Array.isArray(queueItems)) {\n\t\treturn malformedDequeue(statusCode);\n\t}\n\n\tconst rawItems = queueItems ?? [];\n\tconst items = rawItems.map(wireBodyToQueueItem);\n\tif (!items.every(isQueueItem)) {\n\t\treturn malformedDequeue(statusCode);\n\t}\n\n\treturn { data: { items, readId: id }, success: true };\n}\n\nfunction isQueueItemWire(body: unknown): body is MemoryStoreQueueItemWire {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\tconst { data, expireTime, path, priority } = body;\n\treturn (\n\t\ttypeof path === \"string\" &&\n\t\tisDateTimeString(expireTime) &&\n\t\tdata !== undefined &&\n\t\tdata !== null &&\n\t\t(priority === undefined || priority === null || typeof priority === \"number\")\n\t);\n}\n\nfunction wireBodyToQueueItem(body: unknown): QueueItem | undefined {\n\tif (!isQueueItemWire(body)) {\n\t\treturn undefined;\n\t}\n\n\tconst match = PATH_PATTERN.exec(body.path);\n\tconst universeId = match?.[1];\n\tconst queueId = match?.[2];\n\tconst id = match?.[3];\n\tif (universeId === undefined || queueId === undefined || id === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\tid,\n\t\tdata: body.data,\n\t\texpiresAt: new Date(body.expireTime),\n\t\tpriority: body.priority ?? undefined,\n\t\tqueueId,\n\t\tuniverseId,\n\t};\n}\n\nfunction malformedQueueItem(statusCode: number): Result<QueueItem, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_QUEUE_ITEM_MESSAGE, { statusCode }),\n\t\tsuccess: false,\n\t};\n}\n\nfunction isQueueItem(item: QueueItem | undefined): item is QueueItem {\n\treturn item !== undefined;\n}\n\nfunction malformedDequeue(statusCode: number): Result<DequeueResult, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_DEQUEUE_MESSAGE, { statusCode }),\n\t\tsuccess: false,\n\t};\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport {\n\tbuildDequeueRequest,\n\tbuildDiscardRequest,\n\tbuildEnqueueRequest,\n} from \"../../domains/cloud-v2/memory-store-queues/builders.ts\";\nimport {\n\tDEQUEUE_OPERATION_LIMIT,\n\tDEQUEUE_REQUIRED_SCOPES,\n\tDISCARD_OPERATION_LIMIT,\n\tDISCARD_REQUIRED_SCOPES,\n\tENQUEUE_OPERATION_LIMIT,\n\tENQUEUE_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/memory-store-queues/operations.ts\";\nimport {\n\tparseDequeueResponse,\n\tparseQueueItemResponse,\n} from \"../../domains/cloud-v2/memory-store-queues/parsers.ts\";\nimport type {\n\tDequeueQueueItemsParameters,\n\tDequeueResult,\n\tDiscardQueueItemsParameters,\n\tEnqueueQueueItemParameters,\n\tQueueItem,\n} from \"../../domains/cloud-v2/memory-store-queues/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS, IDEMPOTENT_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport {\n\tokRequest,\n\tparseEmptyResponse,\n\ttype ResourceClient,\n\ttype ResourceMethodSpec,\n} from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\n\nfunction makeSpec<P, R>(spec: ResourceMethodSpec<P, R>): ResourceMethodSpec<P, R> {\n\treturn Object.freeze(spec);\n}\n\nconst ENQUEUE_SPEC = makeSpec<EnqueueQueueItemParameters, QueueItem>({\n\tbuildRequest: (parameters) => okRequest(buildEnqueueRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: ENQUEUE_OPERATION_LIMIT,\n\tparse: parseQueueItemResponse,\n\trequiredScopes: ENQUEUE_REQUIRED_SCOPES,\n});\n\n// Dequeue uses HTTP GET but mutates server state via the invisibility\n// window. Retrying a 5xx where the server set invisibility before\n// failing the response would lose the original batch (it stays\n// invisible until the window elapses) and return a different one. So\n// the retry policy mirrors `create`: only 429, never 5xx.\nconst DEQUEUE_SPEC = makeSpec<DequeueQueueItemsParameters, DequeueResult>({\n\tbuildRequest: (parameters) => okRequest(buildDequeueRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: DEQUEUE_OPERATION_LIMIT,\n\tparse: parseDequeueResponse,\n\trequiredScopes: DEQUEUE_REQUIRED_SCOPES,\n});\n\nconst DISCARD_SPEC = makeSpec<DiscardQueueItemsParameters, undefined>({\n\tbuildRequest: (parameters) => okRequest(buildDiscardRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: DISCARD_OPERATION_LIMIT,\n\tparse: parseEmptyResponse,\n\trequiredScopes: DISCARD_REQUIRED_SCOPES,\n});\n\n/**\n * Operation Group on `StorageClient` that exposes the memory-store\n * queue endpoints. Queues are FIFO collections of opaque JSON values\n * with optional priority and TTL; consumers enqueue items, dequeue\n * them in batches, and acknowledge processed batches with a read\n * identifier.\n */\nexport class MemoryStoreQueuesGroup {\n\treadonly #inner: ResourceClient;\n\n\t/**\n\t * Wraps the shared {@link ResourceClient} so the Operation Group\n\t * routes calls through the same retry, hooks, and rate-limit queues\n\t * as the rest of the parent client.\n\t *\n\t * @param inner - The shared {@link ResourceClient} owned by the\n\t * parent client.\n\t */\n\tconstructor(inner: ResourceClient) {\n\t\tthis.#inner = inner;\n\t}\n\n\t/**\n\t * Dequeues up to `count` items from the front of the queue. Items\n\t * returned become invisible to subsequent reads for\n\t * `invisibilityWindow` seconds (default 30 server-side); they\n\t * reappear once the window elapses unless acknowledged via\n\t * `discard` with the returned `readId`.\n\t *\n\t * On 5xx, dequeue does not retry: the server may have set\n\t * invisibility on a batch before the response failed, so a retry\n\t * would return a *different* batch and the first one is lost until\n\t * the window expires. Callers that can detect duplicates externally\n\t * may opt back into 5xx retry per call by passing `retryableStatuses`\n\t * on `options`.\n\t *\n\t * @param parameters - Universe and queue identifiers, plus optional\n\t * `count`, `allOrNothing`, and `invisibilityWindow`.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed {@link DequeueResult}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async dequeue(\n\t\tparameters: DequeueQueueItemsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<DequeueResult, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: DEQUEUE_SPEC });\n\t}\n\n\t/**\n\t * Acknowledges a dequeued batch of items, removing them from the\n\t * queue permanently. Pass the `readId` returned from the prior\n\t * `dequeue` call. Without `discard`, the items reappear once the\n\t * invisibility window elapses.\n\t *\n\t * The call is idempotent: a second `discard` with the same `readId`\n\t * is a no-op once the batch has been acknowledged. The retry policy\n\t * therefore retries both 429 and 5xx.\n\t *\n\t * @param parameters - Universe and queue identifiers, plus the\n\t * `readId` returned from a prior dequeue.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping `undefined` on success (the\n\t * server returns an empty body) or the {@link OpenCloudError}\n\t * that caused the request to fail.\n\t */\n\tpublic async discard(\n\t\tparameters: DiscardQueueItemsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: DISCARD_SPEC });\n\t}\n\n\t/**\n\t * Enqueues a single item onto a memory-store queue. The queue is\n\t * auto-created on first use; the queue identifier is any string the\n\t * caller picks. Items with higher `priority` values are dequeued\n\t * first; equal priorities preserve insertion order. Items expire\n\t * and are removed automatically after `ttl` seconds, or after a\n\t * server-default lifetime when omitted.\n\t *\n\t * @param parameters - Universe and queue identifiers, the opaque\n\t * payload, and optional `priority` and `ttl`.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link QueueItem} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async enqueue(\n\t\tparameters: EnqueueQueueItemParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<QueueItem, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: ENQUEUE_SPEC });\n\t}\n}\n","import type { HttpRequest } from \"../../../client/types.ts\";\nimport type {\n\tCreateSortedMapItemParameters,\n\tDeleteSortedMapItemParameters,\n\tGetSortedMapItemParameters,\n\tListSortedMapItemsParameters,\n\tSortKey,\n\tUpdateSortedMapItemParameters,\n} from \"./types.ts\";\n\n/**\n * Builds a `POST` request for the Open Cloud\n * `Cloud_CreateMemoryStoreSortedMapItem` endpoint. The caller-supplied\n * `itemId` travels as the `id` query parameter (URL-encoded by\n * `URLSearchParams`); the body carries `value`, the optional `ttl`\n * (serialized as a Google protobuf `Duration` string in seconds), and\n * one of `stringSortKey`/`numericSortKey` projected from the\n * {@link SortKey} discriminated union.\n *\n * @param parameters - Universe, sorted-map, item identifiers, the\n * value to store, and optional `sortKey` and `ttl`.\n * @returns A pure {@link HttpRequest} describing the create call.\n */\nexport function buildCreateRequest(parameters: CreateSortedMapItemParameters): HttpRequest {\n\tconst { itemId, mapId, sortKey, ttl, universeId, value } = parameters;\n\tconst body: Record<string, unknown> = { value };\n\tif (ttl !== undefined) {\n\t\tbody[\"ttl\"] = `${ttl}s`;\n\t}\n\n\tapplySortKeyToBody(body, sortKey);\n\n\tconst query = new URLSearchParams({ id: itemId });\n\treturn {\n\t\tbody,\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${encodeURIComponent(universeId)}/memory-store/sorted-maps/${encodeURIComponent(mapId)}/items?${query.toString()}`,\n\t};\n}\n\n/**\n * Builds a `DELETE` request for the Open Cloud\n * `Cloud_DeleteMemoryStoreSortedMapItem` endpoint. Every path segment\n * (universe, sorted-map, item identifiers) is URL-encoded so callers\n * can pass values containing reserved characters without manual\n * escaping.\n *\n * @param parameters - Universe, sorted-map, and item identifiers.\n * @returns A pure {@link HttpRequest} describing the delete call.\n */\nexport function buildDeleteRequest(parameters: DeleteSortedMapItemParameters): HttpRequest {\n\tconst { itemId, mapId, universeId } = parameters;\n\treturn {\n\t\tmethod: \"DELETE\",\n\t\turl: `/cloud/v2/universes/${encodeURIComponent(universeId)}/memory-store/sorted-maps/${encodeURIComponent(mapId)}/items/${encodeURIComponent(itemId)}`,\n\t};\n}\n\n/**\n * Builds a `GET` request for the Open Cloud\n * `Cloud_GetMemoryStoreSortedMapItem` endpoint. Every path segment\n * (universe, sorted-map, item identifiers) is URL-encoded so callers\n * can pass values containing reserved characters without manual\n * escaping.\n *\n * @param parameters - Universe, sorted-map, and item identifiers.\n * @returns A pure {@link HttpRequest} describing the get call.\n */\nexport function buildGetRequest(parameters: GetSortedMapItemParameters): HttpRequest {\n\tconst { itemId, mapId, universeId } = parameters;\n\treturn {\n\t\tmethod: \"GET\",\n\t\turl: `/cloud/v2/universes/${encodeURIComponent(universeId)}/memory-store/sorted-maps/${encodeURIComponent(mapId)}/items/${encodeURIComponent(itemId)}`,\n\t};\n}\n\n/**\n * Builds a `GET` request for the Open Cloud\n * `Cloud_ListMemoryStoreSortedMapItems` endpoint. Optional `filter`,\n * `maxPageSize`, `orderBy`, and `pageToken` parameters travel as query\n * string parameters and are omitted when unset.\n *\n * @param parameters - Universe and sorted-map identifiers, plus\n * optional pagination and filter parameters.\n * @returns A pure {@link HttpRequest} describing the list call.\n */\nexport function buildListRequest(parameters: ListSortedMapItemsParameters): HttpRequest {\n\tconst { filter, mapId, maxPageSize, orderBy, pageToken, universeId } = parameters;\n\tconst query = new URLSearchParams();\n\tif (maxPageSize !== undefined) {\n\t\tquery.append(\"maxPageSize\", String(maxPageSize));\n\t}\n\n\tif (pageToken !== undefined) {\n\t\tquery.append(\"pageToken\", pageToken);\n\t}\n\n\tif (orderBy !== undefined) {\n\t\tquery.append(\"orderBy\", orderBy);\n\t}\n\n\tif (filter !== undefined) {\n\t\tquery.append(\"filter\", filter);\n\t}\n\n\tconst base = `/cloud/v2/universes/${encodeURIComponent(universeId)}/memory-store/sorted-maps/${encodeURIComponent(mapId)}/items`;\n\tconst queryString = query.toString();\n\treturn { method: \"GET\", url: queryString === \"\" ? base : `${base}?${queryString}` };\n}\n\n/**\n * Builds a `PATCH` request for the Open Cloud\n * `Cloud_UpdateMemoryStoreSortedMapItem` endpoint. Body fields are\n * conditionally included so a partial update sends only the changed\n * fields; the optional `allowMissing` query string drives\n * upsert-on-missing behaviour server-side.\n *\n * @param parameters - Universe, sorted-map, and item identifiers,\n * plus any subset of `value`, `ttl`, `sortKey`, and `allowMissing`.\n * @returns A pure {@link HttpRequest} describing the update call.\n */\nexport function buildUpdateRequest(parameters: UpdateSortedMapItemParameters): HttpRequest {\n\tconst { allowMissing: shouldAllowMissing, itemId, mapId, universeId } = parameters;\n\tconst base = `/cloud/v2/universes/${encodeURIComponent(universeId)}/memory-store/sorted-maps/${encodeURIComponent(mapId)}/items/${encodeURIComponent(itemId)}`;\n\tconst query = new URLSearchParams();\n\tif (shouldAllowMissing !== undefined) {\n\t\tquery.append(\"allowMissing\", String(shouldAllowMissing));\n\t}\n\n\tconst queryString = query.toString();\n\treturn {\n\t\tbody: buildUpdateBody(parameters),\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"PATCH\",\n\t\turl: queryString === \"\" ? base : `${base}?${queryString}`,\n\t};\n}\n\nfunction applySortKeyToBody(body: Record<string, unknown>, sortKey: SortKey | undefined): void {\n\tif (sortKey === undefined) {\n\t\treturn;\n\t}\n\n\tif (sortKey.kind === \"string\") {\n\t\tbody[\"stringSortKey\"] = sortKey.value;\n\t\treturn;\n\t}\n\n\tbody[\"numericSortKey\"] = sortKey.value;\n}\n\nfunction buildUpdateBody(parameters: UpdateSortedMapItemParameters): Record<string, unknown> {\n\tconst { sortKey, ttl, value } = parameters;\n\tconst body: Record<string, unknown> = {};\n\tif (value !== undefined) {\n\t\tbody[\"value\"] = value;\n\t}\n\n\tif (ttl !== undefined) {\n\t\tbody[\"ttl\"] = `${ttl}s`;\n\t}\n\n\tapplySortKeyToBody(body, sortKey);\n\treturn body;\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst CREATE_PER_MINUTE = 1_000_000;\nconst SECONDS_PER_MINUTE = 60;\n\nconst WRITE_SCOPE = \"memory-store.sorted-map:write\";\n\n/**\n * Per-second request ceiling for creating a memory-store sorted-map\n * item, from the Open Cloud OpenAPI schema (1,000,000 requests per\n * minute per API key owner). Keyed independently from the get, update,\n * delete, and list operations so the five do not share a queue.\n */\nexport const CREATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: CREATE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-sorted-maps.create\",\n});\n\n/**\n * Scopes required to create a memory-store sorted-map item, sourced\n * from `x-roblox-scopes` on the `Cloud_CreateMemoryStoreSortedMapItem`\n * operation in the vendored OpenAPI schema.\n */\nexport const CREATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([WRITE_SCOPE]);\n\nconst DELETE_PER_MINUTE = 1_000_000;\n\n/**\n * Per-second request ceiling for deleting a memory-store sorted-map\n * item, from the Open Cloud OpenAPI schema (1,000,000 requests per\n * minute per API key owner).\n */\nexport const DELETE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: DELETE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-sorted-maps.delete\",\n});\n\n/**\n * Scopes required to delete a memory-store sorted-map item, sourced\n * from `x-roblox-scopes` on the `Cloud_DeleteMemoryStoreSortedMapItem`\n * operation in the vendored OpenAPI schema.\n */\nexport const DELETE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([WRITE_SCOPE]);\n\nconst GET_PER_MINUTE = 1_000_000;\n\n/**\n * Per-second request ceiling for reading a memory-store sorted-map\n * item, from the Open Cloud OpenAPI schema (1,000,000 requests per\n * minute per API key owner).\n */\nexport const GET_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: GET_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-sorted-maps.get\",\n});\n\n/**\n * Scopes required to read a memory-store sorted-map item, sourced from\n * `x-roblox-scopes` on the `Cloud_GetMemoryStoreSortedMapItem`\n * operation in the vendored OpenAPI schema.\n */\nexport const GET_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"memory-store.sorted-map:read\",\n]);\n\nconst LIST_PER_MINUTE = 1_000_000;\n\n/**\n * Per-second request ceiling for listing memory-store sorted-map\n * items, from the Open Cloud OpenAPI schema (1,000,000 requests per\n * minute per API key owner).\n */\nexport const LIST_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: LIST_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-sorted-maps.list\",\n});\n\n/**\n * Scopes required to list memory-store sorted-map items, sourced from\n * `x-roblox-scopes` on the `Cloud_ListMemoryStoreSortedMapItems`\n * operation in the vendored OpenAPI schema.\n */\nexport const LIST_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"memory-store.sorted-map:read\",\n]);\n\nconst UPDATE_PER_MINUTE = 1_000_000;\n\n/**\n * Per-second request ceiling for updating a memory-store sorted-map\n * item, from the Open Cloud OpenAPI schema (1,000,000 requests per\n * minute per API key owner).\n */\nexport const UPDATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: UPDATE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-sorted-maps.update\",\n});\n\n/**\n * Scopes required to update a memory-store sorted-map item, sourced\n * from `x-roblox-scopes` on the `Cloud_UpdateMemoryStoreSortedMapItem`\n * operation in the vendored OpenAPI schema.\n */\nexport const UPDATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([WRITE_SCOPE]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { ListSortedMapItemsResult, SortedMapItem, SortKey } from \"./types.ts\";\nimport type { MemoryStoreSortedMapItemWire } from \"./wire.ts\";\n\nconst PATH_PATTERN =\n\t/^cloud\\/v2\\/universes\\/(\\d+)\\/memory-stores?\\/sorted-maps\\/([^/]+)\\/items\\/([^/]+)$/;\nconst MALFORMED_MESSAGE = \"Malformed memory-store sorted-map item response\";\nconst MALFORMED_LIST_MESSAGE = \"Malformed memory-store sorted-map list response\";\n\n/**\n * Parses a successful memory-store sorted-map item response body (the\n * happy path for create, get, and update) into the public\n * {@link SortedMapItem} shape.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link SortedMapItem},\n * or an {@link ApiError} when the body does not match the wire schema.\n */\nexport function parseSortedMapItemResponse(\n\tresponse: HttpResponse,\n): Result<SortedMapItem, ApiError> {\n\tconst item = wireBodyToSortedMapItem(response.body);\n\tif (item === undefined) {\n\t\treturn malformedSortedMapItem(response.status);\n\t}\n\n\treturn { data: item, success: true };\n}\n\n/**\n * Parses a successful `Cloud_ListMemoryStoreSortedMapItems` response\n * body into the public {@link ListSortedMapItemsResult} shape. Each\n * item in the `items` array is validated through the same\n * path-and-shape checks as {@link parseSortedMapItemResponse}; a\n * malformed entry rejects the whole response.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed\n * {@link ListSortedMapItemsResult}, or an {@link ApiError} when the\n * response shape is wrong.\n */\nexport function parseListResponse(\n\tresponse: HttpResponse,\n): Result<ListSortedMapItemsResult, ApiError> {\n\tconst { body, status: statusCode } = response;\n\tif (!isRecord(body)) {\n\t\treturn malformedList(statusCode);\n\t}\n\n\tconst { items: rawItemsField, nextPageToken } = body;\n\tif (rawItemsField !== undefined && rawItemsField !== null && !Array.isArray(rawItemsField)) {\n\t\treturn malformedList(statusCode);\n\t}\n\n\tconst normalizedToken = nextPageToken ?? undefined;\n\tif (normalizedToken !== undefined && typeof normalizedToken !== \"string\") {\n\t\treturn malformedList(statusCode);\n\t}\n\n\tconst rawItems = rawItemsField ?? [];\n\tconst items = rawItems.map(wireBodyToSortedMapItem);\n\tif (!items.every(isSortedMapItem)) {\n\t\treturn malformedList(statusCode);\n\t}\n\n\treturn { data: { items, nextPageToken: normalizedToken }, success: true };\n}\n\nfunction isSortedMapItemWire(body: unknown): body is MemoryStoreSortedMapItemWire {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\tconst { id, etag, expireTime, numericSortKey, path, stringSortKey, value } = body;\n\treturn (\n\t\ttypeof path === \"string\" &&\n\t\ttypeof etag === \"string\" &&\n\t\ttypeof id === \"string\" &&\n\t\tisDateTimeString(expireTime) &&\n\t\tvalue !== undefined &&\n\t\t(stringSortKey === undefined ||\n\t\t\tstringSortKey === null ||\n\t\t\ttypeof stringSortKey === \"string\") &&\n\t\t(numericSortKey === undefined ||\n\t\t\tnumericSortKey === null ||\n\t\t\ttypeof numericSortKey === \"number\")\n\t);\n}\n\nfunction extractSortKey(body: MemoryStoreSortedMapItemWire): \"conflict\" | SortKey | undefined {\n\tconst hasStringKey = typeof body.stringSortKey === \"string\";\n\tconst hasNumericKey = typeof body.numericSortKey === \"number\";\n\tif (hasStringKey && hasNumericKey) {\n\t\treturn \"conflict\";\n\t}\n\n\tif (hasStringKey) {\n\t\treturn { kind: \"string\", value: body.stringSortKey };\n\t}\n\n\tif (hasNumericKey) {\n\t\treturn { kind: \"numeric\", value: body.numericSortKey };\n\t}\n\n\treturn undefined;\n}\n\nfunction wireBodyToSortedMapItem(body: unknown): SortedMapItem | undefined {\n\tif (!isSortedMapItemWire(body)) {\n\t\treturn undefined;\n\t}\n\n\t// Item ids round-trip URL-encoded in `path` (e.g. `name::id` arrives\n\t// as `name%3A%3Aid`), so the decoded id is read from `body.id` rather\n\t// than the regex group.\n\tconst match = PATH_PATTERN.exec(body.path);\n\tconst universeId = match?.[1];\n\tconst mapId = match?.[2];\n\tif (universeId === undefined || mapId === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst sortKey = extractSortKey(body);\n\tif (sortKey === \"conflict\") {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\tid: body.id,\n\t\tetag: body.etag,\n\t\texpiresAt: new Date(body.expireTime),\n\t\tmapId,\n\t\tsortKey,\n\t\tuniverseId,\n\t\tvalue: body.value,\n\t};\n}\n\nfunction malformedSortedMapItem(statusCode: number): Result<SortedMapItem, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_MESSAGE, { statusCode }),\n\t\tsuccess: false,\n\t};\n}\n\nfunction isSortedMapItem(item: SortedMapItem | undefined): item is SortedMapItem {\n\treturn item !== undefined;\n}\n\nfunction malformedList(statusCode: number): Result<ListSortedMapItemsResult, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_LIST_MESSAGE, { statusCode }),\n\t\tsuccess: false,\n\t};\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport {\n\tbuildCreateRequest,\n\tbuildDeleteRequest,\n\tbuildGetRequest,\n\tbuildListRequest,\n\tbuildUpdateRequest,\n} from \"../../domains/cloud-v2/memory-store-sorted-maps/builders.ts\";\nimport {\n\tCREATE_OPERATION_LIMIT,\n\tCREATE_REQUIRED_SCOPES,\n\tDELETE_OPERATION_LIMIT,\n\tDELETE_REQUIRED_SCOPES,\n\tGET_OPERATION_LIMIT,\n\tGET_REQUIRED_SCOPES,\n\tLIST_OPERATION_LIMIT,\n\tLIST_REQUIRED_SCOPES,\n\tUPDATE_OPERATION_LIMIT,\n\tUPDATE_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/memory-store-sorted-maps/operations.ts\";\nimport {\n\tparseListResponse,\n\tparseSortedMapItemResponse,\n} from \"../../domains/cloud-v2/memory-store-sorted-maps/parsers.ts\";\nimport type {\n\tCreateSortedMapItemParameters,\n\tDeleteSortedMapItemParameters,\n\tGetSortedMapItemParameters,\n\tListSortedMapItemsParameters,\n\tListSortedMapItemsResult,\n\tSortedMapItem,\n\tUpdateSortedMapItemParameters,\n} from \"../../domains/cloud-v2/memory-store-sorted-maps/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS, IDEMPOTENT_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport {\n\tokRequest,\n\tparseEmptyResponse,\n\ttype ResourceClient,\n\ttype ResourceMethodSpec,\n} from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\n\nfunction makeSpec<P, R>(spec: ResourceMethodSpec<P, R>): ResourceMethodSpec<P, R> {\n\treturn Object.freeze(spec);\n}\n\nconst CREATE_SPEC = makeSpec<CreateSortedMapItemParameters, SortedMapItem>({\n\tbuildRequest: (parameters) => okRequest(buildCreateRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: CREATE_OPERATION_LIMIT,\n\tparse: parseSortedMapItemResponse,\n\trequiredScopes: CREATE_REQUIRED_SCOPES,\n});\n\nconst DELETE_SPEC = makeSpec<DeleteSortedMapItemParameters, undefined>({\n\tbuildRequest: (parameters) => okRequest(buildDeleteRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: DELETE_OPERATION_LIMIT,\n\tparse: parseEmptyResponse,\n\trequiredScopes: DELETE_REQUIRED_SCOPES,\n});\n\nconst GET_SPEC = makeSpec<GetSortedMapItemParameters, SortedMapItem>({\n\tbuildRequest: (parameters) => okRequest(buildGetRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: GET_OPERATION_LIMIT,\n\tparse: parseSortedMapItemResponse,\n\trequiredScopes: GET_REQUIRED_SCOPES,\n});\n\nconst LIST_SPEC = makeSpec<ListSortedMapItemsParameters, ListSortedMapItemsResult>({\n\tbuildRequest: (parameters) => okRequest(buildListRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: LIST_OPERATION_LIMIT,\n\tparse: parseListResponse,\n\trequiredScopes: LIST_REQUIRED_SCOPES,\n});\n\nconst UPDATE_SPEC = makeSpec<UpdateSortedMapItemParameters, SortedMapItem>({\n\tbuildRequest: (parameters) => okRequest(buildUpdateRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: UPDATE_OPERATION_LIMIT,\n\tparse: parseSortedMapItemResponse,\n\trequiredScopes: UPDATE_REQUIRED_SCOPES,\n});\n\n/**\n * Operation Group on `StorageClient` that exposes the memory-store\n * sorted-map endpoints. Sorted maps are ordered collections of\n * (id, value, sortKey) triples; consumers create, read, update, list,\n * and delete items keyed by a caller-supplied identifier and ordered\n * by an optional string or numeric sort key.\n */\nexport class MemoryStoreSortedMapsGroup {\n\treadonly #inner: ResourceClient;\n\n\t/**\n\t * Wraps the shared {@link ResourceClient} so the Operation Group\n\t * routes calls through the same retry, hooks, and rate-limit queues\n\t * as the rest of the parent client.\n\t *\n\t * @param inner - The shared {@link ResourceClient} owned by the\n\t * parent client.\n\t */\n\tconstructor(inner: ResourceClient) {\n\t\tthis.#inner = inner;\n\t}\n\n\t/**\n\t * Creates a single item in a sorted map. The sorted map is\n\t * auto-created on first use; the map identifier is any string the\n\t * caller picks. Items are keyed by `itemId` (case-sensitive) and\n\t * ordered by an optional `sortKey`. Items expire and are removed\n\t * automatically after `ttl` seconds, or after a server-default\n\t * lifetime when omitted.\n\t *\n\t * On 5xx, create does not retry: Roblox Open Cloud has no\n\t * idempotency-key support, so a retry of a transient failure risks\n\t * producing a duplicate item.\n\t *\n\t * @param parameters - Universe, sorted-map, item identifiers, the\n\t * value to store, and optional `sortKey` and `ttl`.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link SortedMapItem}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async create(\n\t\tparameters: CreateSortedMapItemParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<SortedMapItem, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: CREATE_SPEC });\n\t}\n\n\t/**\n\t * Removes a single item from a sorted map. The call is idempotent:\n\t * a second `delete` against the same item is a no-op once the\n\t * server has dropped the row. The retry policy retries both 429\n\t * and 5xx.\n\t *\n\t * @param parameters - Universe, sorted-map, and item identifiers.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping `undefined` on success or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async delete(\n\t\tparameters: DeleteSortedMapItemParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: DELETE_SPEC });\n\t}\n\n\t/**\n\t * Reads a single item from a sorted map. Returns the parsed\n\t * {@link SortedMapItem} with the server-recorded `etag` for use in\n\t * subsequent conditional updates (once the SDK begins emitting\n\t * `If-Match`; see the package README).\n\t *\n\t * @param parameters - Universe, sorted-map, and item identifiers.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed {@link SortedMapItem}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async get(\n\t\tparameters: GetSortedMapItemParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<SortedMapItem, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: GET_SPEC });\n\t}\n\n\t/**\n\t * Lists items in a sorted map. The server caps `maxPageSize` at\n\t * `100` and defaults it to `1` when omitted, so callers explicitly\n\t * pass `maxPageSize` to retrieve more than a single item per page.\n\t * The `filter` parameter accepts a CEL expression on `id` and\n\t * `sortKey` (operators `<`, `>`, `&&` only).\n\t *\n\t * @param parameters - Universe and sorted-map identifiers, plus\n\t * optional pagination and filter parameters.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link ListSortedMapItemsResult} or the {@link OpenCloudError}\n\t * that caused the request to fail.\n\t */\n\tpublic async list(\n\t\tparameters: ListSortedMapItemsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<ListSortedMapItemsResult, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: LIST_SPEC });\n\t}\n\n\t/**\n\t * Updates a sorted-map item under PATCH semantics: omitted body\n\t * fields are left unchanged on the server, supplied fields replace\n\t * their existing values. Passing `allowMissing: true` creates the\n\t * item when no row exists instead of returning 404.\n\t *\n\t * Retries 5xx because PATCH with the same body produces the same\n\t * server state.\n\t *\n\t * @param parameters - Universe, sorted-map, and item identifiers,\n\t * plus any subset of `value`, `ttl`, `sortKey`, and\n\t * `allowMissing`.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed {@link SortedMapItem}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async update(\n\t\tparameters: UpdateSortedMapItemParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<SortedMapItem, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: UPDATE_SPEC });\n\t}\n}\n","import type { OpenCloudClientOptions } from \"../../client/types.ts\";\nimport { ResourceClient } from \"../../internal/resource-client.ts\";\nimport { MemoryStoreQueuesGroup } from \"./queues-group.ts\";\nimport { MemoryStoreSortedMapsGroup } from \"./sorted-maps-group.ts\";\n\n/**\n * Public client for the Roblox Open Cloud `Data and memory stores`\n * Feature. Today it covers memory-store queues via the\n * {@link StorageClient.queues} Operation Group and memory-store sorted\n * maps via the {@link StorageClient.sortedMaps} Operation Group; a\n * future data-stores Operation Group slots in as a sibling on the same\n * client.\n *\n * Every method returns a `Result` so callers handle failure\n * explicitly; no thrown error ever escapes the client.\n *\n * @example\n *\n * ```ts\n * import { StorageClient } from \"@bedrock-rbx/ocale/storage\";\n *\n * const client = new StorageClient({ apiKey: \"your-key\" });\n * expect(client).toBeInstanceOf(StorageClient);\n * ```\n */\nexport class StorageClient {\n\t/** Memory-store queue Operation Group. */\n\tpublic readonly queues: MemoryStoreQueuesGroup;\n\t/** Memory-store sorted-map Operation Group. */\n\tpublic readonly sortedMaps: MemoryStoreSortedMapsGroup;\n\n\t/**\n\t * Creates a new {@link StorageClient}. Configuration is frozen on\n\t * construction; per-request overrides are accepted on each method.\n\t *\n\t * @param options - Client-level configuration including the API key.\n\t */\n\tconstructor(options: OpenCloudClientOptions) {\n\t\tconst inner = new ResourceClient(options);\n\t\tthis.queues = new MemoryStoreQueuesGroup(inner);\n\t\tthis.sortedMaps = new MemoryStoreSortedMapsGroup(inner);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAiBA,SAAgB,oBAAoB,YAAqD;CACxF,MAAM,EAAE,MAAM,UAAU,SAAS,KAAK,eAAe;CACrD,MAAM,OAAgC,EAAE,MAAM;AAC9C,KAAI,aAAa,KAAA,EAChB,MAAK,cAAc;AAGpB,KAAI,QAAQ,KAAA,EACX,MAAK,SAAS,GAAG,IAAI;AAGtB,QAAO;EACN;EACA,SAAS,EAAE,gBAAgB,oBAAoB;EAC/C,QAAQ;EACR,KAAK,uBAAuB,WAAW,uBAAuB,QAAQ;EACtE;;;;;;;;;;;;;;;;AAiBF,SAAgB,oBAAoB,YAAsD;CACzF,MAAM,QAAQ,IAAI,iBAAiB;AACnC,KAAI,WAAW,UAAU,KAAA,EACxB,OAAM,OAAO,SAAS,OAAO,WAAW,MAAM,CAAC;AAGhD,KAAI,WAAW,iBAAiB,KAAA,EAC/B,OAAM,OAAO,gBAAgB,OAAO,WAAW,aAAa,CAAC;AAG9D,KAAI,WAAW,uBAAuB,KAAA,EACrC,OAAM,OAAO,sBAAsB,GAAG,WAAW,mBAAmB,GAAG;CAGxE,MAAM,cAAc,MAAM,UAAU;CACpC,MAAM,EAAE,SAAS,eAAe;CAChC,MAAM,OAAO,uBAAuB,WAAW,uBAAuB,QAAQ;AAC9E,QAAO;EACN,QAAQ;EACR,KAAK,gBAAgB,KAAK,OAAO,GAAG,KAAK,GAAG;EAC5C;;;;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,IAAa,gBAAb,MAA2B;;CAE1B;;CAEA;;;;;;;CAQA,YAAY,SAAiC;EAC5C,MAAM,QAAQ,IAAI,eAAe,QAAQ;AACzC,OAAK,SAAS,IAAI,uBAAuB,MAAM;AAC/C,OAAK,aAAa,IAAI,2BAA2B,MAAM"}
|
|
1
|
+
{"version":3,"file":"storage.mjs","names":["SECONDS_PER_MINUTE","PATH_PATTERN","makeSpec","#inner","#inner"],"sources":["../src/domains/cloud-v2/memory-store-queues/builders.ts","../src/domains/cloud-v2/memory-store-queues/operations.ts","../src/domains/cloud-v2/memory-store-queues/parsers.ts","../src/resources/storage/queues-group.ts","../src/domains/cloud-v2/memory-store-sorted-maps/builders.ts","../src/domains/cloud-v2/memory-store-sorted-maps/operations.ts","../src/domains/cloud-v2/memory-store-sorted-maps/parsers.ts","../src/resources/storage/sorted-maps-group.ts","../src/resources/storage/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../client/types.ts\";\nimport type {\n\tDequeueQueueItemsParameters,\n\tDiscardQueueItemsParameters,\n\tEnqueueQueueItemParameters,\n} from \"./types.ts\";\n\n/**\n * Builds a `POST` request for the Open Cloud\n * `Cloud_CreateMemoryStoreQueueItem` endpoint. Serializes the optional\n * `ttl` field as a Google protobuf `Duration` string in seconds (`\"30s\"`)\n * to match the wire contract.\n *\n * @param parameters - Universe and queue identifiers, the opaque payload,\n * and optional priority and TTL.\n * @returns A pure {@link HttpRequest} describing the enqueue call.\n */\nexport function buildEnqueueRequest(parameters: EnqueueQueueItemParameters): HttpRequest {\n\tconst { data, priority, queueId, ttl, universeId } = parameters;\n\tconst body: Record<string, unknown> = { data };\n\tif (priority !== undefined) {\n\t\tbody[\"priority\"] = priority;\n\t}\n\n\tif (ttl !== undefined) {\n\t\tbody[\"ttl\"] = `${ttl}s`;\n\t}\n\n\treturn {\n\t\tbody,\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${universeId}/memory-store/queues/${queueId}/items`,\n\t};\n}\n\n/**\n * Builds a `GET` request for the Open Cloud\n * `Cloud_ReadMemoryStoreQueueItems` endpoint. The `:read` suffix is a\n * custom-method marker; the call is HTTP `GET` despite the AIP-136\n * convention that custom methods use `POST`. Parameters travel as query\n * string only; there is no request body.\n *\n * `invisibilityWindow` is serialized as a Google protobuf `Duration`\n * string in seconds (`\"30s\"`), matching the wire contract.\n *\n * @param parameters - Universe and queue identifiers, plus optional\n * `count`, `allOrNothing`, and `invisibilityWindow`.\n * @returns A pure {@link HttpRequest} describing the dequeue call.\n */\nexport function buildDequeueRequest(parameters: DequeueQueueItemsParameters): HttpRequest {\n\tconst query = new URLSearchParams();\n\tif (parameters.count !== undefined) {\n\t\tquery.append(\"count\", String(parameters.count));\n\t}\n\n\tif (parameters.allOrNothing !== undefined) {\n\t\tquery.append(\"allOrNothing\", String(parameters.allOrNothing));\n\t}\n\n\tif (parameters.invisibilityWindow !== undefined) {\n\t\tquery.append(\"invisibilityWindow\", `${parameters.invisibilityWindow}s`);\n\t}\n\n\tconst queryString = query.toString();\n\tconst { queueId, universeId } = parameters;\n\tconst base = `/cloud/v2/universes/${universeId}/memory-store/queues/${queueId}/items:read`;\n\treturn {\n\t\tmethod: \"GET\",\n\t\turl: queryString === \"\" ? base : `${base}?${queryString}`,\n\t};\n}\n\n/**\n * Builds a `POST` request for the Open Cloud\n * `Cloud_DiscardMemoryStoreQueueItems` endpoint. The request body uses\n * `{ readId }`, matching the schema (the dequeue *response* uses `id`,\n * but the discard *request* matches the schema and is not patched).\n *\n * @param parameters - Universe and queue identifiers, plus the\n * `readId` returned from a prior dequeue.\n * @returns A pure {@link HttpRequest} describing the discard call.\n */\nexport function buildDiscardRequest(parameters: DiscardQueueItemsParameters): HttpRequest {\n\tconst { queueId, readId, universeId } = parameters;\n\treturn {\n\t\tbody: { readId },\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${universeId}/memory-store/queues/${queueId}/items:discard`,\n\t};\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst ENQUEUE_PER_MINUTE = 1_000_000;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for enqueueing a memory-store queue item,\n * from the Open Cloud OpenAPI schema (1,000,000 requests per minute per\n * API key owner). Keyed independently from the dequeue and discard\n * operations so the three do not share a queue; upstream quota\n * accounting is documented per-operation, and the conservative default\n * is fewer cross-method contention surprises.\n */\nexport const ENQUEUE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: ENQUEUE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-queues.enqueue\",\n});\n\n/**\n * Scopes required to enqueue a memory-store queue item, sourced from\n * `x-roblox-scopes` on the `Cloud_CreateMemoryStoreQueueItem` operation\n * in the vendored OpenAPI schema.\n */\nexport const ENQUEUE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"memory-store.queue:add\",\n]);\n\nconst DEQUEUE_PER_MINUTE = 1_000_000;\n\n/**\n * Per-second request ceiling for dequeueing memory-store queue items,\n * from the Open Cloud OpenAPI schema (1,000,000 requests per minute\n * per API key owner). Keyed independently from enqueue and discard.\n */\nexport const DEQUEUE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: DEQUEUE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-queues.dequeue\",\n});\n\n/**\n * Scopes required to dequeue memory-store queue items, sourced from\n * `x-roblox-scopes` on the `Cloud_ReadMemoryStoreQueueItems` operation\n * in the vendored OpenAPI schema.\n */\nexport const DEQUEUE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"memory-store.queue:dequeue\",\n]);\n\nconst DISCARD_PER_MINUTE = 1_000_000;\n\n/**\n * Per-second request ceiling for discarding (acknowledging) memory-store\n * queue items, from the Open Cloud OpenAPI schema (1,000,000 requests\n * per minute per API key owner). Keyed independently from enqueue and\n * dequeue.\n */\nexport const DISCARD_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: DISCARD_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-queues.discard\",\n});\n\n/**\n * Scopes required to discard memory-store queue items, sourced from\n * `x-roblox-scopes` on the `Cloud_DiscardMemoryStoreQueueItems`\n * operation in the vendored OpenAPI schema.\n */\nexport const DISCARD_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"memory-store.queue:discard\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { DequeueResult, QueueItem } from \"./types.ts\";\nimport type { MemoryStoreQueueItemWire } from \"./wire.ts\";\n\nconst PATH_PATTERN = /^cloud\\/v2\\/universes\\/(\\d+)\\/memory-store\\/queues\\/([^/]+)\\/items\\/([^/]+)$/;\nconst MALFORMED_QUEUE_ITEM_MESSAGE = \"Malformed memory-store queue item response\";\nconst MALFORMED_DEQUEUE_MESSAGE = \"Malformed memory-store dequeue response\";\n\n/**\n * Parses a successful memory-store queue-item response body (the\n * `Cloud_CreateMemoryStoreQueueItem` happy path) into the public\n * {@link QueueItem} shape.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link QueueItem}, or an\n * {@link ApiError} when the body does not match the wire schema.\n */\nexport function parseQueueItemResponse(response: HttpResponse): Result<QueueItem, ApiError> {\n\tconst item = wireBodyToQueueItem(response.body);\n\tif (item === undefined) {\n\t\treturn malformedQueueItem(response.status);\n\t}\n\n\treturn { data: item, success: true };\n}\n\n/**\n * Parses a successful `Cloud_ReadMemoryStoreQueueItems` response body\n * into the public {@link DequeueResult} shape. Each item in the\n * `queueItems` array is validated through the same path-and-shape\n * checks as {@link parseQueueItemResponse}; a malformed entry rejects\n * the whole response.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link DequeueResult},\n * or an {@link ApiError} when the response shape is wrong.\n */\nexport function parseDequeueResponse(response: HttpResponse): Result<DequeueResult, ApiError> {\n\tconst { body, status: statusCode } = response;\n\tif (!isRecord(body)) {\n\t\treturn malformedDequeue(statusCode);\n\t}\n\n\tconst { id, queueItems } = body;\n\tif (typeof id !== \"string\") {\n\t\treturn malformedDequeue(statusCode);\n\t}\n\n\tif (queueItems !== undefined && queueItems !== null && !Array.isArray(queueItems)) {\n\t\treturn malformedDequeue(statusCode);\n\t}\n\n\tconst rawItems = queueItems ?? [];\n\tconst items = rawItems.map(wireBodyToQueueItem);\n\tif (!items.every(isQueueItem)) {\n\t\treturn malformedDequeue(statusCode);\n\t}\n\n\treturn { data: { items, readId: id }, success: true };\n}\n\nfunction isQueueItemWire(body: unknown): body is MemoryStoreQueueItemWire {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\tconst { data, expireTime, path, priority } = body;\n\treturn (\n\t\ttypeof path === \"string\" &&\n\t\tisDateTimeString(expireTime) &&\n\t\tdata !== undefined &&\n\t\tdata !== null &&\n\t\t(priority === undefined || priority === null || typeof priority === \"number\")\n\t);\n}\n\nfunction wireBodyToQueueItem(body: unknown): QueueItem | undefined {\n\tif (!isQueueItemWire(body)) {\n\t\treturn undefined;\n\t}\n\n\tconst match = PATH_PATTERN.exec(body.path);\n\tconst universeId = match?.[1];\n\tconst queueId = match?.[2];\n\tconst id = match?.[3];\n\tif (universeId === undefined || queueId === undefined || id === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\tid,\n\t\tdata: body.data,\n\t\texpiresAt: new Date(body.expireTime),\n\t\tpriority: body.priority ?? undefined,\n\t\tqueueId,\n\t\tuniverseId,\n\t};\n}\n\nfunction malformedQueueItem(statusCode: number): Result<QueueItem, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_QUEUE_ITEM_MESSAGE, { statusCode }),\n\t\tsuccess: false,\n\t};\n}\n\nfunction isQueueItem(item: QueueItem | undefined): item is QueueItem {\n\treturn item !== undefined;\n}\n\nfunction malformedDequeue(statusCode: number): Result<DequeueResult, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_DEQUEUE_MESSAGE, { statusCode }),\n\t\tsuccess: false,\n\t};\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport {\n\tbuildDequeueRequest,\n\tbuildDiscardRequest,\n\tbuildEnqueueRequest,\n} from \"../../domains/cloud-v2/memory-store-queues/builders.ts\";\nimport {\n\tDEQUEUE_OPERATION_LIMIT,\n\tDEQUEUE_REQUIRED_SCOPES,\n\tDISCARD_OPERATION_LIMIT,\n\tDISCARD_REQUIRED_SCOPES,\n\tENQUEUE_OPERATION_LIMIT,\n\tENQUEUE_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/memory-store-queues/operations.ts\";\nimport {\n\tparseDequeueResponse,\n\tparseQueueItemResponse,\n} from \"../../domains/cloud-v2/memory-store-queues/parsers.ts\";\nimport type {\n\tDequeueQueueItemsParameters,\n\tDequeueResult,\n\tDiscardQueueItemsParameters,\n\tEnqueueQueueItemParameters,\n\tQueueItem,\n} from \"../../domains/cloud-v2/memory-store-queues/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS, IDEMPOTENT_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport {\n\tokRequest,\n\tparseEmptyResponse,\n\ttype ResourceClient,\n\ttype ResourceMethodSpec,\n} from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\n\nfunction makeSpec<P, R>(spec: ResourceMethodSpec<P, R>): ResourceMethodSpec<P, R> {\n\treturn Object.freeze(spec);\n}\n\nconst ENQUEUE_SPEC = makeSpec<EnqueueQueueItemParameters, QueueItem>({\n\tbuildRequest: (parameters) => okRequest(buildEnqueueRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: ENQUEUE_OPERATION_LIMIT,\n\tparse: parseQueueItemResponse,\n\trequiredScopes: ENQUEUE_REQUIRED_SCOPES,\n});\n\n// Dequeue uses HTTP GET but mutates server state via the invisibility\n// window. Retrying a 5xx where the server set invisibility before\n// failing the response would lose the original batch (it stays\n// invisible until the window elapses) and return a different one. So\n// the retry policy mirrors `create`: only 429, never 5xx.\nconst DEQUEUE_SPEC = makeSpec<DequeueQueueItemsParameters, DequeueResult>({\n\tbuildRequest: (parameters) => okRequest(buildDequeueRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: DEQUEUE_OPERATION_LIMIT,\n\tparse: parseDequeueResponse,\n\trequiredScopes: DEQUEUE_REQUIRED_SCOPES,\n});\n\nconst DISCARD_SPEC = makeSpec<DiscardQueueItemsParameters, undefined>({\n\tbuildRequest: (parameters) => okRequest(buildDiscardRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: DISCARD_OPERATION_LIMIT,\n\tparse: parseEmptyResponse,\n\trequiredScopes: DISCARD_REQUIRED_SCOPES,\n});\n\n/**\n * Operation Group on `StorageClient` that exposes the memory-store\n * queue endpoints. Queues are FIFO collections of opaque JSON values\n * with optional priority and TTL; consumers enqueue items, dequeue\n * them in batches, and acknowledge processed batches with a read\n * identifier.\n */\nexport class MemoryStoreQueuesGroup {\n\treadonly #inner: ResourceClient;\n\n\t/**\n\t * Wraps the shared {@link ResourceClient} so the Operation Group\n\t * routes calls through the same retry, hooks, and rate-limit queues\n\t * as the rest of the parent client.\n\t *\n\t * @param inner - The shared {@link ResourceClient} owned by the\n\t * parent client.\n\t */\n\tconstructor(inner: ResourceClient) {\n\t\tthis.#inner = inner;\n\t}\n\n\t/**\n\t * Dequeues up to `count` items from the front of the queue. Items\n\t * returned become invisible to subsequent reads for\n\t * `invisibilityWindow` seconds (default 30 server-side); they\n\t * reappear once the window elapses unless acknowledged via\n\t * `discard` with the returned `readId`.\n\t *\n\t * On 5xx, dequeue does not retry: the server may have set\n\t * invisibility on a batch before the response failed, so a retry\n\t * would return a *different* batch and the first one is lost until\n\t * the window expires. Callers that can detect duplicates externally\n\t * may opt back into 5xx retry per call by passing `retryableStatuses`\n\t * on `options`.\n\t *\n\t * @param parameters - Universe and queue identifiers, plus optional\n\t * `count`, `allOrNothing`, and `invisibilityWindow`.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed {@link DequeueResult}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async dequeue(\n\t\tparameters: DequeueQueueItemsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<DequeueResult, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: DEQUEUE_SPEC });\n\t}\n\n\t/**\n\t * Acknowledges a dequeued batch of items, removing them from the\n\t * queue permanently. Pass the `readId` returned from the prior\n\t * `dequeue` call. Without `discard`, the items reappear once the\n\t * invisibility window elapses.\n\t *\n\t * The call is idempotent: a second `discard` with the same `readId`\n\t * is a no-op once the batch has been acknowledged. The retry policy\n\t * therefore retries both 429 and 5xx.\n\t *\n\t * @param parameters - Universe and queue identifiers, plus the\n\t * `readId` returned from a prior dequeue.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping `undefined` on success (the\n\t * server returns an empty body) or the {@link OpenCloudError}\n\t * that caused the request to fail.\n\t */\n\tpublic async discard(\n\t\tparameters: DiscardQueueItemsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: DISCARD_SPEC });\n\t}\n\n\t/**\n\t * Enqueues a single item onto a memory-store queue. The queue is\n\t * auto-created on first use; the queue identifier is any string the\n\t * caller picks. Items with higher `priority` values are dequeued\n\t * first; equal priorities preserve insertion order. Items expire\n\t * and are removed automatically after `ttl` seconds, or after a\n\t * server-default lifetime when omitted.\n\t *\n\t * @param parameters - Universe and queue identifiers, the opaque\n\t * payload, and optional `priority` and `ttl`.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link QueueItem} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async enqueue(\n\t\tparameters: EnqueueQueueItemParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<QueueItem, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: ENQUEUE_SPEC });\n\t}\n}\n","import type { HttpRequest } from \"../../../client/types.ts\";\nimport type {\n\tCreateSortedMapItemParameters,\n\tDeleteSortedMapItemParameters,\n\tGetSortedMapItemParameters,\n\tListSortedMapItemsParameters,\n\tSortKey,\n\tUpdateSortedMapItemParameters,\n} from \"./types.ts\";\n\n/**\n * Builds a `POST` request for the Open Cloud\n * `Cloud_CreateMemoryStoreSortedMapItem` endpoint. The caller-supplied\n * `itemId` travels as the `id` query parameter (URL-encoded by\n * `URLSearchParams`); the body carries `value`, the optional `ttl`\n * (serialized as a Google protobuf `Duration` string in seconds), and\n * one of `stringSortKey`/`numericSortKey` projected from the\n * {@link SortKey} discriminated union.\n *\n * @param parameters - Universe, sorted-map, item identifiers, the\n * value to store, and optional `sortKey` and `ttl`.\n * @returns A pure {@link HttpRequest} describing the create call.\n */\nexport function buildCreateRequest(parameters: CreateSortedMapItemParameters): HttpRequest {\n\tconst { itemId, mapId, sortKey, ttl, universeId, value } = parameters;\n\tconst body: Record<string, unknown> = { value };\n\tif (ttl !== undefined) {\n\t\tbody[\"ttl\"] = `${ttl}s`;\n\t}\n\n\tapplySortKeyToBody(body, sortKey);\n\n\tconst query = new URLSearchParams({ id: itemId });\n\treturn {\n\t\tbody,\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${encodeURIComponent(universeId)}/memory-store/sorted-maps/${encodeURIComponent(mapId)}/items?${query.toString()}`,\n\t};\n}\n\n/**\n * Builds a `DELETE` request for the Open Cloud\n * `Cloud_DeleteMemoryStoreSortedMapItem` endpoint. Every path segment\n * (universe, sorted-map, item identifiers) is URL-encoded so callers\n * can pass values containing reserved characters without manual\n * escaping.\n *\n * @param parameters - Universe, sorted-map, and item identifiers.\n * @returns A pure {@link HttpRequest} describing the delete call.\n */\nexport function buildDeleteRequest(parameters: DeleteSortedMapItemParameters): HttpRequest {\n\tconst { itemId, mapId, universeId } = parameters;\n\treturn {\n\t\tmethod: \"DELETE\",\n\t\turl: `/cloud/v2/universes/${encodeURIComponent(universeId)}/memory-store/sorted-maps/${encodeURIComponent(mapId)}/items/${encodeURIComponent(itemId)}`,\n\t};\n}\n\n/**\n * Builds a `GET` request for the Open Cloud\n * `Cloud_GetMemoryStoreSortedMapItem` endpoint. Every path segment\n * (universe, sorted-map, item identifiers) is URL-encoded so callers\n * can pass values containing reserved characters without manual\n * escaping.\n *\n * @param parameters - Universe, sorted-map, and item identifiers.\n * @returns A pure {@link HttpRequest} describing the get call.\n */\nexport function buildGetRequest(parameters: GetSortedMapItemParameters): HttpRequest {\n\tconst { itemId, mapId, universeId } = parameters;\n\treturn {\n\t\tmethod: \"GET\",\n\t\turl: `/cloud/v2/universes/${encodeURIComponent(universeId)}/memory-store/sorted-maps/${encodeURIComponent(mapId)}/items/${encodeURIComponent(itemId)}`,\n\t};\n}\n\n/**\n * Builds a `GET` request for the Open Cloud\n * `Cloud_ListMemoryStoreSortedMapItems` endpoint. Optional `filter`,\n * `maxPageSize`, `orderBy`, and `pageToken` parameters travel as query\n * string parameters and are omitted when unset.\n *\n * @param parameters - Universe and sorted-map identifiers, plus\n * optional pagination and filter parameters.\n * @returns A pure {@link HttpRequest} describing the list call.\n */\nexport function buildListRequest(parameters: ListSortedMapItemsParameters): HttpRequest {\n\tconst { filter, mapId, maxPageSize, orderBy, pageToken, universeId } = parameters;\n\tconst query = new URLSearchParams();\n\tif (maxPageSize !== undefined) {\n\t\tquery.append(\"maxPageSize\", String(maxPageSize));\n\t}\n\n\tif (pageToken !== undefined) {\n\t\tquery.append(\"pageToken\", pageToken);\n\t}\n\n\tif (orderBy !== undefined) {\n\t\tquery.append(\"orderBy\", orderBy);\n\t}\n\n\tif (filter !== undefined) {\n\t\tquery.append(\"filter\", filter);\n\t}\n\n\tconst base = `/cloud/v2/universes/${encodeURIComponent(universeId)}/memory-store/sorted-maps/${encodeURIComponent(mapId)}/items`;\n\tconst queryString = query.toString();\n\treturn { method: \"GET\", url: queryString === \"\" ? base : `${base}?${queryString}` };\n}\n\n/**\n * Builds a `PATCH` request for the Open Cloud\n * `Cloud_UpdateMemoryStoreSortedMapItem` endpoint. Body fields are\n * conditionally included so a partial update sends only the changed\n * fields; the optional `allowMissing` query string drives\n * upsert-on-missing behaviour server-side.\n *\n * @param parameters - Universe, sorted-map, and item identifiers,\n * plus any subset of `value`, `ttl`, `sortKey`, and `allowMissing`.\n * @returns A pure {@link HttpRequest} describing the update call.\n */\nexport function buildUpdateRequest(parameters: UpdateSortedMapItemParameters): HttpRequest {\n\tconst { allowMissing: shouldAllowMissing, itemId, mapId, universeId } = parameters;\n\tconst base = `/cloud/v2/universes/${encodeURIComponent(universeId)}/memory-store/sorted-maps/${encodeURIComponent(mapId)}/items/${encodeURIComponent(itemId)}`;\n\tconst query = new URLSearchParams();\n\tif (shouldAllowMissing !== undefined) {\n\t\tquery.append(\"allowMissing\", String(shouldAllowMissing));\n\t}\n\n\tconst queryString = query.toString();\n\treturn {\n\t\tbody: buildUpdateBody(parameters),\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"PATCH\",\n\t\turl: queryString === \"\" ? base : `${base}?${queryString}`,\n\t};\n}\n\nfunction applySortKeyToBody(body: Record<string, unknown>, sortKey: SortKey | undefined): void {\n\tif (sortKey === undefined) {\n\t\treturn;\n\t}\n\n\tif (sortKey.kind === \"string\") {\n\t\tbody[\"stringSortKey\"] = sortKey.value;\n\t\treturn;\n\t}\n\n\tbody[\"numericSortKey\"] = sortKey.value;\n}\n\nfunction buildUpdateBody(parameters: UpdateSortedMapItemParameters): Record<string, unknown> {\n\tconst { sortKey, ttl, value } = parameters;\n\tconst body: Record<string, unknown> = {};\n\tif (value !== undefined) {\n\t\tbody[\"value\"] = value;\n\t}\n\n\tif (ttl !== undefined) {\n\t\tbody[\"ttl\"] = `${ttl}s`;\n\t}\n\n\tapplySortKeyToBody(body, sortKey);\n\treturn body;\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst CREATE_PER_MINUTE = 1_000_000;\nconst SECONDS_PER_MINUTE = 60;\n\nconst WRITE_SCOPE = \"memory-store.sorted-map:write\";\n\n/**\n * Per-second request ceiling for creating a memory-store sorted-map\n * item, from the Open Cloud OpenAPI schema (1,000,000 requests per\n * minute per API key owner). Keyed independently from the get, update,\n * delete, and list operations so the five do not share a queue.\n */\nexport const CREATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: CREATE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-sorted-maps.create\",\n});\n\n/**\n * Scopes required to create a memory-store sorted-map item, sourced\n * from `x-roblox-scopes` on the `Cloud_CreateMemoryStoreSortedMapItem`\n * operation in the vendored OpenAPI schema.\n */\nexport const CREATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([WRITE_SCOPE]);\n\nconst DELETE_PER_MINUTE = 1_000_000;\n\n/**\n * Per-second request ceiling for deleting a memory-store sorted-map\n * item, from the Open Cloud OpenAPI schema (1,000,000 requests per\n * minute per API key owner).\n */\nexport const DELETE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: DELETE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-sorted-maps.delete\",\n});\n\n/**\n * Scopes required to delete a memory-store sorted-map item, sourced\n * from `x-roblox-scopes` on the `Cloud_DeleteMemoryStoreSortedMapItem`\n * operation in the vendored OpenAPI schema.\n */\nexport const DELETE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([WRITE_SCOPE]);\n\nconst GET_PER_MINUTE = 1_000_000;\n\n/**\n * Per-second request ceiling for reading a memory-store sorted-map\n * item, from the Open Cloud OpenAPI schema (1,000,000 requests per\n * minute per API key owner).\n */\nexport const GET_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: GET_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-sorted-maps.get\",\n});\n\n/**\n * Scopes required to read a memory-store sorted-map item, sourced from\n * `x-roblox-scopes` on the `Cloud_GetMemoryStoreSortedMapItem`\n * operation in the vendored OpenAPI schema.\n */\nexport const GET_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"memory-store.sorted-map:read\",\n]);\n\nconst LIST_PER_MINUTE = 1_000_000;\n\n/**\n * Per-second request ceiling for listing memory-store sorted-map\n * items, from the Open Cloud OpenAPI schema (1,000,000 requests per\n * minute per API key owner).\n */\nexport const LIST_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: LIST_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-sorted-maps.list\",\n});\n\n/**\n * Scopes required to list memory-store sorted-map items, sourced from\n * `x-roblox-scopes` on the `Cloud_ListMemoryStoreSortedMapItems`\n * operation in the vendored OpenAPI schema.\n */\nexport const LIST_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"memory-store.sorted-map:read\",\n]);\n\nconst UPDATE_PER_MINUTE = 1_000_000;\n\n/**\n * Per-second request ceiling for updating a memory-store sorted-map\n * item, from the Open Cloud OpenAPI schema (1,000,000 requests per\n * minute per API key owner).\n */\nexport const UPDATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: UPDATE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"memory-store-sorted-maps.update\",\n});\n\n/**\n * Scopes required to update a memory-store sorted-map item, sourced\n * from `x-roblox-scopes` on the `Cloud_UpdateMemoryStoreSortedMapItem`\n * operation in the vendored OpenAPI schema.\n */\nexport const UPDATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([WRITE_SCOPE]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { ListSortedMapItemsResult, SortedMapItem, SortKey } from \"./types.ts\";\nimport type { MemoryStoreSortedMapItemWire } from \"./wire.ts\";\n\nconst PATH_PATTERN =\n\t/^cloud\\/v2\\/universes\\/(\\d+)\\/memory-stores?\\/sorted-maps\\/([^/]+)\\/items\\/([^/]+)$/;\nconst MALFORMED_MESSAGE = \"Malformed memory-store sorted-map item response\";\nconst MALFORMED_LIST_MESSAGE = \"Malformed memory-store sorted-map list response\";\n\n/**\n * Parses a successful memory-store sorted-map item response body (the\n * happy path for create, get, and update) into the public\n * {@link SortedMapItem} shape.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link SortedMapItem},\n * or an {@link ApiError} when the body does not match the wire schema.\n */\nexport function parseSortedMapItemResponse(\n\tresponse: HttpResponse,\n): Result<SortedMapItem, ApiError> {\n\tconst item = wireBodyToSortedMapItem(response.body);\n\tif (item === undefined) {\n\t\treturn malformedSortedMapItem(response.status);\n\t}\n\n\treturn { data: item, success: true };\n}\n\n/**\n * Parses a successful `Cloud_ListMemoryStoreSortedMapItems` response\n * body into the public {@link ListSortedMapItemsResult} shape. Each\n * item in the `items` array is validated through the same\n * path-and-shape checks as {@link parseSortedMapItemResponse}; a\n * malformed entry rejects the whole response.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed\n * {@link ListSortedMapItemsResult}, or an {@link ApiError} when the\n * response shape is wrong.\n */\nexport function parseListResponse(\n\tresponse: HttpResponse,\n): Result<ListSortedMapItemsResult, ApiError> {\n\tconst { body, status: statusCode } = response;\n\tif (!isRecord(body)) {\n\t\treturn malformedList(statusCode);\n\t}\n\n\tconst { items: rawItemsField, nextPageToken } = body;\n\tif (rawItemsField !== undefined && rawItemsField !== null && !Array.isArray(rawItemsField)) {\n\t\treturn malformedList(statusCode);\n\t}\n\n\tconst normalizedToken = nextPageToken ?? undefined;\n\tif (normalizedToken !== undefined && typeof normalizedToken !== \"string\") {\n\t\treturn malformedList(statusCode);\n\t}\n\n\tconst rawItems = rawItemsField ?? [];\n\tconst items = rawItems.map(wireBodyToSortedMapItem);\n\tif (!items.every(isSortedMapItem)) {\n\t\treturn malformedList(statusCode);\n\t}\n\n\treturn { data: { items, nextPageToken: normalizedToken }, success: true };\n}\n\nfunction isSortedMapItemWire(body: unknown): body is MemoryStoreSortedMapItemWire {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\tconst { id, etag, expireTime, numericSortKey, path, stringSortKey, value } = body;\n\treturn (\n\t\ttypeof path === \"string\" &&\n\t\ttypeof etag === \"string\" &&\n\t\ttypeof id === \"string\" &&\n\t\tisDateTimeString(expireTime) &&\n\t\tvalue !== undefined &&\n\t\t(stringSortKey === undefined ||\n\t\t\tstringSortKey === null ||\n\t\t\ttypeof stringSortKey === \"string\") &&\n\t\t(numericSortKey === undefined ||\n\t\t\tnumericSortKey === null ||\n\t\t\ttypeof numericSortKey === \"number\")\n\t);\n}\n\nfunction extractSortKey(body: MemoryStoreSortedMapItemWire): \"conflict\" | SortKey | undefined {\n\tconst hasStringKey = typeof body.stringSortKey === \"string\";\n\tconst hasNumericKey = typeof body.numericSortKey === \"number\";\n\tif (hasStringKey && hasNumericKey) {\n\t\treturn \"conflict\";\n\t}\n\n\tif (hasStringKey) {\n\t\treturn { kind: \"string\", value: body.stringSortKey };\n\t}\n\n\tif (hasNumericKey) {\n\t\treturn { kind: \"numeric\", value: body.numericSortKey };\n\t}\n\n\treturn undefined;\n}\n\nfunction wireBodyToSortedMapItem(body: unknown): SortedMapItem | undefined {\n\tif (!isSortedMapItemWire(body)) {\n\t\treturn undefined;\n\t}\n\n\t// Item ids round-trip URL-encoded in `path` (e.g. `name::id` arrives\n\t// as `name%3A%3Aid`), so the decoded id is read from `body.id` rather\n\t// than the regex group.\n\tconst match = PATH_PATTERN.exec(body.path);\n\tconst universeId = match?.[1];\n\tconst mapId = match?.[2];\n\tif (universeId === undefined || mapId === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst sortKey = extractSortKey(body);\n\tif (sortKey === \"conflict\") {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\tid: body.id,\n\t\tetag: body.etag,\n\t\texpiresAt: new Date(body.expireTime),\n\t\tmapId,\n\t\tsortKey,\n\t\tuniverseId,\n\t\tvalue: body.value,\n\t};\n}\n\nfunction malformedSortedMapItem(statusCode: number): Result<SortedMapItem, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_MESSAGE, { statusCode }),\n\t\tsuccess: false,\n\t};\n}\n\nfunction isSortedMapItem(item: SortedMapItem | undefined): item is SortedMapItem {\n\treturn item !== undefined;\n}\n\nfunction malformedList(statusCode: number): Result<ListSortedMapItemsResult, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_LIST_MESSAGE, { statusCode }),\n\t\tsuccess: false,\n\t};\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport {\n\tbuildCreateRequest,\n\tbuildDeleteRequest,\n\tbuildGetRequest,\n\tbuildListRequest,\n\tbuildUpdateRequest,\n} from \"../../domains/cloud-v2/memory-store-sorted-maps/builders.ts\";\nimport {\n\tCREATE_OPERATION_LIMIT,\n\tCREATE_REQUIRED_SCOPES,\n\tDELETE_OPERATION_LIMIT,\n\tDELETE_REQUIRED_SCOPES,\n\tGET_OPERATION_LIMIT,\n\tGET_REQUIRED_SCOPES,\n\tLIST_OPERATION_LIMIT,\n\tLIST_REQUIRED_SCOPES,\n\tUPDATE_OPERATION_LIMIT,\n\tUPDATE_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/memory-store-sorted-maps/operations.ts\";\nimport {\n\tparseListResponse,\n\tparseSortedMapItemResponse,\n} from \"../../domains/cloud-v2/memory-store-sorted-maps/parsers.ts\";\nimport type {\n\tCreateSortedMapItemParameters,\n\tDeleteSortedMapItemParameters,\n\tGetSortedMapItemParameters,\n\tListSortedMapItemsParameters,\n\tListSortedMapItemsResult,\n\tSortedMapItem,\n\tUpdateSortedMapItemParameters,\n} from \"../../domains/cloud-v2/memory-store-sorted-maps/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS, IDEMPOTENT_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport {\n\tokRequest,\n\tparseEmptyResponse,\n\ttype ResourceClient,\n\ttype ResourceMethodSpec,\n} from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\n\nfunction makeSpec<P, R>(spec: ResourceMethodSpec<P, R>): ResourceMethodSpec<P, R> {\n\treturn Object.freeze(spec);\n}\n\nconst CREATE_SPEC = makeSpec<CreateSortedMapItemParameters, SortedMapItem>({\n\tbuildRequest: (parameters) => okRequest(buildCreateRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: CREATE_OPERATION_LIMIT,\n\tparse: parseSortedMapItemResponse,\n\trequiredScopes: CREATE_REQUIRED_SCOPES,\n});\n\nconst DELETE_SPEC = makeSpec<DeleteSortedMapItemParameters, undefined>({\n\tbuildRequest: (parameters) => okRequest(buildDeleteRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: DELETE_OPERATION_LIMIT,\n\tparse: parseEmptyResponse,\n\trequiredScopes: DELETE_REQUIRED_SCOPES,\n});\n\nconst GET_SPEC = makeSpec<GetSortedMapItemParameters, SortedMapItem>({\n\tbuildRequest: (parameters) => okRequest(buildGetRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: GET_OPERATION_LIMIT,\n\tparse: parseSortedMapItemResponse,\n\trequiredScopes: GET_REQUIRED_SCOPES,\n});\n\nconst LIST_SPEC = makeSpec<ListSortedMapItemsParameters, ListSortedMapItemsResult>({\n\tbuildRequest: (parameters) => okRequest(buildListRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: LIST_OPERATION_LIMIT,\n\tparse: parseListResponse,\n\trequiredScopes: LIST_REQUIRED_SCOPES,\n});\n\nconst UPDATE_SPEC = makeSpec<UpdateSortedMapItemParameters, SortedMapItem>({\n\tbuildRequest: (parameters) => okRequest(buildUpdateRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: UPDATE_OPERATION_LIMIT,\n\tparse: parseSortedMapItemResponse,\n\trequiredScopes: UPDATE_REQUIRED_SCOPES,\n});\n\n/**\n * Operation Group on `StorageClient` that exposes the memory-store\n * sorted-map endpoints. Sorted maps are ordered collections of\n * (id, value, sortKey) triples; consumers create, read, update, list,\n * and delete items keyed by a caller-supplied identifier and ordered\n * by an optional string or numeric sort key.\n */\nexport class MemoryStoreSortedMapsGroup {\n\treadonly #inner: ResourceClient;\n\n\t/**\n\t * Wraps the shared {@link ResourceClient} so the Operation Group\n\t * routes calls through the same retry, hooks, and rate-limit queues\n\t * as the rest of the parent client.\n\t *\n\t * @param inner - The shared {@link ResourceClient} owned by the\n\t * parent client.\n\t */\n\tconstructor(inner: ResourceClient) {\n\t\tthis.#inner = inner;\n\t}\n\n\t/**\n\t * Creates a single item in a sorted map. The sorted map is\n\t * auto-created on first use; the map identifier is any string the\n\t * caller picks. Items are keyed by `itemId` (case-sensitive) and\n\t * ordered by an optional `sortKey`. Items expire and are removed\n\t * automatically after `ttl` seconds, or after a server-default\n\t * lifetime when omitted.\n\t *\n\t * On 5xx, create does not retry: Roblox Open Cloud has no\n\t * idempotency-key support, so a retry of a transient failure risks\n\t * producing a duplicate item.\n\t *\n\t * @param parameters - Universe, sorted-map, item identifiers, the\n\t * value to store, and optional `sortKey` and `ttl`.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link SortedMapItem}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async create(\n\t\tparameters: CreateSortedMapItemParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<SortedMapItem, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: CREATE_SPEC });\n\t}\n\n\t/**\n\t * Removes a single item from a sorted map. The call is idempotent:\n\t * a second `delete` against the same item is a no-op once the\n\t * server has dropped the row. The retry policy retries both 429\n\t * and 5xx.\n\t *\n\t * @param parameters - Universe, sorted-map, and item identifiers.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping `undefined` on success or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async delete(\n\t\tparameters: DeleteSortedMapItemParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: DELETE_SPEC });\n\t}\n\n\t/**\n\t * Reads a single item from a sorted map. Returns the parsed\n\t * {@link SortedMapItem} with the server-recorded `etag` for use in\n\t * subsequent conditional updates (once the SDK begins emitting\n\t * `If-Match`; see the package README).\n\t *\n\t * @param parameters - Universe, sorted-map, and item identifiers.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed {@link SortedMapItem}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async get(\n\t\tparameters: GetSortedMapItemParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<SortedMapItem, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: GET_SPEC });\n\t}\n\n\t/**\n\t * Lists items in a sorted map. The server caps `maxPageSize` at\n\t * `100` and defaults it to `1` when omitted, so callers explicitly\n\t * pass `maxPageSize` to retrieve more than a single item per page.\n\t * The `filter` parameter accepts a CEL expression on `id` and\n\t * `sortKey` (operators `<`, `>`, `&&` only).\n\t *\n\t * @param parameters - Universe and sorted-map identifiers, plus\n\t * optional pagination and filter parameters.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link ListSortedMapItemsResult} or the {@link OpenCloudError}\n\t * that caused the request to fail.\n\t */\n\tpublic async list(\n\t\tparameters: ListSortedMapItemsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<ListSortedMapItemsResult, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: LIST_SPEC });\n\t}\n\n\t/**\n\t * Updates a sorted-map item under PATCH semantics: omitted body\n\t * fields are left unchanged on the server, supplied fields replace\n\t * their existing values. Passing `allowMissing: true` creates the\n\t * item when no row exists instead of returning 404.\n\t *\n\t * Retries 5xx because PATCH with the same body produces the same\n\t * server state.\n\t *\n\t * @param parameters - Universe, sorted-map, and item identifiers,\n\t * plus any subset of `value`, `ttl`, `sortKey`, and\n\t * `allowMissing`.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed {@link SortedMapItem}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async update(\n\t\tparameters: UpdateSortedMapItemParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<SortedMapItem, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: UPDATE_SPEC });\n\t}\n}\n","import type { OpenCloudClientOptions } from \"../../client/types.ts\";\nimport { ResourceClient } from \"../../internal/resource-client.ts\";\nimport { MemoryStoreQueuesGroup } from \"./queues-group.ts\";\nimport { MemoryStoreSortedMapsGroup } from \"./sorted-maps-group.ts\";\n\n/**\n * Public client for the Roblox Open Cloud `Data and memory stores`\n * Feature. Today it covers memory-store queues via the\n * {@link StorageClient.queues} Operation Group and memory-store sorted\n * maps via the {@link StorageClient.sortedMaps} Operation Group; a\n * future data-stores Operation Group slots in as a sibling on the same\n * client.\n *\n * Every method returns a `Result` so callers handle failure\n * explicitly; no thrown error ever escapes the client.\n *\n * @example\n *\n * ```ts\n * import { StorageClient } from \"@bedrock-rbx/ocale/storage\";\n *\n * const client = new StorageClient({ apiKey: \"your-key\" });\n * expect(client).toBeInstanceOf(StorageClient);\n * ```\n */\nexport class StorageClient {\n\t/** Memory-store queue Operation Group. */\n\tpublic readonly queues: MemoryStoreQueuesGroup;\n\t/** Memory-store sorted-map Operation Group. */\n\tpublic readonly sortedMaps: MemoryStoreSortedMapsGroup;\n\n\t/**\n\t * Creates a new {@link StorageClient}. Configuration is frozen on\n\t * construction; per-request overrides are accepted on each method.\n\t *\n\t * @param options - Client-level configuration including the API key.\n\t */\n\tconstructor(options: OpenCloudClientOptions) {\n\t\tconst inner = new ResourceClient(options);\n\t\tthis.queues = new MemoryStoreQueuesGroup(inner);\n\t\tthis.sortedMaps = new MemoryStoreSortedMapsGroup(inner);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,oBAAoB,YAAqD;CACxF,MAAM,EAAE,MAAM,UAAU,SAAS,KAAK,eAAe;CACrD,MAAM,OAAgC,EAAE,MAAM;AAC9C,KAAI,aAAa,KAAA,EAChB,MAAK,cAAc;AAGpB,KAAI,QAAQ,KAAA,EACX,MAAK,SAAS,GAAG,IAAI;AAGtB,QAAO;EACN;EACA,SAAS,EAAE,gBAAgB,oBAAoB;EAC/C,QAAQ;EACR,KAAK,uBAAuB,WAAW,uBA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Y,QAAQ;GAAE;GAAS;GAAY,MAAM;GAAa,CAAC;;;;;;;;;;;;;CAcvE,MAAa,OACZ,YACA,SAC6C;AAC7C,SAAO,MAAA,MAAY,QAAQ;GAAE;GAAS;GAAY,MAAM;GAAa,CAAC;;;;;;;;;;;;;CAcvE,MAAa,IACZ,YACA,SACiD;AACjD,SAAO,MAAA,MAAY,QAAQ;GAAE;GAAS;GAAY,MAAM;GAAU,CAAC;;;;;;;;;;;;;;;;CAiBpE,MAAa,KACZ,YACA,SAC4D;AAC5D,SAAO,MAAA,MAAY,QAAQ;GAAE;GAAS;GAAY,MAAM;GAAW,CAAC;;;;;;;;;;;;;;;;;;CAmBrE,MAAa,OACZ,YACA,SACiD;AACjD,SAAO,MAAA,MAAY,QAAQ;GAAE;GAAS;GAAY,MAAM;GAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AChMxE,IAAa,gBAAb,MAA2B;;CAE1B;;CAEA;;;;;;;CAQA,YAAY,SAAiC;EAC5C,MAAM,QAAQ,IAAI,eAAe,QAAQ;AACzC,OAAK,SAAS,IAAI,uBAAuB,MAAM;AAC/C,OAAK,aAAa,IAAI,2BAA2B,MAAM"}
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as OpenCloudError, l as Result, n as HttpRequest, o as RequestConfig, r as HttpResponse, t as HttpClient, u as SleepFunc } from "./types-
|
|
1
|
+
import { d as OpenCloudError, l as Result, n as HttpRequest, o as RequestConfig, r as HttpResponse, t as HttpClient, u as SleepFunc } from "./types-rzs1NB-j.mjs";
|
|
2
2
|
import { r as GetGameIconResponseWire, t as GameIconListWire } from "./wire-CeL6W_V7.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/badges/badges/wire.d.ts
|
package/dist/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as NetworkError, r as ApiError, t as RateLimitError } from "./rate-limit-
|
|
1
|
+
import { n as NetworkError, r as ApiError, t as RateLimitError } from "./rate-limit-nY4BF079.mjs";
|
|
2
2
|
import { n as RBXL_SIGNATURE, t as RBXLX_SIGNATURE } from "./signatures-B5Fojgn0.mjs";
|
|
3
3
|
//#region tests/helpers/badges.ts
|
|
4
4
|
/**
|
|
@@ -179,6 +179,16 @@ interface OpenCloudClientOptions {
|
|
|
179
179
|
* method (e.g. `create` only retries `429`).
|
|
180
180
|
*/
|
|
181
181
|
readonly retryableStatuses?: ReadonlyArray<number>;
|
|
182
|
+
/**
|
|
183
|
+
* Node-style transport error codes eligible for retry when a request fails
|
|
184
|
+
* with a `NetworkError` (e.g. `["ECONNRESET", "ETIMEDOUT"]`).
|
|
185
|
+
* Defaults to the idempotent-method transient set. Create methods default
|
|
186
|
+
* to none and cannot be relaxed by a client-level value. Pass the exported
|
|
187
|
+
* `TRANSIENT_TRANSPORT_CODES` set (or your own subset) on a single call's
|
|
188
|
+
* {@link RequestOptions} to opt a create into transport retries when a
|
|
189
|
+
* duplicate resource is acceptable.
|
|
190
|
+
*/
|
|
191
|
+
readonly retryableTransportCodes?: ReadonlyArray<string>;
|
|
182
192
|
/** Fallback delay function used when no server hint is available. */
|
|
183
193
|
readonly retryDelay?: (attempt: number) => number;
|
|
184
194
|
/**
|
|
@@ -196,7 +206,7 @@ interface OpenCloudClientOptions {
|
|
|
196
206
|
* may be supplied for a single request; omitted fields fall through to the
|
|
197
207
|
* client-level defaults.
|
|
198
208
|
*/
|
|
199
|
-
type RequestOptions = Partial<Pick<OpenCloudClientOptions, "apiKey" | "baseUrl" | "maxRetries" | "retryableStatuses" | "retryDelay" | "timeout">>;
|
|
209
|
+
type RequestOptions = Partial<Pick<OpenCloudClientOptions, "apiKey" | "baseUrl" | "maxRetries" | "retryableStatuses" | "retryableTransportCodes" | "retryDelay" | "timeout">>;
|
|
200
210
|
/**
|
|
201
211
|
* Supported request body types.
|
|
202
212
|
*
|
|
@@ -211,4 +221,4 @@ type RequestOptions = Partial<Pick<OpenCloudClientOptions, "apiKey" | "baseUrl"
|
|
|
211
221
|
type HttpRequestBody = FormData | Record<string, unknown> | Uint8Array<ArrayBuffer> | undefined;
|
|
212
222
|
//#endregion
|
|
213
223
|
export { OpenCloudHooks as a, Page as c, OpenCloudError as d, OpenCloudClientOptions as i, Result as l, HttpRequest as n, RequestConfig as o, HttpResponse as r, RequestOptions as s, HttpClient as t, SleepFunc as u };
|
|
214
|
-
//# sourceMappingURL=types-
|
|
224
|
+
//# sourceMappingURL=types-rzs1NB-j.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-rzs1NB-j.d.mts","names":[],"sources":["../src/errors/base.ts","../src/internal/utils/sleep.ts","../src/types.ts","../src/client/types.ts"],"mappings":";;AAMA;;;;;cAAa,cAAA,SAAuB,KAAA;EAAA,kBACV,IAAA;AAAA;;;;KCNd,SAAA,IAAa,EAAA,aAAe,OAAA;;;;ADKxC;;;;;;;;ACLA;;;;;;;;ACiCA;;;;;;;;;;;;;;;;;KAAY,MAAA,QAAc,KAAA;EAAW,IAAA,EAAM,CAAA;EAAG,OAAA;AAAA;EAAoB,GAAA,EAAK,CAAA;EAAG,OAAA;AAAA;;;;;;;ACzB1E;;;;;;;;;;;;;;;;;AAkBA;;;UDmCiB,IAAA;;WAEP,KAAA,EAAO,aAAA,CAAc,CAAA;;WAErB,aAAA;AAAA;;;;;;UCzDO,WAAA;;WAEP,IAAA,GAAO,eAAA;EFVL;;;;;EAAA,SEgBF,OAAA,GAAU,QAAA,CAAS,MAAA;;WAEnB,MAAA;EDeE;EAAA,SCbF,GAAA;AAAA;;;;UAMO,YAAA;;;;;;WAMP,IAAA;;WAEA,OAAA,EAAS,QAAA,CAAS,MAAA;;WAElB,MAAA;AAAA;ADyBV;;;AAAA,UCnBiB,aAAA;;WAEP,MAAA;;WAEA,OAAA;;WAEA,OAAA;AAAA;;;;AAxCV;UA+CiB,UAAA;;EAEhB,OAAA,CACC,OAAA,EAAS,WAAA,EACT,MAAA,EAAQ,aAAA,GACN,OAAA,CAAQ,MAAA,CAAO,YAAA,EAAc,cAAA;AAAA;;;;;UAOhB,cAAA;;WAEP,WAAA,IAAe,MAAA;;WAEf,SAAA,IAAa,OAAA,EAAS,WAAA;;WAEtB,OAAA,IAAW,OAAA,UAAiB,KAAA,EAAO,cAAA;AAAA;AA/C7C;;;;AAAA,UAsDiB,sBAAA;;WAEP,MAAA;;WAEA,OAAA;;WAEA,KAAA,GAAQ,cAAA;EA5ClB;;;;;;;EAAA,SAoDU,UAAA,GAAa,UAAA;EA9Cb;EAAA,SAgDA,UAAA;EAzCO;;;;;EAAA,SA+CP,iBAAA,GAAoB,aAAA;;;;;;;;;;WAUpB,uBAAA,GAA0B,aAAA;;WAE1B,UAAA,IAAc,OAAA;;;;AA/CxB;;;WAsDU,KAAA,GAAQ,SAAA;;WAER,OAAA;AAAA;;;;;;KAQE,cAAA,GAAiB,OAAA,CAC5B,IAAA,CACC,sBAAA;;;AArDF;;;;;;;;;KA2EK,eAAA,GAAkB,QAAA,GAAW,MAAA,oBAA0B,UAAA,CAAW,WAAA"}
|
package/dist/universes.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as OpenCloudError, i as OpenCloudClientOptions, l as Result, s as RequestOptions } from "./types-
|
|
1
|
+
import { d as OpenCloudError, i as OpenCloudClientOptions, l as Result, s as RequestOptions } from "./types-rzs1NB-j.mjs";
|
|
2
2
|
import { i as RobloxLocale, r as RobloxLanguageCode } from "./data.generated-Cb6g6asv.mjs";
|
|
3
3
|
import { n as GameIconState } from "./wire-CeL6W_V7.mjs";
|
|
4
4
|
|
package/dist/universes.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { r as ApiError } from "./rate-limit-
|
|
2
|
-
import { t as
|
|
1
|
+
import { r as ApiError } from "./rate-limit-nY4BF079.mjs";
|
|
2
|
+
import { n as IDEMPOTENT_METHOD_DEFAULTS, t as CREATE_METHOD_DEFAULTS } from "./retry-BzX29aw_.mjs";
|
|
3
|
+
import { t as ValidationError } from "./validation-CGsK8aey.mjs";
|
|
3
4
|
import { t as toBlob } from "./to-blob-B27VhoRp.mjs";
|
|
4
|
-
import { a as
|
|
5
|
+
import { a as isDateTimeString, i as isRecord, n as okRequest, r as parseEmptyResponse, t as ResourceClient } from "./resource-client-CG9-BG81.mjs";
|
|
5
6
|
//#region src/domains/cloud-v2/universes/builders.ts
|
|
6
7
|
/**
|
|
7
8
|
* Dodges `unicorn/no-null` while still emitting a literal `null` onto
|
package/dist/universes.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universes.mjs","names":["#inner"],"sources":["../src/domains/cloud-v2/universes/builders.ts","../src/domains/cloud-v2/universes/operations.ts","../src/domains/cloud-v2/universes/parsers.ts","../src/domains/game-internationalization/game-icon/builders.ts","../src/domains/game-internationalization/game-icon/operations.ts","../src/domains/game-internationalization/game-icon/parsers.ts","../src/domains/game-internationalization/game-thumbnails/builders.ts","../src/domains/game-internationalization/game-thumbnails/operations.ts","../src/domains/game-internationalization/game-thumbnails/parsers.ts","../src/resources/universes/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../client/types.ts\";\nimport type { OpenCloudError } from \"../../../errors/base.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport { okRequest } from \"../../../internal/resource-client.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { GetUniverseParameters, UpdateUniverseParameters } from \"./types.ts\";\n\n/**\n * Dodges `unicorn/no-null` while still emitting a literal `null` onto\n * the wire, which the Open Cloud `Cloud_UpdateUniverse` endpoint\n * requires to clear a nullable field (for example disabling private\n * servers or removing a social link).\n */\nconst NULL_SENTINEL = JSON.parse(\"null\");\n\n/**\n * Builds a `GET` request for the Open Cloud \"get universe\" endpoint.\n *\n * @param parameters - The universe identifier.\n * @returns A success result wrapping the request; the builder cannot fail.\n */\nexport function buildGetRequest(\n\tparameters: GetUniverseParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest({\n\t\tmethod: \"GET\",\n\t\turl: `/cloud/v2/universes/${parameters.universeId}`,\n\t});\n}\n\n/**\n * Builds a `PATCH` request for the Open Cloud \"update universe\"\n * endpoint. Derives the `updateMask` query string from the keys\n * present on `parameters` and emits a JSON body containing those same\n * fields, translating `undefined` values to JSON `null` so Roblox\n * clears the corresponding server-side value.\n *\n * @param parameters - The universe identifier plus the fields to update.\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when no updatable fields were supplied.\n */\nexport function buildUpdateRequest(\n\tparameters: UpdateUniverseParameters,\n): Result<HttpRequest, ValidationError> {\n\tconst fieldKeys = extractUpdateFieldKeys(parameters);\n\n\tif (fieldKeys.length === 0) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Update must include at least one field\", {\n\t\t\t\tcode: \"empty_update\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst body: Record<string, unknown> = {};\n\tfor (const key of fieldKeys) {\n\t\tbody[key] = bodyValueFor(parameters, key);\n\t}\n\n\tconst updateMask = fieldKeys.join(\",\");\n\treturn {\n\t\tdata: {\n\t\t\tbody,\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tmethod: \"PATCH\",\n\t\t\turl: `/cloud/v2/universes/${parameters.universeId}?updateMask=${updateMask}`,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction extractUpdateFieldKeys(parameters: UpdateUniverseParameters): ReadonlyArray<string> {\n\treturn Object.keys(parameters).filter((key) => key !== \"universeId\");\n}\n\nfunction bodyValueFor(parameters: UpdateUniverseParameters, key: string): unknown {\n\tconst value = Reflect.get(parameters, key);\n\treturn value === undefined ? NULL_SENTINEL : value;\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst PER_MINUTE = 100;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for reading a universe, from the Open\n * Cloud OpenAPI schema (100 requests per minute per API key owner).\n */\nexport const GET_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"universes.get\",\n});\n\n/**\n * Per-second request ceiling for updating a universe, from the Open\n * Cloud OpenAPI schema (100 requests per minute per API key owner).\n * Keyed independently from {@link GET_OPERATION_LIMIT} so reads and\n * updates do not share a queue; upstream quota accounting is not\n * documented as shared and the conservative default is fewer\n * cross-method contention surprises.\n */\nexport const UPDATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"universes.update\",\n});\n\n/**\n * Scopes required to update a universe, sourced from `x-roblox-scopes`\n * on the `Cloud_UpdateUniverse` operation in the vendored OpenAPI schema.\n * `Cloud_GetUniverse` declares no scope, so the GET method intentionally\n * does not declare `requiredScopes` and a 401/403 there surfaces as a\n * generic ApiError.\n */\nexport const UPDATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"universe:write\"]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type {\n\tSocialLink,\n\tUniverse,\n\tUniverseAgeRating,\n\tUniverseOwner,\n\tUniverseVisibility,\n} from \"./types.ts\";\nimport type { AgeRatingWire, SocialLinkWire, UniverseWire, VisibilityWire } from \"./wire.ts\";\n\nconst VISIBILITY_MAP: Readonly<Record<VisibilityWire, UniverseVisibility>> = {\n\tPRIVATE: \"private\",\n\tPUBLIC: \"public\",\n\tVISIBILITY_UNSPECIFIED: \"unspecified\",\n};\n\nconst AGE_RATING_MAP: Readonly<Record<AgeRatingWire, UniverseAgeRating>> = {\n\tAGE_RATING_9_PLUS: \"9Plus\",\n\tAGE_RATING_13_PLUS: \"13Plus\",\n\tAGE_RATING_17_PLUS: \"17Plus\",\n\tAGE_RATING_ALL: \"all\",\n\tAGE_RATING_UNSPECIFIED: \"unspecified\",\n};\n\nconst MALFORMED_MESSAGE = \"Malformed universe response\";\n\ninterface ToUniverseArgs {\n\treadonly id: string;\n\treadonly body: UniverseWire;\n\treadonly owner: UniverseOwner;\n}\n\n/**\n * Parses a successful Open Cloud `Universe` response body into the\n * public {@link Universe} shape.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link Universe}, or\n * an {@link ApiError} when the body does not match the wire schema.\n */\nexport function parseUniverseResponse(response: HttpResponse): Result<Universe, ApiError> {\n\tconst { body, status: statusCode } = response;\n\n\tif (!isUniverseWire(body)) {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst ownerResult = resolveOwner(body);\n\tif (!ownerResult.success) {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst idMatch = /^universes\\/(\\d+)$/.exec(body.path);\n\tconst id = idMatch?.[1];\n\tif (id === undefined) {\n\t\treturn malformed(statusCode);\n\t}\n\n\treturn { data: toUniverse({ id, body, owner: ownerResult.data }), success: true };\n}\n\nfunction malformed(statusCode: number): Result<Universe, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_MESSAGE, { statusCode }),\n\t\tsuccess: false,\n\t};\n}\n\nfunction extractRootPlaceId(rootPlace: string | undefined): string | undefined {\n\tif (rootPlace === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst match = /\\/places\\/(\\d+)$/.exec(rootPlace);\n\treturn match?.[1];\n}\n\nfunction toSocialLink(wire: SocialLinkWire | undefined): SocialLink | undefined {\n\tif (wire === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn { title: wire.title, uri: wire.uri };\n}\n\nfunction toUniverse(args: ToUniverseArgs): Universe {\n\tconst { id, body, owner } = args;\n\treturn {\n\t\tid,\n\t\tageRating: AGE_RATING_MAP[body.ageRating],\n\t\tconsoleEnabled: body.consoleEnabled ?? false,\n\t\tcreatedAt: new Date(body.createTime),\n\t\tdescription: body.description,\n\t\tdesktopEnabled: body.desktopEnabled ?? false,\n\t\tdiscordSocialLink: toSocialLink(body.discordSocialLink),\n\t\tdisplayName: body.displayName,\n\t\tfacebookSocialLink: toSocialLink(body.facebookSocialLink),\n\t\tguildedSocialLink: toSocialLink(body.guildedSocialLink),\n\t\tmobileEnabled: body.mobileEnabled ?? false,\n\t\towner,\n\t\tprivateServerPriceRobux: body.privateServerPriceRobux ?? undefined,\n\t\trobloxGroupSocialLink: toSocialLink(body.robloxGroupSocialLink),\n\t\trootPlaceId: extractRootPlaceId(body.rootPlace),\n\t\ttabletEnabled: body.tabletEnabled ?? false,\n\t\ttwitchSocialLink: toSocialLink(body.twitchSocialLink),\n\t\ttwitterSocialLink: toSocialLink(body.twitterSocialLink),\n\t\tupdatedAt: new Date(body.updateTime),\n\t\tvisibility: VISIBILITY_MAP[body.visibility],\n\t\tvoiceChatEnabled: body.voiceChatEnabled ?? false,\n\t\tvrEnabled: body.vrEnabled ?? false,\n\t\tyoutubeSocialLink: toSocialLink(body.youtubeSocialLink),\n\t};\n}\n\nfunction isVisibilityWire(value: unknown): value is VisibilityWire {\n\treturn value === \"PRIVATE\" || value === \"PUBLIC\" || value === \"VISIBILITY_UNSPECIFIED\";\n}\n\nfunction isAgeRatingWire(value: unknown): value is AgeRatingWire {\n\treturn (\n\t\tvalue === \"AGE_RATING_13_PLUS\" ||\n\t\tvalue === \"AGE_RATING_17_PLUS\" ||\n\t\tvalue === \"AGE_RATING_9_PLUS\" ||\n\t\tvalue === \"AGE_RATING_ALL\" ||\n\t\tvalue === \"AGE_RATING_UNSPECIFIED\"\n\t);\n}\n\nfunction hasValidRequiredFields(body: Record<string, unknown>): boolean {\n\treturn (\n\t\ttypeof body[\"path\"] === \"string\" &&\n\t\tisDateTimeString(body[\"createTime\"]) &&\n\t\tisDateTimeString(body[\"updateTime\"]) &&\n\t\ttypeof body[\"displayName\"] === \"string\" &&\n\t\ttypeof body[\"description\"] === \"string\" &&\n\t\tisVisibilityWire(body[\"visibility\"]) &&\n\t\tisAgeRatingWire(body[\"ageRating\"])\n\t);\n}\n\nfunction isSocialLinkWire(value: unknown): value is SocialLinkWire {\n\tif (!isRecord(value)) {\n\t\treturn false;\n\t}\n\n\treturn typeof value[\"title\"] === \"string\" && typeof value[\"uri\"] === \"string\";\n}\n\nfunction isOptionalSocialLink(value: unknown): boolean {\n\treturn value === undefined || value === null || isSocialLinkWire(value);\n}\n\nfunction isOptionalBoolean(value: unknown): boolean {\n\treturn value === undefined || value === null || typeof value === \"boolean\";\n}\n\nfunction hasValidOptionalFields(body: Record<string, unknown>): boolean {\n\tconst priceField = body[\"privateServerPriceRobux\"] ?? undefined;\n\tif (priceField !== undefined && typeof priceField !== \"number\") {\n\t\treturn false;\n\t}\n\n\tconst rootPlace = body[\"rootPlace\"] ?? undefined;\n\tif (rootPlace !== undefined && typeof rootPlace !== \"string\") {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\tisOptionalBoolean(body[\"voiceChatEnabled\"]) &&\n\t\tisOptionalBoolean(body[\"desktopEnabled\"]) &&\n\t\tisOptionalBoolean(body[\"mobileEnabled\"]) &&\n\t\tisOptionalBoolean(body[\"tabletEnabled\"]) &&\n\t\tisOptionalBoolean(body[\"consoleEnabled\"]) &&\n\t\tisOptionalBoolean(body[\"vrEnabled\"]) &&\n\t\tisOptionalSocialLink(body[\"facebookSocialLink\"]) &&\n\t\tisOptionalSocialLink(body[\"twitterSocialLink\"]) &&\n\t\tisOptionalSocialLink(body[\"youtubeSocialLink\"]) &&\n\t\tisOptionalSocialLink(body[\"twitchSocialLink\"]) &&\n\t\tisOptionalSocialLink(body[\"discordSocialLink\"]) &&\n\t\tisOptionalSocialLink(body[\"robloxGroupSocialLink\"]) &&\n\t\tisOptionalSocialLink(body[\"guildedSocialLink\"])\n\t);\n}\n\nfunction isUniverseWire(body: unknown): body is UniverseWire {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\treturn hasValidRequiredFields(body) && hasValidOptionalFields(body);\n}\n\nfunction extractOwnerId(resourcePath: string): string | undefined {\n\tconst match = /^(?:users|groups)\\/(\\d+)$/.exec(resourcePath);\n\treturn match?.[1];\n}\n\nfunction resolveOwner(body: UniverseWire): Result<UniverseOwner, undefined> {\n\tif (typeof body.user === \"string\") {\n\t\tconst id = extractOwnerId(body.user);\n\t\tif (id !== undefined) {\n\t\t\treturn { data: { id, kind: \"user\" }, success: true };\n\t\t}\n\t}\n\n\tif (typeof body.group === \"string\") {\n\t\tconst id = extractOwnerId(body.group);\n\t\tif (id !== undefined) {\n\t\t\treturn { data: { id, kind: \"group\" }, success: true };\n\t\t}\n\t}\n\n\treturn { err: undefined, success: false };\n}\n","// The legacy `{gameId}` URL segment is in fact the universe ID; the public API\n// takes `universeId` and substitutes it into the path.\n\nimport type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { toBlob } from \"../../../internal/utils/to-blob.ts\";\nimport type {\n\tDeleteExperienceIconParameters,\n\tListExperienceIconsParameters,\n\tUploadExperienceIconParameters,\n} from \"./types.ts\";\n\n/**\n * Builds a `POST` request for the localized \"upload experience icon\"\n * endpoint. A successful upload replaces any existing icon for the same\n * `(universeId, languageCode)` pair.\n *\n * @param parameters - Universe and language identifiers plus the image\n * bytes to upload.\n * @returns A pure {@link HttpRequest} describing the upload call.\n */\nexport function buildUploadIconRequest(parameters: UploadExperienceIconParameters): HttpRequest {\n\tconst body = new FormData();\n\t// The legacy game-icon endpoint reads the upload from `request.files`.\n\tbody.append(\"request.files\", toBlob(parameters.image));\n\n\treturn {\n\t\tbody,\n\t\tmethod: \"POST\",\n\t\turl: `/legacy-game-internationalization/v1/game-icon/games/${parameters.universeId}/language-codes/${parameters.languageCode}`,\n\t};\n}\n\n/**\n * Builds a `DELETE` request for the localized \"delete experience icon\"\n * endpoint. Removing the source-language icon is rejected server-side;\n * deleting the icon for a non-source language clears that translation.\n *\n * @param parameters - Universe and language identifiers of the icon to\n * delete.\n * @returns A pure {@link HttpRequest} describing the delete call.\n */\nexport function buildDeleteIconRequest(parameters: DeleteExperienceIconParameters): HttpRequest {\n\treturn {\n\t\tmethod: \"DELETE\",\n\t\turl: `/legacy-game-internationalization/v1/game-icon/games/${parameters.universeId}/language-codes/${parameters.languageCode}`,\n\t};\n}\n\n/**\n * Builds a `GET` request for the \"list experience icons\" endpoint. The\n * server returns one entry per locale that has an icon registered.\n *\n * @param parameters - Universe identifier whose icons to list.\n * @returns A pure {@link HttpRequest} describing the list call.\n */\nexport function buildListIconsRequest(parameters: ListExperienceIconsParameters): HttpRequest {\n\treturn {\n\t\tmethod: \"GET\",\n\t\turl: `/legacy-game-internationalization/v1/game-icon/games/${parameters.universeId}`,\n\t};\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/**\n * Per-second request ceiling for every game-icon Operation bound on\n * `UniversesClient.icon`. The legacy `gameinternationalization` service caps\n * each API key at 100 requests per minute *shared across the entire service*\n * (see the `x-roblox-rate-limits` extension on every operation in the\n * vendored Open Cloud spec), so all methods queue against the same operation\n * key.\n */\nexport const ICON_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 100 / 60,\n\toperationKey: \"experience-icon\",\n});\n\n/**\n * Scopes required for every game-icon operation, sourced from\n * `x-roblox-scopes` on the legacy `gameinternationalization` icon\n * endpoints in the vendored OpenAPI schema.\n */\nexport const ICON_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"legacy-universe:manage\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { ExperienceIcon } from \"./types.ts\";\nimport type { GameIconListWire, GameIconState, GetGameIconResponseWire } from \"./wire.ts\";\n\n/**\n * Parses a successful icon-list response into a public array of\n * {@link ExperienceIcon} entries.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the converted icon list, or an\n * `ApiError` when the body does not match the wire schema.\n */\nexport function parseIconListResponse(\n\tresponse: HttpResponse,\n): Result<ReadonlyArray<ExperienceIcon>, ApiError> {\n\tconst { body, status: statusCode } = response;\n\n\tif (!isGameIconListWire(body)) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed icon list response\", { statusCode }),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn {\n\t\tdata: body.data.map(toExperienceIcon),\n\t\tsuccess: true,\n\t};\n}\n\nfunction isGameIconState(value: unknown): value is GameIconState {\n\treturn (\n\t\tvalue === \"Approved\" ||\n\t\tvalue === \"Error\" ||\n\t\tvalue === \"PendingReview\" ||\n\t\tvalue === \"Rejected\" ||\n\t\tvalue === \"UnAvailable\"\n\t);\n}\n\nfunction isGetGameIconResponseWire(value: unknown): value is GetGameIconResponseWire {\n\tif (!isRecord(value)) {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\ttypeof value[\"imageId\"] === \"string\" &&\n\t\ttypeof value[\"imageUrl\"] === \"string\" &&\n\t\ttypeof value[\"languageCode\"] === \"string\" &&\n\t\tisGameIconState(value[\"state\"])\n\t);\n}\n\nfunction isGameIconListWire(body: unknown): body is GameIconListWire {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\tconst { data } = body;\n\tif (!Array.isArray(data)) {\n\t\treturn false;\n\t}\n\n\treturn data.every(isGetGameIconResponseWire);\n}\n\nfunction toExperienceIcon(wire: GetGameIconResponseWire): ExperienceIcon {\n\treturn {\n\t\timageId: wire.imageId,\n\t\timageUrl: wire.imageUrl,\n\t\tlanguageCode: wire.languageCode,\n\t\tstate: wire.state,\n\t};\n}\n","import { ValidationError } from \"../../../errors/validation.ts\";\nimport type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { toBlob } from \"../../../internal/utils/to-blob.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type {\n\tDeleteExperienceThumbnailParameters,\n\tReorderExperienceThumbnailsParameters,\n\tUploadExperienceThumbnailParameters,\n} from \"./types.ts\";\n\ntype ParsedIdsResult = Result<ReadonlyArray<number>, ValidationError>;\n\n/**\n * Builds a `POST` request for the localized \"upload experience thumbnail\"\n * endpoint. Each successful upload appends a new entry to the carousel.\n *\n * @param parameters - Universe and language identifiers plus the image\n * bytes to upload.\n * @returns A pure {@link HttpRequest} describing the upload call.\n */\nexport function buildUploadThumbnailRequest(\n\tparameters: UploadExperienceThumbnailParameters,\n): HttpRequest {\n\tconst body = new FormData();\n\t// The legacy game-thumbnails endpoint reads the upload from\n\t// `gameThumbnailRequest.files`, distinct from game-icon's `request.files`.\n\tbody.append(\"gameThumbnailRequest.files\", toBlob(parameters.image));\n\n\treturn {\n\t\tbody,\n\t\tmethod: \"POST\",\n\t\t// The `{gameId}` URL segment in this legacy path is in fact the\n\t\t// universe ID; the package surfaces only `universeId`.\n\t\turl: `/legacy-game-internationalization/v1/game-thumbnails/games/${parameters.universeId}/language-codes/${parameters.languageCode}/image`,\n\t};\n}\n\n/**\n * Builds a `DELETE` request for the \"delete experience thumbnail\" endpoint.\n *\n * @param parameters - Universe, language, and image identifiers of the\n * thumbnail to delete.\n * @returns A pure {@link HttpRequest} describing the delete call.\n */\nexport function buildDeleteThumbnailRequest(\n\tparameters: DeleteExperienceThumbnailParameters,\n): HttpRequest {\n\treturn {\n\t\tmethod: \"DELETE\",\n\t\turl: `/legacy-game-internationalization/v1/game-thumbnails/games/${parameters.universeId}/language-codes/${parameters.languageCode}/images/${parameters.imageId}`,\n\t};\n}\n\n/**\n * Builds a `POST` request for the \"reorder experience thumbnails\" endpoint.\n * Validates each supplied image ID at the wire boundary so a typo cannot\n * silently serialize as JSON `null` and corrupt the request.\n *\n * @param parameters - Universe, language, and the desired display order.\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when `orderedImageIds` is empty or any ID is not\n * a positive integer within the safe-integer range.\n */\nexport function buildReorderThumbnailsRequest(\n\tparameters: ReorderExperienceThumbnailsParameters,\n): Result<HttpRequest, ValidationError> {\n\tconst { languageCode, orderedImageIds, universeId } = parameters;\n\n\tconst idsResult = parseOrderedImageIds(orderedImageIds);\n\tif (!idsResult.success) {\n\t\treturn idsResult;\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tbody: { mediaAssetIds: idsResult.data },\n\t\t\tmethod: \"POST\",\n\t\t\turl: `/legacy-game-internationalization/v1/game-thumbnails/games/${universeId}/language-codes/${languageCode}/images/order`,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction parseImageId(value: string): number | undefined {\n\tif (!/^[1-9]\\d*$/.test(value)) {\n\t\treturn undefined;\n\t}\n\n\tconst parsed = Number(value);\n\tif (!Number.isSafeInteger(parsed)) {\n\t\treturn undefined;\n\t}\n\n\treturn parsed;\n}\n\nfunction appendParsedId(accumulator: ParsedIdsResult, id: string): ParsedIdsResult {\n\tif (!accumulator.success) {\n\t\treturn accumulator;\n\t}\n\n\tconst parsed = parseImageId(id);\n\tif (parsed === undefined) {\n\t\treturn {\n\t\t\terr: new ValidationError(\n\t\t\t\t`orderedImageIds entry ${JSON.stringify(id)} is not a positive integer ID`,\n\t\t\t\t{ code: \"invalid_image_id\" },\n\t\t\t),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn { data: [...accumulator.data, parsed], success: true };\n}\n\nfunction parseOrderedImageIds(orderedImageIds: ReadonlyArray<string>): ParsedIdsResult {\n\tif (orderedImageIds.length === 0) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"orderedImageIds must contain at least one image ID\", {\n\t\t\t\tcode: \"empty_image_ids\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn orderedImageIds.reduce<ParsedIdsResult>(appendParsedId, { data: [], success: true });\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/**\n * Per-second request ceiling for every game-thumbnails Operation bound on\n * `UniversesClient.thumbnails`. The legacy `gameinternationalization`\n * service caps each API key at 100 requests per minute *shared across the\n * entire service* (see the `x-roblox-rate-limits` extension on every\n * operation in the vendored Open Cloud spec), so all methods queue against\n * the same operation key.\n */\nexport const THUMBNAILS_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 100 / 60,\n\toperationKey: \"experience-thumbnails\",\n});\n\n/**\n * Scopes required for every game-thumbnails operation, sourced from\n * `x-roblox-scopes` on the legacy `gameinternationalization` thumbnail\n * endpoints in the vendored OpenAPI schema.\n */\nexport const THUMBNAILS_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"legacy-universe:manage\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { UploadedExperienceThumbnail } from \"./types.ts\";\nimport type { GameThumbnailUploadWire } from \"./wire.ts\";\n\n/**\n * Parses a successful thumbnail-upload response into the public\n * {@link UploadedExperienceThumbnail} shape, returning a {@link Result}\n * so callers can handle malformed payloads without exceptions.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the converted upload, or an\n * `ApiError` when the body does not match the wire schema.\n */\nexport function parseThumbnailUploadResponse(\n\tresponse: HttpResponse,\n): Result<UploadedExperienceThumbnail, ApiError> {\n\tconst { body, status: statusCode } = response;\n\n\tif (!isGameThumbnailUploadWire(body)) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed thumbnail upload response\", { statusCode }),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn {\n\t\tdata: { mediaAssetId: body.mediaAssetId },\n\t\tsuccess: true,\n\t};\n}\n\nfunction isGameThumbnailUploadWire(body: unknown): body is GameThumbnailUploadWire {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\treturn typeof body[\"mediaAssetId\"] === \"string\";\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport { buildGetRequest, buildUpdateRequest } from \"../../domains/cloud-v2/universes/builders.ts\";\nimport {\n\tGET_OPERATION_LIMIT,\n\tUPDATE_OPERATION_LIMIT,\n\tUPDATE_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/universes/operations.ts\";\nimport { parseUniverseResponse } from \"../../domains/cloud-v2/universes/parsers.ts\";\nimport type {\n\tGetUniverseParameters,\n\tUniverse,\n\tUpdateUniverseParameters,\n} from \"../../domains/cloud-v2/universes/types.ts\";\nimport {\n\tbuildDeleteIconRequest,\n\tbuildListIconsRequest,\n\tbuildUploadIconRequest,\n} from \"../../domains/game-internationalization/game-icon/builders.ts\";\nimport {\n\tICON_OPERATION_LIMIT,\n\tICON_REQUIRED_SCOPES,\n} from \"../../domains/game-internationalization/game-icon/operations.ts\";\nimport { parseIconListResponse } from \"../../domains/game-internationalization/game-icon/parsers.ts\";\nimport type {\n\tDeleteExperienceIconParameters,\n\tExperienceIcon,\n\tListExperienceIconsParameters,\n\tUploadExperienceIconParameters,\n} from \"../../domains/game-internationalization/game-icon/types.ts\";\nimport {\n\tbuildDeleteThumbnailRequest,\n\tbuildReorderThumbnailsRequest,\n\tbuildUploadThumbnailRequest,\n} from \"../../domains/game-internationalization/game-thumbnails/builders.ts\";\nimport {\n\tTHUMBNAILS_OPERATION_LIMIT,\n\tTHUMBNAILS_REQUIRED_SCOPES,\n} from \"../../domains/game-internationalization/game-thumbnails/operations.ts\";\nimport { parseThumbnailUploadResponse } from \"../../domains/game-internationalization/game-thumbnails/parsers.ts\";\nimport type {\n\tDeleteExperienceThumbnailParameters,\n\tReorderExperienceThumbnailsParameters,\n\tUploadedExperienceThumbnail,\n\tUploadExperienceThumbnailParameters,\n} from \"../../domains/game-internationalization/game-thumbnails/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS, IDEMPOTENT_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport type { HttpRequest } from \"../../internal/http/types.ts\";\nimport {\n\tokRequest,\n\tparseEmptyResponse,\n\tResourceClient,\n\ttype ResourceMethodSpec,\n} from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\n\nconst GET_SPEC: ResourceMethodSpec<GetUniverseParameters, Universe> = Object.freeze({\n\tbuildRequest: buildGetRequest,\n\tmethodDefaults: {},\n\tmethodKind: \"idempotent\",\n\toperationLimit: GET_OPERATION_LIMIT,\n\tparse: parseUniverseResponse,\n});\n\nconst UPDATE_SPEC: ResourceMethodSpec<UpdateUniverseParameters, Universe> = Object.freeze({\n\tbuildRequest: buildUpdateRequest,\n\tmethodDefaults: {},\n\tmethodKind: \"idempotent\",\n\toperationLimit: UPDATE_OPERATION_LIMIT,\n\tparse: parseUniverseResponse,\n\trequiredScopes: UPDATE_REQUIRED_SCOPES,\n});\n\nfunction buildIconUploadOkRequest(\n\tparameters: UploadExperienceIconParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest(buildUploadIconRequest(parameters));\n}\n\nfunction buildIconDeleteOkRequest(\n\tparameters: DeleteExperienceIconParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest(buildDeleteIconRequest(parameters));\n}\n\nfunction buildIconListOkRequest(\n\tparameters: ListExperienceIconsParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest(buildListIconsRequest(parameters));\n}\n\nconst ICON_UPLOAD_SPEC: ResourceMethodSpec<UploadExperienceIconParameters, undefined> =\n\tObject.freeze({\n\t\tbuildRequest: buildIconUploadOkRequest,\n\t\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\t\tmethodKind: \"create\",\n\t\toperationLimit: ICON_OPERATION_LIMIT,\n\t\tparse: parseEmptyResponse,\n\t\trequiredScopes: ICON_REQUIRED_SCOPES,\n\t});\n\nconst ICON_DELETE_SPEC: ResourceMethodSpec<DeleteExperienceIconParameters, undefined> =\n\tObject.freeze({\n\t\tbuildRequest: buildIconDeleteOkRequest,\n\t\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\t\tmethodKind: \"idempotent\",\n\t\toperationLimit: ICON_OPERATION_LIMIT,\n\t\tparse: parseEmptyResponse,\n\t\trequiredScopes: ICON_REQUIRED_SCOPES,\n\t});\n\nconst ICON_LIST_SPEC: ResourceMethodSpec<\n\tListExperienceIconsParameters,\n\tReadonlyArray<ExperienceIcon>\n> = Object.freeze({\n\tbuildRequest: buildIconListOkRequest,\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: ICON_OPERATION_LIMIT,\n\tparse: parseIconListResponse,\n\trequiredScopes: ICON_REQUIRED_SCOPES,\n});\n\nfunction buildThumbnailUploadOkRequest(\n\tparameters: UploadExperienceThumbnailParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest(buildUploadThumbnailRequest(parameters));\n}\n\nfunction buildThumbnailDeleteOkRequest(\n\tparameters: DeleteExperienceThumbnailParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest(buildDeleteThumbnailRequest(parameters));\n}\n\nconst THUMBNAIL_UPLOAD_SPEC: ResourceMethodSpec<\n\tUploadExperienceThumbnailParameters,\n\tUploadedExperienceThumbnail\n> = Object.freeze({\n\tbuildRequest: buildThumbnailUploadOkRequest,\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: THUMBNAILS_OPERATION_LIMIT,\n\tparse: parseThumbnailUploadResponse,\n\trequiredScopes: THUMBNAILS_REQUIRED_SCOPES,\n});\n\nconst THUMBNAIL_DELETE_SPEC: ResourceMethodSpec<DeleteExperienceThumbnailParameters, undefined> =\n\tObject.freeze({\n\t\tbuildRequest: buildThumbnailDeleteOkRequest,\n\t\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\t\tmethodKind: \"idempotent\",\n\t\toperationLimit: THUMBNAILS_OPERATION_LIMIT,\n\t\tparse: parseEmptyResponse,\n\t\trequiredScopes: THUMBNAILS_REQUIRED_SCOPES,\n\t});\n\nconst THUMBNAIL_REORDER_SPEC: ResourceMethodSpec<ReorderExperienceThumbnailsParameters, undefined> =\n\tObject.freeze({\n\t\tbuildRequest: buildReorderThumbnailsRequest,\n\t\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\t\tmethodKind: \"idempotent\",\n\t\toperationLimit: THUMBNAILS_OPERATION_LIMIT,\n\t\tparse: parseEmptyResponse,\n\t\trequiredScopes: THUMBNAILS_REQUIRED_SCOPES,\n\t});\n\ninterface UniverseIconHandle {\n\t/**\n\t * Deletes the localized icon registered against a universe for a given\n\t * language. Removing the source-language icon is rejected server-side;\n\t * consumers must replace it via {@link UniverseIconHandle.upload}\n\t * instead.\n\t *\n\t * @param parameters - Universe and language identifiers of the icon to\n\t * delete.\n\t * @param options - Optional per-request overrides.\n\t * @returns A success {@link Result} with no payload, or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tdelete: (\n\t\tparameters: DeleteExperienceIconParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n\t/**\n\t * Lists every localized icon registered against an experience. The\n\t * server returns one entry per locale that has an icon registered.\n\t *\n\t * @param parameters - Universe identifier whose icons to list.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed array of\n\t * {@link ExperienceIcon} entries or the {@link OpenCloudError} that\n\t * caused the request to fail.\n\t */\n\tlist: (\n\t\tparameters: ListExperienceIconsParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<ReadonlyArray<ExperienceIcon>, OpenCloudError>>;\n\t/**\n\t * Uploads or replaces the localized icon for an experience. A\n\t * subsequent upload for the same `(universeId, languageCode)` pair\n\t * replaces the existing icon for that locale.\n\t *\n\t * @param parameters - Universe and language identifiers plus the image\n\t * bytes to upload.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A success {@link Result} with no payload, or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tupload: (\n\t\tparameters: UploadExperienceIconParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n}\n\ninterface UniverseThumbnailsHandle {\n\t/**\n\t * Deletes a single thumbnail by media asset ID. Idempotent: deleting an\n\t * already-removed thumbnail surfaces the server's 404 unchanged.\n\t *\n\t * @param parameters - Universe, language, and image identifiers of the\n\t * thumbnail to delete.\n\t * @param options - Optional per-request overrides.\n\t * @returns A success {@link Result} with no payload, or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tdelete: (\n\t\tparameters: DeleteExperienceThumbnailParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n\t/**\n\t * Reorders the localized thumbnail carousel. The supplied\n\t * `orderedImageIds` describes the desired display order from first to\n\t * last. Image IDs must be positive integers within the safe-integer\n\t * range; invalid input is rejected with a {@link OpenCloudError} of\n\t * kind `ValidationError` before any HTTP round-trip.\n\t *\n\t * @param parameters - Universe, language, and the desired display order.\n\t * @param options - Optional per-request overrides.\n\t * @returns A success {@link Result} with no payload, or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\treorder: (\n\t\tparameters: ReorderExperienceThumbnailsParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n\t/**\n\t * Uploads a new thumbnail and appends it to the localized carousel. Use\n\t * {@link UniverseThumbnailsHandle.reorder} after multiple uploads to\n\t * set the display order.\n\t *\n\t * @param parameters - Universe and language identifiers plus the image\n\t * bytes to upload.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link UploadedExperienceThumbnail} or the {@link OpenCloudError}\n\t * that caused the request to fail.\n\t */\n\tupload: (\n\t\tparameters: UploadExperienceThumbnailParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<UploadedExperienceThumbnail, OpenCloudError>>;\n}\n\n/**\n * Public client for the Roblox Open Cloud `Universe` resource. Wires\n * the request builders, the injected\n * {@link OpenCloudClientOptions.httpClient}, and the response parser\n * into a single ergonomic surface. Every method returns a\n * {@link Result} so callers handle failure explicitly; no thrown\n * {@link OpenCloudError} ever escapes the client.\n *\n * Partial updates use a Google-style `updateMask` query string derived\n * from the keys present on the update parameters. Setting a clearable\n * field (`privateServerPriceRobux` or any social link) to `undefined`\n * sends JSON `null` for that field so the server clears the\n * corresponding value.\n *\n * Localized experience-icon and experience-thumbnail Operations are\n * bound on the {@link UniversesClient.icon} and\n * {@link UniversesClient.thumbnails} Operation Groups so callers reach\n * for one client per universe.\n *\n * @example\n *\n * ```ts\n * import { UniversesClient } from \"@bedrock-rbx/ocale/universes\";\n *\n * const client = new UniversesClient({ apiKey: \"your-key\" });\n * expect(client).toBeInstanceOf(UniversesClient);\n * ```\n */\nexport class UniversesClient {\n\treadonly #inner: ResourceClient;\n\n\t/**\n\t * Operation Group exposing the localized experience-icon\n\t * Operations (`upload`, `delete`, `list`) backed by the\n\t * `legacy-game-internationalization` domain. Shares the parent\n\t * client's HTTP, rate-limit, and retry plumbing.\n\t */\n\tpublic readonly icon: UniverseIconHandle;\n\t/**\n\t * Operation Group exposing the localized experience-thumbnail\n\t * Operations (`upload`, `delete`, `reorder`) backed by the\n\t * `legacy-game-internationalization` domain. No list-thumbnails\n\t * endpoint is bridged; consumers must track uploaded\n\t * `mediaAssetId`s in their own state store to reconcile against\n\t * the existing carousel. Shares the parent client's HTTP,\n\t * rate-limit, and retry plumbing.\n\t */\n\tpublic readonly thumbnails: UniverseThumbnailsHandle;\n\n\t/**\n\t * Creates a new {@link UniversesClient}. Configuration is frozen\n\t * on construction; per-request overrides are accepted on each\n\t * method.\n\t *\n\t * @param options - Client-level configuration including the API key.\n\t */\n\tconstructor(options: OpenCloudClientOptions) {\n\t\tthis.#inner = new ResourceClient(options);\n\t\tthis.icon = createIconHandle(this.#inner);\n\t\tthis.thumbnails = createThumbnailsHandle(this.#inner);\n\t}\n\n\t/**\n\t * Fetches the current configuration of a universe.\n\t *\n\t * @param parameters - The universe identifier.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link Universe}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async get(\n\t\tparameters: GetUniverseParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<Universe, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: GET_SPEC });\n\t}\n\n\t/**\n\t * Partially updates a universe's configuration. The fields\n\t * supplied on `parameters` (excluding `universeId`) are forwarded\n\t * to the server via a Google-style `updateMask`; unmentioned\n\t * fields are left untouched.\n\t *\n\t * @param parameters - The universe identifier and the fields to\n\t * update. At least one updatable field must be supplied.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link Universe}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async update(\n\t\tparameters: UpdateUniverseParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<Universe, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: UPDATE_SPEC });\n\t}\n}\n\nfunction createIconHandle(inner: ResourceClient): UniverseIconHandle {\n\treturn {\n\t\tasync delete(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: ICON_DELETE_SPEC });\n\t\t},\n\t\tasync list(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: ICON_LIST_SPEC });\n\t\t},\n\t\tasync upload(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: ICON_UPLOAD_SPEC });\n\t\t},\n\t};\n}\n\nfunction createThumbnailsHandle(inner: ResourceClient): UniverseThumbnailsHandle {\n\treturn {\n\t\tasync delete(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: THUMBNAIL_DELETE_SPEC });\n\t\t},\n\t\tasync reorder(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: THUMBNAIL_REORDER_SPEC });\n\t\t},\n\t\tasync upload(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: THUMBNAIL_UPLOAD_SPEC });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;AAaA,MAAM,gBAAgB,KAAK,MAAM,OAAO;;;;;;;AAQxC,SAAgB,gBACf,YACsC;AACtC,QAAO,UAAU;EAChB,QAAQ;EACR,KAAK,uBAAuB,WAAW;EACvC,CAAC;;;;;;;;;;;;;AAcH,SAAgB,mBACf,YACuC;CACvC,MAAM,YAAY,uBAAuB,WAAW;AAEpD,KAAI,UAAU,WAAW,EACxB,QAAO;EACN,KAAK,IAAI,gBAAgB,0CAA0C,EAClE,MAAM,gBACN,CAAC;EACF,SAAS;EACT;CAGF,MAAM,OAAgC,EAAE;AACxC,MAAK,MAAM,OAAO,UACjB,MAAK,OAAO,aAAa,YAAY,IAAI;CAG1C,MAAM,aAAa,UAAU,KAAK,IAAI;AACtC,QAAO;EACN,MAAM;GACL;GACA,SAAS,EAAE,gBAAgB,oBAAoB;GAC/C,QAAQ;GACR,KAAK,uBAAuB,WAAW,WAAW,cAAc;GAChE;EACD,SAAS;EACT;;AAGF,SAAS,uBAAuB,YAA6D;AAC5F,QAAO,OAAO,KAAK,WAAW,CAAC,QAAQ,QAAQ,QAAQ,aAAa;;AAGrE,SAAS,aAAa,YAAsC,KAAsB;CACjF,MAAM,QAAQ,QAAQ,IAAI,YAAY,IAAI;AAC1C,QAAO,UAAU,KAAA,IAAY,gBAAgB;;;;AC5E9C,MAAM,aAAa;AACnB,MAAM,qBAAqB;;;;;AAM3B,MAAa,sBAAsC,OAAO,OAAO;CAChE,cAAc,aAAa;CAC3B,cAAc;CACd,CAAC;;;;;;;;;AAUF,MAAa,yBAAyC,OAAO,OAAO;CACnE,cAAc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AACjC,UAAO,MAAM,QAAQ;IAAE;IAAS;IAAY,MAAM;IAAkB,CAAC;;EAEtE,MAAM,KAAK,YAAY,SAAS;AAC/B,UAAO,MAAM,QAAQ;IAAE;IAAS;IAAY,MAAM;IAAgB,CAAC;;EAEpE,MAAM,OAAO,YAAY,SAAS;AACjC,UAAO,MAAM,QAAQ;IAAE;IAAS;IAAY,MAAM;IAAkB,CAAC;;EAEtE;;AAGF,SAAS,uBAAuB,OAAiD;AAChF,QAAO;EACN,MAAM,OAAO,YAAY,SAAS;AACjC,UAAO,MAAM,QAAQ;IAAE;IAAS;IAAY,MAAM;IAAuB,CAAC;;EAE3E,MAAM,QAAQ,YAAY,SAAS;AAClC,UAAO,MAAM,QAAQ;IAAE;IAAS;IAAY,MAAM;IAAwB,CAAC;;EAE5E,MAAM,OAAO,YAAY,SAAS;AACjC,UAAO,MAAM,QAAQ;IAAE;IAAS;IAAY,MAAM;IAAuB,CAAC;;EAE3E"}
|
|
1
|
+
{"version":3,"file":"universes.mjs","names":["#inner"],"sources":["../src/domains/cloud-v2/universes/builders.ts","../src/domains/cloud-v2/universes/operations.ts","../src/domains/cloud-v2/universes/parsers.ts","../src/domains/game-internationalization/game-icon/builders.ts","../src/domains/game-internationalization/game-icon/operations.ts","../src/domains/game-internationalization/game-icon/parsers.ts","../src/domains/game-internationalization/game-thumbnails/builders.ts","../src/domains/game-internationalization/game-thumbnails/operations.ts","../src/domains/game-internationalization/game-thumbnails/parsers.ts","../src/resources/universes/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../client/types.ts\";\nimport type { OpenCloudError } from \"../../../errors/base.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport { okRequest } from \"../../../internal/resource-client.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { GetUniverseParameters, UpdateUniverseParameters } from \"./types.ts\";\n\n/**\n * Dodges `unicorn/no-null` while still emitting a literal `null` onto\n * the wire, which the Open Cloud `Cloud_UpdateUniverse` endpoint\n * requires to clear a nullable field (for example disabling private\n * servers or removing a social link).\n */\nconst NULL_SENTINEL = JSON.parse(\"null\");\n\n/**\n * Builds a `GET` request for the Open Cloud \"get universe\" endpoint.\n *\n * @param parameters - The universe identifier.\n * @returns A success result wrapping the request; the builder cannot fail.\n */\nexport function buildGetRequest(\n\tparameters: GetUniverseParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest({\n\t\tmethod: \"GET\",\n\t\turl: `/cloud/v2/universes/${parameters.universeId}`,\n\t});\n}\n\n/**\n * Builds a `PATCH` request for the Open Cloud \"update universe\"\n * endpoint. Derives the `updateMask` query string from the keys\n * present on `parameters` and emits a JSON body containing those same\n * fields, translating `undefined` values to JSON `null` so Roblox\n * clears the corresponding server-side value.\n *\n * @param parameters - The universe identifier plus the fields to update.\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when no updatable fields were supplied.\n */\nexport function buildUpdateRequest(\n\tparameters: UpdateUniverseParameters,\n): Result<HttpRequest, ValidationError> {\n\tconst fieldKeys = extractUpdateFieldKeys(parameters);\n\n\tif (fieldKeys.length === 0) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Update must include at least one field\", {\n\t\t\t\tcode: \"empty_update\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst body: Record<string, unknown> = {};\n\tfor (const key of fieldKeys) {\n\t\tbody[key] = bodyValueFor(parameters, key);\n\t}\n\n\tconst updateMask = fieldKeys.join(\",\");\n\treturn {\n\t\tdata: {\n\t\t\tbody,\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tmethod: \"PATCH\",\n\t\t\turl: `/cloud/v2/universes/${parameters.universeId}?updateMask=${updateMask}`,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction extractUpdateFieldKeys(parameters: UpdateUniverseParameters): ReadonlyArray<string> {\n\treturn Object.keys(parameters).filter((key) => key !== \"universeId\");\n}\n\nfunction bodyValueFor(parameters: UpdateUniverseParameters, key: string): unknown {\n\tconst value = Reflect.get(parameters, key);\n\treturn value === undefined ? NULL_SENTINEL : value;\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst PER_MINUTE = 100;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for reading a universe, from the Open\n * Cloud OpenAPI schema (100 requests per minute per API key owner).\n */\nexport const GET_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"universes.get\",\n});\n\n/**\n * Per-second request ceiling for updating a universe, from the Open\n * Cloud OpenAPI schema (100 requests per minute per API key owner).\n * Keyed independently from {@link GET_OPERATION_LIMIT} so reads and\n * updates do not share a queue; upstream quota accounting is not\n * documented as shared and the conservative default is fewer\n * cross-method contention surprises.\n */\nexport const UPDATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"universes.update\",\n});\n\n/**\n * Scopes required to update a universe, sourced from `x-roblox-scopes`\n * on the `Cloud_UpdateUniverse` operation in the vendored OpenAPI schema.\n * `Cloud_GetUniverse` declares no scope, so the GET method intentionally\n * does not declare `requiredScopes` and a 401/403 there surfaces as a\n * generic ApiError.\n */\nexport const UPDATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"universe:write\"]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type {\n\tSocialLink,\n\tUniverse,\n\tUniverseAgeRating,\n\tUniverseOwner,\n\tUniverseVisibility,\n} from \"./types.ts\";\nimport type { AgeRatingWire, SocialLinkWire, UniverseWire, VisibilityWire } from \"./wire.ts\";\n\nconst VISIBILITY_MAP: Readonly<Record<VisibilityWire, UniverseVisibility>> = {\n\tPRIVATE: \"private\",\n\tPUBLIC: \"public\",\n\tVISIBILITY_UNSPECIFIED: \"unspecified\",\n};\n\nconst AGE_RATING_MAP: Readonly<Record<AgeRatingWire, UniverseAgeRating>> = {\n\tAGE_RATING_9_PLUS: \"9Plus\",\n\tAGE_RATING_13_PLUS: \"13Plus\",\n\tAGE_RATING_17_PLUS: \"17Plus\",\n\tAGE_RATING_ALL: \"all\",\n\tAGE_RATING_UNSPECIFIED: \"unspecified\",\n};\n\nconst MALFORMED_MESSAGE = \"Malformed universe response\";\n\ninterface ToUniverseArgs {\n\treadonly id: string;\n\treadonly body: UniverseWire;\n\treadonly owner: UniverseOwner;\n}\n\n/**\n * Parses a successful Open Cloud `Universe` response body into the\n * public {@link Universe} shape.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link Universe}, or\n * an {@link ApiError} when the body does not match the wire schema.\n */\nexport function parseUniverseResponse(response: HttpResponse): Result<Universe, ApiError> {\n\tconst { body, status: statusCode } = response;\n\n\tif (!isUniverseWire(body)) {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst ownerResult = resolveOwner(body);\n\tif (!ownerResult.success) {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst idMatch = /^universes\\/(\\d+)$/.exec(body.path);\n\tconst id = idMatch?.[1];\n\tif (id === undefined) {\n\t\treturn malformed(statusCode);\n\t}\n\n\treturn { data: toUniverse({ id, body, owner: ownerResult.data }), success: true };\n}\n\nfunction malformed(statusCode: number): Result<Universe, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_MESSAGE, { statusCode }),\n\t\tsuccess: false,\n\t};\n}\n\nfunction extractRootPlaceId(rootPlace: string | undefined): string | undefined {\n\tif (rootPlace === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst match = /\\/places\\/(\\d+)$/.exec(rootPlace);\n\treturn match?.[1];\n}\n\nfunction toSocialLink(wire: SocialLinkWire | undefined): SocialLink | undefined {\n\tif (wire === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn { title: wire.title, uri: wire.uri };\n}\n\nfunction toUniverse(args: ToUniverseArgs): Universe {\n\tconst { id, body, owner } = args;\n\treturn {\n\t\tid,\n\t\tageRating: AGE_RATING_MAP[body.ageRating],\n\t\tconsoleEnabled: body.consoleEnabled ?? false,\n\t\tcreatedAt: new Date(body.createTime),\n\t\tdescription: body.description,\n\t\tdesktopEnabled: body.desktopEnabled ?? false,\n\t\tdiscordSocialLink: toSocialLink(body.discordSocialLink),\n\t\tdisplayName: body.displayName,\n\t\tfacebookSocialLink: toSocialLink(body.facebookSocialLink),\n\t\tguildedSocialLink: toSocialLink(body.guildedSocialLink),\n\t\tmobileEnabled: body.mobileEnabled ?? false,\n\t\towner,\n\t\tprivateServerPriceRobux: body.privateServerPriceRobux ?? undefined,\n\t\trobloxGroupSocialLink: toSocialLink(body.robloxGroupSocialLink),\n\t\trootPlaceId: extractRootPlaceId(body.rootPlace),\n\t\ttabletEnabled: body.tabletEnabled ?? false,\n\t\ttwitchSocialLink: toSocialLink(body.twitchSocialLink),\n\t\ttwitterSocialLink: toSocialLink(body.twitterSocialLink),\n\t\tupdatedAt: new Date(body.updateTime),\n\t\tvisibility: VISIBILITY_MAP[body.visibility],\n\t\tvoiceChatEnabled: body.voiceChatEnabled ?? false,\n\t\tvrEnabled: body.vrEnabled ?? false,\n\t\tyoutubeSocialLink: toSocialLink(body.youtubeSocialLink),\n\t};\n}\n\nfunction isVisibilityWire(value: unknown): value is VisibilityWire {\n\treturn value === \"PRIVATE\" || value === \"PUBLIC\" || value === \"VISIBILITY_UNSPECIFIED\";\n}\n\nfunction isAgeRatingWire(value: unknown): value is AgeRatingWire {\n\treturn (\n\t\tvalue === \"AGE_RATING_13_PLUS\" ||\n\t\tvalue === \"AGE_RATING_17_PLUS\" ||\n\t\tvalue === \"AGE_RATING_9_PLUS\" ||\n\t\tvalue === \"AGE_RATING_ALL\" ||\n\t\tvalue === \"AGE_RATING_UNSPECIFIED\"\n\t);\n}\n\nfunction hasValidRequiredFields(body: Record<string, unknown>): boolean {\n\treturn (\n\t\ttypeof body[\"path\"] === \"string\" &&\n\t\tisDateTimeString(body[\"createTime\"]) &&\n\t\tisDateTimeString(body[\"updateTime\"]) &&\n\t\ttypeof body[\"displayName\"] === \"string\" &&\n\t\ttypeof body[\"description\"] === \"string\" &&\n\t\tisVisibilityWire(body[\"visibility\"]) &&\n\t\tisAgeRatingWire(body[\"ageRating\"])\n\t);\n}\n\nfunction isSocialLinkWire(value: unknown): value is SocialLinkWire {\n\tif (!isRecord(value)) {\n\t\treturn false;\n\t}\n\n\treturn typeof value[\"title\"] === \"string\" && typeof value[\"uri\"] === \"string\";\n}\n\nfunction isOptionalSocialLink(value: unknown): boolean {\n\treturn value === undefined || value === null || isSocialLinkWire(value);\n}\n\nfunction isOptionalBoolean(value: unknown): boolean {\n\treturn value === undefined || value === null || typeof value === \"boolean\";\n}\n\nfunction hasValidOptionalFields(body: Record<string, unknown>): boolean {\n\tconst priceField = body[\"privateServerPriceRobux\"] ?? undefined;\n\tif (priceField !== undefined && typeof priceField !== \"number\") {\n\t\treturn false;\n\t}\n\n\tconst rootPlace = body[\"rootPlace\"] ?? undefined;\n\tif (rootPlace !== undefined && typeof rootPlace !== \"string\") {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\tisOptionalBoolean(body[\"voiceChatEnabled\"]) &&\n\t\tisOptionalBoolean(body[\"desktopEnabled\"]) &&\n\t\tisOptionalBoolean(body[\"mobileEnabled\"]) &&\n\t\tisOptionalBoolean(body[\"tabletEnabled\"]) &&\n\t\tisOptionalBoolean(body[\"consoleEnabled\"]) &&\n\t\tisOptionalBoolean(body[\"vrEnabled\"]) &&\n\t\tisOptionalSocialLink(body[\"facebookSocialLink\"]) &&\n\t\tisOptionalSocialLink(body[\"twitterSocialLink\"]) &&\n\t\tisOptionalSocialLink(body[\"youtubeSocialLink\"]) &&\n\t\tisOptionalSocialLink(body[\"twitchSocialLink\"]) &&\n\t\tisOptionalSocialLink(body[\"discordSocialLink\"]) &&\n\t\tisOptionalSocialLink(body[\"robloxGroupSocialLink\"]) &&\n\t\tisOptionalSocialLink(body[\"guildedSocialLink\"])\n\t);\n}\n\nfunction isUniverseWire(body: unknown): body is UniverseWire {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\treturn hasValidRequiredFields(body) && hasValidOptionalFields(body);\n}\n\nfunction extractOwnerId(resourcePath: string): string | undefined {\n\tconst match = /^(?:users|groups)\\/(\\d+)$/.exec(resourcePath);\n\treturn match?.[1];\n}\n\nfunction resolveOwner(body: UniverseWire): Result<UniverseOwner, undefined> {\n\tif (typeof body.user === \"string\") {\n\t\tconst id = extractOwnerId(body.user);\n\t\tif (id !== undefined) {\n\t\t\treturn { data: { id, kind: \"user\" }, success: true };\n\t\t}\n\t}\n\n\tif (typeof body.group === \"string\") {\n\t\tconst id = extractOwnerId(body.group);\n\t\tif (id !== undefined) {\n\t\t\treturn { data: { id, kind: \"group\" }, success: true };\n\t\t}\n\t}\n\n\treturn { err: undefined, success: false };\n}\n","// The legacy `{gameId}` URL segment is in fact the universe ID; the public API\n// takes `universeId` and substitutes it into the path.\n\nimport type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { toBlob } from \"../../../internal/utils/to-blob.ts\";\nimport type {\n\tDeleteExperienceIconParameters,\n\tListExperienceIconsParameters,\n\tUploadExperienceIconParameters,\n} from \"./types.ts\";\n\n/**\n * Builds a `POST` request for the localized \"upload experience icon\"\n * endpoint. A successful upload replaces any existing icon for the same\n * `(universeId, languageCode)` pair.\n *\n * @param parameters - Universe and language identifiers plus the image\n * bytes to upload.\n * @returns A pure {@link HttpRequest} describing the upload call.\n */\nexport function buildUploadIconRequest(parameters: UploadExperienceIconParameters): HttpRequest {\n\tconst body = new FormData();\n\t// The legacy game-icon endpoint reads the upload from `request.files`.\n\tbody.append(\"request.files\", toBlob(parameters.image));\n\n\treturn {\n\t\tbody,\n\t\tmethod: \"POST\",\n\t\turl: `/legacy-game-internationalization/v1/game-icon/games/${parameters.universeId}/language-codes/${parameters.languageCode}`,\n\t};\n}\n\n/**\n * Builds a `DELETE` request for the localized \"delete experience icon\"\n * endpoint. Removing the source-language icon is rejected server-side;\n * deleting the icon for a non-source language clears that translation.\n *\n * @param parameters - Universe and language identifiers of the icon to\n * delete.\n * @returns A pure {@link HttpRequest} describing the delete call.\n */\nexport function buildDeleteIconRequest(parameters: DeleteExperienceIconParameters): HttpRequest {\n\treturn {\n\t\tmethod: \"DELETE\",\n\t\turl: `/legacy-game-internationalization/v1/game-icon/games/${parameters.universeId}/language-codes/${parameters.languageCode}`,\n\t};\n}\n\n/**\n * Builds a `GET` request for the \"list experience icons\" endpoint. The\n * server returns one entry per locale that has an icon registered.\n *\n * @param parameters - Universe identifier whose icons to list.\n * @returns A pure {@link HttpRequest} describing the list call.\n */\nexport function buildListIconsRequest(parameters: ListExperienceIconsParameters): HttpRequest {\n\treturn {\n\t\tmethod: \"GET\",\n\t\turl: `/legacy-game-internationalization/v1/game-icon/games/${parameters.universeId}`,\n\t};\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/**\n * Per-second request ceiling for every game-icon Operation bound on\n * `UniversesClient.icon`. The legacy `gameinternationalization` service caps\n * each API key at 100 requests per minute *shared across the entire service*\n * (see the `x-roblox-rate-limits` extension on every operation in the\n * vendored Open Cloud spec), so all methods queue against the same operation\n * key.\n */\nexport const ICON_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 100 / 60,\n\toperationKey: \"experience-icon\",\n});\n\n/**\n * Scopes required for every game-icon operation, sourced from\n * `x-roblox-scopes` on the legacy `gameinternationalization` icon\n * endpoints in the vendored OpenAPI schema.\n */\nexport const ICON_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"legacy-universe:manage\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { ExperienceIcon } from \"./types.ts\";\nimport type { GameIconListWire, GameIconState, GetGameIconResponseWire } from \"./wire.ts\";\n\n/**\n * Parses a successful icon-list response into a public array of\n * {@link ExperienceIcon} entries.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the converted icon list, or an\n * `ApiError` when the body does not match the wire schema.\n */\nexport function parseIconListResponse(\n\tresponse: HttpResponse,\n): Result<ReadonlyArray<ExperienceIcon>, ApiError> {\n\tconst { body, status: statusCode } = response;\n\n\tif (!isGameIconListWire(body)) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed icon list response\", { statusCode }),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn {\n\t\tdata: body.data.map(toExperienceIcon),\n\t\tsuccess: true,\n\t};\n}\n\nfunction isGameIconState(value: unknown): value is GameIconState {\n\treturn (\n\t\tvalue === \"Approved\" ||\n\t\tvalue === \"Error\" ||\n\t\tvalue === \"PendingReview\" ||\n\t\tvalue === \"Rejected\" ||\n\t\tvalue === \"UnAvailable\"\n\t);\n}\n\nfunction isGetGameIconResponseWire(value: unknown): value is GetGameIconResponseWire {\n\tif (!isRecord(value)) {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\ttypeof value[\"imageId\"] === \"string\" &&\n\t\ttypeof value[\"imageUrl\"] === \"string\" &&\n\t\ttypeof value[\"languageCode\"] === \"string\" &&\n\t\tisGameIconState(value[\"state\"])\n\t);\n}\n\nfunction isGameIconListWire(body: unknown): body is GameIconListWire {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\tconst { data } = body;\n\tif (!Array.isArray(data)) {\n\t\treturn false;\n\t}\n\n\treturn data.every(isGetGameIconResponseWire);\n}\n\nfunction toExperienceIcon(wire: GetGameIconResponseWire): ExperienceIcon {\n\treturn {\n\t\timageId: wire.imageId,\n\t\timageUrl: wire.imageUrl,\n\t\tlanguageCode: wire.languageCode,\n\t\tstate: wire.state,\n\t};\n}\n","import { ValidationError } from \"../../../errors/validation.ts\";\nimport type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { toBlob } from \"../../../internal/utils/to-blob.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type {\n\tDeleteExperienceThumbnailParameters,\n\tReorderExperienceThumbnailsParameters,\n\tUploadExperienceThumbnailParameters,\n} from \"./types.ts\";\n\ntype ParsedIdsResult = Result<ReadonlyArray<number>, ValidationError>;\n\n/**\n * Builds a `POST` request for the localized \"upload experience thumbnail\"\n * endpoint. Each successful upload appends a new entry to the carousel.\n *\n * @param parameters - Universe and language identifiers plus the image\n * bytes to upload.\n * @returns A pure {@link HttpRequest} describing the upload call.\n */\nexport function buildUploadThumbnailRequest(\n\tparameters: UploadExperienceThumbnailParameters,\n): HttpRequest {\n\tconst body = new FormData();\n\t// The legacy game-thumbnails endpoint reads the upload from\n\t// `gameThumbnailRequest.files`, distinct from game-icon's `request.files`.\n\tbody.append(\"gameThumbnailRequest.files\", toBlob(parameters.image));\n\n\treturn {\n\t\tbody,\n\t\tmethod: \"POST\",\n\t\t// The `{gameId}` URL segment in this legacy path is in fact the\n\t\t// universe ID; the package surfaces only `universeId`.\n\t\turl: `/legacy-game-internationalization/v1/game-thumbnails/games/${parameters.universeId}/language-codes/${parameters.languageCode}/image`,\n\t};\n}\n\n/**\n * Builds a `DELETE` request for the \"delete experience thumbnail\" endpoint.\n *\n * @param parameters - Universe, language, and image identifiers of the\n * thumbnail to delete.\n * @returns A pure {@link HttpRequest} describing the delete call.\n */\nexport function buildDeleteThumbnailRequest(\n\tparameters: DeleteExperienceThumbnailParameters,\n): HttpRequest {\n\treturn {\n\t\tmethod: \"DELETE\",\n\t\turl: `/legacy-game-internationalization/v1/game-thumbnails/games/${parameters.universeId}/language-codes/${parameters.languageCode}/images/${parameters.imageId}`,\n\t};\n}\n\n/**\n * Builds a `POST` request for the \"reorder experience thumbnails\" endpoint.\n * Validates each supplied image ID at the wire boundary so a typo cannot\n * silently serialize as JSON `null` and corrupt the request.\n *\n * @param parameters - Universe, language, and the desired display order.\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when `orderedImageIds` is empty or any ID is not\n * a positive integer within the safe-integer range.\n */\nexport function buildReorderThumbnailsRequest(\n\tparameters: ReorderExperienceThumbnailsParameters,\n): Result<HttpRequest, ValidationError> {\n\tconst { languageCode, orderedImageIds, universeId } = parameters;\n\n\tconst idsResult = parseOrderedImageIds(orderedImageIds);\n\tif (!idsResult.success) {\n\t\treturn idsResult;\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tbody: { mediaAssetIds: idsResult.data },\n\t\t\tmethod: \"POST\",\n\t\t\turl: `/legacy-game-internationalization/v1/game-thumbnails/games/${universeId}/language-codes/${languageCode}/images/order`,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction parseImageId(value: string): number | undefined {\n\tif (!/^[1-9]\\d*$/.test(value)) {\n\t\treturn undefined;\n\t}\n\n\tconst parsed = Number(value);\n\tif (!Number.isSafeInteger(parsed)) {\n\t\treturn undefined;\n\t}\n\n\treturn parsed;\n}\n\nfunction appendParsedId(accumulator: ParsedIdsResult, id: string): ParsedIdsResult {\n\tif (!accumulator.success) {\n\t\treturn accumulator;\n\t}\n\n\tconst parsed = parseImageId(id);\n\tif (parsed === undefined) {\n\t\treturn {\n\t\t\terr: new ValidationError(\n\t\t\t\t`orderedImageIds entry ${JSON.stringify(id)} is not a positive integer ID`,\n\t\t\t\t{ code: \"invalid_image_id\" },\n\t\t\t),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn { data: [...accumulator.data, parsed], success: true };\n}\n\nfunction parseOrderedImageIds(orderedImageIds: ReadonlyArray<string>): ParsedIdsResult {\n\tif (orderedImageIds.length === 0) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"orderedImageIds must contain at least one image ID\", {\n\t\t\t\tcode: \"empty_image_ids\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn orderedImageIds.reduce<ParsedIdsResult>(appendParsedId, { data: [], success: true });\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/**\n * Per-second request ceiling for every game-thumbnails Operation bound on\n * `UniversesClient.thumbnails`. The legacy `gameinternationalization`\n * service caps each API key at 100 requests per minute *shared across the\n * entire service* (see the `x-roblox-rate-limits` extension on every\n * operation in the vendored Open Cloud spec), so all methods queue against\n * the same operation key.\n */\nexport const THUMBNAILS_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 100 / 60,\n\toperationKey: \"experience-thumbnails\",\n});\n\n/**\n * Scopes required for every game-thumbnails operation, sourced from\n * `x-roblox-scopes` on the legacy `gameinternationalization` thumbnail\n * endpoints in the vendored OpenAPI schema.\n */\nexport const THUMBNAILS_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"legacy-universe:manage\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { UploadedExperienceThumbnail } from \"./types.ts\";\nimport type { GameThumbnailUploadWire } from \"./wire.ts\";\n\n/**\n * Parses a successful thumbnail-upload response into the public\n * {@link UploadedExperienceThumbnail} shape, returning a {@link Result}\n * so callers can handle malformed payloads without exceptions.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the converted upload, or an\n * `ApiError` when the body does not match the wire schema.\n */\nexport function parseThumbnailUploadResponse(\n\tresponse: HttpResponse,\n): Result<UploadedExperienceThumbnail, ApiError> {\n\tconst { body, status: statusCode } = response;\n\n\tif (!isGameThumbnailUploadWire(body)) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed thumbnail upload response\", { statusCode }),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn {\n\t\tdata: { mediaAssetId: body.mediaAssetId },\n\t\tsuccess: true,\n\t};\n}\n\nfunction isGameThumbnailUploadWire(body: unknown): body is GameThumbnailUploadWire {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\treturn typeof body[\"mediaAssetId\"] === \"string\";\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport { buildGetRequest, buildUpdateRequest } from \"../../domains/cloud-v2/universes/builders.ts\";\nimport {\n\tGET_OPERATION_LIMIT,\n\tUPDATE_OPERATION_LIMIT,\n\tUPDATE_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/universes/operations.ts\";\nimport { parseUniverseResponse } from \"../../domains/cloud-v2/universes/parsers.ts\";\nimport type {\n\tGetUniverseParameters,\n\tUniverse,\n\tUpdateUniverseParameters,\n} from \"../../domains/cloud-v2/universes/types.ts\";\nimport {\n\tbuildDeleteIconRequest,\n\tbuildListIconsRequest,\n\tbuildUploadIconRequest,\n} from \"../../domains/game-internationalization/game-icon/builders.ts\";\nimport {\n\tICON_OPERATION_LIMIT,\n\tICON_REQUIRED_SCOPES,\n} from \"../../domains/game-internationalization/game-icon/operations.ts\";\nimport { parseIconListResponse } from \"../../domains/game-internationalization/game-icon/parsers.ts\";\nimport type {\n\tDeleteExperienceIconParameters,\n\tExperienceIcon,\n\tListExperienceIconsParameters,\n\tUploadExperienceIconParameters,\n} from \"../../domains/game-internationalization/game-icon/types.ts\";\nimport {\n\tbuildDeleteThumbnailRequest,\n\tbuildReorderThumbnailsRequest,\n\tbuildUploadThumbnailRequest,\n} from \"../../domains/game-internationalization/game-thumbnails/builders.ts\";\nimport {\n\tTHUMBNAILS_OPERATION_LIMIT,\n\tTHUMBNAILS_REQUIRED_SCOPES,\n} from \"../../domains/game-internationalization/game-thumbnails/operations.ts\";\nimport { parseThumbnailUploadResponse } from \"../../domains/game-internationalization/game-thumbnails/parsers.ts\";\nimport type {\n\tDeleteExperienceThumbnailParameters,\n\tReorderExperienceThumbnailsParameters,\n\tUploadedExperienceThumbnail,\n\tUploadExperienceThumbnailParameters,\n} from \"../../domains/game-internationalization/game-thumbnails/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS, IDEMPOTENT_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport type { HttpRequest } from \"../../internal/http/types.ts\";\nimport {\n\tokRequest,\n\tparseEmptyResponse,\n\tResourceClient,\n\ttype ResourceMethodSpec,\n} from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\n\nconst GET_SPEC: ResourceMethodSpec<GetUniverseParameters, Universe> = Object.freeze({\n\tbuildRequest: buildGetRequest,\n\tmethodDefaults: {},\n\tmethodKind: \"idempotent\",\n\toperationLimit: GET_OPERATION_LIMIT,\n\tparse: parseUniverseResponse,\n});\n\nconst UPDATE_SPEC: ResourceMethodSpec<UpdateUniverseParameters, Universe> = Object.freeze({\n\tbuildRequest: buildUpdateRequest,\n\tmethodDefaults: {},\n\tmethodKind: \"idempotent\",\n\toperationLimit: UPDATE_OPERATION_LIMIT,\n\tparse: parseUniverseResponse,\n\trequiredScopes: UPDATE_REQUIRED_SCOPES,\n});\n\nfunction buildIconUploadOkRequest(\n\tparameters: UploadExperienceIconParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest(buildUploadIconRequest(parameters));\n}\n\nfunction buildIconDeleteOkRequest(\n\tparameters: DeleteExperienceIconParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest(buildDeleteIconRequest(parameters));\n}\n\nfunction buildIconListOkRequest(\n\tparameters: ListExperienceIconsParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest(buildListIconsRequest(parameters));\n}\n\nconst ICON_UPLOAD_SPEC: ResourceMethodSpec<UploadExperienceIconParameters, undefined> =\n\tObject.freeze({\n\t\tbuildRequest: buildIconUploadOkRequest,\n\t\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\t\tmethodKind: \"create\",\n\t\toperationLimit: ICON_OPERATION_LIMIT,\n\t\tparse: parseEmptyResponse,\n\t\trequiredScopes: ICON_REQUIRED_SCOPES,\n\t});\n\nconst ICON_DELETE_SPEC: ResourceMethodSpec<DeleteExperienceIconParameters, undefined> =\n\tObject.freeze({\n\t\tbuildRequest: buildIconDeleteOkRequest,\n\t\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\t\tmethodKind: \"idempotent\",\n\t\toperationLimit: ICON_OPERATION_LIMIT,\n\t\tparse: parseEmptyResponse,\n\t\trequiredScopes: ICON_REQUIRED_SCOPES,\n\t});\n\nconst ICON_LIST_SPEC: ResourceMethodSpec<\n\tListExperienceIconsParameters,\n\tReadonlyArray<ExperienceIcon>\n> = Object.freeze({\n\tbuildRequest: buildIconListOkRequest,\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: ICON_OPERATION_LIMIT,\n\tparse: parseIconListResponse,\n\trequiredScopes: ICON_REQUIRED_SCOPES,\n});\n\nfunction buildThumbnailUploadOkRequest(\n\tparameters: UploadExperienceThumbnailParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest(buildUploadThumbnailRequest(parameters));\n}\n\nfunction buildThumbnailDeleteOkRequest(\n\tparameters: DeleteExperienceThumbnailParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest(buildDeleteThumbnailRequest(parameters));\n}\n\nconst THUMBNAIL_UPLOAD_SPEC: ResourceMethodSpec<\n\tUploadExperienceThumbnailParameters,\n\tUploadedExperienceThumbnail\n> = Object.freeze({\n\tbuildRequest: buildThumbnailUploadOkRequest,\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: THUMBNAILS_OPERATION_LIMIT,\n\tparse: parseThumbnailUploadResponse,\n\trequiredScopes: THUMBNAILS_REQUIRED_SCOPES,\n});\n\nconst THUMBNAIL_DELETE_SPEC: ResourceMethodSpec<DeleteExperienceThumbnailParameters, undefined> =\n\tObject.freeze({\n\t\tbuildRequest: buildThumbnailDeleteOkRequest,\n\t\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\t\tmethodKind: \"idempotent\",\n\t\toperationLimit: THUMBNAILS_OPERATION_LIMIT,\n\t\tparse: parseEmptyResponse,\n\t\trequiredScopes: THUMBNAILS_REQUIRED_SCOPES,\n\t});\n\nconst THUMBNAIL_REORDER_SPEC: ResourceMethodSpec<ReorderExperienceThumbnailsParameters, undefined> =\n\tObject.freeze({\n\t\tbuildRequest: buildReorderThumbnailsRequest,\n\t\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\t\tmethodKind: \"idempotent\",\n\t\toperationLimit: THUMBNAILS_OPERATION_LIMIT,\n\t\tparse: parseEmptyResponse,\n\t\trequiredScopes: THUMBNAILS_REQUIRED_SCOPES,\n\t});\n\ninterface UniverseIconHandle {\n\t/**\n\t * Deletes the localized icon registered against a universe for a given\n\t * language. Removing the source-language icon is rejected server-side;\n\t * consumers must replace it via {@link UniverseIconHandle.upload}\n\t * instead.\n\t *\n\t * @param parameters - Universe and language identifiers of the icon to\n\t * delete.\n\t * @param options - Optional per-request overrides.\n\t * @returns A success {@link Result} with no payload, or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tdelete: (\n\t\tparameters: DeleteExperienceIconParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n\t/**\n\t * Lists every localized icon registered against an experience. The\n\t * server returns one entry per locale that has an icon registered.\n\t *\n\t * @param parameters - Universe identifier whose icons to list.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed array of\n\t * {@link ExperienceIcon} entries or the {@link OpenCloudError} that\n\t * caused the request to fail.\n\t */\n\tlist: (\n\t\tparameters: ListExperienceIconsParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<ReadonlyArray<ExperienceIcon>, OpenCloudError>>;\n\t/**\n\t * Uploads or replaces the localized icon for an experience. A\n\t * subsequent upload for the same `(universeId, languageCode)` pair\n\t * replaces the existing icon for that locale.\n\t *\n\t * @param parameters - Universe and language identifiers plus the image\n\t * bytes to upload.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A success {@link Result} with no payload, or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tupload: (\n\t\tparameters: UploadExperienceIconParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n}\n\ninterface UniverseThumbnailsHandle {\n\t/**\n\t * Deletes a single thumbnail by media asset ID. Idempotent: deleting an\n\t * already-removed thumbnail surfaces the server's 404 unchanged.\n\t *\n\t * @param parameters - Universe, language, and image identifiers of the\n\t * thumbnail to delete.\n\t * @param options - Optional per-request overrides.\n\t * @returns A success {@link Result} with no payload, or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tdelete: (\n\t\tparameters: DeleteExperienceThumbnailParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n\t/**\n\t * Reorders the localized thumbnail carousel. The supplied\n\t * `orderedImageIds` describes the desired display order from first to\n\t * last. Image IDs must be positive integers within the safe-integer\n\t * range; invalid input is rejected with a {@link OpenCloudError} of\n\t * kind `ValidationError` before any HTTP round-trip.\n\t *\n\t * @param parameters - Universe, language, and the desired display order.\n\t * @param options - Optional per-request overrides.\n\t * @returns A success {@link Result} with no payload, or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\treorder: (\n\t\tparameters: ReorderExperienceThumbnailsParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n\t/**\n\t * Uploads a new thumbnail and appends it to the localized carousel. Use\n\t * {@link UniverseThumbnailsHandle.reorder} after multiple uploads to\n\t * set the display order.\n\t *\n\t * @param parameters - Universe and language identifiers plus the image\n\t * bytes to upload.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link UploadedExperienceThumbnail} or the {@link OpenCloudError}\n\t * that caused the request to fail.\n\t */\n\tupload: (\n\t\tparameters: UploadExperienceThumbnailParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<UploadedExperienceThumbnail, OpenCloudError>>;\n}\n\n/**\n * Public client for the Roblox Open Cloud `Universe` resource. Wires\n * the request builders, the injected\n * {@link OpenCloudClientOptions.httpClient}, and the response parser\n * into a single ergonomic surface. Every method returns a\n * {@link Result} so callers handle failure explicitly; no thrown\n * {@link OpenCloudError} ever escapes the client.\n *\n * Partial updates use a Google-style `updateMask` query string derived\n * from the keys present on the update parameters. Setting a clearable\n * field (`privateServerPriceRobux` or any social link) to `undefined`\n * sends JSON `null` for that field so the server clears the\n * corresponding value.\n *\n * Localized experience-icon and experience-thumbnail Operations are\n * bound on the {@link UniversesClient.icon} and\n * {@link UniversesClient.thumbnails} Operation Groups so callers reach\n * for one client per universe.\n *\n * @example\n *\n * ```ts\n * import { UniversesClient } from \"@bedrock-rbx/ocale/universes\";\n *\n * const client = new UniversesClient({ apiKey: \"your-key\" });\n * expect(client).toBeInstanceOf(UniversesClient);\n * ```\n */\nexport class UniversesClient {\n\treadonly #inner: ResourceClient;\n\n\t/**\n\t * Operation Group exposing the localized experience-icon\n\t * Operations (`upload`, `delete`, `list`) backed by the\n\t * `legacy-game-internationalization` domain. Shares the parent\n\t * client's HTTP, rate-limit, and retry plumbing.\n\t */\n\tpublic readonly icon: UniverseIconHandle;\n\t/**\n\t * Operation Group exposing the localized experience-thumbnail\n\t * Operations (`upload`, `delete`, `reorder`) backed by the\n\t * `legacy-game-internationalization` domain. No list-thumbnails\n\t * endpoint is bridged; consumers must track uploaded\n\t * `mediaAssetId`s in their own state store to reconcile against\n\t * the existing carousel. Shares the parent client's HTTP,\n\t * rate-limit, and retry plumbing.\n\t */\n\tpublic readonly thumbnails: UniverseThumbnailsHandle;\n\n\t/**\n\t * Creates a new {@link UniversesClient}. Configuration is frozen\n\t * on construction; per-request overrides are accepted on each\n\t * method.\n\t *\n\t * @param options - Client-level configuration including the API key.\n\t */\n\tconstructor(options: OpenCloudClientOptions) {\n\t\tthis.#inner = new ResourceClient(options);\n\t\tthis.icon = createIconHandle(this.#inner);\n\t\tthis.thumbnails = createThumbnailsHandle(this.#inner);\n\t}\n\n\t/**\n\t * Fetches the current configuration of a universe.\n\t *\n\t * @param parameters - The universe identifier.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link Universe}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async get(\n\t\tparameters: GetUniverseParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<Universe, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: GET_SPEC });\n\t}\n\n\t/**\n\t * Partially updates a universe's configuration. The fields\n\t * supplied on `parameters` (excluding `universeId`) are forwarded\n\t * to the server via a Google-style `updateMask`; unmentioned\n\t * fields are left untouched.\n\t *\n\t * @param parameters - The universe identifier and the fields to\n\t * update. At least one updatable field must be supplied.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link Universe}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async update(\n\t\tparameters: UpdateUniverseParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<Universe, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: UPDATE_SPEC });\n\t}\n}\n\nfunction createIconHandle(inner: ResourceClient): UniverseIconHandle {\n\treturn {\n\t\tasync delete(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: ICON_DELETE_SPEC });\n\t\t},\n\t\tasync list(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: ICON_LIST_SPEC });\n\t\t},\n\t\tasync upload(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: ICON_UPLOAD_SPEC });\n\t\t},\n\t};\n}\n\nfunction createThumbnailsHandle(inner: ResourceClient): UniverseThumbnailsHandle {\n\treturn {\n\t\tasync delete(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: THUMBNAIL_DELETE_SPEC });\n\t\t},\n\t\tasync reorder(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: THUMBNAIL_REORDER_SPEC });\n\t\t},\n\t\tasync upload(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: THUMBNAIL_UPLOAD_SPEC });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,gBAAgB,KAAK,MAAM,OAAO;;;;;;;AAQxC,SAAgB,gBACf,YACsC;AACtC,QAAO,UAAU;EAChB,QAAQ;EACR,KAAK,uBAAuB,WAAW;EACvC,CAAC;;;;;;;;;;;;;AAcH,SAAgB,mBACf,YACuC;CACvC,MAAM,YAAY,uBAAuB,WAAW;AAEpD,KAAI,UAAU,WAAW,EACxB,QAAO;EACN,KAAK,IAAI,gBAAgB,0CAA0C,EAClE,MAAM,gBACN,CAAC;EACF,SAAS;EACT;CAGF,MAAM,OAAgC,EAAE;AACxC,MAAK,MAAM,OAAO,UACjB,MAAK,OAAO,aAAa,YAAY,IAAI;CAG1C,MAAM,aAAa,UAAU,KAAK,IAAI;AACtC,QAAO;EACN,MAAM;GACL;GACA,SAAS,EAAE,gBAAgB,oBAAoB;GAC/C,QAAQ;GACR,KAAK,uBAAuB,WAAW,WAAW,cAAc;GAChE;EACD,SAAS;EACT;;AAGF,SAAS,uBAAuB,YAA6D;AAC5F,QAAO,OAAO,KAAK,WAAW,CAAC,QAAQ,QAAQ,QAAQ,aAAa;;AAGrE,SAAS,aAAa,YAAsC,KAAsB;CACjF,MAAM,QAAQ,QAAQ,IAAI,YAAY,IAAI;AAC1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