@bedrock-rbx/ocale 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/dist/badge-cost-mismatch-DrlvhlQc.mjs +47 -0
- package/dist/badge-cost-mismatch-DrlvhlQc.mjs.map +1 -0
- package/dist/badges.d.mts +228 -184
- package/dist/badges.d.mts.map +1 -1
- package/dist/badges.mjs +176 -18
- package/dist/badges.mjs.map +1 -1
- package/dist/capacity-admission-hycCFkTo.d.mts +355 -0
- package/dist/capacity-admission-hycCFkTo.d.mts.map +1 -0
- package/dist/{data.generated-B2ceLfSn.d.mts → data.generated-D_vpa5-g.d.mts} +23 -23
- package/dist/data.generated-D_vpa5-g.d.mts.map +1 -0
- package/dist/developer-products.d.mts +181 -186
- package/dist/developer-products.d.mts.map +1 -1
- package/dist/developer-products.mjs +24 -24
- package/dist/developer-products.mjs.map +1 -1
- package/dist/game-passes.d.mts +206 -203
- package/dist/game-passes.d.mts.map +1 -1
- package/dist/game-passes.mjs +26 -21
- package/dist/game-passes.mjs.map +1 -1
- package/dist/index.d.mts +905 -343
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +325 -10
- package/dist/index.mjs.map +1 -1
- package/dist/locales.d.mts +30 -2
- package/dist/locales.d.mts.map +1 -0
- package/dist/locales.mjs +24 -1
- package/dist/locales.mjs.map +1 -1
- package/dist/luau-execution.d.mts +154 -151
- package/dist/luau-execution.d.mts.map +1 -1
- package/dist/luau-execution.mjs +11 -8
- package/dist/luau-execution.mjs.map +1 -1
- package/dist/{network-error-DR9FX5hb.mjs → network-error-iVSng5MT.mjs} +44 -6
- package/dist/network-error-iVSng5MT.mjs.map +1 -0
- package/dist/places.d.mts +204 -180
- package/dist/places.d.mts.map +1 -1
- package/dist/places.mjs +66 -20
- package/dist/places.mjs.map +1 -1
- package/dist/{poll-timeout-3PXLsabj.mjs → poll-timeout-DzztDymd.mjs} +2 -2
- package/dist/{poll-timeout-3PXLsabj.mjs.map → poll-timeout-DzztDymd.mjs.map} +1 -1
- package/dist/{polling-helpers-CoVhsC33.mjs → polling-helpers-DfF5dspc.mjs} +249 -83
- package/dist/polling-helpers-DfF5dspc.mjs.map +1 -0
- package/dist/{price-information-B0tkOoAX.mjs → price-information-DEkEQ8Pq.mjs} +2 -2
- package/dist/{price-information-B0tkOoAX.mjs.map → price-information-DEkEQ8Pq.mjs.map} +1 -1
- package/dist/resource-client-BCKukheG.d.mts +168 -0
- package/dist/resource-client-BCKukheG.d.mts.map +1 -0
- package/dist/{resource-client-rqTMkBeR.mjs → resource-client-CaIVr-go.mjs} +586 -158
- package/dist/resource-client-CaIVr-go.mjs.map +1 -0
- package/dist/retry-C2oHesDx.d.mts +229 -0
- package/dist/retry-C2oHesDx.d.mts.map +1 -0
- package/dist/{retry-BlX4tUnT.mjs → retry-CMRDvAR4.mjs} +278 -18
- package/dist/retry-CMRDvAR4.mjs.map +1 -0
- package/dist/storage.d.mts +333 -334
- package/dist/storage.d.mts.map +1 -1
- package/dist/storage.mjs +29 -22
- package/dist/storage.mjs.map +1 -1
- package/dist/testing.d.mts +347 -360
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +3 -4
- package/dist/testing.mjs.map +1 -1
- package/dist/types-CdMr_J1M.d.mts +509 -0
- package/dist/types-CdMr_J1M.d.mts.map +1 -0
- package/dist/universes.d.mts +619 -422
- package/dist/universes.d.mts.map +1 -1
- package/dist/universes.mjs +421 -48
- package/dist/universes.mjs.map +1 -1
- package/dist/{validation-B_Zs1So2.mjs → validation-964VNlbp.mjs} +2 -2
- package/dist/{validation-B_Zs1So2.mjs.map → validation-964VNlbp.mjs.map} +1 -1
- package/dist/wire-DJqupefn.d.mts +41 -0
- package/dist/wire-DJqupefn.d.mts.map +1 -0
- package/package.json +14 -14
- package/dist/capacity-admission-IDO3fcUC.d.mts +0 -369
- package/dist/capacity-admission-IDO3fcUC.d.mts.map +0 -1
- package/dist/data.generated-B2ceLfSn.d.mts.map +0 -1
- package/dist/network-error-DR9FX5hb.mjs.map +0 -1
- package/dist/polling-helpers-CoVhsC33.mjs.map +0 -1
- package/dist/resource-client-B6NeFXUv.d.mts +0 -164
- package/dist/resource-client-B6NeFXUv.d.mts.map +0 -1
- package/dist/resource-client-rqTMkBeR.mjs.map +0 -1
- package/dist/retry-BlX4tUnT.mjs.map +0 -1
- package/dist/retry-war_-9tb.d.mts +0 -373
- package/dist/retry-war_-9tb.d.mts.map +0 -1
- package/dist/types-CvYh4SPC.d.mts +0 -386
- package/dist/types-CvYh4SPC.d.mts.map +0 -1
- package/dist/wire-D3K-a-UP.d.mts +0 -37
- package/dist/wire-D3K-a-UP.d.mts.map +0 -1
package/dist/universes.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universes.d.mts","names":[],"sources":["../src/domains/cloud-v2/universes/types.ts","../src/domains/game-internationalization/game-icon/types.ts","../src/domains/game-internationalization/game-thumbnails/types.ts","../src/domains/server-management/restarts/types.ts","../src/resources/universes/restarts-group.ts","../src/resources/universes/client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"universes.d.mts","names":[],"sources":["../src/domains/cloud-v2/universes/types.ts","../src/domains/develop/universes/types.ts","../src/domains/game-internationalization/game-icon/types.ts","../src/domains/game-internationalization/game-thumbnails/types.ts","../src/domains/server-management/restarts/types.ts","../src/resources/universes/restarts-group.ts","../src/resources/universes/client.ts"],"mappings":"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"}
|
package/dist/universes.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as ApiError } from "./network-error-
|
|
2
|
-
import { r as IDEMPOTENT_METHOD_DEFAULTS, t as CREATE_METHOD_DEFAULTS } from "./retry-
|
|
3
|
-
import { t as ValidationError } from "./validation-
|
|
1
|
+
import { a as ApiError, o as requestContextOf } from "./network-error-iVSng5MT.mjs";
|
|
2
|
+
import { j as isRecord, m as UnexpectedResponseError, r as IDEMPOTENT_METHOD_DEFAULTS, t as CREATE_METHOD_DEFAULTS } from "./retry-CMRDvAR4.mjs";
|
|
3
|
+
import { t as ValidationError } from "./validation-964VNlbp.mjs";
|
|
4
4
|
import { t as toBlob } from "./to-blob-RPqMBuft.mjs";
|
|
5
|
-
import { c as isDateTimeString, n as okRequest,
|
|
5
|
+
import { c as isDateTimeString, n as okRequest, r as parseEmptyResponse, s as toJsonDetails, t as ResourceClient } from "./resource-client-CaIVr-go.mjs";
|
|
6
6
|
//#region src/internal/utils/positive-integer-id.ts
|
|
7
7
|
const POSITIVE_INTEGER_PATTERN = /^[1-9]\d*$/;
|
|
8
8
|
/**
|
|
@@ -16,10 +16,13 @@ const POSITIVE_INTEGER_PATTERN = /^[1-9]\d*$/;
|
|
|
16
16
|
*/
|
|
17
17
|
function parsePositiveIntegerIds(ids, { code, field }) {
|
|
18
18
|
const invalid = ids.find((id) => parsePositiveIntegerId(id) === void 0);
|
|
19
|
-
if (invalid !== void 0)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
if (invalid !== void 0) {
|
|
20
|
+
const message = `${field} entry ${JSON.stringify(invalid)} is not a positive integer ID`;
|
|
21
|
+
return {
|
|
22
|
+
err: new ValidationError(message, { code }),
|
|
23
|
+
success: false
|
|
24
|
+
};
|
|
25
|
+
}
|
|
23
26
|
return {
|
|
24
27
|
data: ids.map(Number),
|
|
25
28
|
success: true
|
|
@@ -200,7 +203,8 @@ const OWNER_PATH_PATTERN = /^(?:users|groups)\/(\d+)$/;
|
|
|
200
203
|
*
|
|
201
204
|
* @param response - The full {@link HttpResponse} from the Open Cloud API.
|
|
202
205
|
* @returns A success result wrapping the parsed {@link Universe}, or
|
|
203
|
-
* an {@link
|
|
206
|
+
* an {@link UnexpectedResponseError} when the body does not match the wire
|
|
207
|
+
* schema.
|
|
204
208
|
*/
|
|
205
209
|
function parseUniverseResponse({ body, status: statusCode }) {
|
|
206
210
|
if (!isUniverseWire(body)) return malformed$1(statusCode, body);
|
|
@@ -219,7 +223,7 @@ function parseUniverseResponse({ body, status: statusCode }) {
|
|
|
219
223
|
}
|
|
220
224
|
function malformed$1(statusCode, body) {
|
|
221
225
|
return {
|
|
222
|
-
err: new
|
|
226
|
+
err: new UnexpectedResponseError(MALFORMED_MESSAGE, {
|
|
223
227
|
details: toJsonDetails(body),
|
|
224
228
|
statusCode
|
|
225
229
|
}),
|
|
@@ -374,12 +378,13 @@ function buildListIconsRequest(parameters) {
|
|
|
374
378
|
//#endregion
|
|
375
379
|
//#region src/domains/game-internationalization/game-icon/operations.ts
|
|
376
380
|
/**
|
|
377
|
-
* Per-second request ceiling for
|
|
378
|
-
* `UniversesClient.icon
|
|
379
|
-
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
*
|
|
381
|
+
* Per-second request ceiling for game-icon Operations on
|
|
382
|
+
* `UniversesClient.icon`, from each operation's
|
|
383
|
+
* `x-roblox-rate-limits.perApiKeyOwner` in the vendored schema (100 requests
|
|
384
|
+
* per minute). This family's key stays separate from other
|
|
385
|
+
* game-internationalization families: the #587 probe measured independent
|
|
386
|
+
* reported 100/minute counters. Successful writes may have additional service
|
|
387
|
+
* limits; see `docs/spikes/game-internationalization-rate-limits/README.md`.
|
|
383
388
|
*/
|
|
384
389
|
const ICON_OPERATION_LIMIT = Object.freeze({
|
|
385
390
|
maxPerSecond: 100 / 60,
|
|
@@ -399,11 +404,11 @@ const ICON_REQUIRED_SCOPES = Object.freeze(["legacy-universe:manage"]);
|
|
|
399
404
|
*
|
|
400
405
|
* @param response - The full {@link HttpResponse} from the Open Cloud API.
|
|
401
406
|
* @returns A success result wrapping the converted icon list, or an
|
|
402
|
-
* `
|
|
407
|
+
* `UnexpectedResponseError` when the body does not match the wire schema.
|
|
403
408
|
*/
|
|
404
409
|
function parseIconListResponse({ body, status: statusCode }) {
|
|
405
410
|
if (!isGameIconListWire(body)) return {
|
|
406
|
-
err: new
|
|
411
|
+
err: new UnexpectedResponseError("Malformed icon list response", {
|
|
407
412
|
details: toJsonDetails(body),
|
|
408
413
|
statusCode
|
|
409
414
|
}),
|
|
@@ -419,7 +424,7 @@ function isGameIconState(value) {
|
|
|
419
424
|
}
|
|
420
425
|
function isGetGameIconResponseWire(value) {
|
|
421
426
|
if (!isRecord(value)) return false;
|
|
422
|
-
return typeof value["imageId"] === "string" && typeof value["imageUrl"] === "string" && typeof value["languageCode"] === "string" && isGameIconState(value["state"]);
|
|
427
|
+
return (value["imageId"] === null || typeof value["imageId"] === "string") && typeof value["imageUrl"] === "string" && typeof value["languageCode"] === "string" && isGameIconState(value["state"]);
|
|
423
428
|
}
|
|
424
429
|
function isGameIconListWire(body) {
|
|
425
430
|
if (!isRecord(body)) return false;
|
|
@@ -429,7 +434,7 @@ function isGameIconListWire(body) {
|
|
|
429
434
|
}
|
|
430
435
|
function toExperienceIcon(wire) {
|
|
431
436
|
return {
|
|
432
|
-
imageId: wire.imageId,
|
|
437
|
+
imageId: wire.imageId ?? void 0,
|
|
433
438
|
imageUrl: wire.imageUrl,
|
|
434
439
|
languageCode: wire.languageCode,
|
|
435
440
|
state: wire.state
|
|
@@ -502,12 +507,14 @@ function parseOrderedImageIds(orderedImageIds) {
|
|
|
502
507
|
//#endregion
|
|
503
508
|
//#region src/domains/game-internationalization/game-thumbnails/operations.ts
|
|
504
509
|
/**
|
|
505
|
-
* Per-second request ceiling for
|
|
506
|
-
* `UniversesClient.thumbnails
|
|
507
|
-
*
|
|
508
|
-
*
|
|
509
|
-
*
|
|
510
|
-
*
|
|
510
|
+
* Per-second request ceiling for game-thumbnails Operations on
|
|
511
|
+
* `UniversesClient.thumbnails`, from each operation's
|
|
512
|
+
* `x-roblox-rate-limits.perApiKeyOwner` in the vendored schema (100 requests
|
|
513
|
+
* per minute). This family's key stays separate from other
|
|
514
|
+
* game-internationalization families: the #587 probe measured independent
|
|
515
|
+
* reported 100/minute counters on rejected requests. Successful writes may
|
|
516
|
+
* have additional service limits; see
|
|
517
|
+
* `docs/spikes/game-internationalization-rate-limits/README.md`.
|
|
511
518
|
*/
|
|
512
519
|
const THUMBNAILS_OPERATION_LIMIT = Object.freeze({
|
|
513
520
|
maxPerSecond: 100 / 60,
|
|
@@ -528,11 +535,11 @@ const THUMBNAILS_REQUIRED_SCOPES = Object.freeze(["legacy-universe:manage"]);
|
|
|
528
535
|
*
|
|
529
536
|
* @param response - The full {@link HttpResponse} from the Open Cloud API.
|
|
530
537
|
* @returns A success result wrapping the converted upload, or an
|
|
531
|
-
* `
|
|
538
|
+
* `UnexpectedResponseError` when the body does not match the wire schema.
|
|
532
539
|
*/
|
|
533
540
|
function parseThumbnailUploadResponse({ body, status: statusCode }) {
|
|
534
541
|
if (!isGameThumbnailUploadWire(body)) return {
|
|
535
|
-
err: new
|
|
542
|
+
err: new UnexpectedResponseError("Malformed thumbnail upload response", {
|
|
536
543
|
details: toJsonDetails(body),
|
|
537
544
|
statusCode
|
|
538
545
|
}),
|
|
@@ -548,6 +555,126 @@ function isGameThumbnailUploadWire(body) {
|
|
|
548
555
|
return typeof body["mediaAssetId"] === "string";
|
|
549
556
|
}
|
|
550
557
|
//#endregion
|
|
558
|
+
//#region src/domains/develop/universes/builders.ts
|
|
559
|
+
/**
|
|
560
|
+
* Builds the Open Cloud experience activation request.
|
|
561
|
+
* @param parameters - The universe identifier.
|
|
562
|
+
* @returns The POST request wrapped in a success Result.
|
|
563
|
+
*/
|
|
564
|
+
function buildActivateRequest(parameters) {
|
|
565
|
+
return okRequest({
|
|
566
|
+
method: "POST",
|
|
567
|
+
url: `/legacy-develop/v1/universes/${parameters.universeId}/activate`
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Builds the Open Cloud experience deactivation request.
|
|
572
|
+
* @param parameters - The universe identifier.
|
|
573
|
+
* @returns The POST request wrapped in a success Result.
|
|
574
|
+
*/
|
|
575
|
+
function buildDeactivateRequest(parameters) {
|
|
576
|
+
return okRequest({
|
|
577
|
+
method: "POST",
|
|
578
|
+
url: `/legacy-develop/v1/universes/${parameters.universeId}/deactivate`
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
//#endregion
|
|
582
|
+
//#region src/domains/develop/universes/operations.ts
|
|
583
|
+
/**
|
|
584
|
+
* OpenAPI specifies 100 requests per minute per API key owner or OAuth
|
|
585
|
+
* authorization.
|
|
586
|
+
*/
|
|
587
|
+
const ACTIVATE_OPERATION_LIMIT = Object.freeze({
|
|
588
|
+
maxPerSecond: 100 / 60,
|
|
589
|
+
operationKey: "universes.activate"
|
|
590
|
+
});
|
|
591
|
+
/**
|
|
592
|
+
* OpenAPI specifies 100 requests per minute per API key owner or OAuth
|
|
593
|
+
* authorization.
|
|
594
|
+
*/
|
|
595
|
+
const DEACTIVATE_OPERATION_LIMIT = Object.freeze({
|
|
596
|
+
maxPerSecond: 100 / 60,
|
|
597
|
+
operationKey: "universes.deactivate"
|
|
598
|
+
});
|
|
599
|
+
/** Required scope declared by both experience visibility operations. */
|
|
600
|
+
const ACTIVATION_REQUIRED_SCOPES = Object.freeze(["legacy-universe:manage"]);
|
|
601
|
+
//#endregion
|
|
602
|
+
//#region src/resources/universes/activation-specs.ts
|
|
603
|
+
const GET_SPEC = Object.freeze({
|
|
604
|
+
buildRequest: buildGetRequest,
|
|
605
|
+
methodDefaults: {},
|
|
606
|
+
methodKind: "idempotent",
|
|
607
|
+
operationLimit: GET_OPERATION_LIMIT,
|
|
608
|
+
parse: parseUniverseResponse
|
|
609
|
+
});
|
|
610
|
+
const ACTIVATE_SPEC = Object.freeze({
|
|
611
|
+
buildRequest: buildActivateRequest,
|
|
612
|
+
methodDefaults: CREATE_METHOD_DEFAULTS,
|
|
613
|
+
methodKind: "create",
|
|
614
|
+
operationLimit: ACTIVATE_OPERATION_LIMIT,
|
|
615
|
+
parse: parseEmptyResponse,
|
|
616
|
+
requiredScopes: ACTIVATION_REQUIRED_SCOPES
|
|
617
|
+
});
|
|
618
|
+
const DEACTIVATE_SPEC = Object.freeze({
|
|
619
|
+
buildRequest: buildDeactivateRequest,
|
|
620
|
+
methodDefaults: CREATE_METHOD_DEFAULTS,
|
|
621
|
+
methodKind: "create",
|
|
622
|
+
operationLimit: DEACTIVATE_OPERATION_LIMIT,
|
|
623
|
+
parse: parseEmptyResponse,
|
|
624
|
+
requiredScopes: ACTIVATION_REQUIRED_SCOPES
|
|
625
|
+
});
|
|
626
|
+
//#endregion
|
|
627
|
+
//#region src/resources/universes/activation-error.ts
|
|
628
|
+
/**
|
|
629
|
+
* Adds the known eligibility explanation without diagnosing a missing rating.
|
|
630
|
+
*
|
|
631
|
+
* @param err - The activation attempt's transport error.
|
|
632
|
+
* @returns An error retaining the original request and response evidence.
|
|
633
|
+
*/
|
|
634
|
+
function explainActivationError(err) {
|
|
635
|
+
if (!(err instanceof ApiError) || err.statusCode !== 403) return err;
|
|
636
|
+
const code = err.code ?? (isRecord(err.details) ? err.details["code"] : void 0);
|
|
637
|
+
if (code !== 3 && code !== "3") return err;
|
|
638
|
+
return new ApiError(`${err.message} A missing content maturity rating is a possible cause; complete the content questionnaire in Creator Hub.`, {
|
|
639
|
+
...requestContextOf(err),
|
|
640
|
+
cause: err,
|
|
641
|
+
code: err.code,
|
|
642
|
+
details: err.details,
|
|
643
|
+
statusCode: err.statusCode
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
//#endregion
|
|
647
|
+
//#region src/resources/universes/activation.ts
|
|
648
|
+
/**
|
|
649
|
+
* Changes visibility and verifies an ambiguous gateway timeout through a read.
|
|
650
|
+
* @param inner - The universe client's shared request pipeline.
|
|
651
|
+
* @param call - The universe, desired visibility and request overrides.
|
|
652
|
+
* @returns A success only when the write or verification confirms it.
|
|
653
|
+
*/
|
|
654
|
+
async function setVisibilityAsync(inner, { options, parameters, visibility }) {
|
|
655
|
+
const activating = visibility === "public";
|
|
656
|
+
const result = await inner.executeAsync({
|
|
657
|
+
options: {
|
|
658
|
+
...options,
|
|
659
|
+
retryableStatuses: options?.retryableStatuses?.filter((status) => status !== 504) ?? CREATE_METHOD_DEFAULTS.retryableStatuses
|
|
660
|
+
},
|
|
661
|
+
parameters,
|
|
662
|
+
refineError: activating ? explainActivationError : void 0,
|
|
663
|
+
spec: activating ? ACTIVATE_SPEC : DEACTIVATE_SPEC
|
|
664
|
+
});
|
|
665
|
+
if (result.success || !(result.err instanceof ApiError) || result.err.statusCode !== 504) return result;
|
|
666
|
+
const observed = await inner.executeAsync({
|
|
667
|
+
options,
|
|
668
|
+
parameters,
|
|
669
|
+
spec: GET_SPEC
|
|
670
|
+
});
|
|
671
|
+
if (observed.success && observed.data.visibility === visibility) return {
|
|
672
|
+
data: void 0,
|
|
673
|
+
success: true
|
|
674
|
+
};
|
|
675
|
+
return result;
|
|
676
|
+
}
|
|
677
|
+
//#endregion
|
|
551
678
|
//#region src/domains/server-management/restarts/builders.ts
|
|
552
679
|
/**
|
|
553
680
|
* Builds a `GET` request for the server-management restart forecast.
|
|
@@ -631,7 +758,7 @@ const LIST_OPERATION_LIMIT = Object.freeze({
|
|
|
631
758
|
});
|
|
632
759
|
//#endregion
|
|
633
760
|
//#region src/domains/server-management/restarts/parsers.ts
|
|
634
|
-
const RESTART_STATES = new Set([
|
|
761
|
+
const RESTART_STATES = /* @__PURE__ */ new Set([
|
|
635
762
|
"DELAYING",
|
|
636
763
|
"RESTARTING",
|
|
637
764
|
"SUCCEEDED"
|
|
@@ -643,7 +770,7 @@ const NIL_RESTART_ID = "00000000-0000-0000-0000-000000000000";
|
|
|
643
770
|
* {@link PlaceRestartForecast} per place.
|
|
644
771
|
*
|
|
645
772
|
* @param response - The full {@link HttpResponse} from the Open Cloud API.
|
|
646
|
-
* @returns A success result wrapping the forecasts, or an {@link
|
|
773
|
+
* @returns A success result wrapping the forecasts, or an {@link UnexpectedResponseError}
|
|
647
774
|
* when the body does not match the wire schema.
|
|
648
775
|
*/
|
|
649
776
|
function parseForecastResponse({ body, status: statusCode }) {
|
|
@@ -663,7 +790,8 @@ function parseForecastResponse({ body, status: statusCode }) {
|
|
|
663
790
|
*
|
|
664
791
|
* @param response - The full {@link HttpResponse} from the Open Cloud API.
|
|
665
792
|
* @returns A success result wrapping the launched restart, or an
|
|
666
|
-
* {@link
|
|
793
|
+
* {@link UnexpectedResponseError} when the body does not match the wire
|
|
794
|
+
* schema.
|
|
667
795
|
*/
|
|
668
796
|
function parseLaunchResponse({ body, status: statusCode }) {
|
|
669
797
|
if (!isLaunchWire(body)) return malformed("Malformed restart launch response", {
|
|
@@ -684,7 +812,7 @@ function parseLaunchResponse({ body, status: statusCode }) {
|
|
|
684
812
|
* {@link RestartStatus} per restart.
|
|
685
813
|
*
|
|
686
814
|
* @param response - The full {@link HttpResponse} from the Open Cloud API.
|
|
687
|
-
* @returns A success result wrapping the restarts, or an {@link
|
|
815
|
+
* @returns A success result wrapping the restarts, or an {@link UnexpectedResponseError}
|
|
688
816
|
* when the body does not match the wire schema.
|
|
689
817
|
*/
|
|
690
818
|
function parseListResponse({ body, status: statusCode }) {
|
|
@@ -701,7 +829,7 @@ function parseListResponse({ body, status: statusCode }) {
|
|
|
701
829
|
}
|
|
702
830
|
function malformed(message, { body, statusCode }) {
|
|
703
831
|
return {
|
|
704
|
-
err: new
|
|
832
|
+
err: new UnexpectedResponseError(message, {
|
|
705
833
|
details: toJsonDetails(body),
|
|
706
834
|
statusCode
|
|
707
835
|
}),
|
|
@@ -801,6 +929,49 @@ function isListWire(body) {
|
|
|
801
929
|
return isRecord(body) && isOptionalRecordOf(body["restartStatuses"], isRestartStatusWire);
|
|
802
930
|
}
|
|
803
931
|
//#endregion
|
|
932
|
+
//#region src/domains/server-management/restarts/select-outdated.ts
|
|
933
|
+
/**
|
|
934
|
+
* Selects the requested places whose forecast counts outdated servers. A
|
|
935
|
+
* place missing from the forecast has no live server and counts 0. A
|
|
936
|
+
* repeated place ID counts once, at its first position.
|
|
937
|
+
*
|
|
938
|
+
* @param placeIds - The requested place IDs.
|
|
939
|
+
* @param forecasts - The universe's restart forecast.
|
|
940
|
+
* @returns Each requested place with its outdated server count, and the
|
|
941
|
+
* places to restart.
|
|
942
|
+
*/
|
|
943
|
+
function selectOutdatedPlaces(placeIds, forecasts) {
|
|
944
|
+
const impacted = new Map(forecasts.map((forecast) => [forecast.placeId, forecast.instancesImpacted]));
|
|
945
|
+
const places = Array.from(new Set(placeIds), (placeId) => {
|
|
946
|
+
return {
|
|
947
|
+
instancesImpacted: impacted.get(placeId) ?? 0,
|
|
948
|
+
placeId
|
|
949
|
+
};
|
|
950
|
+
});
|
|
951
|
+
return {
|
|
952
|
+
placeIds: places.filter(({ instancesImpacted }) => instancesImpacted > 0).map(({ placeId }) => placeId),
|
|
953
|
+
places
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Builds the per-place outcome of a restart of `selection.placeIds`.
|
|
958
|
+
*
|
|
959
|
+
* @param selection - The selection that drove the final decision.
|
|
960
|
+
* @param restarted - Whether the restart call for the selection succeeded.
|
|
961
|
+
* @returns The outcome, with only the selected places marked restarted.
|
|
962
|
+
*/
|
|
963
|
+
function summarizeOutdatedRestart(selection, restarted) {
|
|
964
|
+
return {
|
|
965
|
+
places: selection.places.map((place) => {
|
|
966
|
+
return {
|
|
967
|
+
...place,
|
|
968
|
+
restarted: restarted && place.instancesImpacted > 0
|
|
969
|
+
};
|
|
970
|
+
}),
|
|
971
|
+
restarted
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
//#endregion
|
|
804
975
|
//#region src/resources/universes/restarts-group.ts
|
|
805
976
|
function makeSpec(spec) {
|
|
806
977
|
return Object.freeze(spec);
|
|
@@ -821,6 +992,22 @@ const LAUNCH_SPEC = makeSpec({
|
|
|
821
992
|
parse: parseLaunchResponse,
|
|
822
993
|
requiredScopes: LAUNCH_REQUIRED_SCOPES
|
|
823
994
|
});
|
|
995
|
+
const RESTART_OUTDATED_SPEC = makeSpec({
|
|
996
|
+
buildRequest: buildRestartServersRequest,
|
|
997
|
+
methodDefaults: Object.freeze({
|
|
998
|
+
retryableStatuses: Object.freeze([
|
|
999
|
+
429,
|
|
1000
|
+
502,
|
|
1001
|
+
503,
|
|
1002
|
+
504
|
|
1003
|
+
]),
|
|
1004
|
+
retryableTransportCodes: IDEMPOTENT_METHOD_DEFAULTS.retryableTransportCodes
|
|
1005
|
+
}),
|
|
1006
|
+
methodKind: "create",
|
|
1007
|
+
operationLimit: RESTART_OPERATION_LIMIT,
|
|
1008
|
+
parse: parseEmptyResponse,
|
|
1009
|
+
requiredScopes: RESTART_REQUIRED_SCOPES
|
|
1010
|
+
});
|
|
824
1011
|
const LIST_SPEC = makeSpec({
|
|
825
1012
|
buildRequest: buildListRequest,
|
|
826
1013
|
methodDefaults: IDEMPOTENT_METHOD_DEFAULTS,
|
|
@@ -831,8 +1018,9 @@ const LIST_SPEC = makeSpec({
|
|
|
831
1018
|
});
|
|
832
1019
|
/**
|
|
833
1020
|
* Operation Group on `UniversesClient` that exposes the server-management
|
|
834
|
-
* restart endpoints: preview a restart, launch one, and track it.
|
|
835
|
-
*
|
|
1021
|
+
* restart endpoints: preview a restart, launch one, and track it. Its
|
|
1022
|
+
* `restartOutdated` also uses the universe `:restartServers` method. The
|
|
1023
|
+
* server-management endpoints are BETA on the Roblox side.
|
|
836
1024
|
*/
|
|
837
1025
|
var UniverseRestartsGroup = class {
|
|
838
1026
|
#inner;
|
|
@@ -882,7 +1070,10 @@ var UniverseRestartsGroup = class {
|
|
|
882
1070
|
* },
|
|
883
1071
|
* status: 200,
|
|
884
1072
|
* });
|
|
885
|
-
* const client = new UniversesClient({
|
|
1073
|
+
* const client = new UniversesClient({
|
|
1074
|
+
* credential: { apiKey: "your-key", kind: "apiKey" },
|
|
1075
|
+
* httpClient,
|
|
1076
|
+
* });
|
|
886
1077
|
*
|
|
887
1078
|
* return client.restarts
|
|
888
1079
|
* .launch({ bleedOffDurationMinutes: 5, universeId: "42" })
|
|
@@ -924,16 +1115,127 @@ var UniverseRestartsGroup = class {
|
|
|
924
1115
|
spec: LIST_SPEC
|
|
925
1116
|
});
|
|
926
1117
|
}
|
|
1118
|
+
/**
|
|
1119
|
+
* Restarts only the servers that run an older version of the given
|
|
1120
|
+
* places, for example after a publish. It reads the forecast
|
|
1121
|
+
* (`universe:read`), keeps each place with at least one outdated
|
|
1122
|
+
* server, and sends one `:restartServers` call (`universe:write`) for
|
|
1123
|
+
* them. When no place has an outdated server, it sends no restart.
|
|
1124
|
+
*
|
|
1125
|
+
* Roblox answers a 500 when any listed place has no live server, which
|
|
1126
|
+
* happens when a place loses its last outdated server between the
|
|
1127
|
+
* forecast and the restart. On that 500 it reads the forecast once more
|
|
1128
|
+
* and sends one more restart for the places still outdated. A 502, 503
|
|
1129
|
+
* or 504 on the restart is retried. The selection relies on the
|
|
1130
|
+
* forecast's `instancesImpacted` counting only servers on an older
|
|
1131
|
+
* version, which live captures show but Roblox does not document.
|
|
1132
|
+
*
|
|
1133
|
+
* @example
|
|
1134
|
+
* ```ts
|
|
1135
|
+
* import { createFakeHttpClient } from "@bedrock-rbx/ocale/testing";
|
|
1136
|
+
* import { UniversesClient } from "@bedrock-rbx/ocale/universes";
|
|
1137
|
+
*
|
|
1138
|
+
* const httpClient = createFakeHttpClient()
|
|
1139
|
+
* .mockResponse({
|
|
1140
|
+
* body: {
|
|
1141
|
+
* placeForecasts: {
|
|
1142
|
+
* 111: {
|
|
1143
|
+
* instancesImpacted: 2,
|
|
1144
|
+
* instancesPerVersion: { 5: 2, 6: 1 },
|
|
1145
|
+
* isNotInUniverse: false,
|
|
1146
|
+
* latestPlaceVersion: "6",
|
|
1147
|
+
* playersImpacted: 4,
|
|
1148
|
+
* playersPerVersion: { 5: 4, 6: 1 },
|
|
1149
|
+
* publishTime: "2026-04-24T02:36:28.673Z",
|
|
1150
|
+
* totalInstances: 3,
|
|
1151
|
+
* totalPlayers: 5,
|
|
1152
|
+
* },
|
|
1153
|
+
* },
|
|
1154
|
+
* },
|
|
1155
|
+
* status: 200,
|
|
1156
|
+
* })
|
|
1157
|
+
* .mockResponse({ body: {}, status: 200 });
|
|
1158
|
+
* const client = new UniversesClient({
|
|
1159
|
+
* credential: { apiKey: "your-key", kind: "apiKey" },
|
|
1160
|
+
* httpClient,
|
|
1161
|
+
* });
|
|
1162
|
+
*
|
|
1163
|
+
* return client.restarts
|
|
1164
|
+
* .restartOutdated({ placeIds: ["111", "222"], universeId: "42" })
|
|
1165
|
+
* .then((result) => {
|
|
1166
|
+
* expect(result).toEqual({
|
|
1167
|
+
* data: {
|
|
1168
|
+
* places: [
|
|
1169
|
+
* { instancesImpacted: 2, placeId: "111", restarted: true },
|
|
1170
|
+
* { instancesImpacted: 0, placeId: "222", restarted: false },
|
|
1171
|
+
* ],
|
|
1172
|
+
* restarted: true,
|
|
1173
|
+
* },
|
|
1174
|
+
* success: true,
|
|
1175
|
+
* });
|
|
1176
|
+
* });
|
|
1177
|
+
* ```
|
|
1178
|
+
*
|
|
1179
|
+
* @param parameters - The universe and the places to check.
|
|
1180
|
+
* @param options - Optional per-request overrides, applied to every
|
|
1181
|
+
* request.
|
|
1182
|
+
* @returns A {@link Result} wrapping the {@link OutdatedRestart}, or
|
|
1183
|
+
* the {@link OpenCloudError} that caused a request to fail.
|
|
1184
|
+
*/
|
|
1185
|
+
async restartOutdated({ placeIds, universeId }, options) {
|
|
1186
|
+
const validated = buildRestartServersRequest({
|
|
1187
|
+
placeIds,
|
|
1188
|
+
universeId
|
|
1189
|
+
});
|
|
1190
|
+
if (!validated.success) return validated;
|
|
1191
|
+
let selection = await this.#selectOutdated({
|
|
1192
|
+
placeIds,
|
|
1193
|
+
universeId
|
|
1194
|
+
}, options);
|
|
1195
|
+
if (!selection.success) return selection;
|
|
1196
|
+
let restart = await this.#restartSelected({
|
|
1197
|
+
placeIds: selection.data.placeIds,
|
|
1198
|
+
universeId
|
|
1199
|
+
}, options);
|
|
1200
|
+
if (!restart.success && restart.err instanceof ApiError && restart.err.statusCode === 500) {
|
|
1201
|
+
selection = await this.#selectOutdated({
|
|
1202
|
+
placeIds,
|
|
1203
|
+
universeId
|
|
1204
|
+
}, options);
|
|
1205
|
+
if (!selection.success) return selection;
|
|
1206
|
+
restart = await this.#restartSelected({
|
|
1207
|
+
placeIds: selection.data.placeIds,
|
|
1208
|
+
universeId
|
|
1209
|
+
}, options);
|
|
1210
|
+
}
|
|
1211
|
+
const restarted = selection.data.placeIds.length > 0;
|
|
1212
|
+
return restart.success ? {
|
|
1213
|
+
data: summarizeOutdatedRestart(selection.data, restarted),
|
|
1214
|
+
success: true
|
|
1215
|
+
} : restart;
|
|
1216
|
+
}
|
|
1217
|
+
async #restartSelected(parameters, options) {
|
|
1218
|
+
if (parameters.placeIds.length === 0) return {
|
|
1219
|
+
data: void 0,
|
|
1220
|
+
success: true
|
|
1221
|
+
};
|
|
1222
|
+
return this.#inner.executeAsync({
|
|
1223
|
+
options,
|
|
1224
|
+
parameters,
|
|
1225
|
+
spec: RESTART_OUTDATED_SPEC
|
|
1226
|
+
});
|
|
1227
|
+
}
|
|
1228
|
+
async #selectOutdated({ placeIds, universeId }, options) {
|
|
1229
|
+
const forecast = await this.forecast({ universeId }, options);
|
|
1230
|
+
if (!forecast.success) return forecast;
|
|
1231
|
+
return {
|
|
1232
|
+
data: selectOutdatedPlaces(placeIds, forecast.data),
|
|
1233
|
+
success: true
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
927
1236
|
};
|
|
928
1237
|
//#endregion
|
|
929
1238
|
//#region src/resources/universes/client.ts
|
|
930
|
-
const GET_SPEC = Object.freeze({
|
|
931
|
-
buildRequest: buildGetRequest,
|
|
932
|
-
methodDefaults: {},
|
|
933
|
-
methodKind: "idempotent",
|
|
934
|
-
operationLimit: GET_OPERATION_LIMIT,
|
|
935
|
-
parse: parseUniverseResponse
|
|
936
|
-
});
|
|
937
1239
|
const UPDATE_SPEC = Object.freeze({
|
|
938
1240
|
buildRequest: buildUpdateRequest,
|
|
939
1241
|
methodDefaults: {},
|
|
@@ -1039,7 +1341,7 @@ const THUMBNAIL_REORDER_SPEC = Object.freeze({
|
|
|
1039
1341
|
* ```ts
|
|
1040
1342
|
* import { UniversesClient } from "@bedrock-rbx/ocale/universes";
|
|
1041
1343
|
*
|
|
1042
|
-
* const client = new UniversesClient({ apiKey: "your-key" });
|
|
1344
|
+
* const client = new UniversesClient({ credential: { apiKey: "your-key", kind: "apiKey" } });
|
|
1043
1345
|
* expect(client).toBeInstanceOf(UniversesClient);
|
|
1044
1346
|
* ```
|
|
1045
1347
|
*/
|
|
@@ -1054,8 +1356,9 @@ var UniversesClient = class {
|
|
|
1054
1356
|
icon;
|
|
1055
1357
|
/**
|
|
1056
1358
|
* Operation Group exposing the server-management restart Operations
|
|
1057
|
-
* (`forecast`, `launch`, `list`).
|
|
1058
|
-
*
|
|
1359
|
+
* (`forecast`, `launch`, `list`, `restartOutdated`). `restartOutdated`
|
|
1360
|
+
* also uses the universe `:restartServers` method. Shares the parent
|
|
1361
|
+
* client's HTTP, rate-limit, and retry plumbing.
|
|
1059
1362
|
*/
|
|
1060
1363
|
restarts;
|
|
1061
1364
|
/**
|
|
@@ -1082,11 +1385,81 @@ var UniversesClient = class {
|
|
|
1082
1385
|
this.thumbnails = createThumbnailsHandle(this.#inner);
|
|
1083
1386
|
}
|
|
1084
1387
|
/**
|
|
1388
|
+
* Makes an experience public. The API key needs `legacy-universe:manage`.
|
|
1389
|
+
* A missing content maturity rating can cause a misleading 403; complete
|
|
1390
|
+
* the content questionnaire in Creator Hub before activating.
|
|
1391
|
+
* On a 504, reads the universe's visibility and succeeds only if public.
|
|
1392
|
+
* This verification needs permission to read the universe. Otherwise the
|
|
1393
|
+
* original 504 is returned, leaving the outcome unconfirmed.
|
|
1394
|
+
*
|
|
1395
|
+
* @since 0.4.0
|
|
1396
|
+
* @param parameters - The universe identifier.
|
|
1397
|
+
* @param options - Optional per-request overrides.
|
|
1398
|
+
* @returns A success Result with no payload, or the Open Cloud error.
|
|
1399
|
+
*
|
|
1400
|
+
* @example
|
|
1401
|
+
*
|
|
1402
|
+
* ```ts
|
|
1403
|
+
* import { UniversesClient } from "@bedrock-rbx/ocale/universes";
|
|
1404
|
+
* import { createFakeHttpClient } from "@bedrock-rbx/ocale/testing";
|
|
1405
|
+
* const httpClient = createFakeHttpClient()
|
|
1406
|
+
* .mockResponse({ body: {}, status: 200 });
|
|
1407
|
+
* const client = new UniversesClient({
|
|
1408
|
+
* credential: { apiKey: "your-key", kind: "apiKey" },
|
|
1409
|
+
* httpClient,
|
|
1410
|
+
* });
|
|
1411
|
+
* const result = client.activate({ universeId: "123" });
|
|
1412
|
+
* return expect(result).resolves.toEqual({ data: undefined, success: true });
|
|
1413
|
+
* ```
|
|
1414
|
+
*/
|
|
1415
|
+
async activate(parameters, options) {
|
|
1416
|
+
return setVisibilityAsync(this.#inner, {
|
|
1417
|
+
options,
|
|
1418
|
+
parameters,
|
|
1419
|
+
visibility: "public"
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Makes an experience private, including one that is already private.
|
|
1424
|
+
* The API key needs `legacy-universe:manage`.
|
|
1425
|
+
* On a 504, reads the universe's visibility and succeeds only if private.
|
|
1426
|
+
* This verification needs permission to read the universe. Otherwise the
|
|
1427
|
+
* original 504 is returned, leaving the outcome unconfirmed.
|
|
1428
|
+
*
|
|
1429
|
+
* @since 0.4.0
|
|
1430
|
+
* @param parameters - The universe identifier.
|
|
1431
|
+
* @param options - Optional per-request overrides.
|
|
1432
|
+
* @returns A success Result with no payload, or the Open Cloud error.
|
|
1433
|
+
*
|
|
1434
|
+
* @example
|
|
1435
|
+
*
|
|
1436
|
+
* ```ts
|
|
1437
|
+
* import { UniversesClient } from "@bedrock-rbx/ocale/universes";
|
|
1438
|
+
* import { createFakeHttpClient } from "@bedrock-rbx/ocale/testing";
|
|
1439
|
+
*
|
|
1440
|
+
* const httpClient = createFakeHttpClient()
|
|
1441
|
+
* .mockResponse({ body: {}, status: 200 });
|
|
1442
|
+
* const client = new UniversesClient({
|
|
1443
|
+
* credential: { apiKey: "your-key", kind: "apiKey" },
|
|
1444
|
+
* httpClient,
|
|
1445
|
+
* });
|
|
1446
|
+
* const result = client.deactivate({ universeId: "123" });
|
|
1447
|
+
* return expect(result).resolves.toEqual({ data: undefined, success: true });
|
|
1448
|
+
* ```
|
|
1449
|
+
*/
|
|
1450
|
+
async deactivate(parameters, options) {
|
|
1451
|
+
return setVisibilityAsync(this.#inner, {
|
|
1452
|
+
options,
|
|
1453
|
+
parameters,
|
|
1454
|
+
visibility: "private"
|
|
1455
|
+
});
|
|
1456
|
+
}
|
|
1457
|
+
/**
|
|
1085
1458
|
* Fetches the current configuration of a universe.
|
|
1086
1459
|
*
|
|
1087
1460
|
* @param parameters - The universe identifier.
|
|
1088
1461
|
* @param options - Optional per-request overrides (e.g. A different
|
|
1089
|
-
* {@link OpenCloudClientOptions.
|
|
1462
|
+
* {@link OpenCloudClientOptions.credential} for this call only).
|
|
1090
1463
|
* @returns A {@link Result} wrapping the parsed {@link Universe}
|
|
1091
1464
|
* or the {@link OpenCloudError} that caused the request to fail.
|
|
1092
1465
|
*/
|
|
@@ -1123,7 +1496,7 @@ var UniversesClient = class {
|
|
|
1123
1496
|
* @param parameters - The universe identifier and the fields to
|
|
1124
1497
|
* update. At least one updatable field must be supplied.
|
|
1125
1498
|
* @param options - Optional per-request overrides (e.g. A different
|
|
1126
|
-
* {@link OpenCloudClientOptions.
|
|
1499
|
+
* {@link OpenCloudClientOptions.credential} for this call only).
|
|
1127
1500
|
* @returns A {@link Result} wrapping the parsed {@link Universe}
|
|
1128
1501
|
* or the {@link OpenCloudError} that caused the request to fail.
|
|
1129
1502
|
*/
|