@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.
Files changed (86) hide show
  1. package/README.md +9 -5
  2. package/dist/badge-cost-mismatch-DrlvhlQc.mjs +47 -0
  3. package/dist/badge-cost-mismatch-DrlvhlQc.mjs.map +1 -0
  4. package/dist/badges.d.mts +228 -184
  5. package/dist/badges.d.mts.map +1 -1
  6. package/dist/badges.mjs +176 -18
  7. package/dist/badges.mjs.map +1 -1
  8. package/dist/capacity-admission-hycCFkTo.d.mts +355 -0
  9. package/dist/capacity-admission-hycCFkTo.d.mts.map +1 -0
  10. package/dist/{data.generated-B2ceLfSn.d.mts → data.generated-D_vpa5-g.d.mts} +23 -23
  11. package/dist/data.generated-D_vpa5-g.d.mts.map +1 -0
  12. package/dist/developer-products.d.mts +181 -186
  13. package/dist/developer-products.d.mts.map +1 -1
  14. package/dist/developer-products.mjs +24 -24
  15. package/dist/developer-products.mjs.map +1 -1
  16. package/dist/game-passes.d.mts +206 -203
  17. package/dist/game-passes.d.mts.map +1 -1
  18. package/dist/game-passes.mjs +26 -21
  19. package/dist/game-passes.mjs.map +1 -1
  20. package/dist/index.d.mts +924 -306
  21. package/dist/index.d.mts.map +1 -1
  22. package/dist/index.mjs +325 -10
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/locales.d.mts +30 -2
  25. package/dist/locales.d.mts.map +1 -0
  26. package/dist/locales.mjs +24 -1
  27. package/dist/locales.mjs.map +1 -1
  28. package/dist/luau-execution.d.mts +154 -151
  29. package/dist/luau-execution.d.mts.map +1 -1
  30. package/dist/luau-execution.mjs +11 -8
  31. package/dist/luau-execution.mjs.map +1 -1
  32. package/dist/{network-error-DR9FX5hb.mjs → network-error-iVSng5MT.mjs} +44 -6
  33. package/dist/network-error-iVSng5MT.mjs.map +1 -0
  34. package/dist/places.d.mts +204 -180
  35. package/dist/places.d.mts.map +1 -1
  36. package/dist/places.mjs +66 -20
  37. package/dist/places.mjs.map +1 -1
  38. package/dist/{poll-timeout-3PXLsabj.mjs → poll-timeout-DzztDymd.mjs} +2 -2
  39. package/dist/{poll-timeout-3PXLsabj.mjs.map → poll-timeout-DzztDymd.mjs.map} +1 -1
  40. package/dist/{polling-helpers-sKTsqEc1.mjs → polling-helpers-DfF5dspc.mjs} +249 -83
  41. package/dist/polling-helpers-DfF5dspc.mjs.map +1 -0
  42. package/dist/{price-information-hWXV6DAI.mjs → price-information-DEkEQ8Pq.mjs} +2 -2
  43. package/dist/{price-information-hWXV6DAI.mjs.map → price-information-DEkEQ8Pq.mjs.map} +1 -1
  44. package/dist/resource-client-BCKukheG.d.mts +168 -0
  45. package/dist/resource-client-BCKukheG.d.mts.map +1 -0
  46. package/dist/resource-client-CaIVr-go.mjs +1419 -0
  47. package/dist/resource-client-CaIVr-go.mjs.map +1 -0
  48. package/dist/retry-C2oHesDx.d.mts +229 -0
  49. package/dist/retry-C2oHesDx.d.mts.map +1 -0
  50. package/dist/{retry-vpHMIwaU.mjs → retry-CMRDvAR4.mjs} +390 -20
  51. package/dist/retry-CMRDvAR4.mjs.map +1 -0
  52. package/dist/storage.d.mts +333 -334
  53. package/dist/storage.d.mts.map +1 -1
  54. package/dist/storage.mjs +29 -22
  55. package/dist/storage.mjs.map +1 -1
  56. package/dist/testing.d.mts +347 -360
  57. package/dist/testing.d.mts.map +1 -1
  58. package/dist/testing.mjs +3 -4
  59. package/dist/testing.mjs.map +1 -1
  60. package/dist/types-CdMr_J1M.d.mts +509 -0
  61. package/dist/types-CdMr_J1M.d.mts.map +1 -0
  62. package/dist/universes.d.mts +619 -422
  63. package/dist/universes.d.mts.map +1 -1
  64. package/dist/universes.mjs +421 -48
  65. package/dist/universes.mjs.map +1 -1
  66. package/dist/{validation-B_Zs1So2.mjs → validation-964VNlbp.mjs} +2 -2
  67. package/dist/{validation-B_Zs1So2.mjs.map → validation-964VNlbp.mjs.map} +1 -1
  68. package/dist/wire-DJqupefn.d.mts +41 -0
  69. package/dist/wire-DJqupefn.d.mts.map +1 -0
  70. package/package.json +14 -14
  71. package/dist/capacity-admission-BvnJjY0S.d.mts +0 -369
  72. package/dist/capacity-admission-BvnJjY0S.d.mts.map +0 -1
  73. package/dist/data.generated-B2ceLfSn.d.mts.map +0 -1
  74. package/dist/network-error-DR9FX5hb.mjs.map +0 -1
  75. package/dist/polling-helpers-sKTsqEc1.mjs.map +0 -1
  76. package/dist/resource-client-3cOhqZpX.mjs +0 -899
  77. package/dist/resource-client-3cOhqZpX.mjs.map +0 -1
  78. package/dist/resource-client-BivRq3JZ.d.mts +0 -164
  79. package/dist/resource-client-BivRq3JZ.d.mts.map +0 -1
  80. package/dist/retry-DXEklFrt.d.mts +0 -373
  81. package/dist/retry-DXEklFrt.d.mts.map +0 -1
  82. package/dist/retry-vpHMIwaU.mjs.map +0 -1
  83. package/dist/types-C3Egi37J.d.mts +0 -378
  84. package/dist/types-C3Egi37J.d.mts.map +0 -1
  85. package/dist/wire-D3K-a-UP.d.mts +0 -37
  86. package/dist/wire-D3K-a-UP.d.mts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"game-passes.mjs","names":["buildUpdateRequest","buildLocaleNameDescRequest","#inner"],"sources":["../src/domains/game-internationalization/game-pass-icon/builders.ts","../src/domains/game-internationalization/game-pass-name-description/builders.ts","../src/domains/game-internationalization/game-pass-name-description/operations.ts","../src/domains/game-passes/game-passes/builders.ts","../src/domains/game-passes/game-passes/operations.ts","../src/domains/game-passes/game-passes/parsers.ts","../src/resources/game-passes/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { toBlob } from \"../../../internal/utils/to-blob.ts\";\nimport type { UploadGamePassIconParameters } from \"./types.ts\";\n\n/**\n * Builds a `POST` request for the localized \"upload game-pass icon\"\n * endpoint. A successful upload replaces any existing icon for the same\n * `(gamePassId, languageCode)` pair.\n *\n * @param parameters - Game pass 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: UploadGamePassIconParameters): HttpRequest {\n\tconst body = new FormData();\n\tbody.append(\"Files\", toBlob(parameters.image));\n\n\treturn {\n\t\tbody,\n\t\tmethod: \"POST\",\n\t\turl: `/legacy-game-internationalization/v1/game-passes/${parameters.gamePassId}/icons/language-codes/${parameters.languageCode}`,\n\t};\n}\n","import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport type { UpdateGamePassNameDescriptionParameters } from \"./types.ts\";\n\n/**\n * Builds a `PATCH` request for the localized \"update game-pass\n * name/description\" endpoint. Either `name`, `description`, or both may be\n * supplied; omitted fields are not included in the JSON body so the server\n * leaves the existing value for that locale untouched.\n *\n * @param parameters - Game pass and language identifiers plus the optional\n * replacement values.\n * @returns A pure {@link HttpRequest} describing the update call.\n */\nexport function buildUpdateRequest(\n\tparameters: UpdateGamePassNameDescriptionParameters,\n): HttpRequest {\n\tconst body: Record<string, string> = {};\n\tif (parameters.name !== undefined) {\n\t\tbody[\"name\"] = parameters.name;\n\t}\n\n\tif (parameters.description !== undefined) {\n\t\tbody[\"description\"] = parameters.description;\n\t}\n\n\treturn {\n\t\tbody,\n\t\tmethod: \"PATCH\",\n\t\turl: `/legacy-game-internationalization/v1/game-passes/${parameters.gamePassId}/name-description/language-codes/${parameters.languageCode}`,\n\t};\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/**\n * Per-second request ceiling for every game-pass localization Operation.\n * The legacy `gameinternationalization` service caps each API key at 100\n * requests per minute *shared across the entire service* (see the\n * `x-roblox-rate-limits` extension on every operation in the vendored Open\n * Cloud spec), so all game-pass localization methods queue against the same\n * operation key.\n */\nexport const LOCALIZATION_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 100 / 60,\n\toperationKey: \"game-pass-localization\",\n});\n\n/**\n * Scopes required for every game-pass localization operation, sourced\n * from `x-roblox-scopes` on the legacy `gameinternationalization`\n * game-pass endpoints in the vendored OpenAPI schema.\n */\nexport const LOCALIZATION_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"legacy-game-pass:manage\",\n]);\n","import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { toBlob } from \"../../../internal/utils/to-blob.ts\";\nimport type {\n\tCreateGamePassParameters,\n\tGetGamePassParameters,\n\tListGamePassesParameters,\n\tUpdateGamePassParameters,\n} from \"./types.ts\";\n\n/**\n * Builds a `GET` request for the Open Cloud \"read game pass\" endpoint.\n *\n * @param parameters - Universe and game pass identifiers to interpolate into\n * the URL.\n * @returns A pure {@link HttpRequest} describing the read call.\n */\nexport function buildGetRequest(parameters: GetGamePassParameters): HttpRequest {\n\treturn {\n\t\tmethod: \"GET\",\n\t\turl: `/game-passes/v1/universes/${parameters.universeId}/game-passes/${parameters.gamePassId}/creator`,\n\t};\n}\n\n/**\n * Builds a `GET` request for the Open Cloud \"list game passes\" endpoint.\n * Optional `pageSize` and `pageToken` are appended to the query string only\n * when defined so the server applies its own defaults for omitted fields.\n *\n * @param parameters - Universe identifier plus optional pagination cursors.\n * @returns A pure {@link HttpRequest} describing the list call.\n */\nexport function buildListRequest(parameters: ListGamePassesParameters): HttpRequest {\n\tconst query = new URLSearchParams();\n\tif (parameters.pageSize !== undefined) {\n\t\tquery.append(\"pageSize\", String(parameters.pageSize));\n\t}\n\n\tif (parameters.pageToken !== undefined) {\n\t\tquery.append(\"pageToken\", parameters.pageToken);\n\t}\n\n\tconst queryString = query.toString();\n\tconst base = `/game-passes/v1/universes/${parameters.universeId}/game-passes/creator`;\n\treturn {\n\t\tmethod: \"GET\",\n\t\turl: queryString === \"\" ? base : `${base}?${queryString}`,\n\t};\n}\n\n/**\n * Builds a `POST` request for the Open Cloud \"create game pass\" endpoint.\n *\n * @param parameters - Fields describing the new game pass; optional values\n * omitted here are left off the multipart payload entirely.\n * @returns A pure {@link HttpRequest} describing the create call.\n */\nexport function buildCreateRequest(parameters: CreateGamePassParameters): HttpRequest {\n\tconst body = new FormData();\n\tbody.append(\"name\", parameters.name);\n\tif (parameters.description !== undefined) {\n\t\tbody.append(\"description\", parameters.description);\n\t}\n\n\tif (parameters.isForSale !== undefined) {\n\t\tbody.append(\"isForSale\", String(parameters.isForSale));\n\t}\n\n\tif (parameters.price !== undefined) {\n\t\tbody.append(\"price\", String(parameters.price));\n\t}\n\n\tif (parameters.isRegionalPricingEnabled !== undefined) {\n\t\tbody.append(\"isRegionalPricingEnabled\", String(parameters.isRegionalPricingEnabled));\n\t}\n\n\tif (parameters.imageFile !== undefined) {\n\t\tbody.append(\"imageFile\", toBlob(parameters.imageFile));\n\t}\n\n\treturn {\n\t\tbody,\n\t\tmethod: \"POST\",\n\t\turl: `/game-passes/v1/universes/${parameters.universeId}/game-passes`,\n\t};\n}\n\n/**\n * Builds a `PATCH` request for the Open Cloud \"update game pass\" endpoint.\n * Every field on `parameters` except the identifiers is optional;\n * omitted fields are not appended to the multipart body so the server\n * leaves their current values unchanged.\n *\n * The public parameter `imageFile` is mapped to the wire's `file`\n * multipart field name, matching the OpenAPI schema for this endpoint\n * (the create endpoint uses `imageFile`, but the update endpoint uses\n * `file`). Public consumers stay with one ergonomic name across both\n * methods.\n *\n * @param parameters - Identifiers plus fields to update.\n * @returns A pure {@link HttpRequest} describing the update call.\n */\nexport function buildUpdateRequest(parameters: UpdateGamePassParameters): HttpRequest {\n\tconst body = new FormData();\n\tif (parameters.name !== undefined) {\n\t\tbody.append(\"name\", parameters.name);\n\t}\n\n\tif (parameters.description !== undefined) {\n\t\tbody.append(\"description\", parameters.description);\n\t}\n\n\tif (parameters.isForSale !== undefined) {\n\t\tbody.append(\"isForSale\", String(parameters.isForSale));\n\t}\n\n\tif (parameters.price !== undefined) {\n\t\tbody.append(\"price\", String(parameters.price));\n\t}\n\n\tif (parameters.isRegionalPricingEnabled !== undefined) {\n\t\tbody.append(\"isRegionalPricingEnabled\", String(parameters.isRegionalPricingEnabled));\n\t}\n\n\tif (parameters.imageFile !== undefined) {\n\t\tbody.append(\"file\", toBlob(parameters.imageFile));\n\t}\n\n\treturn {\n\t\tbody,\n\t\tmethod: \"PATCH\",\n\t\turl: `/game-passes/v1/universes/${parameters.universeId}/game-passes/${parameters.gamePassId}`,\n\t};\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/**\n * Per-second request ceiling for reading a single game pass, from the\n * Open Cloud OpenAPI schema.\n */\nexport const GET_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 10,\n\toperationKey: \"game-passes.get\",\n});\n\n/**\n * Per-second request ceiling for creating a game pass, from the Open\n * Cloud OpenAPI schema.\n */\nexport const CREATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 5,\n\toperationKey: \"game-passes.create\",\n});\n\n/**\n * Per-second request ceiling for updating a game pass, from the Open\n * Cloud OpenAPI schema. Keyed independently from\n * {@link CREATE_OPERATION_LIMIT} so create and update do not share a\n * queue, since the schema does not document the per-second quota as\n * shared between the POST and PATCH endpoints.\n */\nexport const UPDATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 5,\n\toperationKey: \"game-passes.update\",\n});\n\n/**\n * Per-second request ceiling for listing game passes for a universe,\n * from the Open Cloud OpenAPI schema.\n */\nexport const LIST_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 10,\n\toperationKey: \"game-passes.list\",\n});\n\n/**\n * Scopes required to read a game pass, sourced from `x-roblox-scopes`\n * on the `GamePasses_GetGamePassConfig` operation in the vendored\n * OpenAPI schema.\n */\nexport const GET_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"game-pass:read\"]);\n\n/**\n * Scopes required to create a game pass, sourced from `x-roblox-scopes`\n * on the `GamePasses_CreateGamePass` operation in the vendored OpenAPI\n * schema.\n */\nexport const CREATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"game-pass:write\"]);\n\n/**\n * Scopes required to update a game pass, sourced from `x-roblox-scopes`\n * on the `GamePasses_UpdateGamePass` operation in the vendored OpenAPI\n * schema.\n */\nexport const UPDATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"game-pass:write\"]);\n\n/**\n * Scopes required to list game passes for a universe, sourced from\n * `x-roblox-scopes` on the `GamePasses_ListGamePassConfigsByUniverse`\n * operation in the vendored OpenAPI schema.\n */\nexport const LIST_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"game-pass:read\"]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport {\n\tcopyPriceInformation,\n\tisPriceInformationLike,\n} from \"../../../internal/price-information.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 { Page, Result } from \"../../../types.ts\";\nimport type { GamePass } from \"./types.ts\";\nimport type {\n\tGamePassConfigV2,\n\tListGamePassConfigsByUniverseResponseWire,\n\tPricingFeatureWire,\n} from \"./wire.ts\";\n\n/**\n * Parses a successful Game Pass API response into the public `GamePass`\n * shape, returning a `Result` so callers can handle malformed payloads\n * without exceptions.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * The status code is included on the returned `ApiError` when validation\n * fails; the headers are available for future parsers that need them.\n * @returns A success result wrapping the converted `GamePass`, or an\n * `ApiError` when the body does not match the wire schema.\n */\nexport function parseGamePassResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<GamePass, ApiError> {\n\tif (!isGamePassConfigV2(body)) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed game pass 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 { data: toGamePass(body), success: true };\n}\n\n/**\n * Parses a successful \"list game passes\" response into a public\n * {@link Page} of {@link GamePass}, returning a `Result` so callers can\n * handle malformed payloads without exceptions. JSON `null` or a missing\n * `nextPageToken` is normalized to `undefined`.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the converted page, or an\n * `ApiError` when the body does not match the wire schema.\n */\nexport function parseGamePassesListResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<Page<GamePass>, ApiError> {\n\tif (!isListResponseWire(body)) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed game passes 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: {\n\t\t\titems: body.gamePasses.map(toGamePass),\n\t\t\tnextPageToken: body.nextPageToken ?? undefined,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction toGamePass(wire: GamePassConfigV2): GamePass {\n\tconst priceWire = wire.priceInformation ?? undefined;\n\treturn {\n\t\tid: String(wire.gamePassId),\n\t\tname: wire.name,\n\t\tcreatedAt: new Date(wire.createdTimestamp),\n\t\tdescription: wire.description,\n\t\ticonAssetId: wire.iconAssetId === 0 ? undefined : String(wire.iconAssetId),\n\t\tisForSale: wire.isForSale,\n\t\tisManagedPricingEnabled: wire.isManagedPricingEnabled,\n\t\tprice: priceWire === undefined ? undefined : copyPriceInformation(priceWire),\n\t\tupdatedAt: new Date(wire.updatedTimestamp),\n\t};\n}\n\nfunction hasRequiredPrimitiveFields(body: Record<string, unknown>): boolean {\n\treturn (\n\t\ttypeof body[\"gamePassId\"] === \"number\" &&\n\t\ttypeof body[\"name\"] === \"string\" &&\n\t\ttypeof body[\"description\"] === \"string\" &&\n\t\ttypeof body[\"isForSale\"] === \"boolean\" &&\n\t\ttypeof body[\"isManagedPricingEnabled\"] === \"boolean\" &&\n\t\ttypeof body[\"iconAssetId\"] === \"number\" &&\n\t\tisDateTimeString(body[\"createdTimestamp\"]) &&\n\t\tisDateTimeString(body[\"updatedTimestamp\"])\n\t);\n}\n\nfunction isPricingFeatureWire(value: unknown): value is PricingFeatureWire {\n\treturn (\n\t\tvalue === \"Invalid\" ||\n\t\tvalue === \"PriceOptimization\" ||\n\t\tvalue === \"RegionalPricing\" ||\n\t\tvalue === \"UserFixedPrice\"\n\t);\n}\n\nfunction isGamePassConfigV2(body: unknown): body is GamePassConfigV2 {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\tif (!hasRequiredPrimitiveFields(body)) {\n\t\treturn false;\n\t}\n\n\tconst price = body[\"priceInformation\"] ?? undefined;\n\tif (price !== undefined && !isPriceInformationLike(price, isPricingFeatureWire)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nfunction isListResponseWire(body: unknown): body is ListGamePassConfigsByUniverseResponseWire {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\tconst { gamePasses } = body;\n\tif (!Array.isArray(gamePasses)) {\n\t\treturn false;\n\t}\n\n\tfor (const item of gamePasses) {\n\t\tif (!isGamePassConfigV2(item)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tconst nextPageToken = body[\"nextPageToken\"] ?? undefined;\n\tif (nextPageToken !== undefined && typeof nextPageToken !== \"string\") {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport { buildUploadIconRequest } from \"../../domains/game-internationalization/game-pass-icon/builders.ts\";\nimport type { UploadGamePassIconParameters } from \"../../domains/game-internationalization/game-pass-icon/types.ts\";\nimport { buildUpdateRequest as buildLocaleNameDescRequest } from \"../../domains/game-internationalization/game-pass-name-description/builders.ts\";\nimport {\n\tLOCALIZATION_OPERATION_LIMIT,\n\tLOCALIZATION_REQUIRED_SCOPES,\n} from \"../../domains/game-internationalization/game-pass-name-description/operations.ts\";\nimport type { UpdateGamePassNameDescriptionParameters } from \"../../domains/game-internationalization/game-pass-name-description/types.ts\";\nimport {\n\tbuildCreateRequest,\n\tbuildGetRequest,\n\tbuildListRequest,\n\tbuildUpdateRequest,\n} from \"../../domains/game-passes/game-passes/builders.ts\";\nimport {\n\tCREATE_OPERATION_LIMIT,\n\tCREATE_REQUIRED_SCOPES,\n\tGET_OPERATION_LIMIT,\n\tGET_REQUIRED_SCOPES,\n\tLIST_OPERATION_LIMIT,\n\tLIST_REQUIRED_SCOPES,\n\tUPDATE_OPERATION_LIMIT,\n\tUPDATE_REQUIRED_SCOPES,\n} from \"../../domains/game-passes/game-passes/operations.ts\";\nimport {\n\tparseGamePassesListResponse,\n\tparseGamePassResponse,\n} from \"../../domains/game-passes/game-passes/parsers.ts\";\nimport type {\n\tCreateGamePassParameters,\n\tGamePass,\n\tGetGamePassParameters,\n\tListGamePassesParameters,\n\tUpdateGamePassParameters,\n} from \"../../domains/game-passes/game-passes/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS, IDEMPOTENT_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport {\n\tokRequest,\n\tparseEmptyResponse,\n\tResourceClient,\n\ttype ResourceMethodSpec,\n} from \"../../internal/resource-client.ts\";\nimport type { Page, Result } from \"../../types.ts\";\n\nfunction makeSpec<P, R>(spec: ResourceMethodSpec<P, R>): ResourceMethodSpec<P, R> {\n\treturn Object.freeze(spec);\n}\n\nconst CREATE_SPEC = makeSpec<CreateGamePassParameters, GamePass>({\n\tbuildRequest: (parameters) => okRequest(buildCreateRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: CREATE_OPERATION_LIMIT,\n\tparse: parseGamePassResponse,\n\trequiredScopes: CREATE_REQUIRED_SCOPES,\n});\n\nconst GET_SPEC = makeSpec<GetGamePassParameters, GamePass>({\n\tbuildRequest: (parameters) => okRequest(buildGetRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: GET_OPERATION_LIMIT,\n\tparse: parseGamePassResponse,\n\trequiredScopes: GET_REQUIRED_SCOPES,\n});\n\nconst UPDATE_SPEC = makeSpec<UpdateGamePassParameters, undefined>({\n\tbuildRequest: (parameters) => okRequest(buildUpdateRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: UPDATE_OPERATION_LIMIT,\n\tparse: parseEmptyResponse,\n\trequiredScopes: UPDATE_REQUIRED_SCOPES,\n});\n\nconst LIST_SPEC = makeSpec<ListGamePassesParameters, Page<GamePass>>({\n\tbuildRequest: (parameters) => okRequest(buildListRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: LIST_OPERATION_LIMIT,\n\tparse: parseGamePassesListResponse,\n\trequiredScopes: LIST_REQUIRED_SCOPES,\n});\n\nconst UPDATE_NAME_DESCRIPTION_SPEC = makeSpec<UpdateGamePassNameDescriptionParameters, undefined>({\n\tbuildRequest: (parameters) => okRequest(buildLocaleNameDescRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: LOCALIZATION_OPERATION_LIMIT,\n\tparse: parseEmptyResponse,\n\trequiredScopes: LOCALIZATION_REQUIRED_SCOPES,\n});\n\nconst UPLOAD_ICON_SPEC = makeSpec<UploadGamePassIconParameters, undefined>({\n\tbuildRequest: (parameters) => okRequest(buildUploadIconRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: LOCALIZATION_OPERATION_LIMIT,\n\tparse: parseEmptyResponse,\n\trequiredScopes: LOCALIZATION_REQUIRED_SCOPES,\n});\n\ninterface GamePassLocalizationHandle {\n\t/**\n\t * Updates the per-locale display name and/or description registered against\n\t * a game pass. Either `name`, `description`, or both may be supplied;\n\t * omitted fields are not forwarded so the server leaves the existing value\n\t * for that locale untouched. Mirrors the upstream `200 OK` echo body as\n\t * `undefined` data.\n\t *\n\t * @param parameters - Game pass and language identifiers plus the optional\n\t * replacement values.\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\tupdateNameDescription: (\n\t\tparameters: UpdateGamePassNameDescriptionParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n\t/**\n\t * Uploads or replaces the per-locale icon for a game pass. A subsequent\n\t * upload for the same `(gamePassId, languageCode)` pair replaces the\n\t * existing icon for that locale. Does not retry on 5xx so a duplicate\n\t * upload cannot be created if the server fails mid-write.\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 - Game pass and language identifiers plus the image\n\t * bytes to upload.\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\tuploadIcon: (\n\t\tparameters: UploadGamePassIconParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n}\n\n/**\n * Public client for the Roblox Open Cloud Game Passes API.\n *\n * Wires request builders, the injected {@link\n * OpenCloudClientOptions.httpClient}, and response parsers into a single\n * ergonomic surface. Every method returns a {@link Result} so callers handle\n * failure explicitly; no thrown `OpenCloudError` ever escapes the client.\n *\n * ```ts\n * import { GamePassesClient } from \"@bedrock-rbx/ocale/game-passes\";\n *\n * const client = new GamePassesClient({ apiKey: process.env.ROBLOX_API_KEY! });\n *\n * const result = await client.get({\n * universeId: \"1234567890\",\n * gamePassId: \"9876543210\",\n * });\n *\n * if (result.success) {\n * console.log(`${result.data.name} (${result.data.id})`);\n * } else {\n * console.error(result.err.message);\n * }\n * ```\n *\n * Listing is cursor-paginated; drive the loop on `nextPageToken`:\n *\n * ```ts\n * let pageToken: string | undefined;\n * do {\n * const page = await client.list({ universeId: \"1234567890\", pageToken });\n * if (!page.success) {\n * console.error(page.err.message);\n * break;\n * }\n *\n * for (const pass of page.data.items) {\n * console.log(`${pass.name} (${pass.id})`);\n * }\n *\n * pageToken = page.data.nextPageToken;\n * } while (pageToken !== undefined);\n * ```\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { GamePassesClient } from \"@bedrock-rbx/ocale/game-passes\";\n *\n * const client = new GamePassesClient({ apiKey: \"your-key\" });\n * expect(client).toBeInstanceOf(GamePassesClient);\n * ```\n */\nexport class GamePassesClient {\n\treadonly #inner: ResourceClient;\n\n\t/**\n\t * Operation Group exposing per-locale localization Operations\n\t * (`updateNameDescription`, `uploadIcon`) backed by the\n\t * `legacy-game-internationalization` domain. Source-language values\n\t * remain on {@link GamePassesClient.update}; methods on this group set\n\t * per-locale overlays on top. Shares the parent client's HTTP,\n\t * rate-limit, and retry plumbing.\n\t */\n\tpublic readonly localization: GamePassLocalizationHandle;\n\n\t/**\n\t * Creates a new {@link GamePassesClient}. Configuration is frozen on\n\t * construction; per-request overrides are accepted on each method.\n\t *\n\t * @param options - Client-level configuration including the API key.\n\t */\n\tconstructor(options: OpenCloudClientOptions) {\n\t\tthis.#inner = new ResourceClient(options);\n\t\tthis.localization = createLocalizationHandle(this.#inner);\n\t}\n\n\t/**\n\t * Creates a new game pass under the supplied universe.\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 - Creation fields including the universe and pass name.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed {@link GamePass} or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async create(\n\t\tparameters: CreateGamePassParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<GamePass, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: CREATE_SPEC });\n\t}\n\n\t/**\n\t * Reads a single game pass by ID.\n\t *\n\t * @param parameters - Universe and game pass identifiers.\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 GamePass} or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async get(\n\t\tparameters: GetGamePassParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<GamePass, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: GET_SPEC });\n\t}\n\n\t/**\n\t * Lists one page of game passes for the supplied universe. Pagination is\n\t * cursor-based: omit `pageToken` for the first page, then thread the\n\t * previous response's `nextPageToken` back in until it is `undefined`.\n\t *\n\t * @param parameters - Universe identifier and optional page cursors.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping a {@link Page} of {@link GamePass},\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async list(\n\t\tparameters: ListGamePassesParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<Page<GamePass>, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: LIST_SPEC });\n\t}\n\n\t/**\n\t * Partially updates an existing game pass. Mirrors the upstream\n\t * `204 No Content` response: a successful update yields `undefined`\n\t * data. Callers that need the post-update state (for example to\n\t * observe a server-derived `updatedAt`) chain\n\t * {@link GamePassesClient.get} themselves so the GET only fires when\n\t * actually needed.\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 - The universe and game pass identifiers and the\n\t * fields to update. Only fields explicitly provided are forwarded.\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 update(\n\t\tparameters: UpdateGamePassParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: UPDATE_SPEC });\n\t}\n}\n\nfunction createLocalizationHandle(inner: ResourceClient): GamePassLocalizationHandle {\n\treturn {\n\t\tasync updateNameDescription(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: UPDATE_NAME_DESCRIPTION_SPEC });\n\t\t},\n\t\tasync uploadIcon(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: UPLOAD_ICON_SPEC });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,SAAgB,uBAAuB,YAAuD;CAC7F,MAAM,OAAO,IAAI,SAAS;CAC1B,KAAK,OAAO,SAAS,OAAO,WAAW,KAAK,CAAC;CAE7C,OAAO;EACN;EACA,QAAQ;EACR,KAAK,oDAAoD,WAAW,WAAW,wBAAwB,WAAW;CACnH;AACD;;;;;;;;;;;;;ACTA,SAAgBA,qBACf,YACc;CACd,MAAM,OAA+B,CAAC;CACtC,IAAI,WAAW,SAAS,KAAA,GACvB,KAAK,UAAU,WAAW;CAG3B,IAAI,WAAW,gBAAgB,KAAA,GAC9B,KAAK,iBAAiB,WAAW;CAGlC,OAAO;EACN;EACA,QAAQ;EACR,KAAK,oDAAoD,WAAW,WAAW,mCAAmC,WAAW;CAC9H;AACD;;;;;;;;;;;ACpBA,MAAa,+BAA+C,OAAO,OAAO;CACzE,cAAc,MAAM;CACpB,cAAc;AACf,CAAC;;;;;;AAOD,MAAa,+BAAsD,OAAO,OAAO,CAChF,yBACD,CAAC;;;;;;;;;;ACND,SAAgB,gBAAgB,YAAgD;CAC/E,OAAO;EACN,QAAQ;EACR,KAAK,6BAA6B,WAAW,WAAW,eAAe,WAAW,WAAW;CAC9F;AACD;;;;;;;;;AAUA,SAAgB,iBAAiB,YAAmD;CACnF,MAAM,QAAQ,IAAI,gBAAgB;CAClC,IAAI,WAAW,aAAa,KAAA,GAC3B,MAAM,OAAO,YAAY,OAAO,WAAW,QAAQ,CAAC;CAGrD,IAAI,WAAW,cAAc,KAAA,GAC5B,MAAM,OAAO,aAAa,WAAW,SAAS;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,KAAK,eAAe,yBAAyB,KAAKA,MAAM;CACzD;;;;;;;;;;;;CAaA,MAAa,OACZ,YACA,SAC4C;EAC5C,OAAO,KAAKA,OAAO,aAAa;GAAE;GAAS;GAAY,MAAM;EAAY,CAAC;CAC3E;;;;;;;;;;CAWA,MAAa,IACZ,YACA,SAC4C;EAC5C,OAAO,KAAKA,OAAO,aAAa;GAAE;GAAS;GAAY,MAAM;EAAS,CAAC;CACxE;;;;;;;;;;;CAYA,MAAa,KACZ,YACA,SACkD;EAClD,OAAO,KAAKA,OAAO,aAAa;GAAE;GAAS;GAAY,MAAM;EAAU,CAAC;CACzE;;;;;;;;;;;;;;;;;;CAmBA,MAAa,OACZ,YACA,SAC6C;EAC7C,OAAO,KAAKA,OAAO,aAAa;GAAE;GAAS;GAAY,MAAM;EAAY,CAAC;CAC3E;AACD;AAEA,SAAS,yBAAyB,OAAmD;CACpF,OAAO;EACN,MAAM,sBAAsB,YAAY,SAAS;GAChD,OAAO,MAAM,aAAa;IAAE;IAAS;IAAY,MAAM;GAA6B,CAAC;EACtF;EACA,MAAM,WAAW,YAAY,SAAS;GACrC,OAAO,MAAM,aAAa;IAAE;IAAS;IAAY,MAAM;GAAiB,CAAC;EAC1E;CACD;AACD"}
1
+ {"version":3,"file":"game-passes.mjs","names":["buildUpdateRequest","buildLocaleNameDescRequest"],"sources":["../src/domains/game-internationalization/game-pass-icon/builders.ts","../src/domains/game-internationalization/game-pass-name-description/builders.ts","../src/domains/game-internationalization/game-pass-name-description/operations.ts","../src/domains/game-passes/game-passes/builders.ts","../src/domains/game-passes/game-passes/operations.ts","../src/domains/game-passes/game-passes/parsers.ts","../src/resources/game-passes/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { toBlob } from \"../../../internal/utils/to-blob.ts\";\nimport type { UploadGamePassIconParameters } from \"./types.ts\";\n\n/**\n * Builds a `POST` request for the localized \"upload game-pass icon\"\n * endpoint. A successful upload replaces any existing icon for the same\n * `(gamePassId, languageCode)` pair.\n *\n * @param parameters - Game pass 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: UploadGamePassIconParameters): HttpRequest {\n\tconst body = new FormData();\n\tbody.append(\"Files\", toBlob(parameters.image));\n\n\treturn {\n\t\tbody,\n\t\tmethod: \"POST\",\n\t\turl: `/legacy-game-internationalization/v1/game-passes/${parameters.gamePassId}/icons/language-codes/${parameters.languageCode}`,\n\t};\n}\n","import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport type { UpdateGamePassNameDescriptionParameters } from \"./types.ts\";\n\n/**\n * Builds a `PATCH` request for the localized \"update game-pass\n * name/description\" endpoint. Either `name`, `description`, or both may be\n * supplied; omitted fields are not included in the JSON body so the server\n * leaves the existing value for that locale untouched.\n *\n * @param parameters - Game pass and language identifiers plus the optional\n * replacement values.\n * @returns A pure {@link HttpRequest} describing the update call.\n */\nexport function buildUpdateRequest(\n\tparameters: UpdateGamePassNameDescriptionParameters,\n): HttpRequest {\n\tconst body: Record<string, string> = {};\n\tif (parameters.name !== undefined) {\n\t\tbody[\"name\"] = parameters.name;\n\t}\n\n\tif (parameters.description !== undefined) {\n\t\tbody[\"description\"] = parameters.description;\n\t}\n\n\treturn {\n\t\tbody,\n\t\tmethod: \"PATCH\",\n\t\turl: `/legacy-game-internationalization/v1/game-passes/${parameters.gamePassId}/name-description/language-codes/${parameters.languageCode}`,\n\t};\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/**\n * Per-second request ceiling for game-pass localization Operations, from\n * each operation's `x-roblox-rate-limits.perApiKeyOwner` in the vendored schema\n * (100 requests per minute). This family's key stays separate from other\n * game-internationalization families: the #587 probe measured independent\n * reported 100/minute counters, including on rejected requests. Successful\n * writes may have additional service limits; see\n * `docs/spikes/game-internationalization-rate-limits/README.md`.\n */\nexport const LOCALIZATION_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 100 / 60,\n\toperationKey: \"game-pass-localization\",\n});\n\n/**\n * Scopes required for every game-pass localization operation, sourced\n * from `x-roblox-scopes` on the legacy `gameinternationalization`\n * game-pass endpoints in the vendored OpenAPI schema.\n */\nexport const LOCALIZATION_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"legacy-game-pass:manage\",\n]);\n","import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { toBlob } from \"../../../internal/utils/to-blob.ts\";\nimport type {\n\tCreateGamePassParameters,\n\tGetGamePassParameters,\n\tListGamePassesParameters,\n\tUpdateGamePassParameters,\n} from \"./types.ts\";\n\n/**\n * Builds a `GET` request for the Open Cloud \"read game pass\" endpoint.\n *\n * @param parameters - Universe and game pass identifiers to interpolate into\n * the URL.\n * @returns A pure {@link HttpRequest} describing the read call.\n */\nexport function buildGetRequest(parameters: GetGamePassParameters): HttpRequest {\n\treturn {\n\t\tmethod: \"GET\",\n\t\turl: `/game-passes/v1/universes/${parameters.universeId}/game-passes/${parameters.gamePassId}/creator`,\n\t};\n}\n\n/**\n * Builds a `GET` request for the Open Cloud \"list game passes\" endpoint.\n * Optional `pageSize` and `pageToken` are appended to the query string only\n * when defined so the server applies its own defaults for omitted fields.\n *\n * @param parameters - Universe identifier plus optional pagination cursors.\n * @returns A pure {@link HttpRequest} describing the list call.\n */\nexport function buildListRequest(parameters: ListGamePassesParameters): HttpRequest {\n\tconst query = new URLSearchParams();\n\tif (parameters.pageSize !== undefined) {\n\t\tquery.append(\"pageSize\", String(parameters.pageSize));\n\t}\n\n\tif (parameters.pageToken !== undefined) {\n\t\tquery.append(\"pageToken\", parameters.pageToken);\n\t}\n\n\tconst queryString = query.toString();\n\tconst base = `/game-passes/v1/universes/${parameters.universeId}/game-passes/creator`;\n\treturn {\n\t\tmethod: \"GET\",\n\t\turl: queryString === \"\" ? base : `${base}?${queryString}`,\n\t};\n}\n\n/**\n * Builds a `POST` request for the Open Cloud \"create game pass\" endpoint.\n *\n * @param parameters - Fields describing the new game pass; optional values\n * omitted here are left off the multipart payload entirely.\n * @returns A pure {@link HttpRequest} describing the create call.\n */\nexport function buildCreateRequest(parameters: CreateGamePassParameters): HttpRequest {\n\tconst body = new FormData();\n\tbody.append(\"name\", parameters.name);\n\tif (parameters.description !== undefined) {\n\t\tbody.append(\"description\", parameters.description);\n\t}\n\n\tif (parameters.isForSale !== undefined) {\n\t\tbody.append(\"isForSale\", String(parameters.isForSale));\n\t}\n\n\tif (parameters.isManagedPricingEnabled !== undefined) {\n\t\tbody.append(\"isManagedPricingEnabled\", String(parameters.isManagedPricingEnabled));\n\t}\n\n\tif (parameters.price !== undefined) {\n\t\tbody.append(\"price\", String(parameters.price));\n\t}\n\n\tif (parameters.imageFile !== undefined) {\n\t\tbody.append(\"imageFile\", toBlob(parameters.imageFile));\n\t}\n\n\treturn {\n\t\tbody,\n\t\tmethod: \"POST\",\n\t\turl: `/game-passes/v1/universes/${parameters.universeId}/game-passes`,\n\t};\n}\n\n/**\n * Builds a `PATCH` request for the Open Cloud \"update game pass\" endpoint.\n * Every field on `parameters` except the identifiers is optional;\n * omitted fields are not appended to the multipart body so the server\n * leaves their current values unchanged.\n *\n * The public parameter `imageFile` is mapped to the wire's `file`\n * multipart field name, matching the OpenAPI schema for this endpoint\n * (the create endpoint uses `imageFile`, but the update endpoint uses\n * `file`). Public consumers stay with one ergonomic name across both\n * methods.\n *\n * @param parameters - Identifiers plus fields to update.\n * @returns A pure {@link HttpRequest} describing the update call.\n */\nexport function buildUpdateRequest(parameters: UpdateGamePassParameters): HttpRequest {\n\tconst body = new FormData();\n\tif (parameters.name !== undefined) {\n\t\tbody.append(\"name\", parameters.name);\n\t}\n\n\tif (parameters.description !== undefined) {\n\t\tbody.append(\"description\", parameters.description);\n\t}\n\n\tif (parameters.isForSale !== undefined) {\n\t\tbody.append(\"isForSale\", String(parameters.isForSale));\n\t}\n\n\tif (parameters.isManagedPricingEnabled !== undefined) {\n\t\tbody.append(\"isManagedPricingEnabled\", String(parameters.isManagedPricingEnabled));\n\t}\n\n\tif (parameters.price !== undefined) {\n\t\tbody.append(\"price\", String(parameters.price));\n\t}\n\n\tif (parameters.imageFile !== undefined) {\n\t\tbody.append(\"file\", toBlob(parameters.imageFile));\n\t}\n\n\treturn {\n\t\tbody,\n\t\tmethod: \"PATCH\",\n\t\turl: `/game-passes/v1/universes/${parameters.universeId}/game-passes/${parameters.gamePassId}`,\n\t};\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/**\n * Per-second request ceiling for reading a single game pass, from the\n * Open Cloud OpenAPI schema.\n */\nexport const GET_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 10,\n\toperationKey: \"game-passes.get\",\n});\n\n/**\n * Per-second request ceiling for creating a game pass, from the Open\n * Cloud OpenAPI schema.\n */\nexport const CREATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 5,\n\toperationKey: \"game-passes.create\",\n});\n\n/**\n * Per-second request ceiling for updating a game pass, from the Open\n * Cloud OpenAPI schema. Keyed independently from\n * {@link CREATE_OPERATION_LIMIT} so create and update do not share a\n * queue, since the schema does not document the per-second quota as\n * shared between the POST and PATCH endpoints.\n */\nexport const UPDATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 5,\n\toperationKey: \"game-passes.update\",\n});\n\n/**\n * Per-second request ceiling for listing game passes for a universe,\n * from the Open Cloud OpenAPI schema.\n */\nexport const LIST_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 10,\n\toperationKey: \"game-passes.list\",\n});\n\n/**\n * Scopes required to read a game pass, sourced from `x-roblox-scopes`\n * on the `GamePasses_GetGamePassConfig` operation in the vendored\n * OpenAPI schema.\n */\nexport const GET_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"game-pass:read\"]);\n\n/**\n * Scopes required to create a game pass, sourced from `x-roblox-scopes`\n * on the `GamePasses_CreateGamePass` operation in the vendored OpenAPI\n * schema.\n */\nexport const CREATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"game-pass:write\"]);\n\n/**\n * Scopes required to update a game pass, sourced from `x-roblox-scopes`\n * on the `GamePasses_UpdateGamePass` operation in the vendored OpenAPI\n * schema.\n */\nexport const UPDATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"game-pass:write\"]);\n\n/**\n * Scopes required to list game passes for a universe, sourced from\n * `x-roblox-scopes` on the `GamePasses_ListGamePassConfigsByUniverse`\n * operation in the vendored OpenAPI schema.\n */\nexport const LIST_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"game-pass:read\"]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { UnexpectedResponseError } from \"../../../errors/unexpected-response.ts\";\nimport {\n\tcopyPriceInformation,\n\tisPriceInformationLike,\n} from \"../../../internal/price-information.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 { Page, Result } from \"../../../types.ts\";\nimport type { GamePass } from \"./types.ts\";\nimport type {\n\tGamePassConfigV2,\n\tListGamePassConfigsByUniverseResponseWire,\n\tPricingFeatureWire,\n} from \"./wire.ts\";\n\n/**\n * Parses a successful Game Pass API response into the public `GamePass`\n * shape, returning a `Result` so callers can handle malformed payloads\n * without exceptions.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * The status code is included on the returned `UnexpectedResponseError` when\n * validation fails; the headers are available for future parsers that need\n * them.\n * @returns A success result wrapping the converted `GamePass`, or an\n * `UnexpectedResponseError` when the body does not match the wire schema.\n */\nexport function parseGamePassResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<GamePass, UnexpectedResponseError> {\n\tif (!isGamePassConfigV2(body)) {\n\t\treturn {\n\t\t\terr: new UnexpectedResponseError(\"Malformed game pass 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 { data: toGamePass(body), success: true };\n}\n\n/**\n * Parses a successful \"list game passes\" response into a public\n * {@link Page} of {@link GamePass}, returning a `Result` so callers can\n * handle malformed payloads without exceptions. JSON `null` or a missing\n * `nextPageToken` is normalized to `undefined`.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the converted page, or an\n * `UnexpectedResponseError` when the body does not match the wire schema.\n */\nexport function parseGamePassesListResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<Page<GamePass>, UnexpectedResponseError> {\n\tif (!isListResponseWire(body)) {\n\t\treturn {\n\t\t\terr: new UnexpectedResponseError(\"Malformed game passes 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: {\n\t\t\titems: body.gamePasses.map(toGamePass),\n\t\t\tnextPageToken: body.nextPageToken ?? undefined,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction toGamePass(wire: GamePassConfigV2): GamePass {\n\tconst priceWire = wire.priceInformation ?? undefined;\n\treturn {\n\t\tid: String(wire.gamePassId),\n\t\tname: wire.name,\n\t\tcreatedAt: new Date(wire.createdTimestamp),\n\t\tdescription: wire.description,\n\t\ticonAssetId: wire.iconAssetId === 0 ? undefined : String(wire.iconAssetId),\n\t\tisForSale: wire.isForSale,\n\t\tisManagedPricingEnabled: wire.isManagedPricingEnabled,\n\t\tprice: priceWire === undefined ? undefined : copyPriceInformation(priceWire),\n\t\tupdatedAt: new Date(wire.updatedTimestamp),\n\t};\n}\n\nfunction hasRequiredPrimitiveFields(body: Record<string, unknown>): boolean {\n\treturn (\n\t\ttypeof body[\"gamePassId\"] === \"number\" &&\n\t\ttypeof body[\"name\"] === \"string\" &&\n\t\ttypeof body[\"description\"] === \"string\" &&\n\t\ttypeof body[\"isForSale\"] === \"boolean\" &&\n\t\ttypeof body[\"isManagedPricingEnabled\"] === \"boolean\" &&\n\t\ttypeof body[\"iconAssetId\"] === \"number\" &&\n\t\tisDateTimeString(body[\"createdTimestamp\"]) &&\n\t\tisDateTimeString(body[\"updatedTimestamp\"])\n\t);\n}\n\nfunction isPricingFeatureWire(value: unknown): value is PricingFeatureWire {\n\treturn (\n\t\tvalue === \"Invalid\" ||\n\t\tvalue === \"PriceOptimization\" ||\n\t\tvalue === \"RegionalPricing\" ||\n\t\tvalue === \"UserFixedPrice\"\n\t);\n}\n\nfunction isGamePassConfigV2(body: unknown): body is GamePassConfigV2 {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\tif (!hasRequiredPrimitiveFields(body)) {\n\t\treturn false;\n\t}\n\n\tconst price = body[\"priceInformation\"] ?? undefined;\n\tif (price !== undefined && !isPriceInformationLike(price, isPricingFeatureWire)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nfunction isListResponseWire(body: unknown): body is ListGamePassConfigsByUniverseResponseWire {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\tconst { gamePasses } = body;\n\tif (!Array.isArray(gamePasses)) {\n\t\treturn false;\n\t}\n\n\tfor (const item of gamePasses) {\n\t\tif (!isGamePassConfigV2(item)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tconst nextPageToken = body[\"nextPageToken\"] ?? undefined;\n\tif (nextPageToken !== undefined && typeof nextPageToken !== \"string\") {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport { buildUploadIconRequest } from \"../../domains/game-internationalization/game-pass-icon/builders.ts\";\nimport type { UploadGamePassIconParameters } from \"../../domains/game-internationalization/game-pass-icon/types.ts\";\nimport { buildUpdateRequest as buildLocaleNameDescRequest } from \"../../domains/game-internationalization/game-pass-name-description/builders.ts\";\nimport {\n\tLOCALIZATION_OPERATION_LIMIT,\n\tLOCALIZATION_REQUIRED_SCOPES,\n} from \"../../domains/game-internationalization/game-pass-name-description/operations.ts\";\nimport type { UpdateGamePassNameDescriptionParameters } from \"../../domains/game-internationalization/game-pass-name-description/types.ts\";\nimport {\n\tbuildCreateRequest,\n\tbuildGetRequest,\n\tbuildListRequest,\n\tbuildUpdateRequest,\n} from \"../../domains/game-passes/game-passes/builders.ts\";\nimport {\n\tCREATE_OPERATION_LIMIT,\n\tCREATE_REQUIRED_SCOPES,\n\tGET_OPERATION_LIMIT,\n\tGET_REQUIRED_SCOPES,\n\tLIST_OPERATION_LIMIT,\n\tLIST_REQUIRED_SCOPES,\n\tUPDATE_OPERATION_LIMIT,\n\tUPDATE_REQUIRED_SCOPES,\n} from \"../../domains/game-passes/game-passes/operations.ts\";\nimport {\n\tparseGamePassesListResponse,\n\tparseGamePassResponse,\n} from \"../../domains/game-passes/game-passes/parsers.ts\";\nimport type {\n\tCreateGamePassParameters,\n\tGamePass,\n\tGetGamePassParameters,\n\tListGamePassesParameters,\n\tUpdateGamePassParameters,\n} from \"../../domains/game-passes/game-passes/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS, IDEMPOTENT_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport {\n\tokRequest,\n\tparseEmptyResponse,\n\tResourceClient,\n\ttype ResourceMethodSpec,\n} from \"../../internal/resource-client.ts\";\nimport type { Page, Result } from \"../../types.ts\";\n\nfunction makeSpec<P, R>(spec: ResourceMethodSpec<P, R>): ResourceMethodSpec<P, R> {\n\treturn Object.freeze(spec);\n}\n\nconst CREATE_SPEC = makeSpec<CreateGamePassParameters, GamePass>({\n\tbuildRequest: (parameters) => okRequest(buildCreateRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: CREATE_OPERATION_LIMIT,\n\tparse: parseGamePassResponse,\n\trequiredScopes: CREATE_REQUIRED_SCOPES,\n});\n\nconst GET_SPEC = makeSpec<GetGamePassParameters, GamePass>({\n\tbuildRequest: (parameters) => okRequest(buildGetRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: GET_OPERATION_LIMIT,\n\tparse: parseGamePassResponse,\n\trequiredScopes: GET_REQUIRED_SCOPES,\n});\n\nconst UPDATE_SPEC = makeSpec<UpdateGamePassParameters, undefined>({\n\tbuildRequest: (parameters) => okRequest(buildUpdateRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: UPDATE_OPERATION_LIMIT,\n\tparse: parseEmptyResponse,\n\trequiredScopes: UPDATE_REQUIRED_SCOPES,\n});\n\nconst LIST_SPEC = makeSpec<ListGamePassesParameters, Page<GamePass>>({\n\tbuildRequest: (parameters) => okRequest(buildListRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: LIST_OPERATION_LIMIT,\n\tparse: parseGamePassesListResponse,\n\trequiredScopes: LIST_REQUIRED_SCOPES,\n});\n\nconst UPDATE_NAME_DESCRIPTION_SPEC = makeSpec<UpdateGamePassNameDescriptionParameters, undefined>({\n\tbuildRequest: (parameters) => okRequest(buildLocaleNameDescRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: LOCALIZATION_OPERATION_LIMIT,\n\tparse: parseEmptyResponse,\n\trequiredScopes: LOCALIZATION_REQUIRED_SCOPES,\n});\n\nconst UPLOAD_ICON_SPEC = makeSpec<UploadGamePassIconParameters, undefined>({\n\tbuildRequest: (parameters) => okRequest(buildUploadIconRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: LOCALIZATION_OPERATION_LIMIT,\n\tparse: parseEmptyResponse,\n\trequiredScopes: LOCALIZATION_REQUIRED_SCOPES,\n});\n\ninterface GamePassLocalizationHandle {\n\t/**\n\t * Updates the per-locale display name and/or description registered against\n\t * a game pass. Either `name`, `description`, or both may be supplied;\n\t * omitted fields are not forwarded so the server leaves the existing value\n\t * for that locale untouched. Mirrors the upstream `200 OK` echo body as\n\t * `undefined` data.\n\t *\n\t * @param parameters - Game pass and language identifiers plus the optional\n\t * replacement values.\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\tupdateNameDescription: (\n\t\tparameters: UpdateGamePassNameDescriptionParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n\t/**\n\t * Uploads or replaces the per-locale icon for a game pass. A subsequent\n\t * upload for the same `(gamePassId, languageCode)` pair replaces the\n\t * existing icon for that locale. Does not retry on 5xx so a duplicate\n\t * upload cannot be created if the server fails mid-write.\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 - Game pass and language identifiers plus the image\n\t * bytes to upload.\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\tuploadIcon: (\n\t\tparameters: UploadGamePassIconParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n}\n\n/**\n * Public client for the Roblox Open Cloud Game Passes API.\n *\n * Wires request builders, the injected {@link\n * OpenCloudClientOptions.httpClient}, and response parsers into a single\n * ergonomic surface. Every method returns a {@link Result} so callers handle\n * failure explicitly; no thrown `OpenCloudError` ever escapes the client.\n *\n * ```ts\n * import { GamePassesClient } from \"@bedrock-rbx/ocale/game-passes\";\n *\n * const client = new GamePassesClient({\n * credential: { apiKey: process.env.ROBLOX_API_KEY!, kind: \"apiKey\" },\n * });\n *\n * const result = await client.get({\n * universeId: \"1234567890\",\n * gamePassId: \"9876543210\",\n * });\n *\n * if (result.success) {\n * console.log(`${result.data.name} (${result.data.id})`);\n * } else {\n * console.error(result.err.message);\n * }\n * ```\n *\n * Listing is cursor-paginated; drive the loop on `nextPageToken`:\n *\n * ```ts\n * let pageToken: string | undefined;\n * do {\n * const page = await client.list({ universeId: \"1234567890\", pageToken });\n * if (!page.success) {\n * console.error(page.err.message);\n * break;\n * }\n *\n * for (const pass of page.data.items) {\n * console.log(`${pass.name} (${pass.id})`);\n * }\n *\n * pageToken = page.data.nextPageToken;\n * } while (pageToken !== undefined);\n * ```\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { GamePassesClient } from \"@bedrock-rbx/ocale/game-passes\";\n *\n * const client = new GamePassesClient({\n * credential: { apiKey: \"your-key\", kind: \"apiKey\" },\n * });\n * expect(client).toBeInstanceOf(GamePassesClient);\n * ```\n */\nexport class GamePassesClient {\n\treadonly #inner: ResourceClient;\n\n\t/**\n\t * Operation Group exposing per-locale localization Operations\n\t * (`updateNameDescription`, `uploadIcon`) backed by the\n\t * `legacy-game-internationalization` domain. Source-language values\n\t * remain on {@link GamePassesClient.update}; methods on this group set\n\t * per-locale overlays on top. Shares the parent client's HTTP,\n\t * rate-limit, and retry plumbing.\n\t */\n\tpublic readonly localization: GamePassLocalizationHandle;\n\n\t/**\n\t * Creates a new {@link GamePassesClient}. Configuration is frozen on\n\t * construction; per-request overrides are accepted on each method.\n\t *\n\t * @param options - Client-level configuration including the API key.\n\t */\n\tconstructor(options: OpenCloudClientOptions) {\n\t\tthis.#inner = new ResourceClient(options);\n\t\tthis.localization = createLocalizationHandle(this.#inner);\n\t}\n\n\t/**\n\t * Creates a new game pass under the supplied universe.\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 - Creation fields including the universe and pass name.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed {@link GamePass} or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async create(\n\t\tparameters: CreateGamePassParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<GamePass, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: CREATE_SPEC });\n\t}\n\n\t/**\n\t * Reads a single game pass by ID.\n\t *\n\t * @param parameters - Universe and game pass identifiers.\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 GamePass} or the\n\t * {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async get(\n\t\tparameters: GetGamePassParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<GamePass, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: GET_SPEC });\n\t}\n\n\t/**\n\t * Lists one page of game passes for the supplied universe. Pagination is\n\t * cursor-based: omit `pageToken` for the first page, then thread the\n\t * previous response's `nextPageToken` back in until it is `undefined`.\n\t *\n\t * @param parameters - Universe identifier and optional page cursors.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping a {@link Page} of {@link GamePass},\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async list(\n\t\tparameters: ListGamePassesParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<Page<GamePass>, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: LIST_SPEC });\n\t}\n\n\t/**\n\t * Partially updates an existing game pass. Mirrors the upstream\n\t * `204 No Content` response: a successful update yields `undefined`\n\t * data. Callers that need the post-update state (for example to\n\t * observe a server-derived `updatedAt`) chain\n\t * {@link GamePassesClient.get} themselves so the GET only fires when\n\t * actually needed.\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 - The universe and game pass identifiers and the\n\t * fields to update. Only fields explicitly provided are forwarded.\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 update(\n\t\tparameters: UpdateGamePassParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: UPDATE_SPEC });\n\t}\n}\n\nfunction createLocalizationHandle(inner: ResourceClient): GamePassLocalizationHandle {\n\treturn {\n\t\tasync updateNameDescription(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: UPDATE_NAME_DESCRIPTION_SPEC });\n\t\t},\n\t\tasync uploadIcon(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: UPLOAD_ICON_SPEC });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,SAAgB,uBAAuB,YAAuD;CAC7F,MAAM,OAAO,IAAI,SAAS;CAC1B,KAAK,OAAO,SAAS,OAAO,WAAW,KAAK,CAAC;CAE7C,OAAO;EACN;EACA,QAAQ;EACR,KAAK,oDAAoD,WAAW,WAAW,wBAAwB,WAAW;CACnH;AACD;;;;;;;;;;;;;ACTA,SAAgBA,qBACf,YACc;CACd,MAAM,OAA+B,CAAC;CACtC,IAAI,WAAW,SAAS,KAAA,GACvB,KAAK,UAAU,WAAW;CAG3B,IAAI,WAAW,gBAAgB,KAAA,GAC9B,KAAK,iBAAiB,WAAW;CAGlC,OAAO;EACN;EACA,QAAQ;EACR,KAAK,oDAAoD,WAAW,WAAW,mCAAmC,WAAW;CAC9H;AACD;;;;;;;;;;;;ACnBA,MAAa,+BAA+C,OAAO,OAAO;CACzE,cAAc,MAAM;CACpB,cAAc;AACf,CAAC;;;;;;AAOD,MAAa,+BAAsD,OAAO,OAAO,CAChF,yBACD,CAAC;;;;;;;;;;ACPD,SAAgB,gBAAgB,YAAgD;CAC/E,OAAO;EACN,QAAQ;EACR,KAAK,6BAA6B,WAAW,WAAW,eAAe,WAAW,WAAW;CAC9F;AACD;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