@bedrock-rbx/ocale 0.3.4 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +10 -5
  2. package/dist/assets.d.mts +64 -0
  3. package/dist/assets.d.mts.map +1 -0
  4. package/dist/assets.mjs +301 -0
  5. package/dist/assets.mjs.map +1 -0
  6. package/dist/badge-insufficient-funds-BLFvQZt1.mjs +91 -0
  7. package/dist/badge-insufficient-funds-BLFvQZt1.mjs.map +1 -0
  8. package/dist/badges.d.mts +359 -196
  9. package/dist/badges.d.mts.map +1 -1
  10. package/dist/badges.mjs +493 -59
  11. package/dist/badges.mjs.map +1 -1
  12. package/dist/capacity-admission-Ce2V9QNb.d.mts +347 -0
  13. package/dist/capacity-admission-Ce2V9QNb.d.mts.map +1 -0
  14. package/dist/{data.generated-B2ceLfSn.d.mts → data.generated-B4Fztv_7.d.mts} +23 -25
  15. package/dist/data.generated-B4Fztv_7.d.mts.map +1 -0
  16. package/dist/developer-products.d.mts +207 -194
  17. package/dist/developer-products.d.mts.map +1 -1
  18. package/dist/developer-products.mjs +125 -39
  19. package/dist/developer-products.mjs.map +1 -1
  20. package/dist/game-passes.d.mts +206 -211
  21. package/dist/game-passes.d.mts.map +1 -1
  22. package/dist/game-passes.mjs +35 -36
  23. package/dist/game-passes.mjs.map +1 -1
  24. package/dist/index.d.mts +947 -366
  25. package/dist/index.d.mts.map +1 -1
  26. package/dist/index.mjs +324 -12
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/is-date-time-string-C91G44SI.mjs +19 -0
  29. package/dist/is-date-time-string-C91G44SI.mjs.map +1 -0
  30. package/dist/locales.d.mts +28 -2
  31. package/dist/locales.d.mts.map +1 -0
  32. package/dist/locales.mjs +24 -3
  33. package/dist/locales.mjs.map +1 -1
  34. package/dist/luau-execution.d.mts +154 -157
  35. package/dist/luau-execution.d.mts.map +1 -1
  36. package/dist/luau-execution.mjs +15 -16
  37. package/dist/luau-execution.mjs.map +1 -1
  38. package/dist/{network-error-DR9FX5hb.mjs → network-error-P4An7nUB.mjs} +48 -14
  39. package/dist/network-error-P4An7nUB.mjs.map +1 -0
  40. package/dist/places.d.mts +258 -186
  41. package/dist/places.d.mts.map +1 -1
  42. package/dist/places.mjs +187 -35
  43. package/dist/places.mjs.map +1 -1
  44. package/dist/{poll-timeout-3PXLsabj.mjs → poll-timeout-BCxgN97O.mjs} +4 -6
  45. package/dist/{poll-timeout-3PXLsabj.mjs.map → poll-timeout-BCxgN97O.mjs.map} +1 -1
  46. package/dist/{polling-helpers-CoVhsC33.mjs → polling-helpers-BtEYR5dN.mjs} +260 -105
  47. package/dist/polling-helpers-BtEYR5dN.mjs.map +1 -0
  48. package/dist/{price-information-B0tkOoAX.mjs → price-information--d6GZAcp.mjs} +3 -4
  49. package/dist/{price-information-B0tkOoAX.mjs.map → price-information--d6GZAcp.mjs.map} +1 -1
  50. package/dist/resource-client-CF8SPsV8.d.mts +162 -0
  51. package/dist/resource-client-CF8SPsV8.d.mts.map +1 -0
  52. package/dist/{resource-client-rqTMkBeR.mjs → resource-client-Cm_bPcCs.mjs} +589 -197
  53. package/dist/resource-client-Cm_bPcCs.mjs.map +1 -0
  54. package/dist/retry-DYxm_eBU.d.mts +225 -0
  55. package/dist/retry-DYxm_eBU.d.mts.map +1 -0
  56. package/dist/{retry-BlX4tUnT.mjs → retry-Dv5TsY9O.mjs} +312 -54
  57. package/dist/retry-Dv5TsY9O.mjs.map +1 -0
  58. package/dist/{signatures-JF-7Psce.mjs → signatures-CtJ7jfVN.mjs} +2 -3
  59. package/dist/{signatures-JF-7Psce.mjs.map → signatures-CtJ7jfVN.mjs.map} +1 -1
  60. package/dist/storage.d.mts +333 -344
  61. package/dist/storage.d.mts.map +1 -1
  62. package/dist/storage.mjs +39 -40
  63. package/dist/storage.mjs.map +1 -1
  64. package/dist/testing.d.mts +369 -434
  65. package/dist/testing.d.mts.map +1 -1
  66. package/dist/testing.mjs +18 -33
  67. package/dist/testing.mjs.map +1 -1
  68. package/dist/{to-blob-RPqMBuft.mjs → to-blob-Bqu7bmlE.mjs} +2 -3
  69. package/dist/{to-blob-RPqMBuft.mjs.map → to-blob-Bqu7bmlE.mjs.map} +1 -1
  70. package/dist/types-Z4abDJfK.d.mts +501 -0
  71. package/dist/types-Z4abDJfK.d.mts.map +1 -0
  72. package/dist/universes.d.mts +619 -436
  73. package/dist/universes.d.mts.map +1 -1
  74. package/dist/universes.mjs +432 -79
  75. package/dist/universes.mjs.map +1 -1
  76. package/dist/{validation-B_Zs1So2.mjs → validation-kaTLLAD1.mjs} +3 -4
  77. package/dist/{validation-B_Zs1So2.mjs.map → validation-kaTLLAD1.mjs.map} +1 -1
  78. package/dist/wire-DDG87I-d.d.mts +39 -0
  79. package/dist/wire-DDG87I-d.d.mts.map +1 -0
  80. package/package.json +15 -14
  81. package/dist/capacity-admission-IDO3fcUC.d.mts +0 -369
  82. package/dist/capacity-admission-IDO3fcUC.d.mts.map +0 -1
  83. package/dist/data.generated-B2ceLfSn.d.mts.map +0 -1
  84. package/dist/network-error-DR9FX5hb.mjs.map +0 -1
  85. package/dist/polling-helpers-CoVhsC33.mjs.map +0 -1
  86. package/dist/resource-client-B6NeFXUv.d.mts +0 -164
  87. package/dist/resource-client-B6NeFXUv.d.mts.map +0 -1
  88. package/dist/resource-client-rqTMkBeR.mjs.map +0 -1
  89. package/dist/retry-BlX4tUnT.mjs.map +0 -1
  90. package/dist/retry-war_-9tb.d.mts +0 -373
  91. package/dist/retry-war_-9tb.d.mts.map +0 -1
  92. package/dist/types-CvYh4SPC.d.mts +0 -386
  93. package/dist/types-CvYh4SPC.d.mts.map +0 -1
  94. package/dist/wire-D3K-a-UP.d.mts +0 -37
  95. package/dist/wire-D3K-a-UP.d.mts.map +0 -1
@@ -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 { 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,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,GACjB,OAAO,UAAU,YAAY,IAAI;CAGlC,IAAI,OAAO,KAAK,YAAY,YAAY,CAAC,aAAa,KAAK,KAAK,OAAO,GACtE,OAAO,UAAU,YAAY,IAAI;CAGlC,IAAI,OAAO,KAAK,iBAAiB,UAChC,OAAO,UAAU,YAAY,IAAI;CAGlC,OAAO;EACN,MAAM;GAAE,MAAM,KAAK;GAAS,WAAW,KAAK;EAAa;EACzD,SAAS;CACV;AACD;AAEA,SAAS,UACR,YACA,MACiD;CACjD,OAAO;EACN,KAAK,IAAI,SAAS,mBAAmB;GACpC,SAAS,cAAc,IAAI;GAC3B;EACD,CAAC;EACD,SAAS;CACV;AACD;;;ACTA,SAAS,SAAe,MAA0D;CACjF,OAAO,OAAO,OAAO,IAAI;AAC1B;AAEA,MAAM,2BAA2B,SAG/B;CACD,eAAe,eAAe,UAAU,8BAA8B,UAAU,CAAC;CACjF,gBAAgB;CAChB,YAAY;CACZ,gBAAgB;CAChB,OAAO;CACP,gBAAgB;AACjB,CAAC;;;;;;;;;;;;;;;;;;;;;AA+ID,IAAa,sBAAb,MAAiC;CAChC;CAEA;CACA;;;;;;;;CASA,YAAY,SAAiC;EAC5C,KAAKA,SAAS,IAAI,eAAe,OAAO;EACxC,KAAK,eAAe,yBAAyB,KAAKA,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"}
1
+ {"version":3,"file":"luau-execution.mjs","names":[],"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 { UnexpectedResponseError } from \"../../../errors/unexpected-response.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport { toJsonDetails } from \"../../../internal/utils/to-json-details.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { 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 UnexpectedResponseError} when the body does not match the expected\n * shape.\n */\nexport function parseBinaryInputResponse({\n\tbody,\n\tstatus: statusCode,\n}: HttpResponse): Result<LuauExecutionTaskBinaryInput, UnexpectedResponseError> {\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, UnexpectedResponseError> {\n\treturn {\n\t\terr: new UnexpectedResponseError(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, apiKeyOnly: true });\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.credential} for this call only).\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link LuauExecutionTask} or the {@link OpenCloudError} that\n\t * caused the request to fail.\n\t */\n\tget(\n\t\tparameters: GetParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Lists one page of structured log messages produced by a\n\t * previously-submitted Luau execution task. Messages from multiple\n\t * server-side chunks are flattened into a single ordered array.\n\t * Uses idempotent retry semantics for both 429 and 5xx.\n\t *\n\t * @param parameters - The task ref and optional pagination controls\n\t * (`pageSize`, `pageToken`).\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.credential} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link LogPage} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tlistLogs(\n\t\tparameters: ListLogsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LogPage, OpenCloudError>>;\n\t/**\n\t * Polls `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. The budget also bounds an in-flight\n\t * request through its request deadline, so a hanging request ends with\n\t * `PollTimeoutError` at the budget.\n\t *\n\t * @param ref - Reference to the task to poll, typically returned by `submit`.\n\t * @param options - Polling and per-request overrides.\n\t * @returns A {@link Result} wrapping the terminal {@link LuauExecutionTask},\n\t * or an error if aborted, timed out, or the transport fails.\n\t */\n\tpollUntilDone(\n\t\tref: LuauExecutionTaskRef,\n\t\toptions?: PollUntilDoneOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Submits a Luau script and polls `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. The budget opens before the submit\n\t * and covers it, and bounds each in-flight request through its request\n\t * deadline.\n\t *\n\t * @param parameters - The same input accepted by `submit`.\n\t * @param options - Polling and per-request overrides.\n\t * @returns A {@link Result} wrapping the terminal\n\t * {@link LuauExecutionTask}, or an error if submit fails, the task\n\t * is aborted, timed out, or the transport fails.\n\t */\n\trunUntilDone(\n\t\tparameters: SubmitAtHeadParameters | SubmitAtVersionParameters,\n\t\toptions?: LuauExecutionRunOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Submits a Luau script for execution against a place. Dispatches\n\t * to the head-version URL when `versionId` is omitted, or to the\n\t * specific-version URL when one is supplied. Both URL shapes share\n\t * one rate-limit queue and one required-scope set.\n\t *\n\t * @param parameters - The universe and place identifiers, the\n\t * script to run, an optional `versionId`, and any other writable\n\t * submit fields.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.credential} for this call only).\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link LuauExecutionTask} or the {@link OpenCloudError} that\n\t * caused the request to fail.\n\t */\n\tsubmit(\n\t\tparameters: SubmitAtHeadParameters | SubmitAtVersionParameters,\n\t\toptions?: LuauExecutionSubmitOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n}\n\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({ credential: { apiKey: \"your-key\", kind: \"apiKey\" } });\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,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;;;;;;;;;;;AAY1B,SAAgB,yBAAyB,EACxC,MACA,QAAQ,cACuE;CAC/E,IAAI,CAAC,SAAS,IAAI,GACjB,OAAO,UAAU,YAAY,IAAI;CAGlC,IAAI,OAAO,KAAK,YAAY,YAAY,CAAC,aAAa,KAAK,KAAK,OAAO,GACtE,OAAO,UAAU,YAAY,IAAI;CAGlC,IAAI,OAAO,KAAK,iBAAiB,UAChC,OAAO,UAAU,YAAY,IAAI;CAGlC,OAAO;EACN,MAAM;GAAE,MAAM,KAAK;GAAS,WAAW,KAAK;EAAa;EACzD,SAAS;CACV;AACD;AAEA,SAAS,UACR,YACA,MACgE;CAChE,OAAO;EACN,KAAK,IAAI,wBAAwB,mBAAmB;GACnD,SAAS,cAAc,IAAI;GAC3B;EACD,CAAC;EACD,SAAS;CACV;AACD;;ACVA,SAAS,SAAe,MAA0D;CACjF,OAAO,OAAO,OAAO;EAAE,GAAG;EAAM,YAAY;CAAK,CAAC;AACnD;AAEA,MAAM,2BAA2B,SAG/B;CACD,eAAe,eAAe,UAAU,8BAA8B,UAAU,CAAC;CACjF,gBAAgB;CAChB,YAAY;CACZ,gBAAgB;CAChB,OAAO;CACP,gBAAgB;AACjB,CAAC;;;;;;;;;;;;;;;;;;;;;AAmJD,IAAa,sBAAb,MAAiC;CAChC;CAEA;CACA;;;;;;;;CASA,YAAY,SAAiC;EAC5C,KAAK,SAAS,IAAI,eAAe,OAAO;EACxC,KAAK,eAAe,yBAAyB,KAAK,MAAM;EACxD,KAAK,QAAQ,kBAAkB,KAAK,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"}
@@ -1,4 +1,6 @@
1
- //#region src/errors/base.ts
1
+ // src/errors/base.ts
2
+ const NO_PREVIOUS_ATTEMPTS = Object.freeze([]);
3
+ const PREVIOUS_ATTEMPTS = /* @__PURE__ */ new WeakMap();
2
4
  /**
3
5
  * Base error class for all Open Cloud SDK errors.
4
6
  *
@@ -42,9 +44,32 @@ var OpenCloudError = class extends Error {
42
44
  super(message, options);
43
45
  this.code = options?.code;
44
46
  }
47
+ /**
48
+ * Failures of the earlier attempts of the same logical request, oldest
49
+ * first. A failure that is this error's own `cause` is not repeated here.
50
+ * Empty when the request was not retried.
51
+ *
52
+ * @since 0.4.0
53
+ * @returns The earlier attempts' failures.
54
+ */
55
+ get previousAttempts() {
56
+ return PREVIOUS_ATTEMPTS.get(this) ?? NO_PREVIOUS_ATTEMPTS;
57
+ }
45
58
  };
46
- //#endregion
47
- //#region src/errors/api-error.ts
59
+ /**
60
+ * Records the failures of the earlier attempts of the logical request that
61
+ * produced `error`, so they read back through
62
+ * {@link OpenCloudError.previousAttempts}.
63
+ *
64
+ * @param error - The failure the retry loop returns.
65
+ * @param attempts - Earlier attempt failures, oldest first.
66
+ * @returns The same error.
67
+ */
68
+ function recordPreviousAttempts(error, attempts) {
69
+ PREVIOUS_ATTEMPTS.set(error, Object.freeze([...attempts]));
70
+ return error;
71
+ }
72
+ // src/errors/api-error.ts
48
73
  /**
49
74
  * Thrown when the Roblox Open Cloud API returns a non-2xx response
50
75
  * that is not a rate limit (429).
@@ -145,14 +170,15 @@ function requestContextOf(err) {
145
170
  url: err.url
146
171
  };
147
172
  }
148
- //#endregion
149
- //#region src/errors/rate-limit.ts
173
+ // src/errors/rate-limit.ts
150
174
  /**
151
175
  * Thrown when the Roblox Open Cloud API returns a 429 Too Many Requests
152
176
  * 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.
177
+ * machine-readable response evidence. The body code, remaining budget, and
178
+ * headers do not identify the upstream cause (for example quota vs place
179
+ * capacity). `source` names only the layer that refused the request;
180
+ * `"unknown"` means the response carried no positive evidence for either
181
+ * layer.
156
182
  *
157
183
  * @since 0.1.0
158
184
  *
@@ -169,19 +195,22 @@ function requestContextOf(err) {
169
195
  * "x-ratelimit-limit": "5, 5;w=60, 5;w=60",
170
196
  * },
171
197
  * retryAfterSeconds: 1856,
198
+ * source: "service",
172
199
  * });
173
200
  *
174
- * // Inspect the available evidence without assuming it identifies the cause.
201
+ * // `source` is a classification; the raw evidence stays available.
175
202
  * const evidence = {
176
203
  * code: error.code,
177
204
  * limit: error.responseHeaders?.["x-ratelimit-limit"],
178
205
  * retryAfter: error.responseHeaders?.["retry-after"],
206
+ * source: error.source,
179
207
  * };
180
208
  *
181
209
  * expect(evidence).toEqual({
182
210
  * code: "RESOURCE_EXHAUSTED",
183
211
  * limit: "5, 5;w=60, 5;w=60",
184
212
  * retryAfter: "1856",
213
+ * source: "service",
185
214
  * });
186
215
  * ```
187
216
  */
@@ -199,6 +228,12 @@ var RateLimitError = class extends OpenCloudError {
199
228
  /** Allowlisted raw response headers, or `undefined` if not set. */
200
229
  responseHeaders;
201
230
  retryAfterSeconds;
231
+ /**
232
+ * Which layer refused the request, or `"unknown"` without evidence.
233
+ *
234
+ * @since 0.4.0
235
+ */
236
+ source;
202
237
  /** HTTP status code that produced the error, or `undefined` if not set. */
203
238
  statusCode;
204
239
  /**
@@ -214,6 +249,7 @@ var RateLimitError = class extends OpenCloudError {
214
249
  this.responseHeaders = options.responseHeaders;
215
250
  this.details = options.details;
216
251
  this.statusCode = options.statusCode;
252
+ this.source = options.source ?? "unknown";
217
253
  }
218
254
  };
219
255
  const GUIDED_ERRORS = /* @__PURE__ */ new WeakSet();
@@ -236,8 +272,7 @@ function markServerRetryGuidance(error) {
236
272
  function hasServerRetryGuidance(error) {
237
273
  return error.retryAfterSeconds > 0 || GUIDED_ERRORS.has(error);
238
274
  }
239
- //#endregion
240
- //#region src/errors/network-error.ts
275
+ // src/errors/network-error.ts
241
276
  /**
242
277
  * Thrown when a network-level failure prevents the request from reaching
243
278
  * the Roblox Open Cloud API (e.g., DNS resolution failure, connection reset).
@@ -264,7 +299,6 @@ var NetworkError = class extends OpenCloudError {
264
299
  this.url = options?.url;
265
300
  }
266
301
  };
267
- //#endregion
268
- export { ApiError as a, markServerRetryGuidance as i, RateLimitError as n, requestContextOf as o, hasServerRetryGuidance as r, OpenCloudError as s, NetworkError as t };
302
+ export { ApiError as a, recordPreviousAttempts as c, markServerRetryGuidance as i, RateLimitError as n, requestContextOf as o, hasServerRetryGuidance as r, OpenCloudError as s, NetworkError as t };
269
303
 
270
- //# sourceMappingURL=network-error-DR9FX5hb.mjs.map
304
+ //# sourceMappingURL=network-error-P4An7nUB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-error-P4An7nUB.mjs","names":[],"sources":["../src/errors/base.ts","../src/errors/api-error.ts","../src/errors/rate-limit.ts","../src/errors/network-error.ts"],"sourcesContent":["/**\n * Options for constructing an {@link OpenCloudError}.\n *\n * @since 0.3.0\n */\nexport interface OpenCloudErrorOptions extends ErrorOptions {\n\t/**\n\t * Machine-readable classifier for the failure, when the error has one. An\n\t * `ApiError` and `RateLimitError` fill it from the response body; a\n\t * `ValidationError` narrows it to its own closed union. Errors with nothing\n\t * to classify (transport failures and poll timeouts) leave it `undefined`.\n\t */\n\treadonly code?: string | undefined;\n}\n\nconst NO_PREVIOUS_ATTEMPTS: ReadonlyArray<OpenCloudError> = Object.freeze([]);\n\nconst PREVIOUS_ATTEMPTS = new WeakMap<OpenCloudError, ReadonlyArray<OpenCloudError>>();\n\n/**\n * Base error class for all Open Cloud SDK errors.\n *\n * All specific error types (RateLimitError, ApiError, NetworkError)\n * extend this class, enabling `instanceof OpenCloudError` checks.\n *\n * `code` is declared here rather than on the subclasses that populate it, so a\n * caller holding the `OpenCloudError` that `Result.err` is typed as can branch\n * on it without first narrowing to a subclass.\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { ApiError, OpenCloudError } from \"@bedrock-rbx/ocale\";\n *\n * // `Result.err` is typed as OpenCloudError, so a caller draining a queue\n * // branches on the canonical status without narrowing to a subclass first.\n * const err: OpenCloudError = new ApiError(\"HTTP 404: Queue items not found.\", {\n * code: \"NOT_FOUND\",\n * statusCode: 404,\n * });\n *\n * expect(err.code).toBe(\"NOT_FOUND\");\n * expect(new OpenCloudError(\"no classifier\").code).toBeUndefined();\n * ```\n */\nexport class OpenCloudError extends Error {\n\t/** Machine-readable classifier, or `undefined` when the error has none. */\n\tpublic readonly code: string | undefined;\n\tpublic override readonly name: string = \"OpenCloudError\";\n\n\t/**\n\t * Creates a new OpenCloudError.\n\t *\n\t * @param message - Human-readable error description.\n\t * @param options - Error options including the optional `cause` and the\n\t * machine-readable `code`.\n\t */\n\tconstructor(message?: string, options?: OpenCloudErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.code = options?.code;\n\t}\n\n\t/**\n\t * Failures of the earlier attempts of the same logical request, oldest\n\t * first. A failure that is this error's own `cause` is not repeated here.\n\t * Empty when the request was not retried.\n\t *\n\t * @since 0.4.0\n\t * @returns The earlier attempts' failures.\n\t */\n\tpublic get previousAttempts(): ReadonlyArray<OpenCloudError> {\n\t\treturn PREVIOUS_ATTEMPTS.get(this) ?? NO_PREVIOUS_ATTEMPTS;\n\t}\n}\n\n/**\n * Records the failures of the earlier attempts of the logical request that\n * produced `error`, so they read back through\n * {@link OpenCloudError.previousAttempts}.\n *\n * @param error - The failure the retry loop returns.\n * @param attempts - Earlier attempt failures, oldest first.\n * @returns The same error.\n */\nexport function recordPreviousAttempts(\n\terror: OpenCloudError,\n\tattempts: ReadonlyArray<OpenCloudError>,\n): OpenCloudError {\n\tPREVIOUS_ATTEMPTS.set(error, Object.freeze([...attempts]));\n\treturn error;\n}\n","import { OpenCloudError, type OpenCloudErrorOptions } from \"./base.ts\";\n\n/**\n * Options for constructing an {@link ApiError}.\n *\n * @since 0.1.0\n */\nexport interface ApiErrorOptions extends OpenCloudErrorOptions {\n\t/** Parsed response body, when present. */\n\tdetails?: JSONValue | undefined;\n\t/**\n\t * Wall-clock time the request was in flight before this error, in\n\t * milliseconds. Present for errors built by the transport; a long elapsed\n\t * time on an intermittent failure points at a load or timeout correlation.\n\t */\n\telapsedMs?: number | undefined;\n\t/**\n\t * Human-readable summary extracted from an HTML gateway error page, set\n\t * when the error body was such a page (an HAProxy-style load-balancer\n\t * rejection) rather than an Open Cloud response. When present, the raw HTML\n\t * is not retained on {@link ApiError.details}.\n\t */\n\tgatewaySummary?: string | undefined;\n\t/** HTTP method of the request that produced this error. */\n\tmethod?: string | undefined;\n\t/**\n\t * Allowlisted response headers useful for diagnosis and escalation (request\n\t * ids, edge/server identifiers). The full header set is never retained, to\n\t * avoid surfacing anything sensitive and to keep errors light.\n\t */\n\tresponseHeaders?: Readonly<Record<string, string>> | undefined;\n\t/** HTTP status code from the API response. */\n\tstatusCode: number;\n\t/**\n\t * Length, in decoded characters, of a 2xx body that could not be parsed as\n\t * JSON. Set only by the transport, and only for that failure — nothing else\n\t * builds an {@link ApiError} over a successful status — so its presence is\n\t * also how a body-parse failure is told apart from an API rejection. The\n\t * number is the diagnostic one: a body that stops mid-token at exactly the\n\t * length the edge delivered is a truncated read, not malformed JSON.\n\t */\n\tunparsedBodyLength?: number | undefined;\n\t/** Fully-qualified URL of the request that produced this error. */\n\turl?: string | undefined;\n}\n\n/**\n * Everything in {@link ApiErrorOptions} except what the API answered ({@link\n * ApiErrorOptions.code}, {@link ApiErrorOptions.details}, and {@link\n * ApiErrorOptions.statusCode}): the request the transport made, how long it was\n * in flight, and what the response carried alongside its body. Every field is\n * required, and every one accepts `undefined` for a field the transport did not\n * capture.\n *\n * @since 0.2.0\n */\nexport type ApiRequestContext = {\n\t[K in Exclude<keyof ApiErrorOptions, \"cause\" | \"code\" | \"details\" | \"statusCode\">]-?:\n\t\t| ApiErrorOptions[K]\n\t\t| undefined;\n};\n\n/**\n * Thrown when the Roblox Open Cloud API returns a non-2xx response\n * that is not a rate limit (429).\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { ApiError } from \"@bedrock-rbx/ocale\";\n *\n * const error = new ApiError(\"HTTP 404: Pass not found (code NotFound)\", {\n * code: \"NotFound\",\n * details: { errorCode: \"NotFound\", message: \"Pass not found\" },\n * statusCode: 404,\n * });\n *\n * expect(error).toBeInstanceOf(ApiError);\n * expect(error.statusCode).toBe(404);\n * expect(error.code).toBe(\"NotFound\");\n * expect(error.details).toEqual({\n * errorCode: \"NotFound\",\n * message: \"Pass not found\",\n * });\n * ```\n */\nexport class ApiError extends OpenCloudError {\n\tpublic readonly details: JSONValue | undefined;\n\tpublic readonly elapsedMs: number | undefined;\n\tpublic readonly gatewaySummary: string | undefined;\n\tpublic readonly method: string | undefined;\n\tpublic override readonly name: string = \"ApiError\";\n\tpublic readonly responseHeaders: Readonly<Record<string, string>> | undefined;\n\tpublic readonly statusCode: number;\n\tpublic readonly unparsedBodyLength: number | undefined;\n\tpublic readonly url: string | undefined;\n\n\t/**\n\t * Creates a new ApiError.\n\t *\n\t * @param message - Human-readable error description.\n\t * @param options - Error options including status code, optional error\n\t * code, the parsed response body when present, and the request context\n\t * (method, url, elapsed time, allowlisted response headers) when built by\n\t * the transport.\n\t */\n\tconstructor(message: string, options: ApiErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.statusCode = options.statusCode;\n\t\tthis.details = options.details;\n\t\tthis.method = options.method;\n\t\tthis.url = options.url;\n\t\tthis.elapsedMs = options.elapsedMs;\n\t\tthis.responseHeaders = options.responseHeaders;\n\t\tthis.gatewaySummary = options.gatewaySummary;\n\t\tthis.unparsedBodyLength = options.unparsedBodyLength;\n\t}\n}\n\n/**\n * Reads the request context off an {@link ApiError} so a replacement error can\n * carry it. Spread the result into the options of the new error. {@link\n * OpenCloudError.code}, {@link ApiError.details}, and {@link\n * ApiError.statusCode} describe the API's answer and are left to the caller.\n *\n * @since 0.2.0\n *\n * @param err - The error to read the request context from.\n * @returns The transport-captured fields, each undefined when unset.\n *\n * @example\n *\n * ```ts\n * import { ApiError, requestContextOf } from \"@bedrock-rbx/ocale\";\n *\n * const original = new ApiError(\"HTTP 404\", {\n * elapsedMs: 512,\n * method: \"GET\",\n * statusCode: 404,\n * url: \"https://apis.roblox.com/cloud/v2/universes/1\",\n * });\n *\n * const rewrapped = new ApiError(\"Universe 1 was not found; adoption failed\", {\n * ...requestContextOf(original),\n * statusCode: 404,\n * });\n *\n * expect(rewrapped.method).toBe(\"GET\");\n * expect(rewrapped.url).toBe(\"https://apis.roblox.com/cloud/v2/universes/1\");\n * expect(rewrapped.elapsedMs).toBe(512);\n * ```\n */\nexport function requestContextOf(err: ApiError): ApiRequestContext {\n\treturn {\n\t\telapsedMs: err.elapsedMs,\n\t\tgatewaySummary: err.gatewaySummary,\n\t\tmethod: err.method,\n\t\tresponseHeaders: err.responseHeaders,\n\t\tunparsedBodyLength: err.unparsedBodyLength,\n\t\turl: err.url,\n\t};\n}\n","import { OpenCloudError, type OpenCloudErrorOptions } from \"./base.ts\";\n\n/**\n * Which layer refused a 429, as best the SDK can tell from one response.\n * It names the refusing layer only, not the cause of the refusal.\n *\n * - `\"edge\"`: the gateway refused before the request reached the service.\n * - `\"service\"`: the service behind the gateway refused (the response names it\n * in `x-roblox-system-reason`).\n * - `\"unknown\"`: the response has no positive evidence for either layer.\n *\n * @since 0.4.0\n */\nexport type RateLimitSource = \"edge\" | \"service\" | \"unknown\";\n\n/**\n * Options for constructing a {@link RateLimitError}.\n *\n * @since 0.1.0\n */\nexport interface RateLimitErrorOptions extends OpenCloudErrorOptions {\n\t/**\n\t * Parsed 429 response body, when present. Holds the server's 429\n\t * explanation (JSON when the body parses, otherwise the truncated raw\n\t * text) so a rate limit stays diagnosable from the error alone. A literal\n\t * JSON `null` remains `null`; an absent body is `undefined`.\n\t */\n\tdetails?: JSONValue | undefined;\n\t/**\n\t * Requests left in the reported rate-limit window. Read from\n\t * `x-ratelimit-remaining` using the smallest valid token.\n\t *\n\t * `undefined` when the header has no valid non-negative integer token.\n\t *\n\t * Parsed separately from `x-ratelimit-reset`; a valid value survives an\n\t * invalid reset.\n\t *\n\t * This is one budget reading, not a classifier for the cause of the 429.\n\t */\n\tremaining?: number | undefined;\n\t/**\n\t * Allowlisted response headers useful for diagnosing the 429. Values are\n\t * preserved exactly as the Fetch API presents them, including comma-joined\n\t * multi-window values. The full header set is never retained.\n\t */\n\tresponseHeaders?: Readonly<Record<string, string>> | undefined;\n\t/** Seconds to wait before retrying the request. */\n\tretryAfterSeconds: number;\n\t/**\n\t * Which layer refused the request. Defaults to `\"unknown\"`.\n\t *\n\t * @since 0.4.0\n\t */\n\tsource?: RateLimitSource | undefined;\n\t/**\n\t * HTTP status code that produced the error. Always `429` when minted by the\n\t * SDK transport; `undefined` when constructed without one.\n\t */\n\tstatusCode?: number | undefined;\n}\n\n/**\n * Thrown when the Roblox Open Cloud API returns a 429 Too Many Requests\n * response. Contains the server-suggested retry delay and safe,\n * machine-readable response evidence. The body code, remaining budget, and\n * headers do not identify the upstream cause (for example quota vs place\n * capacity). `source` names only the layer that refused the request;\n * `\"unknown\"` means the response carried no positive evidence for either\n * layer.\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { RateLimitError } from \"@bedrock-rbx/ocale\";\n *\n * const error = new RateLimitError(\"Too many requests\", {\n * code: \"RESOURCE_EXHAUSTED\",\n * remaining: 3,\n * responseHeaders: {\n * \"retry-after\": \"1856\",\n * \"x-ratelimit-limit\": \"5, 5;w=60, 5;w=60\",\n * },\n * retryAfterSeconds: 1856,\n * source: \"service\",\n * });\n *\n * // `source` is a classification; the raw evidence stays available.\n * const evidence = {\n * code: error.code,\n * limit: error.responseHeaders?.[\"x-ratelimit-limit\"],\n * retryAfter: error.responseHeaders?.[\"retry-after\"],\n * source: error.source,\n * };\n *\n * expect(evidence).toEqual({\n * code: \"RESOURCE_EXHAUSTED\",\n * limit: \"5, 5;w=60, 5;w=60\",\n * retryAfter: \"1856\",\n * source: \"service\",\n * });\n * ```\n */\nexport class RateLimitError extends OpenCloudError {\n\t/**\n\t * Parsed 429 response body. A literal JSON `null` remains `null`; an absent\n\t * body is `undefined`.\n\t */\n\tpublic readonly details: JSONValue | undefined;\n\tpublic override readonly name = \"RateLimitError\";\n\t/**\n\t * Requests left in the reported window, or `undefined` if not reported.\n\t */\n\tpublic readonly remaining: number | undefined;\n\t/** Allowlisted raw response headers, or `undefined` if not set. */\n\tpublic readonly responseHeaders: Readonly<Record<string, string>> | undefined;\n\tpublic readonly retryAfterSeconds: number;\n\t/**\n\t * Which layer refused the request, or `\"unknown\"` without evidence.\n\t *\n\t * @since 0.4.0\n\t */\n\tpublic readonly source: RateLimitSource;\n\t/** HTTP status code that produced the error, or `undefined` if not set. */\n\tpublic readonly statusCode: number | undefined;\n\n\t/**\n\t * Creates a new RateLimitError.\n\t *\n\t * @param message - Human-readable error description.\n\t * @param options - Error options including the retry delay.\n\t */\n\tconstructor(message: string, options: RateLimitErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.retryAfterSeconds = options.retryAfterSeconds;\n\t\tthis.remaining = options.remaining;\n\t\tthis.responseHeaders = options.responseHeaders;\n\t\tthis.details = options.details;\n\t\tthis.statusCode = options.statusCode;\n\t\tthis.source = options.source ?? \"unknown\";\n\t}\n}\n\nconst GUIDED_ERRORS = new WeakSet<RateLimitError>();\n\n/**\n * Marks a transport-minted error whose zero-second delay is explicit guidance.\n *\n * @param error - The classified rate-limit failure.\n * @returns The same error, marked for retry orchestration.\n */\nexport function markServerRetryGuidance(error: RateLimitError): RateLimitError {\n\tGUIDED_ERRORS.add(error);\n\treturn error;\n}\n\n/**\n * Checks whether an error carries applicable server retry guidance.\n *\n * @param error - The rate-limit failure to inspect.\n * @returns Whether its delay should override caller backoff.\n */\nexport function hasServerRetryGuidance(error: RateLimitError): boolean {\n\treturn error.retryAfterSeconds > 0 || GUIDED_ERRORS.has(error);\n}\n","import { OpenCloudError } from \"./base.ts\";\n\n/**\n * Options for constructing a {@link NetworkError}.\n *\n * @since 0.1.0\n */\nexport interface NetworkErrorOptions extends ErrorOptions {\n\t/** HTTP method of the request that failed. */\n\tmethod?: string | undefined;\n\t/** Fully-qualified URL of the request that failed. */\n\turl?: string | undefined;\n}\n\n/**\n * Thrown when a network-level failure prevents the request from reaching\n * the Roblox Open Cloud API (e.g., DNS resolution failure, connection reset).\n * The `method` and `url` name the failing call so a transport failure that\n * survives every retry can be diagnosed; the underlying transport error is\n * carried on `cause`.\n *\n * @since 0.1.0\n */\nexport class NetworkError extends OpenCloudError {\n\tpublic readonly method: string | undefined;\n\tpublic override readonly name: string = \"NetworkError\";\n\tpublic readonly url: string | undefined;\n\n\t/**\n\t * Creates a new NetworkError.\n\t *\n\t * @param message - Human-readable error description.\n\t * @param options - Error options including the optional `cause` and the\n\t * `method` / `url` of the request that failed.\n\t */\n\tconstructor(message: string, options?: NetworkErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.method = options?.method;\n\t\tthis.url = options?.url;\n\t}\n}\n"],"mappings":";AAeA,MAAM,uBAAsD,OAAO,OAAO,CAAC,CAAC;AAE5E,MAAM,oCAAoB,IAAI,QAAuD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BrF,IAAa,iBAAb,cAAoC,MAAM;;CAEzC;CACA,OAAwC;;;;;;;;CASxC,YAAY,SAAkB,SAAiC;EAC9D,MAAM,SAAS,OAAO;EACtB,KAAK,OAAO,SAAS;CACtB;;;;;;;;;CAUA,IAAW,mBAAkD;EAC5D,OAAO,kBAAkB,IAAI,IAAI,KAAK;CACvC;AACD;;;;;;;;;;AAWA,SAAgB,uBACf,OACA,UACiB;CACjB,kBAAkB,IAAI,OAAO,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;CACzD,OAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACJA,IAAa,WAAb,cAA8B,eAAe;CAC5C;CACA;CACA;CACA;CACA,OAAwC;CACxC;CACA;CACA;CACA;;;;;;;;;;CAWA,YAAY,SAAiB,SAA0B;EACtD,MAAM,SAAS,OAAO;EACtB,KAAK,aAAa,QAAQ;EAC1B,KAAK,UAAU,QAAQ;EACvB,KAAK,SAAS,QAAQ;EACtB,KAAK,MAAM,QAAQ;EACnB,KAAK,YAAY,QAAQ;EACzB,KAAK,kBAAkB,QAAQ;EAC/B,KAAK,iBAAiB,QAAQ;EAC9B,KAAK,qBAAqB,QAAQ;CACnC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAgB,iBAAiB,KAAkC;CAClE,OAAO;EACN,WAAW,IAAI;EACf,gBAAgB,IAAI;EACpB,QAAQ,IAAI;EACZ,iBAAiB,IAAI;EACrB,oBAAoB,IAAI;EACxB,KAAK,IAAI;CACV;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3DA,IAAa,iBAAb,cAAoC,eAAe;;;;;CAKlD;CACA,OAAgC;;;;CAIhC;;CAEA;CACA;;;;;;CAMA;;CAEA;;;;;;;CAQA,YAAY,SAAiB,SAAgC;EAC5D,MAAM,SAAS,OAAO;EACtB,KAAK,oBAAoB,QAAQ;EACjC,KAAK,YAAY,QAAQ;EACzB,KAAK,kBAAkB,QAAQ;EAC/B,KAAK,UAAU,QAAQ;EACvB,KAAK,aAAa,QAAQ;EAC1B,KAAK,SAAS,QAAQ,UAAU;CACjC;AACD;AAEA,MAAM,gCAAgB,IAAI,QAAwB;;;;;;;AAQlD,SAAgB,wBAAwB,OAAuC;CAC9E,cAAc,IAAI,KAAK;CACvB,OAAO;AACR;;;;;;;AAQA,SAAgB,uBAAuB,OAAgC;CACtE,OAAO,MAAM,oBAAoB,KAAK,cAAc,IAAI,KAAK;AAC9D;;;;;;;;;;;AC9IA,IAAa,eAAb,cAAkC,eAAe;CAChD;CACA,OAAwC;CACxC;;;;;;;;CASA,YAAY,SAAiB,SAA+B;EAC3D,MAAM,SAAS,OAAO;EACtB,KAAK,SAAS,SAAS;EACvB,KAAK,MAAM,SAAS;CACrB;AACD"}