@bedrock-rbx/ocale 0.3.0 → 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-Bs0GDvEa.d.mts → capacity-admission-BvnJjY0S.d.mts} +53 -14
- 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 +217 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +70 -5
- package/dist/index.mjs.map +1 -0
- 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/{rate-limit-Df55K34f.mjs → network-error-DR9FX5hb.mjs} +81 -36
- 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-DpEY-gAc.mjs → poll-timeout-3PXLsabj.mjs} +2 -2
- package/dist/{poll-timeout-DpEY-gAc.mjs.map → poll-timeout-3PXLsabj.mjs.map} +1 -1
- package/dist/{polling-helpers-BjFXyaOm.mjs → polling-helpers-CFuSt2O5.mjs} +349 -67
- package/dist/polling-helpers-CFuSt2O5.mjs.map +1 -0
- package/dist/{price-information-Brs8ebsh.mjs → price-information-D8BxwgTS.mjs} +2 -2
- package/dist/{price-information-Brs8ebsh.mjs.map → price-information-D8BxwgTS.mjs.map} +1 -1
- package/dist/resource-client--yYybltk.mjs +899 -0
- 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-Cc4LcXYZ.mjs +1456 -0
- package/dist/retry-Cc4LcXYZ.mjs.map +1 -0
- package/dist/{retry-CdpA3z4A.d.mts → retry-DXEklFrt.d.mts} +51 -16
- package/dist/{retry-CdpA3z4A.d.mts.map → retry-DXEklFrt.d.mts.map} +1 -1
- package/dist/storage.d.mts +2 -157
- package/dist/storage.d.mts.map +1 -1
- package/dist/storage.mjs +3 -3
- package/dist/testing.d.mts +9 -17
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +1 -1
- package/dist/{types-mhEalVsR.d.mts → types-C3Egi37J.d.mts} +86 -10
- 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-Cg2lBhpQ.mjs → validation-B_Zs1So2.mjs} +2 -2
- package/dist/{validation-Cg2lBhpQ.mjs.map → validation-B_Zs1So2.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/polling-Bs0GDvEa.d.mts.map +0 -1
- package/dist/polling-helpers-BjFXyaOm.mjs.map +0 -1
- package/dist/rate-limit-Df55K34f.mjs.map +0 -1
- package/dist/resource-client-DtfDWglY.mjs +0 -1177
- package/dist/resource-client-DtfDWglY.mjs.map +0 -1
- package/dist/retry-DM2-tlR8.mjs +0 -458
- package/dist/retry-DM2-tlR8.mjs.map +0 -1
- package/dist/types-mhEalVsR.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 {
|
|
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 {
|
|
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 {
|
|
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
|
/**
|
|
@@ -97,13 +97,18 @@ interface GetParameters {
|
|
|
97
97
|
/**
|
|
98
98
|
* Discriminated variant carrying every state in which the task has not
|
|
99
99
|
* yet produced output or an error: queued for execution, currently
|
|
100
|
-
* executing, or cancelled by the caller.
|
|
100
|
+
* executing, or cancelled by the caller. `STATE_UNSPECIFIED` is the
|
|
101
|
+
* schema's default enum value, surfaced verbatim when the server sends
|
|
102
|
+
* it; pollers treat it as non-terminal.
|
|
101
103
|
*
|
|
102
104
|
* @since 0.1.0
|
|
103
105
|
*/
|
|
104
106
|
interface InProgressTask extends LuauExecutionTaskBase {
|
|
105
|
-
/**
|
|
106
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Discriminator: the task is unspecified, queued, processing, or
|
|
109
|
+
* cancelled.
|
|
110
|
+
*/
|
|
111
|
+
readonly state: "CANCELLED" | "PROCESSING" | "QUEUED" | "STATE_UNSPECIFIED";
|
|
107
112
|
}
|
|
108
113
|
/**
|
|
109
114
|
* Discriminated variant carrying the script's return values. The
|
|
@@ -127,9 +132,9 @@ interface CompleteTask extends LuauExecutionTaskBase {
|
|
|
127
132
|
}
|
|
128
133
|
/**
|
|
129
134
|
* Discriminated variant carrying the categorical error code and a
|
|
130
|
-
* human-readable message describing the failure.
|
|
131
|
-
*
|
|
132
|
-
*
|
|
135
|
+
* human-readable message describing the failure. `code` mirrors the
|
|
136
|
+
* wire enum verbatim, including the schema's `ERROR_CODE_UNSPECIFIED`
|
|
137
|
+
* default.
|
|
133
138
|
*
|
|
134
139
|
* @since 0.1.0
|
|
135
140
|
*/
|
|
@@ -140,9 +145,10 @@ interface FailedTask extends LuauExecutionTaskBase {
|
|
|
140
145
|
* `SCRIPT_ERROR` for unhandled Luau errors, `DEADLINE_EXCEEDED`
|
|
141
146
|
* when the script outran its timeout, `OUTPUT_SIZE_LIMIT_EXCEEDED`
|
|
142
147
|
* when the return values exceeded 4 MB, or `INTERNAL_ERROR` for
|
|
143
|
-
* server-side faults.
|
|
148
|
+
* server-side faults. `ERROR_CODE_UNSPECIFIED` is the schema's
|
|
149
|
+
* default value, passed through when the server sends it.
|
|
144
150
|
*/
|
|
145
|
-
readonly code: "DEADLINE_EXCEEDED" | "INTERNAL_ERROR" | "OUTPUT_SIZE_LIMIT_EXCEEDED" | "SCRIPT_ERROR"; /** Human-readable description of the failure. */
|
|
151
|
+
readonly code: "DEADLINE_EXCEEDED" | "ERROR_CODE_UNSPECIFIED" | "INTERNAL_ERROR" | "OUTPUT_SIZE_LIMIT_EXCEEDED" | "SCRIPT_ERROR"; /** Human-readable description of the failure. */
|
|
146
152
|
readonly message: string;
|
|
147
153
|
};
|
|
148
154
|
/** Discriminator: the task ran but failed before producing output. */
|
|
@@ -233,10 +239,11 @@ interface LogMessage {
|
|
|
233
239
|
/** Human-readable log message text. */
|
|
234
240
|
readonly message: string;
|
|
235
241
|
/**
|
|
236
|
-
* Categorical message type
|
|
237
|
-
*
|
|
242
|
+
* Categorical message type, mirroring the wire enum verbatim.
|
|
243
|
+
* `MESSAGE_TYPE_UNSPECIFIED` is the schema's default value, passed
|
|
244
|
+
* through when the server sends it.
|
|
238
245
|
*/
|
|
239
|
-
readonly messageType: "ERROR" | "INFO" | "OUTPUT" | "WARNING";
|
|
246
|
+
readonly messageType: "ERROR" | "INFO" | "MESSAGE_TYPE_UNSPECIFIED" | "OUTPUT" | "WARNING";
|
|
240
247
|
}
|
|
241
248
|
/**
|
|
242
249
|
* One page of structured log messages from a Luau execution task.
|
|
@@ -322,9 +329,41 @@ interface PollOptions {
|
|
|
322
329
|
* already agreed to wait for the whole operation, so the backend can answer or
|
|
323
330
|
* surface a retryable status instead.
|
|
324
331
|
*
|
|
332
|
+
* @template TOptions - The concrete polling option shape to preserve.
|
|
325
333
|
* @param options - The caller's poll and per-request options.
|
|
326
334
|
* @returns The options with `timeout` filled from the budget when it was unset.
|
|
327
335
|
*/
|
|
328
336
|
//#endregion
|
|
329
|
-
|
|
330
|
-
|
|
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,OAAA;;WAEA,MAAA;EAgDA;AAAA;AAYV;;EAZU,SA3CA,cAAA;EAuD8B;EAAA,SArD9B,UAAA;EAqEV;EAAA,SAnEU,SAAA;AAAA;;;;;;;;;;UAYO,oBAAA;;WAEP,OAAA;EA6DA;EAAA,SA3DA,SAAA;EAsEO;EAAA,SApEP,MAAA;EAoE0B;EAAA,SAlE1B,UAAA;;WAEA,SAAA;AAAA;;;AAoFA;AASV;;;UApFiB,aAAA;;WAEP,GAAA,EAAK,oBAAA;EAkF6C;;;;;EAAA,SA5ElD,IAA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mCvB;;;;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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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,6 +1,69 @@
|
|
|
1
|
-
import { a as
|
|
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
|
+
//#region src/client/fetch-http-client.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Creates the fetch-backed HTTP transport Ocale uses by default.
|
|
7
|
+
*
|
|
8
|
+
* Wrap the returned transport to add tracing, metrics, recording, or other
|
|
9
|
+
* request-level behavior while retaining Ocale's authentication, timeout,
|
|
10
|
+
* upload, response-parsing, and error-classification semantics.
|
|
11
|
+
*
|
|
12
|
+
* @returns Ocale's default fetch-backed HTTP transport.
|
|
13
|
+
* @since 0.3.1
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* import {
|
|
19
|
+
* createFetchHttpClient,
|
|
20
|
+
* type HttpClient,
|
|
21
|
+
* type HttpRequest,
|
|
22
|
+
* } from "@bedrock-rbx/ocale";
|
|
23
|
+
* import {
|
|
24
|
+
* type DeleteExperienceIconParameters,
|
|
25
|
+
* UniversesClient,
|
|
26
|
+
* } from "@bedrock-rbx/ocale/universes";
|
|
27
|
+
*
|
|
28
|
+
* const defaultHttpClient = createFetchHttpClient();
|
|
29
|
+
* let observedRequests: ReadonlyArray<HttpRequest> = [];
|
|
30
|
+
* const tracedHttpClient: HttpClient = {
|
|
31
|
+
* async request(request, config) {
|
|
32
|
+
* observedRequests = [...observedRequests, request];
|
|
33
|
+
* return defaultHttpClient.request(request, config);
|
|
34
|
+
* },
|
|
35
|
+
* };
|
|
36
|
+
* // A data URL keeps this executable example offline. Production clients
|
|
37
|
+
* // normally omit baseUrl and use Ocale's Roblox Open Cloud default.
|
|
38
|
+
* const commonOptions = { apiKey: "your-key", baseUrl: "data:,#" };
|
|
39
|
+
* const client = new UniversesClient({
|
|
40
|
+
* ...commonOptions,
|
|
41
|
+
* httpClient: tracedHttpClient,
|
|
42
|
+
* });
|
|
43
|
+
* const undecoratedClient = new UniversesClient({
|
|
44
|
+
* ...commonOptions,
|
|
45
|
+
* httpClient: defaultHttpClient,
|
|
46
|
+
* });
|
|
47
|
+
* const parameters: DeleteExperienceIconParameters = {
|
|
48
|
+
* languageCode: "en",
|
|
49
|
+
* universeId: "42",
|
|
50
|
+
* };
|
|
51
|
+
* expect(client).toBeInstanceOf(UniversesClient);
|
|
52
|
+
* return Promise.all([
|
|
53
|
+
* client.icon.delete(parameters),
|
|
54
|
+
* undecoratedClient.icon.delete(parameters),
|
|
55
|
+
* ]).then(([result, undecoratedResult]) => {
|
|
56
|
+
* expect(observedRequests).toStrictEqual([{
|
|
57
|
+
* method: "DELETE",
|
|
58
|
+
* url: "/legacy-game-internationalization/v1/game-icon/games/42/language-codes/en",
|
|
59
|
+
* }]);
|
|
60
|
+
* expect(result).toStrictEqual({ data: undefined, success: true });
|
|
61
|
+
* expect(result).toStrictEqual(undecoratedResult);
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
declare const createFetchHttpClient: () => HttpClient;
|
|
66
|
+
//#endregion
|
|
4
67
|
//#region src/errors/permission-error.d.ts
|
|
5
68
|
/**
|
|
6
69
|
* Options for constructing a {@link PermissionError}.
|
|
@@ -161,6 +224,157 @@ declare class PollTimeoutError<T = unknown> extends OpenCloudError {
|
|
|
161
224
|
constructor(message: string, options: PollTimeoutErrorOptions<T>);
|
|
162
225
|
}
|
|
163
226
|
//#endregion
|
|
227
|
+
//#region src/errors/request-aborted.d.ts
|
|
228
|
+
/**
|
|
229
|
+
* Options for constructing a {@link RequestAbortedError}.
|
|
230
|
+
*
|
|
231
|
+
* @since 0.3.1
|
|
232
|
+
*/
|
|
233
|
+
interface RequestAbortedErrorOptions extends ErrorOptions {
|
|
234
|
+
/** Whatever `AbortSignal.reason` was at the moment of cancellation. */
|
|
235
|
+
readonly reason?: unknown;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Returned when a caller's `AbortSignal` cancels an Open Cloud request.
|
|
239
|
+
* The reason is preserved so intentional cancellation can be distinguished
|
|
240
|
+
* from transport failures and SDK-owned request timeouts.
|
|
241
|
+
*
|
|
242
|
+
* @since 0.3.1
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
*
|
|
246
|
+
* ```ts
|
|
247
|
+
* import { RequestAbortedError } from "@bedrock-rbx/ocale";
|
|
248
|
+
*
|
|
249
|
+
* const error = new RequestAbortedError("Request was aborted", {
|
|
250
|
+
* reason: "superseded",
|
|
251
|
+
* });
|
|
252
|
+
*
|
|
253
|
+
* expect(error).toBeInstanceOf(RequestAbortedError);
|
|
254
|
+
* expect(error.reason).toBe("superseded");
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
declare class RequestAbortedError extends OpenCloudError {
|
|
258
|
+
override readonly name: string;
|
|
259
|
+
readonly reason?: unknown;
|
|
260
|
+
/**
|
|
261
|
+
* Creates a new RequestAbortedError.
|
|
262
|
+
*
|
|
263
|
+
* @param message - Human-readable description of the cancellation.
|
|
264
|
+
* @param options - Error options including the caller's abort reason.
|
|
265
|
+
*/
|
|
266
|
+
constructor(message: string, options?: RequestAbortedErrorOptions);
|
|
267
|
+
}
|
|
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
|
|
164
378
|
//#region src/errors/validation.d.ts
|
|
165
379
|
/**
|
|
166
380
|
* Closed discriminator for a {@link ValidationError}. Consumers can
|
|
@@ -211,5 +425,5 @@ declare class ValidationError extends OpenCloudError {
|
|
|
211
425
|
constructor(message: string, options: ValidationErrorOptions);
|
|
212
426
|
}
|
|
213
427
|
//#endregion
|
|
214
|
-
export { 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, type RequestConfig, type RequestOptions, type Result, type SleepFunc, TRANSIENT_TRANSPORT_CODES, ValidationError, type ValidationErrorCode, type ValidationErrorOptions, 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 };
|
|
215
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/errors/permission-error.ts","../src/errors/poll-aborted.ts","../src/errors/poll-timeout.ts","../src/errors/validation.ts"],"mappings":";;;;;;;
|
|
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"],"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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BAAA;EHlBhB;;;;;;EG0BZ,WAAA,CAAY,OAAA,UAAiB,OAAA,EAAS,mCAAA;AAAA;;;;;;ALIvC;;UMxDiB,8BAAA,SAAuC,YAAA;ENwDd;EAAA,SMtDhC,UAAA;;WAEA,WAAA;;WAEA,YAAA;AAAA;;;;;;;;ALMO;AAgCjB;;;;;;;;;;;;;;cKba,uBAAA,SAAgC,4BAAA;EAAA,kBACnB,IAAA;;WAET,YAAA;ELsBsB;EAAA,SKpBtB,iBAAA;;;AJpCjB;;;;EI4CC,WAAA,CAAY,OAAA,UAAiB,OAAA,EAAS,8BAAA;AAAA;;;;;;ANYvC;;;;KOtDY,mBAAA;;;;ANFZ;;UMeiB,sBAAA,SAA+B,YAAA;ENfA;EMiB/C,IAAA,EAAM,mBAAA;AAAA;;;;ANLU;AAgCjB;;;;;;;;;;;;;;;;cMJa,eAAA,SAAwB,cAAA;EAAA,kBACX,IAAA,EAAM,mBAAA;EAAA,kBACN,IAAA;;;;AL1C1B;;;EKkDC,WAAA,CAAY,OAAA,UAAiB,OAAA,EAAS,sBAAA;AAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,70 @@
|
|
|
1
|
-
import { a as
|
|
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-
|
|
5
|
-
|
|
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
|
+
//#region src/client/fetch-http-client.ts
|
|
6
|
+
/**
|
|
7
|
+
* Creates the fetch-backed HTTP transport Ocale uses by default.
|
|
8
|
+
*
|
|
9
|
+
* Wrap the returned transport to add tracing, metrics, recording, or other
|
|
10
|
+
* request-level behavior while retaining Ocale's authentication, timeout,
|
|
11
|
+
* upload, response-parsing, and error-classification semantics.
|
|
12
|
+
*
|
|
13
|
+
* @returns Ocale's default fetch-backed HTTP transport.
|
|
14
|
+
* @since 0.3.1
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* import {
|
|
20
|
+
* createFetchHttpClient,
|
|
21
|
+
* type HttpClient,
|
|
22
|
+
* type HttpRequest,
|
|
23
|
+
* } from "@bedrock-rbx/ocale";
|
|
24
|
+
* import {
|
|
25
|
+
* type DeleteExperienceIconParameters,
|
|
26
|
+
* UniversesClient,
|
|
27
|
+
* } from "@bedrock-rbx/ocale/universes";
|
|
28
|
+
*
|
|
29
|
+
* const defaultHttpClient = createFetchHttpClient();
|
|
30
|
+
* let observedRequests: ReadonlyArray<HttpRequest> = [];
|
|
31
|
+
* const tracedHttpClient: HttpClient = {
|
|
32
|
+
* async request(request, config) {
|
|
33
|
+
* observedRequests = [...observedRequests, request];
|
|
34
|
+
* return defaultHttpClient.request(request, config);
|
|
35
|
+
* },
|
|
36
|
+
* };
|
|
37
|
+
* // A data URL keeps this executable example offline. Production clients
|
|
38
|
+
* // normally omit baseUrl and use Ocale's Roblox Open Cloud default.
|
|
39
|
+
* const commonOptions = { apiKey: "your-key", baseUrl: "data:,#" };
|
|
40
|
+
* const client = new UniversesClient({
|
|
41
|
+
* ...commonOptions,
|
|
42
|
+
* httpClient: tracedHttpClient,
|
|
43
|
+
* });
|
|
44
|
+
* const undecoratedClient = new UniversesClient({
|
|
45
|
+
* ...commonOptions,
|
|
46
|
+
* httpClient: defaultHttpClient,
|
|
47
|
+
* });
|
|
48
|
+
* const parameters: DeleteExperienceIconParameters = {
|
|
49
|
+
* languageCode: "en",
|
|
50
|
+
* universeId: "42",
|
|
51
|
+
* };
|
|
52
|
+
* expect(client).toBeInstanceOf(UniversesClient);
|
|
53
|
+
* return Promise.all([
|
|
54
|
+
* client.icon.delete(parameters),
|
|
55
|
+
* undecoratedClient.icon.delete(parameters),
|
|
56
|
+
* ]).then(([result, undecoratedResult]) => {
|
|
57
|
+
* expect(observedRequests).toStrictEqual([{
|
|
58
|
+
* method: "DELETE",
|
|
59
|
+
* url: "/legacy-game-internationalization/v1/game-icon/games/42/language-codes/en",
|
|
60
|
+
* }]);
|
|
61
|
+
* expect(result).toStrictEqual({ data: undefined, success: true });
|
|
62
|
+
* expect(result).toStrictEqual(undecoratedResult);
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
const createFetchHttpClient = createFetchHttpClient$1;
|
|
67
|
+
//#endregion
|
|
68
|
+
export { ApiError, GATEWAY_REJECTED, NetworkError, OpenCloudError, PermissionError, PollAbortedError, PollTimeoutError, RESPONSE_UNPARSEABLE, RateLimitError, RequestAbortedError, RequestDeadlineExceededError, RetryDelayExceededError, TRANSIENT_TRANSPORT_CODES, ValidationError, createFetchHttpClient, requestContextOf };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["createInternalFetchHttpClient"],"sources":["../src/client/fetch-http-client.ts"],"sourcesContent":["import { createFetchHttpClient as createInternalFetchHttpClient } from \"../internal/http/fetch-client.ts\";\nimport type { HttpClient } from \"./types.ts\";\n\n/**\n * Creates the fetch-backed HTTP transport Ocale uses by default.\n *\n * Wrap the returned transport to add tracing, metrics, recording, or other\n * request-level behavior while retaining Ocale's authentication, timeout,\n * upload, response-parsing, and error-classification semantics.\n *\n * @returns Ocale's default fetch-backed HTTP transport.\n * @since 0.3.1\n *\n * @example\n *\n * ```ts\n * import {\n * createFetchHttpClient,\n * type HttpClient,\n * type HttpRequest,\n * } from \"@bedrock-rbx/ocale\";\n * import {\n * type DeleteExperienceIconParameters,\n * UniversesClient,\n * } from \"@bedrock-rbx/ocale/universes\";\n *\n * const defaultHttpClient = createFetchHttpClient();\n * let observedRequests: ReadonlyArray<HttpRequest> = [];\n * const tracedHttpClient: HttpClient = {\n * async request(request, config) {\n * observedRequests = [...observedRequests, request];\n * return defaultHttpClient.request(request, config);\n * },\n * };\n * // A data URL keeps this executable example offline. Production clients\n * // normally omit baseUrl and use Ocale's Roblox Open Cloud default.\n * const commonOptions = { apiKey: \"your-key\", baseUrl: \"data:,#\" };\n * const client = new UniversesClient({\n * ...commonOptions,\n * httpClient: tracedHttpClient,\n * });\n * const undecoratedClient = new UniversesClient({\n * ...commonOptions,\n * httpClient: defaultHttpClient,\n * });\n * const parameters: DeleteExperienceIconParameters = {\n * languageCode: \"en\",\n * universeId: \"42\",\n * };\n * expect(client).toBeInstanceOf(UniversesClient);\n * return Promise.all([\n * client.icon.delete(parameters),\n * undecoratedClient.icon.delete(parameters),\n * ]).then(([result, undecoratedResult]) => {\n * expect(observedRequests).toStrictEqual([{\n * method: \"DELETE\",\n * url: \"/legacy-game-internationalization/v1/game-icon/games/42/language-codes/en\",\n * }]);\n * expect(result).toStrictEqual({ data: undefined, success: true });\n * expect(result).toStrictEqual(undecoratedResult);\n * });\n * ```\n */\nexport const createFetchHttpClient: () => HttpClient = createInternalFetchHttpClient;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAa,wBAA0CA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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,QAAA,EAAU,aAAA,CAAc,oBAAA;EAAA,kBACf,IAAA;;;;;;EAOzB,WAAA,CAAY,QAAA,EAAU,aAAA,CAAc,oBAAA;AAAA;;;AD9B3B;AASV;;;;AAMU;;AAfA,UEwDO,kBAAA;;ADpCjB;;;;;;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