@bedrock-rbx/ocale 0.1.0-beta.1 → 0.1.0-beta.10

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 (70) hide show
  1. package/dist/badges.d.mts +86 -3
  2. package/dist/badges.d.mts.map +1 -1
  3. package/dist/badges.mjs +113 -6
  4. package/dist/badges.mjs.map +1 -1
  5. package/dist/data.generated-Cb6g6asv.d.mts +485 -0
  6. package/dist/data.generated-Cb6g6asv.d.mts.map +1 -0
  7. package/dist/developer-products.d.mts +14 -5
  8. package/dist/developer-products.d.mts.map +1 -1
  9. package/dist/developer-products.mjs +5 -5
  10. package/dist/developer-products.mjs.map +1 -1
  11. package/dist/game-passes.d.mts +83 -2
  12. package/dist/game-passes.d.mts.map +1 -1
  13. package/dist/game-passes.mjs +111 -5
  14. package/dist/game-passes.mjs.map +1 -1
  15. package/dist/index.d.mts +75 -64
  16. package/dist/index.d.mts.map +1 -1
  17. package/dist/index.mjs +5 -3
  18. package/dist/locales.d.mts +2 -0
  19. package/dist/locales.mjs +512 -0
  20. package/dist/locales.mjs.map +1 -0
  21. package/dist/luau-execution.d.mts +149 -0
  22. package/dist/luau-execution.d.mts.map +1 -0
  23. package/dist/luau-execution.mjs +164 -0
  24. package/dist/luau-execution.mjs.map +1 -0
  25. package/dist/permission-error-DOVtNq3A.mjs +46 -0
  26. package/dist/permission-error-DOVtNq3A.mjs.map +1 -0
  27. package/dist/places.d.mts +87 -8
  28. package/dist/places.d.mts.map +1 -1
  29. package/dist/places.mjs +58 -69
  30. package/dist/places.mjs.map +1 -1
  31. package/dist/poll-timeout-Dg_QFEqi.mjs +79 -0
  32. package/dist/poll-timeout-Dg_QFEqi.mjs.map +1 -0
  33. package/dist/polling-BMrYajok.d.mts +253 -0
  34. package/dist/polling-BMrYajok.d.mts.map +1 -0
  35. package/dist/polling-helpers-QGjvYq3c.mjs +650 -0
  36. package/dist/polling-helpers-QGjvYq3c.mjs.map +1 -0
  37. package/dist/{price-information-CmpscMc4.mjs → price-information-DIrvwCmd.mjs} +2 -2
  38. package/dist/{price-information-CmpscMc4.mjs.map → price-information-DIrvwCmd.mjs.map} +1 -1
  39. package/dist/rate-limit-BYuizHoD.d.mts +92 -0
  40. package/dist/rate-limit-BYuizHoD.d.mts.map +1 -0
  41. package/dist/{rate-limit-BBU_4xnZ.mjs → rate-limit-D1q2Js-z.mjs} +12 -46
  42. package/dist/rate-limit-D1q2Js-z.mjs.map +1 -0
  43. package/dist/{resource-client-CaS_j3yg.mjs → resource-client-D6Efj9fU.mjs} +95 -15
  44. package/dist/resource-client-D6Efj9fU.mjs.map +1 -0
  45. package/dist/signatures-B5Fojgn0.mjs +59 -0
  46. package/dist/signatures-B5Fojgn0.mjs.map +1 -0
  47. package/dist/storage.d.mts +662 -0
  48. package/dist/storage.d.mts.map +1 -0
  49. package/dist/storage.mjs +858 -0
  50. package/dist/storage.mjs.map +1 -0
  51. package/dist/testing.d.mts +727 -0
  52. package/dist/testing.d.mts.map +1 -0
  53. package/dist/testing.mjs +457 -0
  54. package/dist/testing.mjs.map +1 -0
  55. package/dist/{to-blob-1BtHsDGK.mjs → to-blob-B27VhoRp.mjs} +1 -1
  56. package/dist/{to-blob-1BtHsDGK.mjs.map → to-blob-B27VhoRp.mjs.map} +1 -1
  57. package/dist/{types-YCTsM8Qd.d.mts → types-CwtZT1ek.d.mts} +1 -1
  58. package/dist/{types-YCTsM8Qd.d.mts.map → types-CwtZT1ek.d.mts.map} +1 -1
  59. package/dist/universes.d.mts +38 -18
  60. package/dist/universes.d.mts.map +1 -1
  61. package/dist/universes.mjs +5 -5
  62. package/dist/universes.mjs.map +1 -1
  63. package/dist/{validation-CTZzJhmd.mjs → validation-DkL5KQqz.mjs} +2 -2
  64. package/dist/validation-DkL5KQqz.mjs.map +1 -0
  65. package/dist/wire-CeL6W_V7.d.mts +35 -0
  66. package/dist/wire-CeL6W_V7.d.mts.map +1 -0
  67. package/package.json +8 -3
  68. package/dist/rate-limit-BBU_4xnZ.mjs.map +0 -1
  69. package/dist/resource-client-CaS_j3yg.mjs.map +0 -1
  70. package/dist/validation-CTZzJhmd.mjs.map +0 -1
@@ -0,0 +1,662 @@
1
+ import { d as OpenCloudError, i as OpenCloudClientOptions, l as Result, n as HttpRequest, r as HttpResponse, s as RequestOptions, u as SleepFunc } from "./types-CwtZT1ek.mjs";
2
+
3
+ //#region src/domains/cloud-v2/memory-store-queues/types.d.ts
4
+ /**
5
+ * Caller-supplied input for the `enqueue` method on `StorageClient.queues`.
6
+ * Mirrors `Cloud_CreateMemoryStoreQueueItem` on the Open Cloud API.
7
+ */
8
+ interface EnqueueQueueItemParameters {
9
+ /**
10
+ * Opaque queue payload. Round-trips as JSON, including nested `null`
11
+ * values inside objects and arrays. The top-level value cannot be
12
+ * `null`: the server rejects null payloads with a 400, so the type
13
+ * forbids it at compile time.
14
+ */
15
+ readonly data: Exclude<JSONValue, null>;
16
+ /**
17
+ * Optional priority. Higher values are dequeued first; equal priorities
18
+ * preserve insertion order. Omitted entries are inserted at the back of
19
+ * the queue.
20
+ */
21
+ readonly priority?: number;
22
+ /** Stringified queue identifier; the queue is auto-created on first use. */
23
+ readonly queueId: string;
24
+ /**
25
+ * Optional time-to-live in seconds. After this many seconds the item is
26
+ * automatically removed from the queue. Omitted entries inherit the
27
+ * server-default TTL.
28
+ */
29
+ readonly ttl?: number;
30
+ /** Stringified ID of the universe that owns the queue. */
31
+ readonly universeId: string;
32
+ }
33
+ /**
34
+ * Parsed representation of a memory-store queue item, as returned by the
35
+ * Open Cloud `Cloud_CreateMemoryStoreQueueItem` and (inside the array)
36
+ * `Cloud_ReadMemoryStoreQueueItems` endpoints.
37
+ */
38
+ interface QueueItem {
39
+ /** Server-generated item identifier, parsed from the wire `path`. */
40
+ readonly id: string;
41
+ /**
42
+ * Opaque queue payload. Nested `null` values inside the JSON shape are
43
+ * preserved verbatim; only the top level is constrained.
44
+ */
45
+ readonly data: Exclude<JSONValue, null>;
46
+ /** Timestamp at which the server removes the item from the queue. */
47
+ readonly expiresAt: Date;
48
+ /** Priority recorded on the item, or `undefined` when none was set. */
49
+ readonly priority: number | undefined;
50
+ /** Stringified queue identifier, parsed from the wire `path`. */
51
+ readonly queueId: string;
52
+ /** Stringified universe identifier, parsed from the wire `path`. */
53
+ readonly universeId: string;
54
+ }
55
+ /**
56
+ * Caller-supplied input for the `dequeue` method on
57
+ * `StorageClient.queues`. Mirrors `Cloud_ReadMemoryStoreQueueItems`.
58
+ */
59
+ interface DequeueQueueItemsParameters {
60
+ /**
61
+ * If `true`, the server returns 404 when fewer than `count` items
62
+ * are available. Defaults to `false`, in which case the server
63
+ * returns whatever subset is currently at the front of the queue.
64
+ */
65
+ readonly allOrNothing?: boolean;
66
+ /**
67
+ * Number of items to read from the front of the queue. Defaults to
68
+ * `1`; values above `200` are clamped server-side.
69
+ */
70
+ readonly count?: number;
71
+ /**
72
+ * Number of seconds the dequeued items remain invisible to
73
+ * subsequent reads. Items not acknowledged via `discard` reappear
74
+ * once the window elapses. Defaults to `30` seconds server-side.
75
+ */
76
+ readonly invisibilityWindow?: number;
77
+ /** Stringified queue identifier. */
78
+ readonly queueId: string;
79
+ /** Stringified ID of the universe that owns the queue. */
80
+ readonly universeId: string;
81
+ }
82
+ /**
83
+ * Parsed result of a successful `Cloud_ReadMemoryStoreQueueItems`
84
+ * response. The `readId` value must be passed to a subsequent
85
+ * `discard` call to acknowledge the items; otherwise the items reappear
86
+ * once the invisibility window elapses.
87
+ */
88
+ interface DequeueResult {
89
+ /** Items dequeued from the front of the queue, in dequeue order. */
90
+ readonly items: ReadonlyArray<QueueItem>;
91
+ /**
92
+ * Identifier of the dequeue operation. Pass this to `discard` to
93
+ * remove the items from the queue permanently.
94
+ */
95
+ readonly readId: string;
96
+ }
97
+ /**
98
+ * Caller-supplied input for the `discard` method on
99
+ * `StorageClient.queues`. Mirrors `Cloud_DiscardMemoryStoreQueueItems`.
100
+ * Acknowledging a `readId` removes the dequeued batch from the queue
101
+ * permanently; without `discard`, the items reappear once their
102
+ * invisibility window elapses.
103
+ */
104
+ interface DiscardQueueItemsParameters {
105
+ /** Stringified queue identifier. */
106
+ readonly queueId: string;
107
+ /** Identifier returned by a prior `dequeue` call. */
108
+ readonly readId: string;
109
+ /** Stringified ID of the universe that owns the queue. */
110
+ readonly universeId: string;
111
+ }
112
+ //#endregion
113
+ //#region src/domains/cloud-v2/memory-store-sorted-maps/types.d.ts
114
+ /**
115
+ * Discriminated union describing a sorted-map item's sort key. The
116
+ * server contract requires at most one of `stringSortKey` or
117
+ * `numericSortKey`; the union surfaces that constraint at the type
118
+ * level so callers cannot accidentally set both.
119
+ */
120
+ type SortKey = {
121
+ readonly kind: "numeric";
122
+ readonly value: number;
123
+ } | {
124
+ readonly kind: "string";
125
+ readonly value: string;
126
+ };
127
+ /**
128
+ * Caller-supplied input for the `create` method on
129
+ * `StorageClient.sortedMaps`. Mirrors
130
+ * `Cloud_CreateMemoryStoreSortedMapItem` on the Open Cloud API.
131
+ */
132
+ interface CreateSortedMapItemParameters {
133
+ /**
134
+ * Caller-supplied item identifier. The server stores items
135
+ * case-sensitively; the value is URL-encoded by the builder.
136
+ */
137
+ readonly itemId: string;
138
+ /** Stringified sorted-map identifier. */
139
+ readonly mapId: string;
140
+ /** Optional sort key driving the item's position in the map. */
141
+ readonly sortKey?: SortKey;
142
+ /**
143
+ * Optional time-to-live in seconds. After this many seconds the
144
+ * item is automatically removed. Omitted entries inherit the
145
+ * server-default TTL.
146
+ */
147
+ readonly ttl?: number;
148
+ /** Stringified ID of the universe that owns the sorted map. */
149
+ readonly universeId: string;
150
+ /**
151
+ * Opaque item payload. May be any JSON value, including `null`,
152
+ * matching the protobuf `Value` contract on the wire.
153
+ */
154
+ readonly value: JSONValue;
155
+ }
156
+ /**
157
+ * Caller-supplied input for the `list` method on
158
+ * `StorageClient.sortedMaps`. Mirrors
159
+ * `Cloud_ListMemoryStoreSortedMapItems` on the Open Cloud API. All
160
+ * paging and filtering parameters are optional; omitting them returns
161
+ * up to one item server-side (`maxPageSize` defaults to `1`).
162
+ */
163
+ interface ListSortedMapItemsParameters {
164
+ /**
165
+ * Optional CEL filter on `id` and `sortKey`. The server supports
166
+ * `<`, `>`, and `&&` operators only; other operators are rejected
167
+ * server-side with a validation error.
168
+ */
169
+ readonly filter?: string;
170
+ /** Stringified sorted-map identifier. */
171
+ readonly mapId: string;
172
+ /**
173
+ * Maximum items per page. Capped at `100` server-side; values above
174
+ * the cap are clamped. Defaults to `1` when omitted.
175
+ */
176
+ readonly maxPageSize?: number;
177
+ /**
178
+ * Sort order. The server supports the `id` field only, with an
179
+ * optional ` desc` suffix.
180
+ */
181
+ readonly orderBy?: string;
182
+ /**
183
+ * Page token returned by a previous call. When supplied, all other
184
+ * parameters must match the previous call exactly.
185
+ */
186
+ readonly pageToken?: string;
187
+ /** Stringified ID of the universe that owns the sorted map. */
188
+ readonly universeId: string;
189
+ }
190
+ /**
191
+ * Parsed representation of a sorted-map item, as returned by every
192
+ * sorted-map operation that yields a single item.
193
+ */
194
+ interface SortedMapItem {
195
+ /** Item identifier, parsed from the wire `path`. */
196
+ readonly id: string;
197
+ /**
198
+ * Server-generated etag for optimistic concurrency. Surfaced for
199
+ * caller inspection; the SDK does not yet emit an `If-Match` header
200
+ * for conditional update or delete.
201
+ */
202
+ readonly etag: string;
203
+ /** Timestamp at which the server removes the item from the map. */
204
+ readonly expiresAt: Date;
205
+ /** Stringified sorted-map identifier, parsed from the wire `path`. */
206
+ readonly mapId: string;
207
+ /**
208
+ * Parsed sort key, or `undefined` when the item has none. The server
209
+ * contract is one-of: a response carrying both `stringSortKey` and
210
+ * `numericSortKey` is rejected as malformed.
211
+ */
212
+ readonly sortKey: SortKey | undefined;
213
+ /** Stringified universe identifier, parsed from the wire `path`. */
214
+ readonly universeId: string;
215
+ /**
216
+ * Opaque item payload. Round-trips as JSON, including nested `null`
217
+ * values inside objects and arrays, and `null` at the top level.
218
+ */
219
+ readonly value: JSONValue;
220
+ }
221
+ /**
222
+ * Parsed result of a successful `Cloud_ListMemoryStoreSortedMapItems`
223
+ * response.
224
+ */
225
+ interface ListSortedMapItemsResult {
226
+ /** Items returned in the current page, ordered per `orderBy`. */
227
+ readonly items: ReadonlyArray<SortedMapItem>;
228
+ /**
229
+ * Page token for the next call, or `undefined` when no more pages
230
+ * exist. Pass back through `pageToken` to retrieve the next page.
231
+ */
232
+ readonly nextPageToken: string | undefined;
233
+ }
234
+ /**
235
+ * Caller-supplied input for the `delete` method on
236
+ * `StorageClient.sortedMaps`. Mirrors
237
+ * `Cloud_DeleteMemoryStoreSortedMapItem` on the Open Cloud API.
238
+ */
239
+ interface DeleteSortedMapItemParameters {
240
+ /** Caller-supplied item identifier. URL-encoded by the builder. */
241
+ readonly itemId: string;
242
+ /** Stringified sorted-map identifier. */
243
+ readonly mapId: string;
244
+ /** Stringified ID of the universe that owns the sorted map. */
245
+ readonly universeId: string;
246
+ }
247
+ /**
248
+ * Caller-supplied input for the `get` method on
249
+ * `StorageClient.sortedMaps`. Mirrors
250
+ * `Cloud_GetMemoryStoreSortedMapItem` on the Open Cloud API.
251
+ */
252
+ interface GetSortedMapItemParameters {
253
+ /** Caller-supplied item identifier. URL-encoded by the builder. */
254
+ readonly itemId: string;
255
+ /** Stringified sorted-map identifier. */
256
+ readonly mapId: string;
257
+ /** Stringified ID of the universe that owns the sorted map. */
258
+ readonly universeId: string;
259
+ }
260
+ /**
261
+ * Caller-supplied input for the `update` method on
262
+ * `StorageClient.sortedMaps`. Mirrors
263
+ * `Cloud_UpdateMemoryStoreSortedMapItem` on the Open Cloud API. Body
264
+ * fields (`value`, `ttl`, `sortKey`) are optional under PATCH
265
+ * semantics; omitted fields are left unchanged on the server.
266
+ */
267
+ interface UpdateSortedMapItemParameters {
268
+ /**
269
+ * When `true`, the server creates the item if it does not exist
270
+ * instead of returning 404. Travels as the `allowMissing` query
271
+ * string parameter.
272
+ */
273
+ readonly allowMissing?: boolean;
274
+ /** Caller-supplied item identifier. URL-encoded by the builder. */
275
+ readonly itemId: string;
276
+ /** Stringified sorted-map identifier. */
277
+ readonly mapId: string;
278
+ /**
279
+ * Replacement sort key. Either kind of {@link SortKey} resets the
280
+ * field on the wire; omit the field to leave the existing sort key
281
+ * untouched.
282
+ */
283
+ readonly sortKey?: SortKey;
284
+ /**
285
+ * Replacement time-to-live in seconds. Omitted entries leave the
286
+ * existing TTL unchanged.
287
+ */
288
+ readonly ttl?: number;
289
+ /** Stringified ID of the universe that owns the sorted map. */
290
+ readonly universeId: string;
291
+ /** Replacement value. Omitted entries leave the existing value unchanged. */
292
+ readonly value?: JSONValue;
293
+ }
294
+ //#endregion
295
+ //#region src/internal/http/rate-limit-queue.d.ts
296
+ /**
297
+ * Identifies and bounds a single Roblox Open Cloud operation for rate
298
+ * limiting, e.g. `{ operationKey: "game-passes.create", maxPerSecond: 5 }`.
299
+ */
300
+ interface OperationLimit {
301
+ /** Maximum sustained request rate in requests per second. */
302
+ readonly maxPerSecond: number;
303
+ /**
304
+ * Stable identifier for the operation (e.g. "game-passes.create"). Not
305
+ * consumed by the queue itself; callers use it to key per-operation
306
+ * queues in a registry (see GamePassesClient).
307
+ */
308
+ readonly operationKey: string;
309
+ }
310
+ //#endregion
311
+ //#region src/internal/http/retry.d.ts
312
+ /**
313
+ * Fully-resolved retry config shape that {@link mergeConfig} and
314
+ * {@link shouldRetry} operate on. Fields are required because this represents
315
+ * the post-defaulting, internal view — callers should supply every field (or
316
+ * resolve them via a test factory / client constructor). The partial,
317
+ * user-facing type lives on client construction options; method defaults and
318
+ * per-request overrides use `Partial<RetryResolvable>`.
319
+ */
320
+ interface RetryResolvable {
321
+ /** Roblox Open Cloud API key. */
322
+ readonly apiKey: string;
323
+ /** Base URL for the Open Cloud API. */
324
+ readonly baseUrl: string;
325
+ /** Maximum retry attempts before giving up. */
326
+ readonly maxRetries: number;
327
+ /** Status codes that are eligible for retry. */
328
+ readonly retryableStatuses: ReadonlyArray<number>;
329
+ /** Fallback delay function when no server hint is available. */
330
+ readonly retryDelay: (attempt: number) => number;
331
+ /** Per-request timeout in milliseconds. */
332
+ readonly timeout: number;
333
+ }
334
+ /** Kind of HTTP method the merge is being performed for. */
335
+ type MethodKind = "create" | "idempotent";
336
+ //#endregion
337
+ //#region src/internal/resource-client.d.ts
338
+ /**
339
+ * Describes a single resource method's shape for dispatch through
340
+ * `ResourceClient.execute`. Each resource client declares one module-level
341
+ * constant per public method; that constant binds the four resource-specific
342
+ * values (request builder, response parser, retry-policy method kind,
343
+ * operation-level rate limit) and flows through `execute` uniformly.
344
+ *
345
+ * @template P - The resource-specific parameter shape the builder
346
+ * accepts.
347
+ * @template T - The resource-specific parsed success type the parser
348
+ * produces.
349
+ */
350
+ interface ResourceMethodSpec<P, T> {
351
+ /**
352
+ * Builds the pure {@link HttpRequest} for a single call. Returns a
353
+ * {@link Result} so a builder can short-circuit with a local error
354
+ * (typically a {@link OpenCloudError} subclass such as `ValidationError`)
355
+ * before any HTTP, queue, or retry work happens. Builders that cannot
356
+ * fail wrap their return as `{ data: request, success: true }`.
357
+ */
358
+ readonly buildRequest: (parameters: P) => Result<HttpRequest, OpenCloudError>;
359
+ /** Method-level retry defaults merged into the resolved config. */
360
+ readonly methodDefaults: Partial<RetryResolvable>;
361
+ /**
362
+ * Method kind, controlling merge precedence: `"create"` lets method
363
+ * defaults win over client config so create safety cannot be relaxed
364
+ * silently; `"idempotent"` lets client config win over method defaults
365
+ * so consumers can loosen retry globally.
366
+ */
367
+ readonly methodKind: MethodKind;
368
+ /** Operation-level rate limit, keyed into the client's per-key queue map. */
369
+ readonly operationLimit: OperationLimit;
370
+ /**
371
+ * Converts the full {@link HttpResponse} into the resource-specific
372
+ * parsed shape. Takes the whole response (body, status, headers) so
373
+ * future parsers can read headers without widening the signature.
374
+ */
375
+ readonly parse: (response: HttpResponse) => Result<T, OpenCloudError>;
376
+ /**
377
+ * Open Cloud scopes the API key or OAuth token must carry for this
378
+ * method, sourced from the vendored OpenAPI schema's `x-roblox-scopes`.
379
+ * When set, a 401 or 403 ApiError from the upstream call is upgraded to
380
+ * a {@link PermissionError} carrying these scopes alongside
381
+ * {@link OperationLimit.operationKey}, so callers can name the missing
382
+ * scope instead of just the HTTP status. Optional so test specs and
383
+ * not-yet-wired resources can opt out.
384
+ */
385
+ readonly requiredScopes?: ReadonlyArray<string>;
386
+ }
387
+ /**
388
+ * Single-argument bundle consumed by `ResourceClient.execute`: the per-method
389
+ * spec, the resource-specific parameters, and optional per-request config
390
+ * overrides.
391
+ *
392
+ * @template P - The resource-specific parameter shape the builder accepts.
393
+ * @template T - The resource-specific parsed success type the parser produces.
394
+ */
395
+ interface ExecuteCall<P, T> {
396
+ /** Optional per-request config overrides. */
397
+ readonly options?: RequestOptions | undefined;
398
+ /** Resource-specific request parameters. */
399
+ readonly parameters: P;
400
+ /** Per-method binding of builder, parser, method kind, and operation limit. */
401
+ readonly spec: ResourceMethodSpec<P, T>;
402
+ }
403
+ /**
404
+ * Wraps an infallible request build as a {@link Result}-returning
405
+ * `buildRequest` callback compatible with {@link ResourceMethodSpec}.
406
+ * Use from a resource client whose builder cannot fail; resource clients
407
+ * with local validation should construct the {@link Result} directly.
408
+ *
409
+ * @param request - The pre-built {@link HttpRequest}.
410
+ * @returns A success Result wrapping the request.
411
+ */
412
+ /**
413
+ * Internal orchestrator shared by every Open Cloud resource client. Holds
414
+ * the frozen client config, observability hooks, injected HTTP client and
415
+ * sleep, and the per-effective-key rate-limit queue registry. Resource
416
+ * classes compose one instance and dispatch every public method through
417
+ * {@link ResourceClient.execute} with a per-method {@link ResourceMethodSpec}.
418
+ * Not exported from any package subpath; reachable only via sibling
419
+ * `src/resources/**` modules in this package.
420
+ */
421
+ declare class ResourceClient {
422
+ #private;
423
+ /**
424
+ * Creates a new {@link ResourceClient}. Resolves the injected HTTP
425
+ * client and sleep (defaulting to fetch + `setTimeout`) and freezes the
426
+ * merged client config so subsequent calls cannot mutate it.
427
+ *
428
+ * @param options - Client-level configuration including the API key
429
+ * and optional construction-time test seams.
430
+ */
431
+ constructor(options: OpenCloudClientOptions);
432
+ /**
433
+ * Dispatches a single resource-method call. Merges the frozen client
434
+ * config with the method's `methodDefaults` and the caller's optional
435
+ * per-request `options`, routes through the effective-apiKey rate-limit
436
+ * queue, runs the retry loop, and finally parses the response with the
437
+ * spec's parser.
438
+ *
439
+ * @param call - The per-method spec, resource-specific parameters, and
440
+ * optional per-request overrides.
441
+ * @returns The parsed success payload or the {@link OpenCloudError} that
442
+ * caused the request to fail. Never throws.
443
+ */
444
+ execute<P, T>(call: ExecuteCall<P, T>): Promise<Result<T, OpenCloudError>>;
445
+ /**
446
+ * Returns the sleep function used by this client instance.
447
+ *
448
+ * @returns The sleep function injected at construction time.
449
+ */
450
+ get sleep(): SleepFunc;
451
+ }
452
+ //#endregion
453
+ //#region src/resources/storage/queues-group.d.ts
454
+ /**
455
+ * Operation Group on `StorageClient` that exposes the memory-store
456
+ * queue endpoints. Queues are FIFO collections of opaque JSON values
457
+ * with optional priority and TTL; consumers enqueue items, dequeue
458
+ * them in batches, and acknowledge processed batches with a read
459
+ * identifier.
460
+ */
461
+ declare class MemoryStoreQueuesGroup {
462
+ #private;
463
+ /**
464
+ * Wraps the shared {@link ResourceClient} so the Operation Group
465
+ * routes calls through the same retry, hooks, and rate-limit queues
466
+ * as the rest of the parent client.
467
+ *
468
+ * @param inner - The shared {@link ResourceClient} owned by the
469
+ * parent client.
470
+ */
471
+ constructor(inner: ResourceClient);
472
+ /**
473
+ * Dequeues up to `count` items from the front of the queue. Items
474
+ * returned become invisible to subsequent reads for
475
+ * `invisibilityWindow` seconds (default 30 server-side); they
476
+ * reappear once the window elapses unless acknowledged via
477
+ * `discard` with the returned `readId`.
478
+ *
479
+ * On 5xx, dequeue does not retry: the server may have set
480
+ * invisibility on a batch before the response failed, so a retry
481
+ * would return a *different* batch and the first one is lost until
482
+ * the window expires. Callers that can detect duplicates externally
483
+ * may opt back into 5xx retry per call by passing `retryableStatuses`
484
+ * on `options`.
485
+ *
486
+ * @param parameters - Universe and queue identifiers, plus optional
487
+ * `count`, `allOrNothing`, and `invisibilityWindow`.
488
+ * @param options - Optional per-request overrides.
489
+ * @returns A {@link Result} wrapping the parsed {@link DequeueResult}
490
+ * or the {@link OpenCloudError} that caused the request to fail.
491
+ */
492
+ dequeue(parameters: DequeueQueueItemsParameters, options?: RequestOptions): Promise<Result<DequeueResult, OpenCloudError>>;
493
+ /**
494
+ * Acknowledges a dequeued batch of items, removing them from the
495
+ * queue permanently. Pass the `readId` returned from the prior
496
+ * `dequeue` call. Without `discard`, the items reappear once the
497
+ * invisibility window elapses.
498
+ *
499
+ * The call is idempotent: a second `discard` with the same `readId`
500
+ * is a no-op once the batch has been acknowledged. The retry policy
501
+ * therefore retries both 429 and 5xx.
502
+ *
503
+ * @param parameters - Universe and queue identifiers, plus the
504
+ * `readId` returned from a prior dequeue.
505
+ * @param options - Optional per-request overrides.
506
+ * @returns A {@link Result} wrapping `undefined` on success (the
507
+ * server returns an empty body) or the {@link OpenCloudError}
508
+ * that caused the request to fail.
509
+ */
510
+ discard(parameters: DiscardQueueItemsParameters, options?: RequestOptions): Promise<Result<undefined, OpenCloudError>>;
511
+ /**
512
+ * Enqueues a single item onto a memory-store queue. The queue is
513
+ * auto-created on first use; the queue identifier is any string the
514
+ * caller picks. Items with higher `priority` values are dequeued
515
+ * first; equal priorities preserve insertion order. Items expire
516
+ * and are removed automatically after `ttl` seconds, or after a
517
+ * server-default lifetime when omitted.
518
+ *
519
+ * @param parameters - Universe and queue identifiers, the opaque
520
+ * payload, and optional `priority` and `ttl`.
521
+ * @param options - Optional per-request overrides (e.g. A different
522
+ * {@link OpenCloudClientOptions.apiKey} for this call only).
523
+ * @returns A {@link Result} wrapping the parsed {@link QueueItem} or
524
+ * the {@link OpenCloudError} that caused the request to fail.
525
+ */
526
+ enqueue(parameters: EnqueueQueueItemParameters, options?: RequestOptions): Promise<Result<QueueItem, OpenCloudError>>;
527
+ }
528
+ //#endregion
529
+ //#region src/resources/storage/sorted-maps-group.d.ts
530
+ /**
531
+ * Operation Group on `StorageClient` that exposes the memory-store
532
+ * sorted-map endpoints. Sorted maps are ordered collections of
533
+ * (id, value, sortKey) triples; consumers create, read, update, list,
534
+ * and delete items keyed by a caller-supplied identifier and ordered
535
+ * by an optional string or numeric sort key.
536
+ */
537
+ declare class MemoryStoreSortedMapsGroup {
538
+ #private;
539
+ /**
540
+ * Wraps the shared {@link ResourceClient} so the Operation Group
541
+ * routes calls through the same retry, hooks, and rate-limit queues
542
+ * as the rest of the parent client.
543
+ *
544
+ * @param inner - The shared {@link ResourceClient} owned by the
545
+ * parent client.
546
+ */
547
+ constructor(inner: ResourceClient);
548
+ /**
549
+ * Creates a single item in a sorted map. The sorted map is
550
+ * auto-created on first use; the map identifier is any string the
551
+ * caller picks. Items are keyed by `itemId` (case-sensitive) and
552
+ * ordered by an optional `sortKey`. Items expire and are removed
553
+ * automatically after `ttl` seconds, or after a server-default
554
+ * lifetime when omitted.
555
+ *
556
+ * On 5xx, create does not retry: Roblox Open Cloud has no
557
+ * idempotency-key support, so a retry of a transient failure risks
558
+ * producing a duplicate item.
559
+ *
560
+ * @param parameters - Universe, sorted-map, item identifiers, the
561
+ * value to store, and optional `sortKey` and `ttl`.
562
+ * @param options - Optional per-request overrides (e.g. A different
563
+ * {@link OpenCloudClientOptions.apiKey} for this call only).
564
+ * @returns A {@link Result} wrapping the parsed {@link SortedMapItem}
565
+ * or the {@link OpenCloudError} that caused the request to fail.
566
+ */
567
+ create(parameters: CreateSortedMapItemParameters, options?: RequestOptions): Promise<Result<SortedMapItem, OpenCloudError>>;
568
+ /**
569
+ * Removes a single item from a sorted map. The call is idempotent:
570
+ * a second `delete` against the same item is a no-op once the
571
+ * server has dropped the row. The retry policy retries both 429
572
+ * and 5xx.
573
+ *
574
+ * @param parameters - Universe, sorted-map, and item identifiers.
575
+ * @param options - Optional per-request overrides.
576
+ * @returns A {@link Result} wrapping `undefined` on success or the
577
+ * {@link OpenCloudError} that caused the request to fail.
578
+ */
579
+ delete(parameters: DeleteSortedMapItemParameters, options?: RequestOptions): Promise<Result<undefined, OpenCloudError>>;
580
+ /**
581
+ * Reads a single item from a sorted map. Returns the parsed
582
+ * {@link SortedMapItem} with the server-recorded `etag` for use in
583
+ * subsequent conditional updates (once the SDK begins emitting
584
+ * `If-Match`; see the package README).
585
+ *
586
+ * @param parameters - Universe, sorted-map, and item identifiers.
587
+ * @param options - Optional per-request overrides.
588
+ * @returns A {@link Result} wrapping the parsed {@link SortedMapItem}
589
+ * or the {@link OpenCloudError} that caused the request to fail.
590
+ */
591
+ get(parameters: GetSortedMapItemParameters, options?: RequestOptions): Promise<Result<SortedMapItem, OpenCloudError>>;
592
+ /**
593
+ * Lists items in a sorted map. The server caps `maxPageSize` at
594
+ * `100` and defaults it to `1` when omitted, so callers explicitly
595
+ * pass `maxPageSize` to retrieve more than a single item per page.
596
+ * The `filter` parameter accepts a CEL expression on `id` and
597
+ * `sortKey` (operators `<`, `>`, `&&` only).
598
+ *
599
+ * @param parameters - Universe and sorted-map identifiers, plus
600
+ * optional pagination and filter parameters.
601
+ * @param options - Optional per-request overrides.
602
+ * @returns A {@link Result} wrapping the parsed
603
+ * {@link ListSortedMapItemsResult} or the {@link OpenCloudError}
604
+ * that caused the request to fail.
605
+ */
606
+ list(parameters: ListSortedMapItemsParameters, options?: RequestOptions): Promise<Result<ListSortedMapItemsResult, OpenCloudError>>;
607
+ /**
608
+ * Updates a sorted-map item under PATCH semantics: omitted body
609
+ * fields are left unchanged on the server, supplied fields replace
610
+ * their existing values. Passing `allowMissing: true` creates the
611
+ * item when no row exists instead of returning 404.
612
+ *
613
+ * Retries 5xx because PATCH with the same body produces the same
614
+ * server state.
615
+ *
616
+ * @param parameters - Universe, sorted-map, and item identifiers,
617
+ * plus any subset of `value`, `ttl`, `sortKey`, and
618
+ * `allowMissing`.
619
+ * @param options - Optional per-request overrides.
620
+ * @returns A {@link Result} wrapping the parsed {@link SortedMapItem}
621
+ * or the {@link OpenCloudError} that caused the request to fail.
622
+ */
623
+ update(parameters: UpdateSortedMapItemParameters, options?: RequestOptions): Promise<Result<SortedMapItem, OpenCloudError>>;
624
+ }
625
+ //#endregion
626
+ //#region src/resources/storage/client.d.ts
627
+ /**
628
+ * Public client for the Roblox Open Cloud `Data and memory stores`
629
+ * Feature. Today it covers memory-store queues via the
630
+ * {@link StorageClient.queues} Operation Group and memory-store sorted
631
+ * maps via the {@link StorageClient.sortedMaps} Operation Group; a
632
+ * future data-stores Operation Group slots in as a sibling on the same
633
+ * client.
634
+ *
635
+ * Every method returns a `Result` so callers handle failure
636
+ * explicitly; no thrown error ever escapes the client.
637
+ *
638
+ * @example
639
+ *
640
+ * ```ts
641
+ * import { StorageClient } from "@bedrock-rbx/ocale/storage";
642
+ *
643
+ * const client = new StorageClient({ apiKey: "your-key" });
644
+ * expect(client).toBeInstanceOf(StorageClient);
645
+ * ```
646
+ */
647
+ declare class StorageClient {
648
+ /** Memory-store queue Operation Group. */
649
+ readonly queues: MemoryStoreQueuesGroup;
650
+ /** Memory-store sorted-map Operation Group. */
651
+ readonly sortedMaps: MemoryStoreSortedMapsGroup;
652
+ /**
653
+ * Creates a new {@link StorageClient}. Configuration is frozen on
654
+ * construction; per-request overrides are accepted on each method.
655
+ *
656
+ * @param options - Client-level configuration including the API key.
657
+ */
658
+ constructor(options: OpenCloudClientOptions);
659
+ }
660
+ //#endregion
661
+ export { type CreateSortedMapItemParameters, type DeleteSortedMapItemParameters, type DequeueQueueItemsParameters, type DequeueResult, type DiscardQueueItemsParameters, type EnqueueQueueItemParameters, type GetSortedMapItemParameters, type ListSortedMapItemsParameters, type ListSortedMapItemsResult, type QueueItem, type SortKey, type SortedMapItem, StorageClient, type UpdateSortedMapItemParameters };
662
+ //# sourceMappingURL=storage.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.mts","names":[],"sources":["../src/domains/cloud-v2/memory-store-queues/types.ts","../src/domains/cloud-v2/memory-store-sorted-maps/types.ts","../src/internal/http/rate-limit-queue.ts","../src/internal/http/retry.ts","../src/internal/resource-client.ts","../src/resources/storage/queues-group.ts","../src/resources/storage/sorted-maps-group.ts","../src/resources/storage/client.ts"],"mappings":";;;;;;AAIA;UAAiB,0BAAA;;;;;;;WAOP,IAAA,EAAM,OAAA,CAAQ,SAAA;;;;;AAwBxB;WAlBU,QAAA;;WAEA,OAAA;;;;;;WAMA,GAAA;;WAEA,UAAA;AAAA;;;;;;UAQO,SAAA;EAsBjB;EAAA,SApBU,EAAA;;;;;WAKA,IAAA,EAAM,OAAA,CAAQ,SAAA;;WAEd,SAAA,EAAW,IAAA;;WAEX,QAAA;EAyCV;EAAA,SAvCU,OAAA;;WAEA,UAAA;AAAA;;;;;UAOO,2BAAA;EA+CjB;;;;;EAAA,SAzCU,YAAA;;;;;WAKA,KAAA;;AC9DV;;;;WDoEU,kBAAA;;WAEA,OAAA;;WAEA,UAAA;AAAA;AC/DV;;;;;;AAAA,UDwEiB,aAAA;;WAEP,KAAA,EAAO,aAAA,CAAc,SAAA;;;;;WAKrB,MAAA;AAAA;;;;;;;;UAUO,2BAAA;;WAEP,OAAA;EClCA;EAAA,SDoCA,MAAA;EC7BO;EAAA,SD+BP,UAAA;AAAA;;;;;;AA1GV;;;KCEY,OAAA;EAAA,SACE,IAAA;EAAA,SAA0B,KAAA;AAAA;EAAA,SAC1B,IAAA;EAAA,SAAyB,KAAA;AAAA;;;;AD2BvC;;UCpBiB,6BAAA;;;;;WAKP,MAAA;;WAEA,KAAA;;WAEA,OAAA,GAAU,OAAA;;;;;;WAMV,GAAA;EDoBA;EAAA,SClBA,UAAA;EDyBO;;;;EAAA,SCpBP,KAAA,EAAO,SAAA;AAAA;;;;;ADkDjB;;;UCxCiB,4BAAA;;;;;;WAMP,MAAA;EDmDV;EAAA,SCjDU,KAAA;;;;;WAKA,WAAA;;;;;WAKA,OAAA;EA3DV;;;;EAAA,SAgEU,SAAA;;WAEA,UAAA;AAAA;;;AAzDV;;UAgEiB,aAAA;E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