@bedrock-rbx/ocale 0.3.4-beta.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/dist/badge-cost-mismatch-DrlvhlQc.mjs +47 -0
- package/dist/badge-cost-mismatch-DrlvhlQc.mjs.map +1 -0
- package/dist/badges.d.mts +228 -184
- package/dist/badges.d.mts.map +1 -1
- package/dist/badges.mjs +176 -18
- package/dist/badges.mjs.map +1 -1
- package/dist/capacity-admission-hycCFkTo.d.mts +355 -0
- package/dist/capacity-admission-hycCFkTo.d.mts.map +1 -0
- package/dist/{data.generated-B2ceLfSn.d.mts → data.generated-D_vpa5-g.d.mts} +23 -23
- package/dist/data.generated-D_vpa5-g.d.mts.map +1 -0
- package/dist/developer-products.d.mts +181 -186
- package/dist/developer-products.d.mts.map +1 -1
- package/dist/developer-products.mjs +24 -24
- package/dist/developer-products.mjs.map +1 -1
- package/dist/game-passes.d.mts +206 -203
- package/dist/game-passes.d.mts.map +1 -1
- package/dist/game-passes.mjs +26 -21
- package/dist/game-passes.mjs.map +1 -1
- package/dist/index.d.mts +924 -306
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +325 -10
- package/dist/index.mjs.map +1 -1
- package/dist/locales.d.mts +30 -2
- package/dist/locales.d.mts.map +1 -0
- package/dist/locales.mjs +24 -1
- package/dist/locales.mjs.map +1 -1
- package/dist/luau-execution.d.mts +154 -151
- package/dist/luau-execution.d.mts.map +1 -1
- package/dist/luau-execution.mjs +11 -8
- package/dist/luau-execution.mjs.map +1 -1
- package/dist/{network-error-DR9FX5hb.mjs → network-error-iVSng5MT.mjs} +44 -6
- package/dist/network-error-iVSng5MT.mjs.map +1 -0
- package/dist/places.d.mts +204 -180
- package/dist/places.d.mts.map +1 -1
- package/dist/places.mjs +66 -20
- package/dist/places.mjs.map +1 -1
- package/dist/{poll-timeout-3PXLsabj.mjs → poll-timeout-DzztDymd.mjs} +2 -2
- package/dist/{poll-timeout-3PXLsabj.mjs.map → poll-timeout-DzztDymd.mjs.map} +1 -1
- package/dist/{polling-helpers-sKTsqEc1.mjs → polling-helpers-DfF5dspc.mjs} +249 -83
- package/dist/polling-helpers-DfF5dspc.mjs.map +1 -0
- package/dist/{price-information-hWXV6DAI.mjs → price-information-DEkEQ8Pq.mjs} +2 -2
- package/dist/{price-information-hWXV6DAI.mjs.map → price-information-DEkEQ8Pq.mjs.map} +1 -1
- package/dist/resource-client-BCKukheG.d.mts +168 -0
- package/dist/resource-client-BCKukheG.d.mts.map +1 -0
- package/dist/resource-client-CaIVr-go.mjs +1419 -0
- package/dist/resource-client-CaIVr-go.mjs.map +1 -0
- package/dist/retry-C2oHesDx.d.mts +229 -0
- package/dist/retry-C2oHesDx.d.mts.map +1 -0
- package/dist/{retry-vpHMIwaU.mjs → retry-CMRDvAR4.mjs} +390 -20
- package/dist/retry-CMRDvAR4.mjs.map +1 -0
- package/dist/storage.d.mts +333 -334
- package/dist/storage.d.mts.map +1 -1
- package/dist/storage.mjs +29 -22
- package/dist/storage.mjs.map +1 -1
- package/dist/testing.d.mts +347 -360
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +3 -4
- package/dist/testing.mjs.map +1 -1
- package/dist/types-CdMr_J1M.d.mts +509 -0
- package/dist/types-CdMr_J1M.d.mts.map +1 -0
- package/dist/universes.d.mts +619 -422
- package/dist/universes.d.mts.map +1 -1
- package/dist/universes.mjs +421 -48
- package/dist/universes.mjs.map +1 -1
- package/dist/{validation-B_Zs1So2.mjs → validation-964VNlbp.mjs} +2 -2
- package/dist/{validation-B_Zs1So2.mjs.map → validation-964VNlbp.mjs.map} +1 -1
- package/dist/wire-DJqupefn.d.mts +41 -0
- package/dist/wire-DJqupefn.d.mts.map +1 -0
- package/package.json +14 -14
- package/dist/capacity-admission-BvnJjY0S.d.mts +0 -369
- package/dist/capacity-admission-BvnJjY0S.d.mts.map +0 -1
- package/dist/data.generated-B2ceLfSn.d.mts.map +0 -1
- package/dist/network-error-DR9FX5hb.mjs.map +0 -1
- package/dist/polling-helpers-sKTsqEc1.mjs.map +0 -1
- package/dist/resource-client-3cOhqZpX.mjs +0 -899
- package/dist/resource-client-3cOhqZpX.mjs.map +0 -1
- package/dist/resource-client-BivRq3JZ.d.mts +0 -164
- package/dist/resource-client-BivRq3JZ.d.mts.map +0 -1
- package/dist/retry-DXEklFrt.d.mts +0 -373
- package/dist/retry-DXEklFrt.d.mts.map +0 -1
- package/dist/retry-vpHMIwaU.mjs.map +0 -1
- package/dist/types-C3Egi37J.d.mts +0 -378
- package/dist/types-C3Egi37J.d.mts.map +0 -1
- package/dist/wire-D3K-a-UP.d.mts +0 -37
- package/dist/wire-D3K-a-UP.d.mts.map +0 -1
package/dist/game-passes.d.mts
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as RobloxLocale, r as RobloxLanguageCode } from "./data.generated-
|
|
3
|
-
|
|
1
|
+
import { c as OpenCloudClientOptions, d as RequestOptions, g as OpenCloudError, m as Result, p as Page } from "./types-CdMr_J1M.mjs";
|
|
2
|
+
import { i as RobloxLocale, r as RobloxLanguageCode } from "./data.generated-D_vpa5-g.mjs";
|
|
4
3
|
//#region src/domains/game-internationalization/game-pass-icon/types.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Parameters for uploading or replacing the per-locale icon registered
|
|
7
|
-
* against a game pass. A subsequent upload for the same
|
|
8
|
-
* `(gamePassId, languageCode)` pair replaces the existing icon for that
|
|
9
|
-
* locale.
|
|
10
|
-
*
|
|
11
|
-
* @since 0.1.0
|
|
12
|
-
*/
|
|
5
|
+
* Parameters for uploading or replacing the per-locale icon registered
|
|
6
|
+
* against a game pass. A subsequent upload for the same
|
|
7
|
+
* `(gamePassId, languageCode)` pair replaces the existing icon for that
|
|
8
|
+
* locale.
|
|
9
|
+
*
|
|
10
|
+
* @since 0.1.0
|
|
11
|
+
*/
|
|
13
12
|
interface UploadGamePassIconParameters {
|
|
14
13
|
/** Stringified ID of the game pass whose icon is being uploaded. */
|
|
15
14
|
readonly gamePassId: string;
|
|
16
15
|
/** Image bytes to upload. PNG and JPEG are accepted by the server. */
|
|
17
16
|
readonly image: Blob | Uint8Array;
|
|
18
17
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
* Roblox wire form the icon is being uploaded for. Either the
|
|
19
|
+
* Language form (e.g. `en`, `fil`, `zh-hans`) or the Locale form
|
|
20
|
+
* (e.g. `en_us`, `pt_br`, `ar_001`).
|
|
21
|
+
*/
|
|
23
22
|
readonly languageCode: RobloxLanguageCode | RobloxLocale;
|
|
24
23
|
}
|
|
25
24
|
//#endregion
|
|
26
25
|
//#region src/domains/game-internationalization/game-pass-name-description/types.d.ts
|
|
27
26
|
/**
|
|
28
|
-
* Parameters for updating the per-locale name and/or description registered
|
|
29
|
-
* against a game pass. Both `name` and `description` are optional; fields
|
|
30
|
-
* omitted from the call are not included in the JSON body so the server
|
|
31
|
-
* leaves the existing value for that locale untouched.
|
|
32
|
-
*
|
|
33
|
-
* @since 0.1.0
|
|
34
|
-
*/
|
|
27
|
+
* Parameters for updating the per-locale name and/or description registered
|
|
28
|
+
* against a game pass. Both `name` and `description` are optional; fields
|
|
29
|
+
* omitted from the call are not included in the JSON body so the server
|
|
30
|
+
* leaves the existing value for that locale untouched.
|
|
31
|
+
*
|
|
32
|
+
* @since 0.1.0
|
|
33
|
+
*/
|
|
35
34
|
interface UpdateGamePassNameDescriptionParameters {
|
|
36
35
|
/** Replacement display name for the supplied locale. */
|
|
37
36
|
readonly name?: string;
|
|
@@ -40,26 +39,26 @@ interface UpdateGamePassNameDescriptionParameters {
|
|
|
40
39
|
/** Stringified ID of the game pass whose localization is being updated. */
|
|
41
40
|
readonly gamePassId: string;
|
|
42
41
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
* Roblox wire form being updated. Either the Language form (e.g.
|
|
43
|
+
* `en`, `fil`, `zh-hans`) or the Locale form (e.g. `en_us`, `pt_br`,
|
|
44
|
+
* `ar_001`).
|
|
45
|
+
*/
|
|
47
46
|
readonly languageCode: RobloxLanguageCode | RobloxLocale;
|
|
48
47
|
}
|
|
49
48
|
//#endregion
|
|
50
49
|
//#region src/domains/game-passes/game-passes/types.d.ts
|
|
51
50
|
/**
|
|
52
|
-
* Pricing feature flags that can be enabled on a game pass. Values
|
|
53
|
-
* mirror the Open Cloud `GamePasses.PricingFeature` enum.
|
|
54
|
-
*
|
|
55
|
-
* @since 0.1.0
|
|
56
|
-
*/
|
|
51
|
+
* Pricing feature flags that can be enabled on a game pass. Values
|
|
52
|
+
* mirror the Open Cloud `GamePasses.PricingFeature` enum.
|
|
53
|
+
*
|
|
54
|
+
* @since 0.1.0
|
|
55
|
+
*/
|
|
57
56
|
type GamePassPricingFeature = "Invalid" | "PriceOptimization" | "RegionalPricing" | "UserFixedPrice";
|
|
58
57
|
/**
|
|
59
|
-
* Public shape of a game pass's pricing configuration.
|
|
60
|
-
*
|
|
61
|
-
* @since 0.1.0
|
|
62
|
-
*/
|
|
58
|
+
* Public shape of a game pass's pricing configuration.
|
|
59
|
+
*
|
|
60
|
+
* @since 0.1.0
|
|
61
|
+
*/
|
|
63
62
|
interface GamePassPrice {
|
|
64
63
|
/** Default Robux price; `undefined` when no default price is configured. */
|
|
65
64
|
readonly defaultPriceInRobux: number | undefined;
|
|
@@ -67,12 +66,12 @@ interface GamePassPrice {
|
|
|
67
66
|
readonly enabledFeatures: ReadonlyArray<GamePassPricingFeature>;
|
|
68
67
|
}
|
|
69
68
|
/**
|
|
70
|
-
* A Roblox game pass as exposed to SDK consumers. Fields use DX-friendly
|
|
71
|
-
* names and types (stringified IDs, `Date` timestamps) rather than the
|
|
72
|
-
* raw wire representation.
|
|
73
|
-
*
|
|
74
|
-
* @since 0.1.0
|
|
75
|
-
*/
|
|
69
|
+
* A Roblox game pass as exposed to SDK consumers. Fields use DX-friendly
|
|
70
|
+
* names and types (stringified IDs, `Date` timestamps) rather than the
|
|
71
|
+
* raw wire representation.
|
|
72
|
+
*
|
|
73
|
+
* @since 0.1.0
|
|
74
|
+
*/
|
|
76
75
|
interface GamePass {
|
|
77
76
|
/** Stringified game pass ID. The API returns an int64; always use this. */
|
|
78
77
|
readonly id: string;
|
|
@@ -94,10 +93,10 @@ interface GamePass {
|
|
|
94
93
|
readonly updatedAt: Date;
|
|
95
94
|
}
|
|
96
95
|
/**
|
|
97
|
-
* Parameters for creating a new game pass under a universe.
|
|
98
|
-
*
|
|
99
|
-
* @since 0.1.0
|
|
100
|
-
*/
|
|
96
|
+
* Parameters for creating a new game pass under a universe.
|
|
97
|
+
*
|
|
98
|
+
* @since 0.1.0
|
|
99
|
+
*/
|
|
101
100
|
interface CreateGamePassParameters {
|
|
102
101
|
/** Display name of the new game pass. */
|
|
103
102
|
readonly name: string;
|
|
@@ -107,18 +106,18 @@ interface CreateGamePassParameters {
|
|
|
107
106
|
readonly imageFile?: Blob | Uint8Array;
|
|
108
107
|
/** Whether the game pass should be purchasable immediately. */
|
|
109
108
|
readonly isForSale?: boolean;
|
|
110
|
-
/** Whether
|
|
111
|
-
readonly
|
|
109
|
+
/** Whether managed pricing should be enabled at creation time. */
|
|
110
|
+
readonly isManagedPricingEnabled?: boolean;
|
|
112
111
|
/** Optional default price in Robux at creation time. */
|
|
113
112
|
readonly price?: number;
|
|
114
113
|
/** Stringified ID of the universe that owns the game pass. */
|
|
115
114
|
readonly universeId: string;
|
|
116
115
|
}
|
|
117
116
|
/**
|
|
118
|
-
* Parameters for reading a single game pass by ID.
|
|
119
|
-
*
|
|
120
|
-
* @since 0.1.0
|
|
121
|
-
*/
|
|
117
|
+
* Parameters for reading a single game pass by ID.
|
|
118
|
+
*
|
|
119
|
+
* @since 0.1.0
|
|
120
|
+
*/
|
|
122
121
|
interface GetGamePassParameters {
|
|
123
122
|
/** Stringified ID of the game pass to retrieve. */
|
|
124
123
|
readonly gamePassId: string;
|
|
@@ -126,13 +125,13 @@ interface GetGamePassParameters {
|
|
|
126
125
|
readonly universeId: string;
|
|
127
126
|
}
|
|
128
127
|
/**
|
|
129
|
-
* Parameters for listing the game passes registered against a universe.
|
|
130
|
-
* Pagination is cursor-based: omit `pageToken` to fetch the first page,
|
|
131
|
-
* then thread the previous response's `nextPageToken` back in until it
|
|
132
|
-
* is `undefined`.
|
|
133
|
-
*
|
|
134
|
-
* @since 0.1.0
|
|
135
|
-
*/
|
|
128
|
+
* Parameters for listing the game passes registered against a universe.
|
|
129
|
+
* Pagination is cursor-based: omit `pageToken` to fetch the first page,
|
|
130
|
+
* then thread the previous response's `nextPageToken` back in until it
|
|
131
|
+
* is `undefined`.
|
|
132
|
+
*
|
|
133
|
+
* @since 0.1.0
|
|
134
|
+
*/
|
|
136
135
|
interface ListGamePassesParameters {
|
|
137
136
|
/** Optional page size; the server defaults to 50 when omitted. */
|
|
138
137
|
readonly pageSize?: number;
|
|
@@ -142,13 +141,13 @@ interface ListGamePassesParameters {
|
|
|
142
141
|
readonly universeId: string;
|
|
143
142
|
}
|
|
144
143
|
/**
|
|
145
|
-
* Parameters for partially updating an existing game pass. Every field
|
|
146
|
-
* except the identifiers is optional; omitted fields are not included
|
|
147
|
-
* in the multipart body so the server leaves their current values
|
|
148
|
-
* untouched.
|
|
149
|
-
*
|
|
150
|
-
* @since 0.1.0
|
|
151
|
-
*/
|
|
144
|
+
* Parameters for partially updating an existing game pass. Every field
|
|
145
|
+
* except the identifiers is optional; omitted fields are not included
|
|
146
|
+
* in the multipart body so the server leaves their current values
|
|
147
|
+
* untouched.
|
|
148
|
+
*
|
|
149
|
+
* @since 0.1.0
|
|
150
|
+
*/
|
|
152
151
|
interface UpdateGamePassParameters {
|
|
153
152
|
/** Optional new display name for the game pass. */
|
|
154
153
|
readonly name?: string;
|
|
@@ -160,8 +159,8 @@ interface UpdateGamePassParameters {
|
|
|
160
159
|
readonly imageFile?: Blob | Uint8Array;
|
|
161
160
|
/** Optional new value for whether the game pass is purchasable. */
|
|
162
161
|
readonly isForSale?: boolean;
|
|
163
|
-
/** Optional new value for whether
|
|
164
|
-
readonly
|
|
162
|
+
/** Optional new value for whether managed pricing is enabled. */
|
|
163
|
+
readonly isManagedPricingEnabled?: boolean;
|
|
165
164
|
/** Optional new default price in Robux. */
|
|
166
165
|
readonly price?: number;
|
|
167
166
|
/** Stringified ID of the universe that owns the game pass. */
|
|
@@ -171,161 +170,165 @@ interface UpdateGamePassParameters {
|
|
|
171
170
|
//#region src/resources/game-passes/client.d.ts
|
|
172
171
|
interface GamePassLocalizationHandle {
|
|
173
172
|
/**
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
173
|
+
* Updates the per-locale display name and/or description registered against
|
|
174
|
+
* a game pass. Either `name`, `description`, or both may be supplied;
|
|
175
|
+
* omitted fields are not forwarded so the server leaves the existing value
|
|
176
|
+
* for that locale untouched. Mirrors the upstream `200 OK` echo body as
|
|
177
|
+
* `undefined` data.
|
|
178
|
+
*
|
|
179
|
+
* @param parameters - Game pass and language identifiers plus the optional
|
|
180
|
+
* replacement values.
|
|
181
|
+
* @param options - Optional per-request overrides.
|
|
182
|
+
* @returns A success {@link Result} with no payload, or the
|
|
183
|
+
* {@link OpenCloudError} that caused the request to fail.
|
|
184
|
+
*/
|
|
186
185
|
updateNameDescription: (parameters: UpdateGamePassNameDescriptionParameters, options?: RequestOptions) => Promise<Result<undefined, OpenCloudError>>;
|
|
187
186
|
/**
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
187
|
+
* Uploads or replaces the per-locale icon for a game pass. A subsequent
|
|
188
|
+
* upload for the same `(gamePassId, languageCode)` pair replaces the
|
|
189
|
+
* existing icon for that locale. Does not retry on 5xx so a duplicate
|
|
190
|
+
* upload cannot be created if the server fails mid-write.
|
|
191
|
+
*
|
|
192
|
+
* No default request timeout applies to this upload; pass `options.timeout`
|
|
193
|
+
* to set a per-call deadline.
|
|
194
|
+
*
|
|
195
|
+
* @param parameters - Game pass and language identifiers plus the image
|
|
196
|
+
* bytes to upload.
|
|
197
|
+
* @param options - Optional per-request overrides.
|
|
198
|
+
* @returns A success {@link Result} with no payload, or the
|
|
199
|
+
* {@link OpenCloudError} that caused the request to fail.
|
|
200
|
+
*/
|
|
202
201
|
uploadIcon: (parameters: UploadGamePassIconParameters, options?: RequestOptions) => Promise<Result<undefined, OpenCloudError>>;
|
|
203
202
|
}
|
|
204
203
|
/**
|
|
205
|
-
* Public client for the Roblox Open Cloud Game Passes API.
|
|
206
|
-
*
|
|
207
|
-
* Wires request builders, the injected {@link
|
|
208
|
-
* OpenCloudClientOptions.httpClient}, and response parsers into a single
|
|
209
|
-
* ergonomic surface. Every method returns a {@link Result} so callers handle
|
|
210
|
-
* failure explicitly; no thrown `OpenCloudError` ever escapes the client.
|
|
211
|
-
*
|
|
212
|
-
* ```ts
|
|
213
|
-
* import { GamePassesClient } from "@bedrock-rbx/ocale/game-passes";
|
|
214
|
-
*
|
|
215
|
-
* const client = new GamePassesClient({
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
* console.
|
|
226
|
-
* }
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
* @
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
|
|
259
|
-
|
|
204
|
+
* Public client for the Roblox Open Cloud Game Passes API.
|
|
205
|
+
*
|
|
206
|
+
* Wires request builders, the injected {@link
|
|
207
|
+
* OpenCloudClientOptions.httpClient}, and response parsers into a single
|
|
208
|
+
* ergonomic surface. Every method returns a {@link Result} so callers handle
|
|
209
|
+
* failure explicitly; no thrown `OpenCloudError` ever escapes the client.
|
|
210
|
+
*
|
|
211
|
+
* ```ts
|
|
212
|
+
* import { GamePassesClient } from "@bedrock-rbx/ocale/game-passes";
|
|
213
|
+
*
|
|
214
|
+
* const client = new GamePassesClient({
|
|
215
|
+
* credential: { apiKey: process.env.ROBLOX_API_KEY!, kind: "apiKey" },
|
|
216
|
+
* });
|
|
217
|
+
*
|
|
218
|
+
* const result = await client.get({
|
|
219
|
+
* universeId: "1234567890",
|
|
220
|
+
* gamePassId: "9876543210",
|
|
221
|
+
* });
|
|
222
|
+
*
|
|
223
|
+
* if (result.success) {
|
|
224
|
+
* console.log(`${result.data.name} (${result.data.id})`);
|
|
225
|
+
* } else {
|
|
226
|
+
* console.error(result.err.message);
|
|
227
|
+
* }
|
|
228
|
+
* ```
|
|
229
|
+
*
|
|
230
|
+
* Listing is cursor-paginated; drive the loop on `nextPageToken`:
|
|
231
|
+
*
|
|
232
|
+
* ```ts
|
|
233
|
+
* let pageToken: string | undefined;
|
|
234
|
+
* do {
|
|
235
|
+
* const page = await client.list({ universeId: "1234567890", pageToken });
|
|
236
|
+
* if (!page.success) {
|
|
237
|
+
* console.error(page.err.message);
|
|
238
|
+
* break;
|
|
239
|
+
* }
|
|
240
|
+
*
|
|
241
|
+
* for (const pass of page.data.items) {
|
|
242
|
+
* console.log(`${pass.name} (${pass.id})`);
|
|
243
|
+
* }
|
|
244
|
+
*
|
|
245
|
+
* pageToken = page.data.nextPageToken;
|
|
246
|
+
* } while (pageToken !== undefined);
|
|
247
|
+
* ```
|
|
248
|
+
*
|
|
249
|
+
* @since 0.1.0
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
*
|
|
253
|
+
* ```ts
|
|
254
|
+
* import { GamePassesClient } from "@bedrock-rbx/ocale/game-passes";
|
|
255
|
+
*
|
|
256
|
+
* const client = new GamePassesClient({
|
|
257
|
+
* credential: { apiKey: "your-key", kind: "apiKey" },
|
|
258
|
+
* });
|
|
259
|
+
* expect(client).toBeInstanceOf(GamePassesClient);
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
export declare class GamePassesClient {
|
|
260
263
|
#private;
|
|
261
264
|
/**
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
265
|
+
* Operation Group exposing per-locale localization Operations
|
|
266
|
+
* (`updateNameDescription`, `uploadIcon`) backed by the
|
|
267
|
+
* `legacy-game-internationalization` domain. Source-language values
|
|
268
|
+
* remain on {@link GamePassesClient.update}; methods on this group set
|
|
269
|
+
* per-locale overlays on top. Shares the parent client's HTTP,
|
|
270
|
+
* rate-limit, and retry plumbing.
|
|
271
|
+
*/
|
|
269
272
|
readonly localization: GamePassLocalizationHandle;
|
|
270
273
|
/**
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
* Creates a new {@link GamePassesClient}. Configuration is frozen on
|
|
275
|
+
* construction; per-request overrides are accepted on each method.
|
|
276
|
+
*
|
|
277
|
+
* @param options - Client-level configuration including the API key.
|
|
278
|
+
*/
|
|
276
279
|
constructor(options: OpenCloudClientOptions);
|
|
277
280
|
/**
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
281
|
+
* Creates a new game pass under the supplied universe.
|
|
282
|
+
*
|
|
283
|
+
* No default request timeout applies to this upload; pass `options.timeout`
|
|
284
|
+
* to set a per-call deadline.
|
|
285
|
+
*
|
|
286
|
+
* @param parameters - Creation fields including the universe and pass name.
|
|
287
|
+
* @param options - Optional per-request overrides.
|
|
288
|
+
* @returns A {@link Result} wrapping the parsed {@link GamePass} or the
|
|
289
|
+
* {@link OpenCloudError} that caused the request to fail.
|
|
290
|
+
*/
|
|
288
291
|
create(parameters: CreateGamePassParameters, options?: RequestOptions): Promise<Result<GamePass, OpenCloudError>>;
|
|
289
292
|
/**
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
293
|
+
* Reads a single game pass by ID.
|
|
294
|
+
*
|
|
295
|
+
* @param parameters - Universe and game pass identifiers.
|
|
296
|
+
* @param options - Optional per-request overrides (e.g. A different
|
|
297
|
+
* {@link OpenCloudClientOptions.credential} for this call only).
|
|
298
|
+
* @returns A {@link Result} wrapping the parsed {@link GamePass} or the
|
|
299
|
+
* {@link OpenCloudError} that caused the request to fail.
|
|
300
|
+
*/
|
|
298
301
|
get(parameters: GetGamePassParameters, options?: RequestOptions): Promise<Result<GamePass, OpenCloudError>>;
|
|
299
302
|
/**
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
303
|
+
* Lists one page of game passes for the supplied universe. Pagination is
|
|
304
|
+
* cursor-based: omit `pageToken` for the first page, then thread the
|
|
305
|
+
* previous response's `nextPageToken` back in until it is `undefined`.
|
|
306
|
+
*
|
|
307
|
+
* @param parameters - Universe identifier and optional page cursors.
|
|
308
|
+
* @param options - Optional per-request overrides.
|
|
309
|
+
* @returns A {@link Result} wrapping a {@link Page} of {@link GamePass},
|
|
310
|
+
* or the {@link OpenCloudError} that caused the request to fail.
|
|
311
|
+
*/
|
|
309
312
|
list(parameters: ListGamePassesParameters, options?: RequestOptions): Promise<Result<Page<GamePass>, OpenCloudError>>;
|
|
310
313
|
/**
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
314
|
+
* Partially updates an existing game pass. Mirrors the upstream
|
|
315
|
+
* `204 No Content` response: a successful update yields `undefined`
|
|
316
|
+
* data. Callers that need the post-update state (for example to
|
|
317
|
+
* observe a server-derived `updatedAt`) chain
|
|
318
|
+
* {@link GamePassesClient.get} themselves so the GET only fires when
|
|
319
|
+
* actually needed.
|
|
320
|
+
*
|
|
321
|
+
* No default request timeout applies to this upload; pass `options.timeout`
|
|
322
|
+
* to set a per-call deadline.
|
|
323
|
+
*
|
|
324
|
+
* @param parameters - The universe and game pass identifiers and the
|
|
325
|
+
* fields to update. Only fields explicitly provided are forwarded.
|
|
326
|
+
* @param options - Optional per-request overrides.
|
|
327
|
+
* @returns A success {@link Result} with no payload, or the
|
|
328
|
+
* {@link OpenCloudError} that caused the request to fail.
|
|
329
|
+
*/
|
|
327
330
|
update(parameters: UpdateGamePassParameters, options?: RequestOptions): Promise<Result<undefined, OpenCloudError>>;
|
|
328
331
|
}
|
|
329
332
|
//#endregion
|
|
330
|
-
export {
|
|
333
|
+
export type { CreateGamePassParameters, GamePass, GamePassPrice, GamePassPricingFeature, GetGamePassParameters, ListGamePassesParameters, UpdateGamePassNameDescriptionParameters, UpdateGamePassParameters, UploadGamePassIconParameters };
|
|
331
334
|
//# sourceMappingURL=game-passes.d.mts.map
|
|
@@ -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":"
|
|
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":";;;;;;;;;;;UAUiB;;WAEP;;WAEA,OAAO,OAAO;;;;;;WAMd,cAAc,qBAAqB;;;;;;;;;;;;UCV5B;;WAEP;;WAEA;;WAEA;;;;;;WAMA,cAAc,qBAAqB;;;;;;;;;;KChBjC;;;;;;UAWK;;WAEP;;WAEA,iBAAiB,cAAc;;;;;;;;;UAUxB;;WAEP;;WAEA;;WAEA,WAAW;;WAEX;;WAEA;;WAEA;;WAEA;;WAEA,OAAO;;WAEP,WAAW;;;;;;;UAQJ;;WAEP;;WAEA;;WAEA,YAAY,OAAO;;WAEnB;;WAEA;;WAEA;;WAEA;;;;;;;UAQO;;WAEP;;WAEA;;;;;;;;;;UAWO;;WAEP;;WAEA;;WAEA;;;;;;;;;;UAWO;;WAEP;;WAEA;;WAEA;;WAEA,YAAY,OAAO;;WAEnB;;WAEA;;WAEA;;WAEA;;;;UCvBA;;;;;;;;;;;;;;EAcT,wBACC,YAAY,yCACZ,UAAU,mBACN,QAAQ,kBAAkB;;;;;;;;;;;;;;;;EAgB/B,aACC,YAAY,8BACZ,UAAU,mBACN,QAAQ,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA8DnB;;;;;;;;;;WAWI,cAAc;;;;;;;EAQ9B,YAAY,SAAS;;;;;;;;;;;;EAgBrB,OACC,YAAY,0BACZ,UAAU,iBACR,QAAQ,OAAO,UAAU;;;;;;;;;;EAa5B,IACC,YAAY,uBACZ,UAAU,iBACR,QAAQ,OAAO,UAAU;;;;;;;;;;;EAc5B,KACC,YAAY,0BACZ,UAAU,iBACR,QAAQ,OAAO,KAAK,WAAW;;;;;;;;;;;;;;;;;;EAqBlC,OACC,YAAY,0BACZ,UAAU,iBACR,QAAQ,kBAAkB"}
|
package/dist/game-passes.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as IDEMPOTENT_METHOD_DEFAULTS, t as CREATE_METHOD_DEFAULTS } from "./retry-vpHMIwaU.mjs";
|
|
1
|
+
import { j as isRecord, m as UnexpectedResponseError, r as IDEMPOTENT_METHOD_DEFAULTS, t as CREATE_METHOD_DEFAULTS } from "./retry-CMRDvAR4.mjs";
|
|
3
2
|
import { t as toBlob } from "./to-blob-RPqMBuft.mjs";
|
|
4
|
-
import { c as isDateTimeString, n as okRequest,
|
|
5
|
-
import { n as isPriceInformationLike, t as copyPriceInformation } from "./price-information-
|
|
3
|
+
import { c as isDateTimeString, n as okRequest, r as parseEmptyResponse, s as toJsonDetails, t as ResourceClient } from "./resource-client-CaIVr-go.mjs";
|
|
4
|
+
import { n as isPriceInformationLike, t as copyPriceInformation } from "./price-information-DEkEQ8Pq.mjs";
|
|
6
5
|
//#region src/domains/game-internationalization/game-pass-icon/builders.ts
|
|
7
6
|
/**
|
|
8
7
|
* Builds a `POST` request for the localized "upload game-pass icon"
|
|
@@ -47,12 +46,13 @@ function buildUpdateRequest$1(parameters) {
|
|
|
47
46
|
//#endregion
|
|
48
47
|
//#region src/domains/game-internationalization/game-pass-name-description/operations.ts
|
|
49
48
|
/**
|
|
50
|
-
* Per-second request ceiling for
|
|
51
|
-
*
|
|
52
|
-
* requests per minute
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
49
|
+
* Per-second request ceiling for game-pass localization Operations, from
|
|
50
|
+
* each operation's `x-roblox-rate-limits.perApiKeyOwner` in the vendored schema
|
|
51
|
+
* (100 requests per minute). This family's key stays separate from other
|
|
52
|
+
* game-internationalization families: the #587 probe measured independent
|
|
53
|
+
* reported 100/minute counters, including on rejected requests. Successful
|
|
54
|
+
* writes may have additional service limits; see
|
|
55
|
+
* `docs/spikes/game-internationalization-rate-limits/README.md`.
|
|
56
56
|
*/
|
|
57
57
|
const LOCALIZATION_OPERATION_LIMIT = Object.freeze({
|
|
58
58
|
maxPerSecond: 100 / 60,
|
|
@@ -110,8 +110,8 @@ function buildCreateRequest(parameters) {
|
|
|
110
110
|
body.append("name", parameters.name);
|
|
111
111
|
if (parameters.description !== void 0) body.append("description", parameters.description);
|
|
112
112
|
if (parameters.isForSale !== void 0) body.append("isForSale", String(parameters.isForSale));
|
|
113
|
+
if (parameters.isManagedPricingEnabled !== void 0) body.append("isManagedPricingEnabled", String(parameters.isManagedPricingEnabled));
|
|
113
114
|
if (parameters.price !== void 0) body.append("price", String(parameters.price));
|
|
114
|
-
if (parameters.isRegionalPricingEnabled !== void 0) body.append("isRegionalPricingEnabled", String(parameters.isRegionalPricingEnabled));
|
|
115
115
|
if (parameters.imageFile !== void 0) body.append("imageFile", toBlob(parameters.imageFile));
|
|
116
116
|
return {
|
|
117
117
|
body,
|
|
@@ -139,8 +139,8 @@ function buildUpdateRequest(parameters) {
|
|
|
139
139
|
if (parameters.name !== void 0) body.append("name", parameters.name);
|
|
140
140
|
if (parameters.description !== void 0) body.append("description", parameters.description);
|
|
141
141
|
if (parameters.isForSale !== void 0) body.append("isForSale", String(parameters.isForSale));
|
|
142
|
+
if (parameters.isManagedPricingEnabled !== void 0) body.append("isManagedPricingEnabled", String(parameters.isManagedPricingEnabled));
|
|
142
143
|
if (parameters.price !== void 0) body.append("price", String(parameters.price));
|
|
143
|
-
if (parameters.isRegionalPricingEnabled !== void 0) body.append("isRegionalPricingEnabled", String(parameters.isRegionalPricingEnabled));
|
|
144
144
|
if (parameters.imageFile !== void 0) body.append("file", toBlob(parameters.imageFile));
|
|
145
145
|
return {
|
|
146
146
|
body,
|
|
@@ -217,14 +217,15 @@ const LIST_REQUIRED_SCOPES = Object.freeze(["game-pass:read"]);
|
|
|
217
217
|
* without exceptions.
|
|
218
218
|
*
|
|
219
219
|
* @param response - The full {@link HttpResponse} from the Open Cloud API.
|
|
220
|
-
* The status code is included on the returned `
|
|
221
|
-
* fails; the headers are available for future parsers that need
|
|
220
|
+
* The status code is included on the returned `UnexpectedResponseError` when
|
|
221
|
+
* validation fails; the headers are available for future parsers that need
|
|
222
|
+
* them.
|
|
222
223
|
* @returns A success result wrapping the converted `GamePass`, or an
|
|
223
|
-
* `
|
|
224
|
+
* `UnexpectedResponseError` when the body does not match the wire schema.
|
|
224
225
|
*/
|
|
225
226
|
function parseGamePassResponse({ body, status: statusCode }) {
|
|
226
227
|
if (!isGamePassConfigV2(body)) return {
|
|
227
|
-
err: new
|
|
228
|
+
err: new UnexpectedResponseError("Malformed game pass response", {
|
|
228
229
|
details: toJsonDetails(body),
|
|
229
230
|
statusCode
|
|
230
231
|
}),
|
|
@@ -243,11 +244,11 @@ function parseGamePassResponse({ body, status: statusCode }) {
|
|
|
243
244
|
*
|
|
244
245
|
* @param response - The full {@link HttpResponse} from the Open Cloud API.
|
|
245
246
|
* @returns A success result wrapping the converted page, or an
|
|
246
|
-
* `
|
|
247
|
+
* `UnexpectedResponseError` when the body does not match the wire schema.
|
|
247
248
|
*/
|
|
248
249
|
function parseGamePassesListResponse({ body, status: statusCode }) {
|
|
249
250
|
if (!isListResponseWire(body)) return {
|
|
250
|
-
err: new
|
|
251
|
+
err: new UnexpectedResponseError("Malformed game passes list response", {
|
|
251
252
|
details: toJsonDetails(body),
|
|
252
253
|
statusCode
|
|
253
254
|
}),
|
|
@@ -361,7 +362,9 @@ const UPLOAD_ICON_SPEC = makeSpec({
|
|
|
361
362
|
* ```ts
|
|
362
363
|
* import { GamePassesClient } from "@bedrock-rbx/ocale/game-passes";
|
|
363
364
|
*
|
|
364
|
-
* const client = new GamePassesClient({
|
|
365
|
+
* const client = new GamePassesClient({
|
|
366
|
+
* credential: { apiKey: process.env.ROBLOX_API_KEY!, kind: "apiKey" },
|
|
367
|
+
* });
|
|
365
368
|
*
|
|
366
369
|
* const result = await client.get({
|
|
367
370
|
* universeId: "1234567890",
|
|
@@ -401,7 +404,9 @@ const UPLOAD_ICON_SPEC = makeSpec({
|
|
|
401
404
|
* ```ts
|
|
402
405
|
* import { GamePassesClient } from "@bedrock-rbx/ocale/game-passes";
|
|
403
406
|
*
|
|
404
|
-
* const client = new GamePassesClient({
|
|
407
|
+
* const client = new GamePassesClient({
|
|
408
|
+
* credential: { apiKey: "your-key", kind: "apiKey" },
|
|
409
|
+
* });
|
|
405
410
|
* expect(client).toBeInstanceOf(GamePassesClient);
|
|
406
411
|
* ```
|
|
407
412
|
*/
|
|
@@ -449,7 +454,7 @@ var GamePassesClient = class {
|
|
|
449
454
|
*
|
|
450
455
|
* @param parameters - Universe and game pass identifiers.
|
|
451
456
|
* @param options - Optional per-request overrides (e.g. A different
|
|
452
|
-
* {@link OpenCloudClientOptions.
|
|
457
|
+
* {@link OpenCloudClientOptions.credential} for this call only).
|
|
453
458
|
* @returns A {@link Result} wrapping the parsed {@link GamePass} or the
|
|
454
459
|
* {@link OpenCloudError} that caused the request to fail.
|
|
455
460
|
*/
|