@bedrock-rbx/ocale 0.4.0 → 0.5.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 +1 -0
- package/dist/assets.d.mts +64 -0
- package/dist/assets.d.mts.map +1 -0
- package/dist/assets.mjs +301 -0
- package/dist/assets.mjs.map +1 -0
- package/dist/badge-insufficient-funds-BLFvQZt1.mjs +91 -0
- package/dist/badge-insufficient-funds-BLFvQZt1.mjs.map +1 -0
- package/dist/badges.d.mts +136 -17
- package/dist/badges.d.mts.map +1 -1
- package/dist/badges.mjs +375 -99
- package/dist/badges.mjs.map +1 -1
- package/dist/{capacity-admission-hycCFkTo.d.mts → capacity-admission-Ce2V9QNb.d.mts} +2 -10
- package/dist/capacity-admission-Ce2V9QNb.d.mts.map +1 -0
- package/dist/{data.generated-D_vpa5-g.d.mts → data.generated-B4Fztv_7.d.mts} +1 -3
- package/dist/{data.generated-D_vpa5-g.d.mts.map → data.generated-B4Fztv_7.d.mts.map} +1 -1
- package/dist/developer-products.d.mts +29 -11
- package/dist/developer-products.d.mts.map +1 -1
- package/dist/developer-products.mjs +104 -18
- package/dist/developer-products.mjs.map +1 -1
- package/dist/game-passes.d.mts +2 -10
- package/dist/game-passes.d.mts.map +1 -1
- package/dist/game-passes.mjs +12 -18
- package/dist/game-passes.mjs.map +1 -1
- package/dist/index.d.mts +58 -39
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +9 -12
- package/dist/index.mjs.map +1 -1
- package/dist/is-date-time-string-C91G44SI.mjs +19 -0
- package/dist/is-date-time-string-C91G44SI.mjs.map +1 -0
- package/dist/locales.d.mts +1 -3
- package/dist/locales.d.mts.map +1 -1
- package/dist/locales.mjs +2 -4
- package/dist/locales.mjs.map +1 -1
- package/dist/luau-execution.d.mts +2 -8
- package/dist/luau-execution.d.mts.map +1 -1
- package/dist/luau-execution.mjs +7 -11
- package/dist/luau-execution.mjs.map +1 -1
- package/dist/{network-error-iVSng5MT.mjs → network-error-P4An7nUB.mjs} +5 -9
- package/dist/{network-error-iVSng5MT.mjs.map → network-error-P4An7nUB.mjs.map} +1 -1
- package/dist/places.d.mts +57 -9
- package/dist/places.d.mts.map +1 -1
- package/dist/places.mjs +127 -21
- package/dist/places.mjs.map +1 -1
- package/dist/{poll-timeout-DzztDymd.mjs → poll-timeout-BCxgN97O.mjs} +4 -6
- package/dist/{poll-timeout-DzztDymd.mjs.map → poll-timeout-BCxgN97O.mjs.map} +1 -1
- package/dist/{polling-helpers-DfF5dspc.mjs → polling-helpers-BtEYR5dN.mjs} +19 -30
- package/dist/polling-helpers-BtEYR5dN.mjs.map +1 -0
- package/dist/{price-information-DEkEQ8Pq.mjs → price-information--d6GZAcp.mjs} +3 -4
- package/dist/{price-information-DEkEQ8Pq.mjs.map → price-information--d6GZAcp.mjs.map} +1 -1
- package/dist/{resource-client-BCKukheG.d.mts → resource-client-CF8SPsV8.d.mts} +3 -9
- package/dist/resource-client-CF8SPsV8.d.mts.map +1 -0
- package/dist/{resource-client-CaIVr-go.mjs → resource-client-Cm_bPcCs.mjs} +23 -59
- package/dist/resource-client-Cm_bPcCs.mjs.map +1 -0
- package/dist/{retry-C2oHesDx.d.mts → retry-DYxm_eBU.d.mts} +2 -6
- package/dist/retry-DYxm_eBU.d.mts.map +1 -0
- package/dist/{retry-CMRDvAR4.mjs → retry-Dv5TsY9O.mjs} +50 -52
- package/dist/retry-Dv5TsY9O.mjs.map +1 -0
- package/dist/{signatures-JF-7Psce.mjs → signatures-CtJ7jfVN.mjs} +2 -3
- package/dist/{signatures-JF-7Psce.mjs.map → signatures-CtJ7jfVN.mjs.map} +1 -1
- package/dist/storage.d.mts +2 -12
- package/dist/storage.d.mts.map +1 -1
- package/dist/storage.mjs +12 -20
- package/dist/storage.mjs.map +1 -1
- package/dist/testing.d.mts +2 -54
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +16 -30
- package/dist/testing.mjs.map +1 -1
- package/dist/{to-blob-RPqMBuft.mjs → to-blob-Bqu7bmlE.mjs} +2 -3
- package/dist/{to-blob-RPqMBuft.mjs.map → to-blob-Bqu7bmlE.mjs.map} +1 -1
- package/dist/{types-CdMr_J1M.d.mts → types-Z4abDJfK.d.mts} +1 -9
- package/dist/types-Z4abDJfK.d.mts.map +1 -0
- package/dist/universes.d.mts +4 -18
- package/dist/universes.d.mts.map +1 -1
- package/dist/universes.mjs +27 -47
- package/dist/universes.mjs.map +1 -1
- package/dist/{validation-964VNlbp.mjs → validation-kaTLLAD1.mjs} +3 -4
- package/dist/{validation-964VNlbp.mjs.map → validation-kaTLLAD1.mjs.map} +1 -1
- package/dist/{wire-DJqupefn.d.mts → wire-DDG87I-d.d.mts} +1 -3
- package/dist/wire-DDG87I-d.d.mts.map +1 -0
- package/package.json +8 -7
- package/dist/badge-cost-mismatch-DrlvhlQc.mjs +0 -47
- package/dist/badge-cost-mismatch-DrlvhlQc.mjs.map +0 -1
- package/dist/capacity-admission-hycCFkTo.d.mts.map +0 -1
- package/dist/polling-helpers-DfF5dspc.mjs.map +0 -1
- package/dist/resource-client-BCKukheG.d.mts.map +0 -1
- package/dist/resource-client-CaIVr-go.mjs.map +0 -1
- package/dist/retry-C2oHesDx.d.mts.map +0 -1
- package/dist/retry-CMRDvAR4.mjs.map +0 -1
- package/dist/types-CdMr_J1M.d.mts.map +0 -1
- package/dist/wire-DJqupefn.d.mts.map +0 -1
package/dist/testing.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { a as HttpClient, g as OpenCloudError, h as SleepFunc, m as Result, o as HttpRequest, s as HttpResponse, u as RequestConfig } from "./types-
|
|
2
|
-
import { r as GetGameIconResponseWire, t as GameIconListWire } from "./wire-
|
|
3
|
-
//#region src/domains/badges/badges/wire.d.ts
|
|
1
|
+
import { a as HttpClient, g as OpenCloudError, h as SleepFunc, m as Result, o as HttpRequest, s as HttpResponse, u as RequestConfig } from "./types-Z4abDJfK.mjs";
|
|
2
|
+
import { r as GetGameIconResponseWire, t as GameIconListWire } from "./wire-DDG87I-d.mjs";
|
|
4
3
|
/**
|
|
5
4
|
* Wire shape of
|
|
6
5
|
* `Roblox.Web.Responses.RelatedEntityTypeResponse_Roblox.Platform.Badges.BadgeAwarderType_`.
|
|
@@ -63,8 +62,6 @@ interface BadgeResponseV2Wire {
|
|
|
63
62
|
* Wire shape of `Roblox.Platform.Badges.BadgeAwarderType`.
|
|
64
63
|
*/
|
|
65
64
|
type BadgeAwarderTypeWire = "Place";
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region tests/helpers/badges.d.ts
|
|
68
65
|
/**
|
|
69
66
|
* Builds a minimally-valid {@link BadgeResponseV2Wire} body. Pass an
|
|
70
67
|
* `overrides` object to tweak individual fields while keeping everything
|
|
@@ -75,8 +72,6 @@ type BadgeAwarderTypeWire = "Place";
|
|
|
75
72
|
* @returns A valid wire body with the overrides applied.
|
|
76
73
|
*/
|
|
77
74
|
export declare function validBadgeBody(overrides?: Partial<BadgeResponseV2Wire>): BadgeResponseV2Wire;
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region src/internal/price-information.d.ts
|
|
80
75
|
/**
|
|
81
76
|
* Wire shape shared by every Roblox commerce resource that carries a
|
|
82
77
|
* `priceInformation` block (game passes, developer products, ...). Resources
|
|
@@ -91,8 +86,6 @@ interface PriceInformationLike<F extends string> {
|
|
|
91
86
|
/** Enabled pricing feature flags, in the order returned by the API. */
|
|
92
87
|
readonly enabledFeatures: ReadonlyArray<F>;
|
|
93
88
|
}
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/domains/developer-products/products/wire.d.ts
|
|
96
89
|
/**
|
|
97
90
|
* Wire-level pricing feature flag, mirroring
|
|
98
91
|
* `DeveloperProducts.PricingFeature`.
|
|
@@ -132,8 +125,6 @@ interface DeveloperProductConfigV2 {
|
|
|
132
125
|
* Wire shape of `DeveloperProducts.PriceInformationStruct`.
|
|
133
126
|
*/
|
|
134
127
|
type DeveloperProductPriceInformationWire = PriceInformationLike<DeveloperProductPricingFeatureWire>;
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region tests/helpers/developer-products.d.ts
|
|
137
128
|
/**
|
|
138
129
|
* Builds a minimally-valid {@link DeveloperProductConfigV2} wire body. Pass
|
|
139
130
|
* an `overrides` object to tweak individual fields while keeping everything
|
|
@@ -144,8 +135,6 @@ type DeveloperProductPriceInformationWire = PriceInformationLike<DeveloperProduc
|
|
|
144
135
|
* @returns A valid wire body with the overrides applied.
|
|
145
136
|
*/
|
|
146
137
|
export declare function validDeveloperProductBody(overrides?: Partial<DeveloperProductConfigV2>): DeveloperProductConfigV2;
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region tests/helpers/fake-http-client.d.ts
|
|
149
138
|
/**
|
|
150
139
|
* A request captured by {@link FakeHttpClient} for later assertion.
|
|
151
140
|
*/
|
|
@@ -217,8 +206,6 @@ export declare class FakeHttpClientError extends Error {
|
|
|
217
206
|
* @returns A fresh fake with an empty mock queue.
|
|
218
207
|
*/
|
|
219
208
|
export declare function createFakeHttpClient(): FakeHttpClient;
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region tests/helpers/fake-send.d.ts
|
|
222
209
|
/**
|
|
223
210
|
* The `send` callback shape consumed by `executeWithRetry`. A plain
|
|
224
211
|
* transport function — no `RequestConfig`, no queueing, no retries.
|
|
@@ -246,8 +233,6 @@ interface FakeSend {
|
|
|
246
233
|
export declare function createFakeSend(options: {
|
|
247
234
|
readonly responses: ReadonlyArray<Result<HttpResponse, OpenCloudError>>;
|
|
248
235
|
}): FakeSend;
|
|
249
|
-
//#endregion
|
|
250
|
-
//#region tests/helpers/fake-sleep.d.ts
|
|
251
236
|
/**
|
|
252
237
|
* A directly-callable sleep double that records its wait arguments without
|
|
253
238
|
* delaying. Assignable to {@link SleepFunc}.
|
|
@@ -263,8 +248,6 @@ interface FakeSleep extends SleepFunc {
|
|
|
263
248
|
* @returns A callable sleep function with a `waits` log attached.
|
|
264
249
|
*/
|
|
265
250
|
export declare function createFakeSleep(): FakeSleep;
|
|
266
|
-
//#endregion
|
|
267
|
-
//#region tests/helpers/game-icon.d.ts
|
|
268
251
|
/**
|
|
269
252
|
* Builds a minimally-valid {@link GetGameIconResponseWire} entry. Pass an
|
|
270
253
|
* `overrides` object to tweak individual fields while keeping everything
|
|
@@ -282,8 +265,6 @@ export declare function validLocalizedIcon(overrides?: Partial<GetGameIconRespon
|
|
|
282
265
|
* @returns A valid wire body with the overrides applied.
|
|
283
266
|
*/
|
|
284
267
|
export declare function validIconListBody(overrides?: Partial<GameIconListWire>): GameIconListWire;
|
|
285
|
-
//#endregion
|
|
286
|
-
//#region src/domains/game-passes/game-passes/wire.d.ts
|
|
287
268
|
/**
|
|
288
269
|
* Wire-level pricing feature flag, mirroring `GamePasses.PricingFeature`.
|
|
289
270
|
*/
|
|
@@ -316,8 +297,6 @@ interface GamePassConfigV2 {
|
|
|
316
297
|
* Wire shape of `GamePasses.PriceInformationStruct`.
|
|
317
298
|
*/
|
|
318
299
|
type PriceInformationStructWire = PriceInformationLike<PricingFeatureWire>;
|
|
319
|
-
//#endregion
|
|
320
|
-
//#region tests/helpers/game-passes.d.ts
|
|
321
300
|
/**
|
|
322
301
|
* Builds a minimally-valid {@link GamePassConfigV2} wire body. Pass an
|
|
323
302
|
* `overrides` object to tweak individual fields while keeping everything
|
|
@@ -328,8 +307,6 @@ type PriceInformationStructWire = PriceInformationLike<PricingFeatureWire>;
|
|
|
328
307
|
* @returns A valid wire body with the overrides applied.
|
|
329
308
|
*/
|
|
330
309
|
export declare function validGamePassBody(overrides?: Partial<GamePassConfigV2>): GamePassConfigV2;
|
|
331
|
-
//#endregion
|
|
332
|
-
//#region src/domains/game-internationalization/game-thumbnails/wire.d.ts
|
|
333
310
|
/**
|
|
334
311
|
* Wire shape of `POST
|
|
335
312
|
* /v1/game-thumbnails/games/{gameId}/language-codes/{languageCode}/image`,
|
|
@@ -340,8 +317,6 @@ interface GameThumbnailUploadWire {
|
|
|
340
317
|
/** Stringified ID of the freshly uploaded thumbnail. */
|
|
341
318
|
readonly mediaAssetId: string;
|
|
342
319
|
}
|
|
343
|
-
//#endregion
|
|
344
|
-
//#region tests/helpers/game-thumbnails.d.ts
|
|
345
320
|
/**
|
|
346
321
|
* Builds a minimally-valid {@link GameThumbnailUploadWire} body. Pass an
|
|
347
322
|
* `overrides` object to tweak individual fields while keeping everything
|
|
@@ -352,8 +327,6 @@ interface GameThumbnailUploadWire {
|
|
|
352
327
|
* @returns A valid wire body with the overrides applied.
|
|
353
328
|
*/
|
|
354
329
|
export declare function validThumbnailUploadBody(overrides?: Partial<GameThumbnailUploadWire>): GameThumbnailUploadWire;
|
|
355
|
-
//#endregion
|
|
356
|
-
//#region src/domains/cloud-v2/luau-execution-task-binary-inputs/wire.d.ts
|
|
357
330
|
/** Wire shape of the binary-input create response body. */
|
|
358
331
|
interface LuauExecutionTaskBinaryInputWire {
|
|
359
332
|
/** Resource path the server assigned to this binary input slot. */
|
|
@@ -363,8 +336,6 @@ interface LuauExecutionTaskBinaryInputWire {
|
|
|
363
336
|
/** Presigned PUT URI the caller uses to upload the binary data. */
|
|
364
337
|
readonly uploadUri: string;
|
|
365
338
|
}
|
|
366
|
-
//#endregion
|
|
367
|
-
//#region tests/helpers/luau-execution-task-binary-inputs.d.ts
|
|
368
339
|
/**
|
|
369
340
|
* Builds a minimally-valid {@link LuauExecutionTaskBinaryInputWire} body
|
|
370
341
|
* for tests. Pass an `overrides` object to tweak fields without re-stating
|
|
@@ -374,8 +345,6 @@ interface LuauExecutionTaskBinaryInputWire {
|
|
|
374
345
|
* @returns A valid wire body with the overrides applied.
|
|
375
346
|
*/
|
|
376
347
|
export declare function validBinaryInputBody(overrides?: Partial<LuauExecutionTaskBinaryInputWire>): LuauExecutionTaskBinaryInputWire;
|
|
377
|
-
//#endregion
|
|
378
|
-
//#region src/domains/cloud-v2/luau-execution-task-logs/wire.d.ts
|
|
379
348
|
/**
|
|
380
349
|
* Wire shape of a single structured log message within a
|
|
381
350
|
* {@link LogChunkWire}.
|
|
@@ -419,8 +388,6 @@ interface ListLogsResponseWire {
|
|
|
419
388
|
*/
|
|
420
389
|
readonly nextPageToken?: string | undefined;
|
|
421
390
|
}
|
|
422
|
-
//#endregion
|
|
423
|
-
//#region tests/helpers/luau-execution-task-logs.d.ts
|
|
424
391
|
/**
|
|
425
392
|
* Builds a minimally-valid {@link ListLogsResponseWire} body containing
|
|
426
393
|
* one chunk with one structured message. Pass an `overrides` object to
|
|
@@ -430,8 +397,6 @@ interface ListLogsResponseWire {
|
|
|
430
397
|
* @returns A valid wire body with the overrides applied.
|
|
431
398
|
*/
|
|
432
399
|
export declare function validLogPageBody(overrides?: Partial<ListLogsResponseWire>): ListLogsResponseWire;
|
|
433
|
-
//#endregion
|
|
434
|
-
//#region src/domains/cloud-v2/luau-execution-tasks/wire.d.ts
|
|
435
400
|
/**
|
|
436
401
|
* Wire error payload for `FAILED` tasks. Carries the categorical
|
|
437
402
|
* `code` plus a human-readable `message`.
|
|
@@ -505,8 +470,6 @@ interface LuauExecutionTaskWire {
|
|
|
505
470
|
*/
|
|
506
471
|
readonly user: string;
|
|
507
472
|
}
|
|
508
|
-
//#endregion
|
|
509
|
-
//#region tests/helpers/luau-execution-tasks.d.ts
|
|
510
473
|
/**
|
|
511
474
|
* Builds a minimally-valid {@link LuauExecutionTaskWire} body for an
|
|
512
475
|
* in-progress task. Pass an `overrides` object to tweak fields without
|
|
@@ -516,8 +479,6 @@ interface LuauExecutionTaskWire {
|
|
|
516
479
|
* @returns A valid wire body with the overrides applied.
|
|
517
480
|
*/
|
|
518
481
|
export declare function validInProgressTaskBody(overrides?: Partial<LuauExecutionTaskWire>): LuauExecutionTaskWire;
|
|
519
|
-
//#endregion
|
|
520
|
-
//#region src/domains/cloud-v2/memory-store-queues/wire.d.ts
|
|
521
482
|
/**
|
|
522
483
|
* Wire shape of a `MemoryStoreQueueItem` resource: the response body
|
|
523
484
|
* returned by `Cloud_CreateMemoryStoreQueueItem` and the array entry
|
|
@@ -560,8 +521,6 @@ interface ReadQueueItemsResponseWire {
|
|
|
560
521
|
*/
|
|
561
522
|
readonly queueItems: ReadonlyArray<MemoryStoreQueueItemWire>;
|
|
562
523
|
}
|
|
563
|
-
//#endregion
|
|
564
|
-
//#region tests/helpers/memory-store-queues.d.ts
|
|
565
524
|
/**
|
|
566
525
|
* Builds a minimally-valid {@link MemoryStoreQueueItemWire} body. Pass
|
|
567
526
|
* an `overrides` object to tweak fields without re-stating the defaults.
|
|
@@ -579,8 +538,6 @@ export declare function validQueueItemBody(overrides?: Partial<MemoryStoreQueueI
|
|
|
579
538
|
* @returns A valid dequeue response body with the overrides applied.
|
|
580
539
|
*/
|
|
581
540
|
export declare function validDequeueBody(overrides?: Partial<ReadQueueItemsResponseWire>): ReadQueueItemsResponseWire;
|
|
582
|
-
//#endregion
|
|
583
|
-
//#region src/domains/cloud-v2/places/wire.d.ts
|
|
584
541
|
/**
|
|
585
542
|
* Wire shape of the `Place` resource -- the response body returned by
|
|
586
543
|
* `Cloud_GetPlace` and `Cloud_UpdatePlace`. Genuinely optional fields
|
|
@@ -610,8 +567,6 @@ interface PlaceWire {
|
|
|
610
567
|
/** ISO timestamp of the most recent update (`date-time`). */
|
|
611
568
|
readonly updateTime: string;
|
|
612
569
|
}
|
|
613
|
-
//#endregion
|
|
614
|
-
//#region src/domains/universes/places/wire.d.ts
|
|
615
570
|
/**
|
|
616
571
|
* Wire shape of the publish-version success response body.
|
|
617
572
|
*/
|
|
@@ -619,8 +574,6 @@ interface PlaceVersionWire {
|
|
|
619
574
|
/** Auto-incrementing version number assigned by Roblox. */
|
|
620
575
|
readonly versionNumber: number;
|
|
621
576
|
}
|
|
622
|
-
//#endregion
|
|
623
|
-
//#region tests/helpers/places.d.ts
|
|
624
577
|
/**
|
|
625
578
|
* Returns a fresh, minimal `.rbxl`-formatted body whose magic bytes
|
|
626
579
|
* match {@link RBXL_SIGNATURE}. Useful when integration tests don't
|
|
@@ -653,8 +606,6 @@ export declare function validPublishResponseBody(overrides?: Partial<PlaceVersio
|
|
|
653
606
|
* @returns A valid wire body with the overrides applied.
|
|
654
607
|
*/
|
|
655
608
|
export declare function validPlaceBody(overrides?: Partial<PlaceWire>): PlaceWire;
|
|
656
|
-
//#endregion
|
|
657
|
-
//#region src/domains/cloud-v2/universes/wire.d.ts
|
|
658
609
|
/**
|
|
659
610
|
* Wire-level visibility enum, mirroring the `visibility` field of the
|
|
660
611
|
* `Universe` schema.
|
|
@@ -733,8 +684,6 @@ interface UniverseWire {
|
|
|
733
684
|
/** Youtube social link block. */
|
|
734
685
|
readonly youtubeSocialLink?: SocialLinkWire | undefined;
|
|
735
686
|
}
|
|
736
|
-
//#endregion
|
|
737
|
-
//#region tests/helpers/universes.d.ts
|
|
738
687
|
/**
|
|
739
688
|
* Builds a minimally-valid {@link UniverseWire} body. Pass an
|
|
740
689
|
* `overrides` object to tweak fields without re-stating the defaults.
|
|
@@ -743,6 +692,5 @@ interface UniverseWire {
|
|
|
743
692
|
* @returns A valid wire body with the overrides applied.
|
|
744
693
|
*/
|
|
745
694
|
export declare function validUniverseBody(overrides?: Partial<UniverseWire>): UniverseWire;
|
|
746
|
-
//#endregion
|
|
747
695
|
export type { CapturedRequest, FakeHttpClient, FakeSend, FakeSleep, SendFunc };
|
|
748
696
|
//# sourceMappingURL=testing.d.mts.map
|
package/dist/testing.d.mts.map
CHANGED
|
@@ -1 +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/luau-execution-task-binary-inputs/wire.ts","../tests/helpers/luau-execution-task-binary-inputs.ts","../src/domains/cloud-v2/luau-execution-task-logs/wire.ts","../tests/helpers/luau-execution-task-logs.ts","../src/domains/cloud-v2/luau-execution-tasks/wire.ts","../tests/helpers/luau-execution-tasks.ts","../src/domains/cloud-v2/memory-store-queues/wire.ts","../tests/helpers/memory-store-queues.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":"
|
|
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/luau-execution-task-binary-inputs/wire.ts","../tests/helpers/luau-execution-task-binary-inputs.ts","../src/domains/cloud-v2/luau-execution-task-logs/wire.ts","../tests/helpers/luau-execution-task-logs.ts","../src/domains/cloud-v2/luau-execution-tasks/wire.ts","../tests/helpers/luau-execution-tasks.ts","../src/domains/cloud-v2/memory-store-queues/wire.ts","../tests/helpers/memory-store-queues.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;;WAEP;;WAEA;;WAEA,MAAM;;;;;UAMC;;WAEP;;WAEA;;WAEA;;;;;;UAOO;;WAEP;;WAEA;;WAEA,SAAS;;WAET;;WAEA;;WAEA;;;;WAIA;;WAEA;;;;;WAKA;;WAEA;;WAEA,YAAY;;WAEZ;;;;;KA+BL;;;;;;;;;;wB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1,6 +1,6 @@
|
|
|
1
|
-
import { a as ApiError, n as RateLimitError, t as NetworkError } from "./network-error-
|
|
2
|
-
import { n as RBXL_SIGNATURE, t as RBXLX_SIGNATURE } from "./signatures-
|
|
3
|
-
|
|
1
|
+
import { a as ApiError, n as RateLimitError, t as NetworkError } from "./network-error-P4An7nUB.mjs";
|
|
2
|
+
import { n as RBXL_SIGNATURE, t as RBXLX_SIGNATURE } from "./signatures-CtJ7jfVN.mjs";
|
|
3
|
+
// tests/helpers/badges.ts
|
|
4
4
|
/**
|
|
5
5
|
* Builds a minimally-valid {@link BadgeResponseV2Wire} body. Pass an
|
|
6
6
|
* `overrides` object to tweak individual fields while keeping everything
|
|
@@ -35,8 +35,7 @@ function validBadgeBody(overrides = {}) {
|
|
|
35
35
|
...overrides
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
//#region tests/helpers/developer-products.ts
|
|
38
|
+
// tests/helpers/developer-products.ts
|
|
40
39
|
/**
|
|
41
40
|
* Builds a minimally-valid {@link DeveloperProductConfigV2} wire body. Pass
|
|
42
41
|
* an `overrides` object to tweak individual fields while keeping everything
|
|
@@ -65,8 +64,7 @@ function validDeveloperProductBody(overrides = {}) {
|
|
|
65
64
|
...overrides
|
|
66
65
|
};
|
|
67
66
|
}
|
|
68
|
-
|
|
69
|
-
//#region tests/helpers/fake-http-client.ts
|
|
67
|
+
// tests/helpers/fake-http-client.ts
|
|
70
68
|
/**
|
|
71
69
|
* Thrown when {@link FakeHttpClient.request} is called but no mock has
|
|
72
70
|
* been queued. The message names the method, url, and consumed count to
|
|
@@ -158,8 +156,7 @@ function buildNetworkError(options) {
|
|
|
158
156
|
function buildRateLimitError(options) {
|
|
159
157
|
return new RateLimitError(options.message ?? "Rate limited", { retryAfterSeconds: options.retryAfterSeconds });
|
|
160
158
|
}
|
|
161
|
-
|
|
162
|
-
//#region tests/helpers/fake-send.ts
|
|
159
|
+
// tests/helpers/fake-send.ts
|
|
163
160
|
/**
|
|
164
161
|
* Creates a scripted fake for the `send` callback. Each call returns the
|
|
165
162
|
* next queued response; exhausting the queue throws, which surfaces test
|
|
@@ -185,8 +182,7 @@ function createFakeSend(options) {
|
|
|
185
182
|
send
|
|
186
183
|
};
|
|
187
184
|
}
|
|
188
|
-
|
|
189
|
-
//#region tests/helpers/fake-sleep.ts
|
|
185
|
+
// tests/helpers/fake-sleep.ts
|
|
190
186
|
/**
|
|
191
187
|
* Creates a {@link FakeSleep} that resolves immediately and records every
|
|
192
188
|
* `ms` value it was called with.
|
|
@@ -203,8 +199,7 @@ function createFakeSleep() {
|
|
|
203
199
|
return waits;
|
|
204
200
|
} });
|
|
205
201
|
}
|
|
206
|
-
|
|
207
|
-
//#region tests/helpers/game-icon.ts
|
|
202
|
+
// tests/helpers/game-icon.ts
|
|
208
203
|
/**
|
|
209
204
|
* Builds a minimally-valid {@link GetGameIconResponseWire} entry. Pass an
|
|
210
205
|
* `overrides` object to tweak individual fields while keeping everything
|
|
@@ -235,8 +230,7 @@ function validIconListBody(overrides = {}) {
|
|
|
235
230
|
...overrides
|
|
236
231
|
};
|
|
237
232
|
}
|
|
238
|
-
|
|
239
|
-
//#region tests/helpers/game-passes.ts
|
|
233
|
+
// tests/helpers/game-passes.ts
|
|
240
234
|
/**
|
|
241
235
|
* Builds a minimally-valid {@link GamePassConfigV2} wire body. Pass an
|
|
242
236
|
* `overrides` object to tweak individual fields while keeping everything
|
|
@@ -263,8 +257,7 @@ function validGamePassBody(overrides = {}) {
|
|
|
263
257
|
...overrides
|
|
264
258
|
};
|
|
265
259
|
}
|
|
266
|
-
|
|
267
|
-
//#region tests/helpers/game-thumbnails.ts
|
|
260
|
+
// tests/helpers/game-thumbnails.ts
|
|
268
261
|
/**
|
|
269
262
|
* Builds a minimally-valid {@link GameThumbnailUploadWire} body. Pass an
|
|
270
263
|
* `overrides` object to tweak individual fields while keeping everything
|
|
@@ -280,8 +273,7 @@ function validThumbnailUploadBody(overrides = {}) {
|
|
|
280
273
|
...overrides
|
|
281
274
|
};
|
|
282
275
|
}
|
|
283
|
-
|
|
284
|
-
//#region tests/helpers/luau-execution-task-binary-inputs.ts
|
|
276
|
+
// tests/helpers/luau-execution-task-binary-inputs.ts
|
|
285
277
|
/**
|
|
286
278
|
* Builds a minimally-valid {@link LuauExecutionTaskBinaryInputWire} body
|
|
287
279
|
* for tests. Pass an `overrides` object to tweak fields without re-stating
|
|
@@ -297,8 +289,7 @@ function validBinaryInputBody(overrides = {}) {
|
|
|
297
289
|
...overrides
|
|
298
290
|
};
|
|
299
291
|
}
|
|
300
|
-
|
|
301
|
-
//#region tests/helpers/luau-execution-task-logs.ts
|
|
292
|
+
// tests/helpers/luau-execution-task-logs.ts
|
|
302
293
|
/**
|
|
303
294
|
* Builds a minimally-valid {@link ListLogsResponseWire} body containing
|
|
304
295
|
* one chunk with one structured message. Pass an `overrides` object to
|
|
@@ -317,8 +308,7 @@ function validLogPageBody(overrides = {}) {
|
|
|
317
308
|
...overrides
|
|
318
309
|
};
|
|
319
310
|
}
|
|
320
|
-
|
|
321
|
-
//#region tests/helpers/luau-execution-tasks.ts
|
|
311
|
+
// tests/helpers/luau-execution-tasks.ts
|
|
322
312
|
/**
|
|
323
313
|
* Builds a minimally-valid {@link LuauExecutionTaskWire} body for an
|
|
324
314
|
* in-progress task. Pass an `overrides` object to tweak fields without
|
|
@@ -337,8 +327,7 @@ function validInProgressTaskBody(overrides = {}) {
|
|
|
337
327
|
...overrides
|
|
338
328
|
};
|
|
339
329
|
}
|
|
340
|
-
|
|
341
|
-
//#region tests/helpers/memory-store-queues.ts
|
|
330
|
+
// tests/helpers/memory-store-queues.ts
|
|
342
331
|
/**
|
|
343
332
|
* Builds a minimally-valid {@link MemoryStoreQueueItemWire} body. Pass
|
|
344
333
|
* an `overrides` object to tweak fields without re-stating the defaults.
|
|
@@ -370,8 +359,7 @@ function validDequeueBody(overrides = {}) {
|
|
|
370
359
|
...overrides
|
|
371
360
|
};
|
|
372
361
|
}
|
|
373
|
-
|
|
374
|
-
//#region tests/helpers/places.ts
|
|
362
|
+
// tests/helpers/places.ts
|
|
375
363
|
/**
|
|
376
364
|
* Returns a fresh, minimal `.rbxl`-formatted body whose magic bytes
|
|
377
365
|
* match {@link RBXL_SIGNATURE}. Useful when integration tests don't
|
|
@@ -425,8 +413,7 @@ function validPlaceBody(overrides = {}) {
|
|
|
425
413
|
...overrides
|
|
426
414
|
};
|
|
427
415
|
}
|
|
428
|
-
|
|
429
|
-
//#region tests/helpers/universes.ts
|
|
416
|
+
// tests/helpers/universes.ts
|
|
430
417
|
/**
|
|
431
418
|
* Builds a minimally-valid {@link UniverseWire} body. Pass an
|
|
432
419
|
* `overrides` object to tweak fields without re-stating the defaults.
|
|
@@ -454,7 +441,6 @@ function validUniverseBody(overrides = {}) {
|
|
|
454
441
|
...overrides
|
|
455
442
|
};
|
|
456
443
|
}
|
|
457
|
-
//#endregion
|
|
458
444
|
export { FakeHttpClientError, createFakeHttpClient, createFakeSend, createFakeSleep, rbxlBody, rbxlxBody, validBadgeBody, validBinaryInputBody, validDequeueBody, validDeveloperProductBody, validGamePassBody, validIconListBody, validInProgressTaskBody, validLocalizedIcon, validLogPageBody, validPlaceBody, validPublishResponseBody, validQueueItemBody, validThumbnailUploadBody, validUniverseBody };
|
|
459
445
|
|
|
460
446
|
//# sourceMappingURL=testing.mjs.map
|
package/dist/testing.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","names":[],"sources":["../tests/helpers/badges.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","../tests/helpers/game-passes.ts","../tests/helpers/game-thumbnails.ts","../tests/helpers/luau-execution-task-binary-inputs.ts","../tests/helpers/luau-execution-task-logs.ts","../tests/helpers/luau-execution-tasks.ts","../tests/helpers/memory-store-queues.ts","../tests/helpers/places.ts","../tests/helpers/universes.ts"],"sourcesContent":["import type { BadgeResponseV2Wire } from \"#src/domains/badges/badges/wire\";\n\n/**\n * Builds a minimally-valid {@link BadgeResponseV2Wire} body. Pass an\n * `overrides` object to tweak individual fields while keeping everything\n * else schema-compliant; useful for parser and integration tests that\n * only care about one field at a time.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validBadgeBody(overrides: Partial<BadgeResponseV2Wire> = {}): BadgeResponseV2Wire {\n\treturn {\n\t\tid: 12_345,\n\t\tname: \"First Goal\",\n\t\tawarder: { id: 222, name: \"Lobby\", type: \"Place\" },\n\t\tcreated: \"2024-01-15T10:30:00.000Z\",\n\t\tdescription: \"Awarded on first login.\",\n\t\tdisplayDescription: \"Awarded on first login.\",\n\t\tdisplayIconImageId: 67_890,\n\t\tdisplayName: \"First Goal\",\n\t\tenabled: true,\n\t\ticonImageId: 67_890,\n\t\tstatistics: { awardedCount: 100, pastDayAwardedCount: 5, winRatePercentage: 42.5 },\n\t\tupdated: \"2024-03-20T14:45:00.000Z\",\n\t\t...overrides,\n\t};\n}\n","import type { DeveloperProductConfigV2 } from \"#src/domains/developer-products/products/wire\";\n\n/**\n * Builds a minimally-valid {@link DeveloperProductConfigV2} wire body. Pass\n * an `overrides` object to tweak individual fields while keeping everything\n * else schema-compliant; useful for parser and integration tests that\n * only care about one field at a time.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validDeveloperProductBody(\n\toverrides: Partial<DeveloperProductConfigV2> = {},\n): DeveloperProductConfigV2 {\n\treturn {\n\t\tname: \"Gem Pack\",\n\t\tcreatedTimestamp: \"2024-01-15T10:30:00.000Z\",\n\t\tdescription: \"A premium gem pack\",\n\t\ticonImageAssetId: 67_890,\n\t\tisForSale: true,\n\t\tisImmutable: false,\n\t\tisManagedPricingEnabled: false,\n\t\tpriceInformation: { defaultPriceInRobux: 100, enabledFeatures: [] },\n\t\tproductId: 12_345,\n\t\tuniverseId: 999,\n\t\tupdatedTimestamp: \"2024-03-20T14:45:00.000Z\",\n\t\t...overrides,\n\t};\n}\n","import { ApiError } from \"#src/errors/api-error\";\nimport type { OpenCloudError } from \"#src/errors/base\";\nimport { NetworkError } from \"#src/errors/network-error\";\nimport { RateLimitError } from \"#src/errors/rate-limit\";\nimport type {\n\tHttpClient,\n\tHttpRequest,\n\tHttpResponse,\n\tRequestConfig,\n} from \"#src/internal/http/types\";\nimport type { Result } from \"#src/types\";\n\n/**\n * A request captured by {@link FakeHttpClient} for later assertion.\n */\nexport interface CapturedRequest {\n\t/** The per-request config passed alongside the request. */\n\treadonly config: RequestConfig;\n\t/** The request passed to {@link HttpClient.request}. */\n\treadonly request: HttpRequest;\n}\n\n/**\n * A fluent fake for the {@link HttpClient} boundary. Mocks are queued in\n * FIFO order and consumed by each `request()` call. Records every\n * request and config for later assertion. Throws\n * {@link FakeHttpClientError} if the queue is empty when `request()` is\n * called — surfaces missing mocks as test setup bugs instead of silently\n * repeating the last response.\n */\nexport interface FakeHttpClient extends HttpClient {\n\t/**\n\t * Queues an {@link ApiError} with the given status code and optional\n\t * message/code.\n\t */\n\tmockApiError(options: { code?: string; message?: string; statusCode: number }): this;\n\t/** Queues an error Result with the given error instance. */\n\tmockError(error: OpenCloudError): this;\n\t/** Queues a {@link NetworkError}. Preserves `cause` when provided. */\n\tmockNetworkError(options?: { cause?: unknown; message?: string }): this;\n\t/** Queues a {@link RateLimitError} with the given retry hint. */\n\tmockRateLimit(options: { message?: string; retryAfterSeconds: number }): this;\n\t/**\n\t * Queues a successful {@link HttpResponse}. Body defaults to `{}`; headers\n\t * default to `{}`.\n\t */\n\tmockResponse(options: {\n\t\tbody?: unknown;\n\t\theaders?: Readonly<Record<string, string>>;\n\t\tstatus: number;\n\t}): this;\n\t/** Number of queued mocks that have not yet been consumed. */\n\treadonly pendingMocks: number;\n\t/**\n\t * Chronological log of every `(request, config)` pair the fake received.\n\t */\n\treadonly requests: ReadonlyArray<CapturedRequest>;\n}\n\ntype ErrorResult = Result<HttpResponse, OpenCloudError> & { success: false };\n\ninterface FakeState {\n\treadonly captured: Array<CapturedRequest>;\n\tconsumed: number;\n\treadonly queue: Array<Result<HttpResponse, OpenCloudError>>;\n}\n\n/**\n * Thrown when {@link FakeHttpClient.request} is called but no mock has\n * been queued. The message names the method, url, and consumed count to\n * aid debugging of missing `.mockResponse`/`.mockError` setup.\n */\nexport class FakeHttpClientError extends Error {\n\tpublic override readonly name: string = \"FakeHttpClientError\";\n}\n\n/**\n * Creates a fluent {@link FakeHttpClient} that sits at the\n * {@link HttpClient} seam. Use for integration tests where you need to\n * assert per-request config (credential, baseUrl) flows through to HTTP.\n *\n * @returns A fresh fake with an empty mock queue.\n */\nexport function createFakeHttpClient(): FakeHttpClient {\n\tconst state: FakeState = { captured: [], consumed: 0, queue: [] };\n\tfunction enqueue(result: Result<HttpResponse, OpenCloudError>): FakeHttpClient {\n\t\tstate.queue.push(result);\n\t\treturn fake;\n\t}\n\n\tconst fake: FakeHttpClient = {\n\t\tmockApiError: (options) => enqueue(errorResult(buildApiError(options))),\n\t\tmockError: (error) => enqueue(errorResult(error)),\n\t\tmockNetworkError: (options) => enqueue(errorResult(buildNetworkError(options))),\n\t\tmockRateLimit: (options) => enqueue(errorResult(buildRateLimitError(options))),\n\t\tmockResponse: (options) => enqueue(successResult(options)),\n\t\tget pendingMocks() {\n\t\t\treturn state.queue.length;\n\t\t},\n\t\trequest: async (request, config) => handleRequest({ config, request, state }),\n\t\tget requests() {\n\t\t\treturn state.captured;\n\t\t},\n\t};\n\n\treturn fake;\n}\n\nfunction consumeNextMock(\n\tstate: FakeState,\n\trequest: HttpRequest,\n): Result<HttpResponse, OpenCloudError> {\n\tconst next = state.queue.shift();\n\tif (next === undefined) {\n\t\tthrow new FakeHttpClientError(\n\t\t\t`FakeHttpClient: no mock queued for ${request.method} ${request.url} (consumed ${String(state.consumed)}, pending 0)`,\n\t\t);\n\t}\n\n\tstate.consumed += 1;\n\treturn next;\n}\n\nasync function handleRequest({\n\tconfig,\n\trequest,\n\tstate,\n}: {\n\treadonly config: RequestConfig;\n\treadonly request: HttpRequest;\n\treadonly state: FakeState;\n}): Promise<Result<HttpResponse, OpenCloudError>> {\n\tstate.captured.push({ config, request });\n\t// Resolve on a later microtask, as a real HTTP round trip does.\n\tawait Promise.resolve();\n\treturn consumeNextMock(state, request);\n}\n\nfunction successResult(options: {\n\tbody?: unknown;\n\theaders?: Readonly<Record<string, string>>;\n\tstatus: number;\n}): Result<HttpResponse, OpenCloudError> {\n\treturn {\n\t\tdata: {\n\t\t\tbody: options.body ?? {},\n\t\t\theaders: options.headers ?? {},\n\t\t\tstatus: options.status,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction errorResult(err: OpenCloudError): ErrorResult {\n\treturn { err, success: false };\n}\n\nfunction buildApiError(options: { code?: string; message?: string; statusCode: number }): ApiError {\n\tconst message = options.message ?? \"API error\";\n\tif (options.code === undefined) {\n\t\treturn new ApiError(message, { statusCode: options.statusCode });\n\t}\n\n\treturn new ApiError(message, { code: options.code, statusCode: options.statusCode });\n}\n\nfunction buildNetworkError(\n\toptions: undefined | { cause?: unknown; message?: string },\n): NetworkError {\n\tconst message = options?.message ?? \"Network error\";\n\tif (options?.cause === undefined) {\n\t\treturn new NetworkError(message);\n\t}\n\n\treturn new NetworkError(message, { cause: options.cause });\n}\n\nfunction buildRateLimitError(options: {\n\tmessage?: string;\n\tretryAfterSeconds: number;\n}): RateLimitError {\n\treturn new RateLimitError(options.message ?? \"Rate limited\", {\n\t\tretryAfterSeconds: options.retryAfterSeconds,\n\t});\n}\n","import type { OpenCloudError } from \"#src/errors/base\";\nimport type { HttpRequest, HttpResponse } from \"#src/internal/http/types\";\nimport type { Result } from \"#src/types\";\n\n/**\n * The `send` callback shape consumed by `executeWithRetry`. A plain\n * transport function — no `RequestConfig`, no queueing, no retries.\n */\nexport type SendFunc = (request: HttpRequest) => Promise<Result<HttpResponse, OpenCloudError>>;\n\n/**\n * A scripted fake for the `send` callback. Replays responses in order\n * and records every request it receives.\n */\nexport interface FakeSend {\n\t/** Chronological log of every request the fake received. */\n\treadonly requests: ReadonlyArray<HttpRequest>;\n\t/** The scripted send callback. */\n\treadonly send: SendFunc;\n}\n\n/**\n * Creates a scripted fake for the `send` callback. Each call returns the\n * next queued response; exhausting the queue throws, which surfaces test\n * setup mistakes instead of silently repeating the last response.\n *\n * @param options - The scripted responses to replay, in order.\n * @returns A `send` callback plus a `requests` log.\n * @rejects {Error} When a call is made after all scripted responses are consumed.\n */\nexport function createFakeSend(options: {\n\treadonly responses: ReadonlyArray<Result<HttpResponse, OpenCloudError>>;\n}): FakeSend {\n\tconst requests: Array<HttpRequest> = [];\n\tlet index = 0;\n\n\tasync function send(request: HttpRequest): Promise<Result<HttpResponse, OpenCloudError>> {\n\t\trequests.push(request);\n\t\tconst response = options.responses[index];\n\t\tindex += 1;\n\t\t// Resolve on a later microtask, as a real HTTP round trip does.\n\t\tawait Promise.resolve();\n\n\t\tif (response === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t`createFakeSend exhausted: ${String(index)} calls made, only ${String(options.responses.length)} responses scripted`,\n\t\t\t);\n\t\t}\n\n\t\treturn response;\n\t}\n\n\treturn { requests, send };\n}\n","import type { SleepFunc } from \"#src/internal/utils/sleep\";\n\n/**\n * A directly-callable sleep double that records its wait arguments without\n * delaying. Assignable to {@link SleepFunc}.\n */\nexport interface FakeSleep extends SleepFunc {\n\t/** Chronological log of every `ms` value the fake was called with. */\n\treadonly waits: ReadonlyArray<number>;\n}\n\n/**\n * Creates a {@link FakeSleep} that resolves immediately and records every\n * `ms` value it was called with.\n *\n * @returns A callable sleep function with a `waits` log attached.\n */\nexport function createFakeSleep(): FakeSleep {\n\tconst waits: Array<number> = [];\n\n\tasync function sleep(ms: number): Promise<void> {\n\t\twaits.push(ms);\n\t\t// Resolve on a later microtask, as a real timer-backed sleep does.\n\t\tawait Promise.resolve();\n\t}\n\n\tconst fake: FakeSleep = Object.assign(sleep, {\n\t\tget waits(): ReadonlyArray<number> {\n\t\t\treturn waits;\n\t\t},\n\t});\n\n\treturn fake;\n}\n","import type {\n\tGameIconListWire,\n\tGetGameIconResponseWire,\n} from \"#src/domains/game-internationalization/game-icon/wire\";\n\n/**\n * Builds a minimally-valid {@link GetGameIconResponseWire} entry. Pass an\n * `overrides` object to tweak individual fields while keeping everything\n * else schema-compliant.\n *\n * @param overrides - Fields to override on the default entry.\n * @returns A valid localized-icon entry with the overrides applied.\n */\nexport function validLocalizedIcon(\n\toverrides: Partial<GetGameIconResponseWire> = {},\n): GetGameIconResponseWire {\n\treturn {\n\t\timageId: \"12345\",\n\t\timageUrl: \"https://t1.rbxcdn.com/icon/12345\",\n\t\tlanguageCode: \"en_us\",\n\t\tstate: \"Approved\",\n\t\t...overrides,\n\t};\n}\n\n/**\n * Builds a minimally-valid {@link GameIconListWire} body containing a single\n * default localized icon.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validIconListBody(overrides: Partial<GameIconListWire> = {}): GameIconListWire {\n\treturn {\n\t\tdata: [validLocalizedIcon()],\n\t\t...overrides,\n\t};\n}\n","import type { GamePassConfigV2 } from \"#src/domains/game-passes/game-passes/wire\";\n\n/**\n * Test-only wire shape for the list response. Mirrors the OpenAPI\n * schema, which marks `nextPageToken` as required and nullable, so\n * fixtures can carry the literal JSON `null` the API sends on the last\n * page without leaking `null` into the production wire type (which\n * exposes a post-normalization view of `string | undefined`).\n */\ninterface ListGamePassesWireBody {\n\treadonly gamePasses: ReadonlyArray<GamePassConfigV2>;\n\n\treadonly nextPageToken: null | string;\n}\n\n/**\n * Builds a minimally-valid {@link GamePassConfigV2} wire body. Pass an\n * `overrides` object to tweak individual fields while keeping everything\n * else schema-compliant — useful for parser and integration tests that\n * only care about one field at a time.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validGamePassBody(overrides: Partial<GamePassConfigV2> = {}): GamePassConfigV2 {\n\treturn {\n\t\tname: \"Epic Pass\",\n\t\tcreatedTimestamp: \"2024-01-15T10:30:00.000Z\",\n\t\tdescription: \"Unlocks epic stuff\",\n\t\tgamePassId: 12_345,\n\t\ticonAssetId: 67_890,\n\t\tisForSale: true,\n\t\tisManagedPricingEnabled: false,\n\t\tpriceInformation: { defaultPriceInRobux: 100, enabledFeatures: [] },\n\t\tupdatedTimestamp: \"2024-03-20T14:45:00.000Z\",\n\t\t...overrides,\n\t};\n}\n\n/**\n * Builds a minimally-valid wire body for the \"list game passes\" endpoint.\n * By default the page contains one game pass and `nextPageToken` is the\n * literal JSON `null` the API sends on the last page; `overrides` let\n * parser and integration tests tweak the items array or the cursor\n * without rebuilding the whole shape.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied. `nextPageToken`\n * defaults to the wire's literal `null`, which the response parser\n * normalizes to `undefined` at the boundary.\n */\nexport function validListGamePassesBody(\n\toverrides: Partial<ListGamePassesWireBody> = {},\n): ListGamePassesWireBody {\n\treturn {\n\t\tgamePasses: [validGamePassBody()],\n\t\t// eslint-disable-next-line unicorn/no-null -- API sends null on the last page; parser normalizes to undefined.\n\t\tnextPageToken: null,\n\t\t...overrides,\n\t};\n}\n","import type { GameThumbnailUploadWire } from \"#src/domains/game-internationalization/game-thumbnails/wire\";\n\n/**\n * Builds a minimally-valid {@link GameThumbnailUploadWire} body. Pass an\n * `overrides` object to tweak individual fields while keeping everything\n * else schema-compliant; useful for parser and integration tests that\n * only care about one field at a time.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validThumbnailUploadBody(\n\toverrides: Partial<GameThumbnailUploadWire> = {},\n): GameThumbnailUploadWire {\n\treturn { mediaAssetId: \"67890\", ...overrides };\n}\n","import type { LuauExecutionTaskBinaryInputWire } from \"#src/domains/cloud-v2/luau-execution-task-binary-inputs/wire\";\n\n/**\n * Builds a minimally-valid {@link LuauExecutionTaskBinaryInputWire} body\n * for tests. Pass an `overrides` object to tweak fields without re-stating\n * the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validBinaryInputBody(\n\toverrides: Partial<LuauExecutionTaskBinaryInputWire> = {},\n): LuauExecutionTaskBinaryInputWire {\n\treturn {\n\t\tpath: \"universes/123/luau-execution-session-task-binary-inputs/abc\",\n\t\tuploadUri: \"https://storage.example.com/upload?token=xyz\",\n\t\t...overrides,\n\t};\n}\n","import type { ListLogsResponseWire } from \"#src/domains/cloud-v2/luau-execution-task-logs/wire\";\n\n/**\n * Builds a minimally-valid {@link ListLogsResponseWire} body containing\n * one chunk with one structured message. Pass an `overrides` object to\n * tweak fields without re-stating the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validLogPageBody(\n\toverrides: Partial<ListLogsResponseWire> = {},\n): ListLogsResponseWire {\n\treturn {\n\t\tluauExecutionSessionTaskLogs: [\n\t\t\t{\n\t\t\t\tstructuredMessages: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcreateTime: \"2026-01-01T00:00:00Z\",\n\t\t\t\t\t\tmessage: \"Hello from Luau\",\n\t\t\t\t\t\tmessageType: \"OUTPUT\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t\t...overrides,\n\t};\n}\n","import type { LuauExecutionTaskWire } from \"#src/domains/cloud-v2/luau-execution-tasks/wire\";\n\n/**\n * Builds a minimally-valid {@link LuauExecutionTaskWire} body for an\n * in-progress task. Pass an `overrides` object to tweak fields without\n * re-stating the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validInProgressTaskBody(\n\toverrides: Partial<LuauExecutionTaskWire> = {},\n): LuauExecutionTaskWire {\n\treturn {\n\t\tcreateTime: \"2026-01-01T00:00:00Z\",\n\t\tpath: \"universes/123/places/456/luau-execution-session-tasks/task-1\",\n\t\tstate: \"QUEUED\",\n\t\tupdateTime: \"2026-01-01T00:00:30Z\",\n\t\tuser: \"user-1\",\n\t\t...overrides,\n\t};\n}\n","import type {\n\tMemoryStoreQueueItemWire,\n\tReadQueueItemsResponseWire,\n} from \"#src/domains/cloud-v2/memory-store-queues/wire\";\n\n/**\n * Builds a minimally-valid {@link MemoryStoreQueueItemWire} body. Pass\n * an `overrides` object to tweak fields without re-stating the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validQueueItemBody(\n\toverrides: Partial<MemoryStoreQueueItemWire> = {},\n): MemoryStoreQueueItemWire {\n\treturn {\n\t\tdata: \"hello\",\n\t\texpireTime: \"2026-06-21T15:08:58.4806559Z\",\n\t\tpath: \"cloud/v2/universes/123/memory-store/queues/test-queue/items/abc123\",\n\t\tpriority: 1,\n\t\t...overrides,\n\t};\n}\n\n/**\n * Builds a minimally-valid {@link ReadQueueItemsResponseWire} body\n * carrying a single default queue item. Pass an `overrides` object to\n * change the read identifier or supply a different items array.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid dequeue response body with the overrides applied.\n */\nexport function validDequeueBody(\n\toverrides: Partial<ReadQueueItemsResponseWire> = {},\n): ReadQueueItemsResponseWire {\n\treturn {\n\t\tid: \"1a354bd5b8fe457f8e51232f8dbfe6d0\",\n\t\tqueueItems: [validQueueItemBody()],\n\t\t...overrides,\n\t};\n}\n","import type { PlaceWire } from \"#src/domains/cloud-v2/places/wire\";\nimport { RBXL_SIGNATURE, RBXLX_SIGNATURE } from \"#src/domains/universes/places/signatures\";\nimport type { PlaceVersionWire } from \"#src/domains/universes/places/wire\";\n\n/**\n * Returns a fresh, minimal `.rbxl`-formatted body whose magic bytes\n * match {@link RBXL_SIGNATURE}. Useful when integration tests don't\n * care about the file's contents past the signature.\n *\n * @returns A 14-byte rbxl body matching the binary signature.\n */\nexport function rbxlBody(): Uint8Array<ArrayBuffer> {\n\treturn new Uint8Array(RBXL_SIGNATURE);\n}\n\n/**\n * Returns a fresh, minimal `.rbxlx`-formatted body whose magic bytes\n * match {@link RBXLX_SIGNATURE}. Useful when integration tests don't\n * care about the file's contents past the signature.\n *\n * @returns An 8-byte rbxlx body matching the XML signature.\n */\nexport function rbxlxBody(): Uint8Array<ArrayBuffer> {\n\treturn new Uint8Array(RBXLX_SIGNATURE);\n}\n\n/**\n * Builds a minimally-valid {@link PlaceVersionWire} body. Pass an\n * `overrides` object to tweak fields without re-stating the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validPublishResponseBody(\n\toverrides: Partial<PlaceVersionWire> = {},\n): PlaceVersionWire {\n\treturn {\n\t\tversionNumber: 1,\n\t\t...overrides,\n\t};\n}\n\n/**\n * Builds a minimally-valid {@link PlaceWire} body. Pass an `overrides`\n * object to tweak fields without re-stating the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validPlaceBody(overrides: Partial<PlaceWire> = {}): PlaceWire {\n\treturn {\n\t\tcreateTime: \"2024-01-15T10:30:00.000Z\",\n\t\tdescription: \"A sample place.\",\n\t\tdisplayName: \"Test Place\",\n\t\tpath: \"universes/123/places/456\",\n\t\troot: true,\n\t\tserverSize: 30,\n\t\tuniverseRuntimeCreation: false,\n\t\tupdateTime: \"2024-11-02T17:08:21.500Z\",\n\t\t...overrides,\n\t};\n}\n","import type { UniverseWire } from \"#src/domains/cloud-v2/universes/wire\";\n\n/**\n * Builds a minimally-valid {@link UniverseWire} body. Pass an\n * `overrides` object to tweak fields without re-stating the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validUniverseBody(overrides: Partial<UniverseWire> = {}): UniverseWire {\n\treturn {\n\t\tageRating: \"AGE_RATING_13_PLUS\",\n\t\tconsoleEnabled: false,\n\t\tcreateTime: \"2024-01-15T10:30:00.000Z\",\n\t\tdescription: \"A sample universe for tests.\",\n\t\tdesktopEnabled: true,\n\t\tdisplayName: \"Test Universe\",\n\t\tmobileEnabled: true,\n\t\tpath: \"universes/12345\",\n\t\trootPlace: \"universes/12345/places/98765\",\n\t\ttabletEnabled: true,\n\t\tupdateTime: \"2024-11-02T17:08:21.500Z\",\n\t\tuser: \"users/7777\",\n\t\tvisibility: \"PUBLIC\",\n\t\tvoiceChatEnabled: false,\n\t\tvrEnabled: false,\n\t\t...overrides,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,eAAe,YAA0C,CAAC,GAAwB;CACjG,OAAO;EACN,IAAI;EACJ,MAAM;EACN,SAAS;GAAE,IAAI;GAAK,MAAM;GAAS,MAAM;EAAQ;EACjD,SAAS;EACT,aAAa;EACb,oBAAoB;EACpB,oBAAoB;EACpB,aAAa;EACb,SAAS;EACT,aAAa;EACb,YAAY;GAAE,cAAc;GAAK,qBAAqB;GAAG,mBAAmB;EAAK;EACjF,SAAS;EACT,GAAG;CACJ;AACD;;;;;;;;;;;;AChBA,SAAgB,0BACf,YAA+C,CAAC,GACrB;CAC3B,OAAO;EACN,MAAM;EACN,kBAAkB;EAClB,aAAa;EACb,kBAAkB;EAClB,WAAW;EACX,aAAa;EACb,yBAAyB;EACzB,kBAAkB;GAAE,qBAAqB;GAAK,iBAAiB,CAAC;EAAE;EAClE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,GAAG;CACJ;AACD;;;;;;;;AC4CA,IAAa,sBAAb,cAAyC,MAAM;CAC9C,OAAwC;AACzC;;;;;;;;AASA,SAAgB,uBAAuC;CACtD,MAAM,QAAmB;EAAE,UAAU,CAAC;EAAG,UAAU;EAAG,OAAO,CAAC;CAAE;CAChE,SAAS,QAAQ,QAA8D;EAC9E,MAAM,MAAM,KAAK,MAAM;EACvB,OAAO;CACR;CAEA,MAAM,OAAuB;EAC5B,eAAe,YAAY,QAAQ,YAAY,cAAc,OAAO,CAAC,CAAC;EACtE,YAAY,UAAU,QAAQ,YAAY,KAAK,CAAC;EAChD,mBAAmB,YAAY,QAAQ,YAAY,kBAAkB,OAAO,CAA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,GAAG;CACJ;AACD;;;;;;;;;;ACpDA,SAAgB,kBAAkB,YAAmC,CAAC,GAAiB;CACtF,OAAO;EACN,WAAW;EACX,gBAAgB;EAChB,YAAY;EACZ,aAAa;EACb,gBAAgB;EAChB,aAAa;EACb,eAAe;EACf,MAAM;EACN,WAAW;EACX,eAAe;EACf,YAAY;EACZ,MAAM;EACN,YAAY;EACZ,kBAAkB;EAClB,WAAW;EACX,GAAG;CACJ;AACD"}
|
|
1
|
+
{"version":3,"file":"testing.mjs","names":[],"sources":["../tests/helpers/badges.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","../tests/helpers/game-passes.ts","../tests/helpers/game-thumbnails.ts","../tests/helpers/luau-execution-task-binary-inputs.ts","../tests/helpers/luau-execution-task-logs.ts","../tests/helpers/luau-execution-tasks.ts","../tests/helpers/memory-store-queues.ts","../tests/helpers/places.ts","../tests/helpers/universes.ts"],"sourcesContent":["import type { BadgeResponseV2Wire, BadgeResponseWire } from \"#src/domains/badges/badges/wire\";\n\n/**\n * Builds a minimally-valid {@link BadgeResponseV2Wire} body. Pass an\n * `overrides` object to tweak individual fields while keeping everything\n * else schema-compliant; useful for parser and integration tests that\n * only care about one field at a time.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validBadgeBody(overrides: Partial<BadgeResponseV2Wire> = {}): BadgeResponseV2Wire {\n\treturn {\n\t\tid: 12_345,\n\t\tname: \"First Goal\",\n\t\tawarder: { id: 222, name: \"Lobby\", type: \"Place\" },\n\t\tcreated: \"2024-01-15T10:30:00.000Z\",\n\t\tdescription: \"Awarded on first login.\",\n\t\tdisplayDescription: \"Awarded on first login.\",\n\t\tdisplayIconImageId: 67_890,\n\t\tdisplayName: \"First Goal\",\n\t\tenabled: true,\n\t\ticonImageId: 67_890,\n\t\tstatistics: { awardedCount: 100, pastDayAwardedCount: 5, winRatePercentage: 42.5 },\n\t\tupdated: \"2024-03-20T14:45:00.000Z\",\n\t\t...overrides,\n\t};\n}\n\n/**\n * Builds a valid badge read body, as sent by the unauthenticated badge get and\n * list endpoints.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validBadgeDetailsBody(\n\toverrides: Partial<BadgeResponseWire> = {},\n): BadgeResponseWire {\n\tconst { awarder: _awarder, ...shared } = validBadgeBody();\n\treturn {\n\t\t...shared,\n\t\tawardingUniverse: { id: 999, name: \"Lobby Game\", rootPlaceId: 222 },\n\t\t...overrides,\n\t};\n}\n","import type { DeveloperProductConfigV2 } from \"#src/domains/developer-products/products/wire\";\n\n/**\n * Builds a minimally-valid {@link DeveloperProductConfigV2} wire body. Pass\n * an `overrides` object to tweak individual fields while keeping everything\n * else schema-compliant; useful for parser and integration tests that\n * only care about one field at a time.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validDeveloperProductBody(\n\toverrides: Partial<DeveloperProductConfigV2> = {},\n): DeveloperProductConfigV2 {\n\treturn {\n\t\tname: \"Gem Pack\",\n\t\tcreatedTimestamp: \"2024-01-15T10:30:00.000Z\",\n\t\tdescription: \"A premium gem pack\",\n\t\ticonImageAssetId: 67_890,\n\t\tisForSale: true,\n\t\tisImmutable: false,\n\t\tisManagedPricingEnabled: false,\n\t\tpriceInformation: { defaultPriceInRobux: 100, enabledFeatures: [] },\n\t\tproductId: 12_345,\n\t\tuniverseId: 999,\n\t\tupdatedTimestamp: \"2024-03-20T14:45:00.000Z\",\n\t\t...overrides,\n\t};\n}\n","import { ApiError } from \"#src/errors/api-error\";\nimport type { OpenCloudError } from \"#src/errors/base\";\nimport { NetworkError } from \"#src/errors/network-error\";\nimport { RateLimitError } from \"#src/errors/rate-limit\";\nimport type {\n\tHttpClient,\n\tHttpRequest,\n\tHttpResponse,\n\tRequestConfig,\n} from \"#src/internal/http/types\";\nimport type { Result } from \"#src/types\";\n\n/**\n * A request captured by {@link FakeHttpClient} for later assertion.\n */\nexport interface CapturedRequest {\n\t/** The per-request config passed alongside the request. */\n\treadonly config: RequestConfig;\n\t/** The request passed to {@link HttpClient.request}. */\n\treadonly request: HttpRequest;\n}\n\n/**\n * A fluent fake for the {@link HttpClient} boundary. Mocks are queued in\n * FIFO order and consumed by each `request()` call. Records every\n * request and config for later assertion. Throws\n * {@link FakeHttpClientError} if the queue is empty when `request()` is\n * called — surfaces missing mocks as test setup bugs instead of silently\n * repeating the last response.\n */\nexport interface FakeHttpClient extends HttpClient {\n\t/**\n\t * Queues an {@link ApiError} with the given status code and optional\n\t * message/code.\n\t */\n\tmockApiError(options: { code?: string; message?: string; statusCode: number }): this;\n\t/** Queues an error Result with the given error instance. */\n\tmockError(error: OpenCloudError): this;\n\t/** Queues a {@link NetworkError}. Preserves `cause` when provided. */\n\tmockNetworkError(options?: { cause?: unknown; message?: string }): this;\n\t/** Queues a {@link RateLimitError} with the given retry hint. */\n\tmockRateLimit(options: { message?: string; retryAfterSeconds: number }): this;\n\t/**\n\t * Queues a successful {@link HttpResponse}. Body defaults to `{}`; headers\n\t * default to `{}`.\n\t */\n\tmockResponse(options: {\n\t\tbody?: unknown;\n\t\theaders?: Readonly<Record<string, string>>;\n\t\tstatus: number;\n\t}): this;\n\t/** Number of queued mocks that have not yet been consumed. */\n\treadonly pendingMocks: number;\n\t/**\n\t * Chronological log of every `(request, config)` pair the fake received.\n\t */\n\treadonly requests: ReadonlyArray<CapturedRequest>;\n}\n\ntype ErrorResult = Result<HttpResponse, OpenCloudError> & { success: false };\n\ninterface FakeState {\n\treadonly captured: Array<CapturedRequest>;\n\tconsumed: number;\n\treadonly queue: Array<Result<HttpResponse, OpenCloudError>>;\n}\n\n/**\n * Thrown when {@link FakeHttpClient.request} is called but no mock has\n * been queued. The message names the method, url, and consumed count to\n * aid debugging of missing `.mockResponse`/`.mockError` setup.\n */\nexport class FakeHttpClientError extends Error {\n\tpublic override readonly name: string = \"FakeHttpClientError\";\n}\n\n/**\n * Creates a fluent {@link FakeHttpClient} that sits at the\n * {@link HttpClient} seam. Use for integration tests where you need to\n * assert per-request config (credential, baseUrl) flows through to HTTP.\n *\n * @returns A fresh fake with an empty mock queue.\n */\nexport function createFakeHttpClient(): FakeHttpClient {\n\tconst state: FakeState = { captured: [], consumed: 0, queue: [] };\n\tfunction enqueue(result: Result<HttpResponse, OpenCloudError>): FakeHttpClient {\n\t\tstate.queue.push(result);\n\t\treturn fake;\n\t}\n\n\tconst fake: FakeHttpClient = {\n\t\tmockApiError: (options) => enqueue(errorResult(buildApiError(options))),\n\t\tmockError: (error) => enqueue(errorResult(error)),\n\t\tmockNetworkError: (options) => enqueue(errorResult(buildNetworkError(options))),\n\t\tmockRateLimit: (options) => enqueue(errorResult(buildRateLimitError(options))),\n\t\tmockResponse: (options) => enqueue(successResult(options)),\n\t\tget pendingMocks() {\n\t\t\treturn state.queue.length;\n\t\t},\n\t\trequest: async (request, config) => handleRequest({ config, request, state }),\n\t\tget requests() {\n\t\t\treturn state.captured;\n\t\t},\n\t};\n\n\treturn fake;\n}\n\nfunction consumeNextMock(\n\tstate: FakeState,\n\trequest: HttpRequest,\n): Result<HttpResponse, OpenCloudError> {\n\tconst next = state.queue.shift();\n\tif (next === undefined) {\n\t\tthrow new FakeHttpClientError(\n\t\t\t`FakeHttpClient: no mock queued for ${request.method} ${request.url} (consumed ${String(state.consumed)}, pending 0)`,\n\t\t);\n\t}\n\n\tstate.consumed += 1;\n\treturn next;\n}\n\nasync function handleRequest({\n\tconfig,\n\trequest,\n\tstate,\n}: {\n\treadonly config: RequestConfig;\n\treadonly request: HttpRequest;\n\treadonly state: FakeState;\n}): Promise<Result<HttpResponse, OpenCloudError>> {\n\tstate.captured.push({ config, request });\n\t// Resolve on a later microtask, as a real HTTP round trip does.\n\tawait Promise.resolve();\n\treturn consumeNextMock(state, request);\n}\n\nfunction successResult(options: {\n\tbody?: unknown;\n\theaders?: Readonly<Record<string, string>>;\n\tstatus: number;\n}): Result<HttpResponse, OpenCloudError> {\n\treturn {\n\t\tdata: {\n\t\t\tbody: options.body ?? {},\n\t\t\theaders: options.headers ?? {},\n\t\t\tstatus: options.status,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction errorResult(err: OpenCloudError): ErrorResult {\n\treturn { err, success: false };\n}\n\nfunction buildApiError(options: { code?: string; message?: string; statusCode: number }): ApiError {\n\tconst message = options.message ?? \"API error\";\n\tif (options.code === undefined) {\n\t\treturn new ApiError(message, { statusCode: options.statusCode });\n\t}\n\n\treturn new ApiError(message, { code: options.code, statusCode: options.statusCode });\n}\n\nfunction buildNetworkError(\n\toptions: undefined | { cause?: unknown; message?: string },\n): NetworkError {\n\tconst message = options?.message ?? \"Network error\";\n\tif (options?.cause === undefined) {\n\t\treturn new NetworkError(message);\n\t}\n\n\treturn new NetworkError(message, { cause: options.cause });\n}\n\nfunction buildRateLimitError(options: {\n\tmessage?: string;\n\tretryAfterSeconds: number;\n}): RateLimitError {\n\treturn new RateLimitError(options.message ?? \"Rate limited\", {\n\t\tretryAfterSeconds: options.retryAfterSeconds,\n\t});\n}\n","import type { OpenCloudError } from \"#src/errors/base\";\nimport type { HttpRequest, HttpResponse } from \"#src/internal/http/types\";\nimport type { Result } from \"#src/types\";\n\n/**\n * The `send` callback shape consumed by `executeWithRetry`. A plain\n * transport function — no `RequestConfig`, no queueing, no retries.\n */\nexport type SendFunc = (request: HttpRequest) => Promise<Result<HttpResponse, OpenCloudError>>;\n\n/**\n * A scripted fake for the `send` callback. Replays responses in order\n * and records every request it receives.\n */\nexport interface FakeSend {\n\t/** Chronological log of every request the fake received. */\n\treadonly requests: ReadonlyArray<HttpRequest>;\n\t/** The scripted send callback. */\n\treadonly send: SendFunc;\n}\n\n/**\n * Creates a scripted fake for the `send` callback. Each call returns the\n * next queued response; exhausting the queue throws, which surfaces test\n * setup mistakes instead of silently repeating the last response.\n *\n * @param options - The scripted responses to replay, in order.\n * @returns A `send` callback plus a `requests` log.\n * @rejects {Error} When a call is made after all scripted responses are consumed.\n */\nexport function createFakeSend(options: {\n\treadonly responses: ReadonlyArray<Result<HttpResponse, OpenCloudError>>;\n}): FakeSend {\n\tconst requests: Array<HttpRequest> = [];\n\tlet index = 0;\n\n\tasync function send(request: HttpRequest): Promise<Result<HttpResponse, OpenCloudError>> {\n\t\trequests.push(request);\n\t\tconst response = options.responses[index];\n\t\tindex += 1;\n\t\t// Resolve on a later microtask, as a real HTTP round trip does.\n\t\tawait Promise.resolve();\n\n\t\tif (response === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t`createFakeSend exhausted: ${String(index)} calls made, only ${String(options.responses.length)} responses scripted`,\n\t\t\t);\n\t\t}\n\n\t\treturn response;\n\t}\n\n\treturn { requests, send };\n}\n","import type { SleepFunc } from \"#src/internal/utils/sleep\";\n\n/**\n * A directly-callable sleep double that records its wait arguments without\n * delaying. Assignable to {@link SleepFunc}.\n */\nexport interface FakeSleep extends SleepFunc {\n\t/** Chronological log of every `ms` value the fake was called with. */\n\treadonly waits: ReadonlyArray<number>;\n}\n\n/**\n * Creates a {@link FakeSleep} that resolves immediately and records every\n * `ms` value it was called with.\n *\n * @returns A callable sleep function with a `waits` log attached.\n */\nexport function createFakeSleep(): FakeSleep {\n\tconst waits: Array<number> = [];\n\n\tasync function sleep(ms: number): Promise<void> {\n\t\twaits.push(ms);\n\t\t// Resolve on a later microtask, as a real timer-backed sleep does.\n\t\tawait Promise.resolve();\n\t}\n\n\tconst fake: FakeSleep = Object.assign(sleep, {\n\t\tget waits(): ReadonlyArray<number> {\n\t\t\treturn waits;\n\t\t},\n\t});\n\n\treturn fake;\n}\n","import type {\n\tGameIconListWire,\n\tGetGameIconResponseWire,\n} from \"#src/domains/game-internationalization/game-icon/wire\";\n\n/**\n * Builds a minimally-valid {@link GetGameIconResponseWire} entry. Pass an\n * `overrides` object to tweak individual fields while keeping everything\n * else schema-compliant.\n *\n * @param overrides - Fields to override on the default entry.\n * @returns A valid localized-icon entry with the overrides applied.\n */\nexport function validLocalizedIcon(\n\toverrides: Partial<GetGameIconResponseWire> = {},\n): GetGameIconResponseWire {\n\treturn {\n\t\timageId: \"12345\",\n\t\timageUrl: \"https://t1.rbxcdn.com/icon/12345\",\n\t\tlanguageCode: \"en_us\",\n\t\tstate: \"Approved\",\n\t\t...overrides,\n\t};\n}\n\n/**\n * Builds a minimally-valid {@link GameIconListWire} body containing a single\n * default localized icon.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validIconListBody(overrides: Partial<GameIconListWire> = {}): GameIconListWire {\n\treturn {\n\t\tdata: [validLocalizedIcon()],\n\t\t...overrides,\n\t};\n}\n","import type { GamePassConfigV2 } from \"#src/domains/game-passes/game-passes/wire\";\n\n/**\n * Test-only wire shape for the list response. Mirrors the OpenAPI\n * schema, which marks `nextPageToken` as required and nullable, so\n * fixtures can carry the literal JSON `null` the API sends on the last\n * page without leaking `null` into the production wire type (which\n * exposes a post-normalization view of `string | undefined`).\n */\ninterface ListGamePassesWireBody {\n\treadonly gamePasses: ReadonlyArray<GamePassConfigV2>;\n\n\treadonly nextPageToken: null | string;\n}\n\n/**\n * Builds a minimally-valid {@link GamePassConfigV2} wire body. Pass an\n * `overrides` object to tweak individual fields while keeping everything\n * else schema-compliant — useful for parser and integration tests that\n * only care about one field at a time.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validGamePassBody(overrides: Partial<GamePassConfigV2> = {}): GamePassConfigV2 {\n\treturn {\n\t\tname: \"Epic Pass\",\n\t\tcreatedTimestamp: \"2024-01-15T10:30:00.000Z\",\n\t\tdescription: \"Unlocks epic stuff\",\n\t\tgamePassId: 12_345,\n\t\ticonAssetId: 67_890,\n\t\tisForSale: true,\n\t\tisManagedPricingEnabled: false,\n\t\tpriceInformation: { defaultPriceInRobux: 100, enabledFeatures: [] },\n\t\tupdatedTimestamp: \"2024-03-20T14:45:00.000Z\",\n\t\t...overrides,\n\t};\n}\n\n/**\n * Builds a minimally-valid wire body for the \"list game passes\" endpoint.\n * By default the page contains one game pass and `nextPageToken` is the\n * literal JSON `null` the API sends on the last page; `overrides` let\n * parser and integration tests tweak the items array or the cursor\n * without rebuilding the whole shape.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied. `nextPageToken`\n * defaults to the wire's literal `null`, which the response parser\n * normalizes to `undefined` at the boundary.\n */\nexport function validListGamePassesBody(\n\toverrides: Partial<ListGamePassesWireBody> = {},\n): ListGamePassesWireBody {\n\treturn {\n\t\tgamePasses: [validGamePassBody()],\n\t\t// eslint-disable-next-line unicorn/no-null -- API sends null on the last page; parser normalizes to undefined.\n\t\tnextPageToken: null,\n\t\t...overrides,\n\t};\n}\n","import type { GameThumbnailUploadWire } from \"#src/domains/game-internationalization/game-thumbnails/wire\";\n\n/**\n * Builds a minimally-valid {@link GameThumbnailUploadWire} body. Pass an\n * `overrides` object to tweak individual fields while keeping everything\n * else schema-compliant; useful for parser and integration tests that\n * only care about one field at a time.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validThumbnailUploadBody(\n\toverrides: Partial<GameThumbnailUploadWire> = {},\n): GameThumbnailUploadWire {\n\treturn { mediaAssetId: \"67890\", ...overrides };\n}\n","import type { LuauExecutionTaskBinaryInputWire } from \"#src/domains/cloud-v2/luau-execution-task-binary-inputs/wire\";\n\n/**\n * Builds a minimally-valid {@link LuauExecutionTaskBinaryInputWire} body\n * for tests. Pass an `overrides` object to tweak fields without re-stating\n * the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validBinaryInputBody(\n\toverrides: Partial<LuauExecutionTaskBinaryInputWire> = {},\n): LuauExecutionTaskBinaryInputWire {\n\treturn {\n\t\tpath: \"universes/123/luau-execution-session-task-binary-inputs/abc\",\n\t\tuploadUri: \"https://storage.example.com/upload?token=xyz\",\n\t\t...overrides,\n\t};\n}\n","import type { ListLogsResponseWire } from \"#src/domains/cloud-v2/luau-execution-task-logs/wire\";\n\n/**\n * Builds a minimally-valid {@link ListLogsResponseWire} body containing\n * one chunk with one structured message. Pass an `overrides` object to\n * tweak fields without re-stating the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validLogPageBody(\n\toverrides: Partial<ListLogsResponseWire> = {},\n): ListLogsResponseWire {\n\treturn {\n\t\tluauExecutionSessionTaskLogs: [\n\t\t\t{\n\t\t\t\tstructuredMessages: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcreateTime: \"2026-01-01T00:00:00Z\",\n\t\t\t\t\t\tmessage: \"Hello from Luau\",\n\t\t\t\t\t\tmessageType: \"OUTPUT\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t\t...overrides,\n\t};\n}\n","import type { LuauExecutionTaskWire } from \"#src/domains/cloud-v2/luau-execution-tasks/wire\";\n\n/**\n * Builds a minimally-valid {@link LuauExecutionTaskWire} body for an\n * in-progress task. Pass an `overrides` object to tweak fields without\n * re-stating the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validInProgressTaskBody(\n\toverrides: Partial<LuauExecutionTaskWire> = {},\n): LuauExecutionTaskWire {\n\treturn {\n\t\tcreateTime: \"2026-01-01T00:00:00Z\",\n\t\tpath: \"universes/123/places/456/luau-execution-session-tasks/task-1\",\n\t\tstate: \"QUEUED\",\n\t\tupdateTime: \"2026-01-01T00:00:30Z\",\n\t\tuser: \"user-1\",\n\t\t...overrides,\n\t};\n}\n","import type {\n\tMemoryStoreQueueItemWire,\n\tReadQueueItemsResponseWire,\n} from \"#src/domains/cloud-v2/memory-store-queues/wire\";\n\n/**\n * Builds a minimally-valid {@link MemoryStoreQueueItemWire} body. Pass\n * an `overrides` object to tweak fields without re-stating the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validQueueItemBody(\n\toverrides: Partial<MemoryStoreQueueItemWire> = {},\n): MemoryStoreQueueItemWire {\n\treturn {\n\t\tdata: \"hello\",\n\t\texpireTime: \"2026-06-21T15:08:58.4806559Z\",\n\t\tpath: \"cloud/v2/universes/123/memory-store/queues/test-queue/items/abc123\",\n\t\tpriority: 1,\n\t\t...overrides,\n\t};\n}\n\n/**\n * Builds a minimally-valid {@link ReadQueueItemsResponseWire} body\n * carrying a single default queue item. Pass an `overrides` object to\n * change the read identifier or supply a different items array.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid dequeue response body with the overrides applied.\n */\nexport function validDequeueBody(\n\toverrides: Partial<ReadQueueItemsResponseWire> = {},\n): ReadQueueItemsResponseWire {\n\treturn {\n\t\tid: \"1a354bd5b8fe457f8e51232f8dbfe6d0\",\n\t\tqueueItems: [validQueueItemBody()],\n\t\t...overrides,\n\t};\n}\n","import type { PlaceWire } from \"#src/domains/cloud-v2/places/wire\";\nimport { RBXL_SIGNATURE, RBXLX_SIGNATURE } from \"#src/domains/universes/places/signatures\";\nimport type { PlaceVersionWire } from \"#src/domains/universes/places/wire\";\n\n/**\n * Returns a fresh, minimal `.rbxl`-formatted body whose magic bytes\n * match {@link RBXL_SIGNATURE}. Useful when integration tests don't\n * care about the file's contents past the signature.\n *\n * @returns A 14-byte rbxl body matching the binary signature.\n */\nexport function rbxlBody(): Uint8Array<ArrayBuffer> {\n\treturn new Uint8Array(RBXL_SIGNATURE);\n}\n\n/**\n * Returns a fresh, minimal `.rbxlx`-formatted body whose magic bytes\n * match {@link RBXLX_SIGNATURE}. Useful when integration tests don't\n * care about the file's contents past the signature.\n *\n * @returns An 8-byte rbxlx body matching the XML signature.\n */\nexport function rbxlxBody(): Uint8Array<ArrayBuffer> {\n\treturn new Uint8Array(RBXLX_SIGNATURE);\n}\n\n/**\n * Builds a minimally-valid {@link PlaceVersionWire} body. Pass an\n * `overrides` object to tweak fields without re-stating the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validPublishResponseBody(\n\toverrides: Partial<PlaceVersionWire> = {},\n): PlaceVersionWire {\n\treturn {\n\t\tversionNumber: 1,\n\t\t...overrides,\n\t};\n}\n\n/**\n * Builds a minimally-valid {@link PlaceWire} body. Pass an `overrides`\n * object to tweak fields without re-stating the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validPlaceBody(overrides: Partial<PlaceWire> = {}): PlaceWire {\n\treturn {\n\t\tcreateTime: \"2024-01-15T10:30:00.000Z\",\n\t\tdescription: \"A sample place.\",\n\t\tdisplayName: \"Test Place\",\n\t\tpath: \"universes/123/places/456\",\n\t\troot: true,\n\t\tserverSize: 30,\n\t\tuniverseRuntimeCreation: false,\n\t\tupdateTime: \"2024-11-02T17:08:21.500Z\",\n\t\t...overrides,\n\t};\n}\n","import type { UniverseWire } from \"#src/domains/cloud-v2/universes/wire\";\n\n/**\n * Builds a minimally-valid {@link UniverseWire} body. Pass an\n * `overrides` object to tweak fields without re-stating the defaults.\n *\n * @param overrides - Fields to override on the default body.\n * @returns A valid wire body with the overrides applied.\n */\nexport function validUniverseBody(overrides: Partial<UniverseWire> = {}): UniverseWire {\n\treturn {\n\t\tageRating: \"AGE_RATING_13_PLUS\",\n\t\tconsoleEnabled: false,\n\t\tcreateTime: \"2024-01-15T10:30:00.000Z\",\n\t\tdescription: \"A sample universe for tests.\",\n\t\tdesktopEnabled: true,\n\t\tdisplayName: \"Test Universe\",\n\t\tmobileEnabled: true,\n\t\tpath: \"universes/12345\",\n\t\trootPlace: \"universes/12345/places/98765\",\n\t\ttabletEnabled: true,\n\t\tupdateTime: \"2024-11-02T17:08:21.500Z\",\n\t\tuser: \"users/7777\",\n\t\tvisibility: \"PUBLIC\",\n\t\tvoiceChatEnabled: false,\n\t\tvrEnabled: false,\n\t\t...overrides,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,eAAe,YAA0C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@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/utils/to-blob.ts
|
|
2
2
|
/**
|
|
3
3
|
* Wraps a binary value as a {@link Blob}, copying `Uint8Array` input into a
|
|
4
4
|
* fresh `Blob` so the originating buffer cannot be mutated between request
|
|
@@ -12,7 +12,6 @@ function toBlob(value) {
|
|
|
12
12
|
if (value instanceof Blob) return value;
|
|
13
13
|
return new Blob([new Uint8Array(value)]);
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { toBlob as t };
|
|
17
16
|
|
|
18
|
-
//# sourceMappingURL=to-blob-
|
|
17
|
+
//# sourceMappingURL=to-blob-Bqu7bmlE.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-blob-
|
|
1
|
+
{"version":3,"file":"to-blob-Bqu7bmlE.mjs","names":[],"sources":["../src/internal/utils/to-blob.ts"],"sourcesContent":["/**\n * Wraps a binary value as a {@link Blob}, copying `Uint8Array` input into a\n * fresh `Blob` so the originating buffer cannot be mutated between request\n * build and send. `Blob` input is returned as-is so MIME-type metadata is\n * preserved.\n *\n * @param value - Binary data to convert.\n * @returns The supplied `Blob`, or a new `Blob` wrapping a defensive copy.\n */\nexport function toBlob(value: Blob | Uint8Array): Blob {\n\tif (value instanceof Blob) {\n\t\treturn value;\n\t}\n\n\treturn new Blob([new Uint8Array(value)]);\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,OAAO,OAAgC;CACtD,IAAI,iBAAiB,MACpB,OAAO;CAGR,OAAO,IAAI,KAAK,CAAC,IAAI,WAAW,KAAK,CAAC,CAAC;AACxC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/errors/base.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Options for constructing an {@link OpenCloudError}.
|
|
4
3
|
*
|
|
@@ -63,16 +62,12 @@ declare class OpenCloudError extends Error {
|
|
|
63
62
|
*/
|
|
64
63
|
get previousAttempts(): ReadonlyArray<OpenCloudError>;
|
|
65
64
|
}
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region src/internal/utils/sleep.d.ts
|
|
68
65
|
/**
|
|
69
66
|
* Injectable sleep function signature for testing.
|
|
70
67
|
*
|
|
71
68
|
* @since 0.1.0
|
|
72
69
|
*/
|
|
73
70
|
type SleepFunc = (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/types.d.ts
|
|
76
71
|
/**
|
|
77
72
|
* Discriminated union for explicit error handling.
|
|
78
73
|
*
|
|
@@ -150,8 +145,6 @@ interface Page<T> {
|
|
|
150
145
|
/** Cursor for the next page; `undefined` on the last page. */
|
|
151
146
|
readonly nextPageToken: string | undefined;
|
|
152
147
|
}
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region src/client/types.d.ts
|
|
155
148
|
/**
|
|
156
149
|
* Why a logical request is waiting for SDK-managed admission.
|
|
157
150
|
*
|
|
@@ -504,6 +497,5 @@ type RequestOptions = Partial<Pick<OpenCloudClientOptions, "baseUrl" | "credenti
|
|
|
504
497
|
* - `undefined` for requests without a body (GET, DELETE).
|
|
505
498
|
*/
|
|
506
499
|
type HttpRequestBody = FormData | Record<string, unknown> | Uint8Array<ArrayBuffer> | undefined;
|
|
507
|
-
//#endregion
|
|
508
500
|
export { OpenCloudErrorOptions as _, HttpClient as a, OpenCloudClientOptions as c, RequestOptions as d, ResolvedCredential as f, OpenCloudError as g, SleepFunc as h, Credential as i, OpenCloudHooks as l, Result as m, AdmissionWaitObserver as n, HttpRequest as o, Page as p, AdmissionWaitReason as r, HttpResponse as s, AdmissionWaitEvent as t, RequestConfig as u };
|
|
509
|
-
//# sourceMappingURL=types-
|
|
501
|
+
//# sourceMappingURL=types-Z4abDJfK.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-Z4abDJfK.d.mts","names":[],"sources":["../src/errors/base.ts","../src/internal/utils/sleep.ts","../src/types.ts","../src/client/types.ts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