"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const utils_1=require("@b/api/admin/system/utils");exports.metadata={summary:"Verifies the license for a product",operationId:"verifyProductLicense",tags:["Admin","System"],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{productId:{type:"string",description:"Product ID whose license to verify"},purchaseCode:{type:"string",description:"Purchase code for the product"},envatoUsername:{type:"string",description:"Envato username of the purchaser"}},required:["productId"]}}}},responses:{200:{description:"License verified successfully",content:{"application/json":{schema:{type:"object",properties:{message:{type:"string",description:"Confirmation message indicating successful verification"}}}}}},401:{description:"Unauthorized, admin permission required"},500:{description:"Internal server error"}},logModule:"ADMIN_SYS",logTitle:"Verify license"};exports.default=async e=>{const{ctx:s}=e;null==s||s.step("Validating license details");null==s||s.step("Verifying license with Envato");const t=await(0,utils_1.verifyLicense)(e.body.productId,e.body.purchaseCode,e.body.envatoUsername);null==s||s.success("License verified successfully");return t};