@bedrock-rbx/ocale 0.3.1 → 0.3.2
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 +13 -1
- package/dist/badges.d.mts +1 -1
- package/dist/badges.mjs +3 -3
- package/dist/{polling-0t1wQyVY.d.mts → capacity-admission-BvnJjY0S.d.mts} +35 -3
- package/dist/capacity-admission-BvnJjY0S.d.mts.map +1 -0
- package/dist/developer-products.d.mts +1 -1
- package/dist/developer-products.mjs +4 -4
- package/dist/game-passes.d.mts +1 -1
- package/dist/game-passes.mjs +4 -4
- package/dist/index.d.mts +112 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/luau-execution.d.mts +39 -5
- package/dist/luau-execution.d.mts.map +1 -1
- package/dist/luau-execution.mjs +8 -13
- package/dist/luau-execution.mjs.map +1 -1
- package/dist/{network-error-DmNy_j-u.mjs → network-error-DR9FX5hb.mjs} +32 -7
- package/dist/network-error-DR9FX5hb.mjs.map +1 -0
- package/dist/places.d.mts +4 -4
- package/dist/places.d.mts.map +1 -1
- package/dist/places.mjs +8 -13
- package/dist/places.mjs.map +1 -1
- package/dist/{poll-timeout-wrPTnGl_.mjs → poll-timeout-3PXLsabj.mjs} +2 -2
- package/dist/{poll-timeout-wrPTnGl_.mjs.map → poll-timeout-3PXLsabj.mjs.map} +1 -1
- package/dist/{polling-helpers-CzdT2FS5.mjs → polling-helpers-CFuSt2O5.mjs} +323 -21
- package/dist/polling-helpers-CFuSt2O5.mjs.map +1 -0
- package/dist/{price-information-Czs5cWR1.mjs → price-information-D8BxwgTS.mjs} +2 -2
- package/dist/{price-information-Czs5cWR1.mjs.map → price-information-D8BxwgTS.mjs.map} +1 -1
- package/dist/{resource-client-aqk_V4TD.mjs → resource-client--yYybltk.mjs} +254 -72
- package/dist/resource-client--yYybltk.mjs.map +1 -0
- package/dist/resource-client-BivRq3JZ.d.mts +164 -0
- package/dist/resource-client-BivRq3JZ.d.mts.map +1 -0
- package/dist/{retry-DIK_T_oF.mjs → retry-Cc4LcXYZ.mjs} +266 -132
- package/dist/retry-Cc4LcXYZ.mjs.map +1 -0
- package/dist/{retry-Cj5OXCdL.d.mts → retry-DXEklFrt.d.mts} +51 -16
- package/dist/{retry-Cj5OXCdL.d.mts.map → retry-DXEklFrt.d.mts.map} +1 -1
- package/dist/storage.d.mts +2 -158
- package/dist/storage.d.mts.map +1 -1
- package/dist/storage.mjs +3 -3
- package/dist/testing.d.mts +1 -1
- package/dist/testing.mjs +1 -1
- package/dist/{types-D_njb3qW.d.mts → types-C3Egi37J.d.mts} +14 -8
- package/dist/types-C3Egi37J.d.mts.map +1 -0
- package/dist/universes.d.mts +1 -1
- package/dist/universes.mjs +4 -4
- package/dist/{validation-BwjwOJPD.mjs → validation-B_Zs1So2.mjs} +2 -2
- package/dist/{validation-BwjwOJPD.mjs.map → validation-B_Zs1So2.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/network-error-DmNy_j-u.mjs.map +0 -1
- package/dist/polling-0t1wQyVY.d.mts.map +0 -1
- package/dist/polling-helpers-CzdT2FS5.mjs.map +0 -1
- package/dist/resource-client-aqk_V4TD.mjs.map +0 -1
- package/dist/retry-DIK_T_oF.mjs.map +0 -1
- package/dist/types-D_njb3qW.d.mts.map +0 -1
package/README.md
CHANGED
|
@@ -123,6 +123,14 @@ After retry attempts are exhausted, the final failure surfaces on `result.err`
|
|
|
123
123
|
as the typed error that caused it (`RateLimitError` for 429s, `ApiError` for
|
|
124
124
|
5xx, `NetworkError` for transport-level faults, and so on).
|
|
125
125
|
|
|
126
|
+
A 429 status does not identify one semantic cause. `RateLimitError` preserves
|
|
127
|
+
the upstream `code`, parsed `details`, and an allowlisted `responseHeaders`
|
|
128
|
+
record so consumers can inspect the available evidence. Treat those fields as
|
|
129
|
+
evidence rather than an exhaustive kind: request quota, a longer shared meter,
|
|
130
|
+
and occupied operation capacity can produce overlapping response shapes.
|
|
131
|
+
Resource-specific code should classify a narrower cause only from positive
|
|
132
|
+
domain evidence, such as validated blocker task references.
|
|
133
|
+
|
|
126
134
|
Observability hooks (`onRequest`, `onRetry`, `onRateLimit`) accept callbacks on
|
|
127
135
|
the client constructor for logging, metrics, or tracing integration.
|
|
128
136
|
|
|
@@ -136,13 +144,17 @@ const client = new GamePassesClient({ apiKey: "main-key" });
|
|
|
136
144
|
|
|
137
145
|
const result = await client.create(parameters, {
|
|
138
146
|
apiKey: "asset-upload-key", // different key for moderation safety
|
|
147
|
+
deadlineMs: Date.now() + 495_000,
|
|
139
148
|
timeout: 60_000,
|
|
140
149
|
});
|
|
141
150
|
```
|
|
142
151
|
|
|
143
152
|
This pattern fits multi-tenant tooling (different API keys per workspace),
|
|
144
153
|
credential rotation (swap mid-batch), and isolating retry / timeout policies to
|
|
145
|
-
specific calls.
|
|
154
|
+
specific calls. `deadlineMs` is an absolute timestamp for the whole logical
|
|
155
|
+
call. A retry, operation-queue wait, or reported-budget wait that cannot finish
|
|
156
|
+
before it fails with `RequestDeadlineExceededError`; an oversized retry keeps
|
|
157
|
+
its server delay on the more specific `RetryDelayExceededError`.
|
|
146
158
|
|
|
147
159
|
## Testing helpers
|
|
148
160
|
|
package/dist/badges.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as Result, m as OpenCloudError, s as OpenCloudClientOptions, u as RequestOptions } from "./types-
|
|
1
|
+
import { f as Result, m as OpenCloudError, s as OpenCloudClientOptions, u as RequestOptions } from "./types-C3Egi37J.mjs";
|
|
2
2
|
import { i as RobloxLocale, r as RobloxLanguageCode } from "./data.generated-B2ceLfSn.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/badges/badges/types.d.ts
|
package/dist/badges.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as ApiError } from "./network-error-
|
|
2
|
-
import { r as IDEMPOTENT_METHOD_DEFAULTS, t as CREATE_METHOD_DEFAULTS } from "./retry-
|
|
1
|
+
import { a as ApiError } from "./network-error-DR9FX5hb.mjs";
|
|
2
|
+
import { r as IDEMPOTENT_METHOD_DEFAULTS, t as CREATE_METHOD_DEFAULTS } from "./retry-Cc4LcXYZ.mjs";
|
|
3
3
|
import { t as toBlob } from "./to-blob-RPqMBuft.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { c as isDateTimeString, n as okRequest, o as toJsonDetails, r as parseEmptyResponse, s as isRecord, t as ResourceClient } from "./resource-client--yYybltk.mjs";
|
|
5
5
|
//#region src/domains/badges/badges/builders.ts
|
|
6
6
|
/**
|
|
7
7
|
* Builds a `POST` request for the legacy "create badge" endpoint.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as RequestOptions } from "./types-
|
|
1
|
+
import { u as RequestOptions } from "./types-C3Egi37J.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/domains/cloud-v2/luau-execution-tasks/types.d.ts
|
|
4
4
|
/**
|
|
@@ -329,9 +329,41 @@ interface PollOptions {
|
|
|
329
329
|
* already agreed to wait for the whole operation, so the backend can answer or
|
|
330
330
|
* surface a retryable status instead.
|
|
331
331
|
*
|
|
332
|
+
* @template TOptions - The concrete polling option shape to preserve.
|
|
332
333
|
* @param options - The caller's poll and per-request options.
|
|
333
334
|
* @returns The options with `timeout` filled from the budget when it was unset.
|
|
334
335
|
*/
|
|
335
336
|
//#endregion
|
|
336
|
-
|
|
337
|
-
|
|
337
|
+
//#region src/resources/luau-execution/capacity-admission.d.ts
|
|
338
|
+
/**
|
|
339
|
+
* Per-request options for submitting a Luau execution task.
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
*
|
|
343
|
+
* ```ts
|
|
344
|
+
* import type { LuauExecutionSubmitOptions } from "@bedrock-rbx/ocale/luau-execution";
|
|
345
|
+
*
|
|
346
|
+
* const options: LuauExecutionSubmitOptions = { capacityWaitMs: 60_000 };
|
|
347
|
+
* expect(options.capacityWaitMs).toBe(60_000);
|
|
348
|
+
* ```
|
|
349
|
+
*
|
|
350
|
+
* @since 0.3.2
|
|
351
|
+
*/
|
|
352
|
+
interface LuauExecutionSubmitOptions extends RequestOptions {
|
|
353
|
+
/**
|
|
354
|
+
* Maximum milliseconds to spend waiting for occupied place capacity, from 1
|
|
355
|
+
* through 2,147,483,647. Supplying this value opts the submission into
|
|
356
|
+
* capacity-aware admission.
|
|
357
|
+
*/
|
|
358
|
+
readonly capacityWaitMs?: number;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Per-request capacity and polling options for submitting and awaiting a Luau
|
|
362
|
+
* execution task.
|
|
363
|
+
*
|
|
364
|
+
* @since 0.3.2
|
|
365
|
+
*/
|
|
366
|
+
type LuauExecutionRunOptions = LuauExecutionSubmitOptions & PollUntilDoneOptions;
|
|
367
|
+
//#endregion
|
|
368
|
+
export { ListLogsParameters as a, CompleteTask as c, InProgressTask as d, LuauExecutionTask as f, SubmitAtVersionParameters as h, defaultPollDelay as i, FailedTask as l, SubmitAtHeadParameters as m, LuauExecutionSubmitOptions as n, LogMessage as o, LuauExecutionTaskRef as p, PollUntilDoneOptions as r, LogPage as s, LuauExecutionRunOptions as t, GetParameters as u };
|
|
369
|
+
//# sourceMappingURL=capacity-admission-BvnJjY0S.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capacity-admission-BvnJjY0S.d.mts","names":[],"sources":["../src/domains/cloud-v2/luau-execution-tasks/types.ts","../src/domains/cloud-v2/luau-execution-task-logs/types.ts","../src/resources/luau-execution/polling.ts","../src/resources/luau-execution/capacity-admission.ts"],"mappings":";;;;;;AAOA;;;;UAAiB,sBAAA;;;;;WAKP,WAAA;EAaA;EAAA,SAXA,kBAAA;EAqBV;EAAA,SAnBU,OAAA;;WAEA,MAAA;;;;;WAKA,cAAA;;WAEA,UAAA;AAAA;AA8BA;AAYV;;;;;;AAZU,UApBO,yBAAA;;;;AA0CP;WArCA,WAAA;EA8CO;EAAA,SA5CP,kBAAA;EA8CK;EAAA,SA5CL,OAA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A;AASV;WC3CU,WAAA;AAAA;;;;;;ADmDA;AAYV;;UCpDiB,OAAA;EDoDuB;EAAA,SClD9B,QAAA,EAAU,aAAA,CAAc,UAAA;EDkElC;;;;EAAA,SC7DU,aAAA;AAAA;;;;;;;;;;ADpCA;AAUV;;;;;;;;;;;;iBEuBgB,gBAAA,CAAiB,SAAA;;;;AFqDvB;AAWV;;KE9BY,oBAAA,GAAuB,WAAA,GAAc,cAAA;;UAGvC,WAAA;;;;;;WAMA,0BAAA;;;;;WAKA,SAAA,IAAa,SAAA;EFmCvB;;;;EAAA,SE9BU,MAAA,GAAS,WAAA;;;;;WAKT,SAAA;AAAA;AFsDV;;;;;;;;;;;;AAA4D;AAAA;;;;;;;;;;;;;;AAjJlD;AAUV;;;;;UGEiB,0BAAA,SAAmC,cAAA;;;;;;WAM1C,cAAA;AAAA;AHwBV;;;;;;AAAA,KGfY,uBAAA,GAA0B,0BAAA,GAA6B,oBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as Result, m as OpenCloudError, s as OpenCloudClientOptions, u as RequestOptions } from "./types-
|
|
1
|
+
import { f as Result, m as OpenCloudError, s as OpenCloudClientOptions, u as RequestOptions } from "./types-C3Egi37J.mjs";
|
|
2
2
|
import { i as RobloxLocale, r as RobloxLanguageCode } from "./data.generated-B2ceLfSn.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/developer-products/products/types.d.ts
|
|
@@ -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-
|
|
1
|
+
import { a as ApiError } from "./network-error-DR9FX5hb.mjs";
|
|
2
|
+
import { r as IDEMPOTENT_METHOD_DEFAULTS, t as CREATE_METHOD_DEFAULTS } from "./retry-Cc4LcXYZ.mjs";
|
|
3
3
|
import { t as toBlob } from "./to-blob-RPqMBuft.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { n as isPriceInformationLike, t as copyPriceInformation } from "./price-information-
|
|
4
|
+
import { c as isDateTimeString, n as okRequest, o as toJsonDetails, r as parseEmptyResponse, s as isRecord, t as ResourceClient } from "./resource-client--yYybltk.mjs";
|
|
5
|
+
import { n as isPriceInformationLike, t as copyPriceInformation } from "./price-information-D8BxwgTS.mjs";
|
|
6
6
|
//#region src/domains/developer-products/products/builders.ts
|
|
7
7
|
/**
|
|
8
8
|
* Builds a `GET` request for the Open Cloud "read developer product"
|
package/dist/game-passes.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as Page, f as Result, m as OpenCloudError, s as OpenCloudClientOptions, u as RequestOptions } from "./types-
|
|
1
|
+
import { d as Page, f as Result, m as OpenCloudError, s as OpenCloudClientOptions, u as RequestOptions } from "./types-C3Egi37J.mjs";
|
|
2
2
|
import { i as RobloxLocale, r as RobloxLanguageCode } from "./data.generated-B2ceLfSn.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/game-internationalization/game-pass-icon/types.d.ts
|
package/dist/game-passes.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-
|
|
1
|
+
import { a as ApiError } from "./network-error-DR9FX5hb.mjs";
|
|
2
|
+
import { r as IDEMPOTENT_METHOD_DEFAULTS, t as CREATE_METHOD_DEFAULTS } from "./retry-Cc4LcXYZ.mjs";
|
|
3
3
|
import { t as toBlob } from "./to-blob-RPqMBuft.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { n as isPriceInformationLike, t as copyPriceInformation } from "./price-information-
|
|
4
|
+
import { c as isDateTimeString, n as okRequest, o as toJsonDetails, r as parseEmptyResponse, s as isRecord, t as ResourceClient } from "./resource-client--yYybltk.mjs";
|
|
5
|
+
import { n as isPriceInformationLike, t as copyPriceInformation } from "./price-information-D8BxwgTS.mjs";
|
|
6
6
|
//#region src/domains/game-internationalization/game-pass-icon/builders.ts
|
|
7
7
|
/**
|
|
8
8
|
* Builds a `POST` request for the localized "upload game-pass icon"
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as HttpRequest, c as OpenCloudHooks, d as Page, f as Result, h as OpenCloudErrorOptions, i as HttpClient, l as RequestConfig, m as OpenCloudError, n as AdmissionWaitObserver, o as HttpResponse, p as SleepFunc, r as AdmissionWaitReason, s as OpenCloudClientOptions, t as AdmissionWaitEvent, u as RequestOptions } from "./types-
|
|
2
|
-
import { a as TRANSIENT_TRANSPORT_CODES, c as NetworkError, d as ApiErrorOptions, f as ApiRequestContext, l as NetworkErrorOptions, o as RateLimitError, p as requestContextOf, r as RESPONSE_UNPARSEABLE, s as RateLimitErrorOptions, t as GATEWAY_REJECTED, u as ApiError } from "./retry-
|
|
1
|
+
import { a as HttpRequest, c as OpenCloudHooks, d as Page, f as Result, h as OpenCloudErrorOptions, i as HttpClient, l as RequestConfig, m as OpenCloudError, n as AdmissionWaitObserver, o as HttpResponse, p as SleepFunc, r as AdmissionWaitReason, s as OpenCloudClientOptions, t as AdmissionWaitEvent, u as RequestOptions } from "./types-C3Egi37J.mjs";
|
|
2
|
+
import { a as TRANSIENT_TRANSPORT_CODES, c as NetworkError, d as ApiErrorOptions, f as ApiRequestContext, l as NetworkErrorOptions, o as RateLimitError, p as requestContextOf, r as RESPONSE_UNPARSEABLE, s as RateLimitErrorOptions, t as GATEWAY_REJECTED, u as ApiError } from "./retry-DXEklFrt.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/client/fetch-http-client.d.ts
|
|
5
5
|
/**
|
|
@@ -266,6 +266,115 @@ declare class RequestAbortedError extends OpenCloudError {
|
|
|
266
266
|
constructor(message: string, options?: RequestAbortedErrorOptions);
|
|
267
267
|
}
|
|
268
268
|
//#endregion
|
|
269
|
+
//#region src/errors/request-deadline-exceeded.d.ts
|
|
270
|
+
/**
|
|
271
|
+
* Options for constructing a {@link RequestDeadlineExceededError}.
|
|
272
|
+
*
|
|
273
|
+
* @since 0.3.2
|
|
274
|
+
*/
|
|
275
|
+
interface RequestDeadlineExceededErrorOptions extends ErrorOptions {
|
|
276
|
+
/** Absolute caller-supplied deadline, as Unix epoch milliseconds. */
|
|
277
|
+
readonly deadlineMs: number;
|
|
278
|
+
/** Time left when the SDK refused or ended the wait. */
|
|
279
|
+
readonly remainingMs: number;
|
|
280
|
+
/** Intended wait duration, when it was known before waiting. */
|
|
281
|
+
readonly waitMs?: number | undefined;
|
|
282
|
+
/** SDK admission mechanism whose wait could not meet the deadline. */
|
|
283
|
+
readonly waitReason?: AdmissionWaitReason | undefined;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Returned when a logical request cannot complete by its absolute deadline.
|
|
287
|
+
* Optional wait details identify an SDK-managed admission wait that was
|
|
288
|
+
* refused. This is distinct from caller cancellation so consumers can report
|
|
289
|
+
* exhausted wall-clock budget accurately.
|
|
290
|
+
*
|
|
291
|
+
* @since 0.3.2
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
*
|
|
295
|
+
* ```ts
|
|
296
|
+
* import { RequestDeadlineExceededError } from "@bedrock-rbx/ocale";
|
|
297
|
+
*
|
|
298
|
+
* const error = new RequestDeadlineExceededError("Request deadline elapsed", {
|
|
299
|
+
* deadlineMs: 1_000_000,
|
|
300
|
+
* remainingMs: 0,
|
|
301
|
+
* waitReason: "operation-queue",
|
|
302
|
+
* });
|
|
303
|
+
*
|
|
304
|
+
* expect(error.remainingMs).toBe(0);
|
|
305
|
+
* expect(error.waitReason).toBe("operation-queue");
|
|
306
|
+
* ```
|
|
307
|
+
*/
|
|
308
|
+
declare class RequestDeadlineExceededError extends OpenCloudError {
|
|
309
|
+
/** Absolute caller-supplied deadline, as Unix epoch milliseconds. */
|
|
310
|
+
readonly deadlineMs: number;
|
|
311
|
+
override readonly name: string;
|
|
312
|
+
/** Time left when the SDK refused or ended the wait. */
|
|
313
|
+
readonly remainingMs: number;
|
|
314
|
+
/** Intended wait duration, when known. */
|
|
315
|
+
readonly waitMs: number | undefined;
|
|
316
|
+
/** SDK admission mechanism whose wait could not meet the deadline. */
|
|
317
|
+
readonly waitReason: AdmissionWaitReason | undefined;
|
|
318
|
+
/**
|
|
319
|
+
* Creates a new RequestDeadlineExceededError.
|
|
320
|
+
*
|
|
321
|
+
* @param message - Human-readable description of the exhausted deadline.
|
|
322
|
+
* @param options - Deadline, remaining budget, and optional wait details.
|
|
323
|
+
*/
|
|
324
|
+
constructor(message: string, options: RequestDeadlineExceededErrorOptions);
|
|
325
|
+
}
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/errors/retry-delay-exceeded.d.ts
|
|
328
|
+
/**
|
|
329
|
+
* Options for constructing a {@link RetryDelayExceededError}.
|
|
330
|
+
*
|
|
331
|
+
* @since 0.3.2
|
|
332
|
+
*/
|
|
333
|
+
interface RetryDelayExceededErrorOptions extends ErrorOptions {
|
|
334
|
+
/** Absolute caller-supplied deadline, as Unix epoch milliseconds. */
|
|
335
|
+
readonly deadlineMs: number;
|
|
336
|
+
/** Time left when the SDK refused the retry delay. */
|
|
337
|
+
readonly remainingMs: number;
|
|
338
|
+
/** Computed retry delay that could not fit before the deadline. */
|
|
339
|
+
readonly retryAfterMs: number;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Returned when the SDK refuses a retry delay that cannot complete before the
|
|
343
|
+
* request deadline. This is distinct from cancellation so consumers can
|
|
344
|
+
* report the server's stated retry time without waiting for it.
|
|
345
|
+
*
|
|
346
|
+
* @since 0.3.2
|
|
347
|
+
*
|
|
348
|
+
* @example
|
|
349
|
+
*
|
|
350
|
+
* ```ts
|
|
351
|
+
* import { RetryDelayExceededError } from "@bedrock-rbx/ocale";
|
|
352
|
+
*
|
|
353
|
+
* const error = new RetryDelayExceededError("Retry delay exceeds the request deadline", {
|
|
354
|
+
* deadlineMs: 1_000_000,
|
|
355
|
+
* remainingMs: 495_000,
|
|
356
|
+
* retryAfterMs: 1_856_000,
|
|
357
|
+
* });
|
|
358
|
+
*
|
|
359
|
+
* expect(error.retryAfterMs).toBe(1_856_000);
|
|
360
|
+
* expect(error.remainingMs).toBe(495_000);
|
|
361
|
+
* ```
|
|
362
|
+
*/
|
|
363
|
+
declare class RetryDelayExceededError extends RequestDeadlineExceededError {
|
|
364
|
+
override readonly name: string;
|
|
365
|
+
/** Computed retry delay refused by the SDK, in milliseconds. */
|
|
366
|
+
readonly retryAfterMs: number;
|
|
367
|
+
/** Computed retry delay refused by the SDK, in seconds. */
|
|
368
|
+
readonly retryAfterSeconds: number;
|
|
369
|
+
/**
|
|
370
|
+
* Creates a new RetryDelayExceededError.
|
|
371
|
+
*
|
|
372
|
+
* @param message - Human-readable description of the refused retry delay.
|
|
373
|
+
* @param options - Refused delay, deadline budget, and original failure.
|
|
374
|
+
*/
|
|
375
|
+
constructor(message: string, options: RetryDelayExceededErrorOptions);
|
|
376
|
+
}
|
|
377
|
+
//#endregion
|
|
269
378
|
//#region src/errors/validation.d.ts
|
|
270
379
|
/**
|
|
271
380
|
* Closed discriminator for a {@link ValidationError}. Consumers can
|
|
@@ -316,5 +425,5 @@ declare class ValidationError extends OpenCloudError {
|
|
|
316
425
|
constructor(message: string, options: ValidationErrorOptions);
|
|
317
426
|
}
|
|
318
427
|
//#endregion
|
|
319
|
-
export { type AdmissionWaitEvent, type AdmissionWaitObserver, type AdmissionWaitReason, ApiError, type ApiErrorOptions, type ApiRequestContext, GATEWAY_REJECTED, type HttpClient, type HttpRequest, type HttpResponse, NetworkError, type NetworkErrorOptions, type OpenCloudClientOptions, OpenCloudError, type OpenCloudErrorOptions, type OpenCloudHooks, type Page, PermissionError, type PermissionErrorOptions, PollAbortedError, type PollAbortedErrorOptions, PollTimeoutError, type PollTimeoutErrorOptions, RESPONSE_UNPARSEABLE, RateLimitError, type RateLimitErrorOptions, RequestAbortedError, type RequestAbortedErrorOptions, type RequestConfig, type RequestOptions, type Result, type SleepFunc, TRANSIENT_TRANSPORT_CODES, ValidationError, type ValidationErrorCode, type ValidationErrorOptions, createFetchHttpClient, requestContextOf };
|
|
428
|
+
export { type AdmissionWaitEvent, type AdmissionWaitObserver, type AdmissionWaitReason, ApiError, type ApiErrorOptions, type ApiRequestContext, GATEWAY_REJECTED, type HttpClient, type HttpRequest, type HttpResponse, NetworkError, type NetworkErrorOptions, type OpenCloudClientOptions, OpenCloudError, type OpenCloudErrorOptions, type OpenCloudHooks, type Page, PermissionError, type PermissionErrorOptions, PollAbortedError, type PollAbortedErrorOptions, PollTimeoutError, type PollTimeoutErrorOptions, RESPONSE_UNPARSEABLE, RateLimitError, type RateLimitErrorOptions, RequestAbortedError, type RequestAbortedErrorOptions, type RequestConfig, RequestDeadlineExceededError, type RequestDeadlineExceededErrorOptions, type RequestOptions, type Result, RetryDelayExceededError, type RetryDelayExceededErrorOptions, type SleepFunc, TRANSIENT_TRANSPORT_CODES, ValidationError, type ValidationErrorCode, type ValidationErrorOptions, createFetchHttpClient, requestContextOf };
|
|
320
429
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/client/fetch-http-client.ts","../src/errors/permission-error.ts","../src/errors/poll-aborted.ts","../src/errors/poll-timeout.ts","../src/errors/request-aborted.ts","../src/errors/validation.ts"],"mappings":";;;;;;;AA+DA;;;;AAA0C;;;;ACxD1C;;;;;;;;;AAYiB;AAgCjB;;;;;;;;;;;;;;;;;;AAYuC;;;;ACxDvC;;;;AAEU;AAwBV;;;;;;;;;;;;cF8Ba,qBAAA,QAA6B,UAAA;;;;;;AAA1C;;UCxDiB,sBAAA,SAA+B,eAAA;EDwDN;AAAA;;;;EClDzC,YAAA;EANgB;;;;;EAYhB,cAAA,EAAgB,aAAA;AAAA;;AAAA;AAgCjB;;;;;;;;;;;;;;;;;;AAYuC;;;;ACxDvC;;;;AAEU;cD0CG,eAAA,SAAwB,QAAA;EAAA,kBACX,IAAA;EAAA,SACT,YAAA;EAAA,SACA,cAAA,EAAgB,aAAA;;;;;;;;EAShC,WAAA,CAAY,OAAA,UAAiB,OAAA,EAAS,sBAAA;AAAA;;;;;;ADAvC;;UExDiB,uBAAA,SAAgC,YAAA;EFwDP;EAAA,SEtDhC,MAAA;AAAA;;;ADFV;;;;;;;;;AAYiB;AAgCjB;;;;;;;;;cClBa,gBAAA,SAAyB,cAAA;EAAA,kBACZ,IAAA;EAAA,SACT,MAAA;;;;;;;EAQhB,WAAA,CAAY,OAAA,UAAiB,OAAA,GAAS,uBAAA;AAAA;;;;;;AFoBvC;;;;AAA0C;;;UGnDzB,uBAAA,sBAA6C,YAAA;EFL9D;EAAA,SEOU,gBAAA,GAAmB,CAAA;;WAEnB,SAAA;AAAA;;;;;AFGO;AAgCjB;;;;;;;;;;;;;;;;;;AAYuC;cEpB1B,gBAAA,sBAAsC,cAAA;EAAA,SAClC,gBAAA,EAAkB,CAAA;EAAA,kBACT,IAAA;EAAA,SACT,SAAA;EDvCA;;;AAEP;AAwBV;;ECqBC,WAAA,CAAY,OAAA,UAAiB,OAAA,EAAS,uBAAA,CAAwB,CAAA;AAAA;;;;;;AHS/D;;UIxDiB,0BAAA,SAAmC,YAAA;EJwDV;EAAA,SItDhC,MAAA;AAAA;;;AHFV;;;;;;;;;AAYiB;AAgCjB;;;;;;;;cGnBa,mBAAA,SAA4B,cAAA;EAAA,kBACf,IAAA;EAAA,SACT,MAAA;;;;;;;EAQhB,WAAA,CAAY,OAAA,UAAiB,OAAA,GAAS,0BAAA;AAAA;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/client/fetch-http-client.ts","../src/errors/permission-error.ts","../src/errors/poll-aborted.ts","../src/errors/poll-timeout.ts","../src/errors/request-aborted.ts","../src/errors/request-deadline-exceeded.ts","../src/errors/retry-delay-exceeded.ts","../src/errors/validation.ts"],"m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network-error-
|
|
2
|
-
import { a as TRANSIENT_TRANSPORT_CODES, f as
|
|
3
|
-
import { n as PollAbortedError, t as PollTimeoutError } from "./poll-timeout-
|
|
4
|
-
import { t as ValidationError } from "./validation-
|
|
1
|
+
import { a as ApiError, n as RateLimitError, o as requestContextOf, s as OpenCloudError, t as NetworkError } from "./network-error-DR9FX5hb.mjs";
|
|
2
|
+
import { a as TRANSIENT_TRANSPORT_CODES, b as RequestAbortedError, f as RetryDelayExceededError, h as createFetchHttpClient$1, i as RESPONSE_UNPARSEABLE, m as PermissionError, n as GATEWAY_REJECTED, p as RequestDeadlineExceededError } from "./retry-Cc4LcXYZ.mjs";
|
|
3
|
+
import { n as PollAbortedError, t as PollTimeoutError } from "./poll-timeout-3PXLsabj.mjs";
|
|
4
|
+
import { t as ValidationError } from "./validation-B_Zs1So2.mjs";
|
|
5
5
|
//#region src/client/fetch-http-client.ts
|
|
6
6
|
/**
|
|
7
7
|
* Creates the fetch-backed HTTP transport Ocale uses by default.
|
|
@@ -65,6 +65,6 @@ import { t as ValidationError } from "./validation-BwjwOJPD.mjs";
|
|
|
65
65
|
*/
|
|
66
66
|
const createFetchHttpClient = createFetchHttpClient$1;
|
|
67
67
|
//#endregion
|
|
68
|
-
export { ApiError, GATEWAY_REJECTED, NetworkError, OpenCloudError, PermissionError, PollAbortedError, PollTimeoutError, RESPONSE_UNPARSEABLE, RateLimitError, RequestAbortedError, TRANSIENT_TRANSPORT_CODES, ValidationError, createFetchHttpClient, requestContextOf };
|
|
68
|
+
export { ApiError, GATEWAY_REJECTED, NetworkError, OpenCloudError, PermissionError, PollAbortedError, PollTimeoutError, RESPONSE_UNPARSEABLE, RateLimitError, RequestAbortedError, RequestDeadlineExceededError, RetryDelayExceededError, TRANSIENT_TRANSPORT_CODES, ValidationError, createFetchHttpClient, requestContextOf };
|
|
69
69
|
|
|
70
70
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as Result, m as OpenCloudError, s as OpenCloudClientOptions, u as RequestOptions } from "./types-
|
|
2
|
-
import { a as
|
|
1
|
+
import { f as Result, m as OpenCloudError, s as OpenCloudClientOptions, u as RequestOptions } from "./types-C3Egi37J.mjs";
|
|
2
|
+
import { a as ListLogsParameters, c as CompleteTask, d as InProgressTask, f as LuauExecutionTask, h as SubmitAtVersionParameters, i as defaultPollDelay, l as FailedTask, m as SubmitAtHeadParameters, n as LuauExecutionSubmitOptions, o as LogMessage, p as LuauExecutionTaskRef, r as PollUntilDoneOptions, s as LogPage, t as LuauExecutionRunOptions, u as GetParameters } from "./capacity-admission-BvnJjY0S.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/cloud-v2/luau-execution-task-binary-inputs/types.d.ts
|
|
5
5
|
/**
|
|
@@ -30,6 +30,40 @@ interface LuauExecutionTaskBinaryInput {
|
|
|
30
30
|
readonly uploadUri: string;
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
|
+
//#region src/resources/luau-execution/capacity-error.d.ts
|
|
34
|
+
/**
|
|
35
|
+
* A Luau task submission refused because validated tasks occupy the target
|
|
36
|
+
* place's execution capacity.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* import { LuauExecutionCapacityError } from "@bedrock-rbx/ocale/luau-execution";
|
|
42
|
+
*
|
|
43
|
+
* const error = new LuauExecutionCapacityError([{
|
|
44
|
+
* placeId: "456",
|
|
45
|
+
* sessionId: "11111111-1111-4111-8111-111111111111",
|
|
46
|
+
* taskId: "22222222-2222-4222-8222-222222222222",
|
|
47
|
+
* universeId: "123",
|
|
48
|
+
* versionId: "789",
|
|
49
|
+
* }]);
|
|
50
|
+
* expect(error.blockers).toHaveLength(1);
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @since 0.3.2
|
|
54
|
+
*/
|
|
55
|
+
declare class LuauExecutionCapacityError extends OpenCloudError {
|
|
56
|
+
/** Validated task references reported as occupying the target place. */
|
|
57
|
+
readonly blockers: ReadonlyArray<LuauExecutionTaskRef>;
|
|
58
|
+
override readonly name = "LuauExecutionCapacityError";
|
|
59
|
+
/**
|
|
60
|
+
* Creates a capacity failure from validated blocker references.
|
|
61
|
+
*
|
|
62
|
+
* @param blockers - Tasks reported as occupying the submitted place.
|
|
63
|
+
*/
|
|
64
|
+
constructor(blockers: ReadonlyArray<LuauExecutionTaskRef>);
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
33
67
|
//#region src/resources/luau-execution/client.d.ts
|
|
34
68
|
/**
|
|
35
69
|
* Operation handle for the `binaryInputs` namespace on
|
|
@@ -114,7 +148,7 @@ interface TasksHandle {
|
|
|
114
148
|
* {@link LuauExecutionTask}, or an error if submit fails, the task
|
|
115
149
|
* is aborted, timed out, or the transport fails.
|
|
116
150
|
*/
|
|
117
|
-
runUntilDone(parameters: SubmitAtHeadParameters | SubmitAtVersionParameters, options?:
|
|
151
|
+
runUntilDone(parameters: SubmitAtHeadParameters | SubmitAtVersionParameters, options?: LuauExecutionRunOptions): Promise<Result<LuauExecutionTask, OpenCloudError>>;
|
|
118
152
|
/**
|
|
119
153
|
* Submits a Luau script for execution against a place. Dispatches
|
|
120
154
|
* to the head-version URL when `versionId` is omitted, or to the
|
|
@@ -130,7 +164,7 @@ interface TasksHandle {
|
|
|
130
164
|
* {@link LuauExecutionTask} or the {@link OpenCloudError} that
|
|
131
165
|
* caused the request to fail.
|
|
132
166
|
*/
|
|
133
|
-
submit(parameters: SubmitAtHeadParameters | SubmitAtVersionParameters, options?:
|
|
167
|
+
submit(parameters: SubmitAtHeadParameters | SubmitAtVersionParameters, options?: LuauExecutionSubmitOptions): Promise<Result<LuauExecutionTask, OpenCloudError>>;
|
|
134
168
|
}
|
|
135
169
|
/**
|
|
136
170
|
* Public client for the Roblox Open Cloud `LuauExecutionSessionTask`
|
|
@@ -166,5 +200,5 @@ declare class LuauExecutionClient {
|
|
|
166
200
|
constructor(options: OpenCloudClientOptions);
|
|
167
201
|
}
|
|
168
202
|
//#endregion
|
|
169
|
-
export { type BinaryInputsHandle, type CompleteTask, type CreateBinaryInputParameters, type FailedTask, type GetParameters, type InProgressTask, type ListLogsParameters, type LogMessage, type LogPage, LuauExecutionClient, type LuauExecutionTask, type LuauExecutionTaskBinaryInput, type LuauExecutionTaskRef, type PollUntilDoneOptions, type SubmitAtHeadParameters, type SubmitAtVersionParameters, type TasksHandle, defaultPollDelay };
|
|
203
|
+
export { type BinaryInputsHandle, type CompleteTask, type CreateBinaryInputParameters, type FailedTask, type GetParameters, type InProgressTask, type ListLogsParameters, type LogMessage, type LogPage, LuauExecutionCapacityError, LuauExecutionClient, type LuauExecutionRunOptions, type LuauExecutionSubmitOptions, type LuauExecutionTask, type LuauExecutionTaskBinaryInput, type LuauExecutionTaskRef, type PollUntilDoneOptions, type SubmitAtHeadParameters, type SubmitAtVersionParameters, type TasksHandle, defaultPollDelay };
|
|
170
204
|
//# sourceMappingURL=luau-execution.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"luau-execution.d.mts","names":[],"sources":["../src/domains/cloud-v2/luau-execution-task-binary-inputs/types.ts","../src/resources/luau-execution/client.ts"],"mappings":";;;;;;;;AAOA;;;UAAiB,2BAAA;EAIP;EAAA,SAFA,IAAA;EAWO;EAAA,SATP,UAAA;AAAA;AAeA;;;;
|
|
1
|
+
{"version":3,"file":"luau-execution.d.mts","names":[],"sources":["../src/domains/cloud-v2/luau-execution-task-binary-inputs/types.ts","../src/resources/luau-execution/capacity-error.ts","../src/resources/luau-execution/client.ts"],"mappings":";;;;;;;;AAOA;;;UAAiB,2BAAA;EAIP;EAAA,SAFA,IAAA;EAWO;EAAA,SATP,UAAA;AAAA;AAeA;;;;ACKV;;ADLU,UANO,4BAAA;;;;WAIP,IAAA;;WAEA,SAAA;AAAA;;;;;AAnBV;;;;AAIU;AASV;;;;AAMU;;;;ACKV;;;;;;cAAa,0BAAA,SAAmC,cAAA;;WAE/B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
|
-
import { a as ApiError } from "./network-error-
|
|
2
|
-
import { t as CREATE_METHOD_DEFAULTS } from "./retry-
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
1
|
+
import { a as ApiError } from "./network-error-DR9FX5hb.mjs";
|
|
2
|
+
import { t as CREATE_METHOD_DEFAULTS } from "./retry-Cc4LcXYZ.mjs";
|
|
3
|
+
import { n as okRequest, o as toJsonDetails, s as isRecord, t as ResourceClient } from "./resource-client--yYybltk.mjs";
|
|
4
|
+
import { a as pollUntilDoneCoreAsync, c as LIST_LOGS_SPEC, i as defaultPollDelay, l as LuauExecutionCapacityError, n as submitAndPollAsync, o as withBudgetRequestTimeout, r as submitWithCapacityAsync, s as GET_SPEC, t as buildPollDependencies } from "./polling-helpers-CFuSt2O5.mjs";
|
|
5
5
|
//#region src/domains/cloud-v2/luau-execution-task-binary-inputs/builders.ts
|
|
6
6
|
/**
|
|
7
7
|
* Builds a `POST` request for the Open Cloud
|
|
@@ -165,20 +165,15 @@ function createTasksHandle(inner) {
|
|
|
165
165
|
});
|
|
166
166
|
},
|
|
167
167
|
async submit(parameters, options) {
|
|
168
|
-
|
|
168
|
+
return submitWithCapacityAsync({
|
|
169
|
+
inner,
|
|
169
170
|
options,
|
|
170
|
-
parameters
|
|
171
|
-
spec: SUBMIT_VERSION_SPEC
|
|
172
|
-
});
|
|
173
|
-
return inner.executeAsync({
|
|
174
|
-
options,
|
|
175
|
-
parameters,
|
|
176
|
-
spec: SUBMIT_HEAD_SPEC
|
|
171
|
+
parameters
|
|
177
172
|
});
|
|
178
173
|
}
|
|
179
174
|
};
|
|
180
175
|
}
|
|
181
176
|
//#endregion
|
|
182
|
-
export { LuauExecutionClient, defaultPollDelay };
|
|
177
|
+
export { LuauExecutionCapacityError, LuauExecutionClient, defaultPollDelay };
|
|
183
178
|
|
|
184
179
|
//# sourceMappingURL=luau-execution.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"luau-execution.mjs","names":["#inner"],"sources":["../src/domains/cloud-v2/luau-execution-task-binary-inputs/builders.ts","../src/domains/cloud-v2/luau-execution-task-binary-inputs/operations.ts","../src/domains/cloud-v2/luau-execution-task-binary-inputs/parsers.ts","../src/resources/luau-execution/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../client/types.ts\";\nimport type { CreateBinaryInputParameters } from \"./types.ts\";\n\n/**\n * Builds a `POST` request for the Open Cloud\n * `Cloud_CreateLuauExecutionSessionTaskBinaryInput` endpoint. The\n * server responds with a presigned `uploadUri` and the resource `path`.\n *\n * @param parameters - Universe identifier and the byte size of the\n * binary to be uploaded.\n * @returns A pure {@link HttpRequest} describing the create call.\n */\nexport function buildCreateBinaryInputRequest({\n\tsize,\n\tuniverseId,\n}: CreateBinaryInputParameters): HttpRequest {\n\treturn {\n\t\tbody: { size },\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${universeId}/luau-execution-session-task-binary-inputs`,\n\t};\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst CREATE_PER_MINUTE = 5;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for creating a Luau execution task binary\n * input, sourced from `x-roblox-rate-limits.perApiKeyOwner` on the\n * `Cloud_CreateLuauExecutionSessionTaskBinaryInput` operation (5 requests\n * per minute per API key owner). The whole per-minute allowance is also\n * the burst, matching the server: a probe found the sixth create within\n * one minute is the first to draw a 429.\n */\nexport const CREATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tburstCapacity: CREATE_PER_MINUTE,\n\tmaxPerSecond: CREATE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"luau-execution-task-binary-inputs.create\",\n});\n\n/**\n * Scopes required to create a Luau execution task binary input, sourced\n * from `x-roblox-scopes` on the create operation in the vendored OpenAPI\n * schema.\n */\nexport const CREATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe.place.luau-execution-session: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 { LuauExecutionTaskBinaryInput } from \"./types.ts\";\n\nconst PATH_PATTERN = /^universes\\/(\\d+)\\/luau-execution-session-task-binary-inputs\\/([^/]+)$/;\n\nconst MALFORMED_MESSAGE = \"Malformed luau-execution-session-task-binary-input response\";\n\n/**\n * Parses a successful Open Cloud\n * `Cloud_CreateLuauExecutionSessionTaskBinaryInput` response body into\n * the public {@link LuauExecutionTaskBinaryInput}.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed binary input, or an\n * {@link ApiError} when the body does not match the expected shape.\n */\nexport function parseBinaryInputResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<LuauExecutionTaskBinaryInput, ApiError> {\n\tif (!isRecord(body)) {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\tif (typeof body[\"path\"] !== \"string\" || !PATH_PATTERN.test(body[\"path\"])) {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\tif (typeof body[\"uploadUri\"] !== \"string\") {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\treturn {\n\t\tdata: { path: body[\"path\"], uploadUri: body[\"uploadUri\"] },\n\t\tsuccess: true,\n\t};\n}\n\nfunction malformed(\n\tstatusCode: number,\n\tbody: unknown,\n): Result<LuauExecutionTaskBinaryInput, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_MESSAGE, {\n\t\t\tdetails: toJsonDetails(body),\n\t\t\tstatusCode,\n\t\t}),\n\t\tsuccess: false,\n\t};\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport { buildCreateBinaryInputRequest } from \"../../domains/cloud-v2/luau-execution-task-binary-inputs/builders.ts\";\nimport {\n\tCREATE_OPERATION_LIMIT,\n\tCREATE_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/luau-execution-task-binary-inputs/operations.ts\";\nimport { parseBinaryInputResponse } from \"../../domains/cloud-v2/luau-execution-task-binary-inputs/parsers.ts\";\nimport type {\n\tCreateBinaryInputParameters,\n\tLuauExecutionTaskBinaryInput,\n} from \"../../domains/cloud-v2/luau-execution-task-binary-inputs/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 {\n\tGET_SPEC,\n\tSUBMIT_HEAD_SPEC,\n\tSUBMIT_VERSION_SPEC,\n} 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 type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport {\n\tokRequest,\n\tResourceClient,\n\ttype ResourceMethodSpec,\n} from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\nimport { buildPollDependencies, submitAndPollAsync } from \"./polling-helpers.ts\";\nimport {\n\tpollUntilDoneCoreAsync,\n\ttype PollUntilDoneOptions,\n\twithBudgetRequestTimeout,\n} from \"./polling.ts\";\n\nfunction makeSpec<P, R>(spec: ResourceMethodSpec<P, R>): ResourceMethodSpec<P, R> {\n\treturn Object.freeze(spec);\n}\n\nconst CREATE_BINARY_INPUT_SPEC = makeSpec<\n\tCreateBinaryInputParameters,\n\tLuauExecutionTaskBinaryInput\n>({\n\tbuildRequest: (parameters) => okRequest(buildCreateBinaryInputRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: CREATE_OPERATION_LIMIT,\n\tparse: parseBinaryInputResponse,\n\trequiredScopes: CREATE_REQUIRED_SCOPES,\n});\n\n/**\n * Operation handle for the `binaryInputs` namespace on\n * {@link LuauExecutionClient}. Provides `create` to allocate a presigned\n * upload slot for binary script inputs.\n *\n * @since 0.1.0\n */\nexport interface BinaryInputsHandle {\n\t/**\n\t * Allocates a presigned binary input upload slot. The returned\n\t * `uploadUri` is a presigned `PUT` target; the caller uploads the\n\t * binary data directly and passes `path` to `tasks.submit` as\n\t * `binaryInput`.\n\t *\n\t * @param parameters - Universe identifier and the byte size of the\n\t * binary to upload.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link LuauExecutionTaskBinaryInput} or the {@link OpenCloudError}\n\t * that caused the request to fail.\n\t */\n\tcreate(\n\t\tparameters: CreateBinaryInputParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LuauExecutionTaskBinaryInput, OpenCloudError>>;\n}\n\n/**\n * Operation handle exposed by {@link LuauExecutionClient} as the\n * `tasks` namespace. Provides `submit` to queue a Luau script, `get`\n * to fetch a task's current state, and `listLogs` to retrieve\n * structured log messages produced by a task.\n *\n * @since 0.1.0\n */\nexport interface TasksHandle {\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 `tasks.get` with `view=BASIC` on a configurable backoff schedule\n\t * until the task reaches a terminal state, the wall-clock budget is\n\t * exhausted, or the supplied `AbortSignal` fires. Returns the terminal\n\t * task on 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 `tasks.get` with `view=BASIC` until\n\t * the task reaches a terminal state, the wall-clock budget is\n\t * exhausted, or the supplied `AbortSignal` fires. Combines `submit`\n\t * and `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?: PollUntilDoneOptions,\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?: RequestOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n}\n\n/**\n * Public client for the Roblox Open Cloud `LuauExecutionSessionTask`\n * resource. Tasks run a Luau script against a place and surface state,\n * output, or error through the `LuauExecutionTask` discriminated\n * union. Exposes `tasks.submit` for both the head version and a\n * specific place version, `tasks.get` for fetching task state,\n * `tasks.listLogs` for fetching structured log messages, and\n * `binaryInputs.create` for allocating presigned upload slots.\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { LuauExecutionClient } from \"@bedrock-rbx/ocale/luau-execution\";\n *\n * const client = new LuauExecutionClient({ apiKey: \"your-key\" });\n * expect(client).toBeInstanceOf(LuauExecutionClient);\n * ```\n */\nexport class LuauExecutionClient {\n\treadonly #inner: ResourceClient;\n\n\tpublic readonly binaryInputs: BinaryInputsHandle;\n\tpublic readonly tasks: TasksHandle;\n\n\t/**\n\t * Creates a new {@link LuauExecutionClient}. Configuration is frozen\n\t * on construction; per-request overrides are accepted on each\n\t * 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.binaryInputs = createBinaryInputsHandle(this.#inner);\n\t\tthis.tasks = createTasksHandle(this.#inner);\n\t}\n}\n\nfunction createBinaryInputsHandle(inner: ResourceClient): BinaryInputsHandle {\n\treturn {\n\t\tasync create(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: CREATE_BINARY_INPUT_SPEC });\n\t\t},\n\t};\n}\n\nfunction createTasksHandle(inner: ResourceClient): TasksHandle {\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\tif (\"versionId\" in parameters) {\n\t\t\t\treturn inner.executeAsync({ options, parameters, spec: SUBMIT_VERSION_SPEC });\n\t\t\t}\n\n\t\t\treturn inner.executeAsync({ options, parameters, spec: SUBMIT_HEAD_SPEC });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;AAYA,SAAgB,8BAA8B,EAC7C,MACA,cAC4C;CAC5C,OAAO;EACN,MAAM,EAAE,KAAK;EACb,SAAS,EAAE,gBAAgB,mBAAmB;EAC9C,QAAQ;EACR,KAAK,uBAAuB,WAAW;CACxC;AACD;;;ACpBA,MAAM,oBAAoB;;;;;;;;;AAW1B,MAAa,yBAAyC,OAAO,OAAO;CACnE,eAAe;CACf,cAAc,oBAAoB;CAClC,cAAc;AACf,CAAC;;;;;;AAOD,MAAa,yBAAgD,OAAO,OAAO,CAC1E,6CACD,CAAC;;;ACnBD,MAAM,eAAe;AAErB,MAAM,oBAAoB;;;;;;;;;;AAW1B,SAAgB,yBAAyB,EACxC,MACA,QAAQ,cACwD;CAChE,IAAI,CAAC,SAAS,IAAI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;EACA,MAAM,cAAc,KAAK,UAAU,CAAC,GAAG;GACtC,MAAM,WAAW,yBAAyB,OAAO;GACjD,OAAO,uBACN,sBAAsB,OAAO;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,IAAI,eAAe,YAClB,OAAO,MAAM,aAAa;IAAE;IAAS;IAAY,MAAM;GAAoB,CAAC;GAG7E,OAAO,MAAM,aAAa;IAAE;IAAS;IAAY,MAAM;GAAiB,CAAC;EAC1E;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"luau-execution.mjs","names":["#inner"],"sources":["../src/domains/cloud-v2/luau-execution-task-binary-inputs/builders.ts","../src/domains/cloud-v2/luau-execution-task-binary-inputs/operations.ts","../src/domains/cloud-v2/luau-execution-task-binary-inputs/parsers.ts","../src/resources/luau-execution/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../client/types.ts\";\nimport type { CreateBinaryInputParameters } from \"./types.ts\";\n\n/**\n * Builds a `POST` request for the Open Cloud\n * `Cloud_CreateLuauExecutionSessionTaskBinaryInput` endpoint. The\n * server responds with a presigned `uploadUri` and the resource `path`.\n *\n * @param parameters - Universe identifier and the byte size of the\n * binary to be uploaded.\n * @returns A pure {@link HttpRequest} describing the create call.\n */\nexport function buildCreateBinaryInputRequest({\n\tsize,\n\tuniverseId,\n}: CreateBinaryInputParameters): HttpRequest {\n\treturn {\n\t\tbody: { size },\n\t\theaders: { \"content-type\": \"application/json\" },\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${universeId}/luau-execution-session-task-binary-inputs`,\n\t};\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst CREATE_PER_MINUTE = 5;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for creating a Luau execution task binary\n * input, sourced from `x-roblox-rate-limits.perApiKeyOwner` on the\n * `Cloud_CreateLuauExecutionSessionTaskBinaryInput` operation (5 requests\n * per minute per API key owner). The whole per-minute allowance is also\n * the burst, matching the server: a probe found the sixth create within\n * one minute is the first to draw a 429.\n */\nexport const CREATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tburstCapacity: CREATE_PER_MINUTE,\n\tmaxPerSecond: CREATE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"luau-execution-task-binary-inputs.create\",\n});\n\n/**\n * Scopes required to create a Luau execution task binary input, sourced\n * from `x-roblox-scopes` on the create operation in the vendored OpenAPI\n * schema.\n */\nexport const CREATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe.place.luau-execution-session: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 { LuauExecutionTaskBinaryInput } from \"./types.ts\";\n\nconst PATH_PATTERN = /^universes\\/(\\d+)\\/luau-execution-session-task-binary-inputs\\/([^/]+)$/;\n\nconst MALFORMED_MESSAGE = \"Malformed luau-execution-session-task-binary-input response\";\n\n/**\n * Parses a successful Open Cloud\n * `Cloud_CreateLuauExecutionSessionTaskBinaryInput` response body into\n * the public {@link LuauExecutionTaskBinaryInput}.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed binary input, or an\n * {@link ApiError} when the body does not match the expected shape.\n */\nexport function parseBinaryInputResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<LuauExecutionTaskBinaryInput, ApiError> {\n\tif (!isRecord(body)) {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\tif (typeof body[\"path\"] !== \"string\" || !PATH_PATTERN.test(body[\"path\"])) {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\tif (typeof body[\"uploadUri\"] !== \"string\") {\n\t\treturn malformed(statusCode, body);\n\t}\n\n\treturn {\n\t\tdata: { path: body[\"path\"], uploadUri: body[\"uploadUri\"] },\n\t\tsuccess: true,\n\t};\n}\n\nfunction malformed(\n\tstatusCode: number,\n\tbody: unknown,\n): Result<LuauExecutionTaskBinaryInput, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_MESSAGE, {\n\t\t\tdetails: toJsonDetails(body),\n\t\t\tstatusCode,\n\t\t}),\n\t\tsuccess: false,\n\t};\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport { buildCreateBinaryInputRequest } from \"../../domains/cloud-v2/luau-execution-task-binary-inputs/builders.ts\";\nimport {\n\tCREATE_OPERATION_LIMIT,\n\tCREATE_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/luau-execution-task-binary-inputs/operations.ts\";\nimport { parseBinaryInputResponse } from \"../../domains/cloud-v2/luau-execution-task-binary-inputs/parsers.ts\";\nimport type {\n\tCreateBinaryInputParameters,\n\tLuauExecutionTaskBinaryInput,\n} from \"../../domains/cloud-v2/luau-execution-task-binary-inputs/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 type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport {\n\tokRequest,\n\tResourceClient,\n\ttype ResourceMethodSpec,\n} from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\nimport {\n\ttype LuauExecutionRunOptions,\n\ttype LuauExecutionSubmitOptions,\n\tsubmitWithCapacityAsync,\n} from \"./capacity-admission.ts\";\nimport { buildPollDependencies, submitAndPollAsync } from \"./polling-helpers.ts\";\nimport {\n\tpollUntilDoneCoreAsync,\n\ttype PollUntilDoneOptions,\n\twithBudgetRequestTimeout,\n} from \"./polling.ts\";\n\nfunction makeSpec<P, R>(spec: ResourceMethodSpec<P, R>): ResourceMethodSpec<P, R> {\n\treturn Object.freeze(spec);\n}\n\nconst CREATE_BINARY_INPUT_SPEC = makeSpec<\n\tCreateBinaryInputParameters,\n\tLuauExecutionTaskBinaryInput\n>({\n\tbuildRequest: (parameters) => okRequest(buildCreateBinaryInputRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: CREATE_OPERATION_LIMIT,\n\tparse: parseBinaryInputResponse,\n\trequiredScopes: CREATE_REQUIRED_SCOPES,\n});\n\n/**\n * Operation handle for the `binaryInputs` namespace on\n * {@link LuauExecutionClient}. Provides `create` to allocate a presigned\n * upload slot for binary script inputs.\n *\n * @since 0.1.0\n */\nexport interface BinaryInputsHandle {\n\t/**\n\t * Allocates a presigned binary input upload slot. The returned\n\t * `uploadUri` is a presigned `PUT` target; the caller uploads the\n\t * binary data directly and passes `path` to `tasks.submit` as\n\t * `binaryInput`.\n\t *\n\t * @param parameters - Universe identifier and the byte size of the\n\t * binary to upload.\n\t * @param options - Optional per-request overrides.\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link LuauExecutionTaskBinaryInput} or the {@link OpenCloudError}\n\t * that caused the request to fail.\n\t */\n\tcreate(\n\t\tparameters: CreateBinaryInputParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LuauExecutionTaskBinaryInput, OpenCloudError>>;\n}\n\n/**\n * Operation handle exposed by {@link LuauExecutionClient} as the\n * `tasks` namespace. Provides `submit` to queue a Luau script, `get`\n * to fetch a task's current state, and `listLogs` to retrieve\n * structured log messages produced by a task.\n *\n * @since 0.1.0\n */\nexport interface TasksHandle {\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 `tasks.get` with `view=BASIC` on a configurable backoff schedule\n\t * until the task reaches a terminal state, the wall-clock budget is\n\t * exhausted, or the supplied `AbortSignal` fires. Returns the terminal\n\t * task on 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 `tasks.get` with `view=BASIC` until\n\t * the task reaches a terminal state, the wall-clock budget is\n\t * exhausted, or the supplied `AbortSignal` fires. Combines `submit`\n\t * and `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\n/**\n * Public client for the Roblox Open Cloud `LuauExecutionSessionTask`\n * resource. Tasks run a Luau script against a place and surface state,\n * output, or error through the `LuauExecutionTask` discriminated\n * union. Exposes `tasks.submit` for both the head version and a\n * specific place version, `tasks.get` for fetching task state,\n * `tasks.listLogs` for fetching structured log messages, and\n * `binaryInputs.create` for allocating presigned upload slots.\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { LuauExecutionClient } from \"@bedrock-rbx/ocale/luau-execution\";\n *\n * const client = new LuauExecutionClient({ apiKey: \"your-key\" });\n * expect(client).toBeInstanceOf(LuauExecutionClient);\n * ```\n */\nexport class LuauExecutionClient {\n\treadonly #inner: ResourceClient;\n\n\tpublic readonly binaryInputs: BinaryInputsHandle;\n\tpublic readonly tasks: TasksHandle;\n\n\t/**\n\t * Creates a new {@link LuauExecutionClient}. Configuration is frozen\n\t * on construction; per-request overrides are accepted on each\n\t * 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.binaryInputs = createBinaryInputsHandle(this.#inner);\n\t\tthis.tasks = createTasksHandle(this.#inner);\n\t}\n}\n\nfunction createBinaryInputsHandle(inner: ResourceClient): BinaryInputsHandle {\n\treturn {\n\t\tasync create(parameters, options) {\n\t\t\treturn inner.executeAsync({ options, parameters, spec: CREATE_BINARY_INPUT_SPEC });\n\t\t},\n\t};\n}\n\nfunction createTasksHandle(inner: ResourceClient): TasksHandle {\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":";;;;;;;;;;;;;;AAYA,SAAgB,8BAA8B,EAC7C,M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A,MAAM;EACxD,KAAK,QAAQ,kBAAkB,KAAKA,MAAM;CAC3C;AACD;AAEA,SAAS,yBAAyB,OAA2C;CAC5E,OAAO,EACN,MAAM,OAAO,YAAY,SAAS;EACjC,OAAO,MAAM,aAAa;GAAE;GAAS;GAAY,MAAM;EAAyB,CAAC;CAClF,EACD;AACD;AAEA,SAAS,kBAAkB,OAAoC;CAC9D,OAAO;EACN,MAAM,IAAI,YAAY,SAAS;GAC9B,OAAO,MAAM,aAAa;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,MAAM,WAAW,yBAAyB,OAAO;GACjD,OAAO,uBACN,sBAAsB,OAAO;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"}
|
|
@@ -149,7 +149,10 @@ function requestContextOf(err) {
|
|
|
149
149
|
//#region src/errors/rate-limit.ts
|
|
150
150
|
/**
|
|
151
151
|
* Thrown when the Roblox Open Cloud API returns a 429 Too Many Requests
|
|
152
|
-
* response. Contains the server-suggested retry delay
|
|
152
|
+
* response. Contains the server-suggested retry delay and safe,
|
|
153
|
+
* machine-readable response evidence. Generic 429 evidence can be ambiguous:
|
|
154
|
+
* no individual header, body code, or remaining-budget value guarantees the
|
|
155
|
+
* upstream cause.
|
|
153
156
|
*
|
|
154
157
|
* @since 0.1.0
|
|
155
158
|
*
|
|
@@ -159,21 +162,42 @@ function requestContextOf(err) {
|
|
|
159
162
|
* import { RateLimitError } from "@bedrock-rbx/ocale";
|
|
160
163
|
*
|
|
161
164
|
* const error = new RateLimitError("Too many requests", {
|
|
162
|
-
*
|
|
165
|
+
* code: "RESOURCE_EXHAUSTED",
|
|
166
|
+
* remaining: 3,
|
|
167
|
+
* responseHeaders: {
|
|
168
|
+
* "retry-after": "1856",
|
|
169
|
+
* "x-ratelimit-limit": "5, 5;w=60, 5;w=60",
|
|
170
|
+
* },
|
|
171
|
+
* retryAfterSeconds: 1856,
|
|
163
172
|
* });
|
|
164
173
|
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
174
|
+
* // Inspect the available evidence without assuming it identifies the cause.
|
|
175
|
+
* const evidence = {
|
|
176
|
+
* code: error.code,
|
|
177
|
+
* limit: error.responseHeaders?.["x-ratelimit-limit"],
|
|
178
|
+
* retryAfter: error.responseHeaders?.["retry-after"],
|
|
179
|
+
* };
|
|
180
|
+
*
|
|
181
|
+
* expect(evidence).toEqual({
|
|
182
|
+
* code: "RESOURCE_EXHAUSTED",
|
|
183
|
+
* limit: "5, 5;w=60, 5;w=60",
|
|
184
|
+
* retryAfter: "1856",
|
|
185
|
+
* });
|
|
167
186
|
* ```
|
|
168
187
|
*/
|
|
169
188
|
var RateLimitError = class extends OpenCloudError {
|
|
170
|
-
/**
|
|
189
|
+
/**
|
|
190
|
+
* Parsed 429 response body. A literal JSON `null` remains `null`; an absent
|
|
191
|
+
* body is `undefined`.
|
|
192
|
+
*/
|
|
171
193
|
details;
|
|
172
194
|
name = "RateLimitError";
|
|
173
195
|
/**
|
|
174
|
-
* Requests left in the
|
|
196
|
+
* Requests left in the reported window, or `undefined` if not reported.
|
|
175
197
|
*/
|
|
176
198
|
remaining;
|
|
199
|
+
/** Allowlisted raw response headers, or `undefined` if not set. */
|
|
200
|
+
responseHeaders;
|
|
177
201
|
retryAfterSeconds;
|
|
178
202
|
/** HTTP status code that produced the error, or `undefined` if not set. */
|
|
179
203
|
statusCode;
|
|
@@ -187,6 +211,7 @@ var RateLimitError = class extends OpenCloudError {
|
|
|
187
211
|
super(message, options);
|
|
188
212
|
this.retryAfterSeconds = options.retryAfterSeconds;
|
|
189
213
|
this.remaining = options.remaining;
|
|
214
|
+
this.responseHeaders = options.responseHeaders;
|
|
190
215
|
this.details = options.details;
|
|
191
216
|
this.statusCode = options.statusCode;
|
|
192
217
|
}
|
|
@@ -242,4 +267,4 @@ var NetworkError = class extends OpenCloudError {
|
|
|
242
267
|
//#endregion
|
|
243
268
|
export { ApiError as a, markServerRetryGuidance as i, RateLimitError as n, requestContextOf as o, hasServerRetryGuidance as r, OpenCloudError as s, NetworkError as t };
|
|
244
269
|
|
|
245
|
-
//# sourceMappingURL=network-error-
|
|
270
|
+
//# sourceMappingURL=network-error-DR9FX5hb.mjs.map
|