@bedrock-rbx/ocale 0.1.0-beta.8 → 0.1.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 (81) hide show
  1. package/README.md +182 -0
  2. package/dist/badges.d.mts +33 -2
  3. package/dist/badges.d.mts.map +1 -1
  4. package/dist/badges.mjs +16 -4
  5. package/dist/badges.mjs.map +1 -1
  6. package/dist/{data.generated-Cb6g6asv.d.mts → data.generated-B2ceLfSn.d.mts} +9 -1
  7. package/dist/data.generated-B2ceLfSn.d.mts.map +1 -0
  8. package/dist/developer-products.d.mts +38 -2
  9. package/dist/developer-products.d.mts.map +1 -1
  10. package/dist/developer-products.mjs +32 -8
  11. package/dist/developer-products.mjs.map +1 -1
  12. package/dist/game-passes.d.mts +40 -2
  13. package/dist/game-passes.d.mts.map +1 -1
  14. package/dist/game-passes.mjs +30 -6
  15. package/dist/game-passes.mjs.map +1 -1
  16. package/dist/index.d.mts +21 -12
  17. package/dist/index.d.mts.map +1 -1
  18. package/dist/index.mjs +5 -5
  19. package/dist/locales.d.mts +1 -1
  20. package/dist/locales.mjs +2 -0
  21. package/dist/locales.mjs.map +1 -1
  22. package/dist/luau-execution.d.mts +22 -3
  23. package/dist/luau-execution.d.mts.map +1 -1
  24. package/dist/luau-execution.mjs +29 -13
  25. package/dist/luau-execution.mjs.map +1 -1
  26. package/dist/places.d.mts +20 -2
  27. package/dist/places.d.mts.map +1 -1
  28. package/dist/places.mjs +34 -14
  29. package/dist/places.mjs.map +1 -1
  30. package/dist/{poll-timeout-Dg_QFEqi.mjs → poll-timeout-C0nmJzOd.mjs} +6 -2
  31. package/dist/poll-timeout-C0nmJzOd.mjs.map +1 -0
  32. package/dist/{polling-helpers-CS00apdU.mjs → polling-helpers-BcycDhDm.mjs} +225 -78
  33. package/dist/polling-helpers-BcycDhDm.mjs.map +1 -0
  34. package/dist/{polling-BMrYajok.d.mts → polling-rj0dGREg.d.mts} +73 -14
  35. package/dist/polling-rj0dGREg.d.mts.map +1 -0
  36. package/dist/{price-information-DIrvwCmd.mjs → price-information-DK83Wul1.mjs} +2 -2
  37. package/dist/{price-information-DIrvwCmd.mjs.map → price-information-DK83Wul1.mjs.map} +1 -1
  38. package/dist/{rate-limit-D1q2Js-z.mjs → rate-limit-Co9i28qi.mjs} +30 -2
  39. package/dist/rate-limit-Co9i28qi.mjs.map +1 -0
  40. package/dist/{resource-client-D6Efj9fU.mjs → resource-client-C_D--PYX.mjs} +328 -243
  41. package/dist/resource-client-C_D--PYX.mjs.map +1 -0
  42. package/dist/retry-CbHBw60o.mjs +380 -0
  43. package/dist/retry-CbHBw60o.mjs.map +1 -0
  44. package/dist/retry-r1TXe5Zd.d.mts +189 -0
  45. package/dist/retry-r1TXe5Zd.d.mts.map +1 -0
  46. package/dist/{signatures-B5Fojgn0.mjs → signatures-JF-7Psce.mjs} +1 -1
  47. package/dist/{signatures-B5Fojgn0.mjs.map → signatures-JF-7Psce.mjs.map} +1 -1
  48. package/dist/storage.d.mts +316 -31
  49. package/dist/storage.d.mts.map +1 -1
  50. package/dist/storage.mjs +525 -24
  51. package/dist/storage.mjs.map +1 -1
  52. package/dist/testing.d.mts +24 -9
  53. package/dist/testing.d.mts.map +1 -1
  54. package/dist/testing.mjs +2 -2
  55. package/dist/testing.mjs.map +1 -1
  56. package/dist/{to-blob-B27VhoRp.mjs → to-blob-RPqMBuft.mjs} +1 -1
  57. package/dist/{to-blob-B27VhoRp.mjs.map → to-blob-RPqMBuft.mjs.map} +1 -1
  58. package/dist/{types-CwtZT1ek.d.mts → types-CRiJg5EQ.d.mts} +46 -4
  59. package/dist/types-CRiJg5EQ.d.mts.map +1 -0
  60. package/dist/universes.d.mts +47 -5
  61. package/dist/universes.d.mts.map +1 -1
  62. package/dist/universes.mjs +31 -15
  63. package/dist/universes.mjs.map +1 -1
  64. package/dist/{validation-DkL5KQqz.mjs → validation-9oU6qNNQ.mjs} +4 -2
  65. package/dist/validation-9oU6qNNQ.mjs.map +1 -0
  66. package/dist/{wire-CeL6W_V7.d.mts → wire-D3K-a-UP.d.mts} +3 -1
  67. package/dist/wire-D3K-a-UP.d.mts.map +1 -0
  68. package/package.json +7 -6
  69. package/dist/data.generated-Cb6g6asv.d.mts.map +0 -1
  70. package/dist/permission-error-DOVtNq3A.mjs +0 -46
  71. package/dist/permission-error-DOVtNq3A.mjs.map +0 -1
  72. package/dist/poll-timeout-Dg_QFEqi.mjs.map +0 -1
  73. package/dist/polling-BMrYajok.d.mts.map +0 -1
  74. package/dist/polling-helpers-CS00apdU.mjs.map +0 -1
  75. package/dist/rate-limit-BYuizHoD.d.mts +0 -92
  76. package/dist/rate-limit-BYuizHoD.d.mts.map +0 -1
  77. package/dist/rate-limit-D1q2Js-z.mjs.map +0 -1
  78. package/dist/resource-client-D6Efj9fU.mjs.map +0 -1
  79. package/dist/types-CwtZT1ek.d.mts.map +0 -1
  80. package/dist/validation-DkL5KQqz.mjs.map +0 -1
  81. package/dist/wire-CeL6W_V7.d.mts.map +0 -1
@@ -1,14 +1,18 @@
1
- import { d as OpenCloudError, i as OpenCloudClientOptions, l as Result, s as RequestOptions } from "./types-CwtZT1ek.mjs";
2
- import { i as RobloxLocale, r as RobloxLanguageCode } from "./data.generated-Cb6g6asv.mjs";
1
+ import { d as OpenCloudError, i as OpenCloudClientOptions, l as Result, s as RequestOptions } from "./types-CRiJg5EQ.mjs";
2
+ import { i as RobloxLocale, r as RobloxLanguageCode } from "./data.generated-B2ceLfSn.mjs";
3
3
 
4
4
  //#region src/domains/developer-products/products/types.d.ts
5
5
  /**
6
6
  * Pricing feature flags that can be enabled on a developer product. Values
7
7
  * mirror the Open Cloud `DeveloperProducts.PricingFeature` enum.
8
+ *
9
+ * @since 0.1.0
8
10
  */
9
11
  type DeveloperProductPricingFeature = "Invalid" | "PriceOptimization" | "RegionalPricing" | "UserFixedPrice";
10
12
  /**
11
13
  * Public shape of a developer product's pricing configuration.
14
+ *
15
+ * @since 0.1.0
12
16
  */
13
17
  interface DeveloperProductPrice {
14
18
  /** Default Robux price; `undefined` when no default price is configured. */
@@ -20,6 +24,8 @@ interface DeveloperProductPrice {
20
24
  * A Roblox developer product as exposed to SDK consumers. Fields use
21
25
  * DX-friendly names and types (stringified IDs, `Date` timestamps) rather
22
26
  * than the raw wire representation.
27
+ *
28
+ * @since 0.1.0
23
29
  */
24
30
  interface DeveloperProduct {
25
31
  /** Stringified developer product ID. The API returns an int64; always use this. */
@@ -47,6 +53,8 @@ interface DeveloperProduct {
47
53
  }
48
54
  /**
49
55
  * Parameters for creating a new developer product under a universe.
56
+ *
57
+ * @since 0.1.0
50
58
  */
51
59
  interface CreateDeveloperProductParameters {
52
60
  /** Display name of the new developer product. */
@@ -66,6 +74,8 @@ interface CreateDeveloperProductParameters {
66
74
  }
67
75
  /**
68
76
  * Parameters for reading a single developer product by ID.
77
+ *
78
+ * @since 0.1.0
69
79
  */
70
80
  interface GetDeveloperProductParameters {
71
81
  /** Stringified ID of the developer product to retrieve. */
@@ -78,6 +88,8 @@ interface GetDeveloperProductParameters {
78
88
  * field except the identifiers is optional; omitted fields are not included
79
89
  * in the multipart PATCH body so the server leaves their current values
80
90
  * untouched.
91
+ *
92
+ * @since 0.1.0
81
93
  */
82
94
  interface UpdateDeveloperProductParameters {
83
95
  /** Optional new display name. */
@@ -106,6 +118,8 @@ interface UpdateDeveloperProductParameters {
106
118
  * against a developer product. A subsequent upload for the same
107
119
  * `(productId, languageCode)` pair replaces the existing icon for that
108
120
  * locale.
121
+ *
122
+ * @since 0.1.0
109
123
  */
110
124
  interface UploadDeveloperProductIconParameters {
111
125
  /** Image bytes to upload. PNG and JPEG are accepted by the server. */
@@ -126,6 +140,8 @@ interface UploadDeveloperProductIconParameters {
126
140
  * against a developer product. Both `name` and `description` are optional;
127
141
  * fields omitted from the call are not included in the JSON body so the
128
142
  * server leaves the existing value for that locale untouched.
143
+ *
144
+ * @since 0.1.0
129
145
  */
130
146
  interface UpdateDeveloperProductNameDescriptionParameters {
131
147
  /** Replacement display name for the supplied locale. */
@@ -164,6 +180,9 @@ interface DeveloperProductLocalizationHandle {
164
180
  * the existing icon for that locale. Does not retry on 5xx so a duplicate
165
181
  * upload cannot be created if the server fails mid-write.
166
182
  *
183
+ * No default request timeout applies to this upload; pass `options.timeout`
184
+ * to set a per-call deadline.
185
+ *
167
186
  * @param parameters - Product and language identifiers plus the image
168
187
  * bytes to upload.
169
188
  * @param options - Optional per-request overrides.
@@ -196,6 +215,17 @@ interface DeveloperProductLocalizationHandle {
196
215
  * console.error(result.err.message);
197
216
  * }
198
217
  * ```
218
+ *
219
+ * @since 0.1.0
220
+ *
221
+ * @example
222
+ *
223
+ * ```ts
224
+ * import { DeveloperProductsClient } from "@bedrock-rbx/ocale/developer-products";
225
+ *
226
+ * const client = new DeveloperProductsClient({ apiKey: "your-key" });
227
+ * expect(client).toBeInstanceOf(DeveloperProductsClient);
228
+ * ```
199
229
  */
200
230
  declare class DeveloperProductsClient {
201
231
  #private;
@@ -218,6 +248,9 @@ declare class DeveloperProductsClient {
218
248
  /**
219
249
  * Creates a new developer product under the supplied universe.
220
250
  *
251
+ * No default request timeout applies to this upload; pass `options.timeout`
252
+ * to set a per-call deadline.
253
+ *
221
254
  * @param parameters - Creation fields including the universe and product name.
222
255
  * @param options - Optional per-request overrides.
223
256
  * @returns A {@link Result} wrapping the parsed {@link DeveloperProduct} or
@@ -241,6 +274,9 @@ declare class DeveloperProductsClient {
241
274
  * server-derived `updatedTimestamp`) chain {@link DeveloperProductsClient.get}
242
275
  * themselves so the GET only fires when actually needed.
243
276
  *
277
+ * No default request timeout applies to this upload; pass `options.timeout`
278
+ * to set a per-call deadline.
279
+ *
244
280
  * @param parameters - The universe and product identifiers and the
245
281
  * fields to update. Only fields explicitly provided are forwarded.
246
282
  * @param options - Optional per-request overrides.
@@ -1 +1 @@
1
- {"version":3,"file":"developer-products.d.mts","names":[],"sources":["../src/domains/developer-products/products/types.ts","../src/domains/game-internationalization/developer-product-icon/types.ts","../src/domains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AA,EACZ,OAAA,GAAU,cAAA,KACN,OAAA,CAAQ,MAAA,YAAkB,cAAA;;;;;;;;;;;;;EAa/B,UAAA,GACC,UAAA,EAAY,oCAAA,EACZ,OAAA,GAAU,cAAA,KACN,OAAA,CAAQ,MAAA,YAAkB,cAAA;AAAA;;;;;;;;;AHxEhC;;;;;;;;;;;;;;;AAoBA;;cGgFa,uBAAA;EAAA;EH5EH;AASV;;;;;;;EATU,SGuFO,YAAA,EAAc,kCAAA;;;;;;;EAQ9B,WAAA,CAAY,OAAA,EAAS,sBAAA;;;;;;AFpKtB;;;EEiLC,MAAA,CACC,UAAA,EAAY,gCAAA,EACZ,OAAA,GAAU,cAAA,GACR,OAAA,CAAQ,MAAA,CAAO,gBAAA,EAAkB,cAAA;;;;;;;;;;EAapC,GAAA,CACC,UAAA,EAAY,6BAAA,EACZ,OAAA,GAAU,cAAA,GACR,OAAA,CAAQ,MAAA,CAAO,gBAAA,EAAkB,cAAA;;;;;;;;ADpMrC;;;;;;ECqNC,MAAA,CACC,UAAA,EAAY,gCAAA,EACZ,OAAA,GAAU,cAAA,GACR,OAAA,CAAQ,MAAA,YAAkB,cAAA;AAAA"}
1
+ {"version":3,"file":"developer-products.d.mts","names":[],"sources":["../src/domains/developer-products/products/types.ts","../src/domains/game-internationalization/developer-product-icon/types.ts","../src/domains/game-internationalization/developer-product-name-description/types.ts","../src/resources/developer-products/client.ts"],"mappings":";;;;;;;;AAMA;;KAAY,8BAAA;;AAAA;AAWZ;;;UAAiB,qBAAA;;WAEP,mBAAA;;WAEA,eAAA,EAAiB,aAAA,CAAc,8BAAA;AAAA;AAAA;AAUzC;;;;;;AAVyC,UAUxB,gBAAA;EAsBI;EAAA,SApBX,EAAA;;WAEA,IAAA;;WAEA,SAAA,EAAW,IAAA;;WAEX,WAAA;;WAEA,gBAAA;;WAEA,SAAA;;WAEA,WAAA;;WAEA,KAAA,EAAO,qBAAA;EAMI;EAAA,SAJX,gBAAA;EAYO;EAAA,SAVP,UAAA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qEa,uBAAA;EAAA;;;;AHnDH;;;;AC1GV;WEwKiB,YAAA,EAAc,kCAAA;;;;;;;EAQ9B,WAAA,CAAY,OAAA,EAAS,sBAAA;;;;;;;;;AFtKZ;;;EEsLT,MAAA,CACC,UAAA,EAAY,gCAAA,EACZ,OAAA,GAAU,cAAA,GACR,OAAA,CAAQ,MAAA,CAAO,gBAAA,EAAkB,cAAA;EDnMrC;;;;;;;;;ECgNC,GAAA,CACC,UAAA,EAAY,6BAAA,EACZ,OAAA,GAAU,cAAA,GACR,OAAA,CAAQ,MAAA,CAAO,gBAAA,EAAkB,cAAA;EDvM3B;AAAA;;;;ACckB;;;;;;;;;;;EA6M3B,MAAA,CACC,UAAA,EAAY,gCAAA,EACZ,OAAA,GAAU,cAAA,GACR,OAAA,CAAQ,MAAA,YAAkB,cAAA;AAAA"}
@@ -1,7 +1,8 @@
1
- import { r as ApiError } from "./rate-limit-D1q2Js-z.mjs";
2
- import { t as toBlob } from "./to-blob-B27VhoRp.mjs";
3
- import { a as IDEMPOTENT_METHOD_DEFAULTS, c as isDateTimeString, i as CREATE_METHOD_DEFAULTS, n as okRequest, r as parseEmptyResponse, s as isRecord, t as ResourceClient } from "./resource-client-D6Efj9fU.mjs";
4
- import { n as isPriceInformationLike, t as copyPriceInformation } from "./price-information-DIrvwCmd.mjs";
1
+ import { r as ApiError } from "./rate-limit-Co9i28qi.mjs";
2
+ import { n as IDEMPOTENT_METHOD_DEFAULTS, t as CREATE_METHOD_DEFAULTS } from "./retry-CbHBw60o.mjs";
3
+ import { t as toBlob } from "./to-blob-RPqMBuft.mjs";
4
+ import { a as isDateTimeString, i as isRecord, n as okRequest, r as parseEmptyResponse, t as ResourceClient } from "./resource-client-C_D--PYX.mjs";
5
+ import { n as isPriceInformationLike, t as copyPriceInformation } from "./price-information-DK83Wul1.mjs";
5
6
  //#region src/domains/developer-products/products/builders.ts
6
7
  /**
7
8
  * Builds a `GET` request for the Open Cloud "read developer product"
@@ -121,10 +122,7 @@ const WRITE_REQUIRED_SCOPES = Object.freeze(["developer-product:write"]);
121
122
  */
122
123
  function parseDeveloperProductResponse(response) {
123
124
  const { body, status: statusCode } = response;
124
- if (!isDeveloperProductConfigV2(body)) return {
125
- err: new ApiError("Malformed developer product response", { statusCode }),
126
- success: false
127
- };
125
+ if (!isDeveloperProductConfigV2(body)) return malformedDeveloperProduct(statusCode, body);
128
126
  const priceWire = body.priceInformation ?? void 0;
129
127
  const iconAssetId = body.iconImageAssetId ?? void 0;
130
128
  return {
@@ -144,6 +142,15 @@ function parseDeveloperProductResponse(response) {
144
142
  success: true
145
143
  };
146
144
  }
145
+ function malformedDeveloperProduct(statusCode, body) {
146
+ return {
147
+ err: new ApiError("Malformed developer product response", {
148
+ details: body,
149
+ statusCode
150
+ }),
151
+ success: false
152
+ };
153
+ }
147
154
  function hasRequiredPrimitiveFields(body) {
148
155
  return typeof body["productId"] === "number" && body["productId"] !== 0 && typeof body["universeId"] === "number" && typeof body["name"] === "string" && typeof body["description"] === "string" && typeof body["isForSale"] === "boolean" && typeof body["isImmutable"] === "boolean" && typeof body["storePageEnabled"] === "boolean" && isDateTimeString(body["createdTimestamp"]) && isDateTimeString(body["updatedTimestamp"]);
149
156
  }
@@ -290,6 +297,17 @@ const UPLOAD_ICON_SPEC = makeSpec({
290
297
  * console.error(result.err.message);
291
298
  * }
292
299
  * ```
300
+ *
301
+ * @since 0.1.0
302
+ *
303
+ * @example
304
+ *
305
+ * ```ts
306
+ * import { DeveloperProductsClient } from "@bedrock-rbx/ocale/developer-products";
307
+ *
308
+ * const client = new DeveloperProductsClient({ apiKey: "your-key" });
309
+ * expect(client).toBeInstanceOf(DeveloperProductsClient);
310
+ * ```
293
311
  */
294
312
  var DeveloperProductsClient = class {
295
313
  #inner;
@@ -315,6 +333,9 @@ var DeveloperProductsClient = class {
315
333
  /**
316
334
  * Creates a new developer product under the supplied universe.
317
335
  *
336
+ * No default request timeout applies to this upload; pass `options.timeout`
337
+ * to set a per-call deadline.
338
+ *
318
339
  * @param parameters - Creation fields including the universe and product name.
319
340
  * @param options - Optional per-request overrides.
320
341
  * @returns A {@link Result} wrapping the parsed {@link DeveloperProduct} or
@@ -350,6 +371,9 @@ var DeveloperProductsClient = class {
350
371
  * server-derived `updatedTimestamp`) chain {@link DeveloperProductsClient.get}
351
372
  * themselves so the GET only fires when actually needed.
352
373
  *
374
+ * No default request timeout applies to this upload; pass `options.timeout`
375
+ * to set a per-call deadline.
376
+ *
353
377
  * @param parameters - The universe and product identifiers and the
354
378
  * fields to update. Only fields explicitly provided are forwarded.
355
379
  * @param options - Optional per-request overrides.
@@ -1 +1 @@
1
- {"version":3,"file":"developer-products.mjs","names":["buildUpdateRequest","buildUpdateRequest","buildLocaleNameDescRequest","#inner"],"sources":["../src/domains/developer-products/products/builders.ts","../src/domains/developer-products/products/operations.ts","../src/domains/developer-products/products/parsers.ts","../src/domains/game-internationalization/developer-product-icon/builders.ts","../src/domains/game-internationalization/developer-product-name-description/builders.ts","../src/domains/game-internationalization/developer-product-name-description/operations.ts","../src/resources/developer-products/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { toBlob } from \"../../../internal/utils/to-blob.ts\";\nimport type {\n\tCreateDeveloperProductParameters,\n\tGetDeveloperProductParameters,\n\tUpdateDeveloperProductParameters,\n} from \"./types.ts\";\n\n/**\n * Builds a `GET` request for the Open Cloud \"read developer product\"\n * endpoint.\n *\n * @param parameters - Universe and product identifiers to interpolate into\n * the URL.\n * @returns A pure {@link HttpRequest} describing the read call.\n */\nexport function buildGetRequest(parameters: GetDeveloperProductParameters): HttpRequest {\n\treturn {\n\t\tmethod: \"GET\",\n\t\turl: `/developer-products/v2/universes/${parameters.universeId}/developer-products/${parameters.productId}/creator`,\n\t};\n}\n\n/**\n * Builds a `POST` request for the Open Cloud \"create developer product\"\n * endpoint.\n *\n * @param parameters - Fields describing the new developer product; optional\n * values omitted here are left off the multipart payload entirely.\n * @returns A pure {@link HttpRequest} describing the create call.\n */\nexport function buildCreateRequest(parameters: CreateDeveloperProductParameters): 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: `/developer-products/v2/universes/${parameters.universeId}/developer-products`,\n\t};\n}\n\n/**\n * Builds a `PATCH` request for the Open Cloud \"update developer product\"\n * endpoint. Every field on `parameters` except the identifiers is optional;\n * omitted fields are not appended to the multipart body so the server leaves\n * them unchanged.\n *\n * @param parameters - Identifiers plus fields to update.\n * @returns A pure {@link HttpRequest} describing the update call.\n */\nexport function buildUpdateRequest(parameters: UpdateDeveloperProductParameters): 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.storePageEnabled !== undefined) {\n\t\tbody.append(\"storePageEnabled\", String(parameters.storePageEnabled));\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: \"PATCH\",\n\t\turl: `/developer-products/v2/universes/${parameters.universeId}/developer-products/${parameters.productId}`,\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 developer product, from\n * the Open Cloud OpenAPI schema.\n */\nexport const GET_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 10,\n\toperationKey: \"developer-products.get\",\n});\n\n/**\n * Per-second request ceiling for creating a developer product, from the\n * Open Cloud OpenAPI schema.\n */\nexport const CREATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 3,\n\toperationKey: \"developer-products.create\",\n});\n\n/**\n * Per-second request ceiling for updating a developer product, from the\n * Open Cloud OpenAPI schema. Keyed independently from\n * {@link CREATE_OPERATION_LIMIT} so create and update do not share a queue,\n * since Roblox does not document the per-minute quota as shared between\n * the POST and PATCH endpoints.\n */\nexport const UPDATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 3,\n\toperationKey: \"developer-products.update\",\n});\n\n/**\n * Scopes the API key or OAuth token must carry to read a developer product,\n * sourced from `x-roblox-scopes` on the `DeveloperProducts_GetDeveloperProductConfigV2`\n * operation in the vendored OpenAPI schema.\n */\nexport const GET_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"developer-product:read\"]);\n\n/**\n * Scopes the API key or OAuth token must carry to create or update a developer\n * product, sourced from `x-roblox-scopes` on the\n * `DeveloperProducts_CreateDeveloperProductV2` and\n * `DeveloperProducts_UpdateDeveloperProductV2` operations in the vendored\n * OpenAPI schema.\n */\nexport const WRITE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"developer-product:write\",\n]);\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 type { Result } from \"../../../types.ts\";\nimport type { DeveloperProduct } from \"./types.ts\";\nimport type { DeveloperProductConfigV2, DeveloperProductPricingFeatureWire } from \"./wire.ts\";\n\n/**\n * Parses a successful Developer Products API response into the public\n * `DeveloperProduct` shape, returning a `Result` so callers can handle\n * malformed payloads 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 `DeveloperProduct`, or\n * an `ApiError` when the body does not match the wire schema.\n */\nexport function parseDeveloperProductResponse(\n\tresponse: HttpResponse,\n): Result<DeveloperProduct, ApiError> {\n\tconst { body, status: statusCode } = response;\n\n\tif (!isDeveloperProductConfigV2(body)) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed developer product response\", { statusCode }),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst priceWire = body.priceInformation ?? undefined;\n\tconst iconAssetId = body.iconImageAssetId ?? undefined;\n\n\treturn {\n\t\tdata: {\n\t\t\tid: String(body.productId),\n\t\t\tname: body.name,\n\t\t\tcreatedAt: new Date(body.createdTimestamp),\n\t\t\tdescription: body.description,\n\t\t\ticonImageAssetId: iconAssetId === undefined ? undefined : String(iconAssetId),\n\t\t\tisForSale: body.isForSale,\n\t\t\tisImmutable: body.isImmutable,\n\t\t\tprice: priceWire === undefined ? undefined : copyPriceInformation(priceWire),\n\t\t\tstorePageEnabled: body.storePageEnabled,\n\t\t\tuniverseId: String(body.universeId),\n\t\t\tupdatedAt: new Date(body.updatedTimestamp),\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction hasRequiredPrimitiveFields(body: Record<string, unknown>): boolean {\n\treturn (\n\t\ttypeof body[\"productId\"] === \"number\" &&\n\t\t// Roblox never assigns asset ID 0; a zero productId signals a\n\t\t// malformed response, not a legitimate product.\n\t\tbody[\"productId\"] !== 0 &&\n\t\ttypeof body[\"universeId\"] === \"number\" &&\n\t\ttypeof body[\"name\"] === \"string\" &&\n\t\ttypeof body[\"description\"] === \"string\" &&\n\t\ttypeof body[\"isForSale\"] === \"boolean\" &&\n\t\ttypeof body[\"isImmutable\"] === \"boolean\" &&\n\t\ttypeof body[\"storePageEnabled\"] === \"boolean\" &&\n\t\tisDateTimeString(body[\"createdTimestamp\"]) &&\n\t\tisDateTimeString(body[\"updatedTimestamp\"])\n\t);\n}\n\nfunction isPricingFeatureWire(value: unknown): value is DeveloperProductPricingFeatureWire {\n\treturn (\n\t\tvalue === \"Invalid\" ||\n\t\tvalue === \"PriceOptimization\" ||\n\t\tvalue === \"RegionalPricing\" ||\n\t\tvalue === \"UserFixedPrice\"\n\t);\n}\n\nfunction isDeveloperProductConfigV2(body: unknown): body is DeveloperProductConfigV2 {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\tif (!hasRequiredPrimitiveFields(body)) {\n\t\treturn false;\n\t}\n\n\tconst iconImageAssetId = body[\"iconImageAssetId\"] ?? undefined;\n\tif (iconImageAssetId !== undefined && typeof iconImageAssetId !== \"number\") {\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","import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { toBlob } from \"../../../internal/utils/to-blob.ts\";\nimport type { UploadDeveloperProductIconParameters } from \"./types.ts\";\n\n/**\n * Builds a `POST` request for the localized \"upload developer-product icon\"\n * endpoint. A successful upload replaces any existing icon for the same\n * `(productId, languageCode)` pair.\n *\n * @param parameters - Product and language identifiers plus the image bytes\n * to upload.\n * @returns A pure {@link HttpRequest} describing the upload call.\n */\nexport function buildUploadIconRequest(\n\tparameters: UploadDeveloperProductIconParameters,\n): 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/developer-products/${parameters.productId}/icons/language-codes/${parameters.languageCode}`,\n\t};\n}\n","import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport type { UpdateDeveloperProductNameDescriptionParameters } from \"./types.ts\";\n\n/**\n * Builds a `PATCH` request for the localized \"update developer-product\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 - Product 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: UpdateDeveloperProductNameDescriptionParameters,\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/developer-products/${parameters.productId}/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 developer-product localization\n * Operation. The legacy `gameinternationalization` service caps each API key\n * at 100 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 developer-product localization methods queue against\n * the same operation key.\n */\nexport const LOCALIZATION_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 100 / 60,\n\toperationKey: \"developer-product-localization\",\n});\n\n/**\n * Scopes required for every developer-product localization operation, sourced\n * from `x-roblox-scopes` on the legacy `gameinternationalization`\n * developer-product endpoints in the vendored OpenAPI schema.\n */\nexport const LOCALIZATION_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"legacy-developer-product:manage\",\n]);\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport {\n\tbuildCreateRequest,\n\tbuildGetRequest,\n\tbuildUpdateRequest,\n} from \"../../domains/developer-products/products/builders.ts\";\nimport {\n\tCREATE_OPERATION_LIMIT,\n\tGET_OPERATION_LIMIT,\n\tGET_REQUIRED_SCOPES,\n\tUPDATE_OPERATION_LIMIT,\n\tWRITE_REQUIRED_SCOPES,\n} from \"../../domains/developer-products/products/operations.ts\";\nimport { parseDeveloperProductResponse } from \"../../domains/developer-products/products/parsers.ts\";\nimport type {\n\tCreateDeveloperProductParameters,\n\tDeveloperProduct,\n\tGetDeveloperProductParameters,\n\tUpdateDeveloperProductParameters,\n} from \"../../domains/developer-products/products/types.ts\";\nimport { buildUploadIconRequest } from \"../../domains/game-internationalization/developer-product-icon/builders.ts\";\nimport type { UploadDeveloperProductIconParameters } from \"../../domains/game-internationalization/developer-product-icon/types.ts\";\nimport { buildUpdateRequest as buildLocaleNameDescRequest } from \"../../domains/game-internationalization/developer-product-name-description/builders.ts\";\nimport {\n\tLOCALIZATION_OPERATION_LIMIT,\n\tLOCALIZATION_REQUIRED_SCOPES,\n} from \"../../domains/game-internationalization/developer-product-name-description/operations.ts\";\nimport type { UpdateDeveloperProductNameDescriptionParameters } from \"../../domains/game-internationalization/developer-product-name-description/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 { Result } from \"../../types.ts\";\n\nfunction makeSpec<P, R = DeveloperProduct>(\n\tspec: ResourceMethodSpec<P, R>,\n): ResourceMethodSpec<P, R> {\n\treturn Object.freeze(spec);\n}\n\nconst CREATE_SPEC = makeSpec<CreateDeveloperProductParameters>({\n\tbuildRequest: (parameters) => okRequest(buildCreateRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: CREATE_OPERATION_LIMIT,\n\tparse: parseDeveloperProductResponse,\n\trequiredScopes: WRITE_REQUIRED_SCOPES,\n});\n\nconst GET_SPEC = makeSpec<GetDeveloperProductParameters>({\n\tbuildRequest: (parameters) => okRequest(buildGetRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: GET_OPERATION_LIMIT,\n\tparse: parseDeveloperProductResponse,\n\trequiredScopes: GET_REQUIRED_SCOPES,\n});\n\nconst UPDATE_SPEC = makeSpec<UpdateDeveloperProductParameters, 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: WRITE_REQUIRED_SCOPES,\n});\n\nconst UPDATE_NAME_DESCRIPTION_SPEC = makeSpec<\n\tUpdateDeveloperProductNameDescriptionParameters,\n\tundefined\n>({\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<UploadDeveloperProductIconParameters, 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 DeveloperProductLocalizationHandle {\n\t/**\n\t * Updates the per-locale display name and/or description registered against\n\t * a developer product. Either `name`, `description`, or both may be\n\t * supplied; omitted fields are not forwarded so the server leaves the\n\t * existing value for that locale untouched. Mirrors the upstream `200 OK`\n\t * echo body as `undefined` data.\n\t *\n\t * @param parameters - Product 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: UpdateDeveloperProductNameDescriptionParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n\t/**\n\t * Uploads or replaces the per-locale icon for a developer product. A\n\t * subsequent upload for the same `(productId, languageCode)` pair replaces\n\t * the 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 * @param parameters - Product 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: UploadDeveloperProductIconParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n}\n\n/**\n * Public client for the Roblox Open Cloud Developer Products API.\n *\n * Wires request builders, the injected {@link OpenCloudClientOptions.httpClient}, and response\n * parsers into a single ergonomic surface. Every method returns a\n * {@link Result} so callers handle failure explicitly; no thrown\n * `OpenCloudError` ever escapes the client.\n *\n * ```ts\n * import { DeveloperProductsClient } from \"@bedrock-rbx/ocale/developer-products\";\n *\n * const client = new DeveloperProductsClient({ apiKey: process.env.ROBLOX_API_KEY! });\n *\n * const result = await client.get({\n * universeId: \"1234567890\",\n * productId: \"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 */\nexport class DeveloperProductsClient {\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 DeveloperProductsClient.update}; methods on this\n\t * group set per-locale overlays on top. Shares the parent client's\n\t * HTTP, rate-limit, and retry plumbing.\n\t */\n\tpublic readonly localization: DeveloperProductLocalizationHandle;\n\n\t/**\n\t * Creates a new {@link DeveloperProductsClient}. Configuration is frozen\n\t * on 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 developer product under the supplied universe.\n\t *\n\t * @param parameters - Creation fields including the universe and product name.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed {@link DeveloperProduct} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async create(\n\t\tparameters: CreateDeveloperProductParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<DeveloperProduct, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: CREATE_SPEC });\n\t}\n\n\t/**\n\t * Reads a single developer product by ID.\n\t *\n\t * @param parameters - Universe and product 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 DeveloperProduct} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async get(\n\t\tparameters: GetDeveloperProductParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<DeveloperProduct, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: GET_SPEC });\n\t}\n\n\t/**\n\t * Partially updates an existing developer product. Mirrors the upstream\n\t * `204 No Content` response: a successful update yields `undefined` data.\n\t * Callers that need the post-update state (for example to observe a\n\t * server-derived `updatedTimestamp`) chain {@link DeveloperProductsClient.get}\n\t * themselves so the GET only fires when actually needed.\n\t *\n\t * @param parameters - The universe and product 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: UpdateDeveloperProductParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: UPDATE_SPEC });\n\t}\n}\n\nfunction createLocalizationHandle(inner: ResourceClient): DeveloperProductLocalizationHandle {\n\treturn {\n\t\tasync updateNameDescription(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: UPDATE_NAME_DESCRIPTION_SPEC });\n\t\t},\n\t\tasync uploadIcon(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: UPLOAD_ICON_SPEC });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,SAAgB,gBAAgB,YAAwD;AACvF,QAAO;EACN,QAAQ;EACR,KAAK,oCAAoC,WAAW,WAAW,sBAAsB,WAAW,UAAU;EAC1G;;;;;;;;;;AAWF,SAAgB,mBAAmB,YAA2D;CAC7F,MAAM,OAAO,IAAI,UAAU;AAC3B,MAAK,OAAO,QAAQ,WAAW,KAAK;AACpC,KAAI,WAAW,gBAAgB,KAAA,EAC9B,MAAK,OAAO,eAAe,WAAW,YAAY;AAGnD,KAAI,WAAW,cAAc,KAAA,EAC5B,MAAK,OAAO,aAAa,OAAO,WAAW,UAAU,CAAC;AAGvD,KAAI,WAAW,UAAU,KAAA,EACxB,MAAK,OAAO,SAAS,OAAO,WAAW,MAAM,CAAC;AAG/C,KAAI,WAAW,6BAA6B,KAAA,EAC3C,MAAK,OAAO,4BAA4B,OAAO,WAAW,yBAAyB,C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B,CAAC;AAEF,MAAM,+BAA+B,SAGnC;CACD,eAAe,eAAe,UAAUC,mBAA2B,WAAW,CAAC;CAC/E,gBAAgB;CAChB,YAAY;CACZ,gBAAgB;CAChB,OAAO;CACP,gBAAgB;CAChB,CAAC;AAEF,MAAM,mBAAmB,SAA0D;CAClF,eAAe,eAAe,UAAU,uBAAuB,WAAW,CAAC;CAC3E,gBAAgB;CAChB,YAAY;CACZ,gBAAgB;CAChB,OAAO;CACP,gBAAgB;CAChB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DF,IAAa,0BAAb,MAAqC;CACpC;;;;;;;;;CAUA;;;;;;;CAQA,YAAY,SAAiC;AAC5C,QAAA,QAAc,IAAI,eAAe,QAAQ;AACzC,OAAK,eAAe,yBAAyB,MAAA,MAAY;;;;;;;;;;CAW1D,MAAa,OACZ,YACA,SACoD;AACpD,SAAO,MAAA,MAAY,QAAQ;GAAE;GAAS;GAAY,MAAM;GAAa,CAAC;;;;;;;;;;;CAYvE,MAAa,IACZ,YACA,SACoD;AACpD,SAAO,MAAA,MAAY,QAAQ;GAAE;GAAS;GAAY,MAAM;GAAU,CAAC;;;;;;;;;;;;;;;CAgBpE,MAAa,OACZ,YACA,SAC6C;AAC7C,SAAO,MAAA,MAAY,QAAQ;GAAE;GAAS;GAAY,MAAM;GAAa,CAAC;;;AAIxE,SAAS,yBAAyB,OAA2D;AAC5F,QAAO;EACN,MAAM,sBAAsB,YAAY,SAAS;AAChD,UAAO,MAAM,QAAQ;IAAE;IAAS;IAAY,MAAM;IAA8B,CAAC;;EAElF,MAAM,WAAW,YAAY,SAAS;AACrC,UAAO,MAAM,QAAQ;IAAE;IAAS;IAAY,MAAM;IAAkB,CAAC;;EAEtE"}
1
+ {"version":3,"file":"developer-products.mjs","names":["buildUpdateRequest","buildUpdateRequest","buildLocaleNameDescRequest","#inner"],"sources":["../src/domains/developer-products/products/builders.ts","../src/domains/developer-products/products/operations.ts","../src/domains/developer-products/products/parsers.ts","../src/domains/game-internationalization/developer-product-icon/builders.ts","../src/domains/game-internationalization/developer-product-name-description/builders.ts","../src/domains/game-internationalization/developer-product-name-description/operations.ts","../src/resources/developer-products/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { toBlob } from \"../../../internal/utils/to-blob.ts\";\nimport type {\n\tCreateDeveloperProductParameters,\n\tGetDeveloperProductParameters,\n\tUpdateDeveloperProductParameters,\n} from \"./types.ts\";\n\n/**\n * Builds a `GET` request for the Open Cloud \"read developer product\"\n * endpoint.\n *\n * @param parameters - Universe and product identifiers to interpolate into\n * the URL.\n * @returns A pure {@link HttpRequest} describing the read call.\n */\nexport function buildGetRequest(parameters: GetDeveloperProductParameters): HttpRequest {\n\treturn {\n\t\tmethod: \"GET\",\n\t\turl: `/developer-products/v2/universes/${parameters.universeId}/developer-products/${parameters.productId}/creator`,\n\t};\n}\n\n/**\n * Builds a `POST` request for the Open Cloud \"create developer product\"\n * endpoint.\n *\n * @param parameters - Fields describing the new developer product; optional\n * values omitted here are left off the multipart payload entirely.\n * @returns A pure {@link HttpRequest} describing the create call.\n */\nexport function buildCreateRequest(parameters: CreateDeveloperProductParameters): 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: `/developer-products/v2/universes/${parameters.universeId}/developer-products`,\n\t};\n}\n\n/**\n * Builds a `PATCH` request for the Open Cloud \"update developer product\"\n * endpoint. Every field on `parameters` except the identifiers is optional;\n * omitted fields are not appended to the multipart body so the server leaves\n * them unchanged.\n *\n * @param parameters - Identifiers plus fields to update.\n * @returns A pure {@link HttpRequest} describing the update call.\n */\nexport function buildUpdateRequest(parameters: UpdateDeveloperProductParameters): 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.storePageEnabled !== undefined) {\n\t\tbody.append(\"storePageEnabled\", String(parameters.storePageEnabled));\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: \"PATCH\",\n\t\turl: `/developer-products/v2/universes/${parameters.universeId}/developer-products/${parameters.productId}`,\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 developer product, from\n * the Open Cloud OpenAPI schema.\n */\nexport const GET_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 10,\n\toperationKey: \"developer-products.get\",\n});\n\n/**\n * Per-second request ceiling for creating a developer product, from the\n * Open Cloud OpenAPI schema.\n */\nexport const CREATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 3,\n\toperationKey: \"developer-products.create\",\n});\n\n/**\n * Per-second request ceiling for updating a developer product, from the\n * Open Cloud OpenAPI schema. Keyed independently from\n * {@link CREATE_OPERATION_LIMIT} so create and update do not share a queue,\n * since Roblox does not document the per-minute quota as shared between\n * the POST and PATCH endpoints.\n */\nexport const UPDATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 3,\n\toperationKey: \"developer-products.update\",\n});\n\n/**\n * Scopes the API key or OAuth token must carry to read a developer product,\n * sourced from `x-roblox-scopes` on the `DeveloperProducts_GetDeveloperProductConfigV2`\n * operation in the vendored OpenAPI schema.\n */\nexport const GET_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\"developer-product:read\"]);\n\n/**\n * Scopes the API key or OAuth token must carry to create or update a developer\n * product, sourced from `x-roblox-scopes` on the\n * `DeveloperProducts_CreateDeveloperProductV2` and\n * `DeveloperProducts_UpdateDeveloperProductV2` operations in the vendored\n * OpenAPI schema.\n */\nexport const WRITE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"developer-product:write\",\n]);\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 type { Result } from \"../../../types.ts\";\nimport type { DeveloperProduct } from \"./types.ts\";\nimport type { DeveloperProductConfigV2, DeveloperProductPricingFeatureWire } from \"./wire.ts\";\n\n/**\n * Parses a successful Developer Products API response into the public\n * `DeveloperProduct` shape, returning a `Result` so callers can handle\n * malformed payloads 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 `DeveloperProduct`, or\n * an `ApiError` when the body does not match the wire schema.\n */\nexport function parseDeveloperProductResponse(\n\tresponse: HttpResponse,\n): Result<DeveloperProduct, ApiError> {\n\tconst { body, status: statusCode } = response;\n\n\tif (!isDeveloperProductConfigV2(body)) {\n\t\treturn malformedDeveloperProduct(statusCode, body);\n\t}\n\n\tconst priceWire = body.priceInformation ?? undefined;\n\tconst iconAssetId = body.iconImageAssetId ?? undefined;\n\n\treturn {\n\t\tdata: {\n\t\t\tid: String(body.productId),\n\t\t\tname: body.name,\n\t\t\tcreatedAt: new Date(body.createdTimestamp),\n\t\t\tdescription: body.description,\n\t\t\ticonImageAssetId: iconAssetId === undefined ? undefined : String(iconAssetId),\n\t\t\tisForSale: body.isForSale,\n\t\t\tisImmutable: body.isImmutable,\n\t\t\tprice: priceWire === undefined ? undefined : copyPriceInformation(priceWire),\n\t\t\tstorePageEnabled: body.storePageEnabled,\n\t\t\tuniverseId: String(body.universeId),\n\t\t\tupdatedAt: new Date(body.updatedTimestamp),\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction malformedDeveloperProduct(\n\tstatusCode: number,\n\tbody: unknown,\n): Result<DeveloperProduct, ApiError> {\n\treturn {\n\t\terr: new ApiError(\"Malformed developer product response\", {\n\t\t\tdetails: body as JSONValue | undefined,\n\t\t\tstatusCode,\n\t\t}),\n\t\tsuccess: false,\n\t};\n}\n\nfunction hasRequiredPrimitiveFields(body: Record<string, unknown>): boolean {\n\treturn (\n\t\ttypeof body[\"productId\"] === \"number\" &&\n\t\t// Roblox never assigns asset ID 0; a zero productId signals a\n\t\t// malformed response, not a legitimate product.\n\t\tbody[\"productId\"] !== 0 &&\n\t\ttypeof body[\"universeId\"] === \"number\" &&\n\t\ttypeof body[\"name\"] === \"string\" &&\n\t\ttypeof body[\"description\"] === \"string\" &&\n\t\ttypeof body[\"isForSale\"] === \"boolean\" &&\n\t\ttypeof body[\"isImmutable\"] === \"boolean\" &&\n\t\ttypeof body[\"storePageEnabled\"] === \"boolean\" &&\n\t\tisDateTimeString(body[\"createdTimestamp\"]) &&\n\t\tisDateTimeString(body[\"updatedTimestamp\"])\n\t);\n}\n\nfunction isPricingFeatureWire(value: unknown): value is DeveloperProductPricingFeatureWire {\n\treturn (\n\t\tvalue === \"Invalid\" ||\n\t\tvalue === \"PriceOptimization\" ||\n\t\tvalue === \"RegionalPricing\" ||\n\t\tvalue === \"UserFixedPrice\"\n\t);\n}\n\nfunction isDeveloperProductConfigV2(body: unknown): body is DeveloperProductConfigV2 {\n\tif (!isRecord(body)) {\n\t\treturn false;\n\t}\n\n\tif (!hasRequiredPrimitiveFields(body)) {\n\t\treturn false;\n\t}\n\n\tconst iconImageAssetId = body[\"iconImageAssetId\"] ?? undefined;\n\tif (iconImageAssetId !== undefined && typeof iconImageAssetId !== \"number\") {\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","import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport { toBlob } from \"../../../internal/utils/to-blob.ts\";\nimport type { UploadDeveloperProductIconParameters } from \"./types.ts\";\n\n/**\n * Builds a `POST` request for the localized \"upload developer-product icon\"\n * endpoint. A successful upload replaces any existing icon for the same\n * `(productId, languageCode)` pair.\n *\n * @param parameters - Product and language identifiers plus the image bytes\n * to upload.\n * @returns A pure {@link HttpRequest} describing the upload call.\n */\nexport function buildUploadIconRequest(\n\tparameters: UploadDeveloperProductIconParameters,\n): 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/developer-products/${parameters.productId}/icons/language-codes/${parameters.languageCode}`,\n\t};\n}\n","import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport type { UpdateDeveloperProductNameDescriptionParameters } from \"./types.ts\";\n\n/**\n * Builds a `PATCH` request for the localized \"update developer-product\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 - Product 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: UpdateDeveloperProductNameDescriptionParameters,\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/developer-products/${parameters.productId}/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 developer-product localization\n * Operation. The legacy `gameinternationalization` service caps each API key\n * at 100 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 developer-product localization methods queue against\n * the same operation key.\n */\nexport const LOCALIZATION_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 100 / 60,\n\toperationKey: \"developer-product-localization\",\n});\n\n/**\n * Scopes required for every developer-product localization operation, sourced\n * from `x-roblox-scopes` on the legacy `gameinternationalization`\n * developer-product endpoints in the vendored OpenAPI schema.\n */\nexport const LOCALIZATION_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"legacy-developer-product:manage\",\n]);\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport {\n\tbuildCreateRequest,\n\tbuildGetRequest,\n\tbuildUpdateRequest,\n} from \"../../domains/developer-products/products/builders.ts\";\nimport {\n\tCREATE_OPERATION_LIMIT,\n\tGET_OPERATION_LIMIT,\n\tGET_REQUIRED_SCOPES,\n\tUPDATE_OPERATION_LIMIT,\n\tWRITE_REQUIRED_SCOPES,\n} from \"../../domains/developer-products/products/operations.ts\";\nimport { parseDeveloperProductResponse } from \"../../domains/developer-products/products/parsers.ts\";\nimport type {\n\tCreateDeveloperProductParameters,\n\tDeveloperProduct,\n\tGetDeveloperProductParameters,\n\tUpdateDeveloperProductParameters,\n} from \"../../domains/developer-products/products/types.ts\";\nimport { buildUploadIconRequest } from \"../../domains/game-internationalization/developer-product-icon/builders.ts\";\nimport type { UploadDeveloperProductIconParameters } from \"../../domains/game-internationalization/developer-product-icon/types.ts\";\nimport { buildUpdateRequest as buildLocaleNameDescRequest } from \"../../domains/game-internationalization/developer-product-name-description/builders.ts\";\nimport {\n\tLOCALIZATION_OPERATION_LIMIT,\n\tLOCALIZATION_REQUIRED_SCOPES,\n} from \"../../domains/game-internationalization/developer-product-name-description/operations.ts\";\nimport type { UpdateDeveloperProductNameDescriptionParameters } from \"../../domains/game-internationalization/developer-product-name-description/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 { Result } from \"../../types.ts\";\n\nfunction makeSpec<P, R = DeveloperProduct>(\n\tspec: ResourceMethodSpec<P, R>,\n): ResourceMethodSpec<P, R> {\n\treturn Object.freeze(spec);\n}\n\nconst CREATE_SPEC = makeSpec<CreateDeveloperProductParameters>({\n\tbuildRequest: (parameters) => okRequest(buildCreateRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: CREATE_OPERATION_LIMIT,\n\tparse: parseDeveloperProductResponse,\n\trequiredScopes: WRITE_REQUIRED_SCOPES,\n});\n\nconst GET_SPEC = makeSpec<GetDeveloperProductParameters>({\n\tbuildRequest: (parameters) => okRequest(buildGetRequest(parameters)),\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: GET_OPERATION_LIMIT,\n\tparse: parseDeveloperProductResponse,\n\trequiredScopes: GET_REQUIRED_SCOPES,\n});\n\nconst UPDATE_SPEC = makeSpec<UpdateDeveloperProductParameters, 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: WRITE_REQUIRED_SCOPES,\n});\n\nconst UPDATE_NAME_DESCRIPTION_SPEC = makeSpec<\n\tUpdateDeveloperProductNameDescriptionParameters,\n\tundefined\n>({\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<UploadDeveloperProductIconParameters, 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 DeveloperProductLocalizationHandle {\n\t/**\n\t * Updates the per-locale display name and/or description registered against\n\t * a developer product. Either `name`, `description`, or both may be\n\t * supplied; omitted fields are not forwarded so the server leaves the\n\t * existing value for that locale untouched. Mirrors the upstream `200 OK`\n\t * echo body as `undefined` data.\n\t *\n\t * @param parameters - Product 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: UpdateDeveloperProductNameDescriptionParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n\t/**\n\t * Uploads or replaces the per-locale icon for a developer product. A\n\t * subsequent upload for the same `(productId, languageCode)` pair replaces\n\t * the 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 - Product 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: UploadDeveloperProductIconParameters,\n\t\toptions?: RequestOptions,\n\t) => Promise<Result<undefined, OpenCloudError>>;\n}\n\n/**\n * Public client for the Roblox Open Cloud Developer Products API.\n *\n * Wires request builders, the injected {@link OpenCloudClientOptions.httpClient}, and response\n * parsers into a single ergonomic surface. Every method returns a\n * {@link Result} so callers handle failure explicitly; no thrown\n * `OpenCloudError` ever escapes the client.\n *\n * ```ts\n * import { DeveloperProductsClient } from \"@bedrock-rbx/ocale/developer-products\";\n *\n * const client = new DeveloperProductsClient({ apiKey: process.env.ROBLOX_API_KEY! });\n *\n * const result = await client.get({\n * universeId: \"1234567890\",\n * productId: \"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 * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { DeveloperProductsClient } from \"@bedrock-rbx/ocale/developer-products\";\n *\n * const client = new DeveloperProductsClient({ apiKey: \"your-key\" });\n * expect(client).toBeInstanceOf(DeveloperProductsClient);\n * ```\n */\nexport class DeveloperProductsClient {\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 DeveloperProductsClient.update}; methods on this\n\t * group set per-locale overlays on top. Shares the parent client's\n\t * HTTP, rate-limit, and retry plumbing.\n\t */\n\tpublic readonly localization: DeveloperProductLocalizationHandle;\n\n\t/**\n\t * Creates a new {@link DeveloperProductsClient}. Configuration is frozen\n\t * on 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 developer product 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 product name.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed {@link DeveloperProduct} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async create(\n\t\tparameters: CreateDeveloperProductParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<DeveloperProduct, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: CREATE_SPEC });\n\t}\n\n\t/**\n\t * Reads a single developer product by ID.\n\t *\n\t * @param parameters - Universe and product 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 DeveloperProduct} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async get(\n\t\tparameters: GetDeveloperProductParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<DeveloperProduct, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: GET_SPEC });\n\t}\n\n\t/**\n\t * Partially updates an existing developer product. Mirrors the upstream\n\t * `204 No Content` response: a successful update yields `undefined` data.\n\t * Callers that need the post-update state (for example to observe a\n\t * server-derived `updatedTimestamp`) chain {@link DeveloperProductsClient.get}\n\t * themselves so the GET only fires when 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 product 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: UpdateDeveloperProductParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<undefined, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: UPDATE_SPEC });\n\t}\n}\n\nfunction createLocalizationHandle(inner: ResourceClient): DeveloperProductLocalizationHandle {\n\treturn {\n\t\tasync updateNameDescription(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: UPDATE_NAME_DESCRIPTION_SPEC });\n\t\t},\n\t\tasync uploadIcon(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: UPLOAD_ICON_SPEC });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,gBAAgB,YAAwD;CACvF,OAAO;EACN,QAAQ;EACR,KAAK,oCAAoC,WAAW,WAAW,sBAAsB,WAAW,UAAU;CAC3G;AACD;;;;;;;;;AAUA,SAAgB,mBAAmB,YAA2D;CAC7F,MAAM,OAAO,IAAI,SAAS;CAC1B,KAAK,OAAO,QAAQ,WAAW,IAAI;CACnC,IAAI,WAAW,gBAAgB,KAAA,GAC9B,KAAK,OAAO,eAAe,WAAW,WAAW;CAGlD,IAAI,WAAW,cAAc,KAAA,GAC5B,KAAK,OAAO,aAAa,OAAO,WAAW,SAAS,CAAC;CAGtD,IAAI,WAAW,UAAU,KAAA,GACxB,KAAK,OAAO,SAAS,OAAO,WAAW,KAAK,CAAC;CAG9C,IAAI,WAAW,6BAA6B,KAAA,GAC3C,KAAK,OAAO,4BAA4B,OAAO,WAAW,wBAAwB,CAAC;CAGpF,IAAI,WAAW,cAAc,KAAA,GAC5B,KAAK,OA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ClientOptions, l as Result, s as RequestOptions } from "./types-CwtZT1ek.mjs";
2
- import { i as RobloxLocale, r as RobloxLanguageCode } from "./data.generated-Cb6g6asv.mjs";
1
+ import { c as Page, d as OpenCloudError, i as OpenCloudClientOptions, l as Result, s as RequestOptions } from "./types-CRiJg5EQ.mjs";
2
+ import { i as RobloxLocale, r as RobloxLanguageCode } from "./data.generated-B2ceLfSn.mjs";
3
3
 
4
4
  //#region src/domains/game-internationalization/game-pass-icon/types.d.ts
5
5
  /**
@@ -7,6 +7,8 @@ import { i as RobloxLocale, r as RobloxLanguageCode } from "./data.generated-Cb6
7
7
  * against a game pass. A subsequent upload for the same
8
8
  * `(gamePassId, languageCode)` pair replaces the existing icon for that
9
9
  * locale.
10
+ *
11
+ * @since 0.1.0
10
12
  */
11
13
  interface UploadGamePassIconParameters {
12
14
  /** Stringified ID of the game pass whose icon is being uploaded. */
@@ -27,6 +29,8 @@ interface UploadGamePassIconParameters {
27
29
  * against a game pass. Both `name` and `description` are optional; fields
28
30
  * omitted from the call are not included in the JSON body so the server
29
31
  * leaves the existing value for that locale untouched.
32
+ *
33
+ * @since 0.1.0
30
34
  */
31
35
  interface UpdateGamePassNameDescriptionParameters {
32
36
  /** Replacement display name for the supplied locale. */
@@ -47,10 +51,14 @@ interface UpdateGamePassNameDescriptionParameters {
47
51
  /**
48
52
  * Pricing feature flags that can be enabled on a game pass. Values
49
53
  * mirror the Open Cloud `GamePasses.PricingFeature` enum.
54
+ *
55
+ * @since 0.1.0
50
56
  */
51
57
  type GamePassPricingFeature = "Invalid" | "PriceOptimization" | "RegionalPricing" | "UserFixedPrice";
52
58
  /**
53
59
  * Public shape of a game pass's pricing configuration.
60
+ *
61
+ * @since 0.1.0
54
62
  */
55
63
  interface GamePassPrice {
56
64
  /** Default Robux price; `undefined` when no default price is configured. */
@@ -62,6 +70,8 @@ interface GamePassPrice {
62
70
  * A Roblox game pass as exposed to SDK consumers. Fields use DX-friendly
63
71
  * names and types (stringified IDs, `Date` timestamps) rather than the
64
72
  * raw wire representation.
73
+ *
74
+ * @since 0.1.0
65
75
  */
66
76
  interface GamePass {
67
77
  /** Stringified game pass ID. The API returns an int64; always use this. */
@@ -83,6 +93,8 @@ interface GamePass {
83
93
  }
84
94
  /**
85
95
  * Parameters for creating a new game pass under a universe.
96
+ *
97
+ * @since 0.1.0
86
98
  */
87
99
  interface CreateGamePassParameters {
88
100
  /** Display name of the new game pass. */
@@ -102,6 +114,8 @@ interface CreateGamePassParameters {
102
114
  }
103
115
  /**
104
116
  * Parameters for reading a single game pass by ID.
117
+ *
118
+ * @since 0.1.0
105
119
  */
106
120
  interface GetGamePassParameters {
107
121
  /** Stringified ID of the game pass to retrieve. */
@@ -114,6 +128,8 @@ interface GetGamePassParameters {
114
128
  * Pagination is cursor-based: omit `pageToken` to fetch the first page,
115
129
  * then thread the previous response's `nextPageToken` back in until it
116
130
  * is `undefined`.
131
+ *
132
+ * @since 0.1.0
117
133
  */
118
134
  interface ListGamePassesParameters {
119
135
  /** Optional page size; the server defaults to 50 when omitted. */
@@ -128,6 +144,8 @@ interface ListGamePassesParameters {
128
144
  * except the identifiers is optional; omitted fields are not included
129
145
  * in the multipart body so the server leaves their current values
130
146
  * untouched.
147
+ *
148
+ * @since 0.1.0
131
149
  */
132
150
  interface UpdateGamePassParameters {
133
151
  /** Optional new display name for the game pass. */
@@ -170,6 +188,9 @@ interface GamePassLocalizationHandle {
170
188
  * existing icon for that locale. Does not retry on 5xx so a duplicate
171
189
  * upload cannot be created if the server fails mid-write.
172
190
  *
191
+ * No default request timeout applies to this upload; pass `options.timeout`
192
+ * to set a per-call deadline.
193
+ *
173
194
  * @param parameters - Game pass and language identifiers plus the image
174
195
  * bytes to upload.
175
196
  * @param options - Optional per-request overrides.
@@ -221,6 +242,17 @@ interface GamePassLocalizationHandle {
221
242
  * pageToken = page.data.nextPageToken;
222
243
  * } while (pageToken !== undefined);
223
244
  * ```
245
+ *
246
+ * @since 0.1.0
247
+ *
248
+ * @example
249
+ *
250
+ * ```ts
251
+ * import { GamePassesClient } from "@bedrock-rbx/ocale/game-passes";
252
+ *
253
+ * const client = new GamePassesClient({ apiKey: "your-key" });
254
+ * expect(client).toBeInstanceOf(GamePassesClient);
255
+ * ```
224
256
  */
225
257
  declare class GamePassesClient {
226
258
  #private;
@@ -243,6 +275,9 @@ declare class GamePassesClient {
243
275
  /**
244
276
  * Creates a new game pass under the supplied universe.
245
277
  *
278
+ * No default request timeout applies to this upload; pass `options.timeout`
279
+ * to set a per-call deadline.
280
+ *
246
281
  * @param parameters - Creation fields including the universe and pass name.
247
282
  * @param options - Optional per-request overrides.
248
283
  * @returns A {@link Result} wrapping the parsed {@link GamePass} or the
@@ -278,6 +313,9 @@ declare class GamePassesClient {
278
313
  * {@link GamePassesClient.get} themselves so the GET only fires when
279
314
  * actually needed.
280
315
  *
316
+ * No default request timeout applies to this upload; pass `options.timeout`
317
+ * to set a per-call deadline.
318
+ *
281
319
  * @param parameters - The universe and game pass identifiers and the
282
320
  * fields to update. Only fields explicitly provided are forwarded.
283
321
  * @param options - Optional per-request overrides.
@@ -1 +1 @@
1
- {"version":3,"file":"game-passes.d.mts","names":[],"sources":["../src/domains/game-internationalization/game-pass-icon/types.ts","../src/domains/game-internationalization/game-pass-name-description/types.ts","../src/domains/game-passes/game-passes/types.ts","../src/resources/game-passes/client.ts"],"mappings":";;;;;;;AAQA;;;UAAiB,4BAAA;;WAEP,UAAA;;WAEA,KAAA,EAAO,IAAA,GAAO,UAAA;EAMqB;;;;;EAAA,SAAnC,YAAA,EAAc,kBAAA,GAAqB,YAAA;AAAA;;;;;;AAV7C;;;UCAiB,uCAAA;;WAEP,IAAA;;WAEA,WAAA;EDMmC;EAAA,SCJnC,UAAA;;;;;;WAMA,YAAA,EAAc,kBAAA,GAAqB,YAAA;AAAA;;;;;;;KChBjC,sBAAA;;;;UASK,aAAA;;WAEP,mBAAA;;WAEA,eAAA,EAAiB,aAAA,CAAc,sBAAA;AAAA;;;;;;UAQxB,QAAA;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,GACR,OAAA,CAAQ,MAAA,CAAO,QAAA,EAAU,cAAA;ED5HZ;;;;;;;;;ECyIhB,GAAA,CACC,UAAA,EAAY,qBAAA,EACZ,OAAA,GAAU,cAAA,GACR,OAAA,CAAQ,MAAA,CAAO,QAAA,EAAU,cAAA;;;;;;;;;AA/LK;;EA6MjC,IAAA,CACC,UAAA,EAAY,wBAAA,EACZ,OAAA,GAAU,cAAA,GACR,OAAA,CAAQ,MAAA,CAAO,IAAA,CAAK,QAAA,GAAW,cAAA;;;;;;;;;;;;;;;EAkBlC,MAAA,CACC,UAAA,EAAY,wBAAA,EACZ,OAAA,GAAU,cAAA,GACR,OAAA,CAAQ,MAAA,YAAkB,cAAA;AAAA"}
1
+ {"version":3,"file":"game-passes.d.mts","names":[],"sources":["../src/domains/game-internationalization/game-pass-icon/types.ts","../src/domains/game-internationalization/game-pass-name-description/types.ts","../src/domains/game-passes/game-passes/types.ts","../src/resources/game-passes/client.ts"],"mappings":";;;;;;;AAUA;;;;;UAAiB,4BAAA;;WAEP,UAAA;EAQmC;EAAA,SANnC,KAAA,EAAO,IAAA,GAAO,UAAA;;;;;;WAMd,YAAA,EAAc,kBAAA,GAAqB,YAAA;AAAA;;;;;;AAV7C;;;;;UCAiB,uCAAA;;WAEP,IAAA;EDQmC;EAAA,SCNnC,WAAA;;WAEA,UAAA;;;;;;WAMA,YAAA,EAAc,kBAAA,GAAqB,YAAA;AAAA;;;;;;;ADZ7C;;KEJY,sBAAA;;;;;;UAWK,aAAA;;WAEP,mBAAA;;WAEA,eAAA,EAAiB,aAAA,CAAc,sBAAA;AAAA;;;;AFDI;;;;UEW5B,QAAA;EDrBA;EAAA,SCuBP,EAAA;EDXmC;EAAA,SCanC,IAAA;;WAEA,SAAA,EAAW,IAAA;;WAEX,WAAA;;WAEA,WAAA;EDnBmC;EAAA,SCqBnC,SAAA;;WAEA,KAAA,EAAO,aAAA;EAvCjB;EAAA,SAyCU,SAAA,EAAW,IAAA;AAAA;;AAzCT;AAW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,EAAY,qBAAA,EACZ,OAAA,GAAU,cAAA,GACR,OAAA,CAAQ,MAAA,CAAO,QAAA,EAAU,cAAA;;;;;;;;;;;EAc5B,IAAA,CACC,UAAA,EAAY,wBAAA,EACZ,OAAA,GAAU,cAAA,GACR,OAAA,CAAQ,MAAA,CAAO,IAAA,CAAK,QAAA,GAAW,cAAA;;;;;;;;;;;;;AAjIH;AA0DhC;;;;EA4FC,MAAA,CACC,UAAA,EAAY,wBAAA,EACZ,OAAA,GAAU,cAAA,GACR,OAAA,CAAQ,MAAA,YAAkB,cAAA;AAAA"}
@@ -1,7 +1,8 @@
1
- import { r as ApiError } from "./rate-limit-D1q2Js-z.mjs";
2
- import { t as toBlob } from "./to-blob-B27VhoRp.mjs";
3
- import { a as IDEMPOTENT_METHOD_DEFAULTS, c as isDateTimeString, i as CREATE_METHOD_DEFAULTS, n as okRequest, r as parseEmptyResponse, s as isRecord, t as ResourceClient } from "./resource-client-D6Efj9fU.mjs";
4
- import { n as isPriceInformationLike, t as copyPriceInformation } from "./price-information-DIrvwCmd.mjs";
1
+ import { r as ApiError } from "./rate-limit-Co9i28qi.mjs";
2
+ import { n as IDEMPOTENT_METHOD_DEFAULTS, t as CREATE_METHOD_DEFAULTS } from "./retry-CbHBw60o.mjs";
3
+ import { t as toBlob } from "./to-blob-RPqMBuft.mjs";
4
+ import { a as isDateTimeString, i as isRecord, n as okRequest, r as parseEmptyResponse, t as ResourceClient } from "./resource-client-C_D--PYX.mjs";
5
+ import { n as isPriceInformationLike, t as copyPriceInformation } from "./price-information-DK83Wul1.mjs";
5
6
  //#region src/domains/game-internationalization/game-pass-icon/builders.ts
6
7
  /**
7
8
  * Builds a `POST` request for the localized "upload game-pass icon"
@@ -224,7 +225,10 @@ const LIST_REQUIRED_SCOPES = Object.freeze(["game-pass:read"]);
224
225
  function parseGamePassResponse(response) {
225
226
  const { body, status: statusCode } = response;
226
227
  if (!isGamePassConfigV2(body)) return {
227
- err: new ApiError("Malformed game pass response", { statusCode }),
228
+ err: new ApiError("Malformed game pass response", {
229
+ details: body,
230
+ statusCode
231
+ }),
228
232
  success: false
229
233
  };
230
234
  return {
@@ -245,7 +249,10 @@ function parseGamePassResponse(response) {
245
249
  function parseGamePassesListResponse(response) {
246
250
  const { body, status: statusCode } = response;
247
251
  if (!isListResponseWire(body)) return {
248
- err: new ApiError("Malformed game passes list response", { statusCode }),
252
+ err: new ApiError("Malformed game passes list response", {
253
+ details: body,
254
+ statusCode
255
+ }),
249
256
  success: false
250
257
  };
251
258
  return {
@@ -387,6 +394,17 @@ const UPLOAD_ICON_SPEC = makeSpec({
387
394
  * pageToken = page.data.nextPageToken;
388
395
  * } while (pageToken !== undefined);
389
396
  * ```
397
+ *
398
+ * @since 0.1.0
399
+ *
400
+ * @example
401
+ *
402
+ * ```ts
403
+ * import { GamePassesClient } from "@bedrock-rbx/ocale/game-passes";
404
+ *
405
+ * const client = new GamePassesClient({ apiKey: "your-key" });
406
+ * expect(client).toBeInstanceOf(GamePassesClient);
407
+ * ```
390
408
  */
391
409
  var GamePassesClient = class {
392
410
  #inner;
@@ -412,6 +430,9 @@ var GamePassesClient = class {
412
430
  /**
413
431
  * Creates a new game pass under the supplied universe.
414
432
  *
433
+ * No default request timeout applies to this upload; pass `options.timeout`
434
+ * to set a per-call deadline.
435
+ *
415
436
  * @param parameters - Creation fields including the universe and pass name.
416
437
  * @param options - Optional per-request overrides.
417
438
  * @returns A {@link Result} wrapping the parsed {@link GamePass} or the
@@ -465,6 +486,9 @@ var GamePassesClient = class {
465
486
  * {@link GamePassesClient.get} themselves so the GET only fires when
466
487
  * actually needed.
467
488
  *
489
+ * No default request timeout applies to this upload; pass `options.timeout`
490
+ * to set a per-call deadline.
491
+ *
468
492
  * @param parameters - The universe and game pass identifiers and the
469
493
  * fields to update. Only fields explicitly provided are forwarded.
470
494
  * @param options - Optional per-request overrides.