@bedrock-rbx/ocale 0.1.0-beta.19 → 0.1.0-beta.20

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.
@@ -1 +1 @@
1
- {"version":3,"file":"locales.mjs","names":[],"sources":["../src/locales/data.generated.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 satisfies ReadonlyArray<RobloxCreatorLocale>;\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"],"mappings":";;;;;;;;AA0BA,MAAa,yBAAyB;CACrC;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAA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f,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"}
1
+ {"version":3,"file":"locales.mjs","names":[],"sources":["../src/locales/data.generated.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"],"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,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;CACA;EACC,QAAQ;EACR,cAAc;EACd,MAAM;EACN,YAAY;EACZ,eAAe;EACf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AA4B;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;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"}
@@ -1 +1 @@
1
- {"version":3,"file":"places.mjs","names":["#inner"],"sources":["../src/domains/cloud-v2/places/builders.ts","../src/domains/cloud-v2/places/operations.ts","../src/domains/cloud-v2/places/parsers.ts","../src/domains/universes/places/builders.ts","../src/domains/universes/places/operations.ts","../src/domains/universes/places/parsers.ts","../src/resources/places/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../client/types.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { UpdatePlaceParameters } from \"./types.ts\";\n\nconst NON_UPDATABLE_KEYS: ReadonlySet<string> = new Set([\"placeId\", \"universeId\"]);\n\n/**\n * Builds a `PATCH` request for the Open Cloud \"update place\" endpoint.\n * Derives the `updateMask` query string from the keys present on\n * `parameters` (excluding the identifiers) and emits a JSON body\n * containing those same fields.\n *\n * @param parameters - The universe and place identifiers plus the fields\n * to update.\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when no updatable fields were supplied.\n */\nexport function buildUpdateRequest(\n\tparameters: UpdatePlaceParameters,\n): Result<HttpRequest, ValidationError> {\n\tconst fieldKeys = extractUpdateFieldKeys(parameters);\n\n\tif (fieldKeys.length === 0) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Update must include at least one field\", {\n\t\t\t\tcode: \"empty_update\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst body = Object.fromEntries(\n\t\tfieldKeys.map((key): readonly [string, unknown] => [key, Reflect.get(parameters, key)]),\n\t);\n\tconst updateMask = fieldKeys.join(\",\");\n\tconst { placeId, universeId } = parameters;\n\treturn {\n\t\tdata: {\n\t\t\tbody,\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tmethod: \"PATCH\",\n\t\t\turl: `/cloud/v2/universes/${universeId}/places/${placeId}?updateMask=${updateMask}`,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction extractUpdateFieldKeys(parameters: UpdatePlaceParameters): ReadonlyArray<string> {\n\treturn Object.keys(parameters).filter((key) => !NON_UPDATABLE_KEYS.has(key));\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst UPDATE_PER_MINUTE = 100;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for updating a place, from the Open Cloud\n * OpenAPI schema (100 requests per minute per API key owner). Keyed\n * independently from the publish operation so publish and update do\n * not share a queue; upstream quota accounting is not documented as\n * shared and the conservative default is fewer cross-method\n * contention surprises.\n */\nexport const UPDATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: UPDATE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"places.update\",\n});\n\n/**\n * Scopes required to update a place's metadata, sourced from\n * `x-roblox-scopes` on the `Cloud_UpdatePlace` operation in the vendored\n * OpenAPI schema.\n */\nexport const UPDATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe.place:write\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { Place } from \"./types.ts\";\nimport type { PlaceWire } from \"./wire.ts\";\n\nconst MALFORMED_PLACE_MESSAGE = \"Malformed place response\";\n\ninterface ToPlaceArgs {\n\treadonly id: string;\n\treadonly body: PlaceWire;\n\treadonly universeId: string;\n}\n\n/**\n * Parses a successful Open Cloud `Place` response body into the public\n * {@link Place} shape.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link Place}, or an\n * {@link ApiError} when the body does not match the wire schema.\n */\nexport function parsePlaceResponse(response: HttpResponse): Result<Place, ApiError> {\n\tconst { body, status: statusCode } = response;\n\n\tif (!isPlaceWire(body)) {\n\t\treturn malformedPlace(statusCode);\n\t}\n\n\tconst match = /^universes\\/(\\d+)\\/places\\/(\\d+)$/.exec(body.path);\n\tconst universeId = match?.[1];\n\tconst id = match?.[2];\n\tif (id === undefined || universeId === undefined) {\n\t\treturn malformedPlace(statusCode);\n\t}\n\n\treturn { data: toPlace({ id, body, universeId }), success: true };\n}\n\nfunction malformedPlace(statusCode: number): Result<Place, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_PLACE_MESSAGE, { statusCode }),\n\t\tsuccess: false,\n\t};\n}\n\nfunction toPlace(args: ToPlaceArgs): Place {\n\tconst { id, body, universeId } = args;\n\treturn {\n\t\tid,\n\t\tcreatedAt: new Date(body.createTime),\n\t\tdescription: body.description,\n\t\tdisplayName: body.displayName,\n\t\troot: body.root ?? false,\n\t\tserverSize: body.serverSize ?? undefined,\n\t\tuniverseId,\n\t\tuniverseRuntimeCreation: body.universeRuntimeCreation ?? false,\n\t\tupdatedAt: new Date(body.updateTime),\n\t};\n}\n\nfunction hasValidPlaceRequired(body: Record<string, unknown>): boolean {\n\treturn (\n\t\ttypeof body[\"path\"] === \"string\" &&\n\t\tisDateTimeString(body[\"createTime\"]) &&\n\t\tisDateTimeString(body[\"updateTime\"]) &&\n\t\ttypeof body[\"displayName\"] === \"string\" &&\n\t\ttypeof body[\"description\"] === \"string\"\n\t);\n}\n\nfunction isOptionalBoolean(value: unknown): boolean {\n\treturn value === undefined || value === null || typeof value === \"boolean\";\n}\n\nfunction hasValidPlaceOptional(body: Record<string, unknown>): boolean {\n\tconst serverSize = body[\"serverSize\"] ?? undefined;\n\treturn (\n\t\t(serverSize === undefined || typeof serverSize === \"number\") &&\n\t\tisOptionalBoolean(body[\"root\"]) &&\n\t\tisOptionalBoolean(body[\"universeRuntimeCreation\"])\n\t);\n}\n\nfunction isPlaceWire(body: unknown): body is PlaceWire {\n\treturn isRecord(body) && hasValidPlaceRequired(body) && hasValidPlaceOptional(body);\n}\n","import type { HttpRequest } from \"../../../client/types.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport { matchesSignature, RBXL_SIGNATURE, RBXLX_SIGNATURE } from \"./signatures.ts\";\nimport type { PublishParameters } from \"./types.ts\";\n\n/**\n * Whether a publish call writes a live (`Published`) or draft (`Saved`)\n * version. Surfaces only as the `versionType` query string on the\n * underlying HTTP request.\n */\ntype VersionType = \"Published\" | \"Saved\";\n\nconst CONTENT_TYPE_BY_FORMAT: Readonly<Record<PublishParameters[\"format\"], string>> = {\n\trbxl: \"application/octet-stream\",\n\trbxlx: \"application/xml\",\n};\n\n/**\n * Builds a `POST` request for the Open Cloud \"publish place version\"\n * endpoint. Performs two local validations before producing any\n * {@link HttpRequest}: a non-empty body check and a magic-byte check\n * that the bytes' actual format matches `parameters.format`.\n *\n * @param parameters - Universe and place identifiers, the place file\n * bytes, and the declared `format` of those bytes.\n * @param versionType - `\"Published\"` for `publish()`, `\"Saved\"` for\n * `save()`; baked into the `?versionType=` query string.\n * @returns A success result wrapping the request on success, or a\n * {@link ValidationError} when the body is empty or its magic bytes\n * disagree with `parameters.format`.\n */\nexport function buildPublishRequest(\n\tparameters: PublishParameters,\n\tversionType: VersionType,\n): Result<HttpRequest, ValidationError> {\n\tconst { body, format, placeId, universeId } = parameters;\n\n\tif (body.length === 0) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Place body is empty\", { code: \"empty_body\" }),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst expectedSignature = format === \"rbxl\" ? RBXL_SIGNATURE : RBXLX_SIGNATURE;\n\tif (!matchesSignature(body, expectedSignature)) {\n\t\treturn {\n\t\t\terr: new ValidationError(`Place body does not match the declared \"${format}\" format`, {\n\t\t\t\tcode: \"format_mismatch\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tbody,\n\t\t\theaders: { \"content-type\": CONTENT_TYPE_BY_FORMAT[format] },\n\t\t\tmethod: \"POST\",\n\t\t\turl: `/universes/v1/${universeId}/places/${placeId}/versions?versionType=${versionType}`,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/**\n * Per-second request ceiling for publishing or saving a place version,\n * from the Open Cloud OpenAPI schema (30 requests per minute, expressed\n * here as `0.5` per second). The publish and save methods both reference\n * this constant so that a single per-API-key queue serves both, matching\n * Roblox's server-side accounting which counts both call types against\n * the same per-minute quota.\n */\nexport const PUBLISH_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 0.5,\n\toperationKey: \"places.publishVersion\",\n});\n\n/**\n * Scopes required to publish or save a place version, sourced from\n * `x-roblox-scopes` on the `Places_CreatePlaceVersionApiKey` operation\n * in the vendored OpenAPI schema.\n */\nexport const PUBLISH_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe-places:write\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { PlaceVersion } from \"./types.ts\";\nimport type { PlaceVersionWire } from \"./wire.ts\";\n\n/**\n * Parses a successful publish-version response into the public\n * {@link PlaceVersion} shape. The Roblox endpoint sometimes returns the\n * JSON-shaped body under a `text/plain` `Content-Type`, so the body may\n * arrive either pre-decoded as a JSON object or still in its raw string\n * form; both are accepted here.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link PlaceVersion}, or\n * an {@link ApiError} when the body is malformed or its `versionNumber`\n * field is missing/wrong-typed.\n */\nexport function parsePublishResponse(response: HttpResponse): Result<PlaceVersion, ApiError> {\n\tconst { body, status: statusCode } = response;\n\n\tconst decodeResult = decodeBody(body, statusCode);\n\tif (!decodeResult.success) {\n\t\treturn decodeResult;\n\t}\n\n\tif (!isPlaceVersionWire(decodeResult.data)) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed publish response\", { statusCode }),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn {\n\t\tdata: { versionNumber: decodeResult.data.versionNumber },\n\t\tsuccess: true,\n\t};\n}\n\nfunction decodeBody(body: unknown, statusCode: number): Result<unknown, ApiError> {\n\tif (typeof body !== \"string\") {\n\t\treturn { data: body, success: true };\n\t}\n\n\ttry {\n\t\treturn { data: JSON.parse(body), success: true };\n\t} catch {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed publish response\", { statusCode }),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n}\n\nfunction isPlaceVersionWire(value: unknown): value is PlaceVersionWire {\n\tif (!isRecord(value)) {\n\t\treturn false;\n\t}\n\n\treturn typeof value[\"versionNumber\"] === \"number\";\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport { LIST_LOGS_SPEC } from \"../../domains/cloud-v2/luau-execution-task-logs/specs.ts\";\nimport type {\n\tListLogsParameters,\n\tLogPage,\n} from \"../../domains/cloud-v2/luau-execution-task-logs/types.ts\";\nimport {\n\tGET_SPEC,\n\tSUBMIT_HEAD_SPEC,\n\tSUBMIT_VERSION_SPEC,\n} from \"../../domains/cloud-v2/luau-execution-tasks/specs.ts\";\nimport type {\n\tGetParameters,\n\tLuauExecutionTask,\n\tLuauExecutionTaskRef,\n\tSubmitAtHeadParameters,\n\tSubmitAtVersionParameters,\n} from \"../../domains/cloud-v2/luau-execution-tasks/types.ts\";\nimport { buildUpdateRequest } from \"../../domains/cloud-v2/places/builders.ts\";\nimport {\n\tUPDATE_OPERATION_LIMIT,\n\tUPDATE_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/places/operations.ts\";\nimport { parsePlaceResponse } from \"../../domains/cloud-v2/places/parsers.ts\";\nimport type { Place, UpdatePlaceParameters } from \"../../domains/cloud-v2/places/types.ts\";\nimport { buildPublishRequest } from \"../../domains/universes/places/builders.ts\";\nimport {\n\tPUBLISH_OPERATION_LIMIT,\n\tPUBLISH_REQUIRED_SCOPES,\n} from \"../../domains/universes/places/operations.ts\";\nimport { parsePublishResponse } from \"../../domains/universes/places/parsers.ts\";\nimport type { PlaceVersion, PublishParameters } from \"../../domains/universes/places/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport { ResourceClient, type ResourceMethodSpec } from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\nimport { buildPollDeps, submitAndPoll } from \"../luau-execution/polling-helpers.ts\";\nimport { pollUntilDoneCore, type PollUntilDoneOptions } from \"../luau-execution/polling.ts\";\n\n/**\n * Operation Group exposed by {@link PlacesClient} as the\n * `luauExecution` namespace. Provides `submit` to queue a Luau script,\n * `get` to fetch a task's current state, and `listLogs` to retrieve\n * structured log messages. Shares the same dispatch wiring as the\n * top-level `LuauExecutionClient` exposed at\n * `@bedrock-rbx/ocale/luau-execution`.\n *\n * @since 0.1.0\n */\nexport interface LuauExecutionHandle {\n\t/**\n\t * Fetches the current state of a previously-submitted Luau\n\t * execution task. Uses idempotent retry semantics for both 429 and\n\t * 5xx.\n\t *\n\t * @param parameters - The task ref plus an optional `view` selector.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link LuauExecutionTask} or the {@link OpenCloudError} that\n\t * caused the request to fail.\n\t */\n\tget(\n\t\tparameters: GetParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Lists one page of structured log messages produced by a\n\t * previously-submitted Luau execution task. Messages from multiple\n\t * server-side chunks are flattened into a single ordered array.\n\t * Uses idempotent retry semantics for both 429 and 5xx.\n\t *\n\t * @param parameters - The task ref and optional pagination controls\n\t * (`pageSize`, `pageToken`).\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link LogPage} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tlistLogs(\n\t\tparameters: ListLogsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LogPage, OpenCloudError>>;\n\t/**\n\t * Polls `get` with `view=BASIC` on a configurable backoff schedule until\n\t * the task reaches a terminal state, the wall-clock budget is exhausted,\n\t * or the supplied `AbortSignal` fires. Returns the terminal task on\n\t * success.\n\t *\n\t * @param ref - Reference to the task to poll, typically returned by `submit`.\n\t * @param options - Polling and per-request overrides.\n\t * @returns A {@link Result} wrapping the terminal {@link LuauExecutionTask},\n\t * or an error if aborted, timed out, or the transport fails.\n\t */\n\tpollUntilDone(\n\t\tref: LuauExecutionTaskRef,\n\t\toptions?: PollUntilDoneOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Submits a Luau script and polls `get` with `view=BASIC` until the\n\t * task reaches a terminal state, the wall-clock budget is exhausted,\n\t * or the supplied `AbortSignal` fires. Combines `submit` and\n\t * `pollUntilDone` in one call.\n\t *\n\t * @param parameters - The same input accepted by `submit`.\n\t * @param options - Polling and per-request overrides.\n\t * @returns A {@link Result} wrapping the terminal\n\t * {@link LuauExecutionTask}, or an error if submit fails, the task\n\t * is aborted, timed out, or the transport fails.\n\t */\n\trunUntilDone(\n\t\tparameters: SubmitAtHeadParameters | SubmitAtVersionParameters,\n\t\toptions?: PollUntilDoneOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Submits a Luau script for execution against a place. Dispatches\n\t * to the head-version URL when `versionId` is omitted, or to the\n\t * specific-version URL when one is supplied. Both URL shapes share\n\t * one rate-limit queue and one required-scope set.\n\t *\n\t * @param parameters - The universe and place identifiers, the\n\t * script to run, an optional `versionId`, and any other writable\n\t * submit fields.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link LuauExecutionTask} or the {@link OpenCloudError} that\n\t * caused the request to fail.\n\t */\n\tsubmit(\n\t\tparameters: SubmitAtHeadParameters | SubmitAtVersionParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n}\n\nfunction makePublishSpec(\n\tversionType: \"Published\" | \"Saved\",\n): ResourceMethodSpec<PublishParameters, PlaceVersion> {\n\treturn Object.freeze({\n\t\tbuildRequest: (parameters: PublishParameters) =>\n\t\t\tbuildPublishRequest(parameters, versionType),\n\t\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\t\tmethodKind: \"create\",\n\t\toperationLimit: PUBLISH_OPERATION_LIMIT,\n\t\tparse: parsePublishResponse,\n\t\trequiredScopes: PUBLISH_REQUIRED_SCOPES,\n\t});\n}\n\nconst PUBLISH_SPEC = makePublishSpec(\"Published\");\nconst SAVE_SPEC = makePublishSpec(\"Saved\");\n\nconst UPDATE_SPEC: ResourceMethodSpec<UpdatePlaceParameters, Place> = Object.freeze({\n\tbuildRequest: buildUpdateRequest,\n\tmethodDefaults: {},\n\tmethodKind: \"idempotent\",\n\toperationLimit: UPDATE_OPERATION_LIMIT,\n\tparse: parsePlaceResponse,\n\trequiredScopes: UPDATE_REQUIRED_SCOPES,\n});\n\n/**\n * Public client for the Roblox Open Cloud `Place` resource. Covers\n * place-version publishing (`publish`, `save`), place-configuration\n * updates (`update`), and the Luau execution Operation Group\n * (`luauExecution.submit`, `luauExecution.get`). Every method returns\n * a {@link Result} so callers handle failure explicitly; no thrown\n * {@link OpenCloudError} ever escapes the client.\n *\n * Publishing or saving a 5xx-failed place version is not retried\n * automatically: Roblox does not support idempotency keys, so a retry\n * could publish a duplicate version unnoticed. Callers that *can* detect\n * duplicates externally may opt back into 5xx retry per-call by passing\n * `retryableStatuses` on the second argument. The `update` method, by\n * contrast, is idempotent and retries both 429 and 5xx automatically.\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { PlacesClient } from \"@bedrock-rbx/ocale/places\";\n *\n * const client = new PlacesClient({ apiKey: \"your-key\" });\n * expect(client).toBeInstanceOf(PlacesClient);\n * ```\n */\nexport class PlacesClient {\n\treadonly #inner: ResourceClient;\n\n\tpublic readonly luauExecution: LuauExecutionHandle;\n\n\t/**\n\t * Creates a new {@link PlacesClient}. Configuration is frozen on\n\t * construction; per-request overrides are accepted on each method.\n\t *\n\t * @param options - Client-level configuration including the API key.\n\t */\n\tconstructor(options: OpenCloudClientOptions) {\n\t\tthis.#inner = new ResourceClient(options);\n\t\tthis.luauExecution = createLuauExecutionHandle(this.#inner);\n\t}\n\n\t/**\n\t * Publishes a new live version of a place.\n\t *\n\t * No default request timeout applies to this upload; pass `options.timeout`\n\t * to set a per-call deadline.\n\t *\n\t * @param parameters - Universe and place identifiers, the place file\n\t * bytes, and their declared `format`.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link PlaceVersion}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async publish(\n\t\tparameters: PublishParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<PlaceVersion, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: PUBLISH_SPEC });\n\t}\n\n\t/**\n\t * Saves a new draft version of a place. Identical to {@link publish}\n\t * except the resulting version is not made live; consumers can list or\n\t * promote it later. Shares a single per-API-key rate-limit queue with\n\t * `publish` because Roblox attributes both calls to the same per-minute\n\t * quota.\n\t *\n\t * No default request timeout applies to this upload; pass `options.timeout`\n\t * to set a per-call deadline.\n\t *\n\t * @param parameters - Universe and place identifiers, the place file\n\t * bytes, and their declared `format`.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link PlaceVersion}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async save(\n\t\tparameters: PublishParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<PlaceVersion, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: SAVE_SPEC });\n\t}\n\n\t/**\n\t * Partially updates a place's configuration. The fields supplied on\n\t * `parameters` (excluding the identifiers) are forwarded to the\n\t * server via a Google-style `updateMask`; unmentioned fields are\n\t * left untouched. The universe's root place is the canonical place\n\t * to update when changing a universe's description or display name:\n\t * both are derived server-side from the root place.\n\t *\n\t * @param parameters - The universe and place identifiers and the\n\t * fields to update. At least one writable field must be supplied.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link Place} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async update(\n\t\tparameters: UpdatePlaceParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<Place, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: UPDATE_SPEC });\n\t}\n}\n\nfunction createLuauExecutionHandle(inner: ResourceClient): LuauExecutionHandle {\n\treturn {\n\t\tasync get(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: GET_SPEC });\n\t\t},\n\t\tasync listLogs(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: LIST_LOGS_SPEC });\n\t\t},\n\t\tasync pollUntilDone(ref, options = {}) {\n\t\t\treturn pollUntilDoneCore(buildPollDeps(inner, { options, ref }), options);\n\t\t},\n\t\tasync runUntilDone(parameters, options = {}) {\n\t\t\treturn submitAndPoll(inner, { options, parameters });\n\t\t},\n\t\tasync submit(parameters, options) {\n\t\t\tif (\"versionId\" in parameters) {\n\t\t\t\treturn inner.execute({ options, parameters, spec: SUBMIT_VERSION_SPEC });\n\t\t\t}\n\n\t\t\treturn inner.execute({ options, parameters, spec: SUBMIT_HEAD_SPEC });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;AAKA,MAAM,qBAA0C,IAAI,IAAI,CAAC,WAAW,YAAY,CAAC;;;;;;;;;;;;AAajF,SAAgB,mBACf,YACuC;CACvC,MAAM,YAAY,uBAAuB,UAAU;CAEnD,IAAI,UAAU,WAAW,GACxB,OAAO;EACN,KAAK,IAAI,gBAAgB,0CAA0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ACrE;CACD;AACD"}
1
+ {"version":3,"file":"places.mjs","names":["#inner"],"sources":["../src/domains/cloud-v2/places/builders.ts","../src/domains/cloud-v2/places/operations.ts","../src/domains/cloud-v2/places/parsers.ts","../src/domains/universes/places/builders.ts","../src/domains/universes/places/operations.ts","../src/domains/universes/places/parsers.ts","../src/resources/places/client.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../client/types.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { UpdatePlaceParameters } from \"./types.ts\";\n\nconst NON_UPDATABLE_KEYS: ReadonlySet<string> = new Set([\"placeId\", \"universeId\"]);\n\n/**\n * Builds a `PATCH` request for the Open Cloud \"update place\" endpoint.\n * Derives the `updateMask` query string from the keys present on\n * `parameters` (excluding the identifiers) and emits a JSON body\n * containing those same fields.\n *\n * @param parameters - The universe and place identifiers plus the fields\n * to update.\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when no updatable fields were supplied.\n */\nexport function buildUpdateRequest(\n\tparameters: UpdatePlaceParameters,\n): Result<HttpRequest, ValidationError> {\n\tconst fieldKeys = extractUpdateFieldKeys(parameters);\n\n\tif (fieldKeys.length === 0) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Update must include at least one field\", {\n\t\t\t\tcode: \"empty_update\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst body = Object.fromEntries(\n\t\tfieldKeys.map((key): readonly [string, unknown] => [key, Reflect.get(parameters, key)]),\n\t);\n\tconst updateMask = fieldKeys.join(\",\");\n\tconst { placeId, universeId } = parameters;\n\treturn {\n\t\tdata: {\n\t\t\tbody,\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tmethod: \"PATCH\",\n\t\t\turl: `/cloud/v2/universes/${universeId}/places/${placeId}?updateMask=${updateMask}`,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction extractUpdateFieldKeys(parameters: UpdatePlaceParameters): ReadonlyArray<string> {\n\treturn Object.keys(parameters).filter((key) => !NON_UPDATABLE_KEYS.has(key));\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst UPDATE_PER_MINUTE = 100;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for updating a place, from the Open Cloud\n * OpenAPI schema (100 requests per minute per API key owner). Keyed\n * independently from the publish operation so publish and update do\n * not share a queue; upstream quota accounting is not documented as\n * shared and the conservative default is fewer cross-method\n * contention surprises.\n */\nexport const UPDATE_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: UPDATE_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"places.update\",\n});\n\n/**\n * Scopes required to update a place's metadata, sourced from\n * `x-roblox-scopes` on the `Cloud_UpdatePlace` operation in the vendored\n * OpenAPI schema.\n */\nexport const UPDATE_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe.place:write\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { Place } from \"./types.ts\";\nimport type { PlaceWire } from \"./wire.ts\";\n\nconst MALFORMED_PLACE_MESSAGE = \"Malformed place response\";\n\ninterface ToPlaceArgs {\n\treadonly id: string;\n\treadonly body: PlaceWire;\n\treadonly universeId: string;\n}\n\n/**\n * Parses a successful Open Cloud `Place` response body into the public\n * {@link Place} shape.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link Place}, or an\n * {@link ApiError} when the body does not match the wire schema.\n */\nexport function parsePlaceResponse(response: HttpResponse): Result<Place, ApiError> {\n\tconst { body, status: statusCode } = response;\n\n\tif (!isPlaceWire(body)) {\n\t\treturn malformedPlace(statusCode);\n\t}\n\n\tconst match = /^universes\\/(\\d+)\\/places\\/(\\d+)$/.exec(body.path);\n\tconst universeId = match?.[1];\n\tconst id = match?.[2];\n\tif (id === undefined || universeId === undefined) {\n\t\treturn malformedPlace(statusCode);\n\t}\n\n\treturn { data: toPlace({ id, body, universeId }), success: true };\n}\n\nfunction malformedPlace(statusCode: number): Result<Place, ApiError> {\n\treturn {\n\t\terr: new ApiError(MALFORMED_PLACE_MESSAGE, { statusCode }),\n\t\tsuccess: false,\n\t};\n}\n\nfunction toPlace(args: ToPlaceArgs): Place {\n\tconst { id, body, universeId } = args;\n\treturn {\n\t\tid,\n\t\tcreatedAt: new Date(body.createTime),\n\t\tdescription: body.description,\n\t\tdisplayName: body.displayName,\n\t\troot: body.root ?? false,\n\t\tserverSize: body.serverSize ?? undefined,\n\t\tuniverseId,\n\t\tuniverseRuntimeCreation: body.universeRuntimeCreation ?? false,\n\t\tupdatedAt: new Date(body.updateTime),\n\t};\n}\n\nfunction hasValidPlaceRequired(body: Record<string, unknown>): boolean {\n\treturn (\n\t\ttypeof body[\"path\"] === \"string\" &&\n\t\tisDateTimeString(body[\"createTime\"]) &&\n\t\tisDateTimeString(body[\"updateTime\"]) &&\n\t\ttypeof body[\"displayName\"] === \"string\" &&\n\t\ttypeof body[\"description\"] === \"string\"\n\t);\n}\n\nfunction isOptionalBoolean(value: unknown): boolean {\n\treturn value === undefined || value === null || typeof value === \"boolean\";\n}\n\nfunction hasValidPlaceOptional(body: Record<string, unknown>): boolean {\n\tconst serverSize = body[\"serverSize\"] ?? undefined;\n\treturn (\n\t\t(serverSize === undefined || typeof serverSize === \"number\") &&\n\t\tisOptionalBoolean(body[\"root\"]) &&\n\t\tisOptionalBoolean(body[\"universeRuntimeCreation\"])\n\t);\n}\n\nfunction isPlaceWire(body: unknown): body is PlaceWire {\n\treturn isRecord(body) && hasValidPlaceRequired(body) && hasValidPlaceOptional(body);\n}\n","import type { HttpRequest } from \"../../../client/types.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport { matchesSignature, RBXL_SIGNATURE, RBXLX_SIGNATURE } from \"./signatures.ts\";\nimport type { PublishParameters } from \"./types.ts\";\n\n/**\n * Whether a publish call writes a live (`Published`) or draft (`Saved`)\n * version. Surfaces only as the `versionType` query string on the\n * underlying HTTP request.\n */\ntype VersionType = \"Published\" | \"Saved\";\n\nconst CONTENT_TYPE_BY_FORMAT: Readonly<Record<PublishParameters[\"format\"], string>> = {\n\trbxl: \"application/octet-stream\",\n\trbxlx: \"application/xml\",\n};\n\n/**\n * Builds a `POST` request for the Open Cloud \"publish place version\"\n * endpoint. Performs two local validations before producing any\n * {@link HttpRequest}: a non-empty body check and a magic-byte check\n * that the bytes' actual format matches `parameters.format`.\n *\n * @param parameters - Universe and place identifiers, the place file\n * bytes, and the declared `format` of those bytes.\n * @param versionType - `\"Published\"` for `publish()`, `\"Saved\"` for\n * `save()`; baked into the `?versionType=` query string.\n * @returns A success result wrapping the request on success, or a\n * {@link ValidationError} when the body is empty or its magic bytes\n * disagree with `parameters.format`.\n */\nexport function buildPublishRequest(\n\tparameters: PublishParameters,\n\tversionType: VersionType,\n): Result<HttpRequest, ValidationError> {\n\tconst { body, format, placeId, universeId } = parameters;\n\n\tif (body.length === 0) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Place body is empty\", { code: \"empty_body\" }),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst expectedSignature = format === \"rbxl\" ? RBXL_SIGNATURE : RBXLX_SIGNATURE;\n\tif (!matchesSignature(body, expectedSignature)) {\n\t\treturn {\n\t\t\terr: new ValidationError(`Place body does not match the declared \"${format}\" format`, {\n\t\t\t\tcode: \"format_mismatch\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tbody,\n\t\t\theaders: { \"content-type\": CONTENT_TYPE_BY_FORMAT[format] },\n\t\t\tmethod: \"POST\",\n\t\t\turl: `/universes/v1/${universeId}/places/${placeId}/versions?versionType=${versionType}`,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\n/**\n * Per-second request ceiling for publishing or saving a place version,\n * from the Open Cloud OpenAPI schema (30 requests per minute, expressed\n * here as `0.5` per second). The publish and save methods both reference\n * this constant so that a single per-API-key queue serves both, matching\n * Roblox's server-side accounting which counts both call types against\n * the same per-minute quota.\n */\nexport const PUBLISH_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: 0.5,\n\toperationKey: \"places.publishVersion\",\n});\n\n/**\n * Scopes required to publish or save a place version, sourced from\n * `x-roblox-scopes` on the `Places_CreatePlaceVersionApiKey` operation\n * in the vendored OpenAPI schema.\n */\nexport const PUBLISH_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe-places:write\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { PlaceVersion } from \"./types.ts\";\nimport type { PlaceVersionWire } from \"./wire.ts\";\n\n/**\n * Parses a successful publish-version response into the public\n * {@link PlaceVersion} shape. The Roblox endpoint sometimes returns the\n * JSON-shaped body under a `text/plain` `Content-Type`, so the body may\n * arrive either pre-decoded as a JSON object or still in its raw string\n * form; both are accepted here.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link PlaceVersion}, or\n * an {@link ApiError} when the body is malformed or its `versionNumber`\n * field is missing/wrong-typed.\n */\nexport function parsePublishResponse(response: HttpResponse): Result<PlaceVersion, ApiError> {\n\tconst { body, status: statusCode } = response;\n\n\tconst decodeResult = decodeBody(body, statusCode);\n\tif (!decodeResult.success) {\n\t\treturn decodeResult;\n\t}\n\n\tif (!isPlaceVersionWire(decodeResult.data)) {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed publish response\", { statusCode }),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\treturn {\n\t\tdata: { versionNumber: decodeResult.data.versionNumber },\n\t\tsuccess: true,\n\t};\n}\n\nfunction decodeBody(body: unknown, statusCode: number): Result<unknown, ApiError> {\n\tif (typeof body !== \"string\") {\n\t\treturn { data: body, success: true };\n\t}\n\n\ttry {\n\t\treturn { data: JSON.parse(body), success: true };\n\t} catch {\n\t\treturn {\n\t\t\terr: new ApiError(\"Malformed publish response\", { statusCode }),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n}\n\nfunction isPlaceVersionWire(value: unknown): value is PlaceVersionWire {\n\tif (!isRecord(value)) {\n\t\treturn false;\n\t}\n\n\treturn typeof value[\"versionNumber\"] === \"number\";\n}\n","import type { OpenCloudClientOptions, RequestOptions } from \"../../client/types.ts\";\nimport { LIST_LOGS_SPEC } from \"../../domains/cloud-v2/luau-execution-task-logs/specs.ts\";\nimport type {\n\tListLogsParameters,\n\tLogPage,\n} from \"../../domains/cloud-v2/luau-execution-task-logs/types.ts\";\nimport {\n\tGET_SPEC,\n\tSUBMIT_HEAD_SPEC,\n\tSUBMIT_VERSION_SPEC,\n} from \"../../domains/cloud-v2/luau-execution-tasks/specs.ts\";\nimport type {\n\tGetParameters,\n\tLuauExecutionTask,\n\tLuauExecutionTaskRef,\n\tSubmitAtHeadParameters,\n\tSubmitAtVersionParameters,\n} from \"../../domains/cloud-v2/luau-execution-tasks/types.ts\";\nimport { buildUpdateRequest } from \"../../domains/cloud-v2/places/builders.ts\";\nimport {\n\tUPDATE_OPERATION_LIMIT,\n\tUPDATE_REQUIRED_SCOPES,\n} from \"../../domains/cloud-v2/places/operations.ts\";\nimport { parsePlaceResponse } from \"../../domains/cloud-v2/places/parsers.ts\";\nimport type { Place, UpdatePlaceParameters } from \"../../domains/cloud-v2/places/types.ts\";\nimport { buildPublishRequest } from \"../../domains/universes/places/builders.ts\";\nimport {\n\tPUBLISH_OPERATION_LIMIT,\n\tPUBLISH_REQUIRED_SCOPES,\n} from \"../../domains/universes/places/operations.ts\";\nimport { parsePublishResponse } from \"../../domains/universes/places/parsers.ts\";\nimport type { PlaceVersion, PublishParameters } from \"../../domains/universes/places/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { CREATE_METHOD_DEFAULTS } from \"../../internal/http/retry.ts\";\nimport { ResourceClient, type ResourceMethodSpec } from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\nimport { buildPollDeps, submitAndPoll } from \"../luau-execution/polling-helpers.ts\";\nimport { pollUntilDoneCore, type PollUntilDoneOptions } from \"../luau-execution/polling.ts\";\n\n/**\n * Operation Group exposed by {@link PlacesClient} as the\n * `luauExecution` namespace. Provides `submit` to queue a Luau script,\n * `get` to fetch a task's current state, and `listLogs` to retrieve\n * structured log messages. Shares the same dispatch wiring as the\n * top-level `LuauExecutionClient` exposed at\n * `@bedrock-rbx/ocale/luau-execution`.\n *\n * @since 0.1.0\n */\nexport interface LuauExecutionHandle {\n\t/**\n\t * Fetches the current state of a previously-submitted Luau\n\t * execution task. Uses idempotent retry semantics for both 429 and\n\t * 5xx.\n\t *\n\t * @param parameters - The task ref plus an optional `view` selector.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link LuauExecutionTask} or the {@link OpenCloudError} that\n\t * caused the request to fail.\n\t */\n\tget(\n\t\tparameters: GetParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Lists one page of structured log messages produced by a\n\t * previously-submitted Luau execution task. Messages from multiple\n\t * server-side chunks are flattened into a single ordered array.\n\t * Uses idempotent retry semantics for both 429 and 5xx.\n\t *\n\t * @param parameters - The task ref and optional pagination controls\n\t * (`pageSize`, `pageToken`).\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link LogPage} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tlistLogs(\n\t\tparameters: ListLogsParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LogPage, OpenCloudError>>;\n\t/**\n\t * Polls `get` with `view=BASIC` on a configurable backoff schedule until\n\t * the task reaches a terminal state, the wall-clock budget is exhausted,\n\t * or the supplied `AbortSignal` fires. Returns the terminal task on\n\t * success.\n\t *\n\t * @param ref - Reference to the task to poll, typically returned by `submit`.\n\t * @param options - Polling and per-request overrides.\n\t * @returns A {@link Result} wrapping the terminal {@link LuauExecutionTask},\n\t * or an error if aborted, timed out, or the transport fails.\n\t */\n\tpollUntilDone(\n\t\tref: LuauExecutionTaskRef,\n\t\toptions?: PollUntilDoneOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Submits a Luau script and polls `get` with `view=BASIC` until the\n\t * task reaches a terminal state, the wall-clock budget is exhausted,\n\t * or the supplied `AbortSignal` fires. Combines `submit` and\n\t * `pollUntilDone` in one call.\n\t *\n\t * @param parameters - The same input accepted by `submit`.\n\t * @param options - Polling and per-request overrides.\n\t * @returns A {@link Result} wrapping the terminal\n\t * {@link LuauExecutionTask}, or an error if submit fails, the task\n\t * is aborted, timed out, or the transport fails.\n\t */\n\trunUntilDone(\n\t\tparameters: SubmitAtHeadParameters | SubmitAtVersionParameters,\n\t\toptions?: PollUntilDoneOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/**\n\t * Submits a Luau script for execution against a place. Dispatches\n\t * to the head-version URL when `versionId` is omitted, or to the\n\t * specific-version URL when one is supplied. Both URL shapes share\n\t * one rate-limit queue and one required-scope set.\n\t *\n\t * @param parameters - The universe and place identifiers, the\n\t * script to run, an optional `versionId`, and any other writable\n\t * submit fields.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed\n\t * {@link LuauExecutionTask} or the {@link OpenCloudError} that\n\t * caused the request to fail.\n\t */\n\tsubmit(\n\t\tparameters: SubmitAtHeadParameters | SubmitAtVersionParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<LuauExecutionTask, OpenCloudError>>;\n}\n\nfunction makePublishSpec(\n\tversionType: \"Published\" | \"Saved\",\n): ResourceMethodSpec<PublishParameters, PlaceVersion> {\n\treturn Object.freeze({\n\t\tbuildRequest: (parameters: PublishParameters) =>\n\t\t\tbuildPublishRequest(parameters, versionType),\n\t\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\t\tmethodKind: \"create\",\n\t\toperationLimit: PUBLISH_OPERATION_LIMIT,\n\t\tparse: parsePublishResponse,\n\t\trequiredScopes: PUBLISH_REQUIRED_SCOPES,\n\t});\n}\n\nconst PUBLISH_SPEC = makePublishSpec(\"Published\");\nconst SAVE_SPEC = makePublishSpec(\"Saved\");\n\nconst UPDATE_SPEC: ResourceMethodSpec<UpdatePlaceParameters, Place> = Object.freeze({\n\tbuildRequest: buildUpdateRequest,\n\tmethodDefaults: {},\n\tmethodKind: \"idempotent\",\n\toperationLimit: UPDATE_OPERATION_LIMIT,\n\tparse: parsePlaceResponse,\n\trequiredScopes: UPDATE_REQUIRED_SCOPES,\n});\n\n/**\n * Public client for the Roblox Open Cloud `Place` resource. Covers\n * place-version publishing (`publish`, `save`), place-configuration\n * updates (`update`), and the Luau execution Operation Group\n * (`luauExecution.submit`, `luauExecution.get`). Every method returns\n * a {@link Result} so callers handle failure explicitly; no thrown\n * {@link OpenCloudError} ever escapes the client.\n *\n * Publishing or saving a 5xx-failed place version is not retried\n * automatically: Roblox does not support idempotency keys, so a retry\n * could publish a duplicate version unnoticed. Callers that *can* detect\n * duplicates externally may opt back into 5xx retry per-call by passing\n * `retryableStatuses` on the second argument. The `update` method, by\n * contrast, is idempotent and retries both 429 and 5xx automatically.\n *\n * @since 0.1.0\n *\n * @example\n *\n * ```ts\n * import { PlacesClient } from \"@bedrock-rbx/ocale/places\";\n *\n * const client = new PlacesClient({ apiKey: \"your-key\" });\n * expect(client).toBeInstanceOf(PlacesClient);\n * ```\n */\nexport class PlacesClient {\n\treadonly #inner: ResourceClient;\n\n\tpublic readonly luauExecution: LuauExecutionHandle;\n\n\t/**\n\t * Creates a new {@link PlacesClient}. Configuration is frozen on\n\t * construction; per-request overrides are accepted on each method.\n\t *\n\t * @param options - Client-level configuration including the API key.\n\t */\n\tconstructor(options: OpenCloudClientOptions) {\n\t\tthis.#inner = new ResourceClient(options);\n\t\tthis.luauExecution = createLuauExecutionHandle(this.#inner);\n\t}\n\n\t/**\n\t * Publishes a new live version of a place.\n\t *\n\t * No default request timeout applies to this upload; pass `options.timeout`\n\t * to set a per-call deadline.\n\t *\n\t * @param parameters - Universe and place identifiers, the place file\n\t * bytes, and their declared `format`.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link PlaceVersion}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async publish(\n\t\tparameters: PublishParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<PlaceVersion, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: PUBLISH_SPEC });\n\t}\n\n\t/**\n\t * Saves a new draft version of a place. Identical to {@link publish}\n\t * except the resulting version is not made live; consumers can list or\n\t * promote it later. Shares a single per-API-key rate-limit queue with\n\t * `publish` because Roblox attributes both calls to the same per-minute\n\t * quota.\n\t *\n\t * No default request timeout applies to this upload; pass `options.timeout`\n\t * to set a per-call deadline.\n\t *\n\t * @param parameters - Universe and place identifiers, the place file\n\t * bytes, and their declared `format`.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link PlaceVersion}\n\t * or the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async save(\n\t\tparameters: PublishParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<PlaceVersion, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: SAVE_SPEC });\n\t}\n\n\t/**\n\t * Partially updates a place's configuration. The fields supplied on\n\t * `parameters` (excluding the identifiers) are forwarded to the\n\t * server via a Google-style `updateMask`; unmentioned fields are\n\t * left untouched. The universe's root place is the canonical place\n\t * to update when changing a universe's description or display name:\n\t * both are derived server-side from the root place.\n\t *\n\t * @param parameters - The universe and place identifiers and the\n\t * fields to update. At least one writable field must be supplied.\n\t * @param options - Optional per-request overrides (e.g. A different\n\t * {@link OpenCloudClientOptions.apiKey} for this call only).\n\t * @returns A {@link Result} wrapping the parsed {@link Place} or\n\t * the {@link OpenCloudError} that caused the request to fail.\n\t */\n\tpublic async update(\n\t\tparameters: UpdatePlaceParameters,\n\t\toptions?: RequestOptions,\n\t): Promise<Result<Place, OpenCloudError>> {\n\t\treturn this.#inner.execute({ options, parameters, spec: UPDATE_SPEC });\n\t}\n}\n\nfunction createLuauExecutionHandle(inner: ResourceClient): LuauExecutionHandle {\n\treturn {\n\t\tasync get(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: GET_SPEC });\n\t\t},\n\t\tasync listLogs(parameters, options) {\n\t\t\treturn inner.execute({ options, parameters, spec: LIST_LOGS_SPEC });\n\t\t},\n\t\tasync pollUntilDone(ref, options = {}) {\n\t\t\treturn pollUntilDoneCore(buildPollDeps(inner, { options, ref }), options);\n\t\t},\n\t\tasync runUntilDone(parameters, options = {}) {\n\t\t\treturn submitAndPoll(inner, { options, parameters });\n\t\t},\n\t\tasync submit(parameters, options) {\n\t\t\tif (\"versionId\" in parameters) {\n\t\t\t\treturn inner.execute({ options, parameters, spec: SUBMIT_VERSION_SPEC });\n\t\t\t}\n\n\t\t\treturn inner.execute({ options, parameters, spec: SUBMIT_HEAD_SPEC });\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;AAKA,MAAM,qBAA0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AC;EACpD;EACA,MAAM,OAAO,YAAY,SAAS;GACjC,IAAI,eAAe,YAClB,OAAO,MAAM,QAAQ;IAAE;IAAS;IAAY,MAAM;GAAoB,CAAC;GAGxE,OAAO,MAAM,QAAQ;IAAE;IAAS;IAAY,MAAM;GAAiB,CAAC;EACrE;CACD;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"polling-helpers-Cb4j4cq7.mjs","names":["SECONDS_PER_MINUTE","malformed","makeSpec"],"sources":["../src/domains/cloud-v2/luau-execution-task-logs/builders.ts","../src/domains/cloud-v2/luau-execution-task-logs/operations.ts","../src/domains/cloud-v2/luau-execution-task-logs/parsers.ts","../src/domains/cloud-v2/luau-execution-task-logs/specs.ts","../src/domains/cloud-v2/luau-execution-tasks/builders.ts","../src/domains/cloud-v2/luau-execution-tasks/operations.ts","../src/domains/cloud-v2/luau-execution-tasks/parsers.ts","../src/domains/cloud-v2/luau-execution-tasks/specs.ts","../src/resources/luau-execution/polling.ts","../src/resources/luau-execution/polling-helpers.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../client/types.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { ListLogsParameters } from \"./types.ts\";\n\n/**\n * Builds a `GET` request for the Open Cloud \"list Luau execution session\n * task logs\" endpoint. The endpoint requires the maximal x-aep-resource\n * path shape (universe, place, version, session, task), so the supplied\n * ref must include `versionId` and `sessionId`; refs extracted from the\n * narrower path formats are rejected with a {@link ValidationError}.\n *\n * The `view` query parameter is hard-coded to `STRUCTURED` so callers\n * always receive typed structured messages. No public `view` parameter\n * is exposed.\n *\n * @param parameters - Task ref, and optional `pageSize` and `pageToken`\n * pagination controls.\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when the ref is missing `versionId` or\n * `sessionId`.\n */\nexport function buildListLogsRequest(\n\tparameters: ListLogsParameters,\n): Result<HttpRequest, ValidationError> {\n\tconst { pageSize, pageToken, ref } = parameters;\n\tconst { placeId, sessionId, taskId, universeId, versionId } = ref;\n\n\tif (versionId === undefined) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Task ref is missing versionId; cannot list logs\", {\n\t\t\t\tcode: \"incomplete_ref\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tif (sessionId === undefined) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Task ref is missing sessionId; cannot list logs\", {\n\t\t\t\tcode: \"incomplete_ref\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst base = `/cloud/v2/universes/${universeId}/places/${placeId}/versions/${versionId}/luau-execution-sessions/${sessionId}/tasks/${taskId}/logs`;\n\tconst url = `${base}?${buildQuery(pageSize, pageToken).toString()}`;\n\treturn { data: { method: \"GET\", url }, success: true };\n}\n\nfunction buildQuery(pageSize: number | undefined, pageToken: string | undefined): URLSearchParams {\n\tconst query = new URLSearchParams({ view: \"STRUCTURED\" });\n\n\tif (pageSize !== undefined) {\n\t\tquery.append(\"maxPageSize\", String(pageSize));\n\t}\n\n\tif (pageToken !== undefined) {\n\t\tquery.append(\"pageToken\", pageToken);\n\t}\n\n\treturn query;\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst LIST_LOGS_PER_MINUTE = 45;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for listing Luau execution task logs,\n * sourced from `x-roblox-rate-limits.perApiKeyOwner` on the\n * `Cloud_ListLuauExecutionSessionTaskLogs` operation (45 requests per\n * minute per API key owner).\n */\nexport const LIST_LOGS_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: LIST_LOGS_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"luau-execution-task-logs.list\",\n});\n\n/**\n * Scopes required to list Luau execution task logs, sourced from\n * `x-roblox-scopes` on the list-logs operation in the vendored OpenAPI\n * schema. Surfaced via the `requiredScopes` field of the per-method\n * spec so a 401 or 403 ApiError is upgraded to a `PermissionError`\n * naming the missing scope. Only `:read` is required as the\n * minimum-privilege scope for this read-only operation.\n */\nexport const LIST_LOGS_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe.place.luau-execution-session:read\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { LogMessage, LogPage } from \"./types.ts\";\nimport type { LogChunkWire, LogMessageWire } from \"./wire.ts\";\n\nconst MALFORMED_LOGS_MESSAGE = \"Malformed list-luau-execution-task-logs response\";\n\n/**\n * Parses a successful Open Cloud list-luau-execution-task-logs response\n * body into the public {@link LogPage} shape. Chunks are flattened into\n * a single ordered array of {@link LogMessage} values. The\n * `MESSAGE_TYPE_UNSPECIFIED` sentinel is rejected.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link LogPage}, or an\n * {@link ApiError} when the body does not match a supported shape.\n */\nexport function parseListLogsResponse(response: HttpResponse): Result<LogPage, ApiError> {\n\tconst { body, status: statusCode } = response;\n\tif (!isRecord(body)) {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst rawChunks = body[\"luauExecutionSessionTaskLogs\"] ?? undefined;\n\tif (!isOptionalLogChunks(rawChunks)) {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst rawToken = body[\"nextPageToken\"] ?? undefined;\n\tif (rawToken !== undefined && typeof rawToken !== \"string\") {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst messages: Array<LogMessage> = [];\n\tfor (const chunk of rawChunks ?? []) {\n\t\tfor (const wireMessage of chunk.structuredMessages ?? []) {\n\t\t\tmessages.push({\n\t\t\t\tcreateTime: wireMessage.createTime,\n\t\t\t\tmessage: wireMessage.message,\n\t\t\t\tmessageType: wireMessage.messageType,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn {\n\t\tdata: { messages, nextPageToken: rawToken },\n\t\tsuccess: true,\n\t};\n}\n\nfunction isAcceptedMessageType(value: unknown): value is LogMessageWire[\"messageType\"] {\n\treturn value === \"OUTPUT\" || value === \"INFO\" || value === \"WARNING\" || value === \"ERROR\";\n}\n\nfunction isLogMessageWire(value: unknown): value is LogMessageWire {\n\treturn (\n\t\tisRecord(value) &&\n\t\ttypeof value[\"createTime\"] === \"string\" &&\n\t\ttypeof value[\"message\"] === \"string\" &&\n\t\tisAcceptedMessageType(value[\"messageType\"])\n\t);\n}\n\nfunction isOptionalStructuredMessages(\n\tvalue: unknown,\n): value is ReadonlyArray<LogMessageWire> | undefined {\n\treturn (\n\t\tvalue === undefined ||\n\t\t(Array.isArray(value) && value.every((item: unknown) => isLogMessageWire(item)))\n\t);\n}\n\nfunction isLogChunkWire(value: unknown): value is LogChunkWire {\n\treturn isRecord(value) && isOptionalStructuredMessages(value[\"structuredMessages\"]);\n}\n\nfunction isOptionalLogChunks(value: unknown): value is ReadonlyArray<LogChunkWire> | undefined {\n\treturn (\n\t\tvalue === undefined ||\n\t\t(Array.isArray(value) && value.every((item: unknown) => isLogChunkWire(item)))\n\t);\n}\n\nfunction malformed(statusCode: number): Result<LogPage, ApiError> {\n\treturn { err: new ApiError(MALFORMED_LOGS_MESSAGE, { statusCode }), success: false };\n}\n","import { IDEMPOTENT_METHOD_DEFAULTS } from \"../../../internal/http/retry.ts\";\nimport type { ResourceMethodSpec } from \"../../../internal/resource-client.ts\";\nimport { buildListLogsRequest } from \"./builders.ts\";\nimport { LIST_LOGS_OPERATION_LIMIT, LIST_LOGS_REQUIRED_SCOPES } from \"./operations.ts\";\nimport { parseListLogsResponse } from \"./parsers.ts\";\nimport type { ListLogsParameters, LogPage } from \"./types.ts\";\n\nfunction makeSpec<P>(spec: ResourceMethodSpec<P, LogPage>): ResourceMethodSpec<P, LogPage> {\n\treturn Object.freeze(spec);\n}\n\n/**\n * Per-method dispatch spec for listing the structured log messages\n * produced by a Luau execution task. Frozen at module scope so both\n * the top-level `LuauExecutionClient` and the `luauExecution` Operation\n * Group on `PlacesClient` share the same instance reference.\n */\nexport const LIST_LOGS_SPEC = makeSpec<ListLogsParameters>({\n\tbuildRequest: buildListLogsRequest,\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: LIST_LOGS_OPERATION_LIMIT,\n\tparse: parseListLogsResponse,\n\trequiredScopes: LIST_LOGS_REQUIRED_SCOPES,\n});\n","import type { HttpRequest } from \"../../../client/types.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { GetParameters, SubmitAtHeadParameters, SubmitAtVersionParameters } from \"./types.ts\";\n\ninterface SubmitBodyInput {\n\treadonly binaryInput?: string | undefined;\n\treadonly enableBinaryOutput?: boolean | undefined;\n\treadonly script: string;\n\treadonly timeoutSeconds?: number;\n}\n\nconst JSON_HEADERS: Readonly<Record<string, string>> = { \"content-type\": \"application/json\" };\n\n/**\n * Builds a `POST` request for the Open Cloud \"create Luau execution\n * session task\" endpoint, targeting the place's head version. Serializes\n * `timeoutSeconds` into the wire's duration string format (`\"<n>s\"`)\n * when supplied.\n *\n * @param parameters - Universe and place identifiers, the script body,\n * and an optional `timeoutSeconds`.\n * @returns A pure {@link HttpRequest} describing the submit call.\n */\nexport function buildSubmitAtHeadRequest(parameters: SubmitAtHeadParameters): HttpRequest {\n\tconst { placeId, universeId } = parameters;\n\treturn {\n\t\tbody: buildSubmitBody(parameters),\n\t\theaders: JSON_HEADERS,\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${universeId}/places/${placeId}/luau-execution-session-tasks`,\n\t};\n}\n\n/**\n * Builds a `POST` request for the Open Cloud \"create Luau execution\n * session task\" endpoint, targeting a specific place version. Differs\n * from {@link buildSubmitAtHeadRequest} only in URL shape: the path\n * includes the `versions/{versionId}` segment so the script runs\n * against that exact place version instead of the live head.\n *\n * @param parameters - Universe, place, and version identifiers, the\n * script body, and an optional `timeoutSeconds`.\n * @returns A pure {@link HttpRequest} describing the submit call.\n */\nexport function buildSubmitAtVersionRequest(parameters: SubmitAtVersionParameters): HttpRequest {\n\tconst { placeId, universeId, versionId } = parameters;\n\treturn {\n\t\tbody: buildSubmitBody(parameters),\n\t\theaders: JSON_HEADERS,\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${universeId}/places/${placeId}/versions/${versionId}/luau-execution-session-tasks`,\n\t};\n}\n\n/**\n * Builds a `GET` request for the Open Cloud \"read Luau execution session\n * task\" endpoint. The endpoint accepts only the maximal x-aep-resource\n * path shape (universe, place, version, session, task), so the supplied\n * ref must include `versionId` and `sessionId`; refs extracted from the\n * narrower path formats are rejected with a {@link ValidationError}.\n *\n * @param parameters - Task ref and optional view selector. When `view`\n * is omitted, no `?view=` query is sent and the server applies its\n * own default (`BASIC`).\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when the ref is missing `versionId` or\n * `sessionId`.\n */\nexport function buildGetRequest(parameters: GetParameters): Result<HttpRequest, ValidationError> {\n\tconst { ref, view } = parameters;\n\tconst { placeId, sessionId, taskId, universeId, versionId } = ref;\n\n\tif (versionId === undefined) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Task ref is missing versionId; cannot GET\", {\n\t\t\t\tcode: \"incomplete_ref\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tif (sessionId === undefined) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Task ref is missing sessionId; cannot GET\", {\n\t\t\t\tcode: \"incomplete_ref\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst base = `/cloud/v2/universes/${universeId}/places/${placeId}/versions/${versionId}/luau-execution-sessions/${sessionId}/tasks/${taskId}`;\n\tconst url = view === undefined ? base : `${base}?view=${view}`;\n\treturn { data: { method: \"GET\", url }, success: true };\n}\n\nfunction buildSubmitBody(parameters: SubmitBodyInput): Record<string, unknown> {\n\tconst {\n\t\tbinaryInput,\n\t\tenableBinaryOutput: shouldEnableBinaryOutput,\n\t\tscript,\n\t\ttimeoutSeconds,\n\t} = parameters;\n\tconst body: Record<string, unknown> = { script };\n\tif (timeoutSeconds !== undefined) {\n\t\tbody[\"timeout\"] = `${timeoutSeconds}s`;\n\t}\n\n\tif (binaryInput !== undefined) {\n\t\tbody[\"binaryInput\"] = binaryInput;\n\t}\n\n\tif (shouldEnableBinaryOutput !== undefined) {\n\t\tbody[\"enableBinaryOutput\"] = shouldEnableBinaryOutput;\n\t}\n\n\treturn body;\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst SUBMIT_PER_MINUTE = 40;\nconst GET_PER_MINUTE = 200;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for submitting a Luau execution task,\n * sourced from `x-roblox-rate-limits.perApiKeyOwner` on the\n * `Cloud_CreateLuauExecutionSessionTask__Using_Universes` operation\n * (40 requests per minute per API key owner). The two URL shapes\n * (head and version) share this queue because Roblox attributes both\n * to the same per-minute quota.\n */\nexport const SUBMIT_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: SUBMIT_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"luau-execution-tasks.submit\",\n});\n\n/**\n * Per-second request ceiling for fetching a Luau execution task,\n * sourced from `x-roblox-rate-limits.perApiKeyOwner` on the\n * `Cloud_GetLuauExecutionSessionTask` operation (200 requests per\n * minute per API key owner).\n */\nexport const GET_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: GET_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"luau-execution-tasks.get\",\n});\n\n/**\n * Scopes required to submit a Luau execution task, sourced from\n * `x-roblox-scopes` on the create operation in the vendored OpenAPI\n * schema. Surfaced via the `requiredScopes` field of the per-method\n * spec so a 401 or 403 ApiError is upgraded to a `PermissionError`\n * naming the missing scope.\n */\nexport const SUBMIT_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe.place.luau-execution-session:write\",\n]);\n\n/**\n * Scopes required to fetch a Luau execution task, sourced from\n * `x-roblox-scopes` on the get operation. The `:write` scope also\n * grants read in upstream auth, but we surface only `:read` here as\n * the minimum-privilege requirement for this method.\n */\nexport const GET_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe.place.luau-execution-session:read\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { LuauExecutionTask, LuauExecutionTaskRef } from \"./types.ts\";\nimport type {\n\tLuauExecutionTaskErrorWire,\n\tLuauExecutionTaskOutputWire,\n\tLuauExecutionTaskWire,\n} from \"./wire.ts\";\n\nconst MALFORMED_TASK_MESSAGE = \"Malformed luau-execution-session-task response\";\n\n// Matches any of the four x-aep-resource path formats for a luau\n// execution session task.\n//\n// Capture groups:\n// 1. universeId\n// 2. placeId\n// 3. versionId (when `/versions/{v}/` segment is present, else undefined)\n// 4. sessionId (when `/luau-execution-sessions/{s}/tasks/...` branch matched)\n// 5. taskId (when `/luau-execution-sessions/.../tasks/{t}` branch matched)\n// 6. taskId (when `/luau-execution-session-tasks/{t}` branch matched)\nconst PATH_PATTERN =\n\t/^universes\\/(\\d+)\\/places\\/(\\d+)(?:\\/versions\\/(\\d+))?(?:\\/luau-execution-sessions\\/([^/]+)\\/tasks\\/([^/]+)|\\/luau-execution-session-tasks\\/([^/]+))$/;\n\ntype InProgressWireState = Exclude<LuauExecutionTaskWire[\"state\"], \"COMPLETE\" | \"FAILED\">;\n\ninterface ParseVariantArgs {\n\treadonly body: LuauExecutionTaskWire;\n\treadonly createdAt: Date | undefined;\n\treadonly ref: LuauExecutionTaskRef;\n\treadonly statusCode: number;\n\treadonly timeoutSeconds: number | undefined;\n\treadonly updatedAt: Date | undefined;\n}\n\n/**\n * Parses a successful Open Cloud `LuauExecutionSessionTask` response\n * body into the public {@link LuauExecutionTask} discriminated union.\n * Handles every supported task state (in-progress, COMPLETE, FAILED)\n * across all four x-aep-resource path shapes the server returns.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud\n * API.\n * @returns A success result wrapping the parsed task, or an\n * {@link ApiError} when the body or path do not match a supported\n * shape.\n */\nexport function parseLuauExecutionTaskResponse(\n\tresponse: HttpResponse,\n): Result<LuauExecutionTask, ApiError> {\n\tconst { body, status: statusCode } = response;\n\tif (!isLuauExecutionTaskWire(body)) {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst ref = parseTaskRef(body.path);\n\tif (ref === undefined) {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst timeoutSeconds = parseTimeoutSeconds(body.timeout);\n\tconst createdAt = parseOptionalDate(body.createTime);\n\tconst updatedAt = parseOptionalDate(body.updateTime);\n\n\tif (body.state === \"COMPLETE\") {\n\t\treturn parseCompleteTask({ body, createdAt, ref, statusCode, timeoutSeconds, updatedAt });\n\t}\n\n\tif (body.state === \"FAILED\") {\n\t\treturn parseFailedTask({ body, createdAt, ref, statusCode, timeoutSeconds, updatedAt });\n\t}\n\n\treturn parseInProgressTask({\n\t\tbody,\n\t\tcreatedAt,\n\t\tref,\n\t\tstate: body.state,\n\t\tstatusCode,\n\t\ttimeoutSeconds,\n\t\tupdatedAt,\n\t});\n}\n\nfunction isAcceptedWireState(\n\tstate: unknown,\n): state is \"CANCELLED\" | \"COMPLETE\" | \"FAILED\" | \"PROCESSING\" | \"QUEUED\" {\n\treturn (\n\t\tstate === \"QUEUED\" ||\n\t\tstate === \"PROCESSING\" ||\n\t\tstate === \"CANCELLED\" ||\n\t\tstate === \"COMPLETE\" ||\n\t\tstate === \"FAILED\"\n\t);\n}\n\nfunction isErrorWireCode(code: unknown): code is LuauExecutionTaskErrorWire[\"code\"] {\n\treturn (\n\t\tcode === \"SCRIPT_ERROR\" ||\n\t\tcode === \"DEADLINE_EXCEEDED\" ||\n\t\tcode === \"OUTPUT_SIZE_LIMIT_EXCEEDED\" ||\n\t\tcode === \"INTERNAL_ERROR\"\n\t);\n}\n\nfunction isErrorWire(value: unknown): value is LuauExecutionTaskErrorWire {\n\treturn (\n\t\tisRecord(value) && isErrorWireCode(value[\"code\"]) && typeof value[\"message\"] === \"string\"\n\t);\n}\n\nfunction isOptionalErrorWire(value: unknown): value is LuauExecutionTaskErrorWire | undefined {\n\treturn value === undefined || isErrorWire(value);\n}\n\nfunction isOutputWire(value: unknown): value is LuauExecutionTaskOutputWire {\n\treturn isRecord(value) && Array.isArray(value[\"results\"]);\n}\n\nfunction isOptionalOutputWire(value: unknown): value is LuauExecutionTaskOutputWire | undefined {\n\treturn value === undefined || isOutputWire(value);\n}\n\nfunction isOptionalString(value: unknown): value is string | undefined {\n\treturn value === undefined || typeof value === \"string\";\n}\n\nfunction isOptionalBoolean(value: unknown): value is boolean | undefined {\n\treturn value === undefined || typeof value === \"boolean\";\n}\n\nfunction isOptionalDateTimeString(value: unknown): value is string | undefined {\n\treturn value === undefined || isDateTimeString(value);\n}\n\nfunction isLuauExecutionTaskWire(body: unknown): body is LuauExecutionTaskWire {\n\treturn (\n\t\tisRecord(body) &&\n\t\ttypeof body[\"path\"] === \"string\" &&\n\t\tisOptionalDateTimeString(body[\"createTime\"]) &&\n\t\tisOptionalDateTimeString(body[\"updateTime\"]) &&\n\t\tisAcceptedWireState(body[\"state\"]) &&\n\t\ttypeof body[\"user\"] === \"string\" &&\n\t\tisOptionalOutputWire(body[\"output\"]) &&\n\t\tisOptionalErrorWire(body[\"error\"]) &&\n\t\tisOptionalDurationWire(body[\"timeout\"]) &&\n\t\tisOptionalString(body[\"binaryInput\"]) &&\n\t\tisOptionalBoolean(body[\"enableBinaryOutput\"]) &&\n\t\tisOptionalString(body[\"binaryOutputUri\"])\n\t);\n}\n\nfunction parseOptionalDate(value: string | undefined): Date | undefined {\n\treturn value === undefined ? undefined : new Date(value);\n}\n\nconst DURATION_PATTERN = /^(\\d+)s$/;\n\nfunction isOptionalDurationWire(value: unknown): value is string | undefined {\n\treturn value === undefined || (typeof value === \"string\" && DURATION_PATTERN.test(value));\n}\n\nfunction parseTimeoutSeconds(value: string | undefined): number | undefined {\n\tif (value === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst match = DURATION_PATTERN.exec(value);\n\tconst seconds = match?.[1];\n\tif (seconds === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn Number.parseInt(seconds, 10);\n}\n\nfunction malformed(statusCode: number): Result<LuauExecutionTask, ApiError> {\n\treturn { err: new ApiError(MALFORMED_TASK_MESSAGE, { statusCode }), success: false };\n}\n\nfunction parseInProgressTask(\n\targs: ParseVariantArgs & { readonly state: InProgressWireState },\n): Result<LuauExecutionTask, ApiError> {\n\tconst { body, createdAt, ref, state, timeoutSeconds, updatedAt } = args;\n\treturn {\n\t\tdata: {\n\t\t\tbinaryInput: body.binaryInput,\n\t\t\tbinaryOutputUri: body.binaryOutputUri,\n\t\t\tcreatedAt,\n\t\t\tenableBinaryOutput: body.enableBinaryOutput,\n\t\t\tref,\n\t\t\tstate,\n\t\t\ttimeoutSeconds,\n\t\t\tupdatedAt,\n\t\t\tuser: body.user,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction parseCompleteTask(args: ParseVariantArgs): Result<LuauExecutionTask, ApiError> {\n\tconst { body, createdAt, ref, statusCode, timeoutSeconds, updatedAt } = args;\n\tif (body.output === undefined) {\n\t\treturn malformed(statusCode);\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tbinaryInput: body.binaryInput,\n\t\t\tbinaryOutputUri: body.binaryOutputUri,\n\t\t\tcreatedAt,\n\t\t\tenableBinaryOutput: body.enableBinaryOutput,\n\t\t\toutput: { results: body.output.results },\n\t\t\tref,\n\t\t\tstate: \"COMPLETE\",\n\t\t\ttimeoutSeconds,\n\t\t\tupdatedAt,\n\t\t\tuser: body.user,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction parseFailedTask(args: ParseVariantArgs): Result<LuauExecutionTask, ApiError> {\n\tconst { body, createdAt, ref, statusCode, timeoutSeconds, updatedAt } = args;\n\tif (body.error === undefined) {\n\t\treturn malformed(statusCode);\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tbinaryInput: body.binaryInput,\n\t\t\tbinaryOutputUri: body.binaryOutputUri,\n\t\t\tcreatedAt,\n\t\t\tenableBinaryOutput: body.enableBinaryOutput,\n\t\t\terror: { code: body.error.code, message: body.error.message },\n\t\t\tref,\n\t\t\tstate: \"FAILED\",\n\t\t\ttimeoutSeconds,\n\t\t\tupdatedAt,\n\t\t\tuser: body.user,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction parseTaskRef(path: string): LuauExecutionTaskRef | undefined {\n\tconst match = PATH_PATTERN.exec(path);\n\tif (match === null) {\n\t\treturn undefined;\n\t}\n\n\tconst [, universeId, placeId, versionId, sessionId, sessionTaskId, plainTaskId] = match;\n\tconst taskId = sessionTaskId ?? plainTaskId;\n\tif (universeId === undefined || placeId === undefined || taskId === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn { placeId, sessionId, taskId, universeId, versionId };\n}\n","import {\n\tCREATE_METHOD_DEFAULTS,\n\tIDEMPOTENT_METHOD_DEFAULTS,\n} from \"../../../internal/http/retry.ts\";\nimport { okRequest, type ResourceMethodSpec } from \"../../../internal/resource-client.ts\";\nimport {\n\tbuildGetRequest,\n\tbuildSubmitAtHeadRequest,\n\tbuildSubmitAtVersionRequest,\n} from \"./builders.ts\";\nimport {\n\tGET_OPERATION_LIMIT,\n\tGET_REQUIRED_SCOPES,\n\tSUBMIT_OPERATION_LIMIT,\n\tSUBMIT_REQUIRED_SCOPES,\n} from \"./operations.ts\";\nimport { parseLuauExecutionTaskResponse } from \"./parsers.ts\";\nimport type {\n\tGetParameters,\n\tLuauExecutionTask,\n\tSubmitAtHeadParameters,\n\tSubmitAtVersionParameters,\n} from \"./types.ts\";\n\nfunction makeSpec<P>(\n\tspec: ResourceMethodSpec<P, LuauExecutionTask>,\n): ResourceMethodSpec<P, LuauExecutionTask> {\n\treturn Object.freeze(spec);\n}\n\n/**\n * Per-method dispatch spec for submitting a Luau execution task at a\n * place's head version. Frozen at module scope so both the top-level\n * `LuauExecutionClient` and the `luauExecution` Operation Group on\n * `PlacesClient` share the same instance reference.\n */\nexport const SUBMIT_HEAD_SPEC = makeSpec<SubmitAtHeadParameters>({\n\tbuildRequest: (parameters) => okRequest(buildSubmitAtHeadRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: SUBMIT_OPERATION_LIMIT,\n\tparse: parseLuauExecutionTaskResponse,\n\trequiredScopes: SUBMIT_REQUIRED_SCOPES,\n});\n\n/**\n * Per-method dispatch spec for submitting a Luau execution task at a\n * specific place version. Shares the rate-limit queue and required\n * scope set with {@link SUBMIT_HEAD_SPEC} because Roblox attributes\n * both URL shapes to one per-minute quota.\n */\nexport const SUBMIT_VERSION_SPEC = makeSpec<SubmitAtVersionParameters>({\n\tbuildRequest: (parameters) => okRequest(buildSubmitAtVersionRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: SUBMIT_OPERATION_LIMIT,\n\tparse: parseLuauExecutionTaskResponse,\n\trequiredScopes: SUBMIT_REQUIRED_SCOPES,\n});\n\n/**\n * Per-method dispatch spec for fetching a Luau execution task. Uses\n * idempotent retry semantics (429 and 5xx both retried) so reads\n * recover transparently from transient server errors.\n */\nexport const GET_SPEC = makeSpec<GetParameters>({\n\tbuildRequest: buildGetRequest,\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: GET_OPERATION_LIMIT,\n\tparse: parseLuauExecutionTaskResponse,\n\trequiredScopes: GET_REQUIRED_SCOPES,\n});\n","import type { RequestOptions } from \"../../client/types.ts\";\nimport type { LuauExecutionTask } from \"../../domains/cloud-v2/luau-execution-tasks/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { NetworkError } from \"../../errors/network-error.ts\";\nimport { PollAbortedError } from \"../../errors/poll-aborted.ts\";\nimport { PollTimeoutError } from \"../../errors/poll-timeout.ts\";\nimport { TRANSIENT_TRANSPORT_CODES } from \"../../internal/http/retry.ts\";\nimport { findErrorCode } from \"../../internal/utils/find-error-code.ts\";\nimport type { SleepFunc } from \"../../internal/utils/sleep.ts\";\nimport type { Result } from \"../../types.ts\";\n\n/** Default total polling budget in milliseconds (5 minutes). */\nexport const DEFAULT_POLL_TIMEOUT_MS = 300_000;\n\n/** One step of the default poll-cadence schedule. */\ninterface PollDelayTier {\n\t/** Delay in ms to wait between polls while within this tier. */\n\treadonly delayMs: number;\n\t/** Upper elapsed-time bound (exclusive) at which this tier stops applying. */\n\treadonly untilMs: number;\n}\n\n/** Steady-state delay once elapsed time reaches the final tier bound. */\nconst STEADY_POLL_DELAY_MS = 5_000;\n\n/**\n * Fast-to-slow poll-cadence tiers keyed on elapsed wall-clock time. Elapsed\n * times at or beyond the last `untilMs` fall through to\n * {@link STEADY_POLL_DELAY_MS}.\n */\nconst DEFAULT_POLL_TIERS: ReadonlyArray<PollDelayTier> = [\n\t{ delayMs: 500, untilMs: 20_000 },\n\t{ delayMs: 1_000, untilMs: 60_000 },\n];\n\n/**\n * Default poll cadence as a function of elapsed wall-clock time since\n * polling began. Polls quickly while a task is young so short runs resolve\n * snappily, then eases off so a long run leaves rate-limit headroom for\n * newer tasks: 0-20s is 500ms, 20-60s is 1000ms, 60s+ is 5000ms.\n *\n * @since 0.1.0\n *\n * @example\n * ```ts\n * import { defaultPollDelay } from \"@bedrock-rbx/ocale/luau-execution\";\n *\n * expect(defaultPollDelay(0)).toBe(500);\n * expect(defaultPollDelay(30_000)).toBe(1000);\n * expect(defaultPollDelay(120_000)).toBe(5000);\n * ```\n *\n * @param elapsedMs - Milliseconds elapsed since polling started.\n * @returns The delay in milliseconds to wait before the next poll.\n */\nexport function defaultPollDelay(elapsedMs: number): number {\n\tconst tier = DEFAULT_POLL_TIERS.find((candidate) => elapsedMs < candidate.untilMs);\n\treturn tier?.delayMs ?? STEADY_POLL_DELAY_MS;\n}\n\n/**\n * Default number of consecutive transport failures tolerated before the poll\n * loop gives up. With per-request retries already absorbing isolated blips,\n * three consecutive loop-level failures signals a genuinely unreachable\n * endpoint, so it bails in seconds rather than spinning out the wall-clock budget.\n */\nexport const DEFAULT_POLL_FAILURE_CAP = 3;\n\n/**\n * Injected dependencies for the deep-module polling loop. The `fetch`\n * callback is pre-bound by the wiring layer and closes over the task ref\n * and request options, keeping the core loop narrow.\n */\nexport interface PollDeps {\n\t/** Returns the current task or an error. Called on each loop iteration. */\n\treadonly fetch: () => Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/** Returns the current wall-clock time in ms. */\n\treadonly now: () => number;\n\t/** Injectable sleep for deterministic tests. */\n\treadonly sleep: SleepFunc;\n}\n\n/**\n * Public options accepted by `pollUntilDone` and `runUntilDone` on both client surfaces.\n *\n * @since 0.1.0\n */\nexport type PollUntilDoneOptions = PollOptions & RequestOptions;\n\n/** Caller-supplied polling-loop options; all fields optional. */\ninterface PollOptions {\n\t/**\n\t * Consecutive transient transport failures tolerated before the loop gives\n\t * up. Defaults to {@link DEFAULT_POLL_FAILURE_CAP}. A successful poll resets\n\t * the count.\n\t */\n\treadonly maxConsecutivePollFailures?: number;\n\t/** Returns the sleep duration given ms elapsed since polling started. Defaults to {@link defaultPollDelay}. */\n\treadonly pollDelay?: (elapsedMs: number) => number;\n\t/** When aborted, the loop returns {@link PollAbortedError} rather than continuing. */\n\treadonly signal?: AbortSignal;\n\t/** Total wall-clock budget in ms before the loop returns {@link PollTimeoutError}. */\n\treadonly timeoutMs?: number;\n}\n\n/**\n * Defaults the per-request `timeout` to the effective poll budget when the\n * caller has not set one. A luau-execution submit and each poll `get` normally\n * answer in well under a second (the submit endpoint enqueues the task without\n * waiting for it to run), so the only job of a per-request deadline here is to\n * bound a black-hole connection. Leaving these requests on the client-wide 30s\n * default (tuned for snappy CRUD) turns a slow-but-alive backend into a\n * self-abort, an error the retry layer never retries by construction, before\n * the loop's wall-clock budget is ever consulted. Deriving the deadline from\n * `timeoutMs` keeps a single request alive exactly as long as the caller\n * already agreed to wait for the whole operation, so the backend can answer or\n * surface a retryable status instead.\n *\n * @param options - The caller's poll and per-request options.\n * @returns The options with `timeout` filled from the budget when it was unset.\n */\nexport function withBudgetRequestTimeout(options: PollUntilDoneOptions): PollUntilDoneOptions {\n\tif (options.timeout !== undefined) {\n\t\treturn options;\n\t}\n\n\treturn { ...options, timeout: options.timeoutMs ?? DEFAULT_POLL_TIMEOUT_MS };\n}\n\nconst ABORTED = Symbol(\"poll-aborted\");\ntype Aborted = typeof ABORTED;\n\ninterface AbortObserver {\n\treadonly cleanup: () => void;\n\treadonly promise: Promise<Aborted>;\n}\n\ninterface SleepWithAbortOptions {\n\treadonly ms: number;\n\treadonly signal: AbortSignal | undefined;\n\treadonly sleep: SleepFunc;\n}\n\ntype FetchOutcome =\n\t| { readonly error: NetworkError; readonly kind: \"transient\" }\n\t| { readonly error: OpenCloudError; readonly kind: \"failed\" }\n\t| { readonly kind: \"aborted\" }\n\t| { readonly kind: \"pending\"; readonly task: LuauExecutionTask }\n\t| { readonly kind: \"terminal\"; readonly task: LuauExecutionTask };\n\n/** Mutable-per-iteration loop state threaded through {@link applyOutcome}. */\ninterface LoopState {\n\treadonly consecutiveFailures: number;\n\treadonly lastTask: LuauExecutionTask | undefined;\n}\n\ntype LoopAction =\n\t| { readonly kind: \"continue\"; readonly state: LoopState }\n\t| { readonly kind: \"return\"; readonly result: Result<LuauExecutionTask, OpenCloudError> };\n\n/** Per-iteration inputs to {@link applyOutcome}. */\ninterface OutcomeContext {\n\treadonly maxFailures: number;\n\treadonly signal: AbortSignal | undefined;\n\treadonly state: LoopState;\n}\n\n/**\n * Core polling loop. Calls `deps.fetch()` repeatedly, sleeping\n * `pollDelay(elapsedMs)` ms between iterations, until a terminal state\n * is observed, the wall-clock budget is exhausted, or an `AbortSignal`\n * fires. A transient transport failure ({@link NetworkError}) is tolerated\n * and the loop continues, giving up only after `maxConsecutivePollFailures`\n * consecutive failures; any other failure aborts immediately, since an API\n * response (a 404 for a vanished task, a 403) means there is nothing left to\n * poll. A successful poll resets the failure count.\n *\n * @param deps - Injected fetch, now, and sleep callbacks.\n * @param options - Optional poll delay, timeout, failure cap, and abort signal.\n * @returns The terminal task, or an error if aborted, timed out, or the transport keeps failing.\n */\nexport async function pollUntilDoneCore(\n\tdeps: PollDeps,\n\toptions: PollOptions = {},\n): Promise<Result<LuauExecutionTask, OpenCloudError>> {\n\tconst timeoutMs = options.timeoutMs ?? DEFAULT_POLL_TIMEOUT_MS;\n\tconst pollDelay = options.pollDelay ?? defaultPollDelay;\n\tconst maxFailures = options.maxConsecutivePollFailures ?? DEFAULT_POLL_FAILURE_CAP;\n\tconst sig = options.signal;\n\tconst startedAt = deps.now();\n\tif (sig?.aborted === true) {\n\t\treturn abortedResult(sig);\n\t}\n\n\tlet state: LoopState = { consecutiveFailures: 0, lastTask: undefined };\n\tfor (;;) {\n\t\tconst elapsedMs = deps.now() - startedAt;\n\t\tif (elapsedMs >= timeoutMs) {\n\t\t\treturn { err: makeTimeout(state.lastTask, timeoutMs), success: false };\n\t\t}\n\n\t\tconst outcome = await fetchOnce(deps, sig);\n\t\tconst action = applyOutcome(outcome, { maxFailures, signal: sig, state });\n\t\tif (action.kind === \"return\") {\n\t\t\treturn action.result;\n\t\t}\n\n\t\t({ state } = action);\n\t\tif (await sleepWithAbort({ ms: pollDelay(elapsedMs), signal: sig, sleep: deps.sleep })) {\n\t\t\treturn abortedResult(sig);\n\t\t}\n\t}\n}\n\nfunction makeAborted(signal: AbortSignal | undefined): PollAbortedError {\n\treturn new PollAbortedError(\"Polling was aborted\", { reason: signal?.reason });\n}\n\nfunction abortedResult(signal: AbortSignal | undefined): Result<LuauExecutionTask, OpenCloudError> {\n\treturn { err: makeAborted(signal), success: false };\n}\n\n/**\n * Maps a single fetch outcome to the next loop action. Terminal, failed, and\n * aborted outcomes return immediately; a transient transport failure advances\n * the consecutive-failure count and returns once it reaches `maxFailures`; a\n * pending task resets the count and continues.\n *\n * @param outcome - The classified result of one poll fetch.\n * @param context - The loop state, failure cap, and abort signal.\n * @returns Whether to return a final Result or continue with updated state.\n */\nfunction applyOutcome(outcome: FetchOutcome, context: OutcomeContext): LoopAction {\n\tconst { maxFailures, signal, state } = context;\n\tswitch (outcome.kind) {\n\t\tcase \"aborted\": {\n\t\t\treturn { kind: \"return\", result: abortedResult(signal) };\n\t\t}\n\t\tcase \"failed\": {\n\t\t\treturn { kind: \"return\", result: { err: outcome.error, success: false } };\n\t\t}\n\t\tcase \"pending\": {\n\t\t\treturn { kind: \"continue\", state: { consecutiveFailures: 0, lastTask: outcome.task } };\n\t\t}\n\t\tcase \"terminal\": {\n\t\t\treturn { kind: \"return\", result: { data: outcome.task, success: true } };\n\t\t}\n\t\tcase \"transient\": {\n\t\t\tconst consecutiveFailures = state.consecutiveFailures + 1;\n\t\t\tif (consecutiveFailures >= maxFailures) {\n\t\t\t\treturn { kind: \"return\", result: { err: outcome.error, success: false } };\n\t\t\t}\n\n\t\t\treturn { kind: \"continue\", state: { consecutiveFailures, lastTask: state.lastTask } };\n\t\t}\n\t}\n}\n\nfunction abortObserver(signal: AbortSignal): AbortObserver {\n\tconst { promise, resolve } = Promise.withResolvers<Aborted>();\n\tfunction onAbort(): void {\n\t\tresolve(ABORTED);\n\t}\n\n\tsignal.addEventListener(\"abort\", onAbort);\n\tfunction cleanup(): void {\n\t\tsignal.removeEventListener(\"abort\", onAbort);\n\t}\n\n\treturn { cleanup, promise };\n}\n\nasync function raceWithAbort<T>(\n\tpromise: Promise<T>,\n\tsignal: AbortSignal | undefined,\n): Promise<Aborted | T> {\n\tif (signal === undefined) {\n\t\treturn promise;\n\t}\n\n\tif (signal.aborted) {\n\t\treturn ABORTED;\n\t}\n\n\tconst observer = abortObserver(signal);\n\ttry {\n\t\treturn await Promise.race([promise, observer.promise]);\n\t} finally {\n\t\tobserver.cleanup();\n\t}\n}\n\nasync function sleepWithAbort(options: SleepWithAbortOptions): Promise<boolean> {\n\tconst { ms, signal, sleep } = options;\n\tconst raced = await raceWithAbort(sleep(ms), signal);\n\treturn raced === ABORTED;\n}\n\nfunction makeTimeout(\n\ttask: LuauExecutionTask | undefined,\n\ttimeoutMs: number,\n): PollTimeoutError<LuauExecutionTask> {\n\treturn new PollTimeoutError(`Polling timed out after ${timeoutMs} ms`, {\n\t\tlastObservedTask: task,\n\t\ttimeoutMs,\n\t});\n}\n\nfunction isTerminal(task: LuauExecutionTask): boolean {\n\treturn task.state === \"COMPLETE\" || task.state === \"FAILED\" || task.state === \"CANCELLED\";\n}\n\n/**\n * A failed poll is worth re-polling only when it is a `NetworkError` carrying a\n * known transient transport code. A self-aborted request timeout has no\n * `code`, and an API response (4xx/5xx) is authoritative, so both abort the\n * loop rather than being re-polled. Transient-ness is classified against the\n * canonical `TRANSIENT_TRANSPORT_CODES` set; this is the loop's own tolerance\n * dimension, distinct from the per-request `retryableTransportCodes` override\n * (which governs request-level retries inside each poll). Loop tolerance is\n * bounded separately by `maxConsecutivePollFailures`.\n *\n * @param error - The error returned by a failed poll.\n * @returns `true` when the loop should tolerate and re-poll.\n */\nfunction isTransientTransport(error: OpenCloudError): error is NetworkError {\n\tif (!(error instanceof NetworkError)) {\n\t\treturn false;\n\t}\n\n\tconst code = findErrorCode(error);\n\treturn code !== undefined && TRANSIENT_TRANSPORT_CODES.includes(code);\n}\n\nasync function fetchOnce(deps: PollDeps, signal: AbortSignal | undefined): Promise<FetchOutcome> {\n\tconst fetchResult = await raceWithAbort(deps.fetch(), signal);\n\tif (fetchResult === ABORTED) {\n\t\treturn { kind: \"aborted\" };\n\t}\n\n\tif (!fetchResult.success) {\n\t\treturn isTransientTransport(fetchResult.err)\n\t\t\t? { error: fetchResult.err, kind: \"transient\" }\n\t\t\t: { error: fetchResult.err, kind: \"failed\" };\n\t}\n\n\treturn isTerminal(fetchResult.data)\n\t\t? { kind: \"terminal\", task: fetchResult.data }\n\t\t: { kind: \"pending\", task: fetchResult.data };\n}\n","import {\n\tGET_SPEC,\n\tSUBMIT_HEAD_SPEC,\n\tSUBMIT_VERSION_SPEC,\n} from \"../../domains/cloud-v2/luau-execution-tasks/specs.ts\";\nimport type {\n\tLuauExecutionTask,\n\tLuauExecutionTaskRef,\n\tSubmitAtHeadParameters,\n\tSubmitAtVersionParameters,\n} from \"../../domains/cloud-v2/luau-execution-tasks/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport type { ResourceClient } from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\nimport { type PollDeps, pollUntilDoneCore, type PollUntilDoneOptions } from \"./polling.ts\";\n\n/**\n * Builds the {@link PollDeps} bundle used by {@link pollUntilDoneCore},\n * closing over the supplied {@link ResourceClient}, task ref, and\n * per-request options so the core loop stays narrow.\n *\n * @param inner - The {@link ResourceClient} that issues each `tasks.get` call.\n * @param args - The polling options and the task ref to fetch on every iteration.\n * @returns A {@link PollDeps} bundle wiring `fetch`, `now`, and `sleep`.\n */\nexport function buildPollDeps(\n\tinner: ResourceClient,\n\targs: { options: PollUntilDoneOptions; ref: LuauExecutionTaskRef },\n): PollDeps {\n\treturn {\n\t\tfetch: async () => {\n\t\t\treturn inner.execute({\n\t\t\t\toptions: args.options,\n\t\t\t\tparameters: { ref: args.ref, view: \"BASIC\" },\n\t\t\t\tspec: GET_SPEC,\n\t\t\t});\n\t\t},\n\t\tnow: Date.now,\n\t\tsleep: inner.sleep,\n\t};\n}\n\n/**\n * Submits a Luau execution task and polls it to a terminal state.\n * Dispatches to the head-version or specific-version submit spec based on\n * the presence of `versionId`, then delegates to {@link pollUntilDoneCore}.\n *\n * @param inner - The {@link ResourceClient} that issues submit and poll calls.\n * @param args - The polling options and submit parameters.\n * @returns A {@link Result} wrapping the terminal {@link LuauExecutionTask}, or\n * the {@link OpenCloudError} that caused submit or polling to fail.\n */\nexport async function submitAndPoll(\n\tinner: ResourceClient,\n\targs: {\n\t\toptions: PollUntilDoneOptions;\n\t\tparameters: SubmitAtHeadParameters | SubmitAtVersionParameters;\n\t},\n): Promise<Result<LuauExecutionTask, OpenCloudError>> {\n\tconst { options, parameters } = args;\n\tconst submitResult = await (\"versionId\" in parameters\n\t\t? inner.execute({ options, parameters, spec: SUBMIT_VERSION_SPEC })\n\t\t: inner.execute({ options, parameters, spec: SUBMIT_HEAD_SPEC }));\n\tif (!submitResult.success) {\n\t\treturn submitResult;\n\t}\n\n\treturn pollUntilDoneCore(\n\t\tbuildPollDeps(inner, { options, ref: submitResult.data.ref }),\n\t\toptions,\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,qBACf,YACuC;CACvC,MAAM,EAAE,UAAU,WAAW,QAAQ;CACrC,MAAM,EAAE,SAAS,WAAW,QAAQ,YAAY,cAAc;CAE9D,IAAI,cAAc,KAAA,GACjB,OAAO;EACN,KAAK,IAAI,gBAAgB,mDAAmD,EAC3E,MAAM,iBACP,CAAC;EACD,SAAS;CACV;CAGD,IAAI,cAAc,KAAA,GACjB,OAAO;EACN,KAAK,IAAI,gBAAgB,mDAAmD,EAC3E,MAAM,iBACP,CAAC;EACD,SAAS;CACV;CAKD,OAAO;EAAE,MAAM;GAAE,QAAQ;GAAO,KAAA,GADjB,uBADqB,WAAW,UAAU,QAAQ,YAAY,UAAU,2BAA2B,UAAU,SAAS,OAAO,OACxH,GAAG,WAAW,UAAU,SAAS,EAAE,SAAS;EAC5B;EAAG,SAAS;CAAK;AACtD;AAEA,SAAS,WAAW,UAA8B,WAAgD;CACjG,MAAM,QAAQ,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;CAExD,IAAI,aAAa,KAAA,GAChB,MAAM,OAAO,eAAe,OAAO,QA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,eAAe;CAChC,MAAM,eAAe,OAAO,eAAe,aACxC,MAAM,QAAQ;EAAE;EAAS;EAAY,MAAM;CAAoB,CAAC,IAChE,MAAM,QAAQ;EAAE;EAAS;EAAY,MAAM;CAAiB,CAAC;CAChE,IAAI,CAAC,aAAa,SACjB,OAAO;CAGR,OAAO,kBACN,cAAc,OAAO;EAAE;EAAS,KAAK,aAAa,KAAK;CAAI,CAAC,GAC5D,OACD;AACD"}
1
+ {"version":3,"file":"polling-helpers-Cb4j4cq7.mjs","names":["SECONDS_PER_MINUTE","malformed","makeSpec"],"sources":["../src/domains/cloud-v2/luau-execution-task-logs/builders.ts","../src/domains/cloud-v2/luau-execution-task-logs/operations.ts","../src/domains/cloud-v2/luau-execution-task-logs/parsers.ts","../src/domains/cloud-v2/luau-execution-task-logs/specs.ts","../src/domains/cloud-v2/luau-execution-tasks/builders.ts","../src/domains/cloud-v2/luau-execution-tasks/operations.ts","../src/domains/cloud-v2/luau-execution-tasks/parsers.ts","../src/domains/cloud-v2/luau-execution-tasks/specs.ts","../src/resources/luau-execution/polling.ts","../src/resources/luau-execution/polling-helpers.ts"],"sourcesContent":["import type { HttpRequest } from \"../../../client/types.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { ListLogsParameters } from \"./types.ts\";\n\n/**\n * Builds a `GET` request for the Open Cloud \"list Luau execution session\n * task logs\" endpoint. The endpoint requires the maximal x-aep-resource\n * path shape (universe, place, version, session, task), so the supplied\n * ref must include `versionId` and `sessionId`; refs extracted from the\n * narrower path formats are rejected with a {@link ValidationError}.\n *\n * The `view` query parameter is hard-coded to `STRUCTURED` so callers\n * always receive typed structured messages. No public `view` parameter\n * is exposed.\n *\n * @param parameters - Task ref, and optional `pageSize` and `pageToken`\n * pagination controls.\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when the ref is missing `versionId` or\n * `sessionId`.\n */\nexport function buildListLogsRequest(\n\tparameters: ListLogsParameters,\n): Result<HttpRequest, ValidationError> {\n\tconst { pageSize, pageToken, ref } = parameters;\n\tconst { placeId, sessionId, taskId, universeId, versionId } = ref;\n\n\tif (versionId === undefined) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Task ref is missing versionId; cannot list logs\", {\n\t\t\t\tcode: \"incomplete_ref\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tif (sessionId === undefined) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Task ref is missing sessionId; cannot list logs\", {\n\t\t\t\tcode: \"incomplete_ref\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst base = `/cloud/v2/universes/${universeId}/places/${placeId}/versions/${versionId}/luau-execution-sessions/${sessionId}/tasks/${taskId}/logs`;\n\tconst url = `${base}?${buildQuery(pageSize, pageToken).toString()}`;\n\treturn { data: { method: \"GET\", url }, success: true };\n}\n\nfunction buildQuery(pageSize: number | undefined, pageToken: string | undefined): URLSearchParams {\n\tconst query = new URLSearchParams({ view: \"STRUCTURED\" });\n\n\tif (pageSize !== undefined) {\n\t\tquery.append(\"maxPageSize\", String(pageSize));\n\t}\n\n\tif (pageToken !== undefined) {\n\t\tquery.append(\"pageToken\", pageToken);\n\t}\n\n\treturn query;\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst LIST_LOGS_PER_MINUTE = 45;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for listing Luau execution task logs,\n * sourced from `x-roblox-rate-limits.perApiKeyOwner` on the\n * `Cloud_ListLuauExecutionSessionTaskLogs` operation (45 requests per\n * minute per API key owner).\n */\nexport const LIST_LOGS_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: LIST_LOGS_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"luau-execution-task-logs.list\",\n});\n\n/**\n * Scopes required to list Luau execution task logs, sourced from\n * `x-roblox-scopes` on the list-logs operation in the vendored OpenAPI\n * schema. Surfaced via the `requiredScopes` field of the per-method\n * spec so a 401 or 403 ApiError is upgraded to a `PermissionError`\n * naming the missing scope. Only `:read` is required as the\n * minimum-privilege scope for this read-only operation.\n */\nexport const LIST_LOGS_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe.place.luau-execution-session:read\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { LogMessage, LogPage } from \"./types.ts\";\nimport type { LogChunkWire, LogMessageWire } from \"./wire.ts\";\n\nconst MALFORMED_LOGS_MESSAGE = \"Malformed list-luau-execution-task-logs response\";\n\n/**\n * Parses a successful Open Cloud list-luau-execution-task-logs response\n * body into the public {@link LogPage} shape. Chunks are flattened into\n * a single ordered array of {@link LogMessage} values. The\n * `MESSAGE_TYPE_UNSPECIFIED` sentinel is rejected.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud API.\n * @returns A success result wrapping the parsed {@link LogPage}, or an\n * {@link ApiError} when the body does not match a supported shape.\n */\nexport function parseListLogsResponse(response: HttpResponse): Result<LogPage, ApiError> {\n\tconst { body, status: statusCode } = response;\n\tif (!isRecord(body)) {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst rawChunks = body[\"luauExecutionSessionTaskLogs\"] ?? undefined;\n\tif (!isOptionalLogChunks(rawChunks)) {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst rawToken = body[\"nextPageToken\"] ?? undefined;\n\tif (rawToken !== undefined && typeof rawToken !== \"string\") {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst messages: Array<LogMessage> = [];\n\tfor (const chunk of rawChunks ?? []) {\n\t\tfor (const wireMessage of chunk.structuredMessages ?? []) {\n\t\t\tmessages.push({\n\t\t\t\tcreateTime: wireMessage.createTime,\n\t\t\t\tmessage: wireMessage.message,\n\t\t\t\tmessageType: wireMessage.messageType,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn {\n\t\tdata: { messages, nextPageToken: rawToken },\n\t\tsuccess: true,\n\t};\n}\n\nfunction isAcceptedMessageType(value: unknown): value is LogMessageWire[\"messageType\"] {\n\treturn value === \"OUTPUT\" || value === \"INFO\" || value === \"WARNING\" || value === \"ERROR\";\n}\n\nfunction isLogMessageWire(value: unknown): value is LogMessageWire {\n\treturn (\n\t\tisRecord(value) &&\n\t\ttypeof value[\"createTime\"] === \"string\" &&\n\t\ttypeof value[\"message\"] === \"string\" &&\n\t\tisAcceptedMessageType(value[\"messageType\"])\n\t);\n}\n\nfunction isOptionalStructuredMessages(\n\tvalue: unknown,\n): value is ReadonlyArray<LogMessageWire> | undefined {\n\treturn (\n\t\tvalue === undefined ||\n\t\t(Array.isArray(value) && value.every((item: unknown) => isLogMessageWire(item)))\n\t);\n}\n\nfunction isLogChunkWire(value: unknown): value is LogChunkWire {\n\treturn isRecord(value) && isOptionalStructuredMessages(value[\"structuredMessages\"]);\n}\n\nfunction isOptionalLogChunks(value: unknown): value is ReadonlyArray<LogChunkWire> | undefined {\n\treturn (\n\t\tvalue === undefined ||\n\t\t(Array.isArray(value) && value.every((item: unknown) => isLogChunkWire(item)))\n\t);\n}\n\nfunction malformed(statusCode: number): Result<LogPage, ApiError> {\n\treturn { err: new ApiError(MALFORMED_LOGS_MESSAGE, { statusCode }), success: false };\n}\n","import { IDEMPOTENT_METHOD_DEFAULTS } from \"../../../internal/http/retry.ts\";\nimport type { ResourceMethodSpec } from \"../../../internal/resource-client.ts\";\nimport { buildListLogsRequest } from \"./builders.ts\";\nimport { LIST_LOGS_OPERATION_LIMIT, LIST_LOGS_REQUIRED_SCOPES } from \"./operations.ts\";\nimport { parseListLogsResponse } from \"./parsers.ts\";\nimport type { ListLogsParameters, LogPage } from \"./types.ts\";\n\nfunction makeSpec<P>(spec: ResourceMethodSpec<P, LogPage>): ResourceMethodSpec<P, LogPage> {\n\treturn Object.freeze(spec);\n}\n\n/**\n * Per-method dispatch spec for listing the structured log messages\n * produced by a Luau execution task. Frozen at module scope so both\n * the top-level `LuauExecutionClient` and the `luauExecution` Operation\n * Group on `PlacesClient` share the same instance reference.\n */\nexport const LIST_LOGS_SPEC = makeSpec<ListLogsParameters>({\n\tbuildRequest: buildListLogsRequest,\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: LIST_LOGS_OPERATION_LIMIT,\n\tparse: parseListLogsResponse,\n\trequiredScopes: LIST_LOGS_REQUIRED_SCOPES,\n});\n","import type { HttpRequest } from \"../../../client/types.ts\";\nimport { ValidationError } from \"../../../errors/validation.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { GetParameters, SubmitAtHeadParameters, SubmitAtVersionParameters } from \"./types.ts\";\n\ninterface SubmitBodyInput {\n\treadonly binaryInput?: string | undefined;\n\treadonly enableBinaryOutput?: boolean | undefined;\n\treadonly script: string;\n\treadonly timeoutSeconds?: number;\n}\n\nconst JSON_HEADERS: Readonly<Record<string, string>> = { \"content-type\": \"application/json\" };\n\n/**\n * Builds a `POST` request for the Open Cloud \"create Luau execution\n * session task\" endpoint, targeting the place's head version. Serializes\n * `timeoutSeconds` into the wire's duration string format (`\"<n>s\"`)\n * when supplied.\n *\n * @param parameters - Universe and place identifiers, the script body,\n * and an optional `timeoutSeconds`.\n * @returns A pure {@link HttpRequest} describing the submit call.\n */\nexport function buildSubmitAtHeadRequest(parameters: SubmitAtHeadParameters): HttpRequest {\n\tconst { placeId, universeId } = parameters;\n\treturn {\n\t\tbody: buildSubmitBody(parameters),\n\t\theaders: JSON_HEADERS,\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${universeId}/places/${placeId}/luau-execution-session-tasks`,\n\t};\n}\n\n/**\n * Builds a `POST` request for the Open Cloud \"create Luau execution\n * session task\" endpoint, targeting a specific place version. Differs\n * from {@link buildSubmitAtHeadRequest} only in URL shape: the path\n * includes the `versions/{versionId}` segment so the script runs\n * against that exact place version instead of the live head.\n *\n * @param parameters - Universe, place, and version identifiers, the\n * script body, and an optional `timeoutSeconds`.\n * @returns A pure {@link HttpRequest} describing the submit call.\n */\nexport function buildSubmitAtVersionRequest(parameters: SubmitAtVersionParameters): HttpRequest {\n\tconst { placeId, universeId, versionId } = parameters;\n\treturn {\n\t\tbody: buildSubmitBody(parameters),\n\t\theaders: JSON_HEADERS,\n\t\tmethod: \"POST\",\n\t\turl: `/cloud/v2/universes/${universeId}/places/${placeId}/versions/${versionId}/luau-execution-session-tasks`,\n\t};\n}\n\n/**\n * Builds a `GET` request for the Open Cloud \"read Luau execution session\n * task\" endpoint. The endpoint accepts only the maximal x-aep-resource\n * path shape (universe, place, version, session, task), so the supplied\n * ref must include `versionId` and `sessionId`; refs extracted from the\n * narrower path formats are rejected with a {@link ValidationError}.\n *\n * @param parameters - Task ref and optional view selector. When `view`\n * is omitted, no `?view=` query is sent and the server applies its\n * own default (`BASIC`).\n * @returns A success result wrapping the request, or a\n * {@link ValidationError} when the ref is missing `versionId` or\n * `sessionId`.\n */\nexport function buildGetRequest(parameters: GetParameters): Result<HttpRequest, ValidationError> {\n\tconst { ref, view } = parameters;\n\tconst { placeId, sessionId, taskId, universeId, versionId } = ref;\n\n\tif (versionId === undefined) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Task ref is missing versionId; cannot GET\", {\n\t\t\t\tcode: \"incomplete_ref\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tif (sessionId === undefined) {\n\t\treturn {\n\t\t\terr: new ValidationError(\"Task ref is missing sessionId; cannot GET\", {\n\t\t\t\tcode: \"incomplete_ref\",\n\t\t\t}),\n\t\t\tsuccess: false,\n\t\t};\n\t}\n\n\tconst base = `/cloud/v2/universes/${universeId}/places/${placeId}/versions/${versionId}/luau-execution-sessions/${sessionId}/tasks/${taskId}`;\n\tconst url = view === undefined ? base : `${base}?view=${view}`;\n\treturn { data: { method: \"GET\", url }, success: true };\n}\n\nfunction buildSubmitBody(parameters: SubmitBodyInput): Record<string, unknown> {\n\tconst {\n\t\tbinaryInput,\n\t\tenableBinaryOutput: shouldEnableBinaryOutput,\n\t\tscript,\n\t\ttimeoutSeconds,\n\t} = parameters;\n\tconst body: Record<string, unknown> = { script };\n\tif (timeoutSeconds !== undefined) {\n\t\tbody[\"timeout\"] = `${timeoutSeconds}s`;\n\t}\n\n\tif (binaryInput !== undefined) {\n\t\tbody[\"binaryInput\"] = binaryInput;\n\t}\n\n\tif (shouldEnableBinaryOutput !== undefined) {\n\t\tbody[\"enableBinaryOutput\"] = shouldEnableBinaryOutput;\n\t}\n\n\treturn body;\n}\n","import type { OperationLimit } from \"../../../internal/http/rate-limit-queue.ts\";\n\nconst SUBMIT_PER_MINUTE = 40;\nconst GET_PER_MINUTE = 200;\nconst SECONDS_PER_MINUTE = 60;\n\n/**\n * Per-second request ceiling for submitting a Luau execution task,\n * sourced from `x-roblox-rate-limits.perApiKeyOwner` on the\n * `Cloud_CreateLuauExecutionSessionTask__Using_Universes` operation\n * (40 requests per minute per API key owner). The two URL shapes\n * (head and version) share this queue because Roblox attributes both\n * to the same per-minute quota.\n */\nexport const SUBMIT_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: SUBMIT_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"luau-execution-tasks.submit\",\n});\n\n/**\n * Per-second request ceiling for fetching a Luau execution task,\n * sourced from `x-roblox-rate-limits.perApiKeyOwner` on the\n * `Cloud_GetLuauExecutionSessionTask` operation (200 requests per\n * minute per API key owner).\n */\nexport const GET_OPERATION_LIMIT: OperationLimit = Object.freeze({\n\tmaxPerSecond: GET_PER_MINUTE / SECONDS_PER_MINUTE,\n\toperationKey: \"luau-execution-tasks.get\",\n});\n\n/**\n * Scopes required to submit a Luau execution task, sourced from\n * `x-roblox-scopes` on the create operation in the vendored OpenAPI\n * schema. Surfaced via the `requiredScopes` field of the per-method\n * spec so a 401 or 403 ApiError is upgraded to a `PermissionError`\n * naming the missing scope.\n */\nexport const SUBMIT_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe.place.luau-execution-session:write\",\n]);\n\n/**\n * Scopes required to fetch a Luau execution task, sourced from\n * `x-roblox-scopes` on the get operation. The `:write` scope also\n * grants read in upstream auth, but we surface only `:read` here as\n * the minimum-privilege requirement for this method.\n */\nexport const GET_REQUIRED_SCOPES: ReadonlyArray<string> = Object.freeze([\n\t\"universe.place.luau-execution-session:read\",\n]);\n","import type { HttpResponse } from \"../../../client/types.ts\";\nimport { ApiError } from \"../../../errors/api-error.ts\";\nimport { isDateTimeString } from \"../../../internal/utils/is-date-time-string.ts\";\nimport { isRecord } from \"../../../internal/utils/is-record.ts\";\nimport type { Result } from \"../../../types.ts\";\nimport type { LuauExecutionTask, LuauExecutionTaskRef } from \"./types.ts\";\nimport type {\n\tLuauExecutionTaskErrorWire,\n\tLuauExecutionTaskOutputWire,\n\tLuauExecutionTaskWire,\n} from \"./wire.ts\";\n\nconst MALFORMED_TASK_MESSAGE = \"Malformed luau-execution-session-task response\";\n\n// Matches any of the four x-aep-resource path formats for a luau\n// execution session task.\n//\n// Capture groups:\n// 1. universeId\n// 2. placeId\n// 3. versionId (when `/versions/{v}/` segment is present, else undefined)\n// 4. sessionId (when `/luau-execution-sessions/{s}/tasks/...` branch matched)\n// 5. taskId (when `/luau-execution-sessions/.../tasks/{t}` branch matched)\n// 6. taskId (when `/luau-execution-session-tasks/{t}` branch matched)\nconst PATH_PATTERN =\n\t/^universes\\/(\\d+)\\/places\\/(\\d+)(?:\\/versions\\/(\\d+))?(?:\\/luau-execution-sessions\\/([^/]+)\\/tasks\\/([^/]+)|\\/luau-execution-session-tasks\\/([^/]+))$/;\n\ntype InProgressWireState = Exclude<LuauExecutionTaskWire[\"state\"], \"COMPLETE\" | \"FAILED\">;\n\ninterface ParseVariantArgs {\n\treadonly body: LuauExecutionTaskWire;\n\treadonly createdAt: Date | undefined;\n\treadonly ref: LuauExecutionTaskRef;\n\treadonly statusCode: number;\n\treadonly timeoutSeconds: number | undefined;\n\treadonly updatedAt: Date | undefined;\n}\n\n/**\n * Parses a successful Open Cloud `LuauExecutionSessionTask` response\n * body into the public {@link LuauExecutionTask} discriminated union.\n * Handles every supported task state (in-progress, COMPLETE, FAILED)\n * across all four x-aep-resource path shapes the server returns.\n *\n * @param response - The full {@link HttpResponse} from the Open Cloud\n * API.\n * @returns A success result wrapping the parsed task, or an\n * {@link ApiError} when the body or path do not match a supported\n * shape.\n */\nexport function parseLuauExecutionTaskResponse(\n\tresponse: HttpResponse,\n): Result<LuauExecutionTask, ApiError> {\n\tconst { body, status: statusCode } = response;\n\tif (!isLuauExecutionTaskWire(body)) {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst ref = parseTaskRef(body.path);\n\tif (ref === undefined) {\n\t\treturn malformed(statusCode);\n\t}\n\n\tconst timeoutSeconds = parseTimeoutSeconds(body.timeout);\n\tconst createdAt = parseOptionalDate(body.createTime);\n\tconst updatedAt = parseOptionalDate(body.updateTime);\n\n\tif (body.state === \"COMPLETE\") {\n\t\treturn parseCompleteTask({ body, createdAt, ref, statusCode, timeoutSeconds, updatedAt });\n\t}\n\n\tif (body.state === \"FAILED\") {\n\t\treturn parseFailedTask({ body, createdAt, ref, statusCode, timeoutSeconds, updatedAt });\n\t}\n\n\treturn parseInProgressTask({\n\t\tbody,\n\t\tcreatedAt,\n\t\tref,\n\t\tstate: body.state,\n\t\tstatusCode,\n\t\ttimeoutSeconds,\n\t\tupdatedAt,\n\t});\n}\n\nfunction isAcceptedWireState(\n\tstate: unknown,\n): state is \"CANCELLED\" | \"COMPLETE\" | \"FAILED\" | \"PROCESSING\" | \"QUEUED\" {\n\treturn (\n\t\tstate === \"QUEUED\" ||\n\t\tstate === \"PROCESSING\" ||\n\t\tstate === \"CANCELLED\" ||\n\t\tstate === \"COMPLETE\" ||\n\t\tstate === \"FAILED\"\n\t);\n}\n\nfunction isErrorWireCode(code: unknown): code is LuauExecutionTaskErrorWire[\"code\"] {\n\treturn (\n\t\tcode === \"SCRIPT_ERROR\" ||\n\t\tcode === \"DEADLINE_EXCEEDED\" ||\n\t\tcode === \"OUTPUT_SIZE_LIMIT_EXCEEDED\" ||\n\t\tcode === \"INTERNAL_ERROR\"\n\t);\n}\n\nfunction isErrorWire(value: unknown): value is LuauExecutionTaskErrorWire {\n\treturn (\n\t\tisRecord(value) && isErrorWireCode(value[\"code\"]) && typeof value[\"message\"] === \"string\"\n\t);\n}\n\nfunction isOptionalErrorWire(value: unknown): value is LuauExecutionTaskErrorWire | undefined {\n\treturn value === undefined || isErrorWire(value);\n}\n\nfunction isOutputWire(value: unknown): value is LuauExecutionTaskOutputWire {\n\treturn isRecord(value) && Array.isArray(value[\"results\"]);\n}\n\nfunction isOptionalOutputWire(value: unknown): value is LuauExecutionTaskOutputWire | undefined {\n\treturn value === undefined || isOutputWire(value);\n}\n\nfunction isOptionalString(value: unknown): value is string | undefined {\n\treturn value === undefined || typeof value === \"string\";\n}\n\nfunction isOptionalBoolean(value: unknown): value is boolean | undefined {\n\treturn value === undefined || typeof value === \"boolean\";\n}\n\nfunction isOptionalDateTimeString(value: unknown): value is string | undefined {\n\treturn value === undefined || isDateTimeString(value);\n}\n\nfunction isLuauExecutionTaskWire(body: unknown): body is LuauExecutionTaskWire {\n\treturn (\n\t\tisRecord(body) &&\n\t\ttypeof body[\"path\"] === \"string\" &&\n\t\tisOptionalDateTimeString(body[\"createTime\"]) &&\n\t\tisOptionalDateTimeString(body[\"updateTime\"]) &&\n\t\tisAcceptedWireState(body[\"state\"]) &&\n\t\ttypeof body[\"user\"] === \"string\" &&\n\t\tisOptionalOutputWire(body[\"output\"]) &&\n\t\tisOptionalErrorWire(body[\"error\"]) &&\n\t\tisOptionalDurationWire(body[\"timeout\"]) &&\n\t\tisOptionalString(body[\"binaryInput\"]) &&\n\t\tisOptionalBoolean(body[\"enableBinaryOutput\"]) &&\n\t\tisOptionalString(body[\"binaryOutputUri\"])\n\t);\n}\n\nfunction parseOptionalDate(value: string | undefined): Date | undefined {\n\treturn value === undefined ? undefined : new Date(value);\n}\n\nconst DURATION_PATTERN = /^(\\d+)s$/;\n\nfunction isOptionalDurationWire(value: unknown): value is string | undefined {\n\treturn value === undefined || (typeof value === \"string\" && DURATION_PATTERN.test(value));\n}\n\nfunction parseTimeoutSeconds(value: string | undefined): number | undefined {\n\tif (value === undefined) {\n\t\treturn undefined;\n\t}\n\n\tconst match = DURATION_PATTERN.exec(value);\n\tconst seconds = match?.[1];\n\tif (seconds === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn Number.parseInt(seconds, 10);\n}\n\nfunction malformed(statusCode: number): Result<LuauExecutionTask, ApiError> {\n\treturn { err: new ApiError(MALFORMED_TASK_MESSAGE, { statusCode }), success: false };\n}\n\nfunction parseInProgressTask(\n\targs: ParseVariantArgs & { readonly state: InProgressWireState },\n): Result<LuauExecutionTask, ApiError> {\n\tconst { body, createdAt, ref, state, timeoutSeconds, updatedAt } = args;\n\treturn {\n\t\tdata: {\n\t\t\tbinaryInput: body.binaryInput,\n\t\t\tbinaryOutputUri: body.binaryOutputUri,\n\t\t\tcreatedAt,\n\t\t\tenableBinaryOutput: body.enableBinaryOutput,\n\t\t\tref,\n\t\t\tstate,\n\t\t\ttimeoutSeconds,\n\t\t\tupdatedAt,\n\t\t\tuser: body.user,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction parseCompleteTask(args: ParseVariantArgs): Result<LuauExecutionTask, ApiError> {\n\tconst { body, createdAt, ref, statusCode, timeoutSeconds, updatedAt } = args;\n\tif (body.output === undefined) {\n\t\treturn malformed(statusCode);\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tbinaryInput: body.binaryInput,\n\t\t\tbinaryOutputUri: body.binaryOutputUri,\n\t\t\tcreatedAt,\n\t\t\tenableBinaryOutput: body.enableBinaryOutput,\n\t\t\toutput: { results: body.output.results },\n\t\t\tref,\n\t\t\tstate: \"COMPLETE\",\n\t\t\ttimeoutSeconds,\n\t\t\tupdatedAt,\n\t\t\tuser: body.user,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction parseFailedTask(args: ParseVariantArgs): Result<LuauExecutionTask, ApiError> {\n\tconst { body, createdAt, ref, statusCode, timeoutSeconds, updatedAt } = args;\n\tif (body.error === undefined) {\n\t\treturn malformed(statusCode);\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tbinaryInput: body.binaryInput,\n\t\t\tbinaryOutputUri: body.binaryOutputUri,\n\t\t\tcreatedAt,\n\t\t\tenableBinaryOutput: body.enableBinaryOutput,\n\t\t\terror: { code: body.error.code, message: body.error.message },\n\t\t\tref,\n\t\t\tstate: \"FAILED\",\n\t\t\ttimeoutSeconds,\n\t\t\tupdatedAt,\n\t\t\tuser: body.user,\n\t\t},\n\t\tsuccess: true,\n\t};\n}\n\nfunction parseTaskRef(path: string): LuauExecutionTaskRef | undefined {\n\tconst match = PATH_PATTERN.exec(path);\n\tif (match === null) {\n\t\treturn undefined;\n\t}\n\n\tconst [, universeId, placeId, versionId, sessionId, sessionTaskId, plainTaskId] = match;\n\tconst taskId = sessionTaskId ?? plainTaskId;\n\tif (universeId === undefined || placeId === undefined || taskId === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn { placeId, sessionId, taskId, universeId, versionId };\n}\n","import {\n\tCREATE_METHOD_DEFAULTS,\n\tIDEMPOTENT_METHOD_DEFAULTS,\n} from \"../../../internal/http/retry.ts\";\nimport { okRequest, type ResourceMethodSpec } from \"../../../internal/resource-client.ts\";\nimport {\n\tbuildGetRequest,\n\tbuildSubmitAtHeadRequest,\n\tbuildSubmitAtVersionRequest,\n} from \"./builders.ts\";\nimport {\n\tGET_OPERATION_LIMIT,\n\tGET_REQUIRED_SCOPES,\n\tSUBMIT_OPERATION_LIMIT,\n\tSUBMIT_REQUIRED_SCOPES,\n} from \"./operations.ts\";\nimport { parseLuauExecutionTaskResponse } from \"./parsers.ts\";\nimport type {\n\tGetParameters,\n\tLuauExecutionTask,\n\tSubmitAtHeadParameters,\n\tSubmitAtVersionParameters,\n} from \"./types.ts\";\n\nfunction makeSpec<P>(\n\tspec: ResourceMethodSpec<P, LuauExecutionTask>,\n): ResourceMethodSpec<P, LuauExecutionTask> {\n\treturn Object.freeze(spec);\n}\n\n/**\n * Per-method dispatch spec for submitting a Luau execution task at a\n * place's head version. Frozen at module scope so both the top-level\n * `LuauExecutionClient` and the `luauExecution` Operation Group on\n * `PlacesClient` share the same instance reference.\n */\nexport const SUBMIT_HEAD_SPEC = makeSpec<SubmitAtHeadParameters>({\n\tbuildRequest: (parameters) => okRequest(buildSubmitAtHeadRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: SUBMIT_OPERATION_LIMIT,\n\tparse: parseLuauExecutionTaskResponse,\n\trequiredScopes: SUBMIT_REQUIRED_SCOPES,\n});\n\n/**\n * Per-method dispatch spec for submitting a Luau execution task at a\n * specific place version. Shares the rate-limit queue and required\n * scope set with {@link SUBMIT_HEAD_SPEC} because Roblox attributes\n * both URL shapes to one per-minute quota.\n */\nexport const SUBMIT_VERSION_SPEC = makeSpec<SubmitAtVersionParameters>({\n\tbuildRequest: (parameters) => okRequest(buildSubmitAtVersionRequest(parameters)),\n\tmethodDefaults: CREATE_METHOD_DEFAULTS,\n\tmethodKind: \"create\",\n\toperationLimit: SUBMIT_OPERATION_LIMIT,\n\tparse: parseLuauExecutionTaskResponse,\n\trequiredScopes: SUBMIT_REQUIRED_SCOPES,\n});\n\n/**\n * Per-method dispatch spec for fetching a Luau execution task. Uses\n * idempotent retry semantics (429 and 5xx both retried) so reads\n * recover transparently from transient server errors.\n */\nexport const GET_SPEC = makeSpec<GetParameters>({\n\tbuildRequest: buildGetRequest,\n\tmethodDefaults: IDEMPOTENT_METHOD_DEFAULTS,\n\tmethodKind: \"idempotent\",\n\toperationLimit: GET_OPERATION_LIMIT,\n\tparse: parseLuauExecutionTaskResponse,\n\trequiredScopes: GET_REQUIRED_SCOPES,\n});\n","import type { RequestOptions } from \"../../client/types.ts\";\nimport type { LuauExecutionTask } from \"../../domains/cloud-v2/luau-execution-tasks/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport { NetworkError } from \"../../errors/network-error.ts\";\nimport { PollAbortedError } from \"../../errors/poll-aborted.ts\";\nimport { PollTimeoutError } from \"../../errors/poll-timeout.ts\";\nimport { TRANSIENT_TRANSPORT_CODES } from \"../../internal/http/retry.ts\";\nimport { findErrorCode } from \"../../internal/utils/find-error-code.ts\";\nimport type { SleepFunc } from \"../../internal/utils/sleep.ts\";\nimport type { Result } from \"../../types.ts\";\n\n/** Default total polling budget in milliseconds (5 minutes). */\nexport const DEFAULT_POLL_TIMEOUT_MS = 300_000;\n\n/** One step of the default poll-cadence schedule. */\ninterface PollDelayTier {\n\t/** Delay in ms to wait between polls while within this tier. */\n\treadonly delayMs: number;\n\t/** Upper elapsed-time bound (exclusive) at which this tier stops applying. */\n\treadonly untilMs: number;\n}\n\n/** Steady-state delay once elapsed time reaches the final tier bound. */\nconst STEADY_POLL_DELAY_MS = 5_000;\n\n/**\n * Fast-to-slow poll-cadence tiers keyed on elapsed wall-clock time. Elapsed\n * times at or beyond the last `untilMs` fall through to\n * {@link STEADY_POLL_DELAY_MS}.\n */\nconst DEFAULT_POLL_TIERS: ReadonlyArray<PollDelayTier> = [\n\t{ delayMs: 500, untilMs: 20_000 },\n\t{ delayMs: 1_000, untilMs: 60_000 },\n];\n\n/**\n * Default poll cadence as a function of elapsed wall-clock time since\n * polling began. Polls quickly while a task is young so short runs resolve\n * snappily, then eases off so a long run leaves rate-limit headroom for\n * newer tasks: 0-20s is 500ms, 20-60s is 1000ms, 60s+ is 5000ms.\n *\n * @since 0.1.0\n *\n * @example\n * ```ts\n * import { defaultPollDelay } from \"@bedrock-rbx/ocale/luau-execution\";\n *\n * expect(defaultPollDelay(0)).toBe(500);\n * expect(defaultPollDelay(30_000)).toBe(1000);\n * expect(defaultPollDelay(120_000)).toBe(5000);\n * ```\n *\n * @param elapsedMs - Milliseconds elapsed since polling started.\n * @returns The delay in milliseconds to wait before the next poll.\n */\nexport function defaultPollDelay(elapsedMs: number): number {\n\tconst tier = DEFAULT_POLL_TIERS.find((candidate) => elapsedMs < candidate.untilMs);\n\treturn tier?.delayMs ?? STEADY_POLL_DELAY_MS;\n}\n\n/**\n * Default number of consecutive transport failures tolerated before the poll\n * loop gives up. With per-request retries already absorbing isolated blips,\n * three consecutive loop-level failures signals a genuinely unreachable\n * endpoint, so it bails in seconds rather than spinning out the wall-clock budget.\n */\nexport const DEFAULT_POLL_FAILURE_CAP = 3;\n\n/**\n * Injected dependencies for the deep-module polling loop. The `fetch`\n * callback is pre-bound by the wiring layer and closes over the task ref\n * and request options, keeping the core loop narrow.\n */\nexport interface PollDeps {\n\t/** Returns the current task or an error. Called on each loop iteration. */\n\treadonly fetch: () => Promise<Result<LuauExecutionTask, OpenCloudError>>;\n\t/** Returns the current wall-clock time in ms. */\n\treadonly now: () => number;\n\t/** Injectable sleep for deterministic tests. */\n\treadonly sleep: SleepFunc;\n}\n\n/**\n * Public options accepted by `pollUntilDone` and `runUntilDone` on both client surfaces.\n *\n * @since 0.1.0\n */\nexport type PollUntilDoneOptions = PollOptions & RequestOptions;\n\n/** Caller-supplied polling-loop options; all fields optional. */\ninterface PollOptions {\n\t/**\n\t * Consecutive transient transport failures tolerated before the loop gives\n\t * up. Defaults to {@link DEFAULT_POLL_FAILURE_CAP}. A successful poll resets\n\t * the count.\n\t */\n\treadonly maxConsecutivePollFailures?: number;\n\t/** Returns the sleep duration given ms elapsed since polling started. Defaults to {@link defaultPollDelay}. */\n\treadonly pollDelay?: (elapsedMs: number) => number;\n\t/** When aborted, the loop returns {@link PollAbortedError} rather than continuing. */\n\treadonly signal?: AbortSignal;\n\t/** Total wall-clock budget in ms before the loop returns {@link PollTimeoutError}. */\n\treadonly timeoutMs?: number;\n}\n\n/**\n * Defaults the per-request `timeout` to the effective poll budget when the\n * caller has not set one. A luau-execution submit and each poll `get` normally\n * answer in well under a second (the submit endpoint enqueues the task without\n * waiting for it to run), so the only job of a per-request deadline here is to\n * bound a black-hole connection. Leaving these requests on the client-wide 30s\n * default (tuned for snappy CRUD) turns a slow-but-alive backend into a\n * self-abort, an error the retry layer never retries by construction, before\n * the loop's wall-clock budget is ever consulted. Deriving the deadline from\n * `timeoutMs` keeps a single request alive exactly as long as the caller\n * already agreed to wait for the whole operation, so the backend can answer or\n * surface a retryable status instead.\n *\n * @param options - The caller's poll and per-request options.\n * @returns The options with `timeout` filled from the budget when it was unset.\n */\nexport function withBudgetRequestTimeout(options: PollUntilDoneOptions): PollUntilDoneOptions {\n\tif (options.timeout !== undefined) {\n\t\treturn options;\n\t}\n\n\treturn { ...options, timeout: options.timeoutMs ?? DEFAULT_POLL_TIMEOUT_MS };\n}\n\nconst ABORTED = Symbol(\"poll-aborted\");\ntype Aborted = typeof ABORTED;\n\ninterface AbortObserver {\n\treadonly cleanup: () => void;\n\treadonly promise: Promise<Aborted>;\n}\n\ninterface SleepWithAbortOptions {\n\treadonly ms: number;\n\treadonly signal: AbortSignal | undefined;\n\treadonly sleep: SleepFunc;\n}\n\ntype FetchOutcome =\n\t| { readonly error: NetworkError; readonly kind: \"transient\" }\n\t| { readonly error: OpenCloudError; readonly kind: \"failed\" }\n\t| { readonly kind: \"aborted\" }\n\t| { readonly kind: \"pending\"; readonly task: LuauExecutionTask }\n\t| { readonly kind: \"terminal\"; readonly task: LuauExecutionTask };\n\n/** Mutable-per-iteration loop state threaded through {@link applyOutcome}. */\ninterface LoopState {\n\treadonly consecutiveFailures: number;\n\treadonly lastTask: LuauExecutionTask | undefined;\n}\n\ntype LoopAction =\n\t| { readonly kind: \"continue\"; readonly state: LoopState }\n\t| { readonly kind: \"return\"; readonly result: Result<LuauExecutionTask, OpenCloudError> };\n\n/** Per-iteration inputs to {@link applyOutcome}. */\ninterface OutcomeContext {\n\treadonly maxFailures: number;\n\treadonly signal: AbortSignal | undefined;\n\treadonly state: LoopState;\n}\n\n/**\n * Core polling loop. Calls `deps.fetch()` repeatedly, sleeping\n * `pollDelay(elapsedMs)` ms between iterations, until a terminal state\n * is observed, the wall-clock budget is exhausted, or an `AbortSignal`\n * fires. A transient transport failure ({@link NetworkError}) is tolerated\n * and the loop continues, giving up only after `maxConsecutivePollFailures`\n * consecutive failures; any other failure aborts immediately, since an API\n * response (a 404 for a vanished task, a 403) means there is nothing left to\n * poll. A successful poll resets the failure count.\n *\n * @param deps - Injected fetch, now, and sleep callbacks.\n * @param options - Optional poll delay, timeout, failure cap, and abort signal.\n * @returns The terminal task, or an error if aborted, timed out, or the transport keeps failing.\n */\nexport async function pollUntilDoneCore(\n\tdeps: PollDeps,\n\toptions: PollOptions = {},\n): Promise<Result<LuauExecutionTask, OpenCloudError>> {\n\tconst timeoutMs = options.timeoutMs ?? DEFAULT_POLL_TIMEOUT_MS;\n\tconst pollDelay = options.pollDelay ?? defaultPollDelay;\n\tconst maxFailures = options.maxConsecutivePollFailures ?? DEFAULT_POLL_FAILURE_CAP;\n\tconst sig = options.signal;\n\tconst startedAt = deps.now();\n\tif (sig?.aborted === true) {\n\t\treturn abortedResult(sig);\n\t}\n\n\tlet state: LoopState = { consecutiveFailures: 0, lastTask: undefined };\n\tfor (;;) {\n\t\tconst elapsedMs = deps.now() - startedAt;\n\t\tif (elapsedMs >= timeoutMs) {\n\t\t\treturn { err: makeTimeout(state.lastTask, timeoutMs), success: false };\n\t\t}\n\n\t\tconst outcome = await fetchOnce(deps, sig);\n\t\tconst action = applyOutcome(outcome, { maxFailures, signal: sig, state });\n\t\tif (action.kind === \"return\") {\n\t\t\treturn action.result;\n\t\t}\n\n\t\t({ state } = action);\n\t\tif (await sleepWithAbort({ ms: pollDelay(elapsedMs), signal: sig, sleep: deps.sleep })) {\n\t\t\treturn abortedResult(sig);\n\t\t}\n\t}\n}\n\nfunction makeAborted(signal: AbortSignal | undefined): PollAbortedError {\n\treturn new PollAbortedError(\"Polling was aborted\", { reason: signal?.reason });\n}\n\nfunction abortedResult(signal: AbortSignal | undefined): Result<LuauExecutionTask, OpenCloudError> {\n\treturn { err: makeAborted(signal), success: false };\n}\n\n/**\n * Maps a single fetch outcome to the next loop action. Terminal, failed, and\n * aborted outcomes return immediately; a transient transport failure advances\n * the consecutive-failure count and returns once it reaches `maxFailures`; a\n * pending task resets the count and continues.\n *\n * @param outcome - The classified result of one poll fetch.\n * @param context - The loop state, failure cap, and abort signal.\n * @returns Whether to return a final Result or continue with updated state.\n */\nfunction applyOutcome(outcome: FetchOutcome, context: OutcomeContext): LoopAction {\n\tconst { maxFailures, signal, state } = context;\n\tswitch (outcome.kind) {\n\t\tcase \"aborted\": {\n\t\t\treturn { kind: \"return\", result: abortedResult(signal) };\n\t\t}\n\t\tcase \"failed\": {\n\t\t\treturn { kind: \"return\", result: { err: outcome.error, success: false } };\n\t\t}\n\t\tcase \"pending\": {\n\t\t\treturn { kind: \"continue\", state: { consecutiveFailures: 0, lastTask: outcome.task } };\n\t\t}\n\t\tcase \"terminal\": {\n\t\t\treturn { kind: \"return\", result: { data: outcome.task, success: true } };\n\t\t}\n\t\tcase \"transient\": {\n\t\t\tconst consecutiveFailures = state.consecutiveFailures + 1;\n\t\t\tif (consecutiveFailures >= maxFailures) {\n\t\t\t\treturn { kind: \"return\", result: { err: outcome.error, success: false } };\n\t\t\t}\n\n\t\t\treturn { kind: \"continue\", state: { consecutiveFailures, lastTask: state.lastTask } };\n\t\t}\n\t}\n}\n\nfunction abortObserver(signal: AbortSignal): AbortObserver {\n\tconst { promise, resolve } = Promise.withResolvers<Aborted>();\n\tfunction onAbort(): void {\n\t\tresolve(ABORTED);\n\t}\n\n\tsignal.addEventListener(\"abort\", onAbort);\n\tfunction cleanup(): void {\n\t\tsignal.removeEventListener(\"abort\", onAbort);\n\t}\n\n\treturn { cleanup, promise };\n}\n\nasync function raceWithAbort<T>(\n\tpromise: Promise<T>,\n\tsignal: AbortSignal | undefined,\n): Promise<Aborted | T> {\n\tif (signal === undefined) {\n\t\treturn promise;\n\t}\n\n\tif (signal.aborted) {\n\t\treturn ABORTED;\n\t}\n\n\tconst observer = abortObserver(signal);\n\ttry {\n\t\treturn await Promise.race([promise, observer.promise]);\n\t} finally {\n\t\tobserver.cleanup();\n\t}\n}\n\nasync function sleepWithAbort(options: SleepWithAbortOptions): Promise<boolean> {\n\tconst { ms, signal, sleep } = options;\n\tconst raced = await raceWithAbort(sleep(ms), signal);\n\treturn raced === ABORTED;\n}\n\nfunction makeTimeout(\n\ttask: LuauExecutionTask | undefined,\n\ttimeoutMs: number,\n): PollTimeoutError<LuauExecutionTask> {\n\treturn new PollTimeoutError(`Polling timed out after ${timeoutMs} ms`, {\n\t\tlastObservedTask: task,\n\t\ttimeoutMs,\n\t});\n}\n\nfunction isTerminal(task: LuauExecutionTask): boolean {\n\treturn task.state === \"COMPLETE\" || task.state === \"FAILED\" || task.state === \"CANCELLED\";\n}\n\n/**\n * A failed poll is worth re-polling only when it is a `NetworkError` carrying a\n * known transient transport code. A self-aborted request timeout has no\n * `code`, and an API response (4xx/5xx) is authoritative, so both abort the\n * loop rather than being re-polled. Transient-ness is classified against the\n * canonical `TRANSIENT_TRANSPORT_CODES` set; this is the loop's own tolerance\n * dimension, distinct from the per-request `retryableTransportCodes` override\n * (which governs request-level retries inside each poll). Loop tolerance is\n * bounded separately by `maxConsecutivePollFailures`.\n *\n * @param error - The error returned by a failed poll.\n * @returns `true` when the loop should tolerate and re-poll.\n */\nfunction isTransientTransport(error: OpenCloudError): error is NetworkError {\n\tif (!(error instanceof NetworkError)) {\n\t\treturn false;\n\t}\n\n\tconst code = findErrorCode(error);\n\treturn code !== undefined && TRANSIENT_TRANSPORT_CODES.includes(code);\n}\n\nasync function fetchOnce(deps: PollDeps, signal: AbortSignal | undefined): Promise<FetchOutcome> {\n\tconst fetchResult = await raceWithAbort(deps.fetch(), signal);\n\tif (fetchResult === ABORTED) {\n\t\treturn { kind: \"aborted\" };\n\t}\n\n\tif (!fetchResult.success) {\n\t\treturn isTransientTransport(fetchResult.err)\n\t\t\t? { error: fetchResult.err, kind: \"transient\" }\n\t\t\t: { error: fetchResult.err, kind: \"failed\" };\n\t}\n\n\treturn isTerminal(fetchResult.data)\n\t\t? { kind: \"terminal\", task: fetchResult.data }\n\t\t: { kind: \"pending\", task: fetchResult.data };\n}\n","import {\n\tGET_SPEC,\n\tSUBMIT_HEAD_SPEC,\n\tSUBMIT_VERSION_SPEC,\n} from \"../../domains/cloud-v2/luau-execution-tasks/specs.ts\";\nimport type {\n\tLuauExecutionTask,\n\tLuauExecutionTaskRef,\n\tSubmitAtHeadParameters,\n\tSubmitAtVersionParameters,\n} from \"../../domains/cloud-v2/luau-execution-tasks/types.ts\";\nimport type { OpenCloudError } from \"../../errors/base.ts\";\nimport type { ResourceClient } from \"../../internal/resource-client.ts\";\nimport type { Result } from \"../../types.ts\";\nimport { type PollDeps, pollUntilDoneCore, type PollUntilDoneOptions } from \"./polling.ts\";\n\n/**\n * Builds the {@link PollDeps} bundle used by {@link pollUntilDoneCore},\n * closing over the supplied {@link ResourceClient}, task ref, and\n * per-request options so the core loop stays narrow.\n *\n * @param inner - The {@link ResourceClient} that issues each `tasks.get` call.\n * @param args - The polling options and the task ref to fetch on every iteration.\n * @returns A {@link PollDeps} bundle wiring `fetch`, `now`, and `sleep`.\n */\nexport function buildPollDeps(\n\tinner: ResourceClient,\n\targs: { options: PollUntilDoneOptions; ref: LuauExecutionTaskRef },\n): PollDeps {\n\treturn {\n\t\tfetch: async () => {\n\t\t\treturn inner.execute({\n\t\t\t\toptions: args.options,\n\t\t\t\tparameters: { ref: args.ref, view: \"BASIC\" },\n\t\t\t\tspec: GET_SPEC,\n\t\t\t});\n\t\t},\n\t\tnow: Date.now,\n\t\tsleep: inner.sleep,\n\t};\n}\n\n/**\n * Submits a Luau execution task and polls it to a terminal state.\n * Dispatches to the head-version or specific-version submit spec based on\n * the presence of `versionId`, then delegates to {@link pollUntilDoneCore}.\n *\n * @param inner - The {@link ResourceClient} that issues submit and poll calls.\n * @param args - The polling options and submit parameters.\n * @returns A {@link Result} wrapping the terminal {@link LuauExecutionTask}, or\n * the {@link OpenCloudError} that caused submit or polling to fail.\n */\nexport async function submitAndPoll(\n\tinner: ResourceClient,\n\targs: {\n\t\toptions: PollUntilDoneOptions;\n\t\tparameters: SubmitAtHeadParameters | SubmitAtVersionParameters;\n\t},\n): Promise<Result<LuauExecutionTask, OpenCloudError>> {\n\tconst { options, parameters } = args;\n\tconst submitResult = await (\"versionId\" in parameters\n\t\t? inner.execute({ options, parameters, spec: SUBMIT_VERSION_SPEC })\n\t\t: inner.execute({ options, parameters, spec: SUBMIT_HEAD_SPEC }));\n\tif (!submitResult.success) {\n\t\treturn submitResult;\n\t}\n\n\treturn pollUntilDoneCore(\n\t\tbuildPollDeps(inner, { options, ref: submitResult.data.ref }),\n\t\toptions,\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,qBACf,YACuC;CACvC,MAAM,EAAE,UAAU,WAAW,QAAQ;CACrC,MAAM,EAAE,SAAS,WAAW,QAAQ,YAAY,cAAc;CAE9D,IAAI,cAAc,KAAA,GACjB,OAAO;EACN,KAAK,IAAI,gBAAgB,mDAAmD,EAC3E,MAAM,iBACP,CAAC;EACD,SAAS;CACV;CAGD,IAAI,cAAc,KAAA,GACjB,OAAO;EACN,KAAK,IAAI,gBAAgB,mDAAmD,EAC3E,MAAM,iBACP,CAAC;EACD,SAAS;CACV;CAKD,OAAO;EAAE,MAAM;GAAE,QAAQ;GAAO,KAAA,GADjB,uBADqB,WAAW,UAAU,QAAQ,YAAY,UAAU,2BAA2B,UAAU,SAAS,OAAO,OACxH,GAAG,WAAW,UAAU,SAAS,CAAC,CAAC,SAAS;EAC5B;EAAG,SAAS;CAAK;AACtD;AAEA,SAAS,WAAW,UAA8B,WAAgD;CACjG,MAAM,QAAQ,IAAI,gBAAgB,EAAE,MAAM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