@bedrock-rbx/ocale 0.1.0-beta.2 → 0.1.0-beta.4
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/dist/badges.d.mts +2 -2
- package/dist/badges.mjs +4 -4
- package/dist/{data.generated-BtkDGH8C.d.mts → data.generated-DdwXMiv9.d.mts} +1 -1
- package/dist/{data.generated-BtkDGH8C.d.mts.map → data.generated-DdwXMiv9.d.mts.map} +1 -1
- package/dist/developer-products.d.mts +2 -2
- package/dist/developer-products.mjs +5 -5
- package/dist/game-passes.d.mts +2 -2
- package/dist/game-passes.mjs +5 -5
- package/dist/index.d.mts +92 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -3
- package/dist/{is-date-time-string-Cuf1TaSC.mjs → is-date-time-string-DL6l9mo6.mjs} +1 -1
- package/dist/{is-date-time-string-Cuf1TaSC.mjs.map → is-date-time-string-DL6l9mo6.mjs.map} +1 -1
- package/dist/locales.d.mts +1 -1
- package/dist/luau-execution.d.mts +93 -6
- package/dist/luau-execution.d.mts.map +1 -1
- package/dist/luau-execution.mjs +115 -3
- package/dist/luau-execution.mjs.map +1 -1
- package/dist/permission-error-DOVtNq3A.mjs +46 -0
- package/dist/permission-error-DOVtNq3A.mjs.map +1 -0
- package/dist/places.d.mts +46 -6
- package/dist/places.d.mts.map +1 -1
- package/dist/places.mjs +25 -61
- package/dist/places.mjs.map +1 -1
- package/dist/poll-timeout-Dg_QFEqi.mjs +79 -0
- package/dist/poll-timeout-Dg_QFEqi.mjs.map +1 -0
- package/dist/{types-BZ0959rh.d.mts → polling-DDKKpz6Z.d.mts} +106 -2
- package/dist/polling-DDKKpz6Z.d.mts.map +1 -0
- package/dist/polling-helpers-DJqtcrCQ.mjs +636 -0
- package/dist/polling-helpers-DJqtcrCQ.mjs.map +1 -0
- package/dist/{price-information-s7DY0GV2.mjs → price-information-XyhlYrn8.mjs} +2 -2
- package/dist/{price-information-s7DY0GV2.mjs.map → price-information-XyhlYrn8.mjs.map} +1 -1
- package/dist/{rate-limit-DzHBFwps.d.mts → rate-limit-BHAddFXO.d.mts} +2 -2
- package/dist/{rate-limit-DzHBFwps.d.mts.map → rate-limit-BHAddFXO.d.mts.map} +1 -1
- package/dist/{rate-limit-CKfuhxT1.mjs → rate-limit-D1q2Js-z.mjs} +2 -44
- package/dist/rate-limit-D1q2Js-z.mjs.map +1 -0
- package/dist/{resource-client-Wi4Mwqy5.mjs → resource-client-D7HKNrOp.mjs} +12 -3
- package/dist/{resource-client-Wi4Mwqy5.mjs.map → resource-client-D7HKNrOp.mjs.map} +1 -1
- package/dist/signatures-9rpsTjPL.mjs +59 -0
- package/dist/signatures-9rpsTjPL.mjs.map +1 -0
- package/dist/storage.d.mts +7 -1
- package/dist/storage.d.mts.map +1 -1
- package/dist/storage.mjs +3 -3
- package/dist/testing.d.mts +497 -0
- package/dist/testing.d.mts.map +1 -0
- package/dist/testing.mjs +367 -0
- package/dist/testing.mjs.map +1 -0
- package/dist/{to-blob-1BtHsDGK.mjs → to-blob-B27VhoRp.mjs} +1 -1
- package/dist/{to-blob-1BtHsDGK.mjs.map → to-blob-B27VhoRp.mjs.map} +1 -1
- package/dist/{types-Cp8w8uwA.d.mts → types-BOhSh9ug.d.mts} +1 -1
- package/dist/{types-Cp8w8uwA.d.mts.map → types-BOhSh9ug.d.mts.map} +1 -1
- package/dist/universes.d.mts +3 -8
- package/dist/universes.d.mts.map +1 -1
- package/dist/universes.mjs +5 -5
- package/dist/{validation-b7KAoEio.mjs → validation-DkL5KQqz.mjs} +2 -2
- package/dist/{validation-b7KAoEio.mjs.map → validation-DkL5KQqz.mjs.map} +1 -1
- package/dist/wire-BeIO-d1x.d.mts +35 -0
- package/dist/wire-BeIO-d1x.d.mts.map +1 -0
- package/package.json +3 -3
- package/dist/rate-limit-CKfuhxT1.mjs.map +0 -1
- package/dist/specs-Co6qYp_E.mjs +0 -309
- package/dist/specs-Co6qYp_E.mjs.map +0 -1
- package/dist/types-BZ0959rh.d.mts.map +0 -1
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
import { d as OpenCloudError, l as Result, n as HttpRequest, o as RequestConfig, r as HttpResponse, t as HttpClient, u as SleepFunc } from "./types-BOhSh9ug.mjs";
|
|
2
|
+
import { r as GetGameIconResponseWire, t as GameIconListWire } from "./wire-BeIO-d1x.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/domains/badges/badges/wire.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Wire shape of
|
|
7
|
+
* `Roblox.Web.Responses.RelatedEntityTypeResponse_Roblox.Platform.Badges.BadgeAwarderType_`.
|
|
8
|
+
*/
|
|
9
|
+
interface BadgeAwarderWire {
|
|
10
|
+
/** Int64 awarder ID. */
|
|
11
|
+
readonly id: number;
|
|
12
|
+
/** Display name of the awarding entity. */
|
|
13
|
+
readonly name: string;
|
|
14
|
+
/** Numeric awarder kind. `1` is `Place`. */
|
|
15
|
+
readonly type: BadgeAwarderTypeWire;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Wire shape of `Roblox.Web.Responses.Badges.BadgeAwardStatisticsResponse`.
|
|
19
|
+
*/
|
|
20
|
+
interface BadgeStatisticsWire {
|
|
21
|
+
/** Int64 lifetime awarded count. */
|
|
22
|
+
readonly awardedCount: number;
|
|
23
|
+
/** Int64 awarded count over the past day. */
|
|
24
|
+
readonly pastDayAwardedCount: number;
|
|
25
|
+
/** Double win-rate percentage in the range `[0, 100]`. */
|
|
26
|
+
readonly winRatePercentage: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Wire shape of `Roblox.Web.Responses.Badges.BadgeResponseV2`: the response
|
|
30
|
+
* body returned by the legacy badges create endpoint.
|
|
31
|
+
*/
|
|
32
|
+
interface BadgeResponseV2Wire {
|
|
33
|
+
/** Int64 badge ID, serialized as a JSON number. */
|
|
34
|
+
readonly id: number;
|
|
35
|
+
/** Display name of the badge. */
|
|
36
|
+
readonly name: string;
|
|
37
|
+
/** Awarding entity block. */
|
|
38
|
+
readonly awarder: BadgeAwarderWire;
|
|
39
|
+
/** ISO timestamp at which the badge was created (`date-time`). */
|
|
40
|
+
readonly created: string;
|
|
41
|
+
/** Source-language description. */
|
|
42
|
+
readonly description: string;
|
|
43
|
+
/** Resolved description for the requesting locale. */
|
|
44
|
+
readonly displayDescription: string;
|
|
45
|
+
/** Int64 resolved icon image asset ID; `0` signals no icon for this locale. */
|
|
46
|
+
readonly displayIconImageId: number;
|
|
47
|
+
/** Resolved name for the requesting locale. */
|
|
48
|
+
readonly displayName: string;
|
|
49
|
+
/** Whether the badge is currently active. Disabled badges cannot be awarded. */
|
|
50
|
+
readonly enabled: boolean;
|
|
51
|
+
/** Int64 source-language icon image asset ID; `0` signals no icon. */
|
|
52
|
+
readonly iconImageId: number;
|
|
53
|
+
/** Award statistics block. */
|
|
54
|
+
readonly statistics: BadgeStatisticsWire;
|
|
55
|
+
/** ISO timestamp of the most recent update (`date-time`). */
|
|
56
|
+
readonly updated: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Wire shape of `Roblox.Platform.Badges.BadgeAwarderType`.
|
|
60
|
+
*/
|
|
61
|
+
type BadgeAwarderTypeWire = 1;
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region tests/helpers/badges.d.ts
|
|
64
|
+
/**
|
|
65
|
+
* Builds a minimally-valid {@link BadgeResponseV2Wire} body. Pass an
|
|
66
|
+
* `overrides` object to tweak individual fields while keeping everything
|
|
67
|
+
* else schema-compliant; useful for parser and integration tests that
|
|
68
|
+
* only care about one field at a time.
|
|
69
|
+
*
|
|
70
|
+
* @param overrides - Fields to override on the default body.
|
|
71
|
+
* @returns A valid wire body with the overrides applied.
|
|
72
|
+
*/
|
|
73
|
+
declare function validBadgeBody(overrides?: Partial<BadgeResponseV2Wire>): BadgeResponseV2Wire;
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/internal/price-information.d.ts
|
|
76
|
+
/**
|
|
77
|
+
* Wire shape shared by every Roblox commerce resource that carries a
|
|
78
|
+
* `priceInformation` block (game passes, developer products, ...). Resources
|
|
79
|
+
* vary in the literal set their `enabledFeatures` may contain, so the feature
|
|
80
|
+
* type is left as a parameter `F`.
|
|
81
|
+
*
|
|
82
|
+
* @template F - The string-literal union for this resource's pricing-feature flags.
|
|
83
|
+
*/
|
|
84
|
+
interface PriceInformationLike<F extends string> {
|
|
85
|
+
/** Default Robux price; `undefined` when the schema returns null. */
|
|
86
|
+
readonly defaultPriceInRobux: number | undefined;
|
|
87
|
+
/** Enabled pricing feature flags, in the order returned by the API. */
|
|
88
|
+
readonly enabledFeatures: ReadonlyArray<F>;
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/domains/developer-products/products/wire.d.ts
|
|
92
|
+
/**
|
|
93
|
+
* Wire-level pricing feature flag, mirroring `DeveloperProducts.PricingFeature`.
|
|
94
|
+
*/
|
|
95
|
+
type DeveloperProductPricingFeatureWire = "Invalid" | "PriceOptimization" | "RegionalPricing" | "UserFixedPrice";
|
|
96
|
+
/**
|
|
97
|
+
* Wire shape of `DeveloperProductConfigV2`: the response body returned by
|
|
98
|
+
* the developer-products read and create endpoints.
|
|
99
|
+
*/
|
|
100
|
+
interface DeveloperProductConfigV2 {
|
|
101
|
+
/** Display name of the developer product. */
|
|
102
|
+
readonly name: string;
|
|
103
|
+
/** ISO timestamp at which the developer product was created (`date-time`). */
|
|
104
|
+
readonly createdTimestamp: string;
|
|
105
|
+
/** Consumer-facing description shown on the storefront. */
|
|
106
|
+
readonly description: string;
|
|
107
|
+
/** Int64 icon image asset ID; `undefined` when no icon is uploaded. */
|
|
108
|
+
readonly iconImageAssetId: number | undefined;
|
|
109
|
+
/** Whether the developer product is currently purchasable. */
|
|
110
|
+
readonly isForSale: boolean;
|
|
111
|
+
/** Whether the developer product is locked from configuration changes. */
|
|
112
|
+
readonly isImmutable: boolean;
|
|
113
|
+
/** Pricing block; `undefined` when the schema returns null. */
|
|
114
|
+
readonly priceInformation: DeveloperProductPriceInformationWire | undefined;
|
|
115
|
+
/** Int64 developer product ID, serialized as a JSON number. */
|
|
116
|
+
readonly productId: number;
|
|
117
|
+
/** Whether the developer product appears on the external store page. */
|
|
118
|
+
readonly storePageEnabled: boolean;
|
|
119
|
+
/** Int64 universe ID that owns the developer product. */
|
|
120
|
+
readonly universeId: number;
|
|
121
|
+
/** ISO timestamp of the most recent update (`date-time`). */
|
|
122
|
+
readonly updatedTimestamp: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Wire shape of `DeveloperProducts.PriceInformationStruct`.
|
|
126
|
+
*/
|
|
127
|
+
type DeveloperProductPriceInformationWire = PriceInformationLike<DeveloperProductPricingFeatureWire>;
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region tests/helpers/developer-products.d.ts
|
|
130
|
+
/**
|
|
131
|
+
* Builds a minimally-valid {@link DeveloperProductConfigV2} wire body. Pass
|
|
132
|
+
* an `overrides` object to tweak individual fields while keeping everything
|
|
133
|
+
* else schema-compliant; useful for parser and integration tests that
|
|
134
|
+
* only care about one field at a time.
|
|
135
|
+
*
|
|
136
|
+
* @param overrides - Fields to override on the default body.
|
|
137
|
+
* @returns A valid wire body with the overrides applied.
|
|
138
|
+
*/
|
|
139
|
+
declare function validDeveloperProductBody(overrides?: Partial<DeveloperProductConfigV2>): DeveloperProductConfigV2;
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region tests/helpers/fake-http-client.d.ts
|
|
142
|
+
/**
|
|
143
|
+
* A request captured by {@link FakeHttpClient} for later assertion.
|
|
144
|
+
*/
|
|
145
|
+
interface CapturedRequest {
|
|
146
|
+
/** The per-request config passed alongside the request. */
|
|
147
|
+
readonly config: RequestConfig;
|
|
148
|
+
/** The request passed to {@link HttpClient.request}. */
|
|
149
|
+
readonly request: HttpRequest;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* A fluent fake for the {@link HttpClient} boundary. Mocks are queued in
|
|
153
|
+
* FIFO order and consumed by each `request()` call. Records every
|
|
154
|
+
* request and config for later assertion. Throws
|
|
155
|
+
* {@link FakeHttpClientError} if the queue is empty when `request()` is
|
|
156
|
+
* called — surfaces missing mocks as test setup bugs instead of silently
|
|
157
|
+
* repeating the last response.
|
|
158
|
+
*/
|
|
159
|
+
interface FakeHttpClient extends HttpClient {
|
|
160
|
+
/** Queues an {@link ApiError} with the given status code and optional message/code. */
|
|
161
|
+
mockApiError(options: {
|
|
162
|
+
code?: string;
|
|
163
|
+
message?: string;
|
|
164
|
+
statusCode: number;
|
|
165
|
+
}): this;
|
|
166
|
+
/** Queues an error Result with the given error instance. */
|
|
167
|
+
mockError(error: OpenCloudError): this;
|
|
168
|
+
/** Queues a {@link NetworkError}. Preserves `cause` when provided. */
|
|
169
|
+
mockNetworkError(options?: {
|
|
170
|
+
cause?: unknown;
|
|
171
|
+
message?: string;
|
|
172
|
+
}): this;
|
|
173
|
+
/** Queues a {@link RateLimitError} with the given retry hint. */
|
|
174
|
+
mockRateLimit(options: {
|
|
175
|
+
message?: string;
|
|
176
|
+
retryAfterSeconds: number;
|
|
177
|
+
}): this;
|
|
178
|
+
/** Queues a successful {@link HttpResponse}. Body defaults to `{}`; headers default to `{}`. */
|
|
179
|
+
mockResponse(options: {
|
|
180
|
+
body?: unknown;
|
|
181
|
+
headers?: Readonly<Record<string, string>>;
|
|
182
|
+
status: number;
|
|
183
|
+
}): this;
|
|
184
|
+
/** Number of queued mocks that have not yet been consumed. */
|
|
185
|
+
readonly pendingMocks: number;
|
|
186
|
+
/** Chronological log of every `(request, config)` pair the fake received. */
|
|
187
|
+
readonly requests: ReadonlyArray<CapturedRequest>;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Thrown when {@link FakeHttpClient.request} is called but no mock has
|
|
191
|
+
* been queued. The message names the method, url, and consumed count to
|
|
192
|
+
* aid debugging of missing `.mockResponse`/`.mockError` setup.
|
|
193
|
+
*/
|
|
194
|
+
declare class FakeHttpClientError extends Error {
|
|
195
|
+
override readonly name: string;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Creates a fluent {@link FakeHttpClient} that sits at the
|
|
199
|
+
* {@link HttpClient} seam. Use for integration tests where you need to
|
|
200
|
+
* assert per-request config (apiKey, baseUrl) flows through to HTTP.
|
|
201
|
+
*
|
|
202
|
+
* @returns A fresh fake with an empty mock queue.
|
|
203
|
+
*/
|
|
204
|
+
declare function createFakeHttpClient(): FakeHttpClient;
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region tests/helpers/fake-send.d.ts
|
|
207
|
+
/**
|
|
208
|
+
* The `send` callback shape consumed by `executeWithRetry`. A plain
|
|
209
|
+
* transport function — no `RequestConfig`, no queueing, no retries.
|
|
210
|
+
*/
|
|
211
|
+
type SendFunc = (request: HttpRequest) => Promise<Result<HttpResponse, OpenCloudError>>;
|
|
212
|
+
/**
|
|
213
|
+
* A scripted fake for the `send` callback. Replays responses in order
|
|
214
|
+
* and records every request it receives.
|
|
215
|
+
*/
|
|
216
|
+
interface FakeSend {
|
|
217
|
+
/** Chronological log of every request the fake received. */
|
|
218
|
+
readonly requests: ReadonlyArray<HttpRequest>;
|
|
219
|
+
/** The scripted send callback. */
|
|
220
|
+
readonly send: SendFunc;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Creates a scripted fake for the `send` callback. Each call returns the
|
|
224
|
+
* next queued response; exhausting the queue throws, which surfaces test
|
|
225
|
+
* setup mistakes instead of silently repeating the last response.
|
|
226
|
+
*
|
|
227
|
+
* @param options - The scripted responses to replay, in order.
|
|
228
|
+
* @returns A `send` callback plus a `requests` log.
|
|
229
|
+
* @rejects {Error} When a call is made after all scripted responses are consumed.
|
|
230
|
+
*/
|
|
231
|
+
declare function createFakeSend(options: {
|
|
232
|
+
readonly responses: ReadonlyArray<Result<HttpResponse, OpenCloudError>>;
|
|
233
|
+
}): FakeSend;
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region tests/helpers/fake-sleep.d.ts
|
|
236
|
+
/**
|
|
237
|
+
* A directly-callable sleep double that records its wait arguments without
|
|
238
|
+
* delaying. Assignable to {@link SleepFunc}.
|
|
239
|
+
*/
|
|
240
|
+
interface FakeSleep extends SleepFunc {
|
|
241
|
+
/** Chronological log of every `ms` value the fake was called with. */
|
|
242
|
+
readonly waits: ReadonlyArray<number>;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Creates a {@link FakeSleep} that resolves immediately and records every
|
|
246
|
+
* `ms` value it was called with.
|
|
247
|
+
*
|
|
248
|
+
* @returns A callable sleep function with a `waits` log attached.
|
|
249
|
+
*/
|
|
250
|
+
declare function createFakeSleep(): FakeSleep;
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region tests/helpers/game-icon.d.ts
|
|
253
|
+
/**
|
|
254
|
+
* Builds a minimally-valid {@link GetGameIconResponseWire} entry. Pass an
|
|
255
|
+
* `overrides` object to tweak individual fields while keeping everything
|
|
256
|
+
* else schema-compliant.
|
|
257
|
+
*
|
|
258
|
+
* @param overrides - Fields to override on the default entry.
|
|
259
|
+
* @returns A valid localized-icon entry with the overrides applied.
|
|
260
|
+
*/
|
|
261
|
+
declare function validLocalizedIcon(overrides?: Partial<GetGameIconResponseWire>): GetGameIconResponseWire;
|
|
262
|
+
/**
|
|
263
|
+
* Builds a minimally-valid {@link GameIconListWire} body containing a single
|
|
264
|
+
* default localized icon.
|
|
265
|
+
*
|
|
266
|
+
* @param overrides - Fields to override on the default body.
|
|
267
|
+
* @returns A valid wire body with the overrides applied.
|
|
268
|
+
*/
|
|
269
|
+
declare function validIconListBody(overrides?: Partial<GameIconListWire>): GameIconListWire;
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region src/domains/game-passes/game-passes/wire.d.ts
|
|
272
|
+
/**
|
|
273
|
+
* Wire-level pricing feature flag, mirroring `GamePasses.PricingFeature`.
|
|
274
|
+
*/
|
|
275
|
+
type PricingFeatureWire = "Invalid" | "PriceOptimization" | "RegionalPricing" | "UserFixedPrice";
|
|
276
|
+
/**
|
|
277
|
+
* Wire shape of `GamePassConfigV2` — the response body returned by the
|
|
278
|
+
* Game Passes read endpoint.
|
|
279
|
+
*/
|
|
280
|
+
interface GamePassConfigV2 {
|
|
281
|
+
/** Display name of the game pass. */
|
|
282
|
+
readonly name: string;
|
|
283
|
+
/** ISO timestamp at which the game pass was created (`date-time`). */
|
|
284
|
+
readonly createdTimestamp: string;
|
|
285
|
+
/** Consumer-facing description. */
|
|
286
|
+
readonly description: string;
|
|
287
|
+
/** Int64 game pass ID, serialized as a JSON number. */
|
|
288
|
+
readonly gamePassId: number;
|
|
289
|
+
/** Int64 icon asset ID; `0` signals the pass has no icon uploaded. */
|
|
290
|
+
readonly iconAssetId: number;
|
|
291
|
+
/** Whether the game pass is currently purchasable. */
|
|
292
|
+
readonly isForSale: boolean;
|
|
293
|
+
/** Pricing block; `undefined` when the schema returns null. */
|
|
294
|
+
readonly priceInformation: PriceInformationStructWire | undefined;
|
|
295
|
+
/** ISO timestamp of the most recent update (`date-time`). */
|
|
296
|
+
readonly updatedTimestamp: string;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Wire shape of `GamePasses.PriceInformationStruct`.
|
|
300
|
+
*/
|
|
301
|
+
type PriceInformationStructWire = PriceInformationLike<PricingFeatureWire>;
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region tests/helpers/game-passes.d.ts
|
|
304
|
+
/**
|
|
305
|
+
* Builds a minimally-valid {@link GamePassConfigV2} wire body. Pass an
|
|
306
|
+
* `overrides` object to tweak individual fields while keeping everything
|
|
307
|
+
* else schema-compliant — useful for parser and integration tests that
|
|
308
|
+
* only care about one field at a time.
|
|
309
|
+
*
|
|
310
|
+
* @param overrides - Fields to override on the default body.
|
|
311
|
+
* @returns A valid wire body with the overrides applied.
|
|
312
|
+
*/
|
|
313
|
+
declare function validGamePassBody(overrides?: Partial<GamePassConfigV2>): GamePassConfigV2;
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/domains/game-internationalization/game-thumbnails/wire.d.ts
|
|
316
|
+
/**
|
|
317
|
+
* Wire shape of `POST /v1/game-thumbnails/games/{gameId}/language-codes/{languageCode}/image`,
|
|
318
|
+
* mirroring `Roblox.GameInternationalization.Api.Models.Response.UploadImageForGameThumbnailResponse`.
|
|
319
|
+
*/
|
|
320
|
+
interface GameThumbnailUploadWire {
|
|
321
|
+
/** Stringified ID of the freshly uploaded thumbnail. */
|
|
322
|
+
readonly mediaAssetId: string;
|
|
323
|
+
}
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region tests/helpers/game-thumbnails.d.ts
|
|
326
|
+
/**
|
|
327
|
+
* Builds a minimally-valid {@link GameThumbnailUploadWire} body. Pass an
|
|
328
|
+
* `overrides` object to tweak individual fields while keeping everything
|
|
329
|
+
* else schema-compliant; useful for parser and integration tests that
|
|
330
|
+
* only care about one field at a time.
|
|
331
|
+
*
|
|
332
|
+
* @param overrides - Fields to override on the default body.
|
|
333
|
+
* @returns A valid wire body with the overrides applied.
|
|
334
|
+
*/
|
|
335
|
+
declare function validThumbnailUploadBody(overrides?: Partial<GameThumbnailUploadWire>): GameThumbnailUploadWire;
|
|
336
|
+
//#endregion
|
|
337
|
+
//#region src/domains/cloud-v2/places/wire.d.ts
|
|
338
|
+
/**
|
|
339
|
+
* Wire shape of the `Place` resource -- the response body returned by
|
|
340
|
+
* `Cloud_GetPlace` and `Cloud_UpdatePlace`. Genuinely optional fields
|
|
341
|
+
* are `T | undefined` so callers can simulate absence under
|
|
342
|
+
* `exactOptionalPropertyTypes`. The parser normalizes JSON `null`
|
|
343
|
+
* values to `undefined` at validation time so consumers only ever
|
|
344
|
+
* observe `undefined`.
|
|
345
|
+
*/
|
|
346
|
+
interface PlaceWire {
|
|
347
|
+
/** ISO timestamp when the place was created (`date-time`). */
|
|
348
|
+
readonly createTime: string;
|
|
349
|
+
/** Long-form description of the place. */
|
|
350
|
+
readonly description: string;
|
|
351
|
+
/** Human-facing name of the place. */
|
|
352
|
+
readonly displayName: string;
|
|
353
|
+
/** Resource path, e.g. `"universes/{uid}/places/{pid}"`. */
|
|
354
|
+
readonly path: string;
|
|
355
|
+
/** Whether this place is the universe's root place. */
|
|
356
|
+
readonly root?: boolean | undefined;
|
|
357
|
+
/** Maximum number of allowed users in a single server. */
|
|
358
|
+
readonly serverSize?: number | undefined;
|
|
359
|
+
/** Whether the place was created in-experience via `AssetService::CreatePlaceAsync()`. */
|
|
360
|
+
readonly universeRuntimeCreation?: boolean | undefined;
|
|
361
|
+
/** ISO timestamp of the most recent update (`date-time`). */
|
|
362
|
+
readonly updateTime: string;
|
|
363
|
+
}
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/domains/universes/places/wire.d.ts
|
|
366
|
+
/**
|
|
367
|
+
* Wire shape of the publish-version success response body.
|
|
368
|
+
*/
|
|
369
|
+
interface PlaceVersionWire {
|
|
370
|
+
/** Auto-incrementing version number assigned by Roblox. */
|
|
371
|
+
readonly versionNumber: number;
|
|
372
|
+
}
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region tests/helpers/places.d.ts
|
|
375
|
+
/**
|
|
376
|
+
* Returns a fresh, minimal `.rbxl`-formatted body whose magic bytes
|
|
377
|
+
* match {@link RBXL_SIGNATURE}. Useful when integration tests don't
|
|
378
|
+
* care about the file's contents past the signature.
|
|
379
|
+
*
|
|
380
|
+
* @returns A 14-byte rbxl body matching the binary signature.
|
|
381
|
+
*/
|
|
382
|
+
declare function rbxlBody(): Uint8Array<ArrayBuffer>;
|
|
383
|
+
/**
|
|
384
|
+
* Returns a fresh, minimal `.rbxlx`-formatted body whose magic bytes
|
|
385
|
+
* match {@link RBXLX_SIGNATURE}. Useful when integration tests don't
|
|
386
|
+
* care about the file's contents past the signature.
|
|
387
|
+
*
|
|
388
|
+
* @returns An 8-byte rbxlx body matching the XML signature.
|
|
389
|
+
*/
|
|
390
|
+
declare function rbxlxBody(): Uint8Array<ArrayBuffer>;
|
|
391
|
+
/**
|
|
392
|
+
* Builds a minimally-valid {@link PlaceVersionWire} body. Pass an
|
|
393
|
+
* `overrides` object to tweak fields without re-stating the defaults.
|
|
394
|
+
*
|
|
395
|
+
* @param overrides - Fields to override on the default body.
|
|
396
|
+
* @returns A valid wire body with the overrides applied.
|
|
397
|
+
*/
|
|
398
|
+
declare function validPublishResponseBody(overrides?: Partial<PlaceVersionWire>): PlaceVersionWire;
|
|
399
|
+
/**
|
|
400
|
+
* Builds a minimally-valid {@link PlaceWire} body. Pass an `overrides`
|
|
401
|
+
* object to tweak fields without re-stating the defaults.
|
|
402
|
+
*
|
|
403
|
+
* @param overrides - Fields to override on the default body.
|
|
404
|
+
* @returns A valid wire body with the overrides applied.
|
|
405
|
+
*/
|
|
406
|
+
declare function validPlaceBody(overrides?: Partial<PlaceWire>): PlaceWire;
|
|
407
|
+
//#endregion
|
|
408
|
+
//#region src/domains/cloud-v2/universes/wire.d.ts
|
|
409
|
+
/**
|
|
410
|
+
* Wire-level visibility enum, mirroring the `visibility` field of the
|
|
411
|
+
* `Universe` schema.
|
|
412
|
+
*/
|
|
413
|
+
type VisibilityWire = "PRIVATE" | "PUBLIC" | "VISIBILITY_UNSPECIFIED";
|
|
414
|
+
/**
|
|
415
|
+
* Wire-level age-rating enum, mirroring the `ageRating` field of the
|
|
416
|
+
* `Universe` schema.
|
|
417
|
+
*/
|
|
418
|
+
type AgeRatingWire = "AGE_RATING_9_PLUS" | "AGE_RATING_13_PLUS" | "AGE_RATING_17_PLUS" | "AGE_RATING_ALL" | "AGE_RATING_UNSPECIFIED";
|
|
419
|
+
/**
|
|
420
|
+
* Wire shape of `Universe_SocialLink`.
|
|
421
|
+
*/
|
|
422
|
+
interface SocialLinkWire {
|
|
423
|
+
/** Display title for the link. */
|
|
424
|
+
readonly title: string;
|
|
425
|
+
/** Destination URI. */
|
|
426
|
+
readonly uri: string;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Wire shape of the `Universe` resource -- the response body returned
|
|
430
|
+
* by both `Cloud_GetUniverse` and `Cloud_UpdateUniverse`. Genuinely
|
|
431
|
+
* optional fields are `T | undefined` (rather than `T`) so callers
|
|
432
|
+
* can simulate absence by setting a field to `undefined` under
|
|
433
|
+
* `exactOptionalPropertyTypes`.
|
|
434
|
+
*/
|
|
435
|
+
interface UniverseWire {
|
|
436
|
+
/** Age-rating classification. */
|
|
437
|
+
readonly ageRating: AgeRatingWire;
|
|
438
|
+
/** Whether console players can join. */
|
|
439
|
+
readonly consoleEnabled?: boolean | undefined;
|
|
440
|
+
/** ISO timestamp when the universe was created (`date-time`). */
|
|
441
|
+
readonly createTime: string;
|
|
442
|
+
/** Description, derived from the root place's description. */
|
|
443
|
+
readonly description: string;
|
|
444
|
+
/** Whether desktop players can join. */
|
|
445
|
+
readonly desktopEnabled?: boolean | undefined;
|
|
446
|
+
/** Discord social link block. */
|
|
447
|
+
readonly discordSocialLink?: SocialLinkWire | undefined;
|
|
448
|
+
/** Display name, derived from the root place's name. */
|
|
449
|
+
readonly displayName: string;
|
|
450
|
+
/** Facebook social link block. */
|
|
451
|
+
readonly facebookSocialLink?: SocialLinkWire | undefined;
|
|
452
|
+
/** Group-owner resource path when the universe is group-owned. */
|
|
453
|
+
readonly group?: string | undefined;
|
|
454
|
+
/** Guilded social link block. */
|
|
455
|
+
readonly guildedSocialLink?: SocialLinkWire | undefined;
|
|
456
|
+
/** Whether mobile players can join. */
|
|
457
|
+
readonly mobileEnabled?: boolean | undefined;
|
|
458
|
+
/** Resource path, e.g. `"universes/{id}"`. */
|
|
459
|
+
readonly path: string;
|
|
460
|
+
/** Private server price in Robux; absent when private servers are disabled. */
|
|
461
|
+
readonly privateServerPriceRobux?: number | undefined;
|
|
462
|
+
/** Roblox Group social link block. */
|
|
463
|
+
readonly robloxGroupSocialLink?: SocialLinkWire | undefined;
|
|
464
|
+
/** Root place resource path, e.g. `"universes/{id}/places/{pid}"`. */
|
|
465
|
+
readonly rootPlace?: string | undefined;
|
|
466
|
+
/** Whether tablet players can join. */
|
|
467
|
+
readonly tabletEnabled?: boolean | undefined;
|
|
468
|
+
/** Twitch social link block. */
|
|
469
|
+
readonly twitchSocialLink?: SocialLinkWire | undefined;
|
|
470
|
+
/** Twitter social link block. */
|
|
471
|
+
readonly twitterSocialLink?: SocialLinkWire | undefined;
|
|
472
|
+
/** ISO timestamp of the most recent update (`date-time`). */
|
|
473
|
+
readonly updateTime: string;
|
|
474
|
+
/** User-owner resource path when the universe is user-owned. */
|
|
475
|
+
readonly user?: string | undefined;
|
|
476
|
+
/** Current visibility of the universe. */
|
|
477
|
+
readonly visibility: VisibilityWire;
|
|
478
|
+
/** Whether voice chat is enabled. */
|
|
479
|
+
readonly voiceChatEnabled?: boolean | undefined;
|
|
480
|
+
/** Whether VR players can join. */
|
|
481
|
+
readonly vrEnabled?: boolean | undefined;
|
|
482
|
+
/** Youtube social link block. */
|
|
483
|
+
readonly youtubeSocialLink?: SocialLinkWire | undefined;
|
|
484
|
+
}
|
|
485
|
+
//#endregion
|
|
486
|
+
//#region tests/helpers/universes.d.ts
|
|
487
|
+
/**
|
|
488
|
+
* Builds a minimally-valid {@link UniverseWire} body. Pass an
|
|
489
|
+
* `overrides` object to tweak fields without re-stating the defaults.
|
|
490
|
+
*
|
|
491
|
+
* @param overrides - Fields to override on the default body.
|
|
492
|
+
* @returns A valid wire body with the overrides applied.
|
|
493
|
+
*/
|
|
494
|
+
declare function validUniverseBody(overrides?: Partial<UniverseWire>): UniverseWire;
|
|
495
|
+
//#endregion
|
|
496
|
+
export { type CapturedRequest, type FakeHttpClient, FakeHttpClientError, type FakeSend, type FakeSleep, type SendFunc, createFakeHttpClient, createFakeSend, createFakeSleep, rbxlBody, rbxlxBody, validBadgeBody, validDeveloperProductBody, validGamePassBody, validIconListBody, validLocalizedIcon, validPlaceBody, validPublishResponseBody, validThumbnailUploadBody, validUniverseBody };
|
|
497
|
+
//# sourceMappingURL=testing.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.mts","names":[],"sources":["../src/domains/badges/badges/wire.ts","../tests/helpers/badges.ts","../src/internal/price-information.ts","../src/domains/developer-products/products/wire.ts","../tests/helpers/developer-products.ts","../tests/helpers/fake-http-client.ts","../tests/helpers/fake-send.ts","../tests/helpers/fake-sleep.ts","../tests/helpers/game-icon.ts","../src/domains/game-passes/game-passes/wire.ts","../tests/helpers/game-passes.ts","../src/domains/game-internationalization/game-thumbnails/wire.ts","../tests/helpers/game-thumbnails.ts","../src/domains/cloud-v2/places/wire.ts","../src/domains/universes/places/wire.ts","../tests/helpers/places.ts","../src/domains/cloud-v2/universes/wire.ts","../tests/helpers/universes.ts"],"mappings":";;;;;;;;UAQiB,gBAAA;EAAA;EAAA,SAEP,EAAA;EAIM;EAAA,SAFN,IAAA;;WAEA,IAAA,EAAM,oBAAA;AAAA;;;AAMhB;UAAiB,mBAAA;;WAEP,YAAA;;WAEA,mBAAA;;WAEA,iBAAA;AAAA;AAOV;;;;AAAA,UAAiB,mBAAA;;WAEP,EAAA;;WAEA,IAAA;;WAEA,OAAA,EAAS,gBAAA;;WAET,OAAA;;WAEA,WAAA;;WAEA,kBAAA;;WAEA,kBAAA;EAUA;EAAA,SARA,WAAA;EAcL;EAAA,SAZK,OAAA;EAYL;EAAA,SAVK,WAAA;;WAEA,UAAA,EAAY,mBAAA;;WAEZ,OAAA;AAAA;;;;KAML,oBAAA;;;;;;AAvDL;;;;;;iBCGgB,cAAA,CAAe,SAAA,GAAW,OAAA,CAAQ,mBAAA,IAA4B,mBAAA;;;;;;;ADH9E;;;;UEEiB,oBAAA;;WAEP,mBAAA;;WAEA,eAAA,EAAiB,aAAA,CAAc,CAAA;AAAA;;;;;;KCA7B,kCAAA;;;;;UAUK,wBAAA;;WAEP,IAAA;;WAEA,gBAAA;EHRV;EAAA,SGUU,WAAA;;WAEA,gBAAA;;WAEA,SAAA;;WAEA,WAAA;EHVA;EAAA,SGYA,gBAAA,EAAkB,oCAAA;EHLX;EAAA,SGOP,SAAA;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