@bedrock-rbx/ocale 0.3.4-beta.1 → 0.4.0
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 +9 -5
- package/dist/badge-cost-mismatch-DrlvhlQc.mjs +47 -0
- package/dist/badge-cost-mismatch-DrlvhlQc.mjs.map +1 -0
- package/dist/badges.d.mts +228 -184
- package/dist/badges.d.mts.map +1 -1
- package/dist/badges.mjs +176 -18
- package/dist/badges.mjs.map +1 -1
- package/dist/capacity-admission-hycCFkTo.d.mts +355 -0
- package/dist/capacity-admission-hycCFkTo.d.mts.map +1 -0
- package/dist/{data.generated-B2ceLfSn.d.mts → data.generated-D_vpa5-g.d.mts} +23 -23
- package/dist/data.generated-D_vpa5-g.d.mts.map +1 -0
- package/dist/developer-products.d.mts +181 -186
- package/dist/developer-products.d.mts.map +1 -1
- package/dist/developer-products.mjs +24 -24
- package/dist/developer-products.mjs.map +1 -1
- package/dist/game-passes.d.mts +206 -203
- package/dist/game-passes.d.mts.map +1 -1
- package/dist/game-passes.mjs +26 -21
- package/dist/game-passes.mjs.map +1 -1
- package/dist/index.d.mts +924 -306
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +325 -10
- package/dist/index.mjs.map +1 -1
- package/dist/locales.d.mts +30 -2
- package/dist/locales.d.mts.map +1 -0
- package/dist/locales.mjs +24 -1
- package/dist/locales.mjs.map +1 -1
- package/dist/luau-execution.d.mts +154 -151
- package/dist/luau-execution.d.mts.map +1 -1
- package/dist/luau-execution.mjs +11 -8
- package/dist/luau-execution.mjs.map +1 -1
- package/dist/{network-error-DR9FX5hb.mjs → network-error-iVSng5MT.mjs} +44 -6
- package/dist/network-error-iVSng5MT.mjs.map +1 -0
- package/dist/places.d.mts +204 -180
- package/dist/places.d.mts.map +1 -1
- package/dist/places.mjs +66 -20
- package/dist/places.mjs.map +1 -1
- package/dist/{poll-timeout-3PXLsabj.mjs → poll-timeout-DzztDymd.mjs} +2 -2
- package/dist/{poll-timeout-3PXLsabj.mjs.map → poll-timeout-DzztDymd.mjs.map} +1 -1
- package/dist/{polling-helpers-sKTsqEc1.mjs → polling-helpers-DfF5dspc.mjs} +249 -83
- package/dist/polling-helpers-DfF5dspc.mjs.map +1 -0
- package/dist/{price-information-hWXV6DAI.mjs → price-information-DEkEQ8Pq.mjs} +2 -2
- package/dist/{price-information-hWXV6DAI.mjs.map → price-information-DEkEQ8Pq.mjs.map} +1 -1
- package/dist/resource-client-BCKukheG.d.mts +168 -0
- package/dist/resource-client-BCKukheG.d.mts.map +1 -0
- package/dist/resource-client-CaIVr-go.mjs +1419 -0
- package/dist/resource-client-CaIVr-go.mjs.map +1 -0
- package/dist/retry-C2oHesDx.d.mts +229 -0
- package/dist/retry-C2oHesDx.d.mts.map +1 -0
- package/dist/{retry-vpHMIwaU.mjs → retry-CMRDvAR4.mjs} +390 -20
- package/dist/retry-CMRDvAR4.mjs.map +1 -0
- package/dist/storage.d.mts +333 -334
- package/dist/storage.d.mts.map +1 -1
- package/dist/storage.mjs +29 -22
- package/dist/storage.mjs.map +1 -1
- package/dist/testing.d.mts +347 -360
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +3 -4
- package/dist/testing.mjs.map +1 -1
- package/dist/types-CdMr_J1M.d.mts +509 -0
- package/dist/types-CdMr_J1M.d.mts.map +1 -0
- package/dist/universes.d.mts +619 -422
- package/dist/universes.d.mts.map +1 -1
- package/dist/universes.mjs +421 -48
- package/dist/universes.mjs.map +1 -1
- package/dist/{validation-B_Zs1So2.mjs → validation-964VNlbp.mjs} +2 -2
- package/dist/{validation-B_Zs1So2.mjs.map → validation-964VNlbp.mjs.map} +1 -1
- package/dist/wire-DJqupefn.d.mts +41 -0
- package/dist/wire-DJqupefn.d.mts.map +1 -0
- package/package.json +14 -14
- package/dist/capacity-admission-BvnJjY0S.d.mts +0 -369
- package/dist/capacity-admission-BvnJjY0S.d.mts.map +0 -1
- package/dist/data.generated-B2ceLfSn.d.mts.map +0 -1
- package/dist/network-error-DR9FX5hb.mjs.map +0 -1
- package/dist/polling-helpers-sKTsqEc1.mjs.map +0 -1
- package/dist/resource-client-3cOhqZpX.mjs +0 -899
- package/dist/resource-client-3cOhqZpX.mjs.map +0 -1
- package/dist/resource-client-BivRq3JZ.d.mts +0 -164
- package/dist/resource-client-BivRq3JZ.d.mts.map +0 -1
- package/dist/retry-DXEklFrt.d.mts +0 -373
- package/dist/retry-DXEklFrt.d.mts.map +0 -1
- package/dist/retry-vpHMIwaU.mjs.map +0 -1
- package/dist/types-C3Egi37J.d.mts +0 -378
- package/dist/types-C3Egi37J.d.mts.map +0 -1
- package/dist/wire-D3K-a-UP.d.mts +0 -37
- package/dist/wire-D3K-a-UP.d.mts.map +0 -1
package/dist/universes.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universes.mjs","names":["PER_MINUTE","SECONDS_PER_MINUTE","malformed","#inner","#inner"],"sources":["../src/internal/utils/positive-integer-id.ts","../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/domains/server-management/restarts/builders.ts","../src/domains/server-management/restarts/operations.ts","../src/domains/server-management/restarts/parsers.ts","../src/resources/universes/restarts-group.ts","../src/resources/universes/client.ts"],"sourcesContent":["import { ValidationError, type ValidationErrorCode } from \"../../errors/validation.ts\";\nimport type { Result } from \"../../types.ts\";\n\nconst POSITIVE_INTEGER_PATTERN = /^[1-9]\\d*$/;\n\n/**\n * Names the parameter an ID list came from, for the error it may produce.\n */\nexport interface IdListField {\n\t/** Validation code reported for an entry that is not an ID. */\n\treadonly code: ValidationErrorCode;\n\t/** Parameter name quoted in the error message. */\n\treadonly field: string;\n}\n\n/**\n * Parses stringified Roblox IDs for a wire field typed as an integer array.\n *\n * @param ids - The stringified IDs.\n * @param field - The parameter the IDs came from.\n * @returns The IDs as numbers, or a {@link ValidationError} naming the\n * first entry that is not a positive integer within the safe-integer\n * range.\n */\nexport function parsePositiveIntegerIds(\n\tids: ReadonlyArray<string>,\n\t{ code, field }: IdListField,\n): Result<ReadonlyArray<number>, ValidationError> {\n\tconst invalid = ids.find((id) => parsePositiveIntegerId(id) === undefined);\n\tif (invalid !== undefined) {\n\t\tconst message = `${field} entry ${JSON.stringify(invalid)} is not a positive integer ID`;\n\t\treturn { err: new ValidationError(message, { code }), success: false };\n\t}\n\n\treturn { data: ids.map(Number), success: true };\n}\n\nfunction parsePositiveIntegerId(value: string): number | undefined {\n\tif (!POSITIVE_INTEGER_PATTERN.test(value)) {\n\t\treturn undefined;\n\t}\n\n\tconst parsed = Number(value);\n\treturn Number.isSafeInteger(parsed) ? parsed : undefined;\n}\n","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 { parsePositiveIntegerIds } from \"../../../internal/utils/positive-integer-id.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type {\n\tGetUniverseParameters,\n\tRestartUniverseServersParameters,\n\tUpdateUniverseParameters,\n} 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 `POST` request for the Open Cloud `:restartServers` custom\n * method on a universe. A bleed-off duration also sets the wire's\n * `bleedOffServers` flag, which the server needs before it reads the\n * duration.\n *\n * @param parameters - The universe identifier and restart selection.\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when `placeIds` is empty (Roblox would read it\n * as every place) or holds an ID that is not a positive integer.\n */\nexport function buildRestartServersRequest({\n\tbleedOffDurationMinutes,\n\tplaceIds,\n\tuniverseId,\n\t...selection\n}: RestartUniverseServersParameters): Result<HttpRequest, OpenCloudError> {\n\tif (placeIds?.length === 0) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"placeIds must contain at least one place ID\", {\n\t\t\t\tcode: \"empty_place_ids\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst wirePlaceIds =\n\t\tplaceIds === undefined\n\t\t\t? undefined\n\t\t\t: parsePositiveIntegerIds(placeIds, { code: \"invalid_place_id\", field: \"placeIds\" });\n\tif (wirePlaceIds?.success === false) {\n\t\treturn wirePlaceIds;\n\t}\n\n\tconst bleedOff =\n\t\tbleedOffDurationMinutes === undefined\n\t\t\t? {}\n\t\t\t: { bleedOffDurationMinutes, bleedOffServers: true };\n\tconst places = wirePlaceIds === undefined ? {} : { placeIds: wirePlaceIds.data };\n\treturn okRequest({\n\t\tbody: { ...selection, ...bleedOff, ...places },\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${universeId}:restartServers`,\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 RESTART_SERVERS_PER_MINUTE = 30;\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\n/**\n * Per-second request ceiling for restarting a universe's servers, from\n * `Cloud_RestartUniverseServers` in the Open Cloud OpenAPI schema (30\n * requests per minute per API key owner). The burst grants the whole\n * minute's quota up front, since the default of one token would pace a\n * sub-second limit at one call every two seconds.\n */\nexport const RESTART_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tburstCapacity: RESTART_SERVERS_PER_MINUTE,\n\tmaxPerSecond: RESTART_SERVERS_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"universes.restartServers\",\n});\n\n/**\n * Scopes required to restart a universe's servers, sourced from\n * `x-roblox-scopes` on the `Cloud_RestartUniverseServers` operation in the\n * vendored OpenAPI schema.\n */\nexport const RESTART_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 { toJsonDetails } from \"../../../internal/utils/to-json-details.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\nconst UNIVERSE_PATH_PATTERN = /^universes\\/(\\d+)$/;\n\nconst ROOT_PLACE_PATH_PATTERN = /\\/places\\/(\\d+)$/;\n\nconst OWNER_PATH_PATTERN = /^(?:users|groups)\\/(\\d+)$/;\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({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<Universe, ApiError> {\n\tif (!isUniverseWire(body)) {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\tconst ownerResult = resolveOwner(body);\n\tif (!ownerResult.success) {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\tconst idMatch = UNIVERSE_PATH_PATTERN.exec(body.path);\n\tconst id = idMatch?.[1];\n\tif (id === undefined) {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\treturn { data: toUniverse({ id, body, owner: ownerResult.data }), success: true };\n}\n\nfunction malformed(statusCode: number, body: unknown): Result<Universe, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_MESSAGE, {\n\t\t\tdetails: toJsonDetails(body),\n\t\t\tstatusCode,\n\t\t}),\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 = ROOT_PLACE_PATH_PATTERN.exec(rootPlace);\n\treturn match?.[1];\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 toSocialLink(wire: unknown): SocialLink | undefined {\n\tif (!isSocialLinkWire(wire)) {\n\t\treturn undefined;\n\t}\n\n\treturn { title: wire.title, uri: wire.uri };\n}\n\nfunction toUniverse({ id, body, owner }: ToUniverseArgs): Universe {\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 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 = OWNER_PATH_PATTERN.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 { toJsonDetails } from \"../../../internal/utils/to-json-details.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\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<ReadonlyArray<ExperienceIcon>, ApiError> {\n\tif (!isGameIconListWire(body)) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed icon list response\", {\n\t\t\t\tdetails: toJsonDetails(body),\n\t\t\t\tstatusCode,\n\t\t\t}),\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 { parsePositiveIntegerIds } from \"../../../internal/utils/positive-integer-id.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\tlanguageCode,\n\torderedImageIds,\n\tuniverseId,\n}: ReorderExperienceThumbnailsParameters): Result<HttpRequest, ValidationError> {\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 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 parsePositiveIntegerIds(orderedImageIds, {\n\t\tcode: \"invalid_image_id\",\n\t\tfield: \"orderedImageIds\",\n\t});\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 { toJsonDetails } from \"../../../internal/utils/to-json-details.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\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<UploadedExperienceThumbnail, ApiError> {\n\tif (!isGameThumbnailUploadWire(body)) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed thumbnail upload response\", {\n\t\t\t\tdetails: toJsonDetails(body),\n\t\t\t\tstatusCode,\n\t\t\t}),\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 { HttpRequest } from \"../../../client/types.ts\";\nimport type { OpenCloudError } from \"../../../errors/base.ts\";\nimport { okRequest } from \"../../../internal/resource-client.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type {\n\tForecastRestartParameters,\n\tLaunchRestartParameters,\n\tListRestartsParameters,\n} from \"./types.ts\";\n\n/**\n * Builds a `GET` request for the server-management restart forecast.\n *\n * @param parameters - The universe identifier.\n * @returns A success result wrapping the request; the builder cannot fail.\n */\nexport function buildForecastRequest(\n\tparameters: ForecastRestartParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest({\n\t\tmethod: \"GET\",\n\t\turl: `/server-management/v1/universes/${parameters.universeId}/restarts:forecast`,\n\t});\n}\n\n/**\n * Builds a `POST` request that launches a server-management restart. The\n * body is never omitted: the endpoint answers 415 to a POST without one.\n *\n * @param parameters - The universe identifier and restart selection.\n * @returns A success result wrapping the request; the builder cannot fail.\n */\nexport function buildLaunchRequest({\n\tuniverseId,\n\t...selection\n}: LaunchRestartParameters): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest({\n\t\tbody: selection,\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"POST\",\n\t\turl: `/server-management/v1/universes/${universeId}/restarts`,\n\t});\n}\n\n/**\n * Builds a `GET` request that lists a universe's server-management\n * restarts.\n *\n * @param parameters - The universe identifier.\n * @returns A success result wrapping the request; the builder cannot fail.\n */\nexport function buildListRequest(\n\tparameters: ListRestartsParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest({\n\t\tmethod: \"GET\",\n\t\turl: `/server-management/v1/universes/${parameters.universeId}/restarts`,\n\t});\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 `Restarts_ForecastRestart`, from the\n * Open Cloud OpenAPI schema (100 requests per minute per API key owner).\n * Live headers show it metered apart from launch and list.\n */\nexport const FORECAST_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"restarts.forecast\",\n});\n\n/**\n * Scopes required to read restart forecasts and statuses, sourced from\n * `x-roblox-scopes` on `Restarts_ForecastRestart` and\n * `Restarts_ListRestartStatuses` in the vendored OpenAPI schema.\n */\nexport const READ_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"universe:read\"]);\n\n/**\n * Per-second request ceiling for `Restarts_LaunchRestart`, from the Open\n * Cloud OpenAPI schema (100 requests per minute per API key owner).\n */\nexport const LAUNCH_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"restarts.launch\",\n});\n\n/**\n * Scopes required to launch a restart, sourced from `x-roblox-scopes` on\n * `Restarts_LaunchRestart` in the vendored OpenAPI schema.\n */\nexport const LAUNCH_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"universe:write\"]);\n\n/**\n * Per-second request ceiling for `Restarts_ListRestartStatuses`, from the\n * Open Cloud OpenAPI schema (100 requests per minute per API key owner).\n */\nexport const LIST_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"restarts.list\",\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 { toJsonDetails } from \"../../../internal/utils/to-json-details.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type {\n\tLaunchedRestart,\n\tPlaceRestartForecast,\n\tPlaceRestartStatus,\n\tRestartPlaceFilter,\n\tRestartStatus,\n} from \"./types.ts\";\nimport type {\n\tForecastRestartResponseWire,\n\tLaunchRestartResponseWire,\n\tListRestartStatusesResponseWire,\n\tPlaceFilterWire,\n\tPlaceRestartStatusWire,\n\tPlaceSummaryForGameRestartWire,\n\tRestartStatusWire,\n} from \"./wire.ts\";\n\nconst RESTART_STATES: ReadonlySet<unknown> = new Set([\"DELAYING\", \"RESTARTING\", \"SUCCEEDED\"]);\n\n/** The ID Roblox returns from a launch that matched no live server. */\nconst NIL_RESTART_ID = \"00000000-0000-0000-0000-000000000000\";\n\ninterface MalformedBody {\n\treadonly body: unknown;\n\treadonly statusCode: number;\n}\n\n/**\n * Parses a `ForecastRestartResponse` body into one\n * {@link PlaceRestartForecast} per place.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the forecasts, or an {@link ApiError}\n * when the body does not match the wire schema.\n */\nexport function parseForecastResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<ReadonlyArray<PlaceRestartForecast>, ApiError> {\n\tif (!isForecastWire(body)) {\n\t\treturn malformed(\"Malformed restart forecast response\", { body, statusCode });\n\t}\n\n\tconst forecasts = Object.entries(body.placeForecasts ?? {}).map(([placeId, summary]) => {\n\t\treturn toForecast(placeId, summary);\n\t});\n\treturn { data: forecasts, success: true };\n}\n\n/**\n * Parses a `LaunchRestartResponse` body into a {@link LaunchedRestart}.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the launched restart, or an\n * {@link ApiError} when the body does not match the wire schema.\n */\nexport function parseLaunchResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<LaunchedRestart, ApiError> {\n\tif (!isLaunchWire(body)) {\n\t\treturn malformed(\"Malformed restart launch response\", { body, statusCode });\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tid: body.id === NIL_RESTART_ID ? undefined : (body.id ?? undefined),\n\t\t\tinstancesImpacted: body.instancesImpacted,\n\t\t\tplayersImpacted: body.playersImpacted,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\n/**\n * Parses a `ListRestartStatusesResponse` body into one\n * {@link RestartStatus} per restart.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the restarts, or an {@link ApiError}\n * when the body does not match the wire schema.\n */\nexport function parseListResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<ReadonlyArray<RestartStatus>, ApiError> {\n\tif (!isListWire(body)) {\n\t\treturn malformed(\"Malformed restart list response\", { body, statusCode });\n\t}\n\n\tconst restarts = Object.entries(body.restartStatuses ?? {}).map(([id, status]) => {\n\t\treturn toRestartStatus(id, status);\n\t});\n\treturn { data: restarts, success: true };\n}\n\nfunction malformed(message: string, { body, statusCode }: MalformedBody): Result<never, ApiError> {\n\treturn {\n\t\terr: new ApiError(message, { details: toJsonDetails(body), statusCode }),\n\t\tsuccess: false,\n\t};\n}\n\nfunction toForecast(\n\tplaceId: string,\n\tsummary: PlaceSummaryForGameRestartWire,\n): PlaceRestartForecast {\n\treturn {\n\t\tinstancesImpacted: summary.instancesImpacted,\n\t\tinstancesPerVersion: summary.instancesPerVersion ?? {},\n\t\tisNotInUniverse: summary.isNotInUniverse,\n\t\tlatestPlaceVersion: summary.latestPlaceVersion ?? undefined,\n\t\tplaceId,\n\t\tplayersImpacted: summary.playersImpacted,\n\t\tplayersPerVersion: summary.playersPerVersion ?? {},\n\t\tpublishedAt: new Date(summary.publishTime),\n\t\ttotalInstances: summary.totalInstances,\n\t\ttotalPlayers: summary.totalPlayers,\n\t};\n}\n\n/**\n * Whether a nullable wire field carries no value: absent, `undefined`, or\n * JSON `null`.\n *\n * @param value - The wire value.\n * @returns `true` when the field carries no value.\n */\nfunction isAbsent(value: unknown): boolean {\n\treturn (value ?? undefined) === undefined;\n}\n\nfunction isOptional(value: unknown, isPresent: (present: unknown) => boolean): boolean {\n\treturn isAbsent(value) || isPresent(value);\n}\n\nfunction isOptionalRecordOf(value: unknown, isEntry: (entry: unknown) => boolean): boolean {\n\treturn isOptional(value, (record) => isRecord(record) && Object.values(record).every(isEntry));\n}\n\nfunction isNumber(value: unknown): boolean {\n\treturn typeof value === \"number\";\n}\n\nfunction isString(value: unknown): boolean {\n\treturn typeof value === \"string\";\n}\n\nfunction isPlaceSummaryWire(value: unknown): value is PlaceSummaryForGameRestartWire {\n\treturn (\n\t\tisRecord(value) &&\n\t\ttypeof value[\"instancesImpacted\"] === \"number\" &&\n\t\ttypeof value[\"isNotInUniverse\"] === \"boolean\" &&\n\t\ttypeof value[\"playersImpacted\"] === \"number\" &&\n\t\tisDateTimeString(value[\"publishTime\"]) &&\n\t\ttypeof value[\"totalInstances\"] === \"number\" &&\n\t\ttypeof value[\"totalPlayers\"] === \"number\" &&\n\t\tisOptional(value[\"latestPlaceVersion\"], isString) &&\n\t\tisOptionalRecordOf(value[\"instancesPerVersion\"], isNumber) &&\n\t\tisOptionalRecordOf(value[\"playersPerVersion\"], isNumber)\n\t);\n}\n\nfunction isForecastWire(body: unknown): body is ForecastRestartResponseWire {\n\treturn isRecord(body) && isOptionalRecordOf(body[\"placeForecasts\"], isPlaceSummaryWire);\n}\n\nfunction isLaunchWire(body: unknown): body is LaunchRestartResponseWire {\n\treturn (\n\t\tisRecord(body) &&\n\t\tisOptional(body[\"id\"], isString) &&\n\t\ttypeof body[\"instancesImpacted\"] === \"number\" &&\n\t\ttypeof body[\"playersImpacted\"] === \"number\"\n\t);\n}\n\nfunction toFilter(filter: PlaceFilterWire | undefined): RestartPlaceFilter | undefined {\n\tconst wire = filter ?? undefined;\n\tif (wire === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst versions = wire.versions ?? undefined;\n\tif (versions !== undefined) {\n\t\treturn { versions };\n\t}\n\n\tconst excludeCurrentVersion = wire.excludeCurrentVersion ?? undefined;\n\treturn excludeCurrentVersion === undefined ? {} : { excludeCurrentVersion };\n}\n\nfunction toPlaceStatus(placeId: string, wire: PlaceRestartStatusWire): PlaceRestartStatus {\n\treturn {\n\t\tendedAt: typeof wire.endTime === \"string\" ? new Date(wire.endTime) : undefined,\n\t\tfilter: toFilter(wire.filter),\n\t\tlatestVersion: wire.latestVersion ?? undefined,\n\t\tplaceId,\n\t\tremainingInstances: wire.remainingInstances,\n\t\tremainingPlayers: wire.remainingPlayers,\n\t\tstartedAt: new Date(wire.startTime),\n\t\tstate: wire.state,\n\t\ttotalInstances: wire.totalInstances,\n\t\ttotalPlayers: wire.totalPlayers,\n\t};\n}\n\nfunction toRestartStatus(id: string, wire: RestartStatusWire): RestartStatus {\n\tconst places = Object.entries(wire.placeRestartStatuses ?? {}).map(([placeId, status]) => {\n\t\treturn toPlaceStatus(placeId, status);\n\t});\n\treturn {\n\t\tid,\n\t\tplaces,\n\t\tscheduledAt: new Date(wire.scheduledTime),\n\t\tstartsAt: new Date(wire.startTime),\n\t};\n}\n\nfunction isVersions(value: unknown): boolean {\n\treturn Array.isArray(value) && value.every(isNumber);\n}\n\nfunction isFilterWire(value: unknown): boolean {\n\treturn (\n\t\tisRecord(value) &&\n\t\tisOptional(value[\"excludeCurrentVersion\"], (exclude) => typeof exclude === \"boolean\") &&\n\t\tisOptional(value[\"versions\"], isVersions)\n\t);\n}\n\nfunction isPlaceStatusWire(value: unknown): value is PlaceRestartStatusWire {\n\treturn (\n\t\tisRecord(value) &&\n\t\tRESTART_STATES.has(value[\"state\"]) &&\n\t\tisDateTimeString(value[\"startTime\"]) &&\n\t\tisOptional(value[\"endTime\"], isDateTimeString) &&\n\t\ttypeof value[\"totalPlayers\"] === \"number\" &&\n\t\ttypeof value[\"totalInstances\"] === \"number\" &&\n\t\ttypeof value[\"remainingPlayers\"] === \"number\" &&\n\t\ttypeof value[\"remainingInstances\"] === \"number\" &&\n\t\tisOptional(value[\"filter\"], isFilterWire) &&\n\t\tisOptional(value[\"latestVersion\"], isString)\n\t);\n}\n\nfunction isRestartStatusWire(value: unknown): value is RestartStatusWire {\n\treturn (\n\t\tisRecord(value) &&\n\t\tisDateTimeString(value[\"scheduledTime\"]) &&\n\t\tisDateTimeString(value[\"startTime\"]) &&\n\t\tisOptionalRecordOf(value[\"placeRestartStatuses\"], isPlaceStatusWire)\n\t);\n}\n\nfunction isListWire(body: unknown): body is ListRestartStatusesResponseWire {\n\treturn isRecord(body) && isOptionalRecordOf(body[\"restartStatuses\"], isRestartStatusWire);\n}\n","import type { RequestOptions } from \"../../client/types.ts\";\nimport {\n\tbuildForecastRequest,\n\tbuildLaunchRequest,\n\tbuildListRequest,\n} from \"../../domains/server-management/restarts/builders.ts\";\nimport {\n\tFORECAST_OPERATION_LIMIT,\n\tLAUNCH_OPERATION_LIMIT,\n\tLAUNCH_REQUIRED_SCOPES,\n\tLIST_OPERATION_LIMIT,\n\tREAD_REQUIRED_SCOPES,\n} from \"../../domains/server-management/restarts/operations.ts\";\nimport {\n\tparseForecastResponse,\n\tparseLaunchResponse,\n\tparseListResponse,\n} from \"../../domains/server-management/restarts/parsers.ts\";\nimport type {\n\tForecastRestartParameters,\n\tLaunchedRestart,\n\tLaunchRestartParameters,\n\tListRestartsParameters,\n\tPlaceRestartForecast,\n\tRestartStatus,\n} from \"../../domains/server-management/restarts/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS, IDEMPOTENT_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport type { ResourceClient, ResourceMethodSpec } 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 FORECAST_SPEC = makeSpec<ForecastRestartParameters, ReadonlyArray<PlaceRestartForecast>>({\n\tbuildRequest: buildForecastRequest,\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: FORECAST_OPERATION_LIMIT,\n\tparse: parseForecastResponse,\n\trequiredScopes: READ_REQUIRED_SCOPES,\n});\n\n// A launch is not safe to repeat: a 5xx may follow an accepted restart,\n// and Roblox answers some requests with a steady 500 (see\n// docs/spikes/restart-servers). So the retry policy mirrors `create`.\nconst LAUNCH_SPEC = makeSpec<LaunchRestartParameters, LaunchedRestart>({\n\tbuildRequest: buildLaunchRequest,\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: LAUNCH_OPERATION_LIMIT,\n\tparse: parseLaunchResponse,\n\trequiredScopes: LAUNCH_REQUIRED_SCOPES,\n});\n\nconst LIST_SPEC = makeSpec<ListRestartsParameters, ReadonlyArray<RestartStatus>>({\n\tbuildRequest: buildListRequest,\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: LIST_OPERATION_LIMIT,\n\tparse: parseListResponse,\n\trequiredScopes: READ_REQUIRED_SCOPES,\n});\n\n/**\n * Operation Group on `UniversesClient` that exposes the server-management\n * restart endpoints: preview a restart, launch one, and track it. The\n * endpoints are BETA on the Roblox side.\n */\nexport class UniverseRestartsGroup {\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 * Reads the live servers of every active place in a universe, and how\n\t * many of them a restart of old place versions would close.\n\t *\n\t * @param parameters - The universe identifier.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping one {@link PlaceRestartForecast}\n\t * per active place (empty when no server runs), or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async forecast(\n\t\tparameters: ForecastRestartParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<ReadonlyArray<PlaceRestartForecast>, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: FORECAST_SPEC });\n\t}\n\n\t/**\n\t * Launches a restart of a universe's live servers and returns its ID,\n\t * which `list` reports while the restart runs. When no live server\n\t * matches, Roblox records no restart and `id` is `undefined`.\n\t *\n\t * @example\n\t * ```ts\n\t * import { createFakeHttpClient } from \"@bedrock-rbx/ocale/testing\";\n\t * import { UniversesClient } from \"@bedrock-rbx/ocale/universes\";\n\t *\n\t * const httpClient = createFakeHttpClient().mockResponse({\n\t * body: {\n\t * id: \"00000000-0000-0000-0000-000000000000\",\n\t * instancesImpacted: 0,\n\t * playersImpacted: 0,\n\t * },\n\t * status: 200,\n\t * });\n\t * const client = new UniversesClient({ apiKey: \"your-key\", httpClient });\n\t *\n\t * return client.restarts\n\t * .launch({ bleedOffDurationMinutes: 5, universeId: \"42\" })\n\t * .then((result) => {\n\t * expect(result).toEqual({\n\t * data: { id: undefined, instancesImpacted: 0, playersImpacted: 0 },\n\t * success: true,\n\t * });\n\t * });\n\t * ```\n\t *\n\t * @param parameters - The universe identifier.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the {@link LaunchedRestart}, or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async launch(\n\t\tparameters: LaunchRestartParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LaunchedRestart, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: LAUNCH_SPEC });\n\t}\n\n\t/**\n\t * Lists a universe's restarts with their progress per place. A\n\t * `:restartServers` call that selected a server appears here too, but\n\t * only `launch` returns the ID to match it by.\n\t *\n\t * @param parameters - The universe identifier.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping one {@link RestartStatus} per\n\t * restart, or the {@link OpenCloudError} that caused the request to\n\t * fail.\n\t */\n\tpublic async list(\n\t\tparameters: ListRestartsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<ReadonlyArray<RestartStatus>, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: LIST_SPEC });\n\t}\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport {\n\tbuildGetRequest,\n\tbuildRestartServersRequest,\n\tbuildUpdateRequest,\n} from \"../../domains/cloud-v2/universes/builders.ts\";\nimport {\n\tGET_OPERATION_LIMIT,\n\tRESTART_OPERATION_LIMIT,\n\tRESTART_REQUIRED_SCOPES,\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\tRestartUniverseServersParameters,\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\";\nimport { UniverseRestartsGroup } from \"./restarts-group.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\nconst RESTART_SERVERS_SPEC: ResourceMethodSpec<RestartUniverseServersParameters, undefined> =\n\tObject.freeze({\n\t\tbuildRequest: buildRestartServersRequest,\n\t\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\t\tmethodKind: \"create\",\n\t\toperationLimit: RESTART_OPERATION_LIMIT,\n\t\tparse: parseEmptyResponse,\n\t\trequiredScopes: RESTART_REQUIRED_SCOPES,\n\t});\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 * No default request timeout applies to this upload; pass `options.timeout`\n\t * to set a per-call deadline.\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 * No default request timeout applies to this upload; pass `options.timeout`\n\t * to set a per-call deadline.\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 * @since 0.1.0\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 server-management restart Operations\n\t * (`forecast`, `launch`, `list`). Shares the parent client's HTTP,\n\t * rate-limit, and retry plumbing.\n\t */\n\tpublic readonly restarts: UniverseRestartsGroup;\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.restarts = new UniverseRestartsGroup(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.executeAsync({ options, parameters, spec: GET_SPEC });\n\t}\n\n\t/**\n\t * Restarts the live servers of a universe so players move onto the\n\t * latest published place versions.\n\t *\n\t * @param parameters - The universe identifier, plus optional place,\n\t * version, and bleed-off selection.\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\tpublic async restartServers(\n\t\tparameters: RestartUniverseServersParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: RESTART_SERVERS_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.executeAsync({ 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.executeAsync({ options, parameters, spec: ICON_DELETE_SPEC });\n\t\t},\n\t\tasync list(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: ICON_LIST_SPEC });\n\t\t},\n\t\tasync upload(parameters, options) {\n\t\t\treturn inner.executeAsync({ 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.executeAsync({ options, parameters, spec: THUMBNAIL_DELETE_SPEC });\n\t\t},\n\t\tasync reorder(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: THUMBNAIL_REORDER_SPEC });\n\t\t},\n\t\tasync upload(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: THUMBNAIL_UPLOAD_SPEC });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;AAGA,MAAM,2BAA2B;;;;;;;;;;AAqBjC,SAAgB,wBACf,KACA,EAAE,MAAM,SACyC;CACjD,MAAM,UAAU,IAAI,MAAM,OAAO,uBAAuB,EAAE,MAAM,KAAA,CAAS;CACzE,IAAI,YAAY,KAAA,GAEf,OAAO;EAAE,KAAK,IAAI,gBAAgB,GADf,MAAM,SAAS,KAAK,UAAU,OAAO,EAAE,gCACf,EAAE,KAAK,CAAC;EAAG,SAAS;CAAM;CAGtE,OAAO;EAAE,MAAM,IAAI,IAAI,MAAM;EAAG,SAAS;CAAK;AAC/C;AAEA,SAAS,uBAAuB,OAAmC;CAClE,IAAI,CAAC,yBAAyB,KAAK,KAAK,GACvC;CAGD,MAAM,SAAS,OAAO,KAAK;CAC3B,OAAO,OAAO,cAAc,MAAM,IAAI,SAAS,KAAA;AAChD;;;;;;;;;AC1BA,MAAM,gBAAgB,KAAK,MAAM,MAAM;;;;;;;AAQvC,SAAgB,gBACf,YACsC;CACtC,OAAO,UAAU;EAChB,QAAQ;EACR,KAAK,uBAAuB,WAAW;CACxC,CAAC;AACF;;;;;;;;;;;;AAaA,SAAgB,2BAA2B,EAC1C,yBACA,UACA,YACA,GAAG,aACsE;CACzE,IAAI,UAAU,WAAW,GACxB,OAAO;EACN,KAAK,IAAI,gBAAgB,+CAA+C,EACvE,MAAM,kBACP,CAAC;EACD,SAAS;CACV;CAGD,MAAM,eACL,aAAa,KAAA,IACV,KAAA,IACA,wBAAwB,UAAU;EAAE,MAAM;EAAoB,OAAO;CAAW,CAAC;CACrF,IAAI,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AAM,aAAa;IAAE;IAAS;IAAY,MAAM;GAAiB,CAAC;EAC1E;CACD;AACD;AAEA,SAAS,uBAAuB,OAAiD;CAChF,OAAO;EACN,MAAM,OAAO,YAAY,SAAS;GACjC,OAAO,MAAM,aAAa;IAAE;IAAS;IAAY,MAAM;GAAsB,CAAC;EAC/E;EACA,MAAM,QAAQ,YAAY,SAAS;GAClC,OAAO,MAAM,aAAa;IAAE;IAAS;IAAY,MAAM;GAAuB,CAAC;EAChF;EACA,MAAM,OAAO,YAAY,SAAS;GACjC,OAAO,MAAM,aAAa;IAAE;IAAS;IAAY,MAAM;GAAsB,CAAC;EAC/E;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"universes.mjs","names":["PER_MINUTE","SECONDS_PER_MINUTE","malformed"],"sources":["../src/internal/utils/positive-integer-id.ts","../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/domains/develop/universes/builders.ts","../src/domains/develop/universes/operations.ts","../src/resources/universes/activation-specs.ts","../src/resources/universes/activation-error.ts","../src/resources/universes/activation.ts","../src/domains/server-management/restarts/builders.ts","../src/domains/server-management/restarts/operations.ts","../src/domains/server-management/restarts/parsers.ts","../src/domains/server-management/restarts/select-outdated.ts","../src/resources/universes/restarts-group.ts","../src/resources/universes/client.ts"],"sourcesContent":["import { ValidationError, type ValidationErrorCode } from \"../../errors/validation.ts\";\nimport type { Result } from \"../../types.ts\";\n\nconst POSITIVE_INTEGER_PATTERN = /^[1-9]\\d*$/;\n\n/**\n * Names the parameter an ID list came from, for the error it may produce.\n */\nexport interface IdListField {\n\t/** Validation code reported for an entry that is not an ID. */\n\treadonly code: ValidationErrorCode;\n\t/** Parameter name quoted in the error message. */\n\treadonly field: string;\n}\n\n/**\n * Parses stringified Roblox IDs for a wire field typed as an integer array.\n *\n * @param ids - The stringified IDs.\n * @param field - The parameter the IDs came from.\n * @returns The IDs as numbers, or a {@link ValidationError} naming the\n * first entry that is not a positive integer within the safe-integer\n * range.\n */\nexport function parsePositiveIntegerIds(\n\tids: ReadonlyArray<string>,\n\t{ code, field }: IdListField,\n): Result<ReadonlyArray<number>, ValidationError> {\n\tconst invalid = ids.find((id) => parsePositiveIntegerId(id) === undefined);\n\tif (invalid !== undefined) {\n\t\tconst message = `${field} entry ${JSON.stringify(invalid)} is not a positive integer ID`;\n\t\treturn { err: new ValidationError(message, { code }), success: false };\n\t}\n\n\treturn { data: ids.map(Number), success: true };\n}\n\nfunction parsePositiveIntegerId(value: string): number | undefined {\n\tif (!POSITIVE_INTEGER_PATTERN.test(value)) {\n\t\treturn undefined;\n\t}\n\n\tconst parsed = Number(value);\n\treturn Number.isSafeInteger(parsed) ? parsed : undefined;\n}\n","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 { parsePositiveIntegerIds } from \"../../../internal/utils/positive-integer-id.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type {\n\tGetUniverseParameters,\n\tRestartUniverseServersParameters,\n\tUpdateUniverseParameters,\n} 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 `POST` request for the Open Cloud `:restartServers` custom\n * method on a universe. A bleed-off duration also sets the wire's\n * `bleedOffServers` flag, which the server needs before it reads the\n * duration.\n *\n * @param parameters - The universe identifier and restart selection.\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when `placeIds` is empty (Roblox would read it\n * as every place) or holds an ID that is not a positive integer.\n */\nexport function buildRestartServersRequest({\n\tbleedOffDurationMinutes,\n\tplaceIds,\n\tuniverseId,\n\t...selection\n}: RestartUniverseServersParameters): Result<HttpRequest, OpenCloudError> {\n\tif (placeIds?.length === 0) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"placeIds must contain at least one place ID\", {\n\t\t\t\tcode: \"empty_place_ids\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst wirePlaceIds =\n\t\tplaceIds === undefined\n\t\t\t? undefined\n\t\t\t: parsePositiveIntegerIds(placeIds, { code: \"invalid_place_id\", field: \"placeIds\" });\n\tif (wirePlaceIds?.success === false) {\n\t\treturn wirePlaceIds;\n\t}\n\n\tconst bleedOff =\n\t\tbleedOffDurationMinutes === undefined\n\t\t\t? {}\n\t\t\t: { bleedOffDurationMinutes, bleedOffServers: true };\n\tconst places = wirePlaceIds === undefined ? {} : { placeIds: wirePlaceIds.data };\n\treturn okRequest({\n\t\tbody: { ...selection, ...bleedOff, ...places },\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${universeId}:restartServers`,\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 RESTART_SERVERS_PER_MINUTE = 30;\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\n/**\n * Per-second request ceiling for restarting a universe's servers, from\n * `Cloud_RestartUniverseServers` in the Open Cloud OpenAPI schema (30\n * requests per minute per API key owner). The burst grants the whole\n * minute's quota up front, since the default of one token would pace a\n * sub-second limit at one call every two seconds.\n */\nexport const RESTART_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tburstCapacity: RESTART_SERVERS_PER_MINUTE,\n\tmaxPerSecond: RESTART_SERVERS_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"universes.restartServers\",\n});\n\n/**\n * Scopes required to restart a universe's servers, sourced from\n * `x-roblox-scopes` on the `Cloud_RestartUniverseServers` operation in the\n * vendored OpenAPI schema.\n */\nexport const RESTART_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"universe:write\"]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { UnexpectedResponseError } from \"../../../errors/unexpected-response.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport { toJsonDetails } from \"../../../internal/utils/to-json-details.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\nconst UNIVERSE_PATH_PATTERN = /^universes\\/(\\d+)$/;\n\nconst ROOT_PLACE_PATH_PATTERN = /\\/places\\/(\\d+)$/;\n\nconst OWNER_PATH_PATTERN = /^(?:users|groups)\\/(\\d+)$/;\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 UnexpectedResponseError} when the body does not match the wire\n * schema.\n */\nexport function parseUniverseResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<Universe, UnexpectedResponseError> {\n\tif (!isUniverseWire(body)) {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\tconst ownerResult = resolveOwner(body);\n\tif (!ownerResult.success) {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\tconst idMatch = UNIVERSE_PATH_PATTERN.exec(body.path);\n\tconst id = idMatch?.[1];\n\tif (id === undefined) {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\treturn { data: toUniverse({ id, body, owner: ownerResult.data }), success: true };\n}\n\nfunction malformed(statusCode: number, body: unknown): Result<Universe, UnexpectedResponseError> {\n\treturn {\n\t\terr: new UnexpectedResponseError(MALFORMED_MESSAGE, {\n\t\t\tdetails: toJsonDetails(body),\n\t\t\tstatusCode,\n\t\t}),\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 = ROOT_PLACE_PATH_PATTERN.exec(rootPlace);\n\treturn match?.[1];\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 toSocialLink(wire: unknown): SocialLink | undefined {\n\tif (!isSocialLinkWire(wire)) {\n\t\treturn undefined;\n\t}\n\n\treturn { title: wire.title, uri: wire.uri };\n}\n\nfunction toUniverse({ id, body, owner }: ToUniverseArgs): Universe {\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 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 = OWNER_PATH_PATTERN.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 game-icon Operations on\n * `UniversesClient.icon`, from each operation's\n * `x-roblox-rate-limits.perApiKeyOwner` in the vendored schema (100 requests\n * per minute). This family's key stays separate from other\n * game-internationalization families: the #587 probe measured independent\n * reported 100/minute counters. Successful writes may have additional service\n * limits; see `docs/spikes/game-internationalization-rate-limits/README.md`.\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 { UnexpectedResponseError } from \"../../../errors/unexpected-response.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport { toJsonDetails } from \"../../../internal/utils/to-json-details.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 * `UnexpectedResponseError` when the body does not match the wire schema.\n */\nexport function parseIconListResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<ReadonlyArray<ExperienceIcon>, UnexpectedResponseError> {\n\tif (!isGameIconListWire(body)) {\n\t\treturn {\n\t\t\terr: new UnexpectedResponseError(\"Malformed icon list response\", {\n\t\t\t\tdetails: toJsonDetails(body),\n\t\t\t\tstatusCode,\n\t\t\t}),\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\t(value[\"imageId\"] === null || typeof 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 ?? undefined,\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 { parsePositiveIntegerIds } from \"../../../internal/utils/positive-integer-id.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\tlanguageCode,\n\torderedImageIds,\n\tuniverseId,\n}: ReorderExperienceThumbnailsParameters): Result<HttpRequest, ValidationError> {\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 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 parsePositiveIntegerIds(orderedImageIds, {\n\t\tcode: \"invalid_image_id\",\n\t\tfield: \"orderedImageIds\",\n\t});\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/**\n * Per-second request ceiling for game-thumbnails Operations on\n * `UniversesClient.thumbnails`, from each operation's\n * `x-roblox-rate-limits.perApiKeyOwner` in the vendored schema (100 requests\n * per minute). This family's key stays separate from other\n * game-internationalization families: the #587 probe measured independent\n * reported 100/minute counters on rejected requests. Successful writes may\n * have additional service limits; see\n * `docs/spikes/game-internationalization-rate-limits/README.md`.\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 { UnexpectedResponseError } from \"../../../errors/unexpected-response.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport { toJsonDetails } from \"../../../internal/utils/to-json-details.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 * `UnexpectedResponseError` when the body does not match the wire schema.\n */\nexport function parseThumbnailUploadResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<UploadedExperienceThumbnail, UnexpectedResponseError> {\n\tif (!isGameThumbnailUploadWire(body)) {\n\t\treturn {\n\t\t\terr: new UnexpectedResponseError(\"Malformed thumbnail upload response\", {\n\t\t\t\tdetails: toJsonDetails(body),\n\t\t\t\tstatusCode,\n\t\t\t}),\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 { OpenCloudError } from \"../../../errors/base.ts\";\nimport type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { okRequest } from \"../../../internal/resource-client.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { ActivateUniverseParameters, DeactivateUniverseParameters } from \"./types.ts\";\n\n/**\n * Builds the Open Cloud experience activation request.\n * @param parameters - The universe identifier.\n * @returns The POST request wrapped in a success Result.\n */\nexport function buildActivateRequest(\n\tparameters: ActivateUniverseParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest({\n\t\tmethod: \"POST\",\n\t\turl: `/legacy-develop/v1/universes/${parameters.universeId}/activate`,\n\t});\n}\n\n/**\n * Builds the Open Cloud experience deactivation request.\n * @param parameters - The universe identifier.\n * @returns The POST request wrapped in a success Result.\n */\nexport function buildDeactivateRequest(\n\tparameters: DeactivateUniverseParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest({\n\t\tmethod: \"POST\",\n\t\turl: `/legacy-develop/v1/universes/${parameters.universeId}/deactivate`,\n\t});\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/**\n * OpenAPI specifies 100 requests per minute per API key owner or OAuth\n * authorization.\n */\nexport const ACTIVATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 100 / 60,\n\toperationKey: \"universes.activate\",\n});\n\n/**\n * OpenAPI specifies 100 requests per minute per API key owner or OAuth\n * authorization.\n */\nexport const DEACTIVATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 100 / 60,\n\toperationKey: \"universes.deactivate\",\n});\n\n/** Required scope declared by both experience visibility operations. */\nexport const ACTIVATION_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"legacy-universe:manage\",\n]);\n","import { buildGetRequest } from \"../../domains/cloud-v2/universes/builders.ts\";\nimport { GET_OPERATION_LIMIT } from \"../../domains/cloud-v2/universes/operations.ts\";\nimport { parseUniverseResponse } from \"../../domains/cloud-v2/universes/parsers.ts\";\nimport type { GetUniverseParameters, Universe } from \"../../domains/cloud-v2/universes/types.ts\";\nimport {\n\tbuildActivateRequest,\n\tbuildDeactivateRequest,\n} from \"../../domains/develop/universes/builders.ts\";\nimport {\n\tACTIVATE_OPERATION_LIMIT,\n\tACTIVATION_REQUIRED_SCOPES,\n\tDEACTIVATE_OPERATION_LIMIT,\n} from \"../../domains/develop/universes/operations.ts\";\nimport type {\n\tActivateUniverseParameters,\n\tDeactivateUniverseParameters,\n} from \"../../domains/develop/universes/types.ts\";\nimport { CREATE_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport { parseEmptyResponse, type ResourceMethodSpec } from \"../../internal/resource-client.ts\";\n\nexport const 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\nexport const ACTIVATE_SPEC: ResourceMethodSpec<ActivateUniverseParameters, undefined> =\n\tObject.freeze({\n\t\tbuildRequest: buildActivateRequest,\n\t\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\t\tmethodKind: \"create\",\n\t\toperationLimit: ACTIVATE_OPERATION_LIMIT,\n\t\tparse: parseEmptyResponse,\n\t\trequiredScopes: ACTIVATION_REQUIRED_SCOPES,\n\t});\n\nexport const DEACTIVATE_SPEC: ResourceMethodSpec<DeactivateUniverseParameters, undefined> =\n\tObject.freeze({\n\t\tbuildRequest: buildDeactivateRequest,\n\t\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\t\tmethodKind: \"create\",\n\t\toperationLimit: DEACTIVATE_OPERATION_LIMIT,\n\t\tparse: parseEmptyResponse,\n\t\trequiredScopes: ACTIVATION_REQUIRED_SCOPES,\n\t});\n","import { ApiError, requestContextOf } from \"../../errors/api-error.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { isRecord } from \"../../internal/utils/is-record.ts\";\n\n/**\n * Adds the known eligibility explanation without diagnosing a missing rating.\n *\n * @param err - The activation attempt's transport error.\n * @returns An error retaining the original request and response evidence.\n */\nexport function explainActivationError(err: OpenCloudError): OpenCloudError {\n\tif (!(err instanceof ApiError) || err.statusCode !== 403) {\n\t\treturn err;\n\t}\n\n\tconst code = err.code ?? (isRecord(err.details) ? err.details[\"code\"] : undefined);\n\tif (code !== 3 && code !== \"3\") {\n\t\treturn err;\n\t}\n\n\treturn new ApiError(\n\t\t`${err.message} A missing content maturity rating is a possible cause; complete the content questionnaire in Creator Hub.`,\n\t\t{\n\t\t\t...requestContextOf(err),\n\t\t\tcause: err,\n\t\t\tcode: err.code,\n\t\t\tdetails: err.details,\n\t\t\tstatusCode: err.statusCode,\n\t\t},\n\t);\n}\n","import type { RequestOptions } from \"../../client/types.ts\";\nimport type { ActivateUniverseParameters } from \"../../domains/develop/universes/types.ts\";\nimport { ApiError } from \"../../errors/api-error.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport type { ResourceClient } from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\nimport { explainActivationError } from \"./activation-error.ts\";\nimport { ACTIVATE_SPEC, DEACTIVATE_SPEC, GET_SPEC } from \"./activation-specs.ts\";\n\ninterface VisibilityCall {\n\treadonly options: RequestOptions | undefined;\n\treadonly parameters: ActivateUniverseParameters;\n\treadonly visibility: \"private\" | \"public\";\n}\n\n/**\n * Changes visibility and verifies an ambiguous gateway timeout through a read.\n * @param inner - The universe client's shared request pipeline.\n * @param call - The universe, desired visibility and request overrides.\n * @returns A success only when the write or verification confirms it.\n */\nexport async function setVisibilityAsync(\n\tinner: ResourceClient,\n\t{ options, parameters, visibility }: VisibilityCall,\n): Promise<Result<undefined, OpenCloudError>> {\n\tconst activating = visibility === \"public\";\n\tconst result = await inner.executeAsync({\n\t\toptions: {\n\t\t\t...options,\n\t\t\tretryableStatuses:\n\t\t\t\toptions?.retryableStatuses?.filter((status) => status !== 504) ??\n\t\t\t\tCREATE_METHOD_DEFAULTS.retryableStatuses,\n\t\t},\n\t\tparameters,\n\t\trefineError: activating ? explainActivationError : undefined,\n\t\tspec: activating ? ACTIVATE_SPEC : DEACTIVATE_SPEC,\n\t});\n\tif (result.success || !(result.err instanceof ApiError) || result.err.statusCode !== 504) {\n\t\treturn result;\n\t}\n\n\tconst observed = await inner.executeAsync({ options, parameters, spec: GET_SPEC });\n\tif (observed.success && observed.data.visibility === visibility) {\n\t\treturn { data: undefined, success: true };\n\t}\n\n\treturn result;\n}\n","import type { HttpRequest } from \"../../../client/types.ts\";\nimport type { OpenCloudError } from \"../../../errors/base.ts\";\nimport { okRequest } from \"../../../internal/resource-client.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type {\n\tForecastRestartParameters,\n\tLaunchRestartParameters,\n\tListRestartsParameters,\n} from \"./types.ts\";\n\n/**\n * Builds a `GET` request for the server-management restart forecast.\n *\n * @param parameters - The universe identifier.\n * @returns A success result wrapping the request; the builder cannot fail.\n */\nexport function buildForecastRequest(\n\tparameters: ForecastRestartParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest({\n\t\tmethod: \"GET\",\n\t\turl: `/server-management/v1/universes/${parameters.universeId}/restarts:forecast`,\n\t});\n}\n\n/**\n * Builds a `POST` request that launches a server-management restart. The\n * body is never omitted: the endpoint answers 415 to a POST without one.\n *\n * @param parameters - The universe identifier and restart selection.\n * @returns A success result wrapping the request; the builder cannot fail.\n */\nexport function buildLaunchRequest({\n\tuniverseId,\n\t...selection\n}: LaunchRestartParameters): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest({\n\t\tbody: selection,\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"POST\",\n\t\turl: `/server-management/v1/universes/${universeId}/restarts`,\n\t});\n}\n\n/**\n * Builds a `GET` request that lists a universe's server-management\n * restarts.\n *\n * @param parameters - The universe identifier.\n * @returns A success result wrapping the request; the builder cannot fail.\n */\nexport function buildListRequest(\n\tparameters: ListRestartsParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest({\n\t\tmethod: \"GET\",\n\t\turl: `/server-management/v1/universes/${parameters.universeId}/restarts`,\n\t});\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 `Restarts_ForecastRestart`, from the\n * Open Cloud OpenAPI schema (100 requests per minute per API key owner).\n * Live headers show it metered apart from launch and list.\n */\nexport const FORECAST_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"restarts.forecast\",\n});\n\n/**\n * Scopes required to read restart forecasts and statuses, sourced from\n * `x-roblox-scopes` on `Restarts_ForecastRestart` and\n * `Restarts_ListRestartStatuses` in the vendored OpenAPI schema.\n */\nexport const READ_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"universe:read\"]);\n\n/**\n * Per-second request ceiling for `Restarts_LaunchRestart`, from the Open\n * Cloud OpenAPI schema (100 requests per minute per API key owner).\n */\nexport const LAUNCH_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"restarts.launch\",\n});\n\n/**\n * Scopes required to launch a restart, sourced from `x-roblox-scopes` on\n * `Restarts_LaunchRestart` in the vendored OpenAPI schema.\n */\nexport const LAUNCH_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"universe:write\"]);\n\n/**\n * Per-second request ceiling for `Restarts_ListRestartStatuses`, from the\n * Open Cloud OpenAPI schema (100 requests per minute per API key owner).\n */\nexport const LIST_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"restarts.list\",\n});\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { UnexpectedResponseError } from \"../../../errors/unexpected-response.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport { toJsonDetails } from \"../../../internal/utils/to-json-details.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type {\n\tLaunchedRestart,\n\tPlaceRestartForecast,\n\tPlaceRestartStatus,\n\tRestartPlaceFilter,\n\tRestartStatus,\n} from \"./types.ts\";\nimport type {\n\tForecastRestartResponseWire,\n\tLaunchRestartResponseWire,\n\tListRestartStatusesResponseWire,\n\tPlaceFilterWire,\n\tPlaceRestartStatusWire,\n\tPlaceSummaryForGameRestartWire,\n\tRestartStatusWire,\n} from \"./wire.ts\";\n\nconst RESTART_STATES: ReadonlySet<unknown> = new Set([\"DELAYING\", \"RESTARTING\", \"SUCCEEDED\"]);\n\n/** The ID Roblox returns from a launch that matched no live server. */\nconst NIL_RESTART_ID = \"00000000-0000-0000-0000-000000000000\";\n\ninterface MalformedBody {\n\treadonly body: unknown;\n\treadonly statusCode: number;\n}\n\n/**\n * Parses a `ForecastRestartResponse` body into one\n * {@link PlaceRestartForecast} per place.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the forecasts, or an {@link UnexpectedResponseError}\n * when the body does not match the wire schema.\n */\nexport function parseForecastResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<ReadonlyArray<PlaceRestartForecast>, UnexpectedResponseError> {\n\tif (!isForecastWire(body)) {\n\t\treturn malformed(\"Malformed restart forecast response\", { body, statusCode });\n\t}\n\n\tconst forecasts = Object.entries(body.placeForecasts ?? {}).map(([placeId, summary]) => {\n\t\treturn toForecast(placeId, summary);\n\t});\n\treturn { data: forecasts, success: true };\n}\n\n/**\n * Parses a `LaunchRestartResponse` body into a {@link LaunchedRestart}.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the launched restart, or an\n * {@link UnexpectedResponseError} when the body does not match the wire\n * schema.\n */\nexport function parseLaunchResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<LaunchedRestart, UnexpectedResponseError> {\n\tif (!isLaunchWire(body)) {\n\t\treturn malformed(\"Malformed restart launch response\", { body, statusCode });\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tid: body.id === NIL_RESTART_ID ? undefined : (body.id ?? undefined),\n\t\t\tinstancesImpacted: body.instancesImpacted,\n\t\t\tplayersImpacted: body.playersImpacted,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\n/**\n * Parses a `ListRestartStatusesResponse` body into one\n * {@link RestartStatus} per restart.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the restarts, or an {@link UnexpectedResponseError}\n * when the body does not match the wire schema.\n */\nexport function parseListResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<ReadonlyArray<RestartStatus>, UnexpectedResponseError> {\n\tif (!isListWire(body)) {\n\t\treturn malformed(\"Malformed restart list response\", { body, statusCode });\n\t}\n\n\tconst restarts = Object.entries(body.restartStatuses ?? {}).map(([id, status]) => {\n\t\treturn toRestartStatus(id, status);\n\t});\n\treturn { data: restarts, success: true };\n}\n\nfunction malformed(\n\tmessage: string,\n\t{ body, statusCode }: MalformedBody,\n): Result<never, UnexpectedResponseError> {\n\treturn {\n\t\terr: new UnexpectedResponseError(message, { details: toJsonDetails(body), statusCode }),\n\t\tsuccess: false,\n\t};\n}\n\nfunction toForecast(\n\tplaceId: string,\n\tsummary: PlaceSummaryForGameRestartWire,\n): PlaceRestartForecast {\n\treturn {\n\t\tinstancesImpacted: summary.instancesImpacted,\n\t\tinstancesPerVersion: summary.instancesPerVersion ?? {},\n\t\tisNotInUniverse: summary.isNotInUniverse,\n\t\tlatestPlaceVersion: summary.latestPlaceVersion ?? undefined,\n\t\tplaceId,\n\t\tplayersImpacted: summary.playersImpacted,\n\t\tplayersPerVersion: summary.playersPerVersion ?? {},\n\t\tpublishedAt: new Date(summary.publishTime),\n\t\ttotalInstances: summary.totalInstances,\n\t\ttotalPlayers: summary.totalPlayers,\n\t};\n}\n\n/**\n * Whether a nullable wire field carries no value: absent, `undefined`, or\n * JSON `null`.\n *\n * @param value - The wire value.\n * @returns `true` when the field carries no value.\n */\nfunction isAbsent(value: unknown): boolean {\n\treturn (value ?? undefined) === undefined;\n}\n\nfunction isOptional(value: unknown, isPresent: (present: unknown) => boolean): boolean {\n\treturn isAbsent(value) || isPresent(value);\n}\n\nfunction isOptionalRecordOf(value: unknown, isEntry: (entry: unknown) => boolean): boolean {\n\treturn isOptional(value, (record) => isRecord(record) && Object.values(record).every(isEntry));\n}\n\nfunction isNumber(value: unknown): boolean {\n\treturn typeof value === \"number\";\n}\n\nfunction isString(value: unknown): boolean {\n\treturn typeof value === \"string\";\n}\n\nfunction isPlaceSummaryWire(value: unknown): value is PlaceSummaryForGameRestartWire {\n\treturn (\n\t\tisRecord(value) &&\n\t\ttypeof value[\"instancesImpacted\"] === \"number\" &&\n\t\ttypeof value[\"isNotInUniverse\"] === \"boolean\" &&\n\t\ttypeof value[\"playersImpacted\"] === \"number\" &&\n\t\tisDateTimeString(value[\"publishTime\"]) &&\n\t\ttypeof value[\"totalInstances\"] === \"number\" &&\n\t\ttypeof value[\"totalPlayers\"] === \"number\" &&\n\t\tisOptional(value[\"latestPlaceVersion\"], isString) &&\n\t\tisOptionalRecordOf(value[\"instancesPerVersion\"], isNumber) &&\n\t\tisOptionalRecordOf(value[\"playersPerVersion\"], isNumber)\n\t);\n}\n\nfunction isForecastWire(body: unknown): body is ForecastRestartResponseWire {\n\treturn isRecord(body) && isOptionalRecordOf(body[\"placeForecasts\"], isPlaceSummaryWire);\n}\n\nfunction isLaunchWire(body: unknown): body is LaunchRestartResponseWire {\n\treturn (\n\t\tisRecord(body) &&\n\t\tisOptional(body[\"id\"], isString) &&\n\t\ttypeof body[\"instancesImpacted\"] === \"number\" &&\n\t\ttypeof body[\"playersImpacted\"] === \"number\"\n\t);\n}\n\nfunction toFilter(filter: PlaceFilterWire | undefined): RestartPlaceFilter | undefined {\n\tconst wire = filter ?? undefined;\n\tif (wire === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst versions = wire.versions ?? undefined;\n\tif (versions !== undefined) {\n\t\treturn { versions };\n\t}\n\n\tconst excludeCurrentVersion = wire.excludeCurrentVersion ?? undefined;\n\treturn excludeCurrentVersion === undefined ? {} : { excludeCurrentVersion };\n}\n\nfunction toPlaceStatus(placeId: string, wire: PlaceRestartStatusWire): PlaceRestartStatus {\n\treturn {\n\t\tendedAt: typeof wire.endTime === \"string\" ? new Date(wire.endTime) : undefined,\n\t\tfilter: toFilter(wire.filter),\n\t\tlatestVersion: wire.latestVersion ?? undefined,\n\t\tplaceId,\n\t\tremainingInstances: wire.remainingInstances,\n\t\tremainingPlayers: wire.remainingPlayers,\n\t\tstartedAt: new Date(wire.startTime),\n\t\tstate: wire.state,\n\t\ttotalInstances: wire.totalInstances,\n\t\ttotalPlayers: wire.totalPlayers,\n\t};\n}\n\nfunction toRestartStatus(id: string, wire: RestartStatusWire): RestartStatus {\n\tconst places = Object.entries(wire.placeRestartStatuses ?? {}).map(([placeId, status]) => {\n\t\treturn toPlaceStatus(placeId, status);\n\t});\n\treturn {\n\t\tid,\n\t\tplaces,\n\t\tscheduledAt: new Date(wire.scheduledTime),\n\t\tstartsAt: new Date(wire.startTime),\n\t};\n}\n\nfunction isVersions(value: unknown): boolean {\n\treturn Array.isArray(value) && value.every(isNumber);\n}\n\nfunction isFilterWire(value: unknown): boolean {\n\treturn (\n\t\tisRecord(value) &&\n\t\tisOptional(value[\"excludeCurrentVersion\"], (exclude) => typeof exclude === \"boolean\") &&\n\t\tisOptional(value[\"versions\"], isVersions)\n\t);\n}\n\nfunction isPlaceStatusWire(value: unknown): value is PlaceRestartStatusWire {\n\treturn (\n\t\tisRecord(value) &&\n\t\tRESTART_STATES.has(value[\"state\"]) &&\n\t\tisDateTimeString(value[\"startTime\"]) &&\n\t\tisOptional(value[\"endTime\"], isDateTimeString) &&\n\t\ttypeof value[\"totalPlayers\"] === \"number\" &&\n\t\ttypeof value[\"totalInstances\"] === \"number\" &&\n\t\ttypeof value[\"remainingPlayers\"] === \"number\" &&\n\t\ttypeof value[\"remainingInstances\"] === \"number\" &&\n\t\tisOptional(value[\"filter\"], isFilterWire) &&\n\t\tisOptional(value[\"latestVersion\"], isString)\n\t);\n}\n\nfunction isRestartStatusWire(value: unknown): value is RestartStatusWire {\n\treturn (\n\t\tisRecord(value) &&\n\t\tisDateTimeString(value[\"scheduledTime\"]) &&\n\t\tisDateTimeString(value[\"startTime\"]) &&\n\t\tisOptionalRecordOf(value[\"placeRestartStatuses\"], isPlaceStatusWire)\n\t);\n}\n\nfunction isListWire(body: unknown): body is ListRestartStatusesResponseWire {\n\treturn isRecord(body) && isOptionalRecordOf(body[\"restartStatuses\"], isRestartStatusWire);\n}\n","import type { Except } from \"type-fest\";\n\nimport type { OutdatedRestart, PlaceOutdatedRestart, PlaceRestartForecast } from \"./types.ts\";\n\n/** The requested places, their outdated servers, and those to restart. */\nexport interface OutdatedSelection {\n\t/** Requested places with at least one outdated server, in request order. */\n\treadonly placeIds: ReadonlyArray<string>;\n\t/** One entry per requested place (duplicates removed), in request order. */\n\treadonly places: ReadonlyArray<Except<PlaceOutdatedRestart, \"restarted\">>;\n}\n\n/**\n * Selects the requested places whose forecast counts outdated servers. A\n * place missing from the forecast has no live server and counts 0. A\n * repeated place ID counts once, at its first position.\n *\n * @param placeIds - The requested place IDs.\n * @param forecasts - The universe's restart forecast.\n * @returns Each requested place with its outdated server count, and the\n * places to restart.\n */\nexport function selectOutdatedPlaces(\n\tplaceIds: ReadonlyArray<string>,\n\tforecasts: ReadonlyArray<PlaceRestartForecast>,\n): OutdatedSelection {\n\tconst impacted = new Map(\n\t\tforecasts.map((forecast) => [forecast.placeId, forecast.instancesImpacted]),\n\t);\n\tconst places = Array.from(new Set(placeIds), (placeId) => {\n\t\treturn { instancesImpacted: impacted.get(placeId) ?? 0, placeId };\n\t});\n\n\treturn {\n\t\tplaceIds: places\n\t\t\t.filter(({ instancesImpacted }) => instancesImpacted > 0)\n\t\t\t.map(({ placeId }) => placeId),\n\t\tplaces,\n\t};\n}\n\n/**\n * Builds the per-place outcome of a restart of `selection.placeIds`.\n *\n * @param selection - The selection that drove the final decision.\n * @param restarted - Whether the restart call for the selection succeeded.\n * @returns The outcome, with only the selected places marked restarted.\n */\nexport function summarizeOutdatedRestart(\n\tselection: OutdatedSelection,\n\trestarted: boolean,\n): OutdatedRestart {\n\treturn {\n\t\tplaces: selection.places.map((place) => {\n\t\t\treturn { ...place, restarted: restarted && place.instancesImpacted > 0 };\n\t\t}),\n\t\trestarted,\n\t};\n}\n","import type { RequestOptions } from \"../../client/types.ts\";\nimport { buildRestartServersRequest } from \"../../domains/cloud-v2/universes/builders.ts\";\nimport {\n\tRESTART_OPERATION_LIMIT,\n\tRESTART_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/universes/operations.ts\";\nimport type { RestartUniverseServersParameters } from \"../../domains/cloud-v2/universes/types.ts\";\nimport {\n\tbuildForecastRequest,\n\tbuildLaunchRequest,\n\tbuildListRequest,\n} from \"../../domains/server-management/restarts/builders.ts\";\nimport {\n\tFORECAST_OPERATION_LIMIT,\n\tLAUNCH_OPERATION_LIMIT,\n\tLAUNCH_REQUIRED_SCOPES,\n\tLIST_OPERATION_LIMIT,\n\tREAD_REQUIRED_SCOPES,\n} from \"../../domains/server-management/restarts/operations.ts\";\nimport {\n\tparseForecastResponse,\n\tparseLaunchResponse,\n\tparseListResponse,\n} from \"../../domains/server-management/restarts/parsers.ts\";\nimport {\n\ttype OutdatedSelection,\n\tselectOutdatedPlaces,\n\tsummarizeOutdatedRestart,\n} from \"../../domains/server-management/restarts/select-outdated.ts\";\nimport type {\n\tForecastRestartParameters,\n\tLaunchedRestart,\n\tLaunchRestartParameters,\n\tListRestartsParameters,\n\tOutdatedRestart,\n\tPlaceRestartForecast,\n\tRestartOutdatedParameters,\n\tRestartStatus,\n} from \"../../domains/server-management/restarts/types.ts\";\nimport { ApiError } from \"../../errors/api-error.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS, IDEMPOTENT_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport {\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 FORECAST_SPEC = makeSpec<ForecastRestartParameters, ReadonlyArray<PlaceRestartForecast>>({\n\tbuildRequest: buildForecastRequest,\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: FORECAST_OPERATION_LIMIT,\n\tparse: parseForecastResponse,\n\trequiredScopes: READ_REQUIRED_SCOPES,\n});\n\n// A launch is not safe to repeat: a 5xx may follow an accepted restart,\n// and Roblox answers some requests with a steady 500 (see\n// docs/spikes/restart-servers). So the retry policy mirrors `create`.\nconst LAUNCH_SPEC = makeSpec<LaunchRestartParameters, LaunchedRestart>({\n\tbuildRequest: buildLaunchRequest,\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: LAUNCH_OPERATION_LIMIT,\n\tparse: parseLaunchResponse,\n\trequiredScopes: LAUNCH_REQUIRED_SCOPES,\n});\n\n// Unlike `LAUNCH_SPEC`, this restart is safe to repeat: it selects only\n// servers on an older place version, so a repeat closes only servers that\n// are still outdated. So a 429, 502, 503 or 504 is retried. A 500 is not:\n// Roblox answers a steady 500 when a listed place has no live server, so\n// `restartOutdated` reads the forecast again instead of spending backed-off\n// retries on it. `methodKind: \"create\"` makes these defaults win over the\n// client-level retry config, whose default retries a 500; a per-request\n// override still wins. It shares the `restartServers` operation key, and so\n// its rate-limit queue.\nconst RESTART_OUTDATED_SPEC = makeSpec<RestartUniverseServersParameters, undefined>({\n\tbuildRequest: buildRestartServersRequest,\n\tmethodDefaults: Object.freeze({\n\t\tretryableStatuses: Object.freeze([429, 502, 503, 504] as const),\n\t\tretryableTransportCodes: IDEMPOTENT_METHOD_DEFAULTS.retryableTransportCodes,\n\t}),\n\tmethodKind: \"create\",\n\toperationLimit: RESTART_OPERATION_LIMIT,\n\tparse: parseEmptyResponse,\n\trequiredScopes: RESTART_REQUIRED_SCOPES,\n});\n\nconst LIST_SPEC = makeSpec<ListRestartsParameters, ReadonlyArray<RestartStatus>>({\n\tbuildRequest: buildListRequest,\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: LIST_OPERATION_LIMIT,\n\tparse: parseListResponse,\n\trequiredScopes: READ_REQUIRED_SCOPES,\n});\n\n/**\n * Operation Group on `UniversesClient` that exposes the server-management\n * restart endpoints: preview a restart, launch one, and track it. Its\n * `restartOutdated` also uses the universe `:restartServers` method. The\n * server-management endpoints are BETA on the Roblox side.\n */\nexport class UniverseRestartsGroup {\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 * Reads the live servers of every active place in a universe, and how\n\t * many of them a restart of old place versions would close.\n\t *\n\t * @param parameters - The universe identifier.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping one {@link PlaceRestartForecast}\n\t * per active place (empty when no server runs), or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async forecast(\n\t\tparameters: ForecastRestartParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<ReadonlyArray<PlaceRestartForecast>, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: FORECAST_SPEC });\n\t}\n\n\t/**\n\t * Launches a restart of a universe's live servers and returns its ID,\n\t * which `list` reports while the restart runs. When no live server\n\t * matches, Roblox records no restart and `id` is `undefined`.\n\t *\n\t * @example\n\t * ```ts\n\t * import { createFakeHttpClient } from \"@bedrock-rbx/ocale/testing\";\n\t * import { UniversesClient } from \"@bedrock-rbx/ocale/universes\";\n\t *\n\t * const httpClient = createFakeHttpClient().mockResponse({\n\t * body: {\n\t * id: \"00000000-0000-0000-0000-000000000000\",\n\t * instancesImpacted: 0,\n\t * playersImpacted: 0,\n\t * },\n\t * status: 200,\n\t * });\n\t * const client = new UniversesClient({\n\t * credential: { apiKey: \"your-key\", kind: \"apiKey\" },\n\t * httpClient,\n\t * });\n\t *\n\t * return client.restarts\n\t * .launch({ bleedOffDurationMinutes: 5, universeId: \"42\" })\n\t * .then((result) => {\n\t * expect(result).toEqual({\n\t * data: { id: undefined, instancesImpacted: 0, playersImpacted: 0 },\n\t * success: true,\n\t * });\n\t * });\n\t * ```\n\t *\n\t * @param parameters - The universe identifier.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the {@link LaunchedRestart}, or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async launch(\n\t\tparameters: LaunchRestartParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LaunchedRestart, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: LAUNCH_SPEC });\n\t}\n\n\t/**\n\t * Lists a universe's restarts with their progress per place. A\n\t * `:restartServers` call that selected a server appears here too, but\n\t * only `launch` returns the ID to match it by.\n\t *\n\t * @param parameters - The universe identifier.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping one {@link RestartStatus} per\n\t * restart, or the {@link OpenCloudError} that caused the request to\n\t * fail.\n\t */\n\tpublic async list(\n\t\tparameters: ListRestartsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<ReadonlyArray<RestartStatus>, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: LIST_SPEC });\n\t}\n\n\t/**\n\t * Restarts only the servers that run an older version of the given\n\t * places, for example after a publish. It reads the forecast\n\t * (`universe:read`), keeps each place with at least one outdated\n\t * server, and sends one `:restartServers` call (`universe:write`) for\n\t * them. When no place has an outdated server, it sends no restart.\n\t *\n\t * Roblox answers a 500 when any listed place has no live server, which\n\t * happens when a place loses its last outdated server between the\n\t * forecast and the restart. On that 500 it reads the forecast once more\n\t * and sends one more restart for the places still outdated. A 502, 503\n\t * or 504 on the restart is retried. The selection relies on the\n\t * forecast's `instancesImpacted` counting only servers on an older\n\t * version, which live captures show but Roblox does not document.\n\t *\n\t * @example\n\t * ```ts\n\t * import { createFakeHttpClient } from \"@bedrock-rbx/ocale/testing\";\n\t * import { UniversesClient } from \"@bedrock-rbx/ocale/universes\";\n\t *\n\t * const httpClient = createFakeHttpClient()\n\t * .mockResponse({\n\t * body: {\n\t * placeForecasts: {\n\t * 111: {\n\t * instancesImpacted: 2,\n\t * instancesPerVersion: { 5: 2, 6: 1 },\n\t * isNotInUniverse: false,\n\t * latestPlaceVersion: \"6\",\n\t * playersImpacted: 4,\n\t * playersPerVersion: { 5: 4, 6: 1 },\n\t * publishTime: \"2026-04-24T02:36:28.673Z\",\n\t * totalInstances: 3,\n\t * totalPlayers: 5,\n\t * },\n\t * },\n\t * },\n\t * status: 200,\n\t * })\n\t * .mockResponse({ body: {}, status: 200 });\n\t * const client = new UniversesClient({\n\t * credential: { apiKey: \"your-key\", kind: \"apiKey\" },\n\t * httpClient,\n\t * });\n\t *\n\t * return client.restarts\n\t * .restartOutdated({ placeIds: [\"111\", \"222\"], universeId: \"42\" })\n\t * .then((result) => {\n\t * expect(result).toEqual({\n\t * data: {\n\t * places: [\n\t * { instancesImpacted: 2, placeId: \"111\", restarted: true },\n\t * { instancesImpacted: 0, placeId: \"222\", restarted: false },\n\t * ],\n\t * restarted: true,\n\t * },\n\t * success: true,\n\t * });\n\t * });\n\t * ```\n\t *\n\t * @param parameters - The universe and the places to check.\n\t * @param options - Optional per-request overrides, applied to every\n\t * request.\n\t * @returns A {@link Result} wrapping the {@link OutdatedRestart}, or\n\t * the {@link OpenCloudError} that caused a request to fail.\n\t */\n\tpublic async restartOutdated(\n\t\t{ placeIds, universeId }: RestartOutdatedParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<OutdatedRestart, OpenCloudError>> {\n\t\t// Built only to validate `placeIds` before the forecast; then discarded.\n\t\tconst validated = buildRestartServersRequest({ placeIds, universeId });\n\t\tif (!validated.success) {\n\t\t\treturn validated;\n\t\t}\n\n\t\tlet selection = await this.#selectOutdated({ placeIds, universeId }, options);\n\t\tif (!selection.success) {\n\t\t\treturn selection;\n\t\t}\n\n\t\tlet restart = await this.#restartSelected(\n\t\t\t{ placeIds: selection.data.placeIds, universeId },\n\t\t\toptions,\n\t\t);\n\t\tif (!restart.success && restart.err instanceof ApiError && restart.err.statusCode === 500) {\n\t\t\tselection = await this.#selectOutdated({ placeIds, universeId }, options);\n\t\t\tif (!selection.success) {\n\t\t\t\treturn selection;\n\t\t\t}\n\n\t\t\trestart = await this.#restartSelected(\n\t\t\t\t{ placeIds: selection.data.placeIds, universeId },\n\t\t\t\toptions,\n\t\t\t);\n\t\t}\n\n\t\tconst restarted = selection.data.placeIds.length > 0;\n\t\treturn restart.success\n\t\t\t? { data: summarizeOutdatedRestart(selection.data, restarted), success: true }\n\t\t\t: restart;\n\t}\n\n\tasync #restartSelected(\n\t\tparameters: RestartOutdatedParameters,\n\t\toptions: RequestOptions | undefined,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\tif (parameters.placeIds.length === 0) {\n\t\t\treturn { data: undefined, success: true };\n\t\t}\n\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: RESTART_OUTDATED_SPEC });\n\t}\n\n\tasync #selectOutdated(\n\t\t{ placeIds, universeId }: RestartOutdatedParameters,\n\t\toptions: RequestOptions | undefined,\n\t): Promise<Result<OutdatedSelection, OpenCloudError>> {\n\t\tconst forecast = await this.forecast({ universeId }, options);\n\t\tif (!forecast.success) {\n\t\t\treturn forecast;\n\t\t}\n\n\t\treturn { data: selectOutdatedPlaces(placeIds, forecast.data), success: true };\n\t}\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport {\n\tbuildRestartServersRequest,\n\tbuildUpdateRequest,\n} from \"../../domains/cloud-v2/universes/builders.ts\";\nimport {\n\tRESTART_OPERATION_LIMIT,\n\tRESTART_REQUIRED_SCOPES,\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\tRestartUniverseServersParameters,\n\tUniverse,\n\tUpdateUniverseParameters,\n} from \"../../domains/cloud-v2/universes/types.ts\";\nimport type {\n\tActivateUniverseParameters,\n\tDeactivateUniverseParameters,\n} from \"../../domains/develop/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\";\nimport { GET_SPEC } from \"./activation-specs.ts\";\nimport { setVisibilityAsync } from \"./activation.ts\";\nimport { UniverseRestartsGroup } from \"./restarts-group.ts\";\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\nconst RESTART_SERVERS_SPEC: ResourceMethodSpec<RestartUniverseServersParameters, undefined> =\n\tObject.freeze({\n\t\tbuildRequest: buildRestartServersRequest,\n\t\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\t\tmethodKind: \"create\",\n\t\toperationLimit: RESTART_OPERATION_LIMIT,\n\t\tparse: parseEmptyResponse,\n\t\trequiredScopes: RESTART_REQUIRED_SCOPES,\n\t});\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 * No default request timeout applies to this upload; pass `options.timeout`\n\t * to set a per-call deadline.\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.credential} 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 * No default request timeout applies to this upload; pass `options.timeout`\n\t * to set a per-call deadline.\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.credential} 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 * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { UniversesClient } from \"@bedrock-rbx/ocale/universes\";\n *\n * const client = new UniversesClient({ credential: { apiKey: \"your-key\", kind: \"apiKey\" } });\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 server-management restart Operations\n\t * (`forecast`, `launch`, `list`, `restartOutdated`). `restartOutdated`\n\t * also uses the universe `:restartServers` method. Shares the parent\n\t * client's HTTP, rate-limit, and retry plumbing.\n\t */\n\tpublic readonly restarts: UniverseRestartsGroup;\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.restarts = new UniverseRestartsGroup(this.#inner);\n\t\tthis.thumbnails = createThumbnailsHandle(this.#inner);\n\t}\n\n\t/**\n\t * Makes an experience public. The API key needs `legacy-universe:manage`.\n\t * A missing content maturity rating can cause a misleading 403; complete\n\t * the content questionnaire in Creator Hub before activating.\n\t * On a 504, reads the universe's visibility and succeeds only if public.\n\t * This verification needs permission to read the universe. Otherwise the\n\t * original 504 is returned, leaving the outcome unconfirmed.\n\t *\n\t * @since 0.4.0\n\t * @param parameters - The universe identifier.\n\t * @param options - Optional per-request overrides.\n\t * @returns A success Result with no payload, or the Open Cloud error.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * import { UniversesClient } from \"@bedrock-rbx/ocale/universes\";\n\t * import { createFakeHttpClient } from \"@bedrock-rbx/ocale/testing\";\n\t * const httpClient = createFakeHttpClient()\n\t * .mockResponse({ body: {}, status: 200 });\n\t * const client = new UniversesClient({\n\t * credential: { apiKey: \"your-key\", kind: \"apiKey\" },\n\t * httpClient,\n\t * });\n\t * const result = client.activate({ universeId: \"123\" });\n\t * return expect(result).resolves.toEqual({ data: undefined, success: true });\n\t * ```\n\t */\n\tpublic async activate(\n\t\tparameters: ActivateUniverseParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\treturn setVisibilityAsync(this.#inner, { options, parameters, visibility: \"public\" });\n\t}\n\n\t/**\n\t * Makes an experience private, including one that is already private.\n\t * The API key needs `legacy-universe:manage`.\n\t * On a 504, reads the universe's visibility and succeeds only if private.\n\t * This verification needs permission to read the universe. Otherwise the\n\t * original 504 is returned, leaving the outcome unconfirmed.\n\t *\n\t * @since 0.4.0\n\t * @param parameters - The universe identifier.\n\t * @param options - Optional per-request overrides.\n\t * @returns A success Result with no payload, or the Open Cloud error.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * import { UniversesClient } from \"@bedrock-rbx/ocale/universes\";\n\t * import { createFakeHttpClient } from \"@bedrock-rbx/ocale/testing\";\n\t *\n\t * const httpClient = createFakeHttpClient()\n\t * .mockResponse({ body: {}, status: 200 });\n\t * const client = new UniversesClient({\n\t * credential: { apiKey: \"your-key\", kind: \"apiKey\" },\n\t * httpClient,\n\t * });\n\t * const result = client.deactivate({ universeId: \"123\" });\n\t * return expect(result).resolves.toEqual({ data: undefined, success: true });\n\t * ```\n\t */\n\tpublic async deactivate(\n\t\tparameters: DeactivateUniverseParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\treturn setVisibilityAsync(this.#inner, { options, parameters, visibility: \"private\" });\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.credential} 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.executeAsync({ options, parameters, spec: GET_SPEC });\n\t}\n\n\t/**\n\t * Restarts the live servers of a universe so players move onto the\n\t * latest published place versions.\n\t *\n\t * @param parameters - The universe identifier, plus optional place,\n\t * version, and bleed-off selection.\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\tpublic async restartServers(\n\t\tparameters: RestartUniverseServersParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: RESTART_SERVERS_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.credential} 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.executeAsync({ 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.executeAsync({ options, parameters, spec: ICON_DELETE_SPEC });\n\t\t},\n\t\tasync list(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: ICON_LIST_SPEC });\n\t\t},\n\t\tasync upload(parameters, options) {\n\t\t\treturn inner.executeAsync({ 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.executeAsync({ options, parameters, spec: THUMBNAIL_DELETE_SPEC });\n\t\t},\n\t\tasync reorder(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: THUMBNAIL_REORDER_SPEC });\n\t\t},\n\t\tasync upload(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: THUMBNAIL_UPLOAD_SPEC });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;AAGA,MAAM,2BAA2B;;;;;;;;;;AAqBjC,SAAgB,wBACf,KACA,EAAE,MAAM,SACyC;CACjD,MAAM,UAAU,IAAI,MAAM,OAAO,uBAA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AM,aAAa;IAAE;IAAS;IAAY,MAAM;GAAsB,CAAC;EAC/E;EACA,MAAM,QAAQ,YAAY,SAAS;GAClC,OAAO,MAAM,aAAa;IAAE;IAAS;IAAY,MAAM;GAAuB,CAAC;EAChF;EACA,MAAM,OAAO,YAAY,SAAS;GACjC,OAAO,MAAM,aAAa;IAAE;IAAS;IAAY,MAAM;GAAsB,CAAC;EAC/E;CACD;AACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as OpenCloudError } from "./network-error-
|
|
1
|
+
import { s as OpenCloudError } from "./network-error-iVSng5MT.mjs";
|
|
2
2
|
//#region src/errors/validation.ts
|
|
3
3
|
/**
|
|
4
4
|
* Thrown locally when caller-supplied input is rejected before any HTTP
|
|
@@ -37,4 +37,4 @@ var ValidationError = class extends OpenCloudError {
|
|
|
37
37
|
//#endregion
|
|
38
38
|
export { ValidationError as t };
|
|
39
39
|
|
|
40
|
-
//# sourceMappingURL=validation-
|
|
40
|
+
//# sourceMappingURL=validation-964VNlbp.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-
|
|
1
|
+
{"version":3,"file":"validation-964VNlbp.mjs","names":[],"sources":["../src/errors/validation.ts"],"sourcesContent":["import { OpenCloudError } from \"./base.ts\";\n\n/**\n * Closed discriminator for a {@link ValidationError}. Consumers can\n * exhaustively `switch` over this union so TypeScript will refuse to compile\n * if a new variant is added without a handler.\n *\n * @since 0.1.0\n */\nexport type ValidationErrorCode =\n\t| \"empty_body\"\n\t| \"empty_image_ids\"\n\t| \"empty_place_ids\"\n\t| \"empty_update\"\n\t| \"format_mismatch\"\n\t| \"incomplete_ref\"\n\t| \"invalid_image_id\"\n\t| \"invalid_place_id\";\n\n/**\n * Options for constructing a {@link ValidationError}.\n *\n * @since 0.1.0\n */\nexport interface ValidationErrorOptions extends ErrorOptions {\n\t/** Machine-readable discriminator identifying the validation failure. */\n\tcode: ValidationErrorCode;\n}\n\n/**\n * Thrown locally when caller-supplied input is rejected before any HTTP\n * round-trip. The `code` discriminator lets consumers branch on local-input\n * errors separately from server-side errors.\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { ValidationError } from \"@bedrock-rbx/ocale\";\n *\n * const error = new ValidationError(\"Place body is empty\", {\n * code: \"empty_body\",\n * });\n *\n * expect(error).toBeInstanceOf(ValidationError);\n * expect(error.code).toBe(\"empty_body\");\n * ```\n */\nexport class ValidationError extends OpenCloudError {\n\tpublic override readonly code: ValidationErrorCode;\n\tpublic override readonly name: string = \"ValidationError\";\n\n\t/**\n\t * Creates a new ValidationError.\n\t *\n\t * @param message - Human-readable error description.\n\t * @param options - Error options including the validation failure code.\n\t */\n\tconstructor(message: string, options: ValidationErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.code = options.code;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAa,kBAAb,cAAqC,eAAe;CACnD;CACA,OAAwC;;;;;;;CAQxC,YAAY,SAAiB,SAAiC;EAC7D,MAAM,SAAS,OAAO;EACtB,KAAK,OAAO,QAAQ;CACrB;AACD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region src/domains/game-internationalization/game-icon/wire.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Image moderation state returned alongside each localized icon.
|
|
4
|
+
*
|
|
5
|
+
* @since 0.1.0
|
|
6
|
+
*/
|
|
7
|
+
type GameIconState = "Approved" | "Error" | "PendingReview" | "Rejected" | "UnAvailable";
|
|
8
|
+
/**
|
|
9
|
+
* A single localized icon entry, mirroring
|
|
10
|
+
* `Roblox.GameInternationalization.Api.GetGameIconResponse` from the
|
|
11
|
+
* vendored Open Cloud spec.
|
|
12
|
+
*/
|
|
13
|
+
interface GetGameIconResponseWire {
|
|
14
|
+
/**
|
|
15
|
+
* Stringified ID of the uploaded icon image. JSON `null` on the wire
|
|
16
|
+
* when the locale is still on the default icon; the parser normalizes
|
|
17
|
+
* it to `undefined`.
|
|
18
|
+
*/
|
|
19
|
+
readonly imageId: string | undefined;
|
|
20
|
+
/** CDN URL the icon can be loaded from. */
|
|
21
|
+
readonly imageUrl: string;
|
|
22
|
+
/**
|
|
23
|
+
* Roblox wire form the icon is registered against. Either the
|
|
24
|
+
* Language form (e.g. `en`, `fil`, `zh-hans`) or the Locale form
|
|
25
|
+
* (e.g. `en_us`, `pt_br`, `ar_001`).
|
|
26
|
+
*/
|
|
27
|
+
readonly languageCode: string;
|
|
28
|
+
/** Moderation state of the icon. */
|
|
29
|
+
readonly state: GameIconState;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Wire shape of `GET /v1/game-icon/games/{gameId}`, mirroring
|
|
33
|
+
* `Roblox.Web.WebAPI.Models.ApiArrayResponse_…`.
|
|
34
|
+
*/
|
|
35
|
+
interface GameIconListWire {
|
|
36
|
+
/** Localized icons in the order returned by the API. */
|
|
37
|
+
readonly data: ReadonlyArray<GetGameIconResponseWire>;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { GameIconState as n, GetGameIconResponseWire as r, GameIconListWire as t };
|
|
41
|
+
//# sourceMappingURL=wire-DJqupefn.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-DJqupefn.d.mts","names":[],"sources":["../src/domains/game-internationalization/game-icon/wire.ts"],"mappings":";;;;;;KAKY;;;;;;UAOK;;;;;;WAMP;;WAEA;;;;;;WAMA;;WAEA,OAAO;;;;;;UAOA;;WAEP,MAAM,cAAc"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrock-rbx/ocale",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Roblox Open Cloud API client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -43,21 +43,21 @@
|
|
|
43
43
|
"dist"
|
|
44
44
|
],
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@stryker-mutator/api": "9.6.1",
|
|
47
|
-
"@stryker-mutator/core": "9.6.1",
|
|
48
|
-
"@stryker-mutator/typescript-checker": "9.6.1",
|
|
49
|
-
"@stryker-mutator/vitest-runner": "9.6.1",
|
|
50
|
-
"@total-typescript/shoehorn": "0.1.2",
|
|
51
|
-
"@types/bun": "1.4.0",
|
|
52
|
-
"ajv": "8.18.0",
|
|
53
|
-
"ajv-formats": "3.0.1",
|
|
54
|
-
"oxc-minify": "0.137.0",
|
|
55
|
-
"type-fest": "5.6.0",
|
|
56
|
-
"typescript": "npm:@typescript/typescript6@6.0.1",
|
|
57
|
-
"vitest": "4.1.9",
|
|
58
46
|
"@bedrock-rbx/testing": "0.0.0",
|
|
59
47
|
"@bedrock-rbx/typescript-config": "0.0.0",
|
|
60
|
-
"@bedrock-rbx/vite-config": "0.0.0"
|
|
48
|
+
"@bedrock-rbx/vite-config": "0.0.0",
|
|
49
|
+
"@stryker-mutator/api": "10.0.0",
|
|
50
|
+
"@stryker-mutator/core": "10.0.0",
|
|
51
|
+
"@stryker-mutator/typescript-checker": "10.0.0",
|
|
52
|
+
"@stryker-mutator/vitest-runner": "10.0.0",
|
|
53
|
+
"@total-typescript/shoehorn": "0.1.2",
|
|
54
|
+
"@types/bun": "1.4.4",
|
|
55
|
+
"ajv": "8.20.0",
|
|
56
|
+
"ajv-formats": "3.0.1",
|
|
57
|
+
"oxc-minify": "0.154.0",
|
|
58
|
+
"type-fest": "5.10.0",
|
|
59
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
60
|
+
"vitest": "5.0.5"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=24.12.0",
|