@bedrock-rbx/ocale 0.3.4 → 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 +10 -5
- 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 +359 -196
- package/dist/badges.d.mts.map +1 -1
- package/dist/badges.mjs +493 -59
- package/dist/badges.mjs.map +1 -1
- package/dist/capacity-admission-Ce2V9QNb.d.mts +347 -0
- package/dist/capacity-admission-Ce2V9QNb.d.mts.map +1 -0
- package/dist/{data.generated-B2ceLfSn.d.mts → data.generated-B4Fztv_7.d.mts} +23 -25
- package/dist/data.generated-B4Fztv_7.d.mts.map +1 -0
- package/dist/developer-products.d.mts +207 -194
- package/dist/developer-products.d.mts.map +1 -1
- package/dist/developer-products.mjs +125 -39
- package/dist/developer-products.mjs.map +1 -1
- package/dist/game-passes.d.mts +206 -211
- package/dist/game-passes.d.mts.map +1 -1
- package/dist/game-passes.mjs +35 -36
- package/dist/game-passes.mjs.map +1 -1
- package/dist/index.d.mts +947 -366
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +324 -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 +28 -2
- package/dist/locales.d.mts.map +1 -0
- package/dist/locales.mjs +24 -3
- package/dist/locales.mjs.map +1 -1
- package/dist/luau-execution.d.mts +154 -157
- package/dist/luau-execution.d.mts.map +1 -1
- package/dist/luau-execution.mjs +15 -16
- package/dist/luau-execution.mjs.map +1 -1
- package/dist/{network-error-DR9FX5hb.mjs → network-error-P4An7nUB.mjs} +48 -14
- package/dist/network-error-P4An7nUB.mjs.map +1 -0
- package/dist/places.d.mts +258 -186
- package/dist/places.d.mts.map +1 -1
- package/dist/places.mjs +187 -35
- package/dist/places.mjs.map +1 -1
- package/dist/{poll-timeout-3PXLsabj.mjs → poll-timeout-BCxgN97O.mjs} +4 -6
- package/dist/{poll-timeout-3PXLsabj.mjs.map → poll-timeout-BCxgN97O.mjs.map} +1 -1
- package/dist/{polling-helpers-CoVhsC33.mjs → polling-helpers-BtEYR5dN.mjs} +260 -105
- package/dist/polling-helpers-BtEYR5dN.mjs.map +1 -0
- package/dist/{price-information-B0tkOoAX.mjs → price-information--d6GZAcp.mjs} +3 -4
- package/dist/{price-information-B0tkOoAX.mjs.map → price-information--d6GZAcp.mjs.map} +1 -1
- package/dist/resource-client-CF8SPsV8.d.mts +162 -0
- package/dist/resource-client-CF8SPsV8.d.mts.map +1 -0
- package/dist/{resource-client-rqTMkBeR.mjs → resource-client-Cm_bPcCs.mjs} +589 -197
- package/dist/resource-client-Cm_bPcCs.mjs.map +1 -0
- package/dist/retry-DYxm_eBU.d.mts +225 -0
- package/dist/retry-DYxm_eBU.d.mts.map +1 -0
- package/dist/{retry-BlX4tUnT.mjs → retry-Dv5TsY9O.mjs} +312 -54
- 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 +333 -344
- package/dist/storage.d.mts.map +1 -1
- package/dist/storage.mjs +39 -40
- package/dist/storage.mjs.map +1 -1
- package/dist/testing.d.mts +369 -434
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +18 -33
- 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-Z4abDJfK.d.mts +501 -0
- package/dist/types-Z4abDJfK.d.mts.map +1 -0
- package/dist/universes.d.mts +619 -436
- package/dist/universes.d.mts.map +1 -1
- package/dist/universes.mjs +432 -79
- package/dist/universes.mjs.map +1 -1
- package/dist/{validation-B_Zs1So2.mjs → validation-kaTLLAD1.mjs} +3 -4
- package/dist/{validation-B_Zs1So2.mjs.map → validation-kaTLLAD1.mjs.map} +1 -1
- package/dist/wire-DDG87I-d.d.mts +39 -0
- package/dist/wire-DDG87I-d.d.mts.map +1 -0
- package/package.json +15 -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/places.mjs
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as RBXL_SIGNATURE, r as matchesSignature, t as RBXLX_SIGNATURE } from "./signatures-
|
|
7
|
-
|
|
8
|
-
const NON_UPDATABLE_KEYS = new Set(["placeId", "universeId"]);
|
|
1
|
+
import { a as pollUntilDoneCoreAsync, c as LIST_LOGS_SPEC, n as submitAndPollAsync, o as withBudgetRequestTimeout, r as submitWithCapacityAsync, s as GET_SPEC, t as buildPollDependencies } from "./polling-helpers-BtEYR5dN.mjs";
|
|
2
|
+
import { t as ValidationError } from "./validation-kaTLLAD1.mjs";
|
|
3
|
+
import { n as okRequest, s as toJsonDetails, t as ResourceClient } from "./resource-client-Cm_bPcCs.mjs";
|
|
4
|
+
import { A as waitForQuotaReset, N as isRecord, m as UnexpectedResponseError, o as UPLOAD_METHOD_DEFAULTS, r as IDEMPOTENT_METHOD_DEFAULTS } from "./retry-Dv5TsY9O.mjs";
|
|
5
|
+
import { t as isDateTimeString } from "./is-date-time-string-C91G44SI.mjs";
|
|
6
|
+
import { n as RBXL_SIGNATURE, r as matchesSignature, t as RBXLX_SIGNATURE } from "./signatures-CtJ7jfVN.mjs";
|
|
7
|
+
// src/domains/cloud-v2/places/builders.ts
|
|
8
|
+
const NON_UPDATABLE_KEYS = /* @__PURE__ */ new Set(["placeId", "universeId"]);
|
|
9
|
+
/**
|
|
10
|
+
* Build a read-only lookup of a place's configuration, including its root flag.
|
|
11
|
+
*
|
|
12
|
+
* @param parameters - Owning universe and place identifiers.
|
|
13
|
+
* @returns A read-only request carrying both identifiers in the URL.
|
|
14
|
+
*/
|
|
15
|
+
function buildGetRequest(parameters) {
|
|
16
|
+
return okRequest({
|
|
17
|
+
method: "GET",
|
|
18
|
+
url: `/cloud/v2/universes/${parameters.universeId}/places/${parameters.placeId}`
|
|
19
|
+
});
|
|
20
|
+
}
|
|
9
21
|
/**
|
|
10
22
|
* Builds a `PATCH` request for the Open Cloud "update place" endpoint.
|
|
11
23
|
* Derives the `updateMask` query string from the keys present on
|
|
@@ -39,6 +51,14 @@ function buildUpdateRequest(parameters) {
|
|
|
39
51
|
function extractUpdateFieldKeys(parameters) {
|
|
40
52
|
return Object.keys(parameters).filter((key) => !NON_UPDATABLE_KEYS.has(key));
|
|
41
53
|
}
|
|
54
|
+
// src/domains/cloud-v2/places/operations.ts
|
|
55
|
+
const UPDATE_PER_MINUTE = 100;
|
|
56
|
+
const SECONDS_PER_MINUTE$1 = 60;
|
|
57
|
+
/** Read quota from the Cloud_GetPlace operation: 100 requests per minute. */
|
|
58
|
+
const GET_OPERATION_LIMIT = Object.freeze({
|
|
59
|
+
maxPerSecond: 100 / SECONDS_PER_MINUTE$1,
|
|
60
|
+
operationKey: "places.get"
|
|
61
|
+
});
|
|
42
62
|
/**
|
|
43
63
|
* Per-second request ceiling for updating a place, from the Open Cloud
|
|
44
64
|
* OpenAPI schema (100 requests per minute per API key owner). Keyed
|
|
@@ -48,7 +68,7 @@ function extractUpdateFieldKeys(parameters) {
|
|
|
48
68
|
* contention surprises.
|
|
49
69
|
*/
|
|
50
70
|
const UPDATE_OPERATION_LIMIT = Object.freeze({
|
|
51
|
-
maxPerSecond:
|
|
71
|
+
maxPerSecond: UPDATE_PER_MINUTE / SECONDS_PER_MINUTE$1,
|
|
52
72
|
operationKey: "places.update"
|
|
53
73
|
});
|
|
54
74
|
/**
|
|
@@ -57,8 +77,7 @@ const UPDATE_OPERATION_LIMIT = Object.freeze({
|
|
|
57
77
|
* OpenAPI schema.
|
|
58
78
|
*/
|
|
59
79
|
const UPDATE_REQUIRED_SCOPES = Object.freeze(["universe.place:write"]);
|
|
60
|
-
|
|
61
|
-
//#region src/domains/cloud-v2/places/parsers.ts
|
|
80
|
+
// src/domains/cloud-v2/places/parsers.ts
|
|
62
81
|
const MALFORMED_PLACE_MESSAGE = "Malformed place response";
|
|
63
82
|
const PLACE_PATH_PATTERN = /^universes\/(\d+)\/places\/(\d+)$/;
|
|
64
83
|
/**
|
|
@@ -67,10 +86,11 @@ const PLACE_PATH_PATTERN = /^universes\/(\d+)\/places\/(\d+)$/;
|
|
|
67
86
|
*
|
|
68
87
|
* @param response - The full {@link HttpResponse} from the Open Cloud API.
|
|
69
88
|
* @returns A success result wrapping the parsed {@link Place}, or an
|
|
70
|
-
* {@link
|
|
89
|
+
* {@link UnexpectedResponseError} when the body does not match the wire
|
|
90
|
+
* schema.
|
|
71
91
|
*/
|
|
72
92
|
function parsePlaceResponse({ body, status: statusCode }) {
|
|
73
|
-
if (!isPlaceWire(body)) return malformedPlace(statusCode, body);
|
|
93
|
+
if (!isPlaceWire$1(body)) return malformedPlace(statusCode, body);
|
|
74
94
|
const match = PLACE_PATH_PATTERN.exec(body.path);
|
|
75
95
|
const universeId = match?.[1];
|
|
76
96
|
const id = match?.[2];
|
|
@@ -86,7 +106,7 @@ function parsePlaceResponse({ body, status: statusCode }) {
|
|
|
86
106
|
}
|
|
87
107
|
function malformedPlace(statusCode, body) {
|
|
88
108
|
return {
|
|
89
|
-
err: new
|
|
109
|
+
err: new UnexpectedResponseError(MALFORMED_PLACE_MESSAGE, {
|
|
90
110
|
details: toJsonDetails(body),
|
|
91
111
|
statusCode
|
|
92
112
|
}),
|
|
@@ -116,11 +136,87 @@ function hasValidPlaceOptional(body) {
|
|
|
116
136
|
const serverSize = body["serverSize"] ?? void 0;
|
|
117
137
|
return (serverSize === void 0 || typeof serverSize === "number") && isOptionalBoolean(body["root"]) && isOptionalBoolean(body["universeRuntimeCreation"]);
|
|
118
138
|
}
|
|
119
|
-
function isPlaceWire(body) {
|
|
139
|
+
function isPlaceWire$1(body) {
|
|
120
140
|
return isRecord(body) && hasValidPlaceRequired(body) && hasValidPlaceOptional(body);
|
|
121
141
|
}
|
|
122
|
-
|
|
123
|
-
|
|
142
|
+
// src/domains/develop/places/builders.ts
|
|
143
|
+
/**
|
|
144
|
+
* Builds the `GET` request listing one page of a universe's places. Maps
|
|
145
|
+
* `pageSize` to `limit` and `pageToken` to `cursor`, each only when defined.
|
|
146
|
+
*
|
|
147
|
+
* @param parameters - Universe ID plus optional pagination fields.
|
|
148
|
+
* @returns A pure {@link HttpRequest} describing the list call.
|
|
149
|
+
*/
|
|
150
|
+
function buildListPlacesRequest(parameters) {
|
|
151
|
+
const query = new URLSearchParams();
|
|
152
|
+
if (parameters.pageSize !== void 0) query.append("limit", String(parameters.pageSize));
|
|
153
|
+
if (parameters.pageToken !== void 0) query.append("cursor", parameters.pageToken);
|
|
154
|
+
const queryString = query.toString();
|
|
155
|
+
const base = `/v1/universes/${parameters.universeId}/places`;
|
|
156
|
+
return {
|
|
157
|
+
method: "GET",
|
|
158
|
+
url: queryString === "" ? base : `${base}?${queryString}`
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// src/domains/develop/places/operations.ts
|
|
162
|
+
/** Origin of the unauthenticated develop places endpoint. */
|
|
163
|
+
const LIST_PLACES_BASE_URL = "https://develop.roblox.com";
|
|
164
|
+
/**
|
|
165
|
+
* Per-second ceiling for listing places. Not published in the OpenAPI spec;
|
|
166
|
+
* observed 2026-11-09 on 200 and 400 responses as
|
|
167
|
+
* `x-ratelimit-limit: 10000, 10000;w=60` (10000 requests per 60 seconds).
|
|
168
|
+
* The window is fixed: a 429's `retry-after` is shorter than the window,
|
|
169
|
+
* which reopens only at `x-ratelimit-reset`.
|
|
170
|
+
*/
|
|
171
|
+
const LIST_PLACES_OPERATION_LIMIT = Object.freeze({
|
|
172
|
+
maxPerSecond: 1e4 / 60,
|
|
173
|
+
operationKey: "places.list"
|
|
174
|
+
});
|
|
175
|
+
// src/domains/develop/places/parsers.ts
|
|
176
|
+
/**
|
|
177
|
+
* Parses one page of a universe's places. Numeric IDs become strings and a
|
|
178
|
+
* `null` next cursor becomes `undefined`.
|
|
179
|
+
*
|
|
180
|
+
* @param response - The HTTP response to parse.
|
|
181
|
+
* @returns The parsed page or an `UnexpectedResponseError` when the body is
|
|
182
|
+
* malformed.
|
|
183
|
+
*/
|
|
184
|
+
function parsePlacesListResponse({ body, status: statusCode }) {
|
|
185
|
+
if (!isRecord(body) || !Array.isArray(body["data"])) return malformed(statusCode, body);
|
|
186
|
+
const nextPageToken = body["nextPageCursor"] ?? void 0;
|
|
187
|
+
if (nextPageToken !== void 0 && typeof nextPageToken !== "string") return malformed(statusCode, body);
|
|
188
|
+
const items = [];
|
|
189
|
+
const places = body["data"];
|
|
190
|
+
for (const item of places) {
|
|
191
|
+
if (!isPlaceWire(item)) return malformed(statusCode, body);
|
|
192
|
+
items.push({
|
|
193
|
+
id: String(item.id),
|
|
194
|
+
name: item.name,
|
|
195
|
+
description: item.description,
|
|
196
|
+
universeId: String(item.universeId)
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
data: {
|
|
201
|
+
items,
|
|
202
|
+
nextPageToken
|
|
203
|
+
},
|
|
204
|
+
success: true
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function isPlaceWire(value) {
|
|
208
|
+
return isRecord(value) && Number.isSafeInteger(value["id"]) && Number.isSafeInteger(value["universeId"]) && typeof value["name"] === "string" && typeof value["description"] === "string";
|
|
209
|
+
}
|
|
210
|
+
function malformed(statusCode, body) {
|
|
211
|
+
return {
|
|
212
|
+
err: new UnexpectedResponseError("Malformed places list response", {
|
|
213
|
+
details: toJsonDetails(body),
|
|
214
|
+
statusCode
|
|
215
|
+
}),
|
|
216
|
+
success: false
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
// src/domains/universes/places/builders.ts
|
|
124
220
|
const CONTENT_TYPE_BY_FORMAT = {
|
|
125
221
|
rbxl: "application/octet-stream",
|
|
126
222
|
rbxlx: "application/xml"
|
|
@@ -169,8 +265,7 @@ function validateBody(body, format) {
|
|
|
169
265
|
if (body.length === 0) return new ValidationError("Place body is empty", { code: "empty_body" });
|
|
170
266
|
if (!matchesSignature(body, format === "rbxl" ? RBXL_SIGNATURE : RBXLX_SIGNATURE)) return new ValidationError(`Place body does not match the declared "${format}" format`, { code: "format_mismatch" });
|
|
171
267
|
}
|
|
172
|
-
|
|
173
|
-
//#region src/domains/universes/places/operations.ts
|
|
268
|
+
// src/domains/universes/places/operations.ts
|
|
174
269
|
const PUBLISH_PER_MINUTE = 30;
|
|
175
270
|
/**
|
|
176
271
|
* Per-second request ceiling for publishing or saving a place version,
|
|
@@ -191,8 +286,7 @@ const PUBLISH_OPERATION_LIMIT = Object.freeze({
|
|
|
191
286
|
* in the vendored OpenAPI schema.
|
|
192
287
|
*/
|
|
193
288
|
const PUBLISH_REQUIRED_SCOPES = Object.freeze(["universe-places:write"]);
|
|
194
|
-
|
|
195
|
-
//#region src/domains/universes/places/parsers.ts
|
|
289
|
+
// src/domains/universes/places/parsers.ts
|
|
196
290
|
/**
|
|
197
291
|
* Parses a successful publish-version response into the public
|
|
198
292
|
* {@link PlaceVersion} shape. The Roblox endpoint sometimes returns the
|
|
@@ -202,14 +296,14 @@ const PUBLISH_REQUIRED_SCOPES = Object.freeze(["universe-places:write"]);
|
|
|
202
296
|
*
|
|
203
297
|
* @param response - The full {@link HttpResponse} from the Open Cloud API.
|
|
204
298
|
* @returns A success result wrapping the parsed {@link PlaceVersion}, or
|
|
205
|
-
* an {@link
|
|
206
|
-
* field is missing/wrong-typed.
|
|
299
|
+
* an {@link UnexpectedResponseError} when the body is malformed or its
|
|
300
|
+
* `versionNumber` field is missing/wrong-typed.
|
|
207
301
|
*/
|
|
208
302
|
function parsePublishResponse({ body, status: statusCode }) {
|
|
209
303
|
const decodeResult = decodeBody(body, statusCode);
|
|
210
304
|
if (!decodeResult.success) return decodeResult;
|
|
211
305
|
if (!isPlaceVersionWire(decodeResult.data)) return {
|
|
212
|
-
err: new
|
|
306
|
+
err: new UnexpectedResponseError("Malformed publish response", {
|
|
213
307
|
details: toJsonDetails(body),
|
|
214
308
|
statusCode
|
|
215
309
|
}),
|
|
@@ -232,7 +326,7 @@ function decodeBody(body, statusCode) {
|
|
|
232
326
|
};
|
|
233
327
|
} catch (err) {
|
|
234
328
|
return {
|
|
235
|
-
err: new
|
|
329
|
+
err: new UnexpectedResponseError("Malformed publish response", {
|
|
236
330
|
cause: err,
|
|
237
331
|
details: body,
|
|
238
332
|
statusCode
|
|
@@ -245,10 +339,10 @@ function isPlaceVersionWire(value) {
|
|
|
245
339
|
if (!isRecord(value)) return false;
|
|
246
340
|
return typeof value["versionNumber"] === "number";
|
|
247
341
|
}
|
|
248
|
-
|
|
249
|
-
//#region src/resources/places/client.ts
|
|
342
|
+
// src/resources/places/client.ts
|
|
250
343
|
function makePublishSpec(versionType) {
|
|
251
344
|
return Object.freeze({
|
|
345
|
+
apiKeyOnly: true,
|
|
252
346
|
buildRequest: (parameters) => {
|
|
253
347
|
return buildPublishRequest(parameters, versionType);
|
|
254
348
|
},
|
|
@@ -261,6 +355,23 @@ function makePublishSpec(versionType) {
|
|
|
261
355
|
}
|
|
262
356
|
const PUBLISH_SPEC = makePublishSpec("Published");
|
|
263
357
|
const SAVE_SPEC = makePublishSpec("Saved");
|
|
358
|
+
const GET_PLACE_SPEC = Object.freeze({
|
|
359
|
+
buildRequest: buildGetRequest,
|
|
360
|
+
methodDefaults: {},
|
|
361
|
+
methodKind: "idempotent",
|
|
362
|
+
operationLimit: GET_OPERATION_LIMIT,
|
|
363
|
+
parse: parsePlaceResponse
|
|
364
|
+
});
|
|
365
|
+
const LIST_PLACES_SPEC = Object.freeze({
|
|
366
|
+
buildRequest: (parameters) => {
|
|
367
|
+
return okRequest(buildListPlacesRequest(parameters));
|
|
368
|
+
},
|
|
369
|
+
methodDefaults: IDEMPOTENT_METHOD_DEFAULTS,
|
|
370
|
+
methodKind: "idempotent",
|
|
371
|
+
operationLimit: LIST_PLACES_OPERATION_LIMIT,
|
|
372
|
+
parse: parsePlacesListResponse,
|
|
373
|
+
unauthenticatedBaseUrl: LIST_PLACES_BASE_URL
|
|
374
|
+
});
|
|
264
375
|
const UPDATE_SPEC = Object.freeze({
|
|
265
376
|
buildRequest: buildUpdateRequest,
|
|
266
377
|
methodDefaults: {},
|
|
@@ -295,7 +406,7 @@ const UPDATE_SPEC = Object.freeze({
|
|
|
295
406
|
* ```ts
|
|
296
407
|
* import { PlacesClient } from "@bedrock-rbx/ocale/places";
|
|
297
408
|
*
|
|
298
|
-
* const client = new PlacesClient({ apiKey: "your-key" });
|
|
409
|
+
* const client = new PlacesClient({ credential: { apiKey: "your-key", kind: "apiKey" } });
|
|
299
410
|
* expect(client).toBeInstanceOf(PlacesClient);
|
|
300
411
|
* ```
|
|
301
412
|
*/
|
|
@@ -313,6 +424,47 @@ var PlacesClient = class {
|
|
|
313
424
|
this.luauExecution = createLuauExecutionHandle(this.#inner);
|
|
314
425
|
}
|
|
315
426
|
/**
|
|
427
|
+
* Reads a place's configuration, including whether it is the universe's
|
|
428
|
+
* root.
|
|
429
|
+
*
|
|
430
|
+
* @since 0.4.0
|
|
431
|
+
* @param parameters - Owning universe and place identifiers.
|
|
432
|
+
* @param options - Per-request overrides.
|
|
433
|
+
* @returns The parsed place or the Open Cloud failure.
|
|
434
|
+
*/
|
|
435
|
+
async get(parameters, options) {
|
|
436
|
+
return this.#inner.executeAsync({
|
|
437
|
+
options,
|
|
438
|
+
parameters,
|
|
439
|
+
spec: GET_PLACE_SPEC
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Lists one page of the places of a universe. Omit `pageToken` for the
|
|
444
|
+
* first page, then pass the returned `nextPageToken` until it is
|
|
445
|
+
* undefined. An unknown universe yields an empty page.
|
|
446
|
+
*
|
|
447
|
+
* The read is unauthenticated: it sends no credential and is served from
|
|
448
|
+
* `https://develop.roblox.com`, so the client `baseUrl` does not apply.
|
|
449
|
+
* `pageSize` accepts only 10, 25, 50 or 100 and defaults to 10.
|
|
450
|
+
* Roblox allows 10000 reads per caller in a fixed 60-second window. A 429
|
|
451
|
+
* waits until the reported `x-ratelimit-reset` before it retries.
|
|
452
|
+
*
|
|
453
|
+
* @since 0.5.0
|
|
454
|
+
* @param parameters - Universe ID and optional pagination fields.
|
|
455
|
+
* @param options - Optional per-request overrides.
|
|
456
|
+
* @returns A {@link Result} wrapping the page of {@link PlaceSummary}
|
|
457
|
+
* items, or the {@link OpenCloudError} that caused the request to fail.
|
|
458
|
+
*/
|
|
459
|
+
async list(parameters, options) {
|
|
460
|
+
return this.#inner.executeAsync({
|
|
461
|
+
options,
|
|
462
|
+
parameters,
|
|
463
|
+
refineError: waitForQuotaReset,
|
|
464
|
+
spec: LIST_PLACES_SPEC
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
316
468
|
* Publishes a new live version of a place.
|
|
317
469
|
*
|
|
318
470
|
* No default request timeout applies to this upload; pass `options.timeout`
|
|
@@ -321,7 +473,7 @@ var PlacesClient = class {
|
|
|
321
473
|
* @param parameters - Universe and place identifiers, the place file
|
|
322
474
|
* bytes, and their declared `format`.
|
|
323
475
|
* @param options - Optional per-request overrides (e.g. A different
|
|
324
|
-
* {@link OpenCloudClientOptions.
|
|
476
|
+
* {@link OpenCloudClientOptions.credential} for this call only).
|
|
325
477
|
* @returns A {@link Result} wrapping the parsed {@link PlaceVersion}
|
|
326
478
|
* or the {@link OpenCloudError} that caused the request to fail.
|
|
327
479
|
*/
|
|
@@ -345,7 +497,7 @@ var PlacesClient = class {
|
|
|
345
497
|
* @param parameters - Universe and place identifiers, the place file
|
|
346
498
|
* bytes, and their declared `format`.
|
|
347
499
|
* @param options - Optional per-request overrides (e.g. A different
|
|
348
|
-
* {@link OpenCloudClientOptions.
|
|
500
|
+
* {@link OpenCloudClientOptions.credential} for this call only).
|
|
349
501
|
* @returns A {@link Result} wrapping the parsed {@link PlaceVersion}
|
|
350
502
|
* or the {@link OpenCloudError} that caused the request to fail.
|
|
351
503
|
*/
|
|
@@ -367,7 +519,7 @@ var PlacesClient = class {
|
|
|
367
519
|
* @param parameters - The universe and place identifiers and the
|
|
368
520
|
* fields to update. At least one writable field must be supplied.
|
|
369
521
|
* @param options - Optional per-request overrides (e.g. A different
|
|
370
|
-
* {@link OpenCloudClientOptions.
|
|
522
|
+
* {@link OpenCloudClientOptions.credential} for this call only).
|
|
371
523
|
* @returns A {@link Result} wrapping the parsed {@link Place} or
|
|
372
524
|
* the {@link OpenCloudError} that caused the request to fail.
|
|
373
525
|
*/
|
|
@@ -396,14 +548,15 @@ function createLuauExecutionHandle(inner) {
|
|
|
396
548
|
});
|
|
397
549
|
},
|
|
398
550
|
async pollUntilDone(ref, options = {}) {
|
|
551
|
+
const resolved = withBudgetRequestTimeout(options);
|
|
399
552
|
return pollUntilDoneCoreAsync(buildPollDependencies(inner, {
|
|
400
|
-
options,
|
|
553
|
+
options: resolved,
|
|
401
554
|
ref
|
|
402
|
-
}),
|
|
555
|
+
}), resolved);
|
|
403
556
|
},
|
|
404
557
|
async runUntilDone(parameters, options = {}) {
|
|
405
558
|
return submitAndPollAsync(inner, {
|
|
406
|
-
options,
|
|
559
|
+
options: withBudgetRequestTimeout(options),
|
|
407
560
|
parameters
|
|
408
561
|
});
|
|
409
562
|
},
|
|
@@ -416,7 +569,6 @@ function createLuauExecutionHandle(inner) {
|
|
|
416
569
|
}
|
|
417
570
|
};
|
|
418
571
|
}
|
|
419
|
-
//#endregion
|
|
420
572
|
export { PlacesClient };
|
|
421
573
|
|
|
422
574
|
//# sourceMappingURL=places.mjs.map
|
package/dist/places.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"places.mjs","names":["SECONDS_PER_MINUTE","#inner"],"sources":["../src/domains/cloud-v2/places/builders.ts","../src/domains/cloud-v2/places/operations.ts","../src/domains/cloud-v2/places/parsers.ts","../src/domains/universes/places/builders.ts","../src/domains/universes/places/operations.ts","../src/domains/universes/places/parsers.ts","../src/resources/places/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../client/types.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { UpdatePlaceParameters } from \"./types.ts\";\n\nconst NON_UPDATABLE_KEYS: ReadonlySet<string> = new Set([\"placeId\", \"universeId\"]);\n\n/**\n * Builds a `PATCH` request for the Open Cloud \"update place\" endpoint.\n * Derives the `updateMask` query string from the keys present on\n * `parameters` (excluding the identifiers) and emits a JSON body\n * containing those same fields.\n *\n * @param parameters - The universe and place identifiers plus the fields\n * to update.\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when no updatable fields were supplied.\n */\nexport function buildUpdateRequest(\n\tparameters: UpdatePlaceParameters,\n): Result<HttpRequest, ValidationError> {\n\tconst fieldKeys = extractUpdateFieldKeys(parameters);\n\n\tif (fieldKeys.length === 0) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Update must include at least one field\", {\n\t\t\t\tcode: \"empty_update\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst body = Object.fromEntries(\n\t\tfieldKeys.map((key): readonly [string, unknown] => [key, Reflect.get(parameters, key)]),\n\t);\n\tconst updateMask = fieldKeys.join(\",\");\n\tconst { placeId, universeId } = parameters;\n\treturn {\n\t\tdata: {\n\t\t\tbody,\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tmethod: \"PATCH\",\n\t\t\turl: `/cloud/v2/universes/${universeId}/places/${placeId}?updateMask=${updateMask}`,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction extractUpdateFieldKeys(parameters: UpdatePlaceParameters): ReadonlyArray<string> {\n\treturn Object.keys(parameters).filter((key) => !NON_UPDATABLE_KEYS.has(key));\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst UPDATE_PER_MINUTE = 100;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for updating a place, from the Open Cloud\n * OpenAPI schema (100 requests per minute per API key owner). Keyed\n * independently from the publish operation so publish and update do\n * not share a queue; upstream quota accounting is not documented as\n * shared and the conservative default is fewer cross-method\n * contention surprises.\n */\nexport const UPDATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: UPDATE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"places.update\",\n});\n\n/**\n * Scopes required to update a place's metadata, sourced from\n * `x-roblox-scopes` on the `Cloud_UpdatePlace` operation in the vendored\n * OpenAPI schema.\n */\nexport const UPDATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe.place:write\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport { toJsonDetails } from \"../../../internal/utils/to-json-details.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { Place } from \"./types.ts\";\nimport type { PlaceWire } from \"./wire.ts\";\n\nconst MALFORMED_PLACE_MESSAGE = \"Malformed place response\";\n\nconst PLACE_PATH_PATTERN = /^universes\\/(\\d+)\\/places\\/(\\d+)$/;\n\ninterface ToPlaceArgs {\n\treadonly id: string;\n\treadonly body: PlaceWire;\n\treadonly universeId: string;\n}\n\n/**\n * Parses a successful Open Cloud `Place` response body into the public\n * {@link Place} shape.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link Place}, or an\n * {@link ApiError} when the body does not match the wire schema.\n */\nexport function parsePlaceResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<Place, ApiError> {\n\tif (!isPlaceWire(body)) {\n\t\treturn malformedPlace(statusCode, body);\n\t}\n\n\tconst match = PLACE_PATH_PATTERN.exec(body.path);\n\tconst universeId = match?.[1];\n\tconst id = match?.[2];\n\tif (id === undefined || universeId === undefined) {\n\t\treturn malformedPlace(statusCode, body);\n\t}\n\n\treturn { data: toPlace({ id, body, universeId }), success: true };\n}\n\nfunction malformedPlace(statusCode: number, body: unknown): Result<Place, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_PLACE_MESSAGE, {\n\t\t\tdetails: toJsonDetails(body),\n\t\t\tstatusCode,\n\t\t}),\n\t\tsuccess: false,\n\t};\n}\n\nfunction toPlace({ id, body, universeId }: ToPlaceArgs): Place {\n\treturn {\n\t\tid,\n\t\tcreatedAt: new Date(body.createTime),\n\t\tdescription: body.description,\n\t\tdisplayName: body.displayName,\n\t\troot: body.root ?? false,\n\t\tserverSize: body.serverSize ?? undefined,\n\t\tuniverseId,\n\t\tuniverseRuntimeCreation: body.universeRuntimeCreation ?? false,\n\t\tupdatedAt: new Date(body.updateTime),\n\t};\n}\n\nfunction hasValidPlaceRequired(body: Record<string, unknown>): boolean {\n\treturn (\n\t\ttypeof body[\"path\"] === \"string\" &&\n\t\tisDateTimeString(body[\"createTime\"]) &&\n\t\tisDateTimeString(body[\"updateTime\"]) &&\n\t\ttypeof body[\"displayName\"] === \"string\" &&\n\t\ttypeof body[\"description\"] === \"string\"\n\t);\n}\n\nfunction isOptionalBoolean(value: unknown): boolean {\n\treturn value === undefined || value === null || typeof value === \"boolean\";\n}\n\nfunction hasValidPlaceOptional(body: Record<string, unknown>): boolean {\n\tconst serverSize = body[\"serverSize\"] ?? undefined;\n\treturn (\n\t\t(serverSize === undefined || typeof serverSize === \"number\") &&\n\t\tisOptionalBoolean(body[\"root\"]) &&\n\t\tisOptionalBoolean(body[\"universeRuntimeCreation\"])\n\t);\n}\n\nfunction isPlaceWire(body: unknown): body is PlaceWire {\n\treturn isRecord(body) && hasValidPlaceRequired(body) && hasValidPlaceOptional(body);\n}\n","import type { HttpRequest } from \"../../../client/types.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport { matchesSignature, RBXL_SIGNATURE, RBXLX_SIGNATURE } from \"./signatures.ts\";\nimport type { PublishParameters } from \"./types.ts\";\n\n/**\n * Whether a publish call writes a live (`Published`) or draft (`Saved`)\n * version. Surfaces only as the `versionType` query string on the\n * underlying HTTP request.\n */\ntype VersionType = \"Published\" | \"Saved\";\n\nconst CONTENT_TYPE_BY_FORMAT: Readonly<Record<PublishParameters[\"format\"], string>> = {\n\trbxl: \"application/octet-stream\",\n\trbxlx: \"application/xml\",\n};\n\n/**\n * Builds a `POST` request for the Open Cloud \"publish place version\"\n * endpoint. Performs two local validations before producing any\n * {@link HttpRequest}: a non-empty body check and a magic-byte check\n * that the bytes' actual format matches `parameters.format`.\n *\n * @param parameters - Universe and place identifiers, the place file\n * bytes, and the declared `format` of those bytes.\n * @param versionType - `\"Published\"` for `publish()`, `\"Saved\"` for\n * `save()`; baked into the `?versionType=` query string.\n * @returns A success result wrapping the request on success, or a\n * {@link ValidationError} when the body is empty or its magic bytes\n * disagree with `parameters.format`.\n */\nexport function buildPublishRequest(\n\t{ body, format, placeId, universeId }: PublishParameters,\n\tversionType: VersionType,\n): Result<HttpRequest, ValidationError> {\n\tconst validationError = validateBody(body, format);\n\tif (validationError !== undefined) {\n\t\treturn { err: validationError, success: false };\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tbody,\n\t\t\theaders: { \"content-type\": CONTENT_TYPE_BY_FORMAT[format] },\n\t\t\tmethod: \"POST\",\n\t\t\turl: `/universes/v1/${universeId}/places/${placeId}/versions?versionType=${versionType}`,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\n/**\n * Checks a place body against the format its caller declared: non-empty, and\n * carrying the magic bytes of `format`. Emptiness is checked first so a\n * zero-byte body reports `empty_body` rather than a signature mismatch.\n *\n * @param body - The raw place file bytes.\n * @param format - The format the caller declared the bytes to be in.\n * @returns The {@link ValidationError} to fail with, or `undefined` when the\n * body is usable.\n */\nfunction validateBody(\n\tbody: PublishParameters[\"body\"],\n\tformat: PublishParameters[\"format\"],\n): undefined | ValidationError {\n\tif (body.length === 0) {\n\t\treturn new ValidationError(\"Place body is empty\", { code: \"empty_body\" });\n\t}\n\n\tconst expectedSignature = format === \"rbxl\" ? RBXL_SIGNATURE : RBXLX_SIGNATURE;\n\tif (!matchesSignature(body, expectedSignature)) {\n\t\treturn new ValidationError(`Place body does not match the declared \"${format}\" format`, {\n\t\t\tcode: \"format_mismatch\",\n\t\t});\n\t}\n\n\treturn undefined;\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst PUBLISH_PER_MINUTE = 30;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for publishing or saving a place version,\n * from the Open Cloud OpenAPI schema (30 requests per minute, which works\n * out to `0.5` per second and is also the burst the server allows). The\n * publish and save methods both reference this constant so that a single\n * per-API-key queue serves both, matching Roblox's server-side accounting\n * which counts both call types against the same per-minute quota.\n */\nexport const PUBLISH_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tburstCapacity: PUBLISH_PER_MINUTE,\n\tmaxPerSecond: PUBLISH_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"places.publishVersion\",\n});\n\n/**\n * Scopes required to publish or save a place version, sourced from\n * `x-roblox-scopes` on the `Places_CreatePlaceVersionApiKey` operation\n * in the vendored OpenAPI schema.\n */\nexport const PUBLISH_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe-places:write\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport { toJsonDetails } from \"../../../internal/utils/to-json-details.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { PlaceVersion } from \"./types.ts\";\nimport type { PlaceVersionWire } from \"./wire.ts\";\n\n/**\n * Parses a successful publish-version response into the public\n * {@link PlaceVersion} shape. The Roblox endpoint sometimes returns the\n * JSON-shaped body under a `text/plain` `Content-Type`, so the body may\n * arrive either pre-decoded as a JSON object or still in its raw string\n * form; both are accepted here.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link PlaceVersion}, or\n * an {@link ApiError} when the body is malformed or its `versionNumber`\n * field is missing/wrong-typed.\n */\nexport function parsePublishResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<PlaceVersion, ApiError> {\n\tconst decodeResult = decodeBody(body, statusCode);\n\tif (!decodeResult.success) {\n\t\treturn decodeResult;\n\t}\n\n\tif (!isPlaceVersionWire(decodeResult.data)) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed publish response\", {\n\t\t\t\tdetails: toJsonDetails(body),\n\t\t\t\tstatusCode,\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn {\n\t\tdata: { versionNumber: decodeResult.data.versionNumber },\n\t\tsuccess: true,\n\t};\n}\n\nfunction decodeBody(body: unknown, statusCode: number): Result<unknown, ApiError> {\n\tif (typeof body !== \"string\") {\n\t\treturn { data: body, success: true };\n\t}\n\n\ttry {\n\t\treturn { data: JSON.parse(body), success: true };\n\t} catch (err) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed publish response\", {\n\t\t\t\tcause: err,\n\t\t\t\tdetails: body,\n\t\t\t\tstatusCode,\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n}\n\nfunction isPlaceVersionWire(value: unknown): value is PlaceVersionWire {\n\tif (!isRecord(value)) {\n\t\treturn false;\n\t}\n\n\treturn typeof value[\"versionNumber\"] === \"number\";\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport { LIST_LOGS_SPEC } from \"../../domains/cloud-v2/luau-execution-task-logs/specs.ts\";\nimport type {\n\tListLogsParameters,\n\tLogPage,\n} from \"../../domains/cloud-v2/luau-execution-task-logs/types.ts\";\nimport { GET_SPEC } from \"../../domains/cloud-v2/luau-execution-tasks/specs.ts\";\nimport type {\n\tGetParameters,\n\tLuauExecutionTask,\n\tLuauExecutionTaskRef,\n\tSubmitAtHeadParameters,\n\tSubmitAtVersionParameters,\n} from \"../../domains/cloud-v2/luau-execution-tasks/types.ts\";\nimport { buildUpdateRequest } from \"../../domains/cloud-v2/places/builders.ts\";\nimport {\n\tUPDATE_OPERATION_LIMIT,\n\tUPDATE_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/places/operations.ts\";\nimport { parsePlaceResponse } from \"../../domains/cloud-v2/places/parsers.ts\";\nimport type { Place, UpdatePlaceParameters } from \"../../domains/cloud-v2/places/types.ts\";\nimport { buildPublishRequest } from \"../../domains/universes/places/builders.ts\";\nimport {\n\tPUBLISH_OPERATION_LIMIT,\n\tPUBLISH_REQUIRED_SCOPES,\n} from \"../../domains/universes/places/operations.ts\";\nimport { parsePublishResponse } from \"../../domains/universes/places/parsers.ts\";\nimport type { PlaceVersion, PublishParameters } from \"../../domains/universes/places/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { UPLOAD_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport { ResourceClient, type ResourceMethodSpec } from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\nimport {\n\ttype LuauExecutionRunOptions,\n\ttype LuauExecutionSubmitOptions,\n\tsubmitWithCapacityAsync,\n} from \"../luau-execution/capacity-admission.ts\";\nimport { buildPollDependencies, submitAndPollAsync } from \"../luau-execution/polling-helpers.ts\";\nimport { pollUntilDoneCoreAsync, type PollUntilDoneOptions } from \"../luau-execution/polling.ts\";\n\n/**\n * Operation Group exposed by {@link PlacesClient} as the\n * `luauExecution` namespace. Provides `submit` to queue a Luau script,\n * `get` to fetch a task's current state, and `listLogs` to retrieve\n * structured log messages. Shares the same dispatch wiring as the\n * top-level `LuauExecutionClient` exposed at\n * `@bedrock-rbx/ocale/luau-execution`.\n *\n * @since 0.1.0\n */\nexport interface LuauExecutionHandle {\n\t/**\n\t * Fetches the current state of a previously-submitted Luau\n\t * execution task. Uses idempotent retry semantics for both 429 and\n\t * 5xx.\n\t *\n\t * @param parameters - The task ref plus an optional `view` selector.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link LuauExecutionTask} or the {@link OpenCloudError} that\n\t * caused the request to fail.\n\t */\n\tget(\n\t\tparameters: GetParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Lists one page of structured log messages produced by a\n\t * previously-submitted Luau execution task. Messages from multiple\n\t * server-side chunks are flattened into a single ordered array.\n\t * Uses idempotent retry semantics for both 429 and 5xx.\n\t *\n\t * @param parameters - The task ref and optional pagination controls\n\t * (`pageSize`, `pageToken`).\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link LogPage} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tlistLogs(\n\t\tparameters: ListLogsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LogPage, OpenCloudError>>;\n\t/**\n\t * Polls `get` with `view=BASIC` on a configurable backoff schedule until\n\t * the task reaches a terminal state, the wall-clock budget is exhausted,\n\t * or the supplied `AbortSignal` fires. Returns the terminal task on\n\t * success.\n\t *\n\t * @param ref - Reference to the task to poll, typically returned by `submit`.\n\t * @param options - Polling and per-request overrides.\n\t * @returns A {@link Result} wrapping the terminal {@link LuauExecutionTask},\n\t * or an error if aborted, timed out, or the transport fails.\n\t */\n\tpollUntilDone(\n\t\tref: LuauExecutionTaskRef,\n\t\toptions?: PollUntilDoneOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Submits a Luau script and polls `get` with `view=BASIC` until the\n\t * task reaches a terminal state, the wall-clock budget is exhausted,\n\t * or the supplied `AbortSignal` fires. Combines `submit` and\n\t * `pollUntilDone` in one call.\n\t *\n\t * @param parameters - The same input accepted by `submit`.\n\t * @param options - Polling and per-request overrides.\n\t * @returns A {@link Result} wrapping the terminal\n\t * {@link LuauExecutionTask}, or an error if submit fails, the task\n\t * is aborted, timed out, or the transport fails.\n\t */\n\trunUntilDone(\n\t\tparameters: SubmitAtHeadParameters | SubmitAtVersionParameters,\n\t\toptions?: LuauExecutionRunOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Submits a Luau script for execution against a place. Dispatches\n\t * to the head-version URL when `versionId` is omitted, or to the\n\t * specific-version URL when one is supplied. Both URL shapes share\n\t * one rate-limit queue and one required-scope set.\n\t *\n\t * @param parameters - The universe and place identifiers, the\n\t * script to run, an optional `versionId`, and any other writable\n\t * submit fields.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link LuauExecutionTask} or the {@link OpenCloudError} that\n\t * caused the request to fail.\n\t */\n\tsubmit(\n\t\tparameters: SubmitAtHeadParameters | SubmitAtVersionParameters,\n\t\toptions?: LuauExecutionSubmitOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n}\n\nfunction makePublishSpec(\n\tversionType: \"Published\" | \"Saved\",\n): ResourceMethodSpec<PublishParameters, PlaceVersion> {\n\treturn Object.freeze({\n\t\tbuildRequest: (parameters: PublishParameters) => {\n\t\t\treturn buildPublishRequest(parameters, versionType);\n\t\t},\n\t\tmethodDefaults: UPLOAD_METHOD_DEFAULTS,\n\t\tmethodKind: \"create\",\n\t\toperationLimit: PUBLISH_OPERATION_LIMIT,\n\t\tparse: parsePublishResponse,\n\t\trequiredScopes: PUBLISH_REQUIRED_SCOPES,\n\t});\n}\n\nconst PUBLISH_SPEC = makePublishSpec(\"Published\");\nconst SAVE_SPEC = makePublishSpec(\"Saved\");\n\nconst UPDATE_SPEC: ResourceMethodSpec<UpdatePlaceParameters, Place> = Object.freeze({\n\tbuildRequest: buildUpdateRequest,\n\tmethodDefaults: {},\n\tmethodKind: \"idempotent\",\n\toperationLimit: UPDATE_OPERATION_LIMIT,\n\tparse: parsePlaceResponse,\n\trequiredScopes: UPDATE_REQUIRED_SCOPES,\n});\n\n/**\n * Public client for the Roblox Open Cloud `Place` resource. Covers\n * place-version publishing (`publish`, `save`), place-configuration\n * updates (`update`), and the Luau execution Operation Group\n * (`luauExecution.submit`, `luauExecution.get`). Every method returns\n * a {@link Result} so callers handle failure explicitly; no thrown\n * {@link OpenCloudError} ever escapes the client.\n *\n * Publishing or saving a 5xx-failed place version is not retried\n * automatically: Roblox does not support idempotency keys, so a retry\n * could publish a duplicate version unnoticed. Callers that *can* detect\n * duplicates externally may opt back into 5xx retry per-call by passing\n * `retryableStatuses` on the second argument. The `update` method, by\n * contrast, is idempotent and retries both 429 and 5xx automatically.\n *\n * Failures that never reached Open Cloud *are* retried: transient transport\n * errors, and responses served by an edge gateway rather than the API. Neither\n * can have created a version, so neither risks the duplicate a 5xx does.\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { PlacesClient } from \"@bedrock-rbx/ocale/places\";\n *\n * const client = new PlacesClient({ apiKey: \"your-key\" });\n * expect(client).toBeInstanceOf(PlacesClient);\n * ```\n */\nexport class PlacesClient {\n\treadonly #inner: ResourceClient;\n\n\tpublic readonly luauExecution: LuauExecutionHandle;\n\n\t/**\n\t * Creates a new {@link PlacesClient}. Configuration is frozen on\n\t * construction; per-request overrides are accepted on each method.\n\t *\n\t * @param options - Client-level configuration including the API key.\n\t */\n\tconstructor(options: OpenCloudClientOptions) {\n\t\tthis.#inner = new ResourceClient(options);\n\t\tthis.luauExecution = createLuauExecutionHandle(this.#inner);\n\t}\n\n\t/**\n\t * Publishes a new live version of a place.\n\t *\n\t * No default request timeout applies to this upload; pass `options.timeout`\n\t * to set a per-call deadline.\n\t *\n\t * @param parameters - Universe and place identifiers, the place file\n\t * bytes, and their declared `format`.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link PlaceVersion}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async publish(\n\t\tparameters: PublishParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<PlaceVersion, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: PUBLISH_SPEC });\n\t}\n\n\t/**\n\t * Saves a new draft version of a place. Identical to {@link publish}\n\t * except the resulting version is not made live; consumers can list or\n\t * promote it later. Shares a single per-API-key rate-limit queue with\n\t * `publish` because Roblox attributes both calls to the same per-minute\n\t * quota.\n\t *\n\t * No default request timeout applies to this upload; pass `options.timeout`\n\t * to set a per-call deadline.\n\t *\n\t * @param parameters - Universe and place identifiers, the place file\n\t * bytes, and their declared `format`.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link PlaceVersion}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async save(\n\t\tparameters: PublishParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<PlaceVersion, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: SAVE_SPEC });\n\t}\n\n\t/**\n\t * Partially updates a place's configuration. The fields supplied on\n\t * `parameters` (excluding the identifiers) are forwarded to the\n\t * server via a Google-style `updateMask`; unmentioned fields are\n\t * left untouched. The universe's root place is the canonical place\n\t * to update when changing a universe's description or display name:\n\t * both are derived server-side from the root place.\n\t *\n\t * @param parameters - The universe and place identifiers and the\n\t * fields to update. At least one writable field must be supplied.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link Place} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async update(\n\t\tparameters: UpdatePlaceParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<Place, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: UPDATE_SPEC });\n\t}\n}\n\nfunction createLuauExecutionHandle(inner: ResourceClient): LuauExecutionHandle {\n\treturn {\n\t\tasync get(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: GET_SPEC });\n\t\t},\n\t\tasync listLogs(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: LIST_LOGS_SPEC });\n\t\t},\n\t\tasync pollUntilDone(ref, options = {}) {\n\t\t\treturn pollUntilDoneCoreAsync(buildPollDependencies(inner, { options, ref }), options);\n\t\t},\n\t\tasync runUntilDone(parameters, options = {}) {\n\t\t\treturn submitAndPollAsync(inner, { options, parameters });\n\t\t},\n\t\tasync submit(parameters, options) {\n\t\t\treturn submitWithCapacityAsync({ inner, options, parameters });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;AAKA,MAAM,qBAA0C,IAAI,IAAI,CAAC,WAAW,YAAY,CAAC;;;;;;;;;;;;AAajF,SAAgB,mBACf,YACuC;CACvC,MAAM,YAAY,uBAAuB,UAAU;CAEnD,IAAI,UAAU,WAAW,GACxB,OAAO;EACN,KAAK,IAAI,gBAAgB,0CAA0C,EAClE,MAAM,eACP,CAAC;EACD,SAAS;CACV;CAGD,MAAM,OAAO,OAAO,YACnB,UAAU,KAAK,QAAoC,CAAC,KAAK,QAAQ,IAAI,YAAY,GAAG,CAAC,CAAC,CACvF;CACA,MAAM,aAAa,UAAU,KAAK,GAAG;CACrC,MAAM,EAAE,SAAS,eAAe;CAChC,OAAO;EACN,MAAM;GACL;GACA,SAAS,EAAE,gBAAgB,mBAAmB;GAC9C,QAAQ;GACR,KAAK,uBAAuB,WAAW,UAAU,QAAQ,cAAc;EACxE;EACA,SAAS;CACV;AACD;AAEA,SAAS,uBAAuB,YAA0D;CACzF,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,QAAQ,QAAQ,CAAC,mBAAmB,IAAI,GAAG,CAAC;AAC5E;;;;;;;;;ACrCA,MAAa,yBAAyC,OAAO,OAAO;CACnE,cAAc,MAAoBA;CAClC,cAAc;AACf,CAAC;;;;;;AAOD,MAAa,yBAAgD,OAAO,OAAO,CAC1E,sBACD,CAAC;;;AChBD,MAAM,0BAA0B;AAEhC,MAAM,qBAAqB;;;;;;;;;AAgB3B,SAAgB,mBAAmB,EAClC,MACA,QAAQ,cACiC;CACzC,IAAI,CAAC,YAAY,IAAI,GACpB,OAAO,eAAe,YAAY,IAAI;CAGvC,MAAM,QAAQ,mBAAmB,KAAK,KAAK,IAAI;CAC/C,MAAM,aAAa,QAAQ;CAC3B,MAAM,KAAK,QAAQ;CACnB,IAAI,OAAO,KAA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AAa;IAAE;IAAS;IAAY,MAAM;GAAS,CAAC;EAClE;EACA,MAAM,SAAS,YAAY,SAAS;GACnC,OAAO,MAAM,aAAa;IAAE;IAAS;IAAY,MAAM;GAAe,CAAC;EACxE;EACA,MAAM,cAAc,KAAK,UAAU,CAAC,GAAG;GACtC,OAAO,uBAAuB,sBAAsB,OAAO;IAAE;IAAS;GAAI,CAAC,GAAG,OAAO;EACtF;EACA,MAAM,aAAa,YAAY,UAAU,CAAC,GAAG;GAC5C,OAAO,mBAAmB,OAAO;IAAE;IAAS;GAAW,CAAC;EACzD;EACA,MAAM,OAAO,YAAY,SAAS;GACjC,OAAO,wBAAwB;IAAE;IAAO;IAAS;GAAW,CAAC;EAC9D;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"places.mjs","names":["SECONDS_PER_MINUTE","isPlaceWire"],"sources":["../src/domains/cloud-v2/places/builders.ts","../src/domains/cloud-v2/places/operations.ts","../src/domains/cloud-v2/places/parsers.ts","../src/domains/develop/places/builders.ts","../src/domains/develop/places/operations.ts","../src/domains/develop/places/parsers.ts","../src/domains/universes/places/builders.ts","../src/domains/universes/places/operations.ts","../src/domains/universes/places/parsers.ts","../src/resources/places/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../client/types.ts\";\nimport type { OpenCloudError } from \"../../../errors/base.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport { okRequest } from \"../../../internal/resource-client.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { GetPlaceParameters, UpdatePlaceParameters } from \"./types.ts\";\n\nconst NON_UPDATABLE_KEYS: ReadonlySet<string> = new Set([\"placeId\", \"universeId\"]);\n\n/**\n * Build a read-only lookup of a place's configuration, including its root flag.\n *\n * @param parameters - Owning universe and place identifiers.\n * @returns A read-only request carrying both identifiers in the URL.\n */\nexport function buildGetRequest(\n\tparameters: GetPlaceParameters,\n): Result<HttpRequest, OpenCloudError> {\n\treturn okRequest({\n\t\tmethod: \"GET\",\n\t\turl: `/cloud/v2/universes/${parameters.universeId}/places/${parameters.placeId}`,\n\t});\n}\n\n/**\n * Builds a `PATCH` request for the Open Cloud \"update place\" endpoint.\n * Derives the `updateMask` query string from the keys present on\n * `parameters` (excluding the identifiers) and emits a JSON body\n * containing those same fields.\n *\n * @param parameters - The universe and place identifiers plus the fields\n * to update.\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when no updatable fields were supplied.\n */\nexport function buildUpdateRequest(\n\tparameters: UpdatePlaceParameters,\n): Result<HttpRequest, ValidationError> {\n\tconst fieldKeys = extractUpdateFieldKeys(parameters);\n\n\tif (fieldKeys.length === 0) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Update must include at least one field\", {\n\t\t\t\tcode: \"empty_update\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst body = Object.fromEntries(\n\t\tfieldKeys.map((key): readonly [string, unknown] => [key, Reflect.get(parameters, key)]),\n\t);\n\tconst updateMask = fieldKeys.join(\",\");\n\tconst { placeId, universeId } = parameters;\n\treturn {\n\t\tdata: {\n\t\t\tbody,\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tmethod: \"PATCH\",\n\t\t\turl: `/cloud/v2/universes/${universeId}/places/${placeId}?updateMask=${updateMask}`,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction extractUpdateFieldKeys(parameters: UpdatePlaceParameters): ReadonlyArray<string> {\n\treturn Object.keys(parameters).filter((key) => !NON_UPDATABLE_KEYS.has(key));\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst UPDATE_PER_MINUTE = 100;\nconst SECONDS_PER_MINUTE = 60;\n\n/** Read quota from the Cloud_GetPlace operation: 100 requests per minute. */\nexport const GET_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 100 / SECONDS_PER_MINUTE,\n\toperationKey: \"places.get\",\n});\n\n/**\n * Per-second request ceiling for updating a place, from the Open Cloud\n * OpenAPI schema (100 requests per minute per API key owner). Keyed\n * independently from the publish operation so publish and update do\n * not share a queue; upstream quota accounting is not documented as\n * shared and the conservative default is fewer cross-method\n * contention surprises.\n */\nexport const UPDATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: UPDATE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"places.update\",\n});\n\n/**\n * Scopes required to update a place's metadata, sourced from\n * `x-roblox-scopes` on the `Cloud_UpdatePlace` operation in the vendored\n * OpenAPI schema.\n */\nexport const UPDATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe.place:write\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { UnexpectedResponseError } from \"../../../errors/unexpected-response.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport { toJsonDetails } from \"../../../internal/utils/to-json-details.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { Place } from \"./types.ts\";\nimport type { PlaceWire } from \"./wire.ts\";\n\nconst MALFORMED_PLACE_MESSAGE = \"Malformed place response\";\n\nconst PLACE_PATH_PATTERN = /^universes\\/(\\d+)\\/places\\/(\\d+)$/;\n\ninterface ToPlaceArgs {\n\treadonly id: string;\n\treadonly body: PlaceWire;\n\treadonly universeId: string;\n}\n\n/**\n * Parses a successful Open Cloud `Place` response body into the public\n * {@link Place} shape.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link Place}, or an\n * {@link UnexpectedResponseError} when the body does not match the wire\n * schema.\n */\nexport function parsePlaceResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<Place, UnexpectedResponseError> {\n\tif (!isPlaceWire(body)) {\n\t\treturn malformedPlace(statusCode, body);\n\t}\n\n\tconst match = PLACE_PATH_PATTERN.exec(body.path);\n\tconst universeId = match?.[1];\n\tconst id = match?.[2];\n\tif (id === undefined || universeId === undefined) {\n\t\treturn malformedPlace(statusCode, body);\n\t}\n\n\treturn { data: toPlace({ id, body, universeId }), success: true };\n}\n\nfunction malformedPlace(statusCode: number, body: unknown): Result<Place, UnexpectedResponseError> {\n\treturn {\n\t\terr: new UnexpectedResponseError(MALFORMED_PLACE_MESSAGE, {\n\t\t\tdetails: toJsonDetails(body),\n\t\t\tstatusCode,\n\t\t}),\n\t\tsuccess: false,\n\t};\n}\n\nfunction toPlace({ id, body, universeId }: ToPlaceArgs): Place {\n\treturn {\n\t\tid,\n\t\tcreatedAt: new Date(body.createTime),\n\t\tdescription: body.description,\n\t\tdisplayName: body.displayName,\n\t\troot: body.root ?? false,\n\t\tserverSize: body.serverSize ?? undefined,\n\t\tuniverseId,\n\t\tuniverseRuntimeCreation: body.universeRuntimeCreation ?? false,\n\t\tupdatedAt: new Date(body.updateTime),\n\t};\n}\n\nfunction hasValidPlaceRequired(body: Record<string, unknown>): boolean {\n\treturn (\n\t\ttypeof body[\"path\"] === \"string\" &&\n\t\tisDateTimeString(body[\"createTime\"]) &&\n\t\tisDateTimeString(body[\"updateTime\"]) &&\n\t\ttypeof body[\"displayName\"] === \"string\" &&\n\t\ttypeof body[\"description\"] === \"string\"\n\t);\n}\n\nfunction isOptionalBoolean(value: unknown): boolean {\n\treturn value === undefined || value === null || typeof value === \"boolean\";\n}\n\nfunction hasValidPlaceOptional(body: Record<string, unknown>): boolean {\n\tconst serverSize = body[\"serverSize\"] ?? undefined;\n\treturn (\n\t\t(serverSize === undefined || typeof serverSize === \"number\") &&\n\t\tisOptionalBoolean(body[\"root\"]) &&\n\t\tisOptionalBoolean(body[\"universeRuntimeCreation\"])\n\t);\n}\n\nfunction isPlaceWire(body: unknown): body is PlaceWire {\n\treturn isRecord(body) && hasValidPlaceRequired(body) && hasValidPlaceOptional(body);\n}\n","import type { HttpRequest } from \"../../../internal/http/types.ts\";\nimport type { ListPlacesParameters } from \"./types.ts\";\n\n/**\n * Builds the `GET` request listing one page of a universe's places. Maps\n * `pageSize` to `limit` and `pageToken` to `cursor`, each only when defined.\n *\n * @param parameters - Universe ID plus optional pagination fields.\n * @returns A pure {@link HttpRequest} describing the list call.\n */\nexport function buildListPlacesRequest(parameters: ListPlacesParameters): HttpRequest {\n\tconst query = new URLSearchParams();\n\tif (parameters.pageSize !== undefined) {\n\t\tquery.append(\"limit\", String(parameters.pageSize));\n\t}\n\n\tif (parameters.pageToken !== undefined) {\n\t\tquery.append(\"cursor\", parameters.pageToken);\n\t}\n\n\tconst queryString = query.toString();\n\tconst base = `/v1/universes/${parameters.universeId}/places`;\n\treturn { method: \"GET\", url: queryString === \"\" ? base : `${base}?${queryString}` };\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/** Origin of the unauthenticated develop places endpoint. */\nexport const LIST_PLACES_BASE_URL = \"https://develop.roblox.com\";\n\n/**\n * Per-second ceiling for listing places. Not published in the OpenAPI spec;\n * observed 2026-11-09 on 200 and 400 responses as\n * `x-ratelimit-limit: 10000, 10000;w=60` (10000 requests per 60 seconds).\n * The window is fixed: a 429's `retry-after` is shorter than the window,\n * which reopens only at `x-ratelimit-reset`.\n */\nexport const LIST_PLACES_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 10_000 / 60,\n\toperationKey: \"places.list\",\n});\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { UnexpectedResponseError } from \"../../../errors/unexpected-response.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport { toJsonDetails } from \"../../../internal/utils/to-json-details.ts\";\nimport type { Page, Result } from \"../../../types.ts\";\nimport type { PlaceSummary } from \"./types.ts\";\n\ninterface PlaceWire {\n\treadonly id: number;\n\treadonly name: string;\n\treadonly description: string;\n\treadonly universeId: number;\n}\n\n/**\n * Parses one page of a universe's places. Numeric IDs become strings and a\n * `null` next cursor becomes `undefined`.\n *\n * @param response - The HTTP response to parse.\n * @returns The parsed page or an `UnexpectedResponseError` when the body is\n * malformed.\n */\nexport function parsePlacesListResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<Page<PlaceSummary>, UnexpectedResponseError> {\n\tif (!isRecord(body) || !Array.isArray(body[\"data\"])) {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\tconst nextPageToken = body[\"nextPageCursor\"] ?? undefined;\n\tif (nextPageToken !== undefined && typeof nextPageToken !== \"string\") {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\tconst items: Array<PlaceSummary> = [];\n\tconst places = body[\"data\"];\n\tfor (const item of places) {\n\t\tif (!isPlaceWire(item)) {\n\t\t\treturn malformed(statusCode, body);\n\t\t}\n\n\t\titems.push({\n\t\t\tid: String(item.id),\n\t\t\tname: item.name,\n\t\t\tdescription: item.description,\n\t\t\tuniverseId: String(item.universeId),\n\t\t});\n\t}\n\n\treturn { data: { items, nextPageToken }, success: true };\n}\n\nfunction isPlaceWire(value: unknown): value is PlaceWire {\n\treturn (\n\t\tisRecord(value) &&\n\t\tNumber.isSafeInteger(value[\"id\"]) &&\n\t\tNumber.isSafeInteger(value[\"universeId\"]) &&\n\t\ttypeof value[\"name\"] === \"string\" &&\n\t\ttypeof value[\"description\"] === \"string\"\n\t);\n}\n\nfunction malformed(\n\tstatusCode: number,\n\tbody: unknown,\n): Result<Page<PlaceSummary>, UnexpectedResponseError> {\n\treturn {\n\t\terr: new UnexpectedResponseError(\"Malformed places list response\", {\n\t\t\tdetails: toJsonDetails(body),\n\t\t\tstatusCode,\n\t\t}),\n\t\tsuccess: false,\n\t};\n}\n","import type { HttpRequest } from \"../../../client/types.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport { matchesSignature, RBXL_SIGNATURE, RBXLX_SIGNATURE } from \"./signatures.ts\";\nimport type { PublishParameters } from \"./types.ts\";\n\n/**\n * Whether a publish call writes a live (`Published`) or draft (`Saved`)\n * version. Surfaces only as the `versionType` query string on the\n * underlying HTTP request.\n */\ntype VersionType = \"Published\" | \"Saved\";\n\nconst CONTENT_TYPE_BY_FORMAT: Readonly<Record<PublishParameters[\"format\"], string>> = {\n\trbxl: \"application/octet-stream\",\n\trbxlx: \"application/xml\",\n};\n\n/**\n * Builds a `POST` request for the Open Cloud \"publish place version\"\n * endpoint. Performs two local validations before producing any\n * {@link HttpRequest}: a non-empty body check and a magic-byte check\n * that the bytes' actual format matches `parameters.format`.\n *\n * @param parameters - Universe and place identifiers, the place file\n * bytes, and the declared `format` of those bytes.\n * @param versionType - `\"Published\"` for `publish()`, `\"Saved\"` for\n * `save()`; baked into the `?versionType=` query string.\n * @returns A success result wrapping the request on success, or a\n * {@link ValidationError} when the body is empty or its magic bytes\n * disagree with `parameters.format`.\n */\nexport function buildPublishRequest(\n\t{ body, format, placeId, universeId }: PublishParameters,\n\tversionType: VersionType,\n): Result<HttpRequest, ValidationError> {\n\tconst validationError = validateBody(body, format);\n\tif (validationError !== undefined) {\n\t\treturn { err: validationError, success: false };\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tbody,\n\t\t\theaders: { \"content-type\": CONTENT_TYPE_BY_FORMAT[format] },\n\t\t\tmethod: \"POST\",\n\t\t\turl: `/universes/v1/${universeId}/places/${placeId}/versions?versionType=${versionType}`,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\n/**\n * Checks a place body against the format its caller declared: non-empty, and\n * carrying the magic bytes of `format`. Emptiness is checked first so a\n * zero-byte body reports `empty_body` rather than a signature mismatch.\n *\n * @param body - The raw place file bytes.\n * @param format - The format the caller declared the bytes to be in.\n * @returns The {@link ValidationError} to fail with, or `undefined` when the\n * body is usable.\n */\nfunction validateBody(\n\tbody: PublishParameters[\"body\"],\n\tformat: PublishParameters[\"format\"],\n): undefined | ValidationError {\n\tif (body.length === 0) {\n\t\treturn new ValidationError(\"Place body is empty\", { code: \"empty_body\" });\n\t}\n\n\tconst expectedSignature = format === \"rbxl\" ? RBXL_SIGNATURE : RBXLX_SIGNATURE;\n\tif (!matchesSignature(body, expectedSignature)) {\n\t\treturn new ValidationError(`Place body does not match the declared \"${format}\" format`, {\n\t\t\tcode: \"format_mismatch\",\n\t\t});\n\t}\n\n\treturn undefined;\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst PUBLISH_PER_MINUTE = 30;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for publishing or saving a place version,\n * from the Open Cloud OpenAPI schema (30 requests per minute, which works\n * out to `0.5` per second and is also the burst the server allows). The\n * publish and save methods both reference this constant so that a single\n * per-API-key queue serves both, matching Roblox's server-side accounting\n * which counts both call types against the same per-minute quota.\n */\nexport const PUBLISH_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tburstCapacity: PUBLISH_PER_MINUTE,\n\tmaxPerSecond: PUBLISH_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"places.publishVersion\",\n});\n\n/**\n * Scopes required to publish or save a place version, sourced from\n * `x-roblox-scopes` on the `Places_CreatePlaceVersionApiKey` operation\n * in the vendored OpenAPI schema.\n */\nexport const PUBLISH_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe-places:write\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { UnexpectedResponseError } from \"../../../errors/unexpected-response.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport { toJsonDetails } from \"../../../internal/utils/to-json-details.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { PlaceVersion } from \"./types.ts\";\nimport type { PlaceVersionWire } from \"./wire.ts\";\n\n/**\n * Parses a successful publish-version response into the public\n * {@link PlaceVersion} shape. The Roblox endpoint sometimes returns the\n * JSON-shaped body under a `text/plain` `Content-Type`, so the body may\n * arrive either pre-decoded as a JSON object or still in its raw string\n * form; both are accepted here.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link PlaceVersion}, or\n * an {@link UnexpectedResponseError} when the body is malformed or its\n * `versionNumber` field is missing/wrong-typed.\n */\nexport function parsePublishResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<PlaceVersion, UnexpectedResponseError> {\n\tconst decodeResult = decodeBody(body, statusCode);\n\tif (!decodeResult.success) {\n\t\treturn decodeResult;\n\t}\n\n\tif (!isPlaceVersionWire(decodeResult.data)) {\n\t\treturn {\n\t\t\terr: new UnexpectedResponseError(\"Malformed publish response\", {\n\t\t\t\tdetails: toJsonDetails(body),\n\t\t\t\tstatusCode,\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn {\n\t\tdata: { versionNumber: decodeResult.data.versionNumber },\n\t\tsuccess: true,\n\t};\n}\n\nfunction decodeBody(body: unknown, statusCode: number): Result<unknown, UnexpectedResponseError> {\n\tif (typeof body !== \"string\") {\n\t\treturn { data: body, success: true };\n\t}\n\n\ttry {\n\t\treturn { data: JSON.parse(body), success: true };\n\t} catch (err) {\n\t\treturn {\n\t\t\terr: new UnexpectedResponseError(\"Malformed publish response\", {\n\t\t\t\tcause: err,\n\t\t\t\tdetails: body,\n\t\t\t\tstatusCode,\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n}\n\nfunction isPlaceVersionWire(value: unknown): value is PlaceVersionWire {\n\tif (!isRecord(value)) {\n\t\treturn false;\n\t}\n\n\treturn typeof value[\"versionNumber\"] === \"number\";\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport { LIST_LOGS_SPEC } from \"../../domains/cloud-v2/luau-execution-task-logs/specs.ts\";\nimport type {\n\tListLogsParameters,\n\tLogPage,\n} from \"../../domains/cloud-v2/luau-execution-task-logs/types.ts\";\nimport { GET_SPEC } from \"../../domains/cloud-v2/luau-execution-tasks/specs.ts\";\nimport type {\n\tGetParameters,\n\tLuauExecutionTask,\n\tLuauExecutionTaskRef,\n\tSubmitAtHeadParameters,\n\tSubmitAtVersionParameters,\n} from \"../../domains/cloud-v2/luau-execution-tasks/types.ts\";\nimport { buildGetRequest, buildUpdateRequest } from \"../../domains/cloud-v2/places/builders.ts\";\nimport {\n\tGET_OPERATION_LIMIT,\n\tUPDATE_OPERATION_LIMIT,\n\tUPDATE_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/places/operations.ts\";\nimport { parsePlaceResponse } from \"../../domains/cloud-v2/places/parsers.ts\";\nimport type {\n\tGetPlaceParameters,\n\tPlace,\n\tUpdatePlaceParameters,\n} from \"../../domains/cloud-v2/places/types.ts\";\nimport { buildListPlacesRequest } from \"../../domains/develop/places/builders.ts\";\nimport {\n\tLIST_PLACES_BASE_URL,\n\tLIST_PLACES_OPERATION_LIMIT,\n} from \"../../domains/develop/places/operations.ts\";\nimport { parsePlacesListResponse } from \"../../domains/develop/places/parsers.ts\";\nimport type { ListPlacesParameters, PlaceSummary } from \"../../domains/develop/places/types.ts\";\nimport { buildPublishRequest } from \"../../domains/universes/places/builders.ts\";\nimport {\n\tPUBLISH_OPERATION_LIMIT,\n\tPUBLISH_REQUIRED_SCOPES,\n} from \"../../domains/universes/places/operations.ts\";\nimport { parsePublishResponse } from \"../../domains/universes/places/parsers.ts\";\nimport type { PlaceVersion, PublishParameters } from \"../../domains/universes/places/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { waitForQuotaReset } from \"../../internal/http/retry-guidance.ts\";\nimport { IDEMPOTENT_METHOD_DEFAULTS, UPLOAD_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport {\n\tokRequest,\n\tResourceClient,\n\ttype ResourceMethodSpec,\n} from \"../../internal/resource-client.ts\";\nimport type { Page, Result } from \"../../types.ts\";\nimport {\n\ttype LuauExecutionRunOptions,\n\ttype LuauExecutionSubmitOptions,\n\tsubmitWithCapacityAsync,\n} from \"../luau-execution/capacity-admission.ts\";\nimport { buildPollDependencies, submitAndPollAsync } from \"../luau-execution/polling-helpers.ts\";\nimport {\n\tpollUntilDoneCoreAsync,\n\ttype PollUntilDoneOptions,\n\twithBudgetRequestTimeout,\n} from \"../luau-execution/polling.ts\";\n\n/**\n * Operation Group exposed by {@link PlacesClient} as the\n * `luauExecution` namespace. Provides `submit` to queue a Luau script,\n * `get` to fetch a task's current state, and `listLogs` to retrieve\n * structured log messages. Shares the same dispatch wiring as the\n * top-level `LuauExecutionClient` exposed at\n * `@bedrock-rbx/ocale/luau-execution`.\n *\n * @since 0.1.0\n */\nexport interface LuauExecutionHandle {\n\t/**\n\t * Fetches the current state of a previously-submitted Luau\n\t * execution task. Uses idempotent retry semantics for both 429 and\n\t * 5xx.\n\t *\n\t * @param parameters - The task ref plus an optional `view` selector.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.credential} for this call only).\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link LuauExecutionTask} or the {@link OpenCloudError} that\n\t * caused the request to fail.\n\t */\n\tget(\n\t\tparameters: GetParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Lists one page of structured log messages produced by a\n\t * previously-submitted Luau execution task. Messages from multiple\n\t * server-side chunks are flattened into a single ordered array.\n\t * Uses idempotent retry semantics for both 429 and 5xx.\n\t *\n\t * @param parameters - The task ref and optional pagination controls\n\t * (`pageSize`, `pageToken`).\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.credential} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link LogPage} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tlistLogs(\n\t\tparameters: ListLogsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LogPage, OpenCloudError>>;\n\t/**\n\t * Polls `get` with `view=BASIC` on a configurable backoff schedule until\n\t * the task reaches a terminal state, the wall-clock budget is exhausted,\n\t * or the supplied `AbortSignal` fires. Returns the terminal task on\n\t * success. The budget also bounds an in-flight\n\t * request through its request deadline, so a hanging request ends with\n\t * `PollTimeoutError` at the budget.\n\t *\n\t * @param ref - Reference to the task to poll, typically returned by `submit`.\n\t * @param options - Polling and per-request overrides.\n\t * @returns A {@link Result} wrapping the terminal {@link LuauExecutionTask},\n\t * or an error if aborted, timed out, or the transport fails.\n\t */\n\tpollUntilDone(\n\t\tref: LuauExecutionTaskRef,\n\t\toptions?: PollUntilDoneOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Submits a Luau script and polls `get` with `view=BASIC` until the\n\t * task reaches a terminal state, the wall-clock budget is exhausted,\n\t * or the supplied `AbortSignal` fires. Combines `submit` and\n\t * `pollUntilDone` in one call. The budget opens before the submit\n\t * and covers it, and bounds each in-flight request through its request\n\t * deadline.\n\t *\n\t * @param parameters - The same input accepted by `submit`.\n\t * @param options - Polling and per-request overrides.\n\t * @returns A {@link Result} wrapping the terminal\n\t * {@link LuauExecutionTask}, or an error if submit fails, the task\n\t * is aborted, timed out, or the transport fails.\n\t */\n\trunUntilDone(\n\t\tparameters: SubmitAtHeadParameters | SubmitAtVersionParameters,\n\t\toptions?: LuauExecutionRunOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Submits a Luau script for execution against a place. Dispatches\n\t * to the head-version URL when `versionId` is omitted, or to the\n\t * specific-version URL when one is supplied. Both URL shapes share\n\t * one rate-limit queue and one required-scope set.\n\t *\n\t * @param parameters - The universe and place identifiers, the\n\t * script to run, an optional `versionId`, and any other writable\n\t * submit fields.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.credential} for this call only).\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link LuauExecutionTask} or the {@link OpenCloudError} that\n\t * caused the request to fail.\n\t */\n\tsubmit(\n\t\tparameters: SubmitAtHeadParameters | SubmitAtVersionParameters,\n\t\toptions?: LuauExecutionSubmitOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n}\n\nfunction makePublishSpec(\n\tversionType: \"Published\" | \"Saved\",\n): ResourceMethodSpec<PublishParameters, PlaceVersion> {\n\treturn Object.freeze({\n\t\tapiKeyOnly: true,\n\t\tbuildRequest: (parameters: PublishParameters) => {\n\t\t\treturn buildPublishRequest(parameters, versionType);\n\t\t},\n\t\tmethodDefaults: UPLOAD_METHOD_DEFAULTS,\n\t\tmethodKind: \"create\",\n\t\toperationLimit: PUBLISH_OPERATION_LIMIT,\n\t\tparse: parsePublishResponse,\n\t\trequiredScopes: PUBLISH_REQUIRED_SCOPES,\n\t});\n}\n\nconst PUBLISH_SPEC = makePublishSpec(\"Published\");\nconst SAVE_SPEC = makePublishSpec(\"Saved\");\n\nconst GET_PLACE_SPEC: ResourceMethodSpec<GetPlaceParameters, Place> = Object.freeze({\n\tbuildRequest: buildGetRequest,\n\tmethodDefaults: {},\n\tmethodKind: \"idempotent\",\n\toperationLimit: GET_OPERATION_LIMIT,\n\tparse: parsePlaceResponse,\n});\n\nconst LIST_PLACES_SPEC: ResourceMethodSpec<\n\tListPlacesParameters,\n\tPage<PlaceSummary>\n> = Object.freeze({\n\tbuildRequest: (parameters: ListPlacesParameters) => {\n\t\treturn okRequest(buildListPlacesRequest(parameters));\n\t},\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: LIST_PLACES_OPERATION_LIMIT,\n\tparse: parsePlacesListResponse,\n\tunauthenticatedBaseUrl: LIST_PLACES_BASE_URL,\n});\n\nconst UPDATE_SPEC: ResourceMethodSpec<UpdatePlaceParameters, Place> = Object.freeze({\n\tbuildRequest: buildUpdateRequest,\n\tmethodDefaults: {},\n\tmethodKind: \"idempotent\",\n\toperationLimit: UPDATE_OPERATION_LIMIT,\n\tparse: parsePlaceResponse,\n\trequiredScopes: UPDATE_REQUIRED_SCOPES,\n});\n\n/**\n * Public client for the Roblox Open Cloud `Place` resource. Covers\n * place-version publishing (`publish`, `save`), place-configuration\n * updates (`update`), and the Luau execution Operation Group\n * (`luauExecution.submit`, `luauExecution.get`). Every method returns\n * a {@link Result} so callers handle failure explicitly; no thrown\n * {@link OpenCloudError} ever escapes the client.\n *\n * Publishing or saving a 5xx-failed place version is not retried\n * automatically: Roblox does not support idempotency keys, so a retry\n * could publish a duplicate version unnoticed. Callers that *can* detect\n * duplicates externally may opt back into 5xx retry per-call by passing\n * `retryableStatuses` on the second argument. The `update` method, by\n * contrast, is idempotent and retries both 429 and 5xx automatically.\n *\n * Failures that never reached Open Cloud *are* retried: transient transport\n * errors, and responses served by an edge gateway rather than the API. Neither\n * can have created a version, so neither risks the duplicate a 5xx does.\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { PlacesClient } from \"@bedrock-rbx/ocale/places\";\n *\n * const client = new PlacesClient({ credential: { apiKey: \"your-key\", kind: \"apiKey\" } });\n * expect(client).toBeInstanceOf(PlacesClient);\n * ```\n */\nexport class PlacesClient {\n\treadonly #inner: ResourceClient;\n\n\tpublic readonly luauExecution: LuauExecutionHandle;\n\n\t/**\n\t * Creates a new {@link PlacesClient}. Configuration is frozen on\n\t * construction; per-request overrides are accepted on each method.\n\t *\n\t * @param options - Client-level configuration including the API key.\n\t */\n\tconstructor(options: OpenCloudClientOptions) {\n\t\tthis.#inner = new ResourceClient(options);\n\t\tthis.luauExecution = createLuauExecutionHandle(this.#inner);\n\t}\n\n\t/**\n\t * Reads a place's configuration, including whether it is the universe's\n\t * root.\n\t *\n\t * @since 0.4.0\n\t * @param parameters - Owning universe and place identifiers.\n\t * @param options - Per-request overrides.\n\t * @returns The parsed place or the Open Cloud failure.\n\t */\n\tpublic async get(\n\t\tparameters: GetPlaceParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<Place, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: GET_PLACE_SPEC });\n\t}\n\n\t/**\n\t * Lists one page of the places of a universe. Omit `pageToken` for the\n\t * first page, then pass the returned `nextPageToken` until it is\n\t * undefined. An unknown universe yields an empty page.\n\t *\n\t * The read is unauthenticated: it sends no credential and is served from\n\t * `https://develop.roblox.com`, so the client `baseUrl` does not apply.\n\t * `pageSize` accepts only 10, 25, 50 or 100 and defaults to 10.\n\t * Roblox allows 10000 reads per caller in a fixed 60-second window. A 429\n\t * waits until the reported `x-ratelimit-reset` before it retries.\n\t *\n\t * @since 0.5.0\n\t * @param parameters - Universe ID and optional pagination fields.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the page of {@link PlaceSummary}\n\t * items, or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async list(\n\t\tparameters: ListPlacesParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<Page<PlaceSummary>, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({\n\t\t\toptions,\n\t\t\tparameters,\n\t\t\trefineError: waitForQuotaReset,\n\t\t\tspec: LIST_PLACES_SPEC,\n\t\t});\n\t}\n\n\t/**\n\t * Publishes a new live version of a place.\n\t *\n\t * No default request timeout applies to this upload; pass `options.timeout`\n\t * to set a per-call deadline.\n\t *\n\t * @param parameters - Universe and place identifiers, the place file\n\t * bytes, and their declared `format`.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.credential} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link PlaceVersion}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async publish(\n\t\tparameters: PublishParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<PlaceVersion, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: PUBLISH_SPEC });\n\t}\n\n\t/**\n\t * Saves a new draft version of a place. Identical to {@link publish}\n\t * except the resulting version is not made live; consumers can list or\n\t * promote it later. Shares a single per-API-key rate-limit queue with\n\t * `publish` because Roblox attributes both calls to the same per-minute\n\t * quota.\n\t *\n\t * No default request timeout applies to this upload; pass `options.timeout`\n\t * to set a per-call deadline.\n\t *\n\t * @param parameters - Universe and place identifiers, the place file\n\t * bytes, and their declared `format`.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.credential} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link PlaceVersion}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async save(\n\t\tparameters: PublishParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<PlaceVersion, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: SAVE_SPEC });\n\t}\n\n\t/**\n\t * Partially updates a place's configuration. The fields supplied on\n\t * `parameters` (excluding the identifiers) are forwarded to the\n\t * server via a Google-style `updateMask`; unmentioned fields are\n\t * left untouched. The universe's root place is the canonical place\n\t * to update when changing a universe's description or display name:\n\t * both are derived server-side from the root place.\n\t *\n\t * @param parameters - The universe and place identifiers and the\n\t * fields to update. At least one writable field must be supplied.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.credential} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link Place} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async update(\n\t\tparameters: UpdatePlaceParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<Place, OpenCloudError>> {\n\t\treturn this.#inner.executeAsync({ options, parameters, spec: UPDATE_SPEC });\n\t}\n}\n\nfunction createLuauExecutionHandle(inner: ResourceClient): LuauExecutionHandle {\n\treturn {\n\t\tasync get(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: GET_SPEC });\n\t\t},\n\t\tasync listLogs(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: LIST_LOGS_SPEC });\n\t\t},\n\t\tasync pollUntilDone(ref, options = {}) {\n\t\t\tconst resolved = withBudgetRequestTimeout(options);\n\t\t\treturn pollUntilDoneCoreAsync(\n\t\t\t\tbuildPollDependencies(inner, { options: resolved, ref }),\n\t\t\t\tresolved,\n\t\t\t);\n\t\t},\n\t\tasync runUntilDone(parameters, options = {}) {\n\t\t\treturn submitAndPollAsync(inner, {\n\t\t\t\toptions: withBudgetRequestTimeout(options),\n\t\t\t\tparameters,\n\t\t\t});\n\t\t},\n\t\tasync submit(parameters, options) {\n\t\t\treturn submitWithCapacityAsync({ inner, options, parameters });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;AAOA,MAAM,qCAA0C,IAAI,IAAI,CAAC,WAAW,YAAY,CAAC;;;;;;;AAQjF,SAAgB,gBACf,YACsC;CACtC,OAAO,UAAU;EAChB,QAAQ;EACR,KAAK,uBAAuB,WAAW,WAAW,UAAU,WAAW;CACxE,CAAC;AACF;;;;;;;;;;;;AAaA,SAAgB,mBACf,YACuC;CACvC,MAAM,YAAY,uBAAuB,UAAU;CAEnD,IAAI,UAAU,WAAW,GACxB,OAAO;EACN,KAAK,IAAI,gBAAgB,0CAA0C,EAClE,MAAM,eACP,CAAC;EACD,SAAS;CACV;CAGD,MAAM,OAAO,OAAO,YACnB,UAAU,KAAK,QAAoC,CAAC,KAAK,QAAQ,IAAI,YAAY,GAAG,CAAC,CAAC,CACvF;CACA,MAAM,aAAa,UAAU,KAAK,GAAG;CACrC,MAAM,EAAE,SAAS,eAAe;CAChC,OAAO;EACN,MAAM;GACL;GACA,SAAS,EAAE,gBAAgB,mBAAmB;GAC9C,QAAQ;GACR,KAAK,uBAAuB,WAAW,UAAU,QAAQ,cAAc;EACxE;EACA,SAAS;CACV;AACD;AAEA,SAAS,uBAAuB,YAA0D;CACzF,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,QAAQ,QAAQ,CAAC,mBAAmB,IAAI,GAAG,CAAC;AAC5E;;ACjEA,MAAM,oBAAoB;AAC1B,MAAMA,uBAAqB;;AAG3B,MAAa,sBAAsC,OAAO,OAAO;CAChE,cAAc,MAAMA;CACpB,cAAc;AACf,CAAC;;;;;;;;;AAUD,MAAa,yBAAyC,OAAO,OAAO;CACnE,cAAc,oBAAoBA;CAClC,cAAc;AACf,CAAC;;;;;;AAOD,MAAa,yBAAgD,OAAO,OAAO,CAC1E,sBACD,CAAC;;AC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;IAAE,SAAS;IAAU;GAAI,CAAC,GACvD,QACD;EACD;EACA,MAAM,aAAa,YAAY,UAAU,CAAC,GAAG;GAC5C,OAAO,mBAAmB,OAAO;IAChC,SAAS,yBAAyB,OAAO;IACzC;GACD,CAAC;EACF;EACA,MAAM,OAAO,YAAY,SAAS;GACjC,OAAO,wBAAwB;IAAE;IAAO;IAAS;GAAW,CAAC;EAC9D;CACD;AACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as OpenCloudError } from "./network-error-
|
|
2
|
-
|
|
1
|
+
import { s as OpenCloudError } from "./network-error-P4An7nUB.mjs";
|
|
2
|
+
// src/errors/poll-aborted.ts
|
|
3
3
|
/**
|
|
4
4
|
* Returned when `pollUntilDone` is interrupted by an `AbortSignal` before
|
|
5
5
|
* a terminal task state is reached. The `reason` field mirrors
|
|
@@ -35,8 +35,7 @@ var PollAbortedError = class extends OpenCloudError {
|
|
|
35
35
|
this.reason = options.reason;
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
|
|
39
|
-
//#region src/errors/poll-timeout.ts
|
|
38
|
+
// src/errors/poll-timeout.ts
|
|
40
39
|
/**
|
|
41
40
|
* Returned when `pollUntilDone` exhausts its wall-clock budget without
|
|
42
41
|
* observing a terminal task state. Carries the last task polled so callers
|
|
@@ -77,7 +76,6 @@ var PollTimeoutError = class extends OpenCloudError {
|
|
|
77
76
|
this.timeoutMs = options.timeoutMs;
|
|
78
77
|
}
|
|
79
78
|
};
|
|
80
|
-
//#endregion
|
|
81
79
|
export { PollAbortedError as n, PollTimeoutError as t };
|
|
82
80
|
|
|
83
|
-
//# sourceMappingURL=poll-timeout-
|
|
81
|
+
//# sourceMappingURL=poll-timeout-BCxgN97O.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poll-timeout-
|
|
1
|
+
{"version":3,"file":"poll-timeout-BCxgN97O.mjs","names":[],"sources":["../src/errors/poll-aborted.ts","../src/errors/poll-timeout.ts"],"sourcesContent":["import { OpenCloudError } from \"./base.ts\";\n\n/**\n * Options for constructing a {@link PollAbortedError}.\n *\n * @since 0.1.0\n */\nexport interface PollAbortedErrorOptions extends ErrorOptions {\n\t/** Whatever `AbortSignal.reason` was at the moment of abort. */\n\treadonly reason?: unknown;\n}\n\n/**\n * Returned when `pollUntilDone` is interrupted by an `AbortSignal` before\n * a terminal task state is reached. The `reason` field mirrors\n * `AbortSignal.reason` so callers can distinguish intentional cancellation\n * from unexpected abort sources.\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { PollAbortedError } from \"@bedrock-rbx/ocale\";\n *\n * const error = new PollAbortedError(\"polling was aborted\", {\n * reason: \"user cancelled\",\n * });\n *\n * expect(error).toBeInstanceOf(PollAbortedError);\n * expect(error.reason).toBe(\"user cancelled\");\n * ```\n */\nexport class PollAbortedError extends OpenCloudError {\n\tpublic override readonly name: string = \"PollAbortedError\";\n\tpublic readonly reason?: unknown;\n\n\t/**\n\t * Creates a new PollAbortedError.\n\t *\n\t * @param message - Human-readable description of the abort.\n\t * @param options - Error options including the abort reason.\n\t */\n\tconstructor(message: string, options: PollAbortedErrorOptions = {}) {\n\t\tsuper(message, options);\n\t\tthis.reason = options.reason;\n\t}\n}\n","import { OpenCloudError } from \"./base.ts\";\n\n/**\n * Options for {@link PollTimeoutError}. The `T` type parameter captures the\n * resource-specific task variant the caller polled for; defaults to `unknown`\n * so the class can be reused by future Resources without forcing a parallel\n * hierarchy.\n *\n * @since 0.1.0\n *\n * @template T - Resource-specific task type being polled.\n */\nexport interface PollTimeoutErrorOptions<T = unknown> extends ErrorOptions {\n\t/** Last task observed before the timeout budget was exhausted. */\n\treadonly lastObservedTask?: T | undefined;\n\t/** Total wall-clock budget supplied by the caller, in ms. */\n\treadonly timeoutMs: number;\n}\n\n/**\n * Returned when `pollUntilDone` exhausts its wall-clock budget without\n * observing a terminal task state. Carries the last task polled so callers\n * can inspect state and decide whether to retry with a fresh budget.\n *\n * @since 0.1.0\n *\n * @template T - Resource-specific task type being polled.\n *\n * @example\n *\n * ```ts\n * import { PollTimeoutError } from \"@bedrock-rbx/ocale\";\n *\n * const error = new PollTimeoutError(\"polling timed out after 5 s\", {\n * lastObservedTask: { state: \"PROCESSING\" as const },\n * timeoutMs: 5000,\n * });\n *\n * expect(error).toBeInstanceOf(PollTimeoutError);\n * expect(error.timeoutMs).toBe(5000);\n * expect(error.lastObservedTask).toStrictEqual({ state: \"PROCESSING\" });\n * ```\n */\nexport class PollTimeoutError<T = unknown> extends OpenCloudError {\n\tpublic readonly lastObservedTask: T | undefined;\n\tpublic override readonly name: string = \"PollTimeoutError\";\n\tpublic readonly timeoutMs: number;\n\n\t/**\n\t * Creates a new PollTimeoutError.\n\t *\n\t * @param message - Human-readable description of the timeout.\n\t * @param options - Error options including the budget and last-observed task.\n\t */\n\tconstructor(message: string, options: PollTimeoutErrorOptions<T>) {\n\t\tsuper(message, options);\n\t\tthis.lastObservedTask = options.lastObservedTask;\n\t\tthis.timeoutMs = options.timeoutMs;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAa,mBAAb,cAAsC,eAAe;CACpD,OAAwC;CACxC;;;;;;;CAQA,YAAY,SAAiB,UAAmC,CAAC,GAAG;EACnE,MAAM,SAAS,OAAO;EACtB,KAAK,SAAS,QAAQ;CACvB;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;ACJA,IAAa,mBAAb,cAAmD,eAAe;CACjE;CACA,OAAwC;CACxC;;;;;;;CAQA,YAAY,SAAiB,SAAqC;EACjE,MAAM,SAAS,OAAO;EACtB,KAAK,mBAAmB,QAAQ;EAChC,KAAK,YAAY,QAAQ;CAC1B;AACD"}
|