{"version":3,"file":"option-names.mjs","names":[],"sources":["../../../../src/services/license/helpers/option-names.ts"],"sourcesContent":["import type {\n\tLicenseOptionName,\n\tOptionsName,\n} from \"../../../schemas/options.js\";\n\n/**\n * Builds the option name for a tenant-scoped license value.\n * Installs without tenants keep the original global option names.\n */\nexport const getLicenseOptionName = (\n\ttenantKey: string | null | undefined,\n\tname: LicenseOptionName,\n): OptionsName => {\n\tif (!tenantKey) return name;\n\treturn `${name}:t:${tenantKey}` as OptionsName;\n};\n\n/**\n * Builds a list of scoped license option names for option repository queries.\n */\nexport const getLicenseOptionNames = (\n\ttenantKey: string | null | undefined,\n\tnames: LicenseOptionName[],\n): OptionsName[] => names.map((name) => getLicenseOptionName(tenantKey, name));\n\n/**\n * Reads the base license option name back from a tenant-scoped key.\n */\nexport const getLicenseOptionBaseName = (\n\tname: OptionsName,\n): LicenseOptionName | null => {\n\tconst baseName = name.split(\":t:\")[0];\n\tif (\n\t\tbaseName === \"license_key\" ||\n\t\tbaseName === \"license_key_display\" ||\n\t\tbaseName === \"license_valid\" ||\n\t\tbaseName === \"license_last_checked\" ||\n\t\tbaseName === \"license_error_message\" ||\n\t\tbaseName === \"license_ai_enabled\"\n\t) {\n\t\treturn baseName;\n\t}\n\treturn null;\n};\n"],"mappings":"AASA,MAAa,GACZ,EACA,IAEK,EACE,GAAG,EAAK,KAAK,IADG,EAOX,GACZ,EACA,IACmB,EAAM,IAAK,GAAS,EAAqB,EAAW,CAAI,CAAC,EAKhE,EACZ,GAC8B,CAC9B,IAAM,EAAW,EAAK,MAAM,KAAK,CAAC,CAAC,GAWnC,OATC,IAAa,eACb,IAAa,uBACb,IAAa,iBACb,IAAa,wBACb,IAAa,yBACb,IAAa,qBAEN,EAED,IACR"}