"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const query_1=require("@b/utils/query"),cache_1=require("@b/utils/cache");exports.metadata={summary:"Bulk updates the status of extensions",operationId:"bulkUpdateExtensionStatus",tags:["Admin","Extensions"],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{ids:{type:"array",description:"Array of extension IDs to update",items:{type:"string"}},status:{type:"boolean",description:"New status to apply to the extensions (true for active, false for inactive)"}},required:["ids","status"]}}}},responses:(0,query_1.updateRecordResponses)("Extension"),requiresAuth:!0,permission:"edit.extension",logModule:"ADMIN_SYS",logTitle:"Bulk update extension status"};exports.default=async e=>{const{body:t,ctx:s}=e,{ids:a,status:n}=t;null==s||s.step(`Updating ${a.length} extensions to ${n?"active":"inactive"}`);const o=await(0,query_1.updateStatus)("extension",a,n);null==s||s.step("Clearing cache");const i=cache_1.CacheManager.getInstance();await i.clearCache();null==s||s.success(`${a.length} extension statuses updated successfully`);return o};