@bedrock-rbx/ocale 0.4.0 → 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 (90) hide show
  1. package/README.md +1 -0
  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 +136 -17
  9. package/dist/badges.d.mts.map +1 -1
  10. package/dist/badges.mjs +375 -99
  11. package/dist/badges.mjs.map +1 -1
  12. package/dist/{capacity-admission-hycCFkTo.d.mts → capacity-admission-Ce2V9QNb.d.mts} +2 -10
  13. package/dist/capacity-admission-Ce2V9QNb.d.mts.map +1 -0
  14. package/dist/{data.generated-D_vpa5-g.d.mts → data.generated-B4Fztv_7.d.mts} +1 -3
  15. package/dist/{data.generated-D_vpa5-g.d.mts.map → data.generated-B4Fztv_7.d.mts.map} +1 -1
  16. package/dist/developer-products.d.mts +29 -11
  17. package/dist/developer-products.d.mts.map +1 -1
  18. package/dist/developer-products.mjs +104 -18
  19. package/dist/developer-products.mjs.map +1 -1
  20. package/dist/game-passes.d.mts +2 -10
  21. package/dist/game-passes.d.mts.map +1 -1
  22. package/dist/game-passes.mjs +12 -18
  23. package/dist/game-passes.mjs.map +1 -1
  24. package/dist/index.d.mts +58 -39
  25. package/dist/index.d.mts.map +1 -1
  26. package/dist/index.mjs +9 -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 +1 -3
  31. package/dist/locales.d.mts.map +1 -1
  32. package/dist/locales.mjs +2 -4
  33. package/dist/locales.mjs.map +1 -1
  34. package/dist/luau-execution.d.mts +2 -8
  35. package/dist/luau-execution.d.mts.map +1 -1
  36. package/dist/luau-execution.mjs +7 -11
  37. package/dist/luau-execution.mjs.map +1 -1
  38. package/dist/{network-error-iVSng5MT.mjs → network-error-P4An7nUB.mjs} +5 -9
  39. package/dist/{network-error-iVSng5MT.mjs.map → network-error-P4An7nUB.mjs.map} +1 -1
  40. package/dist/places.d.mts +57 -9
  41. package/dist/places.d.mts.map +1 -1
  42. package/dist/places.mjs +127 -21
  43. package/dist/places.mjs.map +1 -1
  44. package/dist/{poll-timeout-DzztDymd.mjs → poll-timeout-BCxgN97O.mjs} +4 -6
  45. package/dist/{poll-timeout-DzztDymd.mjs.map → poll-timeout-BCxgN97O.mjs.map} +1 -1
  46. package/dist/{polling-helpers-DfF5dspc.mjs → polling-helpers-BtEYR5dN.mjs} +19 -30
  47. package/dist/polling-helpers-BtEYR5dN.mjs.map +1 -0
  48. package/dist/{price-information-DEkEQ8Pq.mjs → price-information--d6GZAcp.mjs} +3 -4
  49. package/dist/{price-information-DEkEQ8Pq.mjs.map → price-information--d6GZAcp.mjs.map} +1 -1
  50. package/dist/{resource-client-BCKukheG.d.mts → resource-client-CF8SPsV8.d.mts} +3 -9
  51. package/dist/resource-client-CF8SPsV8.d.mts.map +1 -0
  52. package/dist/{resource-client-CaIVr-go.mjs → resource-client-Cm_bPcCs.mjs} +23 -59
  53. package/dist/resource-client-Cm_bPcCs.mjs.map +1 -0
  54. package/dist/{retry-C2oHesDx.d.mts → retry-DYxm_eBU.d.mts} +2 -6
  55. package/dist/retry-DYxm_eBU.d.mts.map +1 -0
  56. package/dist/{retry-CMRDvAR4.mjs → retry-Dv5TsY9O.mjs} +50 -52
  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 +2 -12
  61. package/dist/storage.d.mts.map +1 -1
  62. package/dist/storage.mjs +12 -20
  63. package/dist/storage.mjs.map +1 -1
  64. package/dist/testing.d.mts +2 -54
  65. package/dist/testing.d.mts.map +1 -1
  66. package/dist/testing.mjs +16 -30
  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-CdMr_J1M.d.mts → types-Z4abDJfK.d.mts} +1 -9
  71. package/dist/types-Z4abDJfK.d.mts.map +1 -0
  72. package/dist/universes.d.mts +4 -18
  73. package/dist/universes.d.mts.map +1 -1
  74. package/dist/universes.mjs +27 -47
  75. package/dist/universes.mjs.map +1 -1
  76. package/dist/{validation-964VNlbp.mjs → validation-kaTLLAD1.mjs} +3 -4
  77. package/dist/{validation-964VNlbp.mjs.map → validation-kaTLLAD1.mjs.map} +1 -1
  78. package/dist/{wire-DJqupefn.d.mts → wire-DDG87I-d.d.mts} +1 -3
  79. package/dist/wire-DDG87I-d.d.mts.map +1 -0
  80. package/package.json +8 -7
  81. package/dist/badge-cost-mismatch-DrlvhlQc.mjs +0 -47
  82. package/dist/badge-cost-mismatch-DrlvhlQc.mjs.map +0 -1
  83. package/dist/capacity-admission-hycCFkTo.d.mts.map +0 -1
  84. package/dist/polling-helpers-DfF5dspc.mjs.map +0 -1
  85. package/dist/resource-client-BCKukheG.d.mts.map +0 -1
  86. package/dist/resource-client-CaIVr-go.mjs.map +0 -1
  87. package/dist/retry-C2oHesDx.d.mts.map +0 -1
  88. package/dist/retry-CMRDvAR4.mjs.map +0 -1
  89. package/dist/types-CdMr_J1M.d.mts.map +0 -1
  90. package/dist/wire-DJqupefn.d.mts.map +0 -1
package/dist/index.d.mts CHANGED
@@ -1,6 +1,5 @@
1
- import { _ as OpenCloudErrorOptions, a as HttpClient, c as OpenCloudClientOptions, d as RequestOptions, f as ResolvedCredential, g as OpenCloudError, h as SleepFunc, i as Credential, l as OpenCloudHooks, m as Result, n as AdmissionWaitObserver, o as HttpRequest, p as Page, r as AdmissionWaitReason, s as HttpResponse, t as AdmissionWaitEvent, u as RequestConfig } from "./types-CdMr_J1M.mjs";
2
- import { a as TRANSIENT_TRANSPORT_CODES, c as RateLimitSource, o as RateLimitError, r as RESPONSE_UNPARSEABLE, s as RateLimitErrorOptions, t as GATEWAY_REJECTED } from "./retry-C2oHesDx.mjs";
3
- //#region src/client/fetch-http-client.d.ts
1
+ import { _ as OpenCloudErrorOptions, a as HttpClient, c as OpenCloudClientOptions, d as RequestOptions, f as ResolvedCredential, g as OpenCloudError, h as SleepFunc, i as Credential, l as OpenCloudHooks, m as Result, n as AdmissionWaitObserver, o as HttpRequest, p as Page, r as AdmissionWaitReason, s as HttpResponse, t as AdmissionWaitEvent, u as RequestConfig } from "./types-Z4abDJfK.mjs";
2
+ import { a as TRANSIENT_TRANSPORT_CODES, c as RateLimitSource, o as RateLimitError, r as RESPONSE_UNPARSEABLE, s as RateLimitErrorOptions, t as GATEWAY_REJECTED } from "./retry-DYxm_eBU.mjs";
4
3
  /**
5
4
  * Creates the fetch-backed HTTP transport Ocale uses by default.
6
5
  *
@@ -73,8 +72,6 @@ import { a as TRANSIENT_TRANSPORT_CODES, c as RateLimitSource, o as RateLimitErr
73
72
  export declare function createFetchHttpClient(options?: {
74
73
  readonly fetch?: (input: string, init: RequestInit) => Promise<Response>;
75
74
  }): HttpClient;
76
- //#endregion
77
- //#region src/client/oauth-token-refresher.d.ts
78
75
  /**
79
76
  * Options for {@link createOAuthTokenRefresher}.
80
77
  *
@@ -160,8 +157,6 @@ type AccessTokenProvider = Extract<Credential, {
160
157
  * ```
161
158
  */
162
159
  export declare function createOAuthTokenRefresher(options: OAuthTokenRefresherOptions): (...args: Parameters<AccessTokenProvider>) => Promise<string>;
163
- //#endregion
164
- //#region src/errors/api-error.d.ts
165
160
  /**
166
161
  * Options for constructing an {@link ApiError}.
167
162
  *
@@ -297,8 +292,6 @@ export declare class ApiError extends OpenCloudError {
297
292
  * ```
298
293
  */
299
294
  export declare function requestContextOf(err: ApiError): ApiRequestContext;
300
- //#endregion
301
- //#region src/errors/badge-cost-mismatch.d.ts
302
295
  /**
303
296
  * Options for constructing a {@link BadgeCostMismatchError}.
304
297
  *
@@ -347,8 +340,61 @@ export declare class BadgeCostMismatchError extends OpenCloudError {
347
340
  */
348
341
  constructor(message: string, options: BadgeCostMismatchErrorOptions);
349
342
  }
350
- //#endregion
351
- //#region src/errors/credential-error.d.ts
343
+ /**
344
+ * Options for constructing a {@link BadgeGroupSpendPermissionError}.
345
+ *
346
+ * @since 0.5.0
347
+ */
348
+ interface BadgeGroupSpendPermissionErrorOptions extends OpenCloudErrorOptions {
349
+ /** HTTP status code of the refusal. */
350
+ readonly statusCode: number;
351
+ }
352
+ /**
353
+ * Returned when Roblox refuses a badge create paid from group funds because
354
+ * the API key owner may not spend that group's funds (body error code `28`).
355
+ * The fix is a group role with permission to spend group funds. The upstream
356
+ * `ApiError` is the `cause`.
357
+ *
358
+ * @since 0.5.0
359
+ */
360
+ export declare class BadgeGroupSpendPermissionError extends OpenCloudError {
361
+ override readonly name: string;
362
+ readonly statusCode: number;
363
+ /**
364
+ * Creates a new BadgeGroupSpendPermissionError.
365
+ *
366
+ * @param message - Human-readable error description.
367
+ * @param options - Error options including the HTTP status of the refusal.
368
+ */
369
+ constructor(message: string, options: BadgeGroupSpendPermissionErrorOptions);
370
+ }
371
+ /**
372
+ * Options for constructing a {@link BadgeInsufficientFundsError}.
373
+ *
374
+ * @since 0.5.0
375
+ */
376
+ interface BadgeInsufficientFundsErrorOptions extends OpenCloudErrorOptions {
377
+ /** HTTP status code of the refusal. */
378
+ readonly statusCode: number;
379
+ }
380
+ /**
381
+ * Returned when Roblox refuses a badge create because the payer does not have
382
+ * enough Robux to pay for it (body error code `17`). The upstream `ApiError`
383
+ * is the `cause`.
384
+ *
385
+ * @since 0.5.0
386
+ */
387
+ export declare class BadgeInsufficientFundsError extends OpenCloudError {
388
+ override readonly name: string;
389
+ readonly statusCode: number;
390
+ /**
391
+ * Creates a new BadgeInsufficientFundsError.
392
+ *
393
+ * @param message - Human-readable error description.
394
+ * @param options - Error options including the HTTP status of the refusal.
395
+ */
396
+ constructor(message: string, options: BadgeInsufficientFundsErrorOptions);
397
+ }
352
398
  /**
353
399
  * Options for constructing a {@link CredentialError}.
354
400
  *
@@ -379,8 +425,6 @@ type CredentialErrorOptions = OpenCloudErrorOptions;
379
425
  export declare class CredentialError extends OpenCloudError {
380
426
  override readonly name: string;
381
427
  }
382
- //#endregion
383
- //#region src/errors/credential-not-supported.d.ts
384
428
  /**
385
429
  * Options for constructing a {@link CredentialNotSupportedError}.
386
430
  *
@@ -422,8 +466,6 @@ export declare class CredentialNotSupportedError extends OpenCloudError {
422
466
  */
423
467
  constructor(message: string, options: CredentialNotSupportedErrorOptions);
424
468
  }
425
- //#endregion
426
- //#region src/errors/credential-rejected.d.ts
427
469
  /**
428
470
  * Options for constructing a {@link CredentialRejectedError}.
429
471
  *
@@ -471,8 +513,6 @@ export declare class CredentialRejectedError extends OpenCloudError {
471
513
  */
472
514
  constructor(message: string, options: CredentialRejectedErrorOptions);
473
515
  }
474
- //#endregion
475
- //#region src/errors/network-error.d.ts
476
516
  /**
477
517
  * Options for constructing a {@link NetworkError}.
478
518
  *
@@ -506,8 +546,6 @@ export declare class NetworkError extends OpenCloudError {
506
546
  */
507
547
  constructor(message: string, options?: NetworkErrorOptions);
508
548
  }
509
- //#endregion
510
- //#region src/errors/permission-error.d.ts
511
549
  /**
512
550
  * Options for constructing a {@link PermissionError}.
513
551
  *
@@ -569,8 +607,6 @@ export declare class PermissionError extends ApiError {
569
607
  */
570
608
  constructor(message: string, options: PermissionErrorOptions);
571
609
  }
572
- //#endregion
573
- //#region src/errors/poll-aborted.d.ts
574
610
  /**
575
611
  * Options for constructing a {@link PollAbortedError}.
576
612
  *
@@ -612,8 +648,6 @@ export declare class PollAbortedError extends OpenCloudError {
612
648
  */
613
649
  constructor(message: string, options?: PollAbortedErrorOptions);
614
650
  }
615
- //#endregion
616
- //#region src/errors/poll-timeout.d.ts
617
651
  /**
618
652
  * Options for {@link PollTimeoutError}. The `T` type parameter captures the
619
653
  * resource-specific task variant the caller polled for; defaults to `unknown`
@@ -666,8 +700,6 @@ export declare class PollTimeoutError<T = unknown> extends OpenCloudError {
666
700
  */
667
701
  constructor(message: string, options: PollTimeoutErrorOptions<T>);
668
702
  }
669
- //#endregion
670
- //#region src/errors/rate-limit-wait-refused.d.ts
671
703
  /**
672
704
  * Options for constructing a {@link RateLimitWaitRefusedError}.
673
705
  *
@@ -720,8 +752,6 @@ export declare class RateLimitWaitRefusedError extends OpenCloudError {
720
752
  */
721
753
  constructor(message: string, { cause }: RateLimitWaitRefusedErrorOptions);
722
754
  }
723
- //#endregion
724
- //#region src/errors/request-aborted.d.ts
725
755
  /**
726
756
  * Options for constructing a {@link RequestAbortedError}.
727
757
  *
@@ -762,8 +792,6 @@ export declare class RequestAbortedError extends OpenCloudError {
762
792
  */
763
793
  constructor(message: string, options?: RequestAbortedErrorOptions);
764
794
  }
765
- //#endregion
766
- //#region src/errors/request-deadline-exceeded.d.ts
767
795
  /**
768
796
  * Options for constructing a {@link RequestDeadlineExceededError}.
769
797
  *
@@ -820,8 +848,6 @@ export declare class RequestDeadlineExceededError extends OpenCloudError {
820
848
  */
821
849
  constructor(message: string, options: RequestDeadlineExceededErrorOptions);
822
850
  }
823
- //#endregion
824
- //#region src/errors/retry-delay-exceeded.d.ts
825
851
  /**
826
852
  * Options for constructing a {@link RetryDelayExceededError}.
827
853
  *
@@ -871,8 +897,6 @@ export declare class RetryDelayExceededError extends RequestDeadlineExceededErro
871
897
  */
872
898
  constructor(message: string, options: RetryDelayExceededErrorOptions);
873
899
  }
874
- //#endregion
875
- //#region src/errors/token-refresh-error.d.ts
876
900
  /**
877
901
  * Options for constructing a {@link TokenRefreshError}.
878
902
  *
@@ -917,8 +941,6 @@ export declare class TokenRefreshError extends OpenCloudError {
917
941
  */
918
942
  constructor(message: string, options: TokenRefreshErrorOptions);
919
943
  }
920
- //#endregion
921
- //#region src/errors/unexpected-response.d.ts
922
944
  /**
923
945
  * Options for constructing an {@link UnexpectedResponseError}.
924
946
  *
@@ -992,8 +1014,6 @@ export declare class UnexpectedResponseError extends OpenCloudError {
992
1014
  */
993
1015
  constructor(message: string, options: UnexpectedResponseErrorOptions);
994
1016
  }
995
- //#endregion
996
- //#region src/errors/validation.d.ts
997
1017
  /**
998
1018
  * Closed discriminator for a {@link ValidationError}. Consumers can
999
1019
  * exhaustively `switch` over this union so TypeScript will refuse to compile
@@ -1042,6 +1062,5 @@ export declare class ValidationError extends OpenCloudError {
1042
1062
  */
1043
1063
  constructor(message: string, options: ValidationErrorOptions);
1044
1064
  }
1045
- //#endregion
1046
- export { type AdmissionWaitEvent, type AdmissionWaitObserver, type AdmissionWaitReason, type ApiErrorOptions, type ApiRequestContext, type BadgeCostMismatchErrorOptions, type Credential, type CredentialErrorOptions, type CredentialNotSupportedErrorOptions, type CredentialRejectedErrorOptions, GATEWAY_REJECTED, type HttpClient, type HttpRequest, type HttpResponse, type NetworkErrorOptions, type OAuthTokenRefresherOptions, type OpenCloudClientOptions, OpenCloudError, type OpenCloudErrorOptions, type OpenCloudHooks, type Page, type PermissionErrorOptions, type PollAbortedErrorOptions, type PollTimeoutErrorOptions, RESPONSE_UNPARSEABLE, RateLimitError, type RateLimitErrorOptions, type RateLimitSource, type RateLimitWaitRefusedErrorOptions, type RequestAbortedErrorOptions, type RequestConfig, type RequestDeadlineExceededErrorOptions, type RequestOptions, type ResolvedCredential, type Result, type RetryDelayExceededErrorOptions, type SleepFunc, TRANSIENT_TRANSPORT_CODES, type TokenRefreshErrorOptions, type UnexpectedResponseErrorOptions, type ValidationErrorCode, type ValidationErrorOptions };
1065
+ export { type AdmissionWaitEvent, type AdmissionWaitObserver, type AdmissionWaitReason, type ApiErrorOptions, type ApiRequestContext, type BadgeCostMismatchErrorOptions, type BadgeGroupSpendPermissionErrorOptions, type BadgeInsufficientFundsErrorOptions, type Credential, type CredentialErrorOptions, type CredentialNotSupportedErrorOptions, type CredentialRejectedErrorOptions, GATEWAY_REJECTED, type HttpClient, type HttpRequest, type HttpResponse, type NetworkErrorOptions, type OAuthTokenRefresherOptions, type OpenCloudClientOptions, OpenCloudError, type OpenCloudErrorOptions, type OpenCloudHooks, type Page, type PermissionErrorOptions, type PollAbortedErrorOptions, type PollTimeoutErrorOptions, RESPONSE_UNPARSEABLE, RateLimitError, type RateLimitErrorOptions, type RateLimitSource, type RateLimitWaitRefusedErrorOptions, type RequestAbortedErrorOptions, type RequestConfig, type RequestDeadlineExceededErrorOptions, type RequestOptions, type ResolvedCredential, type Result, type RetryDelayExceededErrorOptions, type SleepFunc, TRANSIENT_TRANSPORT_CODES, type TokenRefreshErrorOptions, type UnexpectedResponseErrorOptions, type ValidationErrorCode, type ValidationErrorOptions };
1047
1066
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/client/fetch-http-client.ts","../src/client/oauth-token-refresher.ts","../src/errors/api-error.ts","../src/errors/badge-cost-mismatch.ts","../src/errors/credential-error.ts","../src/errors/credential-not-supported.ts","../src/errors/credential-rejected.ts","../src/errors/network-error.ts","../src/errors/permission-error.ts","../src/errors/poll-aborted.ts","../src/errors/poll-timeout.ts","../src/errors/rate-limit-wait-refused.ts","../src/errors/request-aborted.ts","../src/errors/request-deadline-exceeded.ts","../src/errors/retry-delay-exceeded.ts","../src/errors/token-refresh-error.ts","../src/errors/unexpected-response.ts","../src/errors/validation.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwEgB,sBAAsB;WAC5B,SAAS,eAAe,MAAM,gBAAgB,QAAQ;IAC5D;;;;;;;;UC5Da;;WAEP;;;;;WAKA;;;;;WAKA,SAAS,eAA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rCtB,uCAAuC;;EAEvD,UAAU;;EAEV;;;;;EAKA;;;;;EAKA,kBAAkB,SAAS;;EAE3B;;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAgCY,gCAAgC;WAC5B,SAAS;WACT;oBACS;;WAET;WACA,iBAAiB,SAAS;WAC1B;WACA;;;;;;;;;EAUhB,YAAY,iBAAiB,SAAS;;;;;;;;;;;KCpE3B;;;;;;UAeK,+BAA+B;;EAE/C,MAAM;;;;;;;;;;;;;;;;;;;;;;qBAuBM,wBAAwB;oBACX,MAAM;oBACN;;;;;;;EAQzB,YAAY,iBAAiB,SAAS"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/client/fetch-http-client.ts","../src/client/oauth-token-refresher.ts","../src/errors/api-error.ts","../src/errors/badge-cost-mismatch.ts","../src/errors/badge-group-spend-permission.ts","../src/errors/badge-insufficient-funds.ts","../src/errors/credential-error.ts","../src/errors/credential-not-supported.ts","../src/errors/credential-rejected.ts","../src/errors/network-error.ts","../src/errors/permission-error.ts","../src/errors/poll-aborted.ts","../src/errors/poll-timeout.ts","../src/errors/rate-limit-wait-refused.ts","../src/errors/request-aborted.ts","../src/errors/request-deadline-exceeded.ts","../src/errors/retry-delay-exceeded.ts","../src/errors/token-refresh-error.ts","../src/errors/unexpected-response.ts","../src/errors/validation.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwEgB,sBAAsB;WAC5B,SAAS,eAAe,MAAM,gBAAgB,QAAQ;IAC5D;;;;;;UC5Da;;WAEP;;;;;WAKA;;;;;WAKA,SAAS,eAAe,MAAM,gBAAgB,QAAQ;;;;;;WAMtD,WAAW,yBAAyB;;WAEpC;;;KAcL,sBAAsB,QAAQ;EAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAmPjC,0BACf,SAAS,iCACH,MAAM,WA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EvD,UAAU;;EAEV;;;;;EAKA;;;;;EAKA,kBAAkB,SAAS;;EAE3B;;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAgCY,gCAAgC;WAC5B,SAAS;WACT;oBACS;;WAET;WACA,iBAAiB,SAAS;WAC1B;WACA;;;;;;;;;EAUhB,YAAY,iBAAiB,SAAS;;;;;;;;;KCpE3B;;;;;;UAeK,+BAA+B;;EAE/C,MAAM;;;;;;;;;;;;;;;;;;;;;;qBAuBM,wBAAwB;oBACX,MAAM;oBACN;;;;;;;EAQzB,YAAY,iBAAiB,SAAS"}
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { a as ApiError, n as RateLimitError, o as requestContextOf, s as OpenCloudError, t as NetworkError } from "./network-error-iVSng5MT.mjs";
2
- import { D as RequestAbortedError, S as createFetchHttpClient$1, _ as RateLimitWaitRefusedError, a as TRANSIENT_TRANSPORT_CODES, b as CredentialNotSupportedError, g as RequestDeadlineExceededError, h as RetryDelayExceededError, i as RESPONSE_UNPARSEABLE, m as UnexpectedResponseError, n as GATEWAY_REJECTED, v as PermissionError, x as CredentialError, y as CredentialRejectedError } from "./retry-CMRDvAR4.mjs";
3
- import { t as BadgeCostMismatchError } from "./badge-cost-mismatch-DrlvhlQc.mjs";
4
- import { n as PollAbortedError, t as PollTimeoutError } from "./poll-timeout-DzztDymd.mjs";
5
- import { t as ValidationError } from "./validation-964VNlbp.mjs";
6
- //#region src/client/fetch-http-client.ts
1
+ import { O as RequestAbortedError, S as createFetchHttpClient$1, _ as RateLimitWaitRefusedError, a as TRANSIENT_TRANSPORT_CODES, b as CredentialNotSupportedError, g as RequestDeadlineExceededError, h as RetryDelayExceededError, i as RESPONSE_UNPARSEABLE, m as UnexpectedResponseError, n as GATEWAY_REJECTED, v as PermissionError, x as CredentialError, y as CredentialRejectedError } from "./retry-Dv5TsY9O.mjs";
2
+ import { a as ApiError, n as RateLimitError, o as requestContextOf, s as OpenCloudError, t as NetworkError } from "./network-error-P4An7nUB.mjs";
3
+ import { n as BadgeGroupSpendPermissionError, r as BadgeCostMismatchError, t as BadgeInsufficientFundsError } from "./badge-insufficient-funds-BLFvQZt1.mjs";
4
+ import { n as PollAbortedError, t as PollTimeoutError } from "./poll-timeout-BCxgN97O.mjs";
5
+ import { t as ValidationError } from "./validation-kaTLLAD1.mjs";
6
+ // src/client/fetch-http-client.ts
7
7
  /**
8
8
  * Creates the fetch-backed HTTP transport Ocale uses by default.
9
9
  *
@@ -76,8 +76,7 @@ import { t as ValidationError } from "./validation-964VNlbp.mjs";
76
76
  function createFetchHttpClient(options) {
77
77
  return createFetchHttpClient$1(options?.fetch);
78
78
  }
79
- //#endregion
80
- //#region src/errors/token-refresh-error.ts
79
+ // src/errors/token-refresh-error.ts
81
80
  /**
82
81
  * Thrown by the `getAccessToken` that `createOAuthTokenRefresher` returns
83
82
  * when the Roblox token endpoint refuses a refresh. `code` is the OAuth
@@ -116,8 +115,7 @@ var TokenRefreshError = class extends OpenCloudError {
116
115
  this.statusCode = options.statusCode;
117
116
  }
118
117
  };
119
- //#endregion
120
- //#region src/client/oauth-token-refresher.ts
118
+ // src/client/oauth-token-refresher.ts
121
119
  const TOKEN_URL = "https://apis.roblox.com/oauth/v1/token";
122
120
  const REFRESH_BELOW_MS = 12e4;
123
121
  const FALLBACK_MIN_MS = 6e4;
@@ -379,7 +377,6 @@ async function waitAsync(promise, signal) {
379
377
  });
380
378
  });
381
379
  }
382
- //#endregion
383
- export { ApiError, BadgeCostMismatchError, CredentialError, CredentialNotSupportedError, CredentialRejectedError, GATEWAY_REJECTED, NetworkError, OpenCloudError, PermissionError, PollAbortedError, PollTimeoutError, RESPONSE_UNPARSEABLE, RateLimitError, RateLimitWaitRefusedError, RequestAbortedError, RequestDeadlineExceededError, RetryDelayExceededError, TRANSIENT_TRANSPORT_CODES, TokenRefreshError, UnexpectedResponseError, ValidationError, createFetchHttpClient, createOAuthTokenRefresher, requestContextOf };
380
+ export { ApiError, BadgeCostMismatchError, BadgeGroupSpendPermissionError, BadgeInsufficientFundsError, CredentialError, CredentialNotSupportedError, CredentialRejectedError, GATEWAY_REJECTED, NetworkError, OpenCloudError, PermissionError, PollAbortedError, PollTimeoutError, RESPONSE_UNPARSEABLE, RateLimitError, RateLimitWaitRefusedError, RequestAbortedError, RequestDeadlineExceededError, RetryDelayExceededError, TRANSIENT_TRANSPORT_CODES, TokenRefreshError, UnexpectedResponseError, ValidationError, createFetchHttpClient, createOAuthTokenRefresher, requestContextOf };
384
381
 
385
382
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["createInternalFetchHttpClient"],"sources":["../src/client/fetch-http-client.ts","../src/errors/token-refresh-error.ts","../src/client/oauth-token-refresher.ts"],"sourcesContent":["import { createFetchHttpClient as createInternalFetchHttpClient } from \"../internal/http/fetch-client.ts\";\nimport type { HttpClient } from \"./types.ts\";\n\n/**\n * Creates the fetch-backed HTTP transport Ocale uses by default.\n *\n * Wrap the returned transport to add tracing, metrics, recording, or other\n * request-level behavior while retaining Ocale's authentication, timeout,\n * upload, response-parsing, and error-classification semantics.\n *\n * Pass `fetch` to send through a wrapped or replacement `fetch`. Omit it to\n * use the global `fetch`.\n *\n * @param options - Optional transport settings.\n * @param options.fetch - The `fetch` to send requests through.\n * @returns Ocale's default fetch-backed HTTP transport.\n * @since 0.3.1\n *\n * @example\n *\n * ```ts\n * import {\n * createFetchHttpClient,\n * type HttpClient,\n * type HttpRequest,\n * } from \"@bedrock-rbx/ocale\";\n * import {\n * type DeleteExperienceIconParameters,\n * UniversesClient,\n * } from \"@bedrock-rbx/ocale/universes\";\n *\n * // An injected response keeps this executable example offline.\n * // Omit fetch in production to use the runtime's global fetch.\n * const defaultHttpClient = createFetchHttpClient({\n * fetch: async () => new Response(),\n * });\n * let observedRequests: ReadonlyArray<HttpRequest> = [];\n * const tracedHttpClient: HttpClient = {\n * async request(request, config) {\n * observedRequests = [...observedRequests, request];\n * return defaultHttpClient.request(request, config);\n * },\n * };\n * const commonOptions = {\n * credential: { apiKey: \"your-key\", kind: \"apiKey\" as const },\n * };\n * const client = new UniversesClient({\n * ...commonOptions,\n * httpClient: tracedHttpClient,\n * });\n * const undecoratedClient = new UniversesClient({\n * ...commonOptions,\n * httpClient: defaultHttpClient,\n * });\n * const parameters: DeleteExperienceIconParameters = {\n * languageCode: \"en\",\n * universeId: \"42\",\n * };\n * expect(client).toBeInstanceOf(UniversesClient);\n * return Promise.all([\n * client.icon.delete(parameters),\n * undecoratedClient.icon.delete(parameters),\n * ]).then(([result, undecoratedResult]) => {\n * expect(observedRequests).toStrictEqual([{\n * method: \"DELETE\",\n * url: \"/legacy-game-internationalization/v1/game-icon/games/42/language-codes/en\",\n * }]);\n * expect(result).toStrictEqual({ data: undefined, success: true });\n * expect(result).toStrictEqual(undecoratedResult);\n * });\n * ```\n */\nexport function createFetchHttpClient(options?: {\n\treadonly fetch?: (input: string, init: RequestInit) => Promise<Response>;\n}): HttpClient {\n\treturn createInternalFetchHttpClient(options?.fetch);\n}\n","import { OpenCloudError, type OpenCloudErrorOptions } from \"./base.ts\";\n\n/**\n * Options for constructing a {@link TokenRefreshError}.\n *\n * @since 0.4.0\n */\nexport interface TokenRefreshErrorOptions extends OpenCloudErrorOptions {\n\t/** HTTP status of the token endpoint's response. */\n\treadonly statusCode: number;\n}\n\n/**\n * Thrown by the `getAccessToken` that `createOAuthTokenRefresher` returns\n * when the Roblox token endpoint refuses a refresh. `code` is the OAuth\n * `error` field of the response body (for example `invalid_grant`), or\n * `undefined` when the body has none. A client that calls the provider\n * returns it as the `cause` of a `CredentialError`.\n *\n * @since 0.4.0\n *\n * @example\n *\n * ```ts\n * import { TokenRefreshError } from \"@bedrock-rbx/ocale\";\n *\n * const error = new TokenRefreshError(\"Token refresh refused\", {\n * code: \"invalid_grant\",\n * statusCode: 400,\n * });\n *\n * expect(error.code).toBe(\"invalid_grant\");\n * expect(error.statusCode).toBe(400);\n * ```\n */\nexport class TokenRefreshError extends OpenCloudError {\n\tpublic override readonly name: string = \"TokenRefreshError\";\n\t/** HTTP status of the token endpoint's response. */\n\tpublic readonly statusCode: number;\n\n\t/**\n\t * Creates a new TokenRefreshError.\n\t *\n\t * @param message - Human-readable error description.\n\t * @param options - The OAuth error code and the HTTP status.\n\t */\n\tconstructor(message: string, options: TokenRefreshErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.statusCode = options.statusCode;\n\t}\n}\n","import { RequestAbortedError } from \"../errors/request-aborted.ts\";\nimport { TokenRefreshError } from \"../errors/token-refresh-error.ts\";\nimport type { Credential } from \"./types.ts\";\n\nconst TOKEN_URL = \"https://apis.roblox.com/oauth/v1/token\";\nconst REFRESH_BELOW_MS = 120_000;\nconst FALLBACK_MIN_MS = 60_000;\nconst EXCHANGE_TIMEOUT_MS = 30_000;\n\n/**\n * Options for {@link createOAuthTokenRefresher}.\n *\n * @since 0.4.0\n */\nexport interface OAuthTokenRefresherOptions {\n\t/** The OAuth app's client id. */\n\treadonly clientId: string;\n\t/**\n\t * The client secret of a confidential app. Omit it for a public app that\n\t * uses a code verifier.\n\t */\n\treadonly clientSecret?: string;\n\t/**\n\t * The `fetch` to send token requests through. Defaults to the global\n\t * `fetch`.\n\t */\n\treadonly fetch?: (input: string, init: RequestInit) => Promise<Response>;\n\t/**\n\t * Saves the new refresh token after each rotation. The new access token is\n\t * used only after it resolves. If it throws, the call throws, and the next\n\t * call retries it with the same token and does no exchange.\n\t */\n\treadonly onRotate: (refreshToken: string) => Promise<void> | void;\n\t/** The current refresh token. It is spent by the first refresh. */\n\treadonly refreshToken: string;\n}\n\ninterface TokenPair {\n\treadonly accessToken: string;\n\treadonly expiresAt: number;\n\treadonly refreshToken: string;\n}\n\ntype ExchangeOutcome =\n\t| { readonly error: unknown; readonly kind: \"transient\" }\n\t| { readonly kind: \"ok\"; readonly pair: TokenPair };\n\n/** The `getAccessToken` of an OAuth {@link Credential}. */\ntype AccessTokenProvider = Extract<Credential, { kind: \"oauth\" }>[\"getAccessToken\"];\n\ntype FetchSeam = NonNullable<OAuthTokenRefresherOptions[\"fetch\"]>;\n\nclass OAuthTokenRefresher {\n\treadonly #clientId: string;\n\treadonly #clientSecret: string | undefined;\n\treadonly #onRotate: OAuthTokenRefresherOptions[\"onRotate\"];\n\treadonly #send: FetchSeam;\n\n\t#current: TokenPair | undefined;\n\t#failure: TokenRefreshError | undefined;\n\t#inFlight: Promise<string> | undefined;\n\t#pending: TokenPair | undefined;\n\t#refreshToken: string;\n\n\tconstructor(options: OAuthTokenRefresherOptions) {\n\t\tthis.#clientId = options.clientId;\n\t\tthis.#clientSecret = options.clientSecret;\n\t\tthis.#onRotate = options.onRotate;\n\t\tthis.#refreshToken = options.refreshToken;\n\t\tthis.#send = options.fetch ?? fetch;\n\t}\n\n\tpublic async getAccessTokenAsync(signal: AbortSignal): Promise<string> {\n\t\tif (signal.aborted) {\n\t\t\tthrow abortedWait(signal);\n\t\t}\n\n\t\tif (this.#failure !== undefined) {\n\t\t\tthrow this.#failure;\n\t\t}\n\n\t\t// A kept unsaved pair only exists after a refresh, which runs below\n\t\t// the threshold, so the current token never short-circuits its save.\n\t\tconst cached = this.#tokenLasting(REFRESH_BELOW_MS);\n\t\tif (cached !== undefined) {\n\t\t\treturn cached;\n\t\t}\n\n\t\tthis.#inFlight ??= this.#refreshAsync().finally(() => {\n\t\t\tthis.#inFlight = undefined;\n\t\t});\n\t\treturn waitAsync(this.#inFlight, signal);\n\t}\n\n\t/**\n\t * Runs one exchange under its own time limit, apart from any caller's\n\t * signal. A timeout is transient, like a network error.\n\t *\n\t * @returns The exchange outcome.\n\t */\n\tasync #exchangeAsync(): Promise<ExchangeOutcome> {\n\t\tconst controller = new AbortController();\n\t\tconst exchange = this.#sendAsync(controller.signal);\n\n\t\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\t\tconst timeout = new Promise<ExchangeOutcome>((resolve) => {\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tconst error = new DOMException(\"OAuth token exchange timed out\", \"TimeoutError\");\n\t\t\t\tcontroller.abort(error);\n\t\t\t\tresolve({ error, kind: \"transient\" });\n\t\t\t}, EXCHANGE_TIMEOUT_MS);\n\t\t});\n\n\t\ttry {\n\t\t\treturn await Promise.race([exchange, timeout]);\n\t\t} finally {\n\t\t\tclearTimeout(timer);\n\t\t}\n\t}\n\n\t#fallback(error: unknown): string {\n\t\tconst token = this.#tokenLasting(FALLBACK_MIN_MS);\n\t\tif (token === undefined) {\n\t\t\tthrow error;\n\t\t}\n\n\t\treturn token;\n\t}\n\n\t#form(): URLSearchParams {\n\t\tconst form = new URLSearchParams({\n\t\t\tclient_id: this.#clientId,\n\t\t\tgrant_type: \"refresh_token\",\n\t\t\trefresh_token: this.#refreshToken,\n\t\t});\n\t\tif (this.#clientSecret !== undefined) {\n\t\t\tform.set(\"client_secret\", this.#clientSecret);\n\t\t}\n\n\t\treturn form;\n\t}\n\n\t/**\n\t * Refreshes and saves a pair. A save can finish late (a retried kept\n\t * pair, or a slow `onRotate`), so when the saved token has under 60 s\n\t * left it exchanges once more with the now saved refresh token.\n\t *\n\t * @returns An access token.\n\t */\n\tasync #refreshAsync(): Promise<string> {\n\t\tconst first = await this.#rotateAsync();\n\t\tif (first.kind === \"transient\") {\n\t\t\treturn this.#fallback(first.error);\n\t\t}\n\n\t\tif (first.pair.expiresAt - Date.now() >= FALLBACK_MIN_MS) {\n\t\t\treturn first.pair.accessToken;\n\t\t}\n\n\t\tconst second = await this.#rotateAsync();\n\t\treturn second.kind === \"transient\" ? this.#fallback(second.error) : second.pair.accessToken;\n\t}\n\n\t/**\n\t * Records a refusal that spent the refresh token, so it is never sent\n\t * again: an `invalid_grant`, or a 2xx whose body held no usable pair.\n\t *\n\t * @param error - The refusal.\n\t * @param accepted - Whether the endpoint answered 2xx.\n\t * @returns The refusal, to throw.\n\t */\n\t#refused(error: TokenRefreshError, accepted: boolean): TokenRefreshError {\n\t\tif (accepted || error.code === \"invalid_grant\") {\n\t\t\tthis.#failure = error;\n\t\t}\n\n\t\treturn error;\n\t}\n\n\t/**\n\t * Exchanges the refresh token unless a kept unsaved pair exists, then\n\t * saves the pair and makes it current.\n\t *\n\t * @returns The saved pair, or the transient failure of the exchange.\n\t */\n\tasync #rotateAsync(): Promise<ExchangeOutcome> {\n\t\tif (this.#pending === undefined) {\n\t\t\tconst outcome = await this.#exchangeAsync();\n\t\t\tif (outcome.kind === \"transient\") {\n\t\t\t\treturn outcome;\n\t\t\t}\n\n\t\t\tthis.#pending = outcome.pair;\n\t\t}\n\n\t\tconst pending = this.#pending;\n\t\tawait this.#onRotate(pending.refreshToken);\n\t\tthis.#current = pending;\n\t\tthis.#refreshToken = pending.refreshToken;\n\t\tthis.#pending = undefined;\n\t\treturn { kind: \"ok\", pair: pending };\n\t}\n\n\tasync #sendAsync(signal: AbortSignal): Promise<ExchangeOutcome> {\n\t\tlet response: Response;\n\t\ttry {\n\t\t\tresponse = await this.#send(TOKEN_URL, {\n\t\t\t\tbody: this.#form().toString(),\n\t\t\t\theaders: { \"content-type\": \"application/x-www-form-urlencoded\" },\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tsignal,\n\t\t\t});\n\t\t} catch (err) {\n\t\t\treturn { error: err, kind: \"transient\" };\n\t\t}\n\n\t\tconst receivedAt = Date.now();\n\t\tconst json = await readBodyAsync(response);\n\t\tif (response.status === 429 || response.status >= 500) {\n\t\t\treturn { error: refusal(json, response.status), kind: \"transient\" };\n\t\t}\n\n\t\tconst pair = response.ok ? toPair(json, receivedAt) : undefined;\n\t\tif (pair === undefined) {\n\t\t\tthrow this.#refused(refusal(json, response.status), response.ok);\n\t\t}\n\n\t\treturn { kind: \"ok\", pair };\n\t}\n\n\t#tokenLasting(minimumMs: number): string | undefined {\n\t\tconst current = this.#current;\n\t\treturn current !== undefined && current.expiresAt - Date.now() >= minimumMs\n\t\t\t? current.accessToken\n\t\t\t: undefined;\n\t}\n}\n\n/**\n * Creates a `getAccessToken` that keeps an OAuth access token fresh by\n * rotating one refresh token against the Roblox token endpoint. Use it as\n * the `getAccessToken` of an OAuth `Credential`; you write the `identity`.\n *\n * Use one refresher per refresh token, in one process. A refresh token is\n * single use, so two refreshers (or two processes) sharing one will spend it\n * twice and lose the grant. Multi-instance consumers bring their own\n * provider.\n *\n * - The first call refreshes. Later calls refresh when less than 120 s\n * remain, measured on the local clock from receipt plus `expires_in`.\n * - The new access token is used only after `onRotate` resolves. A spent\n * refresh token is never sent again. If the saved access token then has\n * less than 60 s left, it exchanges once more.\n * - A network error, 5xx or 429 returns the current token while 60 s or\n * more remain, and throws otherwise.\n * - Each exchange has its own 30 s limit, for the request and the body\n * read. A timeout is handled like a network error.\n * - Any other non-2xx, or a 2xx without a usable token pair, throws a\n * {@link TokenRefreshError}. After `invalid_grant` or such a 2xx, every\n * call throws it again and sends nothing.\n * - Concurrent calls share one exchange. A caller's `signal` stops only its\n * own wait, never the exchange.\n *\n * @param options - The client, the refresh token and the rotation callback.\n * @returns A `getAccessToken` for an OAuth `Credential`.\n * @since 0.4.0\n *\n * @example\n *\n * ```ts\n * import { createOAuthTokenRefresher, type Credential } from \"@bedrock-rbx/ocale\";\n *\n * let saved = \"refresh-0\";\n * const getAccessToken = createOAuthTokenRefresher({\n * clientId: \"client-id\",\n * fetch: async () =>\n * Response.json({ access_token: \"access-1\", expires_in: 900, refresh_token: \"refresh-1\" }),\n * onRotate: (refreshToken) => {\n * saved = refreshToken;\n * },\n * refreshToken: saved,\n * });\n * const credential: Credential = { getAccessToken, identity: \"user-1\", kind: \"oauth\" };\n *\n * expect(credential.kind).toBe(\"oauth\");\n * return getAccessToken({ signal: new AbortController().signal }).then((token) => {\n * expect(token).toBe(\"access-1\");\n * expect(saved).toBe(\"refresh-1\");\n * });\n * ```\n */\nexport function createOAuthTokenRefresher(\n\toptions: OAuthTokenRefresherOptions,\n): (...args: Parameters<AccessTokenProvider>) => Promise<string> {\n\tconst refresher = new OAuthTokenRefresher(options);\n\treturn async ({ signal }) => refresher.getAccessTokenAsync(signal);\n}\n\nasync function readBodyAsync(response: Response): Promise<JSONValue | undefined> {\n\ttry {\n\t\treturn JSON.parse(await response.text());\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nfunction isRecord(value: JSONValue | undefined): value is Readonly<Record<string, JSONValue>> {\n\treturn value instanceof Object && !Array.isArray(value);\n}\n\nfunction toPair(body: JSONValue | undefined, receivedAt: number): TokenPair | undefined {\n\tif (!isRecord(body)) {\n\t\treturn undefined;\n\t}\n\n\tconst { access_token: accessToken, expires_in: expiresIn, refresh_token: refreshToken } = body;\n\tif (\n\t\ttypeof accessToken !== \"string\" ||\n\t\taccessToken === \"\" ||\n\t\ttypeof refreshToken !== \"string\" ||\n\t\trefreshToken === \"\" ||\n\t\ttypeof expiresIn !== \"number\" ||\n\t\t!Number.isFinite(expiresIn) ||\n\t\texpiresIn <= 0\n\t) {\n\t\treturn undefined;\n\t}\n\n\treturn { accessToken, expiresAt: receivedAt + expiresIn * 1000, refreshToken };\n}\n\nfunction refusal(body: JSONValue | undefined, statusCode: number): TokenRefreshError {\n\tconst code = isRecord(body) && typeof body[\"error\"] === \"string\" ? body[\"error\"] : undefined;\n\treturn new TokenRefreshError(`OAuth token refresh failed with HTTP ${statusCode}`, {\n\t\tcode,\n\t\tstatusCode,\n\t});\n}\n\nfunction abortedWait(signal: AbortSignal): RequestAbortedError {\n\treturn new RequestAbortedError(\"Access token wait was aborted\", { reason: signal.reason });\n}\n\n/**\n * Waits for a shared promise, but lets one caller's signal end only that\n * caller's wait.\n *\n * @template T - The value type of the shared promise.\n * @param promise - The shared promise.\n * @param signal - The caller's signal.\n * @returns The value of the shared promise.\n * @rejects RequestAbortedError when the signal aborts first, or the shared\n * promise's own error.\n */\nasync function waitAsync<T>(promise: Promise<T>, signal: AbortSignal): Promise<T> {\n\treturn new Promise<T>((resolve, reject) => {\n\t\tfunction onAbort(): void {\n\t\t\treject(abortedWait(signal));\n\t\t}\n\n\t\tsignal.addEventListener(\"abort\", onAbort);\n\t\tpromise\n\t\t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AC7F,OAAO,iBAAiB,UAAU,CAAC,MAAM,QAAQ,KAAK;AACvD;AAEA,SAAS,OAAO,MAA6B,YAA2C;CACvF,IAAI,CAAC,SAAS,IAAI,GACjB;CAGD,MAAM,EAAE,cAAc,aAAa,YAAY,WAAW,eAAe,iBAAiB;CAC1F,IACC,OAAO,gBAAgB,YACvB,gBAAgB,MAChB,OAAO,iBAAiB,YACxB,iBAAiB,MACjB,OAAO,cAAc,YACrB,CAAC,OAAO,SAAS,SAAS,KAC1B,aAAa,GAEb;CAGD,OAAO;EAAE;EAAa,WAAW,aAAa,YAAY;EAAM;CAAa;AAC9E;AAEA,SAAS,QAAQ,MAA6B,YAAuC;CACpF,MAAM,OAAO,SAAS,IAAI,KAAK,OAAO,KAAK,aAAa,WAAW,KAAK,WAAW,KAAA;CACnF,OAAO,IAAI,kBAAkB,wCAAwC,cAAc;EAClF;EACA;CACD,CAAC;AACF;AAEA,SAAS,YAAY,QAA0C;CAC9D,OAAO,IAAI,oBAAoB,iCAAiC,EAAE,QAAQ,OAAO,OAAO,CAAC;AAC1F;;;;;;;;;;;;AAaA,eAAe,UAAa,SAAqB,QAAiC;CACjF,OAAO,IAAI,SAAY,SAAS,WAAW;EAC1C,SAAS,UAAgB;GACxB,OAAO,YAAY,MAAM,CAAC;EAC3B;EAEA,OAAO,iBAAiB,SAAS,OAAO;EACxC,QACE,KAAK,OAAO,CAAC,CACb,MAAM,MAAM,CAAC,CACb,cAAc;GACd,OAAO,oBAAoB,SAAS,OAAO;EAC5C,CAAC;CACH,CAAC;AACF"}
1
+ {"version":3,"file":"index.mjs","names":["createInternalFetchHttpClient"],"sources":["../src/client/fetch-http-client.ts","../src/errors/token-refresh-error.ts","../src/client/oauth-token-refresher.ts"],"sourcesContent":["import { createFetchHttpClient as createInternalFetchHttpClient } from \"../internal/http/fetch-client.ts\";\nimport type { HttpClient } from \"./types.ts\";\n\n/**\n * Creates the fetch-backed HTTP transport Ocale uses by default.\n *\n * Wrap the returned transport to add tracing, metrics, recording, or other\n * request-level behavior while retaining Ocale's authentication, timeout,\n * upload, response-parsing, and error-classification semantics.\n *\n * Pass `fetch` to send through a wrapped or replacement `fetch`. Omit it to\n * use the global `fetch`.\n *\n * @param options - Optional transport settings.\n * @param options.fetch - The `fetch` to send requests through.\n * @returns Ocale's default fetch-backed HTTP transport.\n * @since 0.3.1\n *\n * @example\n *\n * ```ts\n * import {\n * createFetchHttpClient,\n * type HttpClient,\n * type HttpRequest,\n * } from \"@bedrock-rbx/ocale\";\n * import {\n * type DeleteExperienceIconParameters,\n * UniversesClient,\n * } from \"@bedrock-rbx/ocale/universes\";\n *\n * // An injected response keeps this executable example offline.\n * // Omit fetch in production to use the runtime's global fetch.\n * const defaultHttpClient = createFetchHttpClient({\n * fetch: async () => new Response(),\n * });\n * let observedRequests: ReadonlyArray<HttpRequest> = [];\n * const tracedHttpClient: HttpClient = {\n * async request(request, config) {\n * observedRequests = [...observedRequests, request];\n * return defaultHttpClient.request(request, config);\n * },\n * };\n * const commonOptions = {\n * credential: { apiKey: \"your-key\", kind: \"apiKey\" as const },\n * };\n * const client = new UniversesClient({\n * ...commonOptions,\n * httpClient: tracedHttpClient,\n * });\n * const undecoratedClient = new UniversesClient({\n * ...commonOptions,\n * httpClient: defaultHttpClient,\n * });\n * const parameters: DeleteExperienceIconParameters = {\n * languageCode: \"en\",\n * universeId: \"42\",\n * };\n * expect(client).toBeInstanceOf(UniversesClient);\n * return Promise.all([\n * client.icon.delete(parameters),\n * undecoratedClient.icon.delete(parameters),\n * ]).then(([result, undecoratedResult]) => {\n * expect(observedRequests).toStrictEqual([{\n * method: \"DELETE\",\n * url: \"/legacy-game-internationalization/v1/game-icon/games/42/language-codes/en\",\n * }]);\n * expect(result).toStrictEqual({ data: undefined, success: true });\n * expect(result).toStrictEqual(undecoratedResult);\n * });\n * ```\n */\nexport function createFetchHttpClient(options?: {\n\treadonly fetch?: (input: string, init: RequestInit) => Promise<Response>;\n}): HttpClient {\n\treturn createInternalFetchHttpClient(options?.fetch);\n}\n","import { OpenCloudError, type OpenCloudErrorOptions } from \"./base.ts\";\n\n/**\n * Options for constructing a {@link TokenRefreshError}.\n *\n * @since 0.4.0\n */\nexport interface TokenRefreshErrorOptions extends OpenCloudErrorOptions {\n\t/** HTTP status of the token endpoint's response. */\n\treadonly statusCode: number;\n}\n\n/**\n * Thrown by the `getAccessToken` that `createOAuthTokenRefresher` returns\n * when the Roblox token endpoint refuses a refresh. `code` is the OAuth\n * `error` field of the response body (for example `invalid_grant`), or\n * `undefined` when the body has none. A client that calls the provider\n * returns it as the `cause` of a `CredentialError`.\n *\n * @since 0.4.0\n *\n * @example\n *\n * ```ts\n * import { TokenRefreshError } from \"@bedrock-rbx/ocale\";\n *\n * const error = new TokenRefreshError(\"Token refresh refused\", {\n * code: \"invalid_grant\",\n * statusCode: 400,\n * });\n *\n * expect(error.code).toBe(\"invalid_grant\");\n * expect(error.statusCode).toBe(400);\n * ```\n */\nexport class TokenRefreshError extends OpenCloudError {\n\tpublic override readonly name: string = \"TokenRefreshError\";\n\t/** HTTP status of the token endpoint's response. */\n\tpublic readonly statusCode: number;\n\n\t/**\n\t * Creates a new TokenRefreshError.\n\t *\n\t * @param message - Human-readable error description.\n\t * @param options - The OAuth error code and the HTTP status.\n\t */\n\tconstructor(message: string, options: TokenRefreshErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.statusCode = options.statusCode;\n\t}\n}\n","import { RequestAbortedError } from \"../errors/request-aborted.ts\";\nimport { TokenRefreshError } from \"../errors/token-refresh-error.ts\";\nimport type { Credential } from \"./types.ts\";\n\nconst TOKEN_URL = \"https://apis.roblox.com/oauth/v1/token\";\nconst REFRESH_BELOW_MS = 120_000;\nconst FALLBACK_MIN_MS = 60_000;\nconst EXCHANGE_TIMEOUT_MS = 30_000;\n\n/**\n * Options for {@link createOAuthTokenRefresher}.\n *\n * @since 0.4.0\n */\nexport interface OAuthTokenRefresherOptions {\n\t/** The OAuth app's client id. */\n\treadonly clientId: string;\n\t/**\n\t * The client secret of a confidential app. Omit it for a public app that\n\t * uses a code verifier.\n\t */\n\treadonly clientSecret?: string;\n\t/**\n\t * The `fetch` to send token requests through. Defaults to the global\n\t * `fetch`.\n\t */\n\treadonly fetch?: (input: string, init: RequestInit) => Promise<Response>;\n\t/**\n\t * Saves the new refresh token after each rotation. The new access token is\n\t * used only after it resolves. If it throws, the call throws, and the next\n\t * call retries it with the same token and does no exchange.\n\t */\n\treadonly onRotate: (refreshToken: string) => Promise<void> | void;\n\t/** The current refresh token. It is spent by the first refresh. */\n\treadonly refreshToken: string;\n}\n\ninterface TokenPair {\n\treadonly accessToken: string;\n\treadonly expiresAt: number;\n\treadonly refreshToken: string;\n}\n\ntype ExchangeOutcome =\n\t| { readonly error: unknown; readonly kind: \"transient\" }\n\t| { readonly kind: \"ok\"; readonly pair: TokenPair };\n\n/** The `getAccessToken` of an OAuth {@link Credential}. */\ntype AccessTokenProvider = Extract<Credential, { kind: \"oauth\" }>[\"getAccessToken\"];\n\ntype FetchSeam = NonNullable<OAuthTokenRefresherOptions[\"fetch\"]>;\n\nclass OAuthTokenRefresher {\n\treadonly #clientId: string;\n\treadonly #clientSecret: string | undefined;\n\treadonly #onRotate: OAuthTokenRefresherOptions[\"onRotate\"];\n\treadonly #send: FetchSeam;\n\n\t#current: TokenPair | undefined;\n\t#failure: TokenRefreshError | undefined;\n\t#inFlight: Promise<string> | undefined;\n\t#pending: TokenPair | undefined;\n\t#refreshToken: string;\n\n\tconstructor(options: OAuthTokenRefresherOptions) {\n\t\tthis.#clientId = options.clientId;\n\t\tthis.#clientSecret = options.clientSecret;\n\t\tthis.#onRotate = options.onRotate;\n\t\tthis.#refreshToken = options.refreshToken;\n\t\tthis.#send = options.fetch ?? fetch;\n\t}\n\n\tpublic async getAccessTokenAsync(signal: AbortSignal): Promise<string> {\n\t\tif (signal.aborted) {\n\t\t\tthrow abortedWait(signal);\n\t\t}\n\n\t\tif (this.#failure !== undefined) {\n\t\t\tthrow this.#failure;\n\t\t}\n\n\t\t// A kept unsaved pair only exists after a refresh, which runs below\n\t\t// the threshold, so the current token never short-circuits its save.\n\t\tconst cached = this.#tokenLasting(REFRESH_BELOW_MS);\n\t\tif (cached !== undefined) {\n\t\t\treturn cached;\n\t\t}\n\n\t\tthis.#inFlight ??= this.#refreshAsync().finally(() => {\n\t\t\tthis.#inFlight = undefined;\n\t\t});\n\t\treturn waitAsync(this.#inFlight, signal);\n\t}\n\n\t/**\n\t * Runs one exchange under its own time limit, apart from any caller's\n\t * signal. A timeout is transient, like a network error.\n\t *\n\t * @returns The exchange outcome.\n\t */\n\tasync #exchangeAsync(): Promise<ExchangeOutcome> {\n\t\tconst controller = new AbortController();\n\t\tconst exchange = this.#sendAsync(controller.signal);\n\n\t\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\t\tconst timeout = new Promise<ExchangeOutcome>((resolve) => {\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tconst error = new DOMException(\"OAuth token exchange timed out\", \"TimeoutError\");\n\t\t\t\tcontroller.abort(error);\n\t\t\t\tresolve({ error, kind: \"transient\" });\n\t\t\t}, EXCHANGE_TIMEOUT_MS);\n\t\t});\n\n\t\ttry {\n\t\t\treturn await Promise.race([exchange, timeout]);\n\t\t} finally {\n\t\t\tclearTimeout(timer);\n\t\t}\n\t}\n\n\t#fallback(error: unknown): string {\n\t\tconst token = this.#tokenLasting(FALLBACK_MIN_MS);\n\t\tif (token === undefined) {\n\t\t\tthrow error;\n\t\t}\n\n\t\treturn token;\n\t}\n\n\t#form(): URLSearchParams {\n\t\tconst form = new URLSearchParams({\n\t\t\tclient_id: this.#clientId,\n\t\t\tgrant_type: \"refresh_token\",\n\t\t\trefresh_token: this.#refreshToken,\n\t\t});\n\t\tif (this.#clientSecret !== undefined) {\n\t\t\tform.set(\"client_secret\", this.#clientSecret);\n\t\t}\n\n\t\treturn form;\n\t}\n\n\t/**\n\t * Refreshes and saves a pair. A save can finish late (a retried kept\n\t * pair, or a slow `onRotate`), so when the saved token has under 60 s\n\t * left it exchanges once more with the now saved refresh token.\n\t *\n\t * @returns An access token.\n\t */\n\tasync #refreshAsync(): Promise<string> {\n\t\tconst first = await this.#rotateAsync();\n\t\tif (first.kind === \"transient\") {\n\t\t\treturn this.#fallback(first.error);\n\t\t}\n\n\t\tif (first.pair.expiresAt - Date.now() >= FALLBACK_MIN_MS) {\n\t\t\treturn first.pair.accessToken;\n\t\t}\n\n\t\tconst second = await this.#rotateAsync();\n\t\treturn second.kind === \"transient\" ? this.#fallback(second.error) : second.pair.accessToken;\n\t}\n\n\t/**\n\t * Records a refusal that spent the refresh token, so it is never sent\n\t * again: an `invalid_grant`, or a 2xx whose body held no usable pair.\n\t *\n\t * @param error - The refusal.\n\t * @param accepted - Whether the endpoint answered 2xx.\n\t * @returns The refusal, to throw.\n\t */\n\t#refused(error: TokenRefreshError, accepted: boolean): TokenRefreshError {\n\t\tif (accepted || error.code === \"invalid_grant\") {\n\t\t\tthis.#failure = error;\n\t\t}\n\n\t\treturn error;\n\t}\n\n\t/**\n\t * Exchanges the refresh token unless a kept unsaved pair exists, then\n\t * saves the pair and makes it current.\n\t *\n\t * @returns The saved pair, or the transient failure of the exchange.\n\t */\n\tasync #rotateAsync(): Promise<ExchangeOutcome> {\n\t\tif (this.#pending === undefined) {\n\t\t\tconst outcome = await this.#exchangeAsync();\n\t\t\tif (outcome.kind === \"transient\") {\n\t\t\t\treturn outcome;\n\t\t\t}\n\n\t\t\tthis.#pending = outcome.pair;\n\t\t}\n\n\t\tconst pending = this.#pending;\n\t\tawait this.#onRotate(pending.refreshToken);\n\t\tthis.#current = pending;\n\t\tthis.#refreshToken = pending.refreshToken;\n\t\tthis.#pending = undefined;\n\t\treturn { kind: \"ok\", pair: pending };\n\t}\n\n\tasync #sendAsync(signal: AbortSignal): Promise<ExchangeOutcome> {\n\t\tlet response: Response;\n\t\ttry {\n\t\t\tresponse = await this.#send(TOKEN_URL, {\n\t\t\t\tbody: this.#form().toString(),\n\t\t\t\theaders: { \"content-type\": \"application/x-www-form-urlencoded\" },\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tsignal,\n\t\t\t});\n\t\t} catch (err) {\n\t\t\treturn { error: err, kind: \"transient\" };\n\t\t}\n\n\t\tconst receivedAt = Date.now();\n\t\tconst json = await readBodyAsync(response);\n\t\tif (response.status === 429 || response.status >= 500) {\n\t\t\treturn { error: refusal(json, response.status), kind: \"transient\" };\n\t\t}\n\n\t\tconst pair = response.ok ? toPair(json, receivedAt) : undefined;\n\t\tif (pair === undefined) {\n\t\t\tthrow this.#refused(refusal(json, response.status), response.ok);\n\t\t}\n\n\t\treturn { kind: \"ok\", pair };\n\t}\n\n\t#tokenLasting(minimumMs: number): string | undefined {\n\t\tconst current = this.#current;\n\t\treturn current !== undefined && current.expiresAt - Date.now() >= minimumMs\n\t\t\t? current.accessToken\n\t\t\t: undefined;\n\t}\n}\n\n/**\n * Creates a `getAccessToken` that keeps an OAuth access token fresh by\n * rotating one refresh token against the Roblox token endpoint. Use it as\n * the `getAccessToken` of an OAuth `Credential`; you write the `identity`.\n *\n * Use one refresher per refresh token, in one process. A refresh token is\n * single use, so two refreshers (or two processes) sharing one will spend it\n * twice and lose the grant. Multi-instance consumers bring their own\n * provider.\n *\n * - The first call refreshes. Later calls refresh when less than 120 s\n * remain, measured on the local clock from receipt plus `expires_in`.\n * - The new access token is used only after `onRotate` resolves. A spent\n * refresh token is never sent again. If the saved access token then has\n * less than 60 s left, it exchanges once more.\n * - A network error, 5xx or 429 returns the current token while 60 s or\n * more remain, and throws otherwise.\n * - Each exchange has its own 30 s limit, for the request and the body\n * read. A timeout is handled like a network error.\n * - Any other non-2xx, or a 2xx without a usable token pair, throws a\n * {@link TokenRefreshError}. After `invalid_grant` or such a 2xx, every\n * call throws it again and sends nothing.\n * - Concurrent calls share one exchange. A caller's `signal` stops only its\n * own wait, never the exchange.\n *\n * @param options - The client, the refresh token and the rotation callback.\n * @returns A `getAccessToken` for an OAuth `Credential`.\n * @since 0.4.0\n *\n * @example\n *\n * ```ts\n * import { createOAuthTokenRefresher, type Credential } from \"@bedrock-rbx/ocale\";\n *\n * let saved = \"refresh-0\";\n * const getAccessToken = createOAuthTokenRefresher({\n * clientId: \"client-id\",\n * fetch: async () =>\n * Response.json({ access_token: \"access-1\", expires_in: 900, refresh_token: \"refresh-1\" }),\n * onRotate: (refreshToken) => {\n * saved = refreshToken;\n * },\n * refreshToken: saved,\n * });\n * const credential: Credential = { getAccessToken, identity: \"user-1\", kind: \"oauth\" };\n *\n * expect(credential.kind).toBe(\"oauth\");\n * return getAccessToken({ signal: new AbortController().signal }).then((token) => {\n * expect(token).toBe(\"access-1\");\n * expect(saved).toBe(\"refresh-1\");\n * });\n * ```\n */\nexport function createOAuthTokenRefresher(\n\toptions: OAuthTokenRefresherOptions,\n): (...args: Parameters<AccessTokenProvider>) => Promise<string> {\n\tconst refresher = new OAuthTokenRefresher(options);\n\treturn async ({ signal }) => refresher.getAccessTokenAsync(signal);\n}\n\nasync function readBodyAsync(response: Response): Promise<JSONValue | undefined> {\n\ttry {\n\t\treturn JSON.parse(await response.text());\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nfunction isRecord(value: JSONValue | undefined): value is Readonly<Record<string, JSONValue>> {\n\treturn value instanceof Object && !Array.isArray(value);\n}\n\nfunction toPair(body: JSONValue | undefined, receivedAt: number): TokenPair | undefined {\n\tif (!isRecord(body)) {\n\t\treturn undefined;\n\t}\n\n\tconst { access_token: accessToken, expires_in: expiresIn, refresh_token: refreshToken } = body;\n\tif (\n\t\ttypeof accessToken !== \"string\" ||\n\t\taccessToken === \"\" ||\n\t\ttypeof refreshToken !== \"string\" ||\n\t\trefreshToken === \"\" ||\n\t\ttypeof expiresIn !== \"number\" ||\n\t\t!Number.isFinite(expiresIn) ||\n\t\texpiresIn <= 0\n\t) {\n\t\treturn undefined;\n\t}\n\n\treturn { accessToken, expiresAt: receivedAt + expiresIn * 1000, refreshToken };\n}\n\nfunction refusal(body: JSONValue | undefined, statusCode: number): TokenRefreshError {\n\tconst code = isRecord(body) && typeof body[\"error\"] === \"string\" ? body[\"error\"] : undefined;\n\treturn new TokenRefreshError(`OAuth token refresh failed with HTTP ${statusCode}`, {\n\t\tcode,\n\t\tstatusCode,\n\t});\n}\n\nfunction abortedWait(signal: AbortSignal): RequestAbortedError {\n\treturn new RequestAbortedError(\"Access token wait was aborted\", { reason: signal.reason });\n}\n\n/**\n * Waits for a shared promise, but lets one caller's signal end only that\n * caller's wait.\n *\n * @template T - The value type of the shared promise.\n * @param promise - The shared promise.\n * @param signal - The caller's signal.\n * @returns The value of the shared promise.\n * @rejects RequestAbortedError when the signal aborts first, or the shared\n * promise's own error.\n */\nasync function waitAsync<T>(promise: Promise<T>, signal: AbortSignal): Promise<T> {\n\treturn new Promise<T>((resolve, reject) => {\n\t\tfunction onAbort(): void {\n\t\t\treject(abortedWait(signal));\n\t\t}\n\n\t\tsignal.addEventListener(\"abort\", onAbort);\n\t\tpromise\n\t\t\t.then(resolve)\n\t\t\t.catch(reject)\n\t\t\t.finally(() => {\n\t\t\t\tsignal.removeEventListener(\"abort\", onAbort);\n\t\t\t});\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,SAAgB,sBAAsB,SAEvB;CACd,OAAOA,wBAA8B,SAAS,KAAK;AACpD;;;;;;;;;;;;;;;;;;;;;;;;;ACzCA,IAAa,oBAAb,cAAuC,eAAe;CACrD,OAAwC;;CAExC;;;;;;;CAQA,YAAY,SAAiB,SAAmC;EAC/D,MAAM,SAAS,OAAO;EACtB,KAAK,aAAa,QAAQ;CAC3B;AACD;;AC9CA,MAAM,YAAY;AAClB,MAAM,mBAAmB;AACzB,MAAM,kBAAkB;AACxB,MAAM,sBAAsB;AA6C5B,IAAM,sBAAN,MAA0B;CACzB;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CAEA,YAAY,SAAq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AE,QAAQ,OAAO,OAAO,CAAC;AAC1F;;;;;;;;;;;;AAaA,eAAe,UAAa,SAAqB,QAAiC;CACjF,OAAO,IAAI,SAAY,SAAS,WAAW;EAC1C,SAAS,UAAgB;GACxB,OAAO,YAAY,MAAM,CAAC;EAC3B;EAEA,OAAO,iBAAiB,SAAS,OAAO;EACxC,QACE,KAAK,OAAO,CAAC,CACb,MAAM,MAAM,CAAC,CACb,cAAc;GACd,OAAO,oBAAoB,SAAS,OAAO;EAC5C,CAAC;CACH,CAAC;AACF"}
@@ -0,0 +1,19 @@
1
+ // src/internal/utils/is-date-time-string.ts
2
+ /**
3
+ * Narrows `value` to a string that parses to a real {@link Date} via the
4
+ * `Date(string)` constructor. Used by resource parsers to gate
5
+ * `format: date-time` wire fields before handing them to `new Date(...)`,
6
+ * which silently produces an `Invalid Date` for invalid input.
7
+ *
8
+ * @param value - The unknown wire value to validate.
9
+ * @returns `true` when `value` is a string and `new Date(value).getTime()`
10
+ * is not `NaN`.
11
+ */
12
+ function isDateTimeString(value) {
13
+ if (typeof value !== "string") return false;
14
+ const parsed = new Date(value);
15
+ return !Number.isNaN(parsed.getTime());
16
+ }
17
+ export { isDateTimeString as t };
18
+
19
+ //# sourceMappingURL=is-date-time-string-C91G44SI.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-date-time-string-C91G44SI.mjs","names":[],"sources":["../src/internal/utils/is-date-time-string.ts"],"sourcesContent":["/**\n * Narrows `value` to a string that parses to a real {@link Date} via the\n * `Date(string)` constructor. Used by resource parsers to gate\n * `format: date-time` wire fields before handing them to `new Date(...)`,\n * which silently produces an `Invalid Date` for invalid input.\n *\n * @param value - The unknown wire value to validate.\n * @returns `true` when `value` is a string and `new Date(value).getTime()`\n * is not `NaN`.\n */\nexport function isDateTimeString(value: unknown): value is string {\n\tif (typeof value !== \"string\") {\n\t\treturn false;\n\t}\n\n\tconst parsed = new Date(value);\n\treturn !Number.isNaN(parsed.getTime());\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAAgB,iBAAiB,OAAiC;CACjE,IAAI,OAAO,UAAU,UACpB,OAAO;CAGR,MAAM,SAAS,IAAI,KAAK,KAAK;CAC7B,OAAO,CAAC,OAAO,MAAM,OAAO,QAAQ,CAAC;AACtC"}
@@ -1,5 +1,4 @@
1
- import { i as RobloxLocale, n as RobloxCreatorLocale, r as RobloxLanguageCode, t as ROBLOX_CREATOR_LOCALES } from "./data.generated-D_vpa5-g.mjs";
2
- //#region src/locales/localization-key.d.ts
1
+ import { i as RobloxLocale, n as RobloxCreatorLocale, r as RobloxLanguageCode, t as ROBLOX_CREATOR_LOCALES } from "./data.generated-B4Fztv_7.mjs";
3
2
  /**
4
3
  * Any string Roblox accepts as a localization key: an underscore locale such
5
4
  * as `en_us`, or a language code such as `en` or `zh-hans`.
@@ -25,6 +24,5 @@ type RobloxLocalizationKey = RobloxLanguageCode | RobloxLocale;
25
24
  * ```
26
25
  */
27
26
  export declare function isRobloxLocalizationKey(value: string): value is RobloxLocalizationKey;
28
- //#endregion
29
27
  export { ROBLOX_CREATOR_LOCALES, type RobloxCreatorLocale, type RobloxLanguageCode, type RobloxLocale, type RobloxLocalizationKey };
30
28
  //# sourceMappingURL=locales.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"locales.d.mts","names":[],"sources":["../src/locales/localization-key.ts"],"mappings":";;;;;;;;KAYY,wBAAwB,qBAAqB;;;;;;;;;;;;;;;;;;wBAuBzC,wBAAwB,gBAAgB,SAAS"}
1
+ {"version":3,"file":"locales.d.mts","names":[],"sources":["../src/locales/localization-key.ts"],"mappings":";;;;;;;KAYY,wBAAwB,qBAAqB;;;;;;;;;;;;;;;;;;wBAuBzC,wBAAwB,gBAAgB,SAAS"}
package/dist/locales.mjs CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/locales/data.generated.ts
1
+ // src/locales/data.generated.ts
2
2
  /**
3
3
  * Vendored snapshot of
4
4
  * `https://locale.roblox.com/v1/locales/supported-locales-for-creators`.
@@ -508,8 +508,7 @@ const ROBLOX_CREATOR_LOCALES = [
508
508
  isEnabledForSignupAndLogin: true
509
509
  }
510
510
  ];
511
- //#endregion
512
- //#region src/locales/localization-key.ts
511
+ // src/locales/localization-key.ts
513
512
  const LOCALIZATION_KEYS = new Set(ROBLOX_CREATOR_LOCALES.flatMap((row) => [row.locale, row.languageCode]));
514
513
  /**
515
514
  * Checks whether a string is a Roblox localization key, narrowing it to
@@ -531,7 +530,6 @@ const LOCALIZATION_KEYS = new Set(ROBLOX_CREATOR_LOCALES.flatMap((row) => [row.l
531
530
  function isRobloxLocalizationKey(value) {
532
531
  return LOCALIZATION_KEYS.has(value);
533
532
  }
534
- //#endregion
535
533
  export { ROBLOX_CREATOR_LOCALES, isRobloxLocalizationKey };
536
534
 
537
535
  //# sourceMappingURL=locales.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"locales.mjs","names":[],"sources":["../src/locales/data.generated.ts","../src/locales/localization-key.ts"],"sourcesContent":["// @generated by scripts/fetch-locales.ts. Do not edit by hand.\n// Source: https://locale.roblox.com/v1/locales/supported-locales-for-creators\n\n/**\n * One row in the vendored Roblox creator-locale list.\n *\n * @since 0.1.0\n */\nexport interface RobloxCreatorLocale {\n\treadonly locale: string;\n\treadonly languageCode: string;\n\treadonly name: string;\n\treadonly nativeName: string;\n\treadonly isRightToLeft: boolean;\n\treadonly isEnabledForFullExperience: boolean;\n\treadonly isEnabledForInGameUgc: boolean;\n\treadonly isEnabledForSignupAndLogin: boolean;\n}\n\n/**\n * Vendored snapshot of\n * `https://locale.roblox.com/v1/locales/supported-locales-for-creators`.\n * Refreshed by `pnpm --filter @bedrock-rbx/ocale refresh-locales`.\n *\n * @since 0.1.0\n */\nexport const ROBLOX_CREATOR_LOCALES = [\n\t{\n\t\tlocale: \"ar_001\",\n\t\tlanguageCode: \"ar\",\n\t\tname: \"Arabic\",\n\t\tnativeName: \"العربية\",\n\t\tisRightToLeft: true,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"bg_bg\",\n\t\tlanguageCode: \"bg\",\n\t\tname: \"Bulgarian\",\n\t\tnativeName: \"Български\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"bn_bd\",\n\t\tlanguageCode: \"bn\",\n\t\tname: \"Bengali\",\n\t\tnativeName: \"বাংলা\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"bs_ba\",\n\t\tlanguageCode: \"bs\",\n\t\tname: \"Bosnian\",\n\t\tnativeName: \"Босански\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"cs_cz\",\n\t\tlanguageCode: \"cs\",\n\t\tname: \"Czech\",\n\t\tnativeName: \"Čeština\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"da_dk\",\n\t\tlanguageCode: \"da\",\n\t\tname: \"Danish\",\n\t\tnativeName: \"Dansk\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"de_de\",\n\t\tlanguageCode: \"de\",\n\t\tname: \"German\",\n\t\tnativeName: \"Deutsch\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"el_gr\",\n\t\tlanguageCode: \"el\",\n\t\tname: \"Greek\",\n\t\tnativeName: \"Ελληνικά\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"en_gb\",\n\t\tlanguageCode: \"en\",\n\t\tname: \"English (United Kingdom)\",\n\t\tnativeName: \"English (United Kingdom)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"en_us\",\n\t\tlanguageCode: \"en\",\n\t\tname: \"English (United States)\",\n\t\tnativeName: \"English (United States)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"es_es\",\n\t\tlanguageCode: \"es\",\n\t\tname: \"Spanish (Spain)\",\n\t\tnativeName: \"Español (España)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"es_mx\",\n\t\tlanguageCode: \"es\",\n\t\tname: \"Spanish (Mexico)\",\n\t\tnativeName: \"Español (México)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"et_ee\",\n\t\tlanguageCode: \"et\",\n\t\tname: \"Estonian\",\n\t\tnativeName: \"Eesti\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"fi_fi\",\n\t\tlanguageCode: \"fi\",\n\t\tname: \"Finnish\",\n\t\tnativeName: \"Suomi\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"fil_ph\",\n\t\tlanguageCode: \"fil\",\n\t\tname: \"Filipino\",\n\t\tnativeName: \"Filipino\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"fr_ca\",\n\t\tlanguageCode: \"fr\",\n\t\tname: \"French (Canada)\",\n\t\tnativeName: \"Français (Canada)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"fr_fr\",\n\t\tlanguageCode: \"fr\",\n\t\tname: \"French (France)\",\n\t\tnativeName: \"Français (France)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"hi_in\",\n\t\tlanguageCode: \"hi\",\n\t\tname: \"Hindi\",\n\t\tnativeName: \"हिन्दी\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"hr_hr\",\n\t\tlanguageCode: \"hr\",\n\t\tname: \"Croatian\",\n\t\tnativeName: \"Hrvatski\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"hu_hu\",\n\t\tlanguageCode: \"hu\",\n\t\tname: \"Hungarian\",\n\t\tnativeName: \"Magyar\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"id_id\",\n\t\tlanguageCode: \"id\",\n\t\tname: \"Indonesian\",\n\t\tnativeName: \"Bahasa Indonesia\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"it_it\",\n\t\tlanguageCode: \"it\",\n\t\tname: \"Italian\",\n\t\tnativeName: \"Italiano\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"ja_jp\",\n\t\tlanguageCode: \"ja\",\n\t\tname: \"Japanese\",\n\t\tnativeName: \"日本語\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"ka_ge\",\n\t\tlanguageCode: \"ka\",\n\t\tname: \"Georgian\",\n\t\tnativeName: \"ქართული\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"kk_kz\",\n\t\tlanguageCode: \"kk\",\n\t\tname: \"Kazakh\",\n\t\tnativeName: \"Қазақ Тілі\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"km_kh\",\n\t\tlanguageCode: \"km\",\n\t\tname: \"Khmer\",\n\t\tnativeName: \"ភាសាខ្មែរ\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"ko_kr\",\n\t\tlanguageCode: \"ko\",\n\t\tname: \"Korean\",\n\t\tnativeName: \"한국어\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"lt_lt\",\n\t\tlanguageCode: \"lt\",\n\t\tname: \"Lithuanian\",\n\t\tnativeName: \"Lietuvių\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"lv_lv\",\n\t\tlanguageCode: \"lv\",\n\t\tname: \"Latvian\",\n\t\tnativeName: \"Latviešu\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"ms_my\",\n\t\tlanguageCode: \"ms\",\n\t\tname: \"Malay\",\n\t\tnativeName: \"Bahasa Melayu\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"my_mm\",\n\t\tlanguageCode: \"my\",\n\t\tname: \"Burmese\",\n\t\tnativeName: \"ဗမာစာ\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"nb_no\",\n\t\tlanguageCode: \"nb\",\n\t\tname: \"Bokmal\",\n\t\tnativeName: \"Bokmål\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"nl_nl\",\n\t\tlanguageCode: \"nl\",\n\t\tname: \"Dutch\",\n\t\tnativeName: \"Nederlands\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"pl_pl\",\n\t\tlanguageCode: \"pl\",\n\t\tname: \"Polish\",\n\t\tnativeName: \"Polski\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"pt_br\",\n\t\tlanguageCode: \"pt\",\n\t\tname: \"Portuguese (Brazil)\",\n\t\tnativeName: \"Português (Brasil)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"pt_pt\",\n\t\tlanguageCode: \"pt\",\n\t\tname: \"Portuguese (Portugal)\",\n\t\tnativeName: \"Português (Portugal)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"ro_ro\",\n\t\tlanguageCode: \"ro\",\n\t\tname: \"Romanian\",\n\t\tnativeName: \"Română\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"ru_ru\",\n\t\tlanguageCode: \"ru\",\n\t\tname: \"Russian\",\n\t\tnativeName: \"Русский\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"si_lk\",\n\t\tlanguageCode: \"si\",\n\t\tname: \"Sinhala\",\n\t\tnativeName: \"සිංහල\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"sk_sk\",\n\t\tlanguageCode: \"sk\",\n\t\tname: \"Slovak\",\n\t\tnativeName: \"Slovenčina\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"sl_sl\",\n\t\tlanguageCode: \"sl\",\n\t\tname: \"Slovenian\",\n\t\tnativeName: \"Slovenski\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"sq_al\",\n\t\tlanguageCode: \"sq\",\n\t\tname: \"Albanian\",\n\t\tnativeName: \"Shqipe\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"sr_rs\",\n\t\tlanguageCode: \"sr\",\n\t\tname: \"Serbian\",\n\t\tnativeName: \"Cрпски\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"sv_se\",\n\t\tlanguageCode: \"sv\",\n\t\tname: \"Swedish\",\n\t\tnativeName: \"Svenska\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"th_th\",\n\t\tlanguageCode: \"th\",\n\t\tname: \"Thai\",\n\t\tnativeName: \"ภาษาไทย\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"tr_tr\",\n\t\tlanguageCode: \"tr\",\n\t\tname: \"Turkish\",\n\t\tnativeName: \"Türkçe\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"uk_ua\",\n\t\tlanguageCode: \"uk\",\n\t\tname: \"Ukrainian\",\n\t\tnativeName: \"Yкраїньска\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"vi_vn\",\n\t\tlanguageCode: \"vi\",\n\t\tname: \"Vietnamese\",\n\t\tnativeName: \"Tiếng Việt\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"zh_cn\",\n\t\tlanguageCode: \"zh-hans\",\n\t\tname: \"Chinese (Simplified)\",\n\t\tnativeName: \"中文(简体)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"zh_tw\",\n\t\tlanguageCode: \"zh-hant\",\n\t\tname: \"Chinese (Traditional)\",\n\t\tnativeName: \"中文(繁體)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n] as const;\n\n/**\n * Roblox locale wire form (e.g. `en_us`, `pt_br`, `ar_001`). Used by\n * the legacy game-internationalization endpoints when\n * `languageCodeType` is `Locale`.\n *\n * @since 0.1.0\n */\nexport type RobloxLocale = (typeof ROBLOX_CREATOR_LOCALES)[number][\"locale\"];\n\n/**\n * Roblox language wire form (e.g. `en`, `fil`, `zh-hans`). Used by\n * the legacy game-internationalization endpoints when\n * `languageCodeType` is `Language`.\n *\n * @since 0.1.0\n */\nexport type RobloxLanguageCode = (typeof ROBLOX_CREATOR_LOCALES)[number][\"languageCode\"];\n","import {\n\tROBLOX_CREATOR_LOCALES,\n\ttype RobloxLanguageCode,\n\ttype RobloxLocale,\n} from \"./data.generated.ts\";\n\n/**\n * Any string Roblox accepts as a localization key: an underscore locale such\n * as `en_us`, or a language code such as `en` or `zh-hans`.\n *\n * @since 0.4.0\n */\nexport type RobloxLocalizationKey = RobloxLanguageCode | RobloxLocale;\n\nconst LOCALIZATION_KEYS: ReadonlySet<string> = new Set(\n\tROBLOX_CREATOR_LOCALES.flatMap((row) => [row.locale, row.languageCode]),\n);\n\n/**\n * Checks whether a string is a Roblox localization key, narrowing it to\n * {@link RobloxLocalizationKey}. Region-qualified hyphen forms such as\n * `en-us` are rejected (Roblox writes them as `en_us`), as are language names\n * such as `english`.\n *\n * @since 0.4.0\n * @param value - The string to check.\n * @returns `true` when `value` is a known locale or language code.\n * @example\n * ```ts\n * import { isRobloxLocalizationKey } from \"@bedrock-rbx/ocale/locales\";\n *\n * expect(isRobloxLocalizationKey(\"pt_br\")).toBe(true);\n * expect(isRobloxLocalizationKey(\"en-us\")).toBe(false);\n * ```\n */\nexport function isRobloxLocalizationKey(value: string): value is RobloxLocalizationKey {\n\treturn LOCALIZATION_KEYS.has(value);\n}\n"],"mappings":";;;;;;;;AA0BA,MAAa,yBAAyB;CACrC;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAAe;EACf,4BAA4B;EAC5B,uBAAuB;EACvB,4BAA4B;CAC7B;CACA;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAAe;EACf,4BAA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AC5B,uBAAuB;EACvB,4BAA4B;CAC7B;CACA;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAAe;EACf,4BAA4B;EAC5B,uBAAuB;EACvB,4BAA4B;CAC7B;CACA;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAAe;EACf,4BAA4B;EAC5B,uBAAuB;EACvB,4BAA4B;CAC7B;CACA;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAAe;EACf,4BAA4B;EAC5B,uBAAuB;EACvB,4BAA4B;CAC7B;CACA;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAAe;EACf,4BAA4B;EAC5B,uBAAuB;EACvB,4BAA4B;CAC7B;AACD;;;ACjgBA,MAAM,oBAAyC,IAAI,IAClD,uBAAuB,SAAS,QAAQ,CAAC,IAAI,QAAQ,IAAI,YAAY,CAAC,CACvE;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,wBAAwB,OAA+C;CACtF,OAAO,kBAAkB,IAAI,KAAK;AACnC"}
1
+ {"version":3,"file":"locales.mjs","names":[],"sources":["../src/locales/data.generated.ts","../src/locales/localization-key.ts"],"sourcesContent":["// @generated by scripts/fetch-locales.ts. Do not edit by hand.\n// Source: https://locale.roblox.com/v1/locales/supported-locales-for-creators\n\n/**\n * One row in the vendored Roblox creator-locale list.\n *\n * @since 0.1.0\n */\nexport interface RobloxCreatorLocale {\n\treadonly locale: string;\n\treadonly languageCode: string;\n\treadonly name: string;\n\treadonly nativeName: string;\n\treadonly isRightToLeft: boolean;\n\treadonly isEnabledForFullExperience: boolean;\n\treadonly isEnabledForInGameUgc: boolean;\n\treadonly isEnabledForSignupAndLogin: boolean;\n}\n\n/**\n * Vendored snapshot of\n * `https://locale.roblox.com/v1/locales/supported-locales-for-creators`.\n * Refreshed by `pnpm --filter @bedrock-rbx/ocale refresh-locales`.\n *\n * @since 0.1.0\n */\nexport const ROBLOX_CREATOR_LOCALES = [\n\t{\n\t\tlocale: \"ar_001\",\n\t\tlanguageCode: \"ar\",\n\t\tname: \"Arabic\",\n\t\tnativeName: \"العربية\",\n\t\tisRightToLeft: true,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"bg_bg\",\n\t\tlanguageCode: \"bg\",\n\t\tname: \"Bulgarian\",\n\t\tnativeName: \"Български\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"bn_bd\",\n\t\tlanguageCode: \"bn\",\n\t\tname: \"Bengali\",\n\t\tnativeName: \"বাংলা\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"bs_ba\",\n\t\tlanguageCode: \"bs\",\n\t\tname: \"Bosnian\",\n\t\tnativeName: \"Босански\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"cs_cz\",\n\t\tlanguageCode: \"cs\",\n\t\tname: \"Czech\",\n\t\tnativeName: \"Čeština\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"da_dk\",\n\t\tlanguageCode: \"da\",\n\t\tname: \"Danish\",\n\t\tnativeName: \"Dansk\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"de_de\",\n\t\tlanguageCode: \"de\",\n\t\tname: \"German\",\n\t\tnativeName: \"Deutsch\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"el_gr\",\n\t\tlanguageCode: \"el\",\n\t\tname: \"Greek\",\n\t\tnativeName: \"Ελληνικά\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"en_gb\",\n\t\tlanguageCode: \"en\",\n\t\tname: \"English (United Kingdom)\",\n\t\tnativeName: \"English (United Kingdom)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"en_us\",\n\t\tlanguageCode: \"en\",\n\t\tname: \"English (United States)\",\n\t\tnativeName: \"English (United States)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"es_es\",\n\t\tlanguageCode: \"es\",\n\t\tname: \"Spanish (Spain)\",\n\t\tnativeName: \"Español (España)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"es_mx\",\n\t\tlanguageCode: \"es\",\n\t\tname: \"Spanish (Mexico)\",\n\t\tnativeName: \"Español (México)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"et_ee\",\n\t\tlanguageCode: \"et\",\n\t\tname: \"Estonian\",\n\t\tnativeName: \"Eesti\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"fi_fi\",\n\t\tlanguageCode: \"fi\",\n\t\tname: \"Finnish\",\n\t\tnativeName: \"Suomi\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"fil_ph\",\n\t\tlanguageCode: \"fil\",\n\t\tname: \"Filipino\",\n\t\tnativeName: \"Filipino\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"fr_ca\",\n\t\tlanguageCode: \"fr\",\n\t\tname: \"French (Canada)\",\n\t\tnativeName: \"Français (Canada)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"fr_fr\",\n\t\tlanguageCode: \"fr\",\n\t\tname: \"French (France)\",\n\t\tnativeName: \"Français (France)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"hi_in\",\n\t\tlanguageCode: \"hi\",\n\t\tname: \"Hindi\",\n\t\tnativeName: \"हिन्दी\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"hr_hr\",\n\t\tlanguageCode: \"hr\",\n\t\tname: \"Croatian\",\n\t\tnativeName: \"Hrvatski\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"hu_hu\",\n\t\tlanguageCode: \"hu\",\n\t\tname: \"Hungarian\",\n\t\tnativeName: \"Magyar\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"id_id\",\n\t\tlanguageCode: \"id\",\n\t\tname: \"Indonesian\",\n\t\tnativeName: \"Bahasa Indonesia\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"it_it\",\n\t\tlanguageCode: \"it\",\n\t\tname: \"Italian\",\n\t\tnativeName: \"Italiano\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"ja_jp\",\n\t\tlanguageCode: \"ja\",\n\t\tname: \"Japanese\",\n\t\tnativeName: \"日本語\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"ka_ge\",\n\t\tlanguageCode: \"ka\",\n\t\tname: \"Georgian\",\n\t\tnativeName: \"ქართული\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"kk_kz\",\n\t\tlanguageCode: \"kk\",\n\t\tname: \"Kazakh\",\n\t\tnativeName: \"Қазақ Тілі\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"km_kh\",\n\t\tlanguageCode: \"km\",\n\t\tname: \"Khmer\",\n\t\tnativeName: \"ភាសាខ្មែរ\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"ko_kr\",\n\t\tlanguageCode: \"ko\",\n\t\tname: \"Korean\",\n\t\tnativeName: \"한국어\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"lt_lt\",\n\t\tlanguageCode: \"lt\",\n\t\tname: \"Lithuanian\",\n\t\tnativeName: \"Lietuvių\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"lv_lv\",\n\t\tlanguageCode: \"lv\",\n\t\tname: \"Latvian\",\n\t\tnativeName: \"Latviešu\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"ms_my\",\n\t\tlanguageCode: \"ms\",\n\t\tname: \"Malay\",\n\t\tnativeName: \"Bahasa Melayu\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"my_mm\",\n\t\tlanguageCode: \"my\",\n\t\tname: \"Burmese\",\n\t\tnativeName: \"ဗမာစာ\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"nb_no\",\n\t\tlanguageCode: \"nb\",\n\t\tname: \"Bokmal\",\n\t\tnativeName: \"Bokmål\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"nl_nl\",\n\t\tlanguageCode: \"nl\",\n\t\tname: \"Dutch\",\n\t\tnativeName: \"Nederlands\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"pl_pl\",\n\t\tlanguageCode: \"pl\",\n\t\tname: \"Polish\",\n\t\tnativeName: \"Polski\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"pt_br\",\n\t\tlanguageCode: \"pt\",\n\t\tname: \"Portuguese (Brazil)\",\n\t\tnativeName: \"Português (Brasil)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"pt_pt\",\n\t\tlanguageCode: \"pt\",\n\t\tname: \"Portuguese (Portugal)\",\n\t\tnativeName: \"Português (Portugal)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"ro_ro\",\n\t\tlanguageCode: \"ro\",\n\t\tname: \"Romanian\",\n\t\tnativeName: \"Română\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"ru_ru\",\n\t\tlanguageCode: \"ru\",\n\t\tname: \"Russian\",\n\t\tnativeName: \"Русский\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"si_lk\",\n\t\tlanguageCode: \"si\",\n\t\tname: \"Sinhala\",\n\t\tnativeName: \"සිංහල\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"sk_sk\",\n\t\tlanguageCode: \"sk\",\n\t\tname: \"Slovak\",\n\t\tnativeName: \"Slovenčina\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"sl_sl\",\n\t\tlanguageCode: \"sl\",\n\t\tname: \"Slovenian\",\n\t\tnativeName: \"Slovenski\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"sq_al\",\n\t\tlanguageCode: \"sq\",\n\t\tname: \"Albanian\",\n\t\tnativeName: \"Shqipe\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"sr_rs\",\n\t\tlanguageCode: \"sr\",\n\t\tname: \"Serbian\",\n\t\tnativeName: \"Cрпски\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"sv_se\",\n\t\tlanguageCode: \"sv\",\n\t\tname: \"Swedish\",\n\t\tnativeName: \"Svenska\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"th_th\",\n\t\tlanguageCode: \"th\",\n\t\tname: \"Thai\",\n\t\tnativeName: \"ภาษาไทย\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"tr_tr\",\n\t\tlanguageCode: \"tr\",\n\t\tname: \"Turkish\",\n\t\tnativeName: \"Türkçe\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"uk_ua\",\n\t\tlanguageCode: \"uk\",\n\t\tname: \"Ukrainian\",\n\t\tnativeName: \"Yкраїньска\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: false,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: false,\n\t},\n\t{\n\t\tlocale: \"vi_vn\",\n\t\tlanguageCode: \"vi\",\n\t\tname: \"Vietnamese\",\n\t\tnativeName: \"Tiếng Việt\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"zh_cn\",\n\t\tlanguageCode: \"zh-hans\",\n\t\tname: \"Chinese (Simplified)\",\n\t\tnativeName: \"中文(简体)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n\t{\n\t\tlocale: \"zh_tw\",\n\t\tlanguageCode: \"zh-hant\",\n\t\tname: \"Chinese (Traditional)\",\n\t\tnativeName: \"中文(繁體)\",\n\t\tisRightToLeft: false,\n\t\tisEnabledForFullExperience: true,\n\t\tisEnabledForInGameUgc: true,\n\t\tisEnabledForSignupAndLogin: true,\n\t},\n] as const;\n\n/**\n * Roblox locale wire form (e.g. `en_us`, `pt_br`, `ar_001`). Used by\n * the legacy game-internationalization endpoints when\n * `languageCodeType` is `Locale`.\n *\n * @since 0.1.0\n */\nexport type RobloxLocale = (typeof ROBLOX_CREATOR_LOCALES)[number][\"locale\"];\n\n/**\n * Roblox language wire form (e.g. `en`, `fil`, `zh-hans`). Used by\n * the legacy game-internationalization endpoints when\n * `languageCodeType` is `Language`.\n *\n * @since 0.1.0\n */\nexport type RobloxLanguageCode = (typeof ROBLOX_CREATOR_LOCALES)[number][\"languageCode\"];\n","import {\n\tROBLOX_CREATOR_LOCALES,\n\ttype RobloxLanguageCode,\n\ttype RobloxLocale,\n} from \"./data.generated.ts\";\n\n/**\n * Any string Roblox accepts as a localization key: an underscore locale such\n * as `en_us`, or a language code such as `en` or `zh-hans`.\n *\n * @since 0.4.0\n */\nexport type RobloxLocalizationKey = RobloxLanguageCode | RobloxLocale;\n\nconst LOCALIZATION_KEYS: ReadonlySet<string> = new Set(\n\tROBLOX_CREATOR_LOCALES.flatMap((row) => [row.locale, row.languageCode]),\n);\n\n/**\n * Checks whether a string is a Roblox localization key, narrowing it to\n * {@link RobloxLocalizationKey}. Region-qualified hyphen forms such as\n * `en-us` are rejected (Roblox writes them as `en_us`), as are language names\n * such as `english`.\n *\n * @since 0.4.0\n * @param value - The string to check.\n * @returns `true` when `value` is a known locale or language code.\n * @example\n * ```ts\n * import { isRobloxLocalizationKey } from \"@bedrock-rbx/ocale/locales\";\n *\n * expect(isRobloxLocalizationKey(\"pt_br\")).toBe(true);\n * expect(isRobloxLocalizationKey(\"en-us\")).toBe(false);\n * ```\n */\nexport function isRobloxLocalizationKey(value: string): value is RobloxLocalizationKey {\n\treturn LOCALIZATION_KEYS.has(value);\n}\n"],"mappings":";;;;;;;;AA0BA,MAAa,yBAAyB;CACrC;EACC,QAAQ;EACR,cAA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d,MAAM;EACN,YAAY;EACZ,eAAe;EACf,4BAA4B;EAC5B,uBAAuB;EACvB,4BAA4B;CAC7B;CACA;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAAe;EACf,4BAA4B;EAC5B,uBAAuB;EACvB,4BAA4B;CAC7B;CACA;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAAe;EACf,4BAA4B;EAC5B,uBAAuB;EACvB,4BAA4B;CAC7B;CACA;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAAe;EACf,4BAA4B;EAC5B,uBAAuB;EACvB,4BAA4B;CAC7B;CACA;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAAe;EACf,4BAA4B;EAC5B,uBAAuB;EACvB,4BAA4B;CAC7B;CACA;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAAe;EACf,4BAA4B;EAC5B,uBAAuB;EACvB,4BAA4B;CAC7B;AACD;;ACjgBA,MAAM,oBAAyC,IAAI,IAClD,uBAAuB,SAAS,QAAQ,CAAC,IAAI,QAAQ,IAAI,YAAY,CAAC,CACvE;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,wBAAwB,OAA+C;CACtF,OAAO,kBAAkB,IAAI,KAAK;AACnC"}
@@ -1,6 +1,5 @@
1
- import { c as OpenCloudClientOptions, d as RequestOptions, g as OpenCloudError, m as Result } from "./types-CdMr_J1M.mjs";
2
- import { a as ListLogsParameters, c as CompleteTask, d as InProgressTask, f as LuauExecutionTask, h as SubmitAtVersionParameters, i as defaultPollDelay, l as FailedTask, m as SubmitAtHeadParameters, n as LuauExecutionSubmitOptions, o as LogMessage, p as LuauExecutionTaskRef, r as PollUntilDoneOptions, s as LogPage, t as LuauExecutionRunOptions, u as GetParameters } from "./capacity-admission-hycCFkTo.mjs";
3
- //#region src/domains/cloud-v2/luau-execution-task-binary-inputs/types.d.ts
1
+ import { a as ListLogsParameters, c as CompleteTask, d as InProgressTask, f as LuauExecutionTask, h as SubmitAtVersionParameters, i as defaultPollDelay, l as FailedTask, m as SubmitAtHeadParameters, n as LuauExecutionSubmitOptions, o as LogMessage, p as LuauExecutionTaskRef, r as PollUntilDoneOptions, s as LogPage, t as LuauExecutionRunOptions, u as GetParameters } from "./capacity-admission-Ce2V9QNb.mjs";
2
+ import { c as OpenCloudClientOptions, d as RequestOptions, g as OpenCloudError, m as Result } from "./types-Z4abDJfK.mjs";
4
3
  /**
5
4
  * Caller-supplied input for creating a Luau execution task binary input
6
5
  * upload slot. The server returns a presigned `uploadUri` the caller uses
@@ -28,8 +27,6 @@ interface LuauExecutionTaskBinaryInput {
28
27
  /** Presigned PUT target; perform the binary upload to this URI directly. */
29
28
  readonly uploadUri: string;
30
29
  }
31
- //#endregion
32
- //#region src/resources/luau-execution/capacity-error.d.ts
33
30
  /**
34
31
  * A Luau task submission refused because validated tasks occupy the target
35
32
  * place's execution capacity.
@@ -62,8 +59,6 @@ export declare class LuauExecutionCapacityError extends OpenCloudError {
62
59
  */
63
60
  constructor(blockers: ReadonlyArray<LuauExecutionTaskRef>);
64
61
  }
65
- //#endregion
66
- //#region src/resources/luau-execution/client.d.ts
67
62
  /**
68
63
  * Operation handle for the `binaryInputs` namespace on
69
64
  * {@link LuauExecutionClient}. Provides `create` to allocate a presigned
@@ -202,6 +197,5 @@ export declare class LuauExecutionClient {
202
197
  */
203
198
  constructor(options: OpenCloudClientOptions);
204
199
  }
205
- //#endregion
206
200
  export { type BinaryInputsHandle, type CompleteTask, type CreateBinaryInputParameters, type FailedTask, type GetParameters, type InProgressTask, type ListLogsParameters, type LogMessage, type LogPage, type LuauExecutionRunOptions, type LuauExecutionSubmitOptions, type LuauExecutionTask, type LuauExecutionTaskBinaryInput, type LuauExecutionTaskRef, type PollUntilDoneOptions, type SubmitAtHeadParameters, type SubmitAtVersionParameters, type TasksHandle, defaultPollDelay };
207
201
  //# sourceMappingURL=luau-execution.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"luau-execution.d.mts","names":[],"sources":["../src/domains/cloud-v2/luau-execution-task-binary-inputs/types.ts","../src/resources/luau-execution/capacity-error.ts","../src/resources/luau-execution/client.ts"],"mappings":";;;;;;;;;;UAOiB;;WAEP;;WAEA;;;;;;;;UASO;;;;WAIP;;WAEA;;;;;;;;;;;;;;;;;;;;;;;;;qBCKG,mCAAmC;;WAE/B,UAAU,cAAc;oBACf;;;;;;EAOzB,YAAY,UAAU,cAAc;;;;;;;;;;;UC0BpB;;;;;;;;;;;;;;EAchB,OACC,YAAY,6BACZ,UAAU,iBACR,QAAQ,OAAO,8BAA8B;;;;;;;;;;UAWhC;;;;;;;;;;;;;EAahB,IACC,YAAY,eACZ,UAAU,iBACR,QAAQ,OAAO,mBAAmB;;;;;;;;;;;;;;EAcrC,SACC,YAAY,oBACZ,UAAU,iBACR,QAAQ,OAAO,SAAS;;;;;;;;;;;;;;EAc3B,cACC,KAAK,sBACL,UAAU,uBACR,QAAQ,OAAO,mBAAmB;;;;;;;;;;;;;;;EAerC,aACC,YAAY,yBAAyB,2BACrC,UAAU,0BACR,QAAQ,OAAO,mBAAmB;;;;;;;;;;;;;;;;EAgBrC,OACC,YAAY,yBAAyB,2BACrC,UAAU,6BACR,QAAQ,OAAO,mBAAmB;;;;;;;;;;;;;;;;;;;;;;qBAuBzB;;WAGI,cAAc;WACd,OAAO;;;;;;;;EASvB,YAAY,SAAS"}
1
+ {"version":3,"file":"luau-execution.d.mts","names":[],"sources":["../src/domains/cloud-v2/luau-execution-task-binary-inputs/types.ts","../src/resources/luau-execution/capacity-error.ts","../src/resources/luau-execution/client.ts"],"mappings":";;;;;;;;;UAOiB;;WAEP;;WAEA;;;;;;;;UASO;;;;WAIP;;WAEA;;;;;;;;;;;;;;;;;;;;;;;qBCKG,mCAAmC;;WAE/B,UAAU,cAAc;oBACf;;;;;;EAOzB,YAAY,UAAU,cAAc;;;;;;;;;UC0BpB;;;;;;;;;;;;;;EAchB,OACC,YAAY,6BACZ,UAAU,iBACR,QAAQ,OAAO,8BAA8B;;;;;;;;;;UAWhC;;;;;;;;;;;;;EAahB,IACC,YAAY,eACZ,UAAU,iBACR,QAAQ,OAAO,mBAAmB;;;;;;;;;;;;;;EAcrC,SACC,YAAY,oBACZ,UAAU,iBACR,QAAQ,OAAO,SAAS;;;;;;;;;;;;;;EAc3B,cACC,KAAK,sBACL,UAAU,uBACR,QAAQ,OAAO,mBAAmB;;;;;;;;;;;;;;;EAerC,aACC,YAAY,yBAAyB,2BACrC,UAAU,0BACR,QAAQ,OAAO,mBAAmB;;;;;;;;;;;;;;;;EAgBrC,OACC,YAAY,yBAAyB,2BACrC,UAAU,6BACR,QAAQ,OAAO,mBAAmB;;;;;;;;;;;;;;;;;;;;;;qBAuBzB;;WAGI,cAAc;WACd,OAAO;;;;;;;;EASvB,YAAY,SAAS"}