diff --git a/apps/dev/package.json b/apps/dev/package.json index 7e5353acbe..82ffdd392b 100644 --- a/apps/dev/package.json +++ b/apps/dev/package.json @@ -4,6 +4,8 @@ "private": true, "scripts": { "backend:dev": "PORT=8080 API_URL=http://localhost:8080 leemons-runner --env services/**/*.service.js", + "backend:test": "NODE_ENV=test yarn backend:dev", + "backend:test:nats": "NODE_ENV=test TRANSPORTER=NATS yarn backend:dev", "backend:dev:hot": "PORT=8080 API_URL=http://localhost:8080 leemons-runner --env --hot services/**/*.service.js", "backend:dev:nats": "TRANSPORTER=NATS yarn backend:dev", "backend:dev:nats:hot": "TRANSPORTER=NATS yarn backend:dev:hot", @@ -13,10 +15,12 @@ "front:build:dev": "NODE_ENV=development API_URL=https://api.leemons.dev NODE_OPTIONS=\"--max-old-space-size=8192\" leemonsFront build", "front:build": "NODE_ENV=production PORT=3000 leemonsFront build -m ../..", "front:preview": "leemonsFront preview", - "front": "yarn front:build && yarn front:preview" + "front": "yarn front:build && yarn front:preview", + "leemons-openapi": "leemons-openapi" }, "leemons": {}, "dependencies": { + "@leemons/openapi": "0.0.40", "@leemons/runner": "0.0.71", "colord": "^2.9.3", "dotenv": "^16.0.3", diff --git a/package.json b/package.json index 8b3904fe01..175f431280 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,11 @@ ], "scripts": { "start:app": "yarn workspace leemons-app backend:dev", + "start:test": "yarn workspace leemons-app backend:test:nats", "done": "echo Done ✨", "check": "start-server-and-test 'PORT=8080 yarn start:app' http-get://localhost:8080/api/gateway/list-aliases 'yarn done'", - "prepare": "husky install" + "prepare": "husky install", + "leemons-openapi": "yarn workspace leemons-app leemons-openapi" }, "packageManager": "yarn@1.22.19", "devDependencies": { diff --git a/packages/leemons-deployment-manager/src/mixin.js b/packages/leemons-deployment-manager/src/mixin.js index 134fc7ecf7..16a19822cc 100644 --- a/packages/leemons-deployment-manager/src/mixin.js +++ b/packages/leemons-deployment-manager/src/mixin.js @@ -4,6 +4,7 @@ const { getPluginNameFromServiceName, getPluginNameWithVersionIfHaveFromServiceName, } = require('@leemons/service-name-parser'); +const { createOpenapiSchemas } = require('@leemons/openapi'); const { isCoreService } = require('./isCoreService'); const { getDeploymentID } = require('./getDeploymentID'); const { ctxCall } = require('./ctxCall'); @@ -104,12 +105,17 @@ module.exports = function ({ }, hooks: { after: { - '*': function (ctx, res) { - if (!CONTROLLED_HTTP_STATUS_CODE.includes(ctx.meta.$statusCode)) { - ctx.meta.$statusCode = 200; - } - return res; - }, + '*': [ + async (ctx, res) => { + if (!CONTROLLED_HTTP_STATUS_CODE.includes(ctx.meta.$statusCode)) { + ctx.meta.$statusCode = 200; + } + if (process.env.NODE_ENV === 'test') { + await createOpenapiSchemas({ res, ctx }); + } + return res; + }, + ], }, before: { '*': [ diff --git a/packages/leemons-openapi/bin/createOpenapiFiles.js b/packages/leemons-openapi/bin/createOpenapiFiles.js new file mode 100755 index 0000000000..e999d346f0 --- /dev/null +++ b/packages/leemons-openapi/bin/createOpenapiFiles.js @@ -0,0 +1,10 @@ +#!/usr/bin/env node + +const path = require('path'); + +const { createOpenapiFiles } = require('../lib/createOpenapiFiles'); + +const rootDir = process.argv[2] || path.join(__dirname, '..', '..', '..'); + +console.log('Creating openapi files from', rootDir); +createOpenapiFiles(rootDir); diff --git a/packages/leemons-openapi/createOpenapiSchemas.js b/packages/leemons-openapi/createOpenapiSchemas.js new file mode 100644 index 0000000000..117f39747f --- /dev/null +++ b/packages/leemons-openapi/createOpenapiSchemas.js @@ -0,0 +1,51 @@ +const jsonSchemaGenerator = require('json-schema-generator'); + +const { getControllerPath, prepareControllerFile } = require('./lib/controllers'); +const { prepareOpenapiFile } = require('./lib/openapi'); +const { buildServicePath } = require('./lib/services'); + +/** + * Decomposes the action name into its components + * @param {string} actionName - The action name + * @returns {Array} The components of the action name + */ +function decomposeActionName(actionName) { + const [version, plugin, service, controller] = actionName.split('.'); + return [version, plugin, service, controller]; +} + +/** + * Creates the openapi request & response schemas + * @param {Object} params - The parameters + * @param {Object} params.res - The response + * @param {Object} params.ctx - The context + */ +async function createOpenapiSchemas({ res, ctx }) { + const { TESTING, NODE_ENV } = process.env; + const isTesting = TESTING || NODE_ENV === 'test' || process.env.testing; + if (isTesting && ctx.action.rest) { + const actionName = ctx.action.name; + const responseSchema = jsonSchemaGenerator(res); + const requestSchema = jsonSchemaGenerator(ctx.params); + try { + const [, plugin, service, controller] = decomposeActionName(actionName); + + const serviceFilePath = buildServicePath({ plugin, service }); + const controllerFilePath = getControllerPath(serviceFilePath, service); + + prepareControllerFile({ controllerFilePath, service, controller, ctx }); + + await prepareOpenapiFile({ + controllerFilePath, + service, + controller, + responseSchema, + requestSchema, + }); + } catch (error) { + ctx.logger.error(`ERROR Openapi: ${ctx.action.name} - ${error.message}`); + } + } +} + +module.exports = { createOpenapiSchemas }; diff --git a/packages/leemons-openapi/index.js b/packages/leemons-openapi/index.js new file mode 100644 index 0000000000..e93c960e51 --- /dev/null +++ b/packages/leemons-openapi/index.js @@ -0,0 +1,9 @@ +const mixin = require('./mixin'); +const { createOpenapiSchemas } = require('./createOpenapiSchemas'); +const { createOpenapiFiles } = require('./lib/createOpenapiFiles'); + +module.exports = { + LeemonsOpenApiMixin: mixin, + createOpenapiSchemas, + createOpenapiFiles, +}; diff --git a/packages/leemons-openapi/lib/controllers.js b/packages/leemons-openapi/lib/controllers.js new file mode 100644 index 0000000000..83c63b5511 --- /dev/null +++ b/packages/leemons-openapi/lib/controllers.js @@ -0,0 +1,186 @@ +const os = require('os'); +const path = require('path'); +const espree = require('espree'); +const estraverse = require('estraverse'); +const prettier = require('prettier'); + +const { readFile } = require('./files'); +const { writeFile } = require('./files'); +const { findServiceFile } = require('./services'); +const { prettierOptions } = require('./prettierOptions'); + +/** + * Parses the code into an Abstract Syntax Tree (AST) + * @param {string} code - The code to parse + * @returns {Object} The AST of the code + */ +function parseCodeToAst(code) { + return espree.parse(code, { range: true, ecmaVersion: 12, sourceType: 'module' }); +} + +/** + * Finds all the controllers in a given file + * @param {string} controllerFilePath - The path of the controller file + * @returns {Array} An array of the names of the controllers + */ +function findControllers(controllerFilePath) { + const code = readFile(controllerFilePath); + + const regex = /(\w+Rest):\s\{/g; // Note the 'g' flag for global search + return [...code.matchAll(regex)].map((match) => match[1]); +} + +/** + * Searches for the controller property in the AST + * @param {Object} ast - The AST to search in + * @param {string} controller - The controller to search for + * @returns {Object|null} The controller object or null if not found + */ +function searchController(ast, controller) { + let controllerObj = null; + estraverse.traverse(ast, { + enter(node) { + if (node.type === 'Property' && node.key.name === controller) { + controllerObj = node; + } + }, + }); + return controllerObj; +} + +/** + * Checks if the controller object has an openapi property + * @param {Object} controllerObj - The controller object + * @returns {boolean} True if the openapi property exists, false otherwise + */ +function hasOpenApiProperty(controllerObj) { + return controllerObj.value.properties.some((prop) => prop.key.name === 'openapi'); +} + +/** + * Adds a require statement to the code + * @param {string} code - The code to add the require statement to + * @param {string} service - The service + * @param {string} controller - The controller + * @returns {string} The code with the added require statement + */ +function addRequireStatement(code, service, controller) { + const requireStatement = `const ${controller} = require('./openapi/${service}/${controller}');`; + + if (!code.includes(requireStatement)) { + const updatedCode = code.replace(`/** @type {ServiceSchema} */${os.EOL}`, ''); + + return updatedCode.replace( + 'module.exports', + `${requireStatement}${os.EOL}/** @type {ServiceSchema} */${os.EOL}module.exports` + ); + } + return code; +} + +/** + * Adds the openapi property to the controller in the code + * @param {string} code - The code to add the openapi property to + * @param {string} controller - The controller + * @returns {string} The code with the added openapi property + * @throws {Error} If the controller line is not found. + */ +function addOpenApi(code, controller) { + const regex = new RegExp(`(${controller}:\\s*\\{)`, 'g'); + const match = regex.exec(code); + if (match) { + const newLine = `${match[1]}${os.EOL} openapi: ${controller}.openapi,`; + return code.replace(regex, newLine); + } + throw new Error('Controller line not found'); +} + +/** + * Finds the import line in the file + * @param {string} filePath - The path of the file + * @param {string} service - The service to find + * @returns {string|null} The import line or null if not found + * @throws {Error} If the service file is not found or an error occurs while reading the file. + */ +function findImportLine(filePath, service) { + let fileContent = null; + + try { + fileContent = readFile(filePath); + } catch (error) { + if (error.code === 'ENOENT') { + // If the service name does not match the service file name + // We search for a service in the plugin that has a 'name' matching the service name + const serviceFilePath = findServiceFile(path.dirname(filePath), service); + if (!serviceFilePath) throw new Error('Service File not found'); + return findImportLine(serviceFilePath, service); + } + throw new Error(`Read file Error: ${error}`); + } + + const lines = fileContent.split(os.EOL); + return lines.find((line) => line.includes(`require('./`) && line.endsWith(`.rest');`)); +} + +/** + * Gets the path of the imported file + * @param {string} importLine - The import line + * @param {string} currentFilePath - The path of the current file + * @returns {string|null} The path of the imported file or null if not found + */ +function getImportedFilePath(importLine, currentFilePath) { + const match = importLine.match(/require\('(.*)'\)/); + if (match && match[1]) { + return path.resolve(path.dirname(currentFilePath), `${match[1]}.js`); + } + return null; +} + +/** + * Gets the path of the controller + * @param {string} filePath - The path of the file + * @param {string} service - The service + * @returns {string} The path of the controller + * @throws {Error} If the import line of rest actions is not found + */ +function getControllerPath(filePath, service) { + const importLine = findImportLine(filePath, service); + if (!importLine) throw Error('import line of rest actions not found'); + return getImportedFilePath(importLine, filePath); +} + +/** + * Prepares the controller file + * @param {Object} params - The parameters + * @param {string} params.controllerFilePath - The path of the controller file + * @param {string} params.service - The service + * @param {string} params.controller - The controller + * @param {Object} params.ctx - The context + * @throws {Error} If the controller is not found or the openapi property already exists + */ +function prepareControllerFile({ controllerFilePath, service, controller, ctx }) { + let code = readFile(controllerFilePath); + const ast = parseCodeToAst(code); + const controllerObj = searchController(ast, controller); + if (!controllerObj) + throw new Error(`Openapi: ${controllerFilePath} Controller "${controller}" not found`); + + if (controllerObj && !hasOpenApiProperty(controllerObj)) { + code = addRequireStatement(code, service, controller); + code = addOpenApi(code, controller); + writeFile(controllerFilePath, prettier.format(code, prettierOptions)); + } else { + const message = `Openapi: ${controllerFilePath} - ${controller}: Property "openapi" already exists, I can't replace it`; + if (ctx) { + ctx.logger.warn(message); + } else { + console.warn('\x1b[31m', message, '\x1b[37m'); + } + } +} + +module.exports = { + findControllers, + getControllerPath, + prepareControllerFile, +}; diff --git a/packages/leemons-openapi/lib/createOpenapiDoc.js b/packages/leemons-openapi/lib/createOpenapiDoc.js new file mode 100644 index 0000000000..119e917957 --- /dev/null +++ b/packages/leemons-openapi/lib/createOpenapiDoc.js @@ -0,0 +1,456 @@ +require('dotenv').config(); + +const axios = require('axios'); +const fs = require('fs'); +const path = require('path'); +const UglifyJS = require('uglify-js'); +const espree = require('espree'); +const estraverse = require('estraverse'); + +/** + * Reads a file and returns its content. + * @param {string} filePath - The path of the file to read. + * @returns {string} The content of the file. + */ +function readFile(filePath) { + try { + return fs.readFileSync(filePath, 'utf8'); + } catch (error) { + return ''; + } +} + +/** + * Extracts required variables from a piece of code. + * @param {string} code - The code to extract required variables from. + * @returns {Object} An object containing the required variables. + */ +function extractRequiredVariables(code) { + const requires = code.match(/const\s*({\s*([^}]+)\s*}|[^=]+)\s*= require\(['"]([^'"]+)['"]\)/g); + const requiredVariables = {}; + + if (!requires) { + return {}; + } + + requires.forEach((req) => { + const variableNameMatch = req.match( + /const\s*({\s*([^}]+)\s*}|[^=]+)\s*= require\(['"]([^'"]+)['"]\)/ + ); + let variableName = variableNameMatch[1] ? variableNameMatch[1] : variableNameMatch[2]; + const importedFile = variableNameMatch[3]; + if (importedFile.includes('.')) { + if (variableName.includes(':')) { + [variableName] = variableName.split(':'); + } + + variableName + .replace('{', '') + .replace('}', '') + .split(',') + .forEach((el) => { + requiredVariables[el.trim()] = importedFile; + }); + } + }); + return requiredVariables; +} + +/** + * Finds a controller node in an Abstract Syntax Tree (AST). + * @param {Object} ast - The AST to search in. + * @param {string} controllerName - The name of the controller to find. + * @returns {Object} The controller node. + */ +function findControllerNode(ast, controllerName) { + let controllerNode = null; + estraverse.traverse(ast, { + enter(node) { + if (node.type === 'Property' && node.key.name === controllerName) { + controllerNode = node; + this.break(); + } + }, + }); + return controllerNode; +} + +/** + * Finds the real required variables in a father node. + * @param {Object} fatherNode - The node to search in. + * @param {Object} requiredVariables - The required variables to find. + * @returns {Object} The real required variables. + */ +function findRealRequired(fatherNode, requiredVariables) { + const variables = Object.keys(requiredVariables); + const realRequired = {}; + estraverse.traverse(fatherNode, { + enter(node) { + if (node.type === 'CallExpression') { + if (variables.includes(node.callee.name)) { + realRequired[node.callee.name] = requiredVariables[node.callee.name]; + } else if ( + node.callee.type === 'MemberExpression' && + variables.includes(node.callee.object.name) + ) { + realRequired[node.callee.object.name] = requiredVariables[node.callee.object.name]; + } + } + }, + }); + return realRequired; +} + +/** + * Finds a function in a controller. + * @param {string} filePath - The path of the file to search in. + * @param {string} controllerName - The name of the controller to find. + * @returns {Object} The found function. + */ +function findFunctionInController(filePath, controllerName) { + // Read the source code of the file + const code = fs.readFileSync(filePath, 'utf8'); + + // Find all require calls and extract variable names + const requiredVariables = extractRequiredVariables(code); + + // Parse the source code into an AST + const ast = espree.parse(code, { + // Parsing options + ecmaVersion: 2020, + sourceType: 'module', + }); + + // Variable to store the found node + const controllerNode = findControllerNode(ast, controllerName); + + if (!controllerNode) { + console.warn('\x1b[33m', `Openapi: Controller "${controllerName}" not found in "${filePath}"`); + return []; + } + + const realRequired = findRealRequired(controllerNode, requiredVariables); + + return { ...realRequired }; +} + +/** + * Finds and reads a file. + * @param {string} filePath - The path of the file to find and read. + * @returns {Array} An array containing the file path and its content. + */ +function findAndReadFile(filePath) { + try { + if (fs.lstatSync(filePath, { throwIfNoEntry: false })?.isDirectory()) { + // si es un directorio debería ser un index.js + return findAndReadFile(path.join(filePath, 'index.js')) || ''; + } + // si no es un directorio debe ser un archivo y debe acabar en .js + // sino acaba en .js se lo añadimos + if ( + !filePath.endsWith('.js') && + !filePath.endsWith('transform.js') && + !filePath.includes('rest/openapi/') + ) { + let _filePath = ''; + if (filePath.endsWith('/')) _filePath = filePath.replace('/', '.js'); + else _filePath = `${filePath}.js`; + if (fs.existsSync(_filePath)) { + return [_filePath, readFile(_filePath)]; + } + // si tampoco es un archivo probamos a quitarle la última parte de la ruta y ver si eso es un directorio + return findAndReadFile(path.join(filePath, '..', 'index.js')); + } + return [filePath, readFile(filePath)]; + } catch (error) { + console.error('\x1b[31m', 'Openapi: findAndReadFile Error:', error, '\x1b[37m'); + return [filePath, '']; + } +} + +/** + * Minimizes and concatenates files. + * @param {Array} codeContext - The context of the code. + * @param {string} filePath - The path of the file to minimize and concatenate. + * @param {string} fileContent - The content of the file to minimize and concatenate. + * @param {Set} concatenatedFiles - The set of already concatenated files. + * @returns {Object} An object containing the new code context and the set of concatenated files. + */ +function minimizeAndConcatenateFiles(codeContext, filePath, fileContent, concatenatedFiles) { + if (concatenatedFiles.has(filePath)) return false; + + const minimizedContent = UglifyJS.minify(fileContent, { keep_fnames: true }); + concatenatedFiles.add(filePath); + codeContext.push(filePath, minimizedContent); + return { codeContext, concatenatedFiles }; +} + +/** + * Gets the real required files. + * @param {string} fileContent - The content of the file. + * @param {string} filePath - The path of the file. + * @param {Object} requires - The required variables. + * @param {string} variableRequired - The required variable. + * @returns {Object} The real required files. + */ +function getRealRequires(fileContent, filePath, requires, variableRequired) { + const ast = espree.parse(fileContent, { ecmaVersion: 2020 }); + let functionNode; + let realRequires = {}; + + estraverse.traverse(ast, { + enter(node) { + // Si el nodo es una declaración de función y su nombre es el nombre de la variable requerida + if (node.type === 'FunctionDeclaration' && node.id.name === variableRequired) { + functionNode = node; + this.break(); // Detener la búsqueda + } + }, + }); + + if (!functionNode) { + // si no podemos encontrar la declaración que buscamos, no podemos filtrar los requires + if (path.basename(filePath) === 'index.js') { + // vemos a ver si alguno de lo requires es como la variable + // Check if any of the requires matches the variable + const matchingVariables = Object.keys(requires).filter( + (variable) => variable === variableRequired + ); + + if (matchingVariables.length > 0) { + matchingVariables.forEach((variable) => { + realRequires[variable] = requires[variable]; + }); + } else { + // no hay ninguna variable que coincida... me traigo todas... + + realRequires = requires; + } + } else { + // no hay ninguna variable que coincida... me traigo todas... + + realRequires = requires; + } + } else { + // recorremos los nodos de la variable para filtrar los requires que se llaman desde esa variable + estraverse.traverse(functionNode, { + enter(node) { + if (node.type === 'CallExpression' && requires[node.callee.name]) { + realRequires[node.callee.name] = requires[node.callee.name]; + } + }, + }); + } + return realRequires; +} + +/** + * Gets the required files. + * @param {string} filePath - The path of the file. + * @param {string} variableRequired - The required variable. + * @param {Set} _concatenatedFiles - The set of already concatenated files. + * @returns {Array} The required files. + */ +function getRequiredFiles(filePath, variableRequired, _concatenatedFiles = new Set()) { + let concatenatedFiles = _concatenatedFiles; + + const [_filePath, fileContent] = findAndReadFile(filePath); + let codeContext = []; + + const minimizeReturn = minimizeAndConcatenateFiles( + codeContext, + _filePath, + fileContent, + concatenatedFiles + ); + if (minimizeReturn === false) return []; + + ({ codeContext, concatenatedFiles } = minimizeReturn); + + const requires = extractRequiredVariables(fileContent); + + const realRequires = getRealRequires(fileContent, _filePath, requires, variableRequired); + + Object.entries(realRequires).forEach(([matchingVariable, matchingPath]) => { + const requiredPath = path.join(path.dirname(_filePath), matchingPath); + + if (!concatenatedFiles.has(requiredPath)) { + const content = getRequiredFiles(requiredPath, matchingVariable, concatenatedFiles); + if (content) { + codeContext = [...codeContext, ...content]; + } + } + }); + + return codeContext; +} + +/** + * Creates a code context. + * @param {string} filePath - The path of the file. + * @param {string} controllerName - The name of the controller. + * @returns {string} The code context. + */ +function createCodeContext(filePath, controllerName) { + const controllerRequires = findFunctionInController(filePath, controllerName); + + let concatenatedFiles = new Set(); + let codeContext = []; + ({ codeContext, concatenatedFiles } = minimizeAndConcatenateFiles( + codeContext, + filePath, + readFile(filePath), + concatenatedFiles + )); + + Object.keys(controllerRequires).forEach((variableRequired) => { + const requirePath = controllerRequires[variableRequired]; + const requiredFilesContext = getRequiredFiles( + path.join(filePath, '..', requirePath), + variableRequired, + concatenatedFiles + ); + + codeContext = [...codeContext, ...requiredFilesContext]; + }); + + return codeContext.join('\n'); +} + +/** + * Calls the OpenAI API. + * @param {string} systemMessage - The system message to send. + * @param {string} userMessage - The user message to send. + * @returns {Promise} The response from the OpenAI API. + */ +async function callOpenAI(systemMessage, userMessage) { + const MINIMUM_EXECUTION_TIME = + Number(process.env.OPENAPI_MINIMUM_EXECUTION_TIME) || 1 * 60 * 1000; + // Guarda la hora de inicio + const startTime = Date.now(); + + const messages = [ + { role: 'user', content: userMessage }, + { role: 'system', content: systemMessage }, + ]; + + const response = await axios.post( + process.env.OPENAPI_OPENAI_APIURL, + { + // model: 'gpt-3.5-turbo-16k', + model: 'gpt-4-turbo-2024-04-09', + messages, + temperature: 1, + max_tokens: 500, + top_p: 1, + frequency_penalty: 0, + presence_penalty: 0, + }, + { + headers: { + Authorization: `Bearer ${process.env.OPENAPI_OPENAI_APIKEY}`, + 'Content-Type': 'application/json', + }, + } + ); + + console.log( + 'AI TOKENS INFO:', + 'REMAINING REQUESTS:', + response.headers['x-ratelimit-remaining-requests'], + 'REMAINING TOKENS:', + response.headers['x-ratelimit-remaining-tokens'] + ); + console.log('AI TOKENS USED IN THIS REQUEST:', JSON.stringify(response.data.usage, null, 2)); + + // Calcula cuánto tiempo ha pasado + const elapsedTime = Date.now() - startTime; + + // Si han pasado menos de 30 segundos, espera el tiempo restante + if (elapsedTime < MINIMUM_EXECUTION_TIME) { + await new Promise((resolve) => { + console.log( + `Waiting ${ + (MINIMUM_EXECUTION_TIME - elapsedTime) / 1000 + } seconds for Minimum Execution Time....` + ); + setTimeout(resolve, MINIMUM_EXECUTION_TIME - elapsedTime); + }); + } + + return response.data.choices[0].message.content.replace('```json', '').replace('```', ''); +} + +/** + * Creates an OpenAPI document. + * @param {string} service - The service to create the document for. + * @param {string} controller - The controller to create the document for. + * @param {string} controllerFile - The file of the controller. + * @returns {Promise} The created OpenAPI document. + */ +async function createOpenapiDoc(service, controller, controllerFile) { + const systemMessage = `Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the '${controller}' property does in the '${controllerFile}' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it\'s implied that users can only access assets that they have rights to view based on the asset\'s ownership and sharing properties.\\n\\nThe endpoint starts by invoking the \`getByUser\` method from the \`Pins\` core, passing in the \`ctx\` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user\'s agent ID. These pins represent the user\'s digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' +`; + + const userMessage = createCodeContext(controllerFile, controller); + + let responseObj = {}; + + let AIResponse = null; + try { + const messages = [ + { role: 'user', content: userMessage }, + { role: 'system', content: systemMessage }, + ]; + console.info('Sending message to OpenAI', JSON.stringify(messages).length, 'Characters'); + AIResponse = await callOpenAI(systemMessage, userMessage); + console.info('OpenAI Response', AIResponse); + + try { + const response = JSON.parse(AIResponse); + responseObj = { + summary: response.summary, + description: response.description, + AIGenerated: true, + }; + } catch (error) { + responseObj = { description: AIResponse, AIGenerated: true }; + } + } catch (error) { + console.error('\x1b[31m', 'Openapi: OpenAI Error', error, '\x1b[37m'); + fs.appendFileSync( + path.resolve(__dirname, 'leemons-openapi.error.log'), + `-------------------------- +date: ${new Date().toISOString()} +controllerFile: ${controllerFile} +service: ${service} +controller: ${controller} +userMessage: ${userMessage} +systemMessage: ${systemMessage} +error: ${error} +-------------------------- +` + ); + } + const requestFolder = path.resolve(__dirname, 'requests'); + + if (!fs.existsSync(requestFolder)) { + fs.mkdirSync(requestFolder); + } + + fs.writeFileSync( + path.resolve(requestFolder, `${service}-${controller}.request.txt`), + JSON.stringify({ systemMessage, userMessage, response: JSON.stringify(responseObj) }, null, 2) + ); + + return responseObj; +} + +module.exports = { createOpenapiDoc }; diff --git a/packages/leemons-openapi/lib/createOpenapiFiles.js b/packages/leemons-openapi/lib/createOpenapiFiles.js new file mode 100755 index 0000000000..e3c23b2812 --- /dev/null +++ b/packages/leemons-openapi/lib/createOpenapiFiles.js @@ -0,0 +1,64 @@ +/* eslint-disable guard-for-in */ +/* eslint-disable no-restricted-syntax */ +const glob = require('glob').sync; +const path = require('path'); + +const { parseServiceFile } = require('./services'); +const { findControllers, prepareControllerFile } = require('./controllers'); +const { prepareOpenapiFile } = require('./openapi'); + +async function createOpenapiFiles(startPath) { + try { + const serviceDirs = glob(`${startPath}/**/services/rest`, { realPath: true }).filter( + (el) => !el.includes('node_modules') + ); + for (const _dir of serviceDirs) { + const dir = _dir.replace('/rest', ''); + const grandparentDir = path.dirname(path.dirname(dir)); + const plugin = path.basename(grandparentDir); + + const serviceFiles = glob(`${dir}/*.service.js`, { realPath: true }); + for (const file of serviceFiles) { + try { + const { service, controllerFile } = parseServiceFile(file); + + const controllers = findControllers(controllerFile); + let counter = 1; + for (const controller of controllers) { + console.log( + 'Creating openapi:', + `(${plugin}-${service}-${controller})`, + controllerFile, + `(${counter}/${controllers.length})` + ); + try { + prepareControllerFile({ + controllerFilePath: controllerFile, + service, + controller, + ctx: undefined, + }); + // eslint-disable-next-line no-await-in-loop + await prepareOpenapiFile({ + controllerFilePath: controllerFile, + service, + controller, + useAItoCreateOpenapiDoc: true, + }); + + counter++; + } catch (error) { + console.warn('\x1b[31m', error.message, '\x1b[37m'); + } + } + } catch (error) { + console.warn('\x1b[31m', error.message, '\x1b[37m'); + } + } + } + } catch (error) { + console.error('\x1b[31m', 'ERROR:', error, '\x1b[37m'); + } +} + +module.exports = { createOpenapiFiles }; diff --git a/packages/leemons-openapi/lib/files.js b/packages/leemons-openapi/lib/files.js new file mode 100644 index 0000000000..e5c6f4eb03 --- /dev/null +++ b/packages/leemons-openapi/lib/files.js @@ -0,0 +1,35 @@ +const fs = require('fs'); + +/** + * Writes the given text to a file at the specified path. + * @param {string} filePath - The path of the file. + * @param {string} text - The text to write. + * @throws {Error} If an error occurs while writing to the file. + */ +function writeFile(filePath, text) { + try { + fs.writeFileSync(filePath, text); + } catch (error) { + throw new Error(`Write file Error(${filePath}): ${error}`); + } +} + +/** + * Reads the file + * @param {string} controllerPath - The path of the controller + * @returns {string} The content of the file + * @throws {Error} If an error occurs while reading the file. + */ +function readFile(controllerPath) { + try { + return fs.readFileSync(controllerPath, 'utf8'); + } catch (error) { + error.message = `Read file Error: ${error.message}`; + throw error; + } +} + +module.exports = { + writeFile, + readFile, +}; diff --git a/packages/leemons-openapi/lib/leemons-openapi.error.log b/packages/leemons-openapi/lib/leemons-openapi.error.log new file mode 100644 index 0000000000..6bfcd5d240 --- /dev/null +++ b/packages/leemons-openapi/lib/leemons-openapi.error.log @@ -0,0 +1,2946 @@ +-------------------------- +date: 2024-04-29T00:41:00.354Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: profileTokenRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'profileTokenRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:41:30.574Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: centerProfileTokenRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'centerProfileTokenRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:42:00.854Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: setRememberLoginRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setRememberLoginRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:42:30.939Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: removeRememberLoginRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeRememberLoginRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:43:01.151Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: getRememberLoginRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRememberLoginRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:43:31.433Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: createBulkRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'createBulkRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:44:01.521Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: deleteUserAgentRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/deleteById.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteUserAgentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:44:31.733Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: listRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:45:01.867Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: getUserAgentsInfoRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getUserAgentsInfoRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:45:31.978Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: searchUserAgentsRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/searchUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/contacts/getUserAgentContacts.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentProfile.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/contacts/getProfileContacts.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'searchUserAgentsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:46:02.091Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: contactsRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/contacts/getUserAgentContacts.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentProfile.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/contacts/getProfileContacts.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/searchUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'contactsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:46:32.371Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: createSuperAdminRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'createSuperAdminRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:47:02.459Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: getDataForUserAgentDatasetsRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getDataForUserAgentDatasets.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getDataForUserAgentDatasetsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:47:32.547Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: saveDataForUserAgentDatasetsRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/saveDataForUserAgentDatasets.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveDataForUserAgentDatasetsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:48:02.830Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: updateUserRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateUserRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:48:33.050Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: updateUserAvatarRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateUserAvatarRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:49:03.333Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: updateUserAgentRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/update.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateUserAgentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:49:33.551Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: updateSessionConfigRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateSessionConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:50:03.836Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: activateUserRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'activateUserRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:50:34.057Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: sendWelcomeEmailToUserRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'sendWelcomeEmailToUserRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:51:04.193Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: disableUserAgentRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/disable.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'disableUserAgentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:51:34.298Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: activeUserAgentRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/active.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/checkIfCanCreateNUserAgentsInGroup.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'activeUserAgentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:52:04.397Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +service: users +controller: getActiveUserAgentsCountByProfileSysNameRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getActiveUserAgentsCountByProfileSysName.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/detailBySysName.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/transformArrayToObject.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getActiveUserAgentsCountByProfileSysNameRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:52:34.427Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-widgets/backend/services/rest/widgets.rest.js +service: widgets +controller: getZoneRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-widgets/backend/services/rest/widgets.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-widgets/backend/core/widgetZone/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-widgets/backend/core/widgetZone/get.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getZoneRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-widgets/backend/services/rest/widgets.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:53:04.463Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-xapi/backend/services/rest/xapi.rest.js +service: xapi +controller: addStatementRest +userMessage: /Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-xapi/backend/services/rest/xapi.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-xapi/backend/core/xapi/statement/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-xapi/backend/core/xapi/statement/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-xapi/backend/validations/forms.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addStatementRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-xapi/backend/services/rest/xapi.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:53:34.497Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +service: config +controller: isSecondTimeRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'isSecondTimeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:54:04.525Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +service: config +controller: setIsSecondTimeRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setIsSecondTimeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:54:34.556Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +service: config +controller: changeCenterConfigRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/updateCenter.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'changeCenterConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:55:04.599Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +service: config +controller: changeOrganizationConfigRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/updateOrganization.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/aws/isSubdomainInUse.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/aws/getRoute53.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/aws/getHostedZoneId.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/aws/listAllHostedZoneRecords.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/aws/registerRecordSet.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'changeOrganizationConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:55:34.638Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +service: config +controller: finishConfigRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/finish.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/activateAdminConfig.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/sendLaunchEmails.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'finishConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:56:04.669Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +service: config +controller: getExternalCustomerPortalUrlRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/getExternalCustomerPortalUrl.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/fetchExternalIdentity.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getExternalCustomerPortalUrlRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:56:34.699Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +service: config +controller: getExternalCheckoutUrlRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/getExternalCheckoutUrl.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/fetchExternalIdentity.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getExternalCheckoutUrlRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:57:04.727Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +service: config +controller: getExternalCustomerSubscriptionRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/getExternalCustomerSubscription.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/fetchExternalIdentity.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getExternalCustomerSubscriptionRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:57:34.753Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +service: config +controller: getTenorApiKeyRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getTenorApiKey.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getTenorApiKeyRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:58:04.778Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +service: config +controller: getGeneralConfigRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getGeneral.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getGeneralConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:58:34.803Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +service: config +controller: getCenterConfigRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getCenter.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getCenterConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:59:04.829Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +service: config +controller: getProgramConfigRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getProgram.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getProgramConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T00:59:34.854Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +service: config +controller: getRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/get.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:00:04.883Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +service: config +controller: saveRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/save.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/get.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:00:34.910Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +service: config +controller: connectedRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/save.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/get.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'connectedRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:01:04.904Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +service: config +controller: connectedUserAgentsRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getUserAgentsConnected.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'connectedUserAgentsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:01:34.934Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +service: config +controller: getAdminConfigRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getFullByCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getGeneral.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getProgram.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getTenorApiKey.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getAdminConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:02:04.966Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +service: config +controller: saveAdminConfigRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/saveFullByCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/saveTenorApiKey.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/saveProgram.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/saveGeneral.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/saveCenter.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveAdminConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:02:35.016Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: getRoomListRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/getUserAgentRoomsList.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/helpers/decrypt.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRoomListRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:03:05.069Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: getMessagesRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/getMessages.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/helpers/decrypt.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getMessagesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:03:35.123Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: sendMessageRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/sendMessage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getCenter.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/helpers/encrypt.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'sendMessageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:04:05.172Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: markMessagesAsReadRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/markAsRead.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'markMessagesAsReadRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:04:35.247Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: getRoomRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/get.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:05:05.302Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: toggleMutedRoomRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/toggleMutedRoom.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'toggleMutedRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:05:35.357Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: toggleAdminMutedRoomRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/toggleAdminMutedRoom.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'toggleAdminMutedRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:06:05.407Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: toggleAdminDisableRoomRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/toggleDisableRoom.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'toggleAdminDisableRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:06:35.461Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: adminRemoveUserAgentRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/adminRemoveUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/removeUserAgents.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'adminRemoveUserAgentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:07:05.538Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: adminUpdateRoomNameRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/adminUpdateRoomName.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'adminUpdateRoomNameRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:07:35.602Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: adminAddUsersToRoomRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/adminAddUserAgents.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/addUserAgents.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'adminAddUsersToRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:08:05.656Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: adminRemoveRoomRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/adminRemoveRoom.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/remove.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'adminRemoveRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:08:35.711Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: createRoomRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/add.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/addUserAgents.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'createRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:09:05.769Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: adminChangeRoomImageRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/adminChangeRoomImage.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'adminChangeRoomImageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:09:35.845Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: searchRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/search.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'searchRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:10:05.905Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: toggleAttachedRoomRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/toggleAttachedRoom.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'toggleAttachedRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:10:35.963Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: getUnreadMessagesRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/getUnreadMessages.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getUnreadMessagesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- +-------------------------- +date: 2024-04-29T01:11:06.010Z +controllerFile: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +service: room +controller: getRoomsMessageCountRest +userMessage: /Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js +[object Object] +/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/getRoomsMessageCount.js +[object Object] +systemMessage: Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRoomsMessageCountRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework. +I want 'summary' only have a short resume of what the controller does. Don't start it with "This handler" or "This Endpoint", only the summary. +I want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph): +* Short detailed description of what the handler does. It should always start with "This endpoint" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done. +* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**" +* Permissions: Information about the permissions required for the user to use the endpoint. It should start with "**Permissions:**" +* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does. +You can use this response as example: '{"summary":"Retrieve assets owned by the current user","description":"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\n\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\n\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\n\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format."}' + +error: Error: getaddrinfo ENOTFOUND api.openai.com +-------------------------- diff --git a/packages/leemons-openapi/lib/openapi.js b/packages/leemons-openapi/lib/openapi.js new file mode 100644 index 0000000000..71c2535835 --- /dev/null +++ b/packages/leemons-openapi/lib/openapi.js @@ -0,0 +1,157 @@ +const fs = require('fs'); +const path = require('path'); +const crypto = require('crypto'); +const os = require('os'); +const prettier = require('prettier'); + +const { createOpenapiDoc } = require('./createOpenapiDoc'); +const { writeFile, readFile } = require('./files'); +const { prettierOptions } = require('./prettierOptions'); + +/** + * Prepares the schema file + * @param {string} schemaPath - The path of the schema + * @param {string} controller - The controller + * @param {Object} schema - The schema + * @throws {Error} If the schema has been manually modified. + */ +function prepareSchemaFile(schemaPath, controller, schema) { + const schemaFilePath = path.join(schemaPath, `${controller}.js`); + + let schemaFile = null; + try { + schemaFile = readFile(schemaFilePath); + } catch (error) { + // + } + + if (schemaFile) { + const firstLine = schemaFile.split(os.EOL)[0]; + const hash = firstLine.split('// automatic hash: ')[1]; + const schemaContent = schemaFile.split(os.EOL).slice(1).join(os.EOL); + const calculatedHash = crypto.createHash('sha256').update(schemaContent).digest('hex'); + + if (hash !== calculatedHash) { + throw new Error(`(${schemaPath}/${controller}.js)Schema has been manually modified`); + } + } + + const schemaContent = prettier.format( + `const schema = ${JSON.stringify(schema, null, 4)}; + + module.exports = {schema}; + `, + prettierOptions + ); + + const calculatedHash = crypto.createHash('sha256').update(schemaContent).digest('hex'); + + writeFile( + schemaFilePath, + `// automatic hash: ${calculatedHash} +${schemaContent}` + ); +} + +/** + * Checks if a file is auto-generated + * @param {string} filePath - The path of the file + * @returns {boolean} - Returns true if the file is auto-generated, false otherwise + */ +function canUpdateAutogeneratedFile(filePath) { + // Por defecto no se actualizan los archivos auto-generados (ni los que se han cambiado a mano (que no tienen el AIGenerated a true)) + const updateAutoGeneratedFiles = + (process.env.OPENAPI_UPDATE_AUTOGENERATED_FILES && + process.env.OPENAPI_UPDATE_AUTOGENERATED_FILES !== 'false') || + false; + + const fileContent = readFile(filePath); + + // Esto ocurre cuando se ha autogenerado el archivo para añadir los openapi schemas de request y response + // Pero no se ha definido el summary y el description + if (fileContent.includes('// summary:') && fileContent.includes('// description:')) return true; + + return ( + updateAutoGeneratedFiles && + fileContent.includes("AIGenerated: 'true'") && + !fileContent.includes("//AIGenerated: 'true'") && + !fileContent.includes("// AIGenerated: 'true'") + ); +} + +/** + * Prepares the openapi file + * @param {Object} options - The options + * @param {string} options.controllerFilePath - The path of the controller file. Used to determine the directory structure for the openapi files. + * @param {string} options.service - The service. Used to name the openapi files. + * @param {string} options.controller - The controller. Used to name the openapi files. + * @param {Object} [options.responseSchema={}] - The response schema. Used to generate the openapi response schema. Defaults to an empty object. + * @param {Object} [options.requestSchema={}] - The request schema. Used to generate the openapi request schema. Defaults to an empty object. + * @param {Object} [options.openapiDoc={}] - The openapi document. Used to generate the openapi documentation. Defaults to an empty object. + * @param {boolean} [options.useAItoCreateOpenapiDoc=false] - Whether to use AI to create the openapi document. Defaults to false. + */ + +async function prepareOpenapiFile({ + controllerFilePath, + service, + controller, + responseSchema = {}, + requestSchema = {}, + openapiDoc = {}, + useAItoCreateOpenapiDoc = false, +}) { + const controllerPath = path.dirname(controllerFilePath); + const openapiPath = path.join(controllerPath, 'openapi', service); + const responseSchemaPath = path.join(openapiPath, 'schemas', 'response'); + const requestSchemaPath = path.join(openapiPath, 'schemas', 'request'); + + if (!fs.existsSync(responseSchemaPath)) { + fs.mkdirSync(responseSchemaPath, { recursive: true }); + } + if (!fs.existsSync(requestSchemaPath)) { + fs.mkdirSync(requestSchemaPath, { recursive: true }); + } + + const openapiFilePath = path.join(openapiPath, `${controller}.js`); + + if (!fs.existsSync(openapiFilePath) || canUpdateAutogeneratedFile(openapiFilePath)) { + const _openapiDoc = useAItoCreateOpenapiDoc + ? await createOpenapiDoc(service, controller, controllerFilePath) + : openapiDoc; + + const openapiResponse = `const { schema } = require('./schemas/response/${controller}'); + const { schema: xRequest } = require('./schemas/request/${controller}'); + + const openapi = { + ${_openapiDoc.summary ? `summary: "${_openapiDoc.summary}",` : '// summary: "Summary",'} + ${ + _openapiDoc.description + ? `description: \`${_openapiDoc.description.replace(/`/g, '\\`')}\`,` + : '// description: "Description",' + } + ${_openapiDoc.AIGenerated ? `AIGenerated: "true",` : ''} + "x-request": xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, + }; + + module.exports = { + openapi, + }; +`; + + writeFile(openapiFilePath, prettier.format(openapiResponse, prettierOptions)); + } + prepareSchemaFile(responseSchemaPath, controller, responseSchema); + prepareSchemaFile(requestSchemaPath, controller, requestSchema); +} + +module.exports = { prepareOpenapiFile }; diff --git a/packages/leemons-openapi/lib/prettierOptions.js b/packages/leemons-openapi/lib/prettierOptions.js new file mode 100644 index 0000000000..49f6d3d9ce --- /dev/null +++ b/packages/leemons-openapi/lib/prettierOptions.js @@ -0,0 +1,15 @@ +/** + * Prettier options for formatting the introduced code in files + * @type {Object} + */ +const prettierOptions = { + parser: 'babel', // The parser to use + tabWidth: 2, // The number of spaces per indentation level + useTabs: false, // Whether to use tabs for indentation + semi: true, // Whether to print semicolons at the ends of statements + endOfLine: 'lf', // The line feed type to use + trailingCommas: 'es5', // Whether to print trailing commas where possible + singleQuote: true, // Whether to use single quotes instead of double quotes +}; + +module.exports = { prettierOptions }; diff --git a/packages/leemons-openapi/lib/requests/actions-listRest.request.txt b/packages/leemons-openapi/lib/requests/actions-listRest.request.txt new file mode 100644 index 0000000000..7786167d26 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/actions-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/actions.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/actions.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/actions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/actions/list.js\n[object Object]", + "response": "{\"summary\":\"Lists all users in the system\",\"description\":\"This endpoint lists all users registered within the system, providing a comprehensive overview of each user's basic information without going into sensitive details.\\n\\n**Authentication:** Users need to be authenticated to retrieve the list of users. Access to this endpoint is contingent upon possessing a valid authentication token.\\n\\n**Permissions:** Specific permissions are required to access this endpoint. Typically, higher-level administrative roles have the rights to invoke this service to ensure data privacy and adherence to organizational policies.\\n\\nThe endpoint begins by accessing the `listUsers` method defined in the `UserService`. This method compiles a query which is then executed against the database to fetch all pertinent user data. The query is structured to respect privacy guidelines and only retrieve non-sensitive user attributes. After the database execution, the users' data is returned in a structured format, allowing the calling service to format the response appropriately before sending it back to the client. The response adheres to a JSON structure, providing a clean and understandable list of user data.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/activities-searchNyaActivitiesRest.request.txt b/packages/leemons-openapi/lib/requests/activities-searchNyaActivitiesRest.request.txt new file mode 100644 index 0000000000..e0fbc8b01a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/activities-searchNyaActivitiesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'searchNyaActivitiesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/activities.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/activities.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/searchNyaActivities.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getTeacherInstances.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getInstancesData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getAssignablesData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getAssetsData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/filterInstancesByStudentCompletionPercentage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/filterInstancesByStatusAndArchived.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesStatus/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesStatus/getInstancesStatus.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/sorts/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/sorts/sortInstancesByDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/filterByBlockedActivities.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/groupInstancesInModules.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/filterInstancesByIsModule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/helpers/updateModuleAssignationDates.js\n[object Object]", + "response": "{\"summary\":\"Search and retrieve ongoing NYA activities\",\"description\":\"This endpoint is designed to search and retrieve ongoing NYA (New Year Activities) that are assigned to either a teacher or a student, providing a comprehensive overview of educational tasks to manage or participate in. It specifically targets elements such as instances, status, and other relational data to ensure all pertinent information about the activities is included for the users.\\n\\n**Authentication:** Users need to be authenticated to access the information about ongoing NYA activities. An authentication check is performed to ensure only users with valid sessions can make use of this endpoint.\\n\\n**Permissions:** This endpoint requires the user to have specific roles or permissions, particularly roles related to educational or teaching activities. Unauthorized access is strictly handled and logged.\\n\\nThe handler begins with verifying user authentication and permissions before proceeding to invoke various methods such as `getTeacherInstances`, `getInstancesData`, and others from within the `activitiesData` and `filters` directories. It comprehensively assesses the user's role and the status of requested activities, filtering and sorting data accordingly. The entire process is aimed at delivering tailored and relevant activity data to authenticated and authorized users, from initiation and data processing to forming the final structured response that details the ongoing NYA activities.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/activities-searchOngoingActivitiesRest.request.txt b/packages/leemons-openapi/lib/requests/activities-searchOngoingActivitiesRest.request.txt new file mode 100644 index 0000000000..04af6c3a25 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/activities-searchOngoingActivitiesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'searchOngoingActivitiesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/activities.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/activities.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/searchEvaluatedActivities.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getStudentAssignations.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getInstancesData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getAssignablesData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getAssetsData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/filterModuleInstancesByHavingAllActivities.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/filterInstancesByNotModule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/filterInstancesByIsModule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/sorts/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/sorts/sortInstancesByDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/groupInstancesInModules.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/returnModulesData.js\n[object Object]", + "response": "{\"summary\":\"Search ongoing activities for the user\",\"description\":\"This endpoint facilitates the retrieval of ongoing activities related to the user. It is designed to provide a list of activities currently active or in progress, which the user has been assigned or has roles assigned in, illustrating typical use in educational or training platforms.\\n\\n**Authentication:** Users are required to be authenticated to access ongoing activities. This ensures that activities are appropriately secured and that users can only access activities that are relevant to their roles and assignments.\\n\\n**Permissions:** This endpoint demands specific permissions allowing the user to view ongoing activities. The exact permissions may include viewing capabilities based on the user's role or group within the application, ensuring they only access assigned or permitted activities.\\n\\nThe process begins with the 'searchEvaluatedActivities' method, which filters the activities based on evaluation criteria specific to each user's role or assignments. Following the filtering process, the 'getInstancesData', 'getAssignablesData', 'getAssetsData', and 'getStudentAssignations' methods from the 'activitiesData' directory are sequentially invoked to compile detailed information about each activity. This compiled data includes everything from basic activity details to specific user assignments and related resources, which are then returned to the user in a structured JSON format. The flow ensures that all accessed data passes through stringent checks for permissions and user authentication.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/activities-searchOngoingRest.request.txt b/packages/leemons-openapi/lib/requests/activities-searchOngoingRest.request.txt new file mode 100644 index 0000000000..c4b409ae2c --- /dev/null +++ b/packages/leemons-openapi/lib/requests/activities-searchOngoingRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'searchOngoingRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/activities.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/activities.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/searchOngoingActivities.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getActivitiesDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/filterAssignationsByDaysUntilDeadline.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/sorts/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/sorts/applyOffsetAndLimit.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/filterInstancesByIsModule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/groupInstancesInModules.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/returnModulesData.js\n[object Object]", + "response": "{\"summary\":\"Search and compile ongoing activities for a user\",\"description\":\"This endpoint searches and compiles a list of ongoing activities that are relevant to the logged-in user. The main function is to provide an organized view of activities like assignments or projects that are currently active and require the user's attention or action.\\n\\n**Authentication:** User authentication is required to access this endpoint. It ensures that the data returned is specific to the authenticated user and their permissions.\\n\\n**Permissions:** The user must have the appropriate permissions to view activities. This typically includes being part of certain user groups or roles that have access to specific modules or activities within the system.\\n\\nThe controller initializes by invoking the `searchOngoingActivities` method which aggregates data across different tables to collate ongoing activities. This process involves filtering activities based on their deadlines, grouping them by modules if applicable, and applying pagination through offsets and limits to manage the data volume returned. Each activity's details, including start and end dates, are processed to ensure that users receive timely and relevant information tailored to their role and permissions in the system.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/admin-adminRealtimeRest.request.txt b/packages/leemons-openapi/lib/requests/admin-adminRealtimeRest.request.txt new file mode 100644 index 0000000000..7af756548d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/admin-adminRealtimeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'adminRealtimeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dashboard/backend/services/rest/admin.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dashboard/backend/services/rest/admin.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dashboard/backend/core/dashboard/getAdminDashboardRealtime.js\n[object Object]", + "response": "{\"summary\":\"Provide real-time dashboard data for administrators\",\"description\":\"This endpoint provides a real-time view of the dashboard data specifically tailored for administrators. It facilitates the monitoring and management of various system metrics and activities from a centralized dashboard interface.\\n\\n**Authentication:** Access to this endpoint requires the user to be authenticated. Failure to provide valid authentication credentials will prevent access.\\n\\n**Permissions:** The user must have administrator-level permissions to access this endpoint. This ensures that only authorized personnel can view and interact with the sensitive real-time data presented.\\n\\nUpon receiving a request, the `adminRealtimeRest` handler firstly verifies the authentication and permissions of the requesting user to ensure they meet the required criteria. If authentication or permissions are inadequate, the request is denied. Once authenticated, it invokes the `getAdminDashboardRealtime` core method. This method consolidates data from various services and modules within the platform, processing them to generate real-time insights. The data is then returned to the admin user through this endpoint in a structured JSON format, which includes key performance metrics and system statuses crucial for administrative monitoring and decision-making.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/admin-adminRest.request.txt b/packages/leemons-openapi/lib/requests/admin-adminRest.request.txt new file mode 100644 index 0000000000..0bb79ac8f1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/admin-adminRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'adminRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dashboard/backend/services/rest/admin.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dashboard/backend/services/rest/admin.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dashboard/backend/core/dashboard/getAdminDashboard.js\n[object Object]", + "response": "{\"summary\":\"Manage and display the admin dashboard configuration\",\"description\":\"This endpoint is responsible for handling requests related to the administration dashboard's configuration and display settings. It serves to aggregate and provide data necessary for the admin dashboard's functionality, tailored specifically to the administrative user's needs and preferences.\\n\\n**Authentication:** Access to this endpoint requires the user to be authenticated as an administrator. Proper credentials must be provided for authentication, and failure to authenticate will deny access to the endpoint functionalities.\\n\\n**Permissions:** This endpoint requires that the user have administrative privileges. Users must have particular roles or permissions designated within the system to interact with the admin dashboard functionalities.\\n\\nUpon receiving a request, the `getAdminDashboard` handler in the `leemons-plugin-dashboard` invokes related core methods designed to collect and assemble various pieces of information required for the dashboard. It processes these data points, such as system stats, user activities, and operational insights, to create a comprehensive view suitable for admin-level decision-making. Once the data is collated, it is returned in a structured format, allowing the admin dashboard to render an informed and detailed interface for the administrator.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-addPinRest.request.txt b/packages/leemons-openapi/lib/requests/assets-addPinRest.request.txt new file mode 100644 index 0000000000..efac6e568f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-addPinRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addPinRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]", + "response": "{\"summary\":\"Add a new pin to the user's collection\",\"description\":\"This endpoint allows the authenticated user to add a new pin to their personal collection within the platform. It is primarily designed to help users organize and save items of interest.\\n\\n**Authentication:** Users need to be logged in to utilize this feature. Access will be denied for any requests without a valid authentication session.\\n\\n**Permissions:** The user must have the 'add_pin' permission, which allows them to append new pins to their collection. This ensures that only users with the requisite rights can make modifications to their pin collection.\\n\\nUpon receiving a request, the endpoint first verifies the user's authentication status and permissions. It then proceeds to invoke the `addPin` function, passing user-specific data extracted from the request body. This function is responsible for creating a new pin and saving it to the database associated with the user's account. After successful insertion, the response confirms the creation of the new pin along with its details serialized in JSON format, indicating a successful operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-addRest.request.txt b/packages/leemons-openapi/lib/requests/assets-addRest.request.txt new file mode 100644 index 0000000000..71cf17ceb1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-addRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/set/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/set/setAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/buildQuery.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getUserPermissionsByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/getClassesPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getAssetPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canUnassignRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getRolePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/validateRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithFiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/find.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsCategoryData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsProgramsAggregatedById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/processFinalAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/handleUpdateObject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/getDiff.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/handleAssetUpgrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/duplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/shared/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/shared/normalizeItemsArray.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/checkDuplicatePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/getAndCheckAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/getFileIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/getFilesToDuplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleAssetDuplication.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleBookmarkData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleUserSessionData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleCategoryData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/checkAndHandleCanUse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleFileUpload.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/helpers/uploadFromSource.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleVersion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/createAssetInDb.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handlePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleFiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleCoverDuplication.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleBookmarkDuplication.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleFilesDuplication.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/handleSubjectsUpdates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/handleTagsUpdates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/handleFileAndCoverUpdates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/handleFilesRemoval.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getUsersByAsset/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getUsersByAsset/getUsersByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAsset/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAsset/getByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canAssignRole.js\n[object Object]", + "response": "{\"summary\":\"Add new digital asset to the library\",\"description\":\"This endpoint handles the addition of a new digital asset to the platform's library. It facilitates users to upload and categorize new content, such as books, media files, or other educational resources, making these assets available for access and use across the platform.\\n\\n**Authentication:** User authentication is mandatory to ensure secure upload and proper attribution of the uploaded assets to the respective user accounts. An unauthorized or unauthenticated request will be rejected.\\n\\n**Permissions:** The user must have the 'add_asset' permission within their role to upload new assets. This permission check ensures that only authorized users can add content to the library.\\n\\nUpon receiving a request, the endpoint first validates the user's authentication and permissions. Assuming all checks pass, the service then proceeds to handle the file upload, metadata assignment, and category association using dedicated services such as `handleFileUpload`, `handleCategoryData`, and `createAssetInDb`. These methods collectively ensure that the asset is appropriately stored, categorized, and recorded in the database. The entire process encapsulates data validation, permission checks, and structured data entry, culminating in a status response that indicates whether the asset has been successfully added.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-duplicateRest.request.txt b/packages/leemons-openapi/lib/requests/assets-duplicateRest.request.txt new file mode 100644 index 0000000000..25d3930385 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-duplicateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'duplicateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/duplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/shared/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/shared/normalizeItemsArray.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/checkDuplicatePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/getAndCheckAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/getFileIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/getFilesToDuplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleAssetDuplication.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleBookmarkData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleUserSessionData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleCategoryData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/checkAndHandleCanUse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleFileUpload.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/helpers/uploadFromSource.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleVersion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/createAssetInDb.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handlePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getAssetPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleFiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleCoverDuplication.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleBookmarkDuplication.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleFilesDuplication.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/prepareAsset/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/prepareAsset/prepareAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/prepareAsset/prepareAssetType.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/prepareAsset/getFileUrl.js\n[object Object]", + "response": "{\"summary\":\"Duplicates an asset based on a provided ID\",\"description\":\"This endpoint facilitates the duplication of a digital asset identified by its unique ID. The duplication process includes duplicating the asset's metadata, tags, associated files, and any specific permissions or categorizations linked to the original asset.\\n\\n**Authentication:** Users must be authenticated and possess the required session tokens to initiate a duplication request. Authentication verifies user identity and session validity before proceeding.\\n\\n**Permissions:** Users need specific 'duplicate' permissions on the asset they intend to duplicate. Without these permissions, the request will be denied, ensuring that only authorized users can duplicate assets.\\n\\nUpon receiving a duplication request, the endpoint initially verifies user authentication and checks if the user has the necessary duplication permissions for the specified asset. If authenticated and authorized, the endpoint calls multiple services: it retrieves the original asset's information, checks for existing duplicates, and then proceeds to duplicate the asset's metadata, files, and tags. Throughout this process, all related entities such as bookmarks or categories associated with the asset are also considered for duplication. The final output is the creation of a new asset entry in the database, echoing the properties of the original while ensuring data consistency and integrity.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-getRest.request.txt b/packages/leemons-openapi/lib/requests/assets-getRest.request.txt new file mode 100644 index 0000000000..b3db422b30 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-getRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/buildQuery.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getUserPermissionsByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/getClassesPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getAssetPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canUnassignRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getRolePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/validateRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithFiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/find.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsCategoryData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsProgramsAggregatedById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/processFinalAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getUsersByAsset/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getUsersByAsset/getUsersByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAsset/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAsset/getByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canAssignRole.js\n[object Object]", + "response": "{\"summary\":\"Retrieve specific assets based on provided IDs\",\"description\":\"This endpoint is designed to fetch a detailed list of assets by their unique identifiers. It caters to retrieving comprehensive asset details which could include metadata, associated permissions, user roles, and more, depending on the asset's configuration and user's access rights.\\n\\n**Authentication:** Access to this endpoint requires user authentication. Users need to pass valid authentication tokens with their requests to prove their identity and session validity.\\n\\n**Permissions:** Users must have appropriate permissions to view the requested assets. The specific permissions required will depend on the assets being accessed and the level of detail required. Permissions checks are integral to ensure that users can only retrieve data for assets they are authorized to access.\\n\\nUpon receiving a request, the endpoint processes input IDs and invokes several internal methods to retrieve the assets. These methods include querying the database for asset details, checking user permissions, and potentially aggregating additional data related to each asset such as associated files, permissions, or related programs. The result encapsulates a comprehensive view of each asset, tailored to the authenticated user’s access rights. The response is then formatted as a JSON object containing all the necessary details about each asset.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-hasPinsRest.request.txt b/packages/leemons-openapi/lib/requests/assets-hasPinsRest.request.txt new file mode 100644 index 0000000000..c061068aa4 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-hasPinsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'hasPinsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]", + "response": "{\"summary\":\"Check for the existence of digital assets pins related to a user\",\"description\":\"This endpoint checks if any digital asset pins related to a specific user exist in the system, helping to quickly identify user interactions with assets such as likes, bookmarks, or any kind of flags.\\n\\n**Authentication:** Users need to be logged in to check for pins. If the authentication details are missing or invalid, the request is rejected.\\n\\n**Permissions:** The user must have the 'view_pins' permission to execute this operation. This ensures that only authorized users can check for their interactions with assets.\\n\\nInitially, the handler invokes the `hasPins` method of the `Assets` service, providing user and asset identifiers wrapped in the request context. This method queries the underlying database to verify the existence of any pins associated with the user's account. The operation does not return the pins themselves but rather a boolean indicating the presence or absence of such interactions. Depending on the outcome, the response is structured to inform the client if at least one pin related to the user exists, facilitating efficient frontend decision-making regarding the display of user-specific asset interactions.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-listByIdsRest.request.txt b/packages/leemons-openapi/lib/requests/assets-listByIdsRest.request.txt new file mode 100644 index 0000000000..41eacbc7ad --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-listByIdsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listByIdsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/buildQuery.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getUserPermissionsByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/getClassesPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getAssetPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canUnassignRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getRolePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/validateRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithFiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/find.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsCategoryData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsProgramsAggregatedById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/processFinalAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/prepareAsset/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/prepareAsset/prepareAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/prepareAsset/prepareAssetType.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/prepareAsset/getFileUrl.js\n[object Object]", + "response": "{\"summary\":\"Retrieve a list of assets by their identifiers\",\"description\":\"This endpoint retrieves a list of assets based on a provided array of asset identifiers. The primary function is to fetch detailed information about each asset, which may include metadata, linked files, tags, categories, and associated programs or subjects.\\n\\n**Authentication:** Users must be authenticated to access this endpoint. Access is denied if the user's session is not valid or the authentication token is missing.\\n\\n**Permissions:** Users need specific roles or permissions set to retrieve the detailed information of each asset. The required permissions vary based on the asset sensitivity and classification.\\n\\nThe handler initiates by calling the `getByIds` method from the `Assets` core, which receives an array of asset IDs through the request parameters. It orchestrates several steps: validating user roles with `getUserPermissionsByAsset` to check access rights, fetching related asset data such as subjects, files, and tags using respective methods like `getAssetsWithSubjects` and `getAssetsWithFiles`. Each asset is then processed to append additional data such as category and program specifics with `getAssetsCategoryData` and `getAssetsProgramsAggregatedById`. Finally, `processFinalAsset` method formats the assets into a presentable structure before sending them back in the HTTP response as a JSON formatted list.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-listRest.request.txt b/packages/leemons-openapi/lib/requests/assets-listRest.request.txt new file mode 100644 index 0000000000..a5d8702247 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByCategory/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByCategory/getByCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByCategory/handleParams.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByCategory/handlePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getPublic/getPublic.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getRolePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/validateRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByCategory/handleAssetIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getAssetIdFromPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getAssetsByProgram/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getAssetsByProgram/getAssetsByProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/shared/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/shared/normalizeItemsArray.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getAssetsBySubject/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getAssetsBySubject/getAssetsBySubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByCategory/handleSorting.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/buildQuery.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getUserPermissionsByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/getClassesPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getAssetPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canUnassignRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithFiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/find.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsCategoryData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsProgramsAggregatedById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/processFinalAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAssets/getByAssets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAssets/handleOnlyShared.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAssets/handleItemPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByCategory/handlePermissionsRoles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByCategory/handleViewerRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByCategory/handleEditorRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByCategory/handleAssignerRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByCategory/handleIndexable.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByCategory/handlePreferCurrent.js\n[object Object]", + "response": "{\"summary\":\"List all assets based on user permissions\",\"description\":\"This endpoint lists all assets accessible to the currently authenticated user based on their permissions. The returned assets may include those owned by the user, shared directly with the user, or shared within teams or groups the user belongs to.\\n\\n**Authentication:** Users must be authenticated to view the list of accessible assets. Proper authentication ensures that the returned list reflects accurate asset access as per user credentials and roles.\\n\\n**Permissions:** Users need to have the 'view' permission for assets. The system conducts a permission check to ensure the user has rights to access each asset listed. Absence of adequate permissions will limit the visibility of certain assets in the response.\\n\\nUpon receiving a request, the handler initializes by validating the user’s authentication status. Once authenticated, it proceeds to fetch asset data by invoking related methods like `filterAssetsByUserPermissions` which determine the assets that the user is eligible to view. The methodology involves querying the database using criteria based on the user's roles and applicable permissions. Post query execution, the endpoint aggregates the data and formats it into a structured response. Finally, the service returns the list of assets in a JSON formatted payload, providing a clear view of all accessible resources to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-myRest.request.txt b/packages/leemons-openapi/lib/requests/assets-myRest.request.txt new file mode 100644 index 0000000000..67c262dda1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-myRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'myRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/pins/getByUser/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/pins/getByUser/getByUser.js\n[object Object]", + "response": "{\"summary\":\"Manage asset interactions for users\",\"description\":\"This endpoint facilitates various interactions for a user’s digital assets within the platform which includes fetching, updating, and deleting operations depending on the user's input and query parameters.\\n\\n**Authentication:** User authentication is mandatory to ensure the secure handling of assets. Access without proper authentication will be denied.\\n\\n**Permissions:** Users need appropriate permissions to interact with assets. Specific permissions like `asset_modify` or `asset_delete` might be required based on the action attempted.\\n\\nThe flow within this endpoint begins by determining the type of request made by the user — get, update, or delete. This is managed by routing the request to the respective function within the asset management controller. Each function uses the `ctx` parameter to access user details and validate permissions. For 'get' operations, it calls a method to retrieve assets linked to the user. For 'update' or 'delete', additional verification checks if the user has rights to modify or remove the asset. Once the requested action is completed, the response, typically in JSON format, reflects the outcome of this operation (success or error details).\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-pinsRest.request.txt b/packages/leemons-openapi/lib/requests/assets-pinsRest.request.txt new file mode 100644 index 0000000000..515bc3d295 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-pinsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'pinsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]", + "response": "{\"summary\":\"Manages pin-related functionalities for assets\",\"description\":\"This endpoint is responsible for handling various operations related to pins, including adding, removing, updating, and retrieving pin information related to assets in the Leebrary system.\\n\\n**Authentication:** Users must be logged in to interact with pin functionalities. Access is denied if authentication credentials are absent or invalid.\\n\\n**Permissions:** User permissions need to align with actions like creating, updating, or deleting pins. Specific permission validation is performed based on the user role and the nature of the operation requested.\\n\\nUpon receiving a request, this controller first verifies the user's authentication and permissions. Depending on the operation - add, remove, update, or fetch - it delegates the task to respective methods within the `PinsService`. Each method utilizes the Moleculer service actions to interact with the database and manipulate or retrieve pin data associated with assets. The flow typically involves validating the input parameters, executing the logic required for each type of pin operation, and formatting the output to be suitable for client's consumption, finalizing with an HTTP response conveying the result or status of the operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-removePinRest.request.txt b/packages/leemons-openapi/lib/requests/assets-removePinRest.request.txt new file mode 100644 index 0000000000..ddb7f0d993 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-removePinRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removePinRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]", + "response": "{\"summary\":\"Remove a pinned asset from the user's collection\",\"description\":\"This endpoint allows a user to unpin or remove an asset previously marked as important or distinctive in their collection. The function alters the user's pinned asset list by removing a specified asset, thus updating the user's preferences and collection views.\\n\\n**Authentication:** User authentication is mandatory to ensure that the request to unpin an asset originates from a bona fide source. An invalid or expired authentication token will prevent access to this functionality.\\n\\n**Permissions:** This endpoint requires that users have proper rights to modify their own pinned assets. The specific permission `unpin_asset` should be validated to permit the operation which ensures the integrity and security of user data.\\n\\nUpon receiving a request, the `removePinRest` endpoint first verifies user authentication and permissions. It then proceeds to call the `unpinAsset` method within the service logic where the actual unpinning procedure is executed. This method checks the provided asset identifier against the user’s currently pinned assets, and if found, it is removed from the pinned list. The entire process is encapsulated within a transaction to ensure data consistency. Should the operation succeed, a success response is sent back to the user; in case of failure due to reasons such as non-existent asset ID or insufficient permissions, the appropriate error message is returned.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-removeRest.request.txt b/packages/leemons-openapi/lib/requests/assets-removeRest.request.txt new file mode 100644 index 0000000000..43f198a01d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-removeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/remove/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/remove/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/buildQuery.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getUserPermissionsByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/getClassesPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getAssetPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canUnassignRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getRolePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/validateRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithFiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/find.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsCategoryData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsProgramsAggregatedById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/processFinalAsset.js\n[object Object]", + "response": "{\"summary\":\"Removes a specified asset from the library\",\"description\":\"This endpoint allows for the deletion of a specified asset from the library according to its unique identifier. The asset is permanently removed from the database and all associated metadata and permissions settings are also deleted.\\n\\n**Authentication:** Users must be authenticated to delete assets. The system validates the user's authentication token, and failure to provide a valid token results in denial of access to the endpoint.\\n\\n**Permissions:** The user must have administrative or specific deletion permissions for the asset they attempt to remove. If the user lacks the necessary permissions, the endpoint will deny access and return an error.\\n\\nUpon receiving a request, the handler in `assets.rest.js` invokes the `remove` action from the corresponding service. This action utilizes methods defined in `remove.js` and related files to check the user's permissions, validate the existence of the asset, and proceed with the deletion process from the database. Detailed error handling ensures feedback is provided for failures such as missing permissions, non-existent assets, or database errors. The flow ensures a secure operation protecting the integrity and access control of asset data within the system.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-updateRest.request.txt b/packages/leemons-openapi/lib/requests/assets-updateRest.request.txt new file mode 100644 index 0000000000..7c306eb124 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-updateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/set/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/set/setAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/buildQuery.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getUserPermissionsByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/getClassesPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getAssetPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canUnassignRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getRolePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/validateRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithFiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/find.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsCategoryData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsProgramsAggregatedById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/processFinalAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/handleUpdateObject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/getDiff.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/handleAssetUpgrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/duplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/shared/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/shared/normalizeItemsArray.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/checkDuplicatePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/getAndCheckAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/getFileIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/getFilesToDuplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleAssetDuplication.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleBookmarkData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleUserSessionData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleCategoryData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/checkAndHandleCanUse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleFileUpload.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/helpers/uploadFromSource.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleVersion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/createAssetInDb.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handlePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/add/handleFiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleCoverDuplication.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleBookmarkDuplication.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/duplicate/handleFilesDuplication.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/handleSubjectsUpdates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/handleTagsUpdates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/handleFileAndCoverUpdates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/update/handleFilesRemoval.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getUsersByAsset/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getUsersByAsset/getUsersByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAsset/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAsset/getByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canAssignRole.js\n[object Object]", + "response": "{\"summary\":\"Update asset details\",\"description\":\"This endpoint is responsible for updating the details of a specific asset in the repository. It accepts updates to various fields of an asset, including but not limited to, the asset’s name, description, and associated metadata. The endpoint processes these updates and ensures the asset's data integrity is maintained throughout the update procedure.\\n\\n**Authentication:** Users must be authenticated to modify asset data. The system will validate the user’s authentication token before proceeding with the update process.\\n\\n**Permissions:** Appropriate permissions are required to update asset details. Users must have edit or admin rights on the specific asset they are attempting to update. The system checks for these permissions before accepting the update request.\\n\\nUpon receiving the request, the `updateRest` handler invokes the `updateAsset` method from the `Assets` core service. This method meticulously validates the updated data against existing records for conflicts and compliance with business rules. After validation, it proceeds to update the database records. The method coordinates with various sub-services like permissions checking and data validation, ensuring a robust and secure update process. The response from this method will confirm whether the update has been successful, with appropriate error handling for any issues encountered during the update.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assets-urlMetadataRest.request.txt b/packages/leemons-openapi/lib/requests/assets-urlMetadataRest.request.txt new file mode 100644 index 0000000000..88fcba66d0 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assets-urlMetadataRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'urlMetadataRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/shared/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/shared/metascraper.js\n[object Object]", + "response": "{\"summary\":\"Extracts URL metadata for enhanced content previews\",\"description\":\"This endpoint is designed to fetch and parse metadata from URLs to enhance content previews such as title, description, and image. This functionality is crucial for applications that require rich link previews to provide better context and visual cues to users.\\n\\n**Authentication:** User authentication is mandatory to ensure that only authorized users can request metadata extraction for URLs. Without valid user credentials, the request will be denied.\\n\\n**Permissions:** The user must have appropriate permissions to extract metadata from specified URLs. This generally includes permissions to access the URLs or domains from which metadata is being extracted.\\n\\nUpon receiving a request, the endpoint utilizes the `metascraper` library, configured within the platform, to process the URL provided by the user. It initiates a network call to retrieve HTML content from the URL and then employs a series of scraping rules to extract metadata like the site title, main image, and description. This extracted metadata will then be formatted accordingly and sent back to the client as a structured JSON response, effectively enhancing the content display for any application's frontend.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assignableInstances-getRest.request.txt b/packages/leemons-openapi/lib/requests/assignableInstances-getRest.request.txt new file mode 100644 index 0000000000..d2fcce3db3 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assignableInstances-getRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js\n[object Object]", + "response": "{\"summary\":\"Manages instances of assignables related to specific telemetry configurations\",\"description\":\"This endpoint manages the creation, update, and deletion of assignable instances within the Leemons platform, specifically focusing on elements related to telemetry configurations. The handling includes operations like setting up initial instances based on templates, updating existing configurations, or removing them as necessary based on user actions or system requirements.\\n\\n**Authentication:** User authentication is mandatory to ensure secure access to assignable instances. The system validates the authenticity of the user's credentials before processing any operations.\\n\\n**Permissions:** Appropriate permissions are required to access this endpoint. Users must have administrative rights or specific role-based permissions that allow them to manage assignable instances and their related configurations.\\n\\nThe action flow begins by validating user context and permissions. Once authentication and authorization are confirmed, the handler invokes various methods depending on the request type: `createInstance`, `updateInstance`, or `deleteInstance`. These methods interact with the platform's backend services to perform database operations that reflect the changes made by the user. The process ensures the accurate application of templates for new instances, updates to existing configurations based on user inputs, or the clean removal of instances when no longer needed. The outcome of these operations is then formatted and sent back to the user as a structured JSON response detailing the status and any relevant instance data.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assignableInstances-searchRest.request.txt b/packages/leemons-openapi/lib/requests/assignableInstances-searchRest.request.txt new file mode 100644 index 0000000000..366ce25204 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assignableInstances-searchRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'searchRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/searchInstances/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/searchInstances.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getTeacherInstances.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getInstancesData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getAssignablesData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/activitiesData/getAssetsData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/filters/filterInstancesByRoleAndQuery.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/searchInstances/filterByInstanceDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/searchInstances/getInstanceDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/sorts/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/ongoing/helpers/sorts/sortInstancesByDates.js\n[object Object]", + "response": "{\"summary\":\"Search assignable instances based on specified criteria\",\"description\":\"This endpoint handles the search operation for different instances of assignables based on the presented criteria, filters, and sort options supplied as part of the request. This could cover a wide range of assignable types, like homework, projects, or quizzes, facilitating the retrieval of relevant assignables according to user needs.\\n\\n**Authentication:** Users need to be authenticated in order to perform a search on assignable instances. The user’s credentials must be verified to ensure valid access to the requested data.\\n\\n**Permissions:** Specific permissions are required to access this endpoint, ensuring that only users with rights to view or manage assignables can execute searches on instances.\\n\\nThe flow of the controller starts by validating user authentication and permissions. Upon validation, it processes the incoming query including filters like date, status, or type of assignable. The method `filterInstancesByRoleAndQuery` from the helpers filters the instances according to the role of the user and the query parameters. Afterwards, `getInstanceDates` and `filterByInstanceDates` methods are applied to narrow down the search results relating to specific date ranges. Finally, the search results are sorted by date via the `sortInstancesByDates` method before sending the response back to the user containing the filtered and sorted list of assignable instances.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assignableInstances-sendReminderRest.request.txt b/packages/leemons-openapi/lib/requests/assignableInstances-sendReminderRest.request.txt new file mode 100644 index 0000000000..82955c0af8 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assignableInstances-sendReminderRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'sendReminderRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendReminder/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendReminder/sendReminder.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstance/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstance/getInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getInstances.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getUserPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getUserPermissions/getUserPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getRoleMatchingActions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getRoleMatchingActions/getRoleMatchingActions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getPermissionName/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getPermissionName/getPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getTeacherPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getTeacherPermissions/getTeacherPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getRelatedInstances.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/classes/listInstanceClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/findDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignables/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignables/getAssignables.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/getUserPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getRoleMatchingActions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getRoleMatchingActions/getRoleMatchingActions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getPermissionName/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getPermissionName/getPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getTeacherPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getTeacherPermissions/getTeacherPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/roles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/roles/getRoles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/subjects/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/subjects/getSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getAssignationsData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignationsOfInstance/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignationsOfInstance/getAssignationsOfInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getAssignations.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/checkPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getClassesWithSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getRelatedAssignationsTimestamps.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getRelatedAssignations.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/findAssignationDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getModuleActivitesTimestamps.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/findInstanceDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getGrades.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getAssignationStatus.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getInstancesSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/helpers/getActivityEvaluationType.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/sendEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/helpers/canSendEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/helpers/prepareEmailContext.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/helpers/getCoverAndAvatarUrls.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/helpers/formatDate.js\n[object Object]", + "response": "{\"summary\":\"Send reminder notifications to users\",\"description\":\"This endpoint triggers the process of sending reminder notifications to users regarding their pending assignments. It is specifically designed to handle operations related to reminding users via email or other configured communication channels of upcoming deadlines or actions required on their part.\\n\\n**Authentication:** User authentication is required to ensure that the reminder notifications are sent only to legitimate and authenticated users within the system.\\n\\n**Permissions:** Users need to have specific roles or permission levels, typically 'user:read' or 'user:write', to trigger sending reminders. The exact permission required can vary based on the system configuration and the sensitivity of the information being reminded about.\\n\\nUpon receiving a request, the `sendReminder` action in `instance.rest.js` initializes the process by calling the `sendReminder` method from the `sendReminder` core. This method verifies user permissions and authenticates the session before proceeding. If the checks pass, it fetches user data related to the assignments that require reminders. It then formats the reminder messages and utilizes configured communication services to dispatch these reminders to the respective users. The workflow ensures that only users with pending actions and correct permissions receive the reminders, thereby adhering to the system's security protocols.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assignableInstances-updateRest.request.txt b/packages/leemons-openapi/lib/requests/assignableInstances-updateRest.request.txt new file mode 100644 index 0000000000..f8659ca71e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assignableInstances-updateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/updateInstance/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/updateInstance/updateInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/helpers/validators/instance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getUserPermission/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getUserPermission/getUserPermission.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getPermissionName/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getPermissionName/getPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getTeacherPermission/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getTeacherPermission/getTeacherPermission.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/classes/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/classes/listInstanceClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getRoleMatchingActions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getRoleMatchingActions/getRoleMatchingActions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstance/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstance/getInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getInstances.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getUserPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getUserPermissions/getUserPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getTeacherPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getTeacherPermissions/getTeacherPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getRelatedInstances.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/findDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignables/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignables/getAssignables.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/getUserPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getRoleMatchingActions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getRoleMatchingActions/getRoleMatchingActions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getPermissionName/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getPermissionName/getPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getTeacherPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getTeacherPermissions/getTeacherPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/roles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/roles/getRoles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/subjects/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/subjects/getSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getAssignationsData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignationsOfInstance/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignationsOfInstance/getAssignationsOfInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getAssignations.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/checkPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getClassesWithSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getRelatedAssignationsTimestamps.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getRelatedAssignations.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/findAssignationDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getModuleActivitesTimestamps.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/findInstanceDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getGrades.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getAssignationStatus.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getInstancesSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/helpers/getActivityEvaluationType.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/helpers/getDiff.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/dates/updateDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/dates/getDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/dates/unregisterDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/dates/registerDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/classes/updateClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/classes/unregisterClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/classes/registerClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/updateInstance/createRelatedInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/createInstance/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/createInstance/createInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignable/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignable/getAssignable.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/registerPermission/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/registerPermission/registerPermission.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getPermissionType/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getPermissionType/getPermissionType.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/createInstance/getTeachersOfGivenClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/teachers/addTeachersToAssignableInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/createInstance/createEventAndAddToUsers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/calendar/registerEvent/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/calendar/registerEvent/registerEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/dates/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/addPermissionToUser/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/addPermissionToUser/addPermissionToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/createAssignation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/helpers/validators/assignation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/helpers/throwIfAnyUserIsAlreadyAssignedToInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/helpers/createComunicaRooms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/helpers/getTeachersBySubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/helpers/comunica/createInstanceRoom.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/helpers/comunica/createGroupRoom.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/helpers/comunica/addUserSubjectRoom.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/sendEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/helpers/canSendEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/helpers/prepareEmailContext.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/helpers/getCoverAndAvatarUrls.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/helpers/formatDate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/createInstance/emitLeemonsEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/updateInstance/updateEventAndAddToUsers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/calendar/updateEvent/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/instances/calendar/updateEvent/updateEvent.js\n[object Object]", + "response": "{\"summary\":\"Update instance details\",\"description\":\"This endpoint updates specific details of an instance based on the provided identifier. It is typically used to modify parameters like name, status, or configuration settings of an instance within the system.\\n\\n**Authentication:** User authentication is mandatory to ensure that the request is made by a system-recognized user. Access without valid authentication will result in refusal of the operation.\\n\\n**Permissions:** This action requires the user to have 'edit' permission on the instance entity. Without the necessary permissions, the operation will not be processed, and an error will be returned.\\n\\nUpon receiving the request, the `updateInstance` method is activated within the controller, which first checks for the presence of a valid user session and appropriate permissions. Following these checks, it retrieves the instance data from the database, updates the fields as per the request, and then commits these changes to the database. The process involves validation of the input data against pre-set criteria to prevent invalid data storage. On success, the updated instance data is sent back to the client, encapsulating the changes in a JSON format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assignables-getRest.request.txt b/packages/leemons-openapi/lib/requests/assignables-getRest.request.txt new file mode 100644 index 0000000000..02d7708968 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assignables-getRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/assignables.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/assignables.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignables/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignables/getAssignables.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/getUserPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getRoleMatchingActions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getRoleMatchingActions/getRoleMatchingActions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getPermissionName/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getPermissionName/getPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getTeacherPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getTeacherPermissions/getTeacherPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/roles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/roles/getRoles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/subjects/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/core/subjects/getSubjects.js\n[object Object]", + "response": "{\"summary\":\"Manage assignable items in the system\",\"description\":\"This endpoint is responsible for managing assignable items such as tasks, homework, projects, etc., in the educational platform. It allows for creating, retrieving, updating, or deleting information related to assignables depending on the provided method and parameters.\\n\\n**Authentication:** User authentication is required to interact with this endpoint. Users must provide a valid session token that the system verifies before granting access to the assignable resources.\\n\\n**Permissions:** Users need specific permissions related to the assignables they are trying to interact with. Typically, permissions like 'assignable.view', 'assignable.edit', and 'assignable.delete' might be checked depending on the action requested.\\n\\nUpon receiving a request, the endpoint first checks the user's authentication status and permissions. If the user is authenticated and has the necessary permissions, the respective action is performed by calling the appropriate service method within the `assignables` plugin's backend. These methods interact with the database to fetch, update, or delete the assignable data as requested. Detailed logs are maintained for auditing and troubleshooting. The response from the action is then prepared and sent back to the client, detailing the outcome of their request or providing the requested data.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assignations-getManyRest.request.txt b/packages/leemons-openapi/lib/requests/assignations-getManyRest.request.txt new file mode 100644 index 0000000000..6f09bc6f8f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assignations-getManyRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getManyRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/assignations.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/assignations.rest.js\n[object Object]", + "response": "{\"summary\":\"Fetches multiple assignations based on specified criteria\",\"description\":\"This endpoint fetches a list of assignations based on various filtering, sorting, and pagination parameters. It is intended to provide a comprehensive overview of assignations that meet specified criteria, aiding in efficient data management and retrieval within the application.\\n\\n**Authentication:** Users must be authenticated to request the assignation data. Authentication tokens must be provided as part of the request headers to verify user identity and session validity.\\n\\n**Permissions:** Proper permissions are required to access this endpoint. Users need to have roles or rights specifically granting them access to view assignations. Failure to meet these permission checks will result in access being denied.\\n\\nUpon receiving a request, the `getManyRest` handler initiates a process to validate user authentication and authorization. Post validation, it employs a series of methods to apply filters, execute sorting mechanisms, and handle pagination details. The final data retrieval involves querying the database with the formulated conditions to compile a list of assignations that match the provided parameters. The result set is then formatted and delivered as a structured JSON response, providing the client with the requested data on assignations.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assignations-getRest.request.txt b/packages/leemons-openapi/lib/requests/assignations-getRest.request.txt new file mode 100644 index 0000000000..5e5addf34c --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assignations-getRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/assignations.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-assignables/backend/services/rest/assignations.rest.js\n[object Object]", + "response": "{\"summary\":\"Manage assignment operations for users\",\"description\":\"This endpoint handles various operations related to user assignments within a platform, potentially including creating, deleting, updating, or retrieving assignments depending on the implemented methods.\\n\\n**Authentication:** Users need to be authenticated to perform operations on assignments. Access is restricted based on user authentication status, and attempts to access the endpoint without proper authentication will result in access being denied.\\n\\n**Permissions:** Specific permissions related to assignment management must be granted to the user. These permissions determine the types of operations the user can perform on assignments (like create, delete, update, retrieve).\\n\\nUpon receiving a request, the endpoint first verifies user authentication and permissions. If authentication or permissions checks fail, it returns an error response. If checks are successful, it proceeds to call the specific method associated with the action (create, delete, update, retrieve) on the assignments. This involves interfacing with database services to fetch or modify assignment data accordingly. Finally, the request results are formatted and returned to the user in JSON format, reflecting the outcome of their requested operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assignments-instanceCreateRest.request.txt b/packages/leemons-openapi/lib/requests/assignments-instanceCreateRest.request.txt new file mode 100644 index 0000000000..94ef10ffc9 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assignments-instanceCreateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'instanceCreateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/assignments.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/assignments.rest.js\n[object Object]", + "response": "{\"summary\":\"Create a new assignment instance\",\"description\":\"This endpoint is responsible for creating a new assignment instance within a specific course or educational context. It handles the instantiation of assignments based on predefined templates or configurations and assigns them to the intended participants or groups.\\n\\n**Authentication:** Users need to be authenticated to create new assignment instances. Access is denied if the user's credentials are not verified.\\n\\n**Permissions:** The user must have 'create_assignment' permission within their role to execute this action. Access without sufficient permissions will result in an authorization error.\\n\\nUpon receiving a request, the `instanceCreateRest` handler first validates the provided input parameters to ensure they meet the necessary schema and logic requirements. It then interacts with the 'Assignments' module to initiate the creation process. The logic includes determining the target group or participants, applying any specific configurations (such as deadlines or unique instructions), and saving the new instance into the system's database. This process might also trigger notifications to inform participants about the new assignment. Once successfully created, the endpoint will respond with the details of the newly created assignment instance, encapsulated within a JSON object.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assignments-instanceGetRest.request.txt b/packages/leemons-openapi/lib/requests/assignments-instanceGetRest.request.txt new file mode 100644 index 0000000000..5b20dd6ff4 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assignments-instanceGetRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'instanceGetRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/assignments.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/assignments.rest.js\n[object Object]", + "response": "{\"summary\":\"Fetches specific task assignment details\",\"description\":\"This endpoint fetches details for a specific task assignment based on the provided assignment identifier. It retrieves comprehensive information including the task description, status, assigned users, and any associated deadlines or milestones.\\n\\n**Authentication:** Users must be authenticated to request the details of an assignment. Failure to provide a valid authentication token will result in denial of access to this endpoint.\\n\\n**Permissions:** Users need to have 'read' permission on the task assignments module to access this endpoint. Without the requisite permissions, the request will be denied, ensuring that only authorized personnel can view sensitive assignment details.\\n\\nUpon receiving the request, the endpoint initially verifies the authentication and permission levels of the user from the context provided. If authentication or permission checks fail, an error response is generated. If checks pass, the `getAssignmentById` method from the `Assignments` service is called with the assignment identifier to fetch the relevant details. This method interacts with the database to retrieve the full information pertaining to the requested assignment, which is then formatted and returned as a JSON object in the response. The entire processing ensures data integrity and security compliance by adhering to the defined access controls.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assignments-studentUpdateRest.request.txt b/packages/leemons-openapi/lib/requests/assignments-studentUpdateRest.request.txt new file mode 100644 index 0000000000..89ec8c59fc --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assignments-studentUpdateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'studentUpdateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/assignments.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/assignments.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/core/assignments/updateStudent.js\n[object Object]", + "response": "{\"summary\":\"Updates assignment details for a student\",\"description\":\"This endpoint allows for the updating of specific assignment details for a student, typically involving changes in assignment status or submission details tailored to aid in educational management tasks.\\n\\n**Authentication:** Users need to be authenticated to update assignment details. This ensures that only registered users can make updates to the assignments.\\n\\n**Permissions:** Required permissions include edit or update access rights on assignments, which ensures that only authorized personnel or students themselves are able to modify assignment details.\\n\\nUpon receiving a request, this handler calls the `updateStudent` method located in 'leemons-plugin-tasks/backend/core/assignments/updateStudent.js'. The method takes in parameters such as the student ID, assignment details, and perhaps any new submission files or status updates. It then processes these updates in the system's database, ensuring all changes adhere to existing educational or organizational policies. The process involves validating the input data, updating the database records, and handling any exceptions or errors that occur during the update. The final output is a successful confirmation of the update or an error message detailing any issues encountered during the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/assistance-rollCallRest.request.txt b/packages/leemons-openapi/lib/requests/assistance-rollCallRest.request.txt new file mode 100644 index 0000000000..fc3be49838 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/assistance-rollCallRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'rollCallRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/services/rest/assistance.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/services/rest/assistance.rest.js\n[object Object]", + "response": "{\"summary\":\"Manage attendance roll calls\",\"description\":\"This endpoint is designed to handle the management of attendance roll calls for classes or sessions. It facilitates the creation, modification, and viewing of roll call records for participants in educational or professional settings.\\n\\n**Authentication:** User authentication is mandatory for access. Without valid credentials, users will be prevented from performing any operations related to roll calls.\\n\\n**Permissions:** Users need specific permissions related to attendance management. Typically, this will include permissions like 'view_attendance', 'edit_attendance', and 'manage_attendance' depending on the level of access required for the operation.\\n\\nThe controller flow begins with the incoming request which is authenticated and authorized to ensure the user has the necessary rights. Following authentication, the endpoint processes the request by calling respective methods such as `createRollCall`, `editRollCall`, or `getRollCallDetails`, depending on the action specified. These methods interact with underlying data storage systems to record or retrieve the necessary attendance information. Detailed error handling is incorporated to manage situations where the request cannot be fulfilled due to invalid inputs or conditions that do not meet business rules. The final response is generated and returned to the user in JSON format, providing either the requested data or an error message detailing any issues encountered.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/bulk-loadRest.request.txt b/packages/leemons-openapi/lib/requests/bulk-loadRest.request.txt new file mode 100644 index 0000000000..09a8ec48a1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/bulk-loadRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'loadRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-bulk-data/backend/services/rest/bulk.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-bulk-data/backend/services/rest/bulk.rest.js\n[object Object]", + "response": "{\"summary\":\"Manages bulk data operations for the Leemons platform\",\"description\":\"This endpoint handles the manipulation and management of bulk data within the Leemons platform. It allows for batch processing of data operations such as imports, exports, and updates, streamlining tasks that require handling large volumes of data simultaneously.\\n\\n**Authentication:** Users need to be authenticated to perform bulk data operations. Proper authentication ensures secure access to the functionality, preventing unauthorized data manipulation.\\n\\n**Permissions:** This endpoint requires specific permissions related to bulk data management. Only users granted these permissions can execute bulk data operations to maintain data integrity and security within the platform.\\n\\nFrom the initial request, the `loadRest` handler orchestrates multiple stages of data processing. It begins by validating the user's authentication and permissions. Once validated, it engages various service methods designed to handle specific bulk data tasks, such as parsing large datasets or updating multiple records based on predefined criteria. These operations might utilize optimized database transactions to handle large-scale changes efficiently. The flow from request to response is meticulously structured to maintain performance and error handling, ensuring that the user receives clear feedback on the operation's outcome.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/bulk-statusRest.request.txt b/packages/leemons-openapi/lib/requests/bulk-statusRest.request.txt new file mode 100644 index 0000000000..e1cfa5192b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/bulk-statusRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'statusRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-bulk-data/backend/services/rest/bulk.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-bulk-data/backend/services/rest/bulk.rest.js\n[object Object]", + "response": "{\"summary\":\"Check bulk data processing status\",\"description\":\"This endpoint checks the current status of a bulk data processing task. It allows users to monitor the progress of data uploads or other asynchronous bulk operations they have initiated.\\n\\n**Authentication:** User authentication is required to track the progress of their own bulk data processing tasks. If unauthenticated, the endpoint will restrict access.\\n\\n**Permissions:** This endpoint requires users to have 'bulk_data_view' permission to check the status of bulk data processing tasks. Access without the appropriate permissions will result in a denial of service.\\n\\nUpon receiving a request, the endpoint uses the `checkStatus` method in the BulkDataService. This method queries the database to retrieve the current status and details of the requested bulk data processing task. The query filters tasks based on the user's session information to ensure that users can only access data related to their tasks. The response includes detailed information about the task's progression, such as the percentage completed, any errors encountered, and the expected time of completion. The output is formatted as a JSON object and returned to the user, providing a clear and informative status update.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-addCalendarConfigRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-addCalendarConfigRest.request.txt new file mode 100644 index 0000000000..250b89fe6b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-addCalendarConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addCalendarConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/addMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCalendars.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/addEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/updateEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/removeEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getByCenterId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCentersWithOutAssign.js\n[object Object]", + "response": "{\"summary\":\"Add a new calendar configuration\",\"description\":\"This endpoint enables the creation of a new calendar configuration within the system. It allows for setting up various properties and rules associated with specific calendars, enhancing the customization and functionality for users.\\n\\n**Authentication:** Users must be authenticated to access this endpoint. This ensures that only logged-in users can create new calendar configurations, providing a level of security and user data integrity.\\n\\n**Permissions:** The user needs to have 'calendar_create' permission to execute this action. This requirement ensures that only users with the necessary rights can make changes to the calendar configurations.\\n\\nAfter receiving the request, the `addCalendarConfigRest` handler initiates a process to validate the provided data against predefined schemas. If the data is valid, it calls the `add` method from the `calendar-configs` core module which interacts with the database to insert new configuration records. This process includes error handling to manage any issues that arise during the database operation. Upon successful creation, a confirmation response is generated and sent back to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-addConfigEventRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-addConfigEventRest.request.txt new file mode 100644 index 0000000000..66211ec016 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-addConfigEventRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addConfigEventRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/addMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCalendars.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/addEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/updateEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/removeEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getByCenterId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCentersWithOutAssign.js\n[object Object]", + "response": "{\"summary\":\"Adds a new configuration event to a calendar\",\"description\":\"This endpoint allows the creation of a new event within a specific calendar configuration. The event details such as title, time, and description are sent to the server, and a new event entry is created in the database associated with the indicated calendar.\\n\\n**Authentication:** Users need to be authenticated to add events. Any attempt to access this endpoint without a valid authentication token will result in denial of access.\\n\\n**Permissions:** Users must have the 'calendar.manage' permission to add new events to a calendar. Without this permission, the server will reject the request.\\n\\nUpon receiving a request, the `addConfigEventRest` handler in the `calendar.rest.js` file triggers the `addEvent` method in the `CalendarConfigs` core service. This method processes the input data, checking for validity and completeness, then interacts with the database to insert the new event record. Once the addition is successful, a response indicating the successful creation of the event is sent back to the client. Error handling is incorporated to manage and respond to any issues that occur during the event creation process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-addEventRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-addEventRest.request.txt new file mode 100644 index 0000000000..46d5a68414 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-addEventRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addEventRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/addFromUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/getPermissionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar/detailByKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/addToCalendar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/notifications/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/notifications/addNexts.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/grantAccessUserAgentToEvent.js\n[object Object]", + "response": "{\"summary\":\"Adds a new event to the calendar\",\"description\":\"This endpoint allows users to add a new event to the calendar system. The operation includes creating an event entry in the database and may involve notifications to other users based on the event details provided.\\n\\n**Authentication:** User authentication is required to ensure the security of the event data. Only authenticated users can add events.\\n\\n**Permissions:** Users need to have event creation privileges. Specific roles or permissions must be checked before allowing a user to create an event.\\n\\nUpon receiving a request to create an event, the `addEventRest` handler calls the `addFromUser` method in the events core module which processes the user's data along with the event information. It checks for necessary permissions and authentication status of the user. Following validation, it proceeds to add the event data into the calendar's database. If the event creation involves notifying other users, the `addToCalendar` method in the notifications core module is triggered, managing the notification logic as per the defined settings.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-detailCalendarConfigRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-detailCalendarConfigRest.request.txt new file mode 100644 index 0000000000..924188bf4d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-detailCalendarConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'detailCalendarConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/addMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCalendars.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/addEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/updateEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/removeEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getByCenterId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCentersWithOutAssign.js\n[object Object]", + "response": "{\"summary\":\"Displays detailed configuration of a specific calendar\",\"description\":\"This endpoint retrieves detailed configuration data for a specific calendar based on the provided calendar ID. The endpoint aims to provide essential configuration details that might include settings like visibility, editing permissions, event rules, and other relevant attributes that define the behavior of the calendar.\\n\\n**Authentication:** Users need to be authenticated to request calendar configuration details. Attempting to access this endpoint without a valid authentication token will result in a denial of service.\\n\\n**Permissions:** The user must have the 'view_calendar_details' permission. Without this permission, the endpoint will restrict access, ensuring that only authorized users can view detailed calendar configurations.\\n\\nUpon receiving a request, the endpoint first verifies user authentication and checks if the user has the required permissions to view calendar details. If these checks are passed, the service calls the `detail` method in the 'calendar-configs' core with the identifier of the calendar to pull detailed information. This method interacts with the database to fetch comprehensive data about the calendar's configuration. The response is then formatted into a structured JSON object containing all relevant calendar configurations, which is sent back to the client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-getCalendarConfigCalendarsRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-getCalendarConfigCalendarsRest.request.txt new file mode 100644 index 0000000000..dfaf8a31ab --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-getCalendarConfigCalendarsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getCalendarConfigCalendarsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/addMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCalendars.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/addEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/updateEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/removeEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getByCenterId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCentersWithOutAssign.js\n[object Object]", + "response": "{\"summary\":\"Fetches calendar configurations associated with a specific center\",\"description\":\"This endpoint retrieves all configurations of the calendar associated with a given center ID, primarily focusing on organizing and managing calendar events relevant to the specific center.\\n\\n**Authentication:** User authentication is required to ensure secure access to calendar configurations. Users must provide valid credentials to interact with this endpoint.\\n\\n**Permissions:** The user needs to have 'view_calendar_configurations' permission to fetch calendar settings. This ensures that only authorized personnel can access sensitive calendar data.\\n\\nThe process flow begins with the `getCalendars` method in the `calendar-configs` core. This method takes the center ID from the request parameter and accesses the database to retrieve all calendar configurations related to that center. The method handles data querying and ensures that only appropriate data is fetched based on the provided center ID. The response returns a detailed list of calendar configurations, including types of events, scheduling details, and customization options, formatted as a JSON object.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-getCalendarRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-getCalendarRest.request.txt new file mode 100644 index 0000000000..14b56ee633 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-getCalendarRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getCalendarRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar/getCalendarsToFrontend.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getByCenterId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/listByConfigId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar/getEvents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCalendars.js\n[object Object]", + "response": "{\"summary\":\"Manage calendar configurations by center\",\"description\":\"This endpoint is responsible for handling calendar configurations associated with a specific center. It allows operations such as retrieving, updating, and deleting calendar configurations based on the provided center ID.\\n\\n**Authentication:** Users need to be authenticated to interact with calendar configurations. Failure to provide a valid authentication token will result in denial of access to the endpoint.\\n\\n**Permissions:** Users must have administrative roles or specific permissions related to calendar management within the center. These permissions check ensures that only authorized personnel can manage or access calendar configurations.\\n\\nUpon receiving a request, the endpoint first verifies user authentication and permissions. If these checks are successful, the `getByCenterId` method from the `calendar-configs` core is called, receiving the center ID as its argument. This method queries the database for all calendar configurations linked to the specified center. The process involves database operations to ensure data integrity and privacy. Finally, the response is formulated based on the retrieved data, which includes detailed information about each calendar configuration, and sent back to the client in a structured JSON format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-getCentersWithOutAssignRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-getCentersWithOutAssignRest.request.txt new file mode 100644 index 0000000000..bf945c4b8b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-getCentersWithOutAssignRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getCentersWithOutAssignRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/addMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCalendars.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/addEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/updateEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/removeEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getByCenterId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCentersWithOutAssign.js\n[object Object]", + "response": "{\"summary\":\"Fetch centers without assigned calendars\",\"description\":\"This endpoint fetches all educational or organizational centers that currently do not have any calendar configurations assigned to them. The result helps administrators to identify which entities need attention for calendar setup.\\n\\n**Authentication:** Users need to be authenticated to ensure secure access to this information. Authentication is verified by checking the provided user token against active sessions or user databases.\\n\\n**Permissions:** This endpoint requires administrative permissions as it deals with broad organizational data that involves multiple centers. Users must have the 'manage_calendars' or equivalent rights to invoke this endpoint.\\n\\nAfter authentication and permission checks are validated, the endpoint proceeds by invoking the `getCentersWithOutAssign` method of the `CalendarConfigs` core service. This method performs a database query to list all centers that lack associated calendar configurations. The process involves filtering data based on specific attributes and associations in the organizational model. The outcome is then formatted and returned in a structured JSON response, listing the centers in question.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-getEventTypesRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-getEventTypesRest.request.txt new file mode 100644 index 0000000000..e3599fb484 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-getEventTypesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getEventTypesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/event-types/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/event-types/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/event-types/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/event-types/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/event-types/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/event-types/remove.js\n[object Object]", + "response": "{\"summary\":\"List all event types available in the calendar\",\"description\":\"This endpoint lists all event types that are available within the calendar system. It is responsible for retrieving a structured list of event types, which may include their unique identifiers, descriptions, and other relevant metadata.\\n\\n**Authentication:** Access to this endpoint requires the user to be authenticated. An authentication check is performed to ensure only authenticated users can retrieve the list of event types.\\n\\n**Permissions:** Users need to have the appropriate permissions to view event types. This typically involves permissions related to accessing or managing calendar events within the system.\\n\\nUpon receiving a request, the handler invokes the `listEventTypes` function from the calendar's event-types core module. This function queries the database for all existing event types and compiles them into a list. Each event type in the list includes details such as the name, description, and any relevant configuration settings. After retrieval, the data is formatted and sent back to the client as a JSON response, providing a comprehensive overview of available event types in the calendar.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-getScheduleRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-getScheduleRest.request.txt new file mode 100644 index 0000000000..b118e4f0b9 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-getScheduleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getScheduleRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar/getScheduleToFrontend.js\n[object Object]", + "response": "{\"summary\":\"Fetches a user's schedule for display on the frontend\",\"description\":\"This endpoint extracts and formats a specific user’s schedule to be suitably displayed on a frontend application. The schedule encompasses all calendar entries, including personal events and system-wide notifications that are applicable to the user.\\n\\n**Authentication:** Users must be authenticated to retrieve their schedule. Failure to provide valid authentication credentials will prevent access to this endpoint.\\n\\n**Permissions:** The user needs to have the 'view_schedule' permission to fetch their personal schedule data. Without this permission, the endpoint will restrict access and return an unauthorized error.\\n\\nThe endpoint begins by invoking the `getScheduleToFrontend` function from the `calendar` module in `leemons-plugin-calendar`'s backend. This function takes user identification (extracted from the authentication context) and consults the backend's calendar database to gather all relevant schedule entries. It processes this data to ensure that it conforms to the requirements for user-friendly display, including formatting of date and time according to user locale settings. Finally, the method returns the processed schedule data as a JSON object, which is then sent back to the client as the HTTP response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-listCalendarConfigRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-listCalendarConfigRest.request.txt new file mode 100644 index 0000000000..2f89d03a1e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-listCalendarConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listCalendarConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/addMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCalendars.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/addEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/updateEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/removeEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getByCenterId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCentersWithOutAssign.js\n[object Object]", + "response": "{\"summary\":\"List all calendar configurations\",\"description\":\"This endpoint lists all calendar configurations available within the system. It retrieves a comprehensive list of calendar setups and their related settings, formatted for easy viewing or further processing by the client application.\\n\\n**Authentication:** Users need to be authenticated to request the list of calendar configurations. Unauthorized access attempts will be rejected.\\n\\n**Permissions:** Users require specific permissions to view all calendar configurations. The required permissions depend on the organization's settings and the user's role within the application.\\n\\nUpon receiving a request, the `listCalendarConfigRest` handler first verifies the user's authentication status and permissions. This verification ensures that only authorized users can access the calendar configuration data. If authentication and permission checks are passed, the handler then calls the `list` method from the `CalendarConfigs` core service. This method gathers all available calendar configurations from the database and formats them into a structured list. The response to the client contains this list in a JSON format, making it suitable for further usage in various application scenarios.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-listKanbanColumnsRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-listKanbanColumnsRest.request.txt new file mode 100644 index 0000000000..d3f306aac5 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-listKanbanColumnsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listKanbanColumnsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/kanban-columns/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/kanban-columns/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/kanban-columns/list.js\n[object Object]", + "response": "{\"summary\":\"List all Kanban columns associated with a specific calendar\",\"description\":\"This endpoint fetches a list of all Kanban columns that are associated with a specific calendar within the leemons plugin calendar system. The endpoint serves as a utility for front-end services to render organized Kanban views based on the user's calendar data.\\n\\n**Authentication:** Users must be authenticated to request the list of Kanban columns. De-authenticated or improperly authenticated requests will be promptly denied, safeguarding the user-specific data.\\n\\n**Permissions:** Proper access rights are required to view the Kanban columns. Typically, users need permissions to access the specific calendar or project management features that relate to Kanban management.\\n\\nThe process begins when the `listKanbanColumnsRest` action is invoked, pulling the relevant calendar ID from the request parameters. It then calls the `list` method from the `kanban-columns` core module. This module queries the database for all columns linked to the specified calendar ID, ensuring that the response is tailored to the authenticated user's context and permissions. Each column is then formatted appropriately before being sent back to the client as a JSON array in the HTTP response. This ensures users receive an accurate, up-to-date representation of their calendar's Kanban layout.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-listKanbanEventOrdersRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-listKanbanEventOrdersRest.request.txt new file mode 100644 index 0000000000..5536913819 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-listKanbanEventOrdersRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listKanbanEventOrdersRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/kanban-event-orders/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/kanban-event-orders/save.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/kanban-event-orders/list.js\n[object Object]", + "response": "{\"summary\":\"Lists all Kanban event orders associated with a user\",\"description\":\"This endpoint provides a list of all Kanban event orders that are associated with the authenticated user's calendar. Events are sorted according to their order in the Kanban board, which represents their priority or sequence in the user's workflow.\\n\\n**Authentication:** Users must be logged in to access their Kanban event orders. The endpoint checks for a valid session or token before proceeding with the request.\\n\\n**Permissions:** This endpoint requires the 'view_kanban_events' permission, indicating that the user has the right to view Kanban events within their scope of accessibility.\\n\\nUpon receiving a GET request, `listKanbanEventOrdersRest` initially verifies the user's authentication status and permissions. If the checks are valid, it then calls the `list` function from 'kanban-event-orders' directory, which queries the database for all Kanban events linked to the user. This data retrieval involves sorting mechanisms based on pre-defined criteria such as event priority or scheduled dates. After successful retrieval, the Kanban event data is formatted and returned as a JSON response to the client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-removeCalendarConfigRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-removeCalendarConfigRest.request.txt new file mode 100644 index 0000000000..1ad68bd742 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-removeCalendarConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeCalendarConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/addMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCalendars.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/addEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/updateEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/removeEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getByCenterId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCentersWithOutAssign.js\n[object Object]", + "response": "{\"summary\":\"Remove a specific calendar configuration\",\"description\":\"This endpoint is responsible for deleting a calendar configuration identified by its unique ID. The operation removes the specified configuration from the system, which includes all associated scheduling and metadata, effectively rendering the calendar unusable for future activities.\\n\\n**Authentication:** Users need to be authenticated to perform this operation. A valid session or authentication token must be provided to authorize the request.\\n\\n**Permissions:** Users require specific permissions related to calendar management. Typically, this includes permissions like 'calendar.delete' or 'admin.calendar' to ensure that only authorized personnel can remove calendar configurations.\\n\\nUpon receiving the request, the `removeCalendarConfigRest` action first verifies user's authentication and permissions. It then proceeds to invoke the `remove` method from the `CalendarConfigs` core. This method is tasked with executing the deletion of the calendar configuration from the database. If the deletion is successful, the endpoint returns a confirmation message. If the specified configuration does not exist or the user lacks adequate permissions, it responds with an appropriate error message.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-removeConfigEventRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-removeConfigEventRest.request.txt new file mode 100644 index 0000000000..9b86fd6253 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-removeConfigEventRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeConfigEventRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/addMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCalendars.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/addEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/updateEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/removeEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getByCenterId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCentersWithOutAssign.js\n[object Object]", + "response": "{\"summary\":\"Remove a specific calendar configuration event\",\"description\":\"This endpoint handles the deletion of a specific event from a calendar configuration. The event to be deleted is identified by its unique event ID, which must be provided as part of the request. The operation ensures that the specified event is properly removed from the system's calendar configuration, maintaining the integrity of the remaining calendar events.\\n\\n**Authentication:** Users must be authenticated and possess a valid session token to access this endpoint. Unauthorized access attempts will be logged and denied.\\n\\n**Permissions:** The user needs to have administrative rights or specific permissions on the calendar module to perform event deletions. Lack of appropriate permissions will result in an access denial response.\\n\\nUpon receiving the request, the server invokes the `removeEvent` method from the `CalendarConfigs` core. This method takes the event ID from the request parameters and performs a query to locate the event within the database. If the event is found, it proceeds with the deletion process, which involves removing the event record and ensuring that any references to this event in other parts of the application are also updated or removed as necessary. The method concludes by returning a success message if the deletion is successful, or an error message detailing why the deletion could not be completed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-removeEventRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-removeEventRest.request.txt new file mode 100644 index 0000000000..dadab1a33f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-removeEventRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeEventRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/removeFromUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/removeOrCancel.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/getPermissionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/unGrantAccessUserAgentToEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]", + "response": "{\"summary\":\"Removes a specific event from the calendar\",\"description\":\"This endpoint removes an existing event based on the provided event ID. The operation checks if the event exists and if the user has appropriate permissions to delete the event. The deletion is either a soft delete or a hard delete based on certain conditions like event recurrence or links.\\n\\n**Authentication:** Users need to be authenticated to perform deletion of an event. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** The user requires specific permissions to delete events. Typically, this includes permissions like 'event.delete' or 'admin' rights on the calendar where the event is scheduled.\\n\\nThe process begins with the `removeOrCancel` function, which first verifies if the user has the required permissions to delete the event. It then checks if the event needs a soft delete (just marking the event as deleted) or a hard delete (completely removing all traces of the event from the database). This decision is based on factors such as whether the event is recurring or has dependencies, such as linked events or notifications. After the appropriate deletion operation, a confirmation is sent back to the user indicating the success of the deletion, or an error message is returned in case of failure.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-saveKanbanEventOrdersRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-saveKanbanEventOrdersRest.request.txt new file mode 100644 index 0000000000..899932015d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-saveKanbanEventOrdersRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveKanbanEventOrdersRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/kanban-event-orders/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/kanban-event-orders/save.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/kanban-event-orders/list.js\n[object Object]", + "response": "{\"summary\":\"Save Kanban event order configurations\",\"description\":\"This endpoint is designed to save changes to the order of kanban events as defined by the user in a calendar application. The updated order reflects how events are displayed or prioritized in the user's kanban view.\\n\\n**Authentication:** Users need to be authenticated to modify the order of kanban events. Access to this functionality is restricted based on user authentication status.\\n\\n**Permissions:** This endpoint requires the user to have the 'edit_kanban_order' permission. Without this, the user's request to reorder kanban events will be denied.\\n\\nUpon receiving a request, the `saveKanbanEventOrdersRest` method in the `calendar.rest.js` controller validates the user's authentication and permissions. If validation succeeds, it then calls the `save` method from the `kanban-event-orders` core module. This method processes the input, which typically includes an array of event IDs and the desired order. It ensures that the order changes comply with business logic, such as checking for conflicts or invalid data. Once the order is successfully updated in the database, the endpoint sends a response that indicates success to the client, along with possibly returning the updated order of events.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-updateCalendarConfigRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-updateCalendarConfigRest.request.txt new file mode 100644 index 0000000000..ac862d1cbb --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-updateCalendarConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateCalendarConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/addMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCalendars.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/addEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/updateEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/removeEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getByCenterId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCentersWithOutAssign.js\n[object Object]", + "response": "{\"summary\":\"Update an existing calendar configuration\",\"description\":\"This endpoint updates a specific calendar configuration by applying provided modifications to aspects such as name, settings, and associated events. The modifications only affect the targeted calendar configuration.\\n\\n**Authentication:** Users need to authenticate to access and modify the calendar configurations. Updates are rejected if the user's session is unauthenticated or expired.\\n\\n**Permissions:** Users must have the 'calendar.modify' permission to update calendar configurations. Unauthorized attempts will result in denial of the operation.\\n\\nThe endpoint begins with validation of the request payload against predefined schema rules, ensuring all required modifications are present and correctly formatted. It then proceeds to check user permissions and, if permitted, fetches the specified calendar configuration from the database using the 'findByConfigId' method from the calendar service. After retrieving the configuration, it applies the requested changes and updates the database record. Finally, it sends back an HTTP response to the client indicating the success of the operation, including details of the updated configuration in JSON.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-updateConfigEventRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-updateConfigEventRest.request.txt new file mode 100644 index 0000000000..e033387d0b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-updateConfigEventRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateConfigEventRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/center-calendar-configs/addMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCalendars.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/addEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/updateEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/removeEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getByCenterId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar-configs/getCentersWithOutAssign.js\n[object Object]", + "response": "{\"summary\":\"Updates a calendar event configuration\",\"description\":\"This endpoint updates specific details of an existing calendar event configuration. Events can include various parameters like time, description, participants, and other metadata which can be modified through this endpoint.\\n\\n**Authentication:** Users must be authenticated to request updates to a calendar event configuration. This ensures that only valid and authenticated users can make changes to event details.\\n\\n**Permissions:** Users need to have edit permissions for the specific calendar event. The required permission might be something like 'calendar_event_edit', which ensures that only users with the necessary rights can make updates to the events.\\n\\nUpon receiving the request at the 'updateConfigEventRest' handler, the method first verifies user authentication and checks if the user holds the required permissions to edit the event. After validation, it calls the `updateEvent` method in the calendar configuration service. This method handles the logic for updating the event details in the database, ensuring that all provided changes comply with business rules and data integrity. The response to the client indicates whether the update was successful or if any errors occurred during the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-updateEventRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-updateEventRest.request.txt new file mode 100644 index 0000000000..142e0e6864 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-updateEventRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateEventRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/updateFromUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/getEventCalendars.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/calendar/detailByKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/unGrantAccessEventUsers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/getPermissionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/unGrantAccessUserAgentToEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/grantAccessUserAgentToEvent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/addToCalendar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/notifications/removeAll.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/notifications/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/notifications/addNexts.js\n[object Object]", + "response": "{\"summary\":\"Update an existing event's details\",\"description\":\"This endpoint allows for the modification of an existing event's details based on the provided event identifier. It adjusts the properties like the event's name, duration, and any associated metadata. The update process ensures that only valid and permitted changes are applied to the event.\\n\\n**Authentication:** Users are required to be authenticated in order to perform an update operation on an event. Unauthenticated requests will be rejected.\\n\\n**Permissions:** The user must have edit permissions for the particular event they attempt to update. If the user lacks the necessary permissions, the request will be denied and an error message returned.\\n\\nThe endpoint begins by validating the user's authentication status and permissions for the event specified in the request. Upon successful authentication and authorization, it calls the `update` method located in the `Events` core module, passing necessary parameters like the event ID and the new data to be updated. This method handles the logic of verifying which pieces of event information can be updated, ensuring data integrity and adherence to any constraints set within the application's business rules. Once updates are applied, it saves the changes to the database and returns an acknowledgment response to the client that the event was successfully updated.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/calendar-updateEventSubTasksRest.request.txt b/packages/leemons-openapi/lib/requests/calendar-updateEventSubTasksRest.request.txt new file mode 100644 index 0000000000..e143f56362 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/calendar-updateEventSubTasksRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateEventSubTasksRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/updateEventSubTasksFromUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-calendar/backend/core/events/getEventCalendars.js\n[object Object]", + "response": "{\"summary\":\"Updates event sub-tasks assigned to a user\",\"description\":\"This endpoint handles the update of sub-tasks linked to specific events within the calendar for a particular user. It ensures that any changes in task status or details are correctly reflected and synchronized across user views and event management systems.\\n\\n**Authentication:** Users must be logged in to update event sub-tasks. Authentication is required to ensure that only authorized users can make changes to events they have access to.\\n\\n**Permissions:** This endpoint requires the user to have 'event_update' rights. Permissions are checked to ensure that the currently logged-in user has the appropriate rights to modify sub-tasks within the event.\\n\\nAfter receiving the request, the controller first verifies user authentication and permissions. If authentication or permissions checks fail, it returns an error response. If checks pass, it then proceeds to invoke the `updateEventSubTasksFromUser` method. This method takes in parameters related to the user's ID and event details, then interacts with the database to update relevant sub-task entries. Changes may involve altering status, descriptions, deadlines, or other sub-task properties. The method aims to ensure data integrity and consistency across the calendar application, updating entries and providing a success status back to the client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/categories-addRest.request.txt b/packages/leemons-openapi/lib/requests/categories-addRest.request.txt new file mode 100644 index 0000000000..b810b68ce6 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/categories-addRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/add/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/add/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/exists/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/exists/exists.js\n[object Object]", + "response": "{\"summary\":\"Add a new category to the library system\",\"description\":\"This endpoint is designed to facilitate the addition of new categories into the library system. It allows for the organization and classification of various resources within the library, enhancing the ease and efficiency of resource retrieval and management.\\n\\n**Authentication:** User authentication is necessary to ensure a secure interaction with the endpoint. Only authenticated users can initiate the addition of new categories.\\n\\n**Permissions:** The user must have the 'admin' role or equivalent permissions to add new categories. This ensures that only authorized personnel can make changes to the category structure.\\n\\nUpon receiving the request, the `addRest` handler first validates the provided category data against the defined schema. If validation passes, it proceeds to invoke the `add` method within the `categories` core module. This method checks for the existence of the category to avoid duplicates using the `exists` function from the same module. If the category does not exist, it is added to the database, and a confirmation is returned to the user. If the category already exists, the endpoint responds with an error message stating that the category cannot be duplicated.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/categories-assetTypesRest.request.txt b/packages/leemons-openapi/lib/requests/categories-assetTypesRest.request.txt new file mode 100644 index 0000000000..a3fff5af82 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/categories-assetTypesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'assetTypesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByCategory/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByCategory/getByCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/buildQuery.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getUserPermissionsByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/getClassesPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getAssetPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canUnassignRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getRolePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/validateRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithFiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/find.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsCategoryData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsProgramsAggregatedById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/processFinalAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/getTypesByAssets/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/getTypesByAssets/getTypesByAssets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/getByIds/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/getByIds/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/shared/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/shared/normalizeItemsArray.js\n[object Object]", + "response": "{\"summary\":\"Manage category-related asset types\",\"description\":\"This endpoint handles the retrieval and management of asset types related to specific categories within the platform. It provides functionalities such as fetching existing asset types linked to a category, updating them, and adding new asset type connections to categories.\\n\\n**Authentication:** Users must be logged in to interact with asset types related to categories. Access to this endpoint requires valid user authentication credentials.\\n\\n**Permissions:** Users need specific permissions related to asset type management. Typically, this includes permissions like 'read_asset_types', 'create_asset_types', and 'edit_asset_types' to perform respective actions within the endpoint.\\n\\nUpon receiving a request, the endpoint first verifies the user's authentication and permissions. If the validation succeeds, it proceeds to call methods from the 'Categories' and 'AssetTypes' services. Actions such as querying the database for asset types linked to specific categories, adding new asset type connections, or updating existing connections are performed based on the request parameters. Each action involves interactions with database models and may include complex business logic to handle various edge cases and ensure data integrity. The response from these actions is formatted and returned to the user, providing detailed feedback on the outcome of the request.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/categories-existsRest.request.txt b/packages/leemons-openapi/lib/requests/categories-existsRest.request.txt new file mode 100644 index 0000000000..18ced7f022 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/categories-existsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'existsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/exists/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/exists/exists.js\n[object Object]", + "response": "{\"summary\":\"Check category existence\",\"description\":\"This endpoint checks whether a specific category exists within the leemons-plugin-leebrary system. It is typically used to validate category inputs in various operations throughout the plugin's features.\\n\\n**Authentication:** The endpoint requires that users be authenticated. Failure to provide a valid authentication token will prevent access to the endpoint functionalities.\\n\\n**Permissions:** Users need specific permissions related to category management to access this endpoint. The necessary permissions ensure that only authorized users can check for the existence of categories, maintaining system integrity and security.\\n\\nThe operation begins with the `exists` action within the `categories.rest.js` service file that calls the `exists` method from the `/backend/core/categories/exists` module. This method takes a category ID from the request parameters and checks the database for the presence of this category. The logic verifies the existence of the category using the unique identifiers provided. The final outcome of this operation is a Boolean value (true or false), which indicates whether the category is present in the database. This result is then sent back to the client as a simple JSON response indicating the existence status.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/categories-listRest.request.txt b/packages/leemons-openapi/lib/requests/categories-listRest.request.txt new file mode 100644 index 0000000000..a8653699bb --- /dev/null +++ b/packages/leemons-openapi/lib/requests/categories-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/list/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/list/list.js\n[object Object]", + "response": "{\"summary\":\"Lists all categories available in the Leebrary system\",\"description\":\"This endpoint retrieves a list of all categories that have been defined within the Leebrary system. The listed categories can include various types of media or content categorizations used within the platform.\\n\\n**Authentication:** Users need to be authenticated to request the list of categories. An absence of valid authentication details will prevent access to this endpoint.\\n\\n**Permissions:** The user must have the 'view_categories' permission to access this list. Without this permission, the request will result in an authorization error.\\n\\nThe request handling begins by invoking the 'listCategories' method located in the categories service. This method queries the database to fetch all existing categories, sorting and filtering them according to any provided parameters in the request. The service layer handles all interaction with the data storage to encapsulate the business logic of category retrieval. Once fetched, these categories are returned to the client in a structured JSON format, typically involving the category names and their respective identifiers.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/categories-listWithMenuItemRest.request.txt b/packages/leemons-openapi/lib/requests/categories-listWithMenuItemRest.request.txt new file mode 100644 index 0000000000..98a6d099ed --- /dev/null +++ b/packages/leemons-openapi/lib/requests/categories-listWithMenuItemRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listWithMenuItemRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/listWithMenuItem/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/listWithMenuItem/listWithMenuItem.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/list/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/list/list.js\n[object Object]", + "response": "{\"summary\":\"Lists categories with associated menu items\",\"description\":\"This endpoint fetches all categories along with their associated menu items, tailored specifically for display in user interfaces. The data includes the category details and any menu items linked to each category, providing a comprehensive view suitable for navigation or content organization within the platform.\\n\\n**Authentication:** User authentication is required to access this endpoint. Only authenticated sessions will receive data; otherwise, a request will lead to an access denied response.\\n\\n**Permissions:** The user needs specific permissions to view categories and their related menu items. These permissions ensure users can only access data that is appropriate to their permission level.\\n\\nThe handler for this endpoint initiates by calling the `listWithMenuItem` function from the `categories` core. This function constructs a query to the database to retrieve all categories and their corresponding menu items, based on the current user’s access privileges determined through their session credentials. The method aggregates the data and formats it for optimal client-side use, then returns this formatted list as a JSON object. This complete chain from request reception to response delivery ensures that users receive data that is both accurate and specific to their allowed access.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/categories-removeRest.request.txt b/packages/leemons-openapi/lib/requests/categories-removeRest.request.txt new file mode 100644 index 0000000000..83b7f7c258 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/categories-removeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/remove/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/categories/remove/remove.js\n[object Object]", + "response": "{\"summary\":\"Remove a specified category\",\"description\":\"This endpoint handles the removal of a category from the system. Once triggered, it ensures that the specified category and any related data are deleted permanently from the database.\\n\\n**Authentication:** User must be logged in to perform this operation. Authentication ensures that the action is performed by a verified user.\\n\\n**Permissions:** This endpoint requires administrator-level permissions. The user must have the right to modify or delete categories within the system.\\n\\nThe `removeRest` action starts by validating the provided category ID against the database to ensure it exists. Upon successful validation, it invokes the `remove` method from the `categories/remove` core, which facilitates the actual deletion process. This method handles all relational deletions and integrity checks to avoid any orphan records. Detailed logs are generated through this process to monitor the steps taken and any potential errors. The final response will confirm the successful removal of the category or report any errors encountered during the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/centers-addRest.request.txt b/packages/leemons-openapi/lib/requests/centers-addRest.request.txt new file mode 100644 index 0000000000..7516b36522 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/centers-addRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/centers.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/centers.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/centers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/centers/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/centers/existName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/createNecessaryRolesForProfilesAccordingToCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/centers/setLimits.js\n[object Object]", + "response": "{\"summary\":\"Add a new center to the platform\",\"description\":\"This endpoint allows the creation of a new educational or organizational center within the platform. It involves the addition of center details into the system's database, enabling centralized management and access to specific functionalities based on the center's characteristics.\\n\\n**Authentication:** User authentication is required to ensure secure access and operation within the endpoint. An authorized login is necessary to proceed with adding new centers.\\n\\n**Permissions:** Proper authorization is mandatory, and users need specific permissions related to center management. These permissions ensure that only authorized personnel can add new centers, maintaining operational integrity and security.\\n\\nUpon receiving the request, the endpoint initially validates the provided data against predefined schemas to ensure compliance with the expected format and completeness. If validation passes, it proceeds to invoke the `add` function from the `centers` core module. This function is responsible for inserting the new center's details into the database. Throughout this process, transactional integrity is maintained to prevent partial data entry and to ensure reliable operations. Finally, upon successful addition of the center, a confirmation response is generated and returned to the user, indicating successful execution of the request.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/centers-listRest.request.txt b/packages/leemons-openapi/lib/requests/centers-listRest.request.txt new file mode 100644 index 0000000000..eea14bb408 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/centers-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/centers.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/centers.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/centers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/centers/list.js\n[object Object]", + "response": "{\"summary\":\"Lists all educational centers accessible to the user\",\"description\":\"This endpoint lists all educational centers that the current user has access to within the leemons platform, focusing on providing a comprehensive view of centers based on user roles and permissions.\\n\\n**Authentication:** Users must be authenticated to view the list of educational centers. Failure to provide valid authentication credentials will prevent access to the endpoint.\\n\\n**Permissions:** Users need specific permission to view educational centers. This permission typically depends on the user's role within the system, such as administrators or educational staff having broader access rights.\\n\\nUpon receiving a request, the endpoint initially verifies the user's authentication status and permissions. Once authentication and authorization are confirmed, it calls the `listCenters` method from the 'centers' module. This method fetches all centers from the database that the user is authorized to see, applying any relevant filters such as center type or location. The data is then formatted appropriately and returned as a JSON list, encapsulating details like center names, locations, and roles associated with each center. The flow concludes with the endpoint sending this data back to the user in a structured response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/centers-removeRest.request.txt b/packages/leemons-openapi/lib/requests/centers-removeRest.request.txt new file mode 100644 index 0000000000..71e9eea260 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/centers-removeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/centers.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/centers.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/centers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/centers/remove.js\n[object Object]", + "response": "{\"summary\":\"Removes a center from the system\",\"description\":\"This endpoint handles the deletion of a center within the system. It allows for the removal of specified center data if the prerequisites are met, ensuring data integrity and compliance with system rules.\\n\\n**Authentication:** User must be authenticated to access this endpoint. Without a valid session or authentication credentials, the request will be rejected.\\n\\n**Permissions:** The user must have admin-level permissions to remove a center. Specific rights to modify or delete center information are required to execute this operation.\\n\\nUpon receiving a request, this handler calls the `remove` method in the `/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/centers/remove.js` core file. This method checks if the center exists and verifies the user has the necessary permissions. If all conditions are met, the center is removed from the database. The process involves several checks to ensure the integrity of the operation, handling errors gracefully and reverting changes if necessary to maintain system consistency. Finally, a success response is returned, indicating that the center has been successfully removed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-classByIdsRest.request.txt b/packages/leemons-openapi/lib/requests/classes-classByIdsRest.request.txt new file mode 100644 index 0000000000..3b86c4de7b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-classByIdsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'classByIdsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]", + "response": "{\"summary\":\"Retrieve classes based on given IDs\",\"description\":\"This endpoint retrieves detailed information about academic classes specified by their unique identifiers (IDs). The main purpose is to fetch specific class details that can facilitate educational management tasks.\\n\\n**Authentication:** Users need to be logged in to access this endpoint. Authentication ensures that only authorized users can retrieve information based on their roles and permissions.\\n\\n**Permissions:** This endpoint requires the user to have specific permissions such as 'view_class_details'. Access without proper permissions will lead to a denial of the request.\\n\\nUpon receiving a request, the `classByIdsRest` handler invokes the `classByIds` method, located in the 'classByIds.js' core file. This method queries the database to obtain detailed information about each class whose ID was provided in the request. It processes the input ID array, performs the necessary database lookups, and handles potential errors such as missing IDs or inaccessible database entries. The result, a collection of class details, is then formatted appropriately and sent back to the user in the response body.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-classDetailForDashboardRest.request.txt b/packages/leemons-openapi/lib/requests/classes-classDetailForDashboardRest.request.txt new file mode 100644 index 0000000000..6c6ad24cbd --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-classDetailForDashboardRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'classDetailForDashboardRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classDetailForDashboard.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]", + "response": "{\"summary\":\"Displays detailed information about classes for the user's dashboard\",\"description\":\"This endpoint provides a comprehensive overview of a specific class, tailored for display on the user's dashboard. It includes insights and metrics relevant to the class's progress, teaching effectiveness, and student engagement.\\n\\n**Authentication:** User authentication is required to ensure secure access to the class details. Only authenticated users can view class-related data, protecting sensitive educational information.\\n\\n**Permissions:** Users need to have the 'view_class_dashboard' permission. This ensures that only users with the necessary rights can access detailed class insights, maintaining confidentiality and integrity of educational data.\\n\\nUpon receiving a request, the `classDetailForDashboardRest` method within `class.rest.js` begins by validating the provided class ID against the database. It uses this ID to fetch detailed information about the class, such as attendance rates, student performance metrics, and recent assessments. The data fetching process involves several service calls to different parts of the system, including attendance services and grade management systems. Once all data is compiled, the method formats it into a user-friendly response, which is then sent back to the client as a JSON object, offering a detailed view suitable for a dashboard presentation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-haveClassesRest.request.txt b/packages/leemons-openapi/lib/requests/classes-haveClassesRest.request.txt new file mode 100644 index 0000000000..43daec20ec --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-haveClassesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'haveClassesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/haveClasses.js\n[object Object]", + "response": "{\"summary\":\"Checks the existence of classes within the academic system\",\"description\":\"This endpoint checks if there are any classes currently existing or active within the academic portfolio of the leemons platform. This function helps in understanding whether the system is populated with academic classes.\\n\\n**Authentication:** Users need to be authenticated to query for class existence. An unauthenticated request will not be processed.\\n\\n**Permissions:** Querying the class existence requires academic-admin rights or a similarly privileged role that can access academic data.\\n\\nThe endpoint calls the `haveClasses` method from the `HaveClasses` core. This method performs a database query to check for the presence of any classes within the system's database. The query checks against multiple parameters to ascertain the activeness and existence of classes. Upon execution, it yields a boolean result indicating the presence (true) or absence (false) of classes in the academic portfolio. This result is then passed back through the API to the requester in the form of a simple JSON response indicating success or failure of the operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-listClassRest.request.txt b/packages/leemons-openapi/lib/requests/classes-listClassRest.request.txt new file mode 100644 index 0000000000..2a64cfbdbb --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-listClassRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listClassRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]", + "response": "{\"summary\":\"Lists all classes available to the user based on specific criteria\",\"description\":\"This endpoint provides a list of all academic classes that are available or relevant to the user, filtered based on specific criteria such as department, program, and academic level. The list can include classes the user is teaching, enrolled in, or has permissions to view.\\n\\n**Authentication:** User authentication is required to access the list of classes. Only authenticated users can query the class details, ensuring that sensitive educational information remains protected.\\n\\n**Permissions:** This endpoint requires the user to have teaching, enrollment, or administrative permissions related to the classes they wish to view. Access is denied if the user lacks appropriate permissions for the requested classes.\\n\\nFrom the initial HTTP request to the response, the `listClassesRest` method begins by verifying the user's authentication and permissions. It then proceeds to gather the classes by calling the `listClasses` method from the academic portfolio services. This method uses filters provided in the request to retrieve relevant class data from the database. The retrieved data is then formatted appropriately and sent back to the user in the form of a JSON structured response, providing a comprehensive list of classes tailored to the user's accessibility and criteria.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-listMultipleSubjectsClassesRest.request.txt b/packages/leemons-openapi/lib/requests/classes-listMultipleSubjectsClassesRest.request.txt new file mode 100644 index 0000000000..a5e54438fd --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-listMultipleSubjectsClassesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listMultipleSubjectsClassesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSubjectClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]", + "response": "{\"summary\":\"List multiple subject classes based on specified criteria\",\"description\":\"This endpoint provides a detailed list of subject classes based on the specified criteria. It is designed to help users efficiently retrieve information about different classes within various subjects as a consolidated response. This can include classes across different departments or faculties, filtered according to the input parameters, which are encapsulated within the request.\\n\\n**Authentication:** Users need to be authenticated to request this information. Access to the endpoint requires the user to provide valid authentication credentials, which will be verified prior to data retrieval.\\n\\n**Permissions:** Specific permissions are required to access this endpoint. Users must have the 'view_classes' permission assigned to their role. Without this permission, the endpoint will deny access to the requested information.\\n\\nUpon receiving a request, the 'listMultipleSubjectsClassesRest' handler initiates by extracting and validating the input parameters from the request. It then invokes the 'listSubjectClasses' method from the academic portfolio's backend services, passing along necessary criteria for class filtration. This method interacts with the database to retrieve data about subject classes that match the given parameters. The process encapsulates error handling to ensure that any issues during data retrieval are managed, resulting in either a successful response with the data or an error message detailing the failure. The final response to the client is formatted as a JSON array containing the details about the classes, structured according to the specified requirements of the client-side application.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-listSessionClassesRest.request.txt b/packages/leemons-openapi/lib/requests/classes-listSessionClassesRest.request.txt new file mode 100644 index 0000000000..e334ec253f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-listSessionClassesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listSessionClassesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]", + "response": "{\"summary\":\"Lists session classes associated with the user\",\"description\":\"This endpoint lists all the class sessions associated with the currently authenticated user's active academic sessions. It filters classes based on user’s session and role within the academic portfolio, thereby providing a tailored view according to the user’s academic engagement.\\n\\n**Authentication:** Users need to be authenticated to retrieve their session classes. Unauthenticated requests will not be processed.\\n\\n**Permissions:** This endpoint requires the user to have the 'view_classes' permission within their academic portfolio. Without sufficient permissions, the user will not be able to access the class list.\\n\\nThe process begins by validating the user's authentication and permissions. Once validation is complete, the endpoint invokes the `listSessionClasses` method from the `ClassesService`. This service fetches the classes from the database that are linked to the user’s current active sessions, by examining user roles and associations within each class environment. Each class fetched includes details such as class name, subject, and schedule, structured to align with the user’s academic requirements. The resulting data is then formatted into a JSON structure and returned as a HTTP response, providing a comprehensive list of relevant session classes.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-listStudentClassesRest.request.txt b/packages/leemons-openapi/lib/requests/classes-listStudentClassesRest.request.txt new file mode 100644 index 0000000000..23fa59ea11 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-listStudentClassesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listStudentClassesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listStudentClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]", + "response": "{\"summary\":\"List all classes associated with a specific student\",\"description\":\"This endpoint lists all the academic classes that a specific student is currently enrolled in or has completed. This involves fetching data that includes the class details, timings, and any other related academic information that pertains to the student's academic record.\\n\\n**Authentication:** Users need to be authenticated to access the list of classes for a student. Authentication ensures that only authorized users such as educational staff or the students themselves can access personal academic information.\\n\\n**Permissions:** Permissions required include roles such as academic staff or administrator. Specific access rights might be required to view detailed student class data to ensure confidentiality and adherence to educational standards.\\n\\nUpon request, the 'listStudentClassesRest' handler in the 'class.rest.js' starts by validating the user's authentication and permission levels. The main process involves calling the `listStudentClasses` function from the `classes` core module, which retrieves all class data associated with the student's ID provided in the request. This function queries the database for relevant class entries and compiles them into a structured format. The response is then prepared to include all pertinent details about the classes, formatted in JSON for client-side integration.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-listSubjectClassesRest.request.txt b/packages/leemons-openapi/lib/requests/classes-listSubjectClassesRest.request.txt new file mode 100644 index 0000000000..2120ad9903 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-listSubjectClassesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listSubjectClassesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSubjectClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]", + "response": "{\"summary\":\"List subject classes based on provided criteria\",\"description\":\"This endpoint lists all subject classes that match the provided criteria. It is primarily used to retrieve detailed information about classes linked to specific subjects in the academic portfolio of the educational institution.\\n\\n**Authentication:** Users must be authenticated to access this endpoint. Unauthenticated requests will be denied, ensuring that only authorized users can fetch class data.\\n\\n**Permissions:** Access to this endpoint requires `view_classes` permission. Users without this permission will not be able to retrieve any class data, safeguarding sensitive academic information.\\n\\nThe endpoint initiates by calling the `listSubjectClassesRest` method, which accesses the `listSubjectClasses` from the core classes module. This method takes search parameters specified by the user and queries the academic database to find matching class entries. The search can be based on various criteria such as subject ID, time of year, or teacher ID. Once the relevant classes are identified, they are formatted and returned as a JSON array, providing comprehensive details like class schedules, involved instructors, and subject correlation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-listTeacherClassesRest.request.txt b/packages/leemons-openapi/lib/requests/classes-listTeacherClassesRest.request.txt new file mode 100644 index 0000000000..df87d69007 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-listTeacherClassesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listTeacherClassesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listTeacherClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]", + "response": "{\"summary\":\"Lists classes associated with a specific teacher\",\"description\":\"This endpoint provides a list of all classes that a specific teacher is associated with, allowing users to view the teaching schedule, enrolled courses, and any relevant educational data tied to that teacher.\\n\\n**Authentication:** User authentication is required to access this endpoint. Access will be denied for requests without a valid authentication token or session.\\n\\n**Permissions:** The user must have the 'view_teacher_classes' permission to retrieve this information. Without appropriate permissions, the request will result in access denial.\\n\\nThe endpoint operates by first validating the authentication and permissions of the requester. Upon successful validation, it invokes the 'listTeacherClasses' method from the academic portfolio core. This method queries the database to fetch detailed class records where the teacher's ID matches the specified in the request. Each class detail includes the course title, schedule times, and participating student count. The process ensures efficient data retrieval and structuring to produce a meaningful output formatted as a JSON list, returned in the endpoint's response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-postClassInstanceRest.request.txt b/packages/leemons-openapi/lib/requests/classes-postClassInstanceRest.request.txt new file mode 100644 index 0000000000..be9c5eaf71 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-postClassInstanceRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postClassInstanceRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addInstanceClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectNeedCourseForAdd.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programCanHaveCoursesOrHaveCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/getCourseIndex.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/existCourseInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/existGroupInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/setSubjectCredits.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/setSubjectInternalId.js\n[object Object]", + "response": "{\"summary\":\"Create an instance of a class within the academic portfolio\",\"description\":\"This endpoint handles the creation of a new class instance within the academic portfolio management system. It typically involves specifying details such as the class name, associated course, and instructor details. This creation process is integral to maintaining an up-to-date academic structure in educational or institutional settings.\\n\\n**Authentication:** Users need to be authenticated to create a class instance. Only logged-in users can initiate the creation process, ensuring secure and authorized access.\\n\\n**Permissions:** Creation of a class instance requires specific permissions, generally reserved for administrative or educational personnel. These permissions ensure that only authorized users can add new classes to the academic portfolio.\\n\\nThe endpoint initiates by processing the provided input which includes necessary details about the class through the `addClassInstance` method. This method validates the input against predefined criteria to ensure compliance with the academic standards and structure. After validation, it proceeds to add the new class instance to the database, handling any constraints or relations inherent in the academic model, such as linking the class to a specific course and assigning an instructor. The response from the endpoint confirms the successful creation of the class instance with relevant details or provides error messages in case of issues during the creation process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-postClassRest.request.txt b/packages/leemons-openapi/lib/requests/classes-postClassRest.request.txt new file mode 100644 index 0000000000..422269efaa --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-postClassRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postClassRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/addKnowledgeArea.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/saveManagers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/updateClassMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/updateClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/substages/existSubstageInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/setToAllClassesWithSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/removeByClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/existCourseInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/existGroupInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/group/isUsedInSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/processScheduleForClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/listKnowledgeAreas.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/updateKnowledgeArea.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/existKnowledgeInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/existsInCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/getKnowledgeAreaById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]", + "response": "{\"summary\":\"Add new class entry to the academic portfolio\",\"description\":\"This endpoint facilitates the addition of a new class entry into the academic portfolio system, effectively allowing the system to track and organize classes as part of an educational institution's offerings.\\n\\n**Authentication:** User authentication is required to ensure that only authorized personnel can add class entries. Users must be logged in and have a valid session token to proceed.\\n\\n**Permissions:** This action requires administrative rights or specific role-based permissions associated with academic management and entry modification. Proper permission checks are enforced to prevent unauthorized modifications.\\n\\nUpon receiving a request, the endpoint invokes the `addClass` method from the academic portfolio module. This method internally validates the provided data against predefined schemas and checks for the existence of necessary attributes such as course identifiers and subject details. After validation, the entry is created in the database, and a confirmation is sent back to the requester indicating successful addition or providing error messages in case of failure. The process ensures data integrity and aligns with the institution’s academic structure and rules.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-postClassStudentsRest.request.txt b/packages/leemons-openapi/lib/requests/classes-postClassStudentsRest.request.txt new file mode 100644 index 0000000000..fcdb8e61e4 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-postClassStudentsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postClassStudentsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClassStudentsMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClassStudents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]", + "response": "{\"summary\":\"Registers multiple students to a class\",\"description\":\"This endpoint is responsible for adding a list of students to a specific class within the academic portfolio system. It typically receives a list of student identifiers and a class identifier, then processes these inputs to add each student to the class in the system database.\\n\\n**Authentication:** User authentication is required to access this endpoint. Only authenticated users with valid session tokens can initiate the process of adding students to a class.\\n\\n**Permissions:** Specific permissions such as 'manage_class_students' or 'class_edit' might be required to perform this operation. Users without appropriate permissions will be denied access to this functionality.\\n\\nThe process begins with the validation of input data to ensure that all necessary parameters like student IDs and the class ID are provided and valid. Subsequent calls are made to the `addClassStudents` method in the backend logic, which interacts with the database to register each student into the designated class. The method checks for existing records to avoid duplicates and handles possible exceptions or errors during the process. Successfully added students are then confirmed, and the endpoint returns a success response, indicating that the students have been successfully added to the class.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-postClassTeachersRest.request.txt b/packages/leemons-openapi/lib/requests/classes-postClassTeachersRest.request.txt new file mode 100644 index 0000000000..b276c30247 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-postClassTeachersRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postClassTeachersRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClassTeachersMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClassTeachers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]", + "response": "{\"summary\":\"Assign multiple teachers to a class\",\"description\":\"This endpoint is responsible for mapping multiple teachers to a specific class, ensuring that these teachers are associated with that class in the academic portfolio. This operation is crucial for managing class responsibilities and access for teachers in the educational management system.\\n\\n**Authentication:** Users need to be authenticated to access and modify the teachers' assignments for classes. An improper or missing authentication will prevent access to this endpoint.\\n\\n**Permissions:** The user needs to have administrative rights or specific role-based permissions that allow them to manage teacher assignments within classes. These permissions are necessary to ensure that only authorized personnel can make changes to the academic assignments.\\n\\nUpon receiving a request, the endpoint first validates the user's authentication and authorization levels. Post validation, it invokes methods from the `Classes` service, particularly `addMultipleTeachersToClass`, which accepts class ID and teacher IDs. This service then interacts with the underlying database to update the class records by associating them with the specified teacher IDs. The process involves checks and balances to ensure that the data integrity is maintained throughout the transaction. Finally, a successful operation will confirm the updated associations via a response, detailing the newly created links between the specified class and its teachers.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-putClassManyRest.request.txt b/packages/leemons-openapi/lib/requests/classes-putClassManyRest.request.txt new file mode 100644 index 0000000000..c31cff5bba --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-putClassManyRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putClassManyRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/updateClassMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/updateClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/substages/existSubstageInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/setToAllClassesWithSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/removeByClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/existCourseInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/existGroupInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/group/isUsedInSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/processScheduleForClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]", + "response": "{\"summary\":\"Update multiple class records\",\"description\":\"This endpoint facilitates the bulk updating of class records in the system. It is specifically designed to handle multiple updates at once, enhancing efficiency and minimizing the need for repetitive API calls for individual updates.\\n\\n**Authentication:** Users need to be authentically signed in to access this endpoint. Any attempt to access it without proper authentication will be denied.\\n\\n**Permissions:** This function requires the user to have 'edit_class_records' permission to update class details. Without this permission, the request will be rejected.\\n\\nUpon receiving the request, this endpoint initiates the `updateClassMany` service action. This action accepts an array of class objects, each containing updated information and an identifier for each class. The method iterates through each object, applying updates where the identifiers match existing records. This process involves validating the new data against existing schema rules to ensure consistency and data integrity. After successful updates, a summary of the affected records (e.g., number of classes updated) is sent back in the HTTP response. This allows clients to verify the extent of changes made.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-putClassRest.request.txt b/packages/leemons-openapi/lib/requests/classes-putClassRest.request.txt new file mode 100644 index 0000000000..c082de6d7d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-putClassRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putClassRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/updateClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHaveMultiCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/substages/existSubstageInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/setToAllClassesWithSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/removeByClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/existCourseInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/existGroupInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/group/isUsedInSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/processScheduleForClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]", + "response": "{\"description\":\"{\\n \\\"summary\\\": \\\"Update class details in the academic portfolio\\\",\\n \\\"description\\\": \\\"This endpoint allows for the updating of specific class details within the academic portfolio subsystem of the Leemonade platform. It is utilized primarily to modify class attributes such as name, schedule, and associated teacher or course data.\\n\\n**Authentication:** Users must be authenticated prior to accessing this endpoint. A valid session or authentication token is mandatory, and any unauthorized access attempt will result in an error response, ensuring security compliance.\\n\\n**Permissions:** Appropriate permissions are required to access this endpoint. Typically, the user must have administrative rights or specific academic staff privileges to modify class data. Permission checks are performed to ensure that only authorized users can perform updates.\\n\\nThe process begins with the validation of the input data to ensure that it conforms to expected formats and values. Next, the `updateClass` method in the `class.rest.js` service is invoked, which interplays with various backend logic such as `existCourseInProgram`, `existGroupInProgram`, and `isUsedInSubject` to validate the current state before applying any updates. If validation passes, the class details are updated in the database using transactional operations to ensure data integrity. A response is then generated and sent back, indicating the successful update or detailing any errors encountered during the process.\\\"\\n}\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-removeClassRest.request.txt b/packages/leemons-openapi/lib/requests/classes-removeClassRest.request.txt new file mode 100644 index 0000000000..abf06b2d13 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-removeClassRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeClassRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/removeClassesByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]", + "response": "{\"summary\":\"Removes multiple class entities by their IDs\",\"description\":\"This endpoint is designed to handle the removal of several class entities specified by their unique identifiers within the academic portfolio system. The process ensures that the specific classes are correctly identified and then deleted from the system's database.\\n\\n**Authentication:** Users must be authenticated to execute this operation. Access to this functionality will be denied if authentication credentials are invalid or absent.\\n\\n**Permissions:** This endpoint requires that the user has administrative rights or specific permissions related to academic class management. Without these permissions, the request will be rejected.\\n\\nThe endpoint initiates by interpreting the received class IDs provided in the request. It calls the `removeClassesByIds` method from the `Classes` core module. This method internally checks each ID to confirm their existence and validates the user's permission to delete each class. Once validation is complete, it proceeds to delete the classes from the system's database. The transaction ensures atomicity to make sure all specified classes are removed effectively and safely. Upon successful completion of the operation, the response confirms the successful deletion of the classes, and in the case of any error during the process, an error message is returned specifying the issue.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/classes-removeStudentRest.request.txt b/packages/leemons-openapi/lib/requests/classes-removeStudentRest.request.txt new file mode 100644 index 0000000000..75a86db21c --- /dev/null +++ b/packages/leemons-openapi/lib/requests/classes-removeStudentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeStudentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js\n[object Object]", + "response": "{\"summary\":\"Removes a student from an academic class\",\"description\":\"This endpoint is responsible for removing a specific student from a designated academic class. The targeted student is disassociated from the class records in the database, effectively updating the class's enrollment status.\\n\\n**Authentication:** User authentication is required to ensure secure access to this endpoint. An attempt to access without a valid authentication session or token will be rejected.\\n\\n**Permissions:** The user must have administrative rights or specific permission to modify class enrollments, especially in the context of managing academic portfolios.\\n\\nThe flow of processing in this handler starts by receiving the student's unique identifier and the associated class ID. The `removeStudentFromClass` method within the `ClassService` is then invoked, where database operations are performed to detach the student from the respective class. These operations include checking that the class exists and that the student is currently enrolled in it. Upon successful removal, the service updates the class enrollment records. Error handling is incorporated to address scenarios such as non-existent classes, non-enrolled students, or database access issues, ensuring that the response accurately reflects the outcome of the operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/common-addStudentsToClassesUnderNodeTreeRest.request.txt b/packages/leemons-openapi/lib/requests/common-addStudentsToClassesUnderNodeTreeRest.request.txt new file mode 100644 index 0000000000..424735bf0b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/common-addStudentsToClassesUnderNodeTreeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addStudentsToClassesUnderNodeTreeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getClassesUnderNodeTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTreeNodes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramKnowledges.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjectTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/getManagers.js\n[object Object]", + "response": "{\"summary\":\"Adds students to classes under a specified node tree\",\"description\":\"This endpoint is designed to add students to specified classes found under a node tree in the academic portfolio system. The process involves identifying the classes linked to a given node tree and updating those classes with new student enrolments.\\n\\n**Authentication:** Users need to be authenticated to perform this operation. Access to this endpoint is controlled by an authentication mechanism that verifies the user's identity and session validity before proceeding.\\n\\n**Permissions:** The user must have 'academic_admin' role or specific permission 'manage_classes_students' to execute this operation. Attempting to use this endpoint without adequate permissions will result in access being denied.\\n\\nThe operation initiated by this endpoint starts with fetching the classes associated with the specified node tree. This is typically achieved by invoking the `getClassesUnderNodeTree` method which queries the database to retrieve all relevant class entries. Subsequently, the endpoint proceeds to add students to these classes by utilizing a batch update method, ensuring all specified students are correctly registered across the identified classes. This comprehensive method handles both the verification of class existence and the validity of student IDs before finalizing the enrolment, thereby maintaining data integrity and operational coherence within the system.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/common-addTeachersToClassesUnderNodeTreeRest.request.txt b/packages/leemons-openapi/lib/requests/common-addTeachersToClassesUnderNodeTreeRest.request.txt new file mode 100644 index 0000000000..6f4de813ab --- /dev/null +++ b/packages/leemons-openapi/lib/requests/common-addTeachersToClassesUnderNodeTreeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addTeachersToClassesUnderNodeTreeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/addTeachersToClassesUnderNodeTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getClassesUnderNodeTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTreeNodes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramKnowledges.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjectTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/getManagers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClassTeachers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]", + "response": "{\"summary\":\"Assign teachers to classes within a specific node tree\",\"description\":\"This endpoint assigns teachers to all classes that are linked to a specific node tree within the organizational structure of the academic portfolio. The structure and linkage determine where the teachers are needed and which classes they should be associated with.\\n\\n**Authentication:** This endpoint requires users to be authenticated to ensure that only authorized personnel can assign teachers to classes.\\n\\n**Permissions:** Users need to have administrative or academic coordinator permissions to access this functionality. The permission checks ensure that only users with the right level of access can make changes to the academic structure.\\n\\nUpon receiving a request, the endpoint first verifies the user's authentication status and permissions. If the verification is successful, it proceeds to interact with the `addTeachersToClassesUnderNodeTree` method in the `common` core. This method fetches all classes under the specified node tree and then assigns the designated teachers to these classes. The operation involves multiple database interactions managed through the Moleculer microservices framework to handle the data efficiently and securely. Once the teachers are successfully assigned, the endpoint sends a confirmation response indicating the successful assignment of teachers to the classes.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/common-getClassesUnderNodeTreeRest.request.txt b/packages/leemons-openapi/lib/requests/common-getClassesUnderNodeTreeRest.request.txt new file mode 100644 index 0000000000..af4c55ca0e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/common-getClassesUnderNodeTreeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getClassesUnderNodeTreeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getClassesUnderNodeTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTreeNodes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramKnowledges.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjectTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/getManagers.js\n[object Object]", + "response": "{\"summary\":\"Retrieve classes under a specific node tree\",\"description\":\"This endpoint fetches all class details located under a specified node tree hierarchy within the academic system. It processes the node tree structure and lists all classes linked under the nodes encompassed by the specified root node.\\n\\n**Authentication:** User authentication is mandatory to access this endpoint. Users without a valid session or authentication token will be denied access.\\n\\n**Permissions:** Necessary permissions include access to the academic program data. Users must have roles that grant visibility or management of class information under the specified node hierarchy.\\n\\nUpon receiving a request, this endpoint initiates by calling the `getClassesUnderNodeTree` function from the `Common` core module, submitting the node ID and leveraging a recursive search to trace through the node tree hierarchy. The operation accesses interconnected nodes and aggregates classes belonging to each node. The action leverages database queries to fetch and compile lists of classes, ensuring the returning data is constructed accurately based on user permissions and authenticated session. The endpoint concludes by packaging this list into a JSON response format, providing a consolidated view of class data structured under the queried node tree.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/common-getLoggedRest.request.txt b/packages/leemons-openapi/lib/requests/common-getLoggedRest.request.txt new file mode 100644 index 0000000000..231f1b9859 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/common-getLoggedRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getLoggedRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/services/rest/common.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/services/rest/common.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/create.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/validations/locale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/has.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/read.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/delete.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/localization/global/getLocalizations/getLocalizations.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/helpers/cacheKeys.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/localization/global/getLocalizations/getLocalizationsByKeys.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/localization/global/getLocalizations/getLocalizationsByKeysStartsWith.js\n[object Object]", + "response": "{\"summary\":\"Retrieve current user's locale settings\",\"description\":\"This endpoint provides the locale settings of the currently logged-in user. These settings include language preferences, formatting conventions, and other localization data relevant to the user interface.\\n\\n**Authentication:** Users must be authenticated to access their localization settings. Any request without a valid authentication credential will be rejected.\\n\\n**Permissions:** The endpoint requires 'view_locale_settings' permission, ensuring that only users with appropriate rights can retrieve their locale information.\\n\\nThe process begins with the `getLoggedRest` method in the `common.rest.js` service file. The method first validates the existence of a session or token proving user authentication. Once authenticated, it checks for the required permissions using the Leemon's authorization services. If the checks are successful, the method interacts with the `getLocaleSettings` function from the `users` core, which extracts and compiles the user's current localization configurations from the database. This compiled data is then formatted and returned in a structured JSON format, echoing the user's locale preferences and settings.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/common-getRest.request.txt b/packages/leemons-openapi/lib/requests/common-getRest.request.txt new file mode 100644 index 0000000000..45b16f6b9a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/common-getRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/services/rest/common.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/services/rest/common.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/localization/global/getLocalizations/getLocalizations.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/helpers/cacheKeys.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/localization/global/getLocalizations/getLocalizationsByKeys.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/localization/global/getLocalizations/getLocalizationsByKeysStartsWith.js\n[object Object]", + "response": "{\"summary\":\"Provides multilingual support by managing localization data\",\"description\":\"This endpoint manages localization configurations and translations across different languages, ensuring that end-users experience a customizable interface based on their selected language preference.\\n\\n**Authentication:** User authentication is mandatory to access this endpoint. Unauthorized access is prevented, and only authenticated sessions will proceed with requests handling.\\n\\n**Permissions:** Appropriate permissions need to be granted for users to manipulate localization settings. Users must have the 'manage_localization' permission to update or fetch localization data.\\n\\nThis endpoint initiates its process by gathering key-value pairs from localization files or databases, which contain translation strings mapped to particular language keys. It uses caching mechanisms to enhance performance by reducing load times during the retrieval of these localizations. Depending on the request details, the `getLocalizations`, `getLocalizationsByKeys`, or `getLocalizationsByKeysStartsWith` functions from the 'globalization' core module are invoked. These functions are responsible for accessing detailed localization data, filtering it based on the provided keys or patterns, and ensuring the data is up-to-date before it is sent back to the client. The final output is then structured in a JSON format, containing the relevant localization data that aligns with the requested language settings.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/common-getStudentsByTagsRest.request.txt b/packages/leemons-openapi/lib/requests/common-getStudentsByTagsRest.request.txt new file mode 100644 index 0000000000..5e029d1c5f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/common-getStudentsByTagsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getStudentsByTagsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getStudentsByTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/settings/getProfiles.js\n[object Object]", + "response": "{\"summary\":\"Fetch students associated with specified tags\",\"description\":\"This endpoint fetches a list of students who are associated with a set of specified tags. It is primarily used in academic portfolio management systems to categorize and retrieve students based on specific criteria represented by tags.\\n\\n**Authentication:** Users must be authenticated to query students by tags. Unauthenticated access will result in denial of service.\\n\\n**Permissions:** This endpoint requires the user to have administrative rights or specific permissions that allow access to student data based on tags. Without the appropriate permissions, the request will be rejected.\\n\\nThe controller starts by validating the incoming request to ensure that it contains valid tags. It then calls the `getStudentsByTags` method in the `common` core, which performs a database query to retrieve all students matching the specified tags. This method utilizes complex query parameters to accurately filter the students' data according to the provided tags. Once the data is fetched, it's formatted and returned as a JSON array in the HTTP response, providing a comprehensive list of students tailored to the query parameters.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/common-getTreeRest.request.txt b/packages/leemons-openapi/lib/requests/common-getTreeRest.request.txt new file mode 100644 index 0000000000..97292c7403 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/common-getTreeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getTreeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramKnowledges.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjectTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/getManagers.js\n[object Object]", + "response": "{\"summary\":\"Generate a hierarchical tree structure for academic entities\",\"description\":\"This endpoint generates a comprehensive hierarchical tree structure representing various academic entities such as courses, programs, and subjects within the platform. This structured output is aimed at providing a clear and navigable visual representation for users, facilitating easier academic planning and management.\\n\\n**Authentication:** User authentication is mandatory to access this endpoint. Proper credentials need to be provided to ensure authorized access, and failure to authenticate will restrict the user's access to the endpoint.\\n\\n**Permissions:** Adequate permissions are required to access different levels of academic information. Depending on the user's role (e.g., student, instructor, administrator), permissions will dictate the visibility and interactability with the hierarchical structure.\\n\\nFrom the initial request to the response, this handler starts by invoking several lower-level methods to gather necessary data about programs, courses, and subjects from the database. This data is then processed to form a nested hierarchical tree structure. Each node in the tree is created by respective methods such as `getProgramCourses`, `getProgramSubjects`, which fetch and organize data based on the relationship between academic entities. The response from this handler is a well-structured JSON object that provides clients with a ready-to-use hierarchical view of all academic entities relevant to the user based on their permissions and roles.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/common-listClassSubjectsRest.request.txt b/packages/leemons-openapi/lib/requests/common-listClassSubjectsRest.request.txt new file mode 100644 index 0000000000..49df0ad563 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/common-listClassSubjectsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listClassSubjectsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/listClassesSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]", + "response": "{\"summary\":\"Lists class subjects associated with specific classes\",\"description\":\"This endpoint retrieves a list of subjects associated with specified classes. It is primarily utilized for generating detailed views of academic schedules or portfolios within the educational institution's management system.\\n\\n**Authentication:** User authentication is required for accessing this endpoint. Access is denied if the user is not authenticated or the session has expired.\\n\\n**Permissions:** Users need to have the 'view_classes' permission. Without this permission, users will not be able to retrieve information on class subjects, enforcing data access restrictions based on user roles within the institution.\\n\\nThis handler invokes the `listClassesSubjects` function from the `common` core module. The process starts by extracting class identifiers from the request parameters. These identifiers are then used to query the database through the `listClassesSubjects`, which retrieves all subjects related to the classes. The queried data includes subject names, codes, and associated teacher details. After the data is collected, it's formatted into a structured response that includes all necessary details about each subject related to the classes in question. This result is then returned to the client as a JSON array.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-changeCenterConfigRest.request.txt b/packages/leemons-openapi/lib/requests/config-changeCenterConfigRest.request.txt new file mode 100644 index 0000000000..7c8950caaa --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-changeCenterConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'changeCenterConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/updateCenter.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-changeOrganizationConfigRest.request.txt b/packages/leemons-openapi/lib/requests/config-changeOrganizationConfigRest.request.txt new file mode 100644 index 0000000000..a1033f3bc3 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-changeOrganizationConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'changeOrganizationConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/updateOrganization.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/aws/isSubdomainInUse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/aws/getRoute53.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/aws/getHostedZoneId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/aws/listAllHostedZoneRecords.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/aws/registerRecordSet.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-connectedRest.request.txt b/packages/leemons-openapi/lib/requests/config-connectedRest.request.txt new file mode 100644 index 0000000000..a0c41ded89 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-connectedRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'connectedRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/save.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/get.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-connectedUserAgentsRest.request.txt b/packages/leemons-openapi/lib/requests/config-connectedUserAgentsRest.request.txt new file mode 100644 index 0000000000..edbdae7637 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-connectedUserAgentsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'connectedUserAgentsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getUserAgentsConnected.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-createRest.request.txt b/packages/leemons-openapi/lib/requests/config-createRest.request.txt new file mode 100644 index 0000000000..d2ad5ba23d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-createRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'createRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/create.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/timeToDayjs.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/weekDays.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/getWeekdays.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/has.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/config/entitiesFormat.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/breakes/create.js\n[object Object]", + "response": "{\"summary\":\"Configure timetable settings\",\"description\":\"This endpoint is responsible for configuring and saving the timetable settings based on the provided details. It typically handles operations such as defining the time slots, setting up break times, and other related configurations for efficient timetable management within the system.\\n\\n**Authentication:** Users need to be authenticated to interact with the timetable settings. Access to this endpoint requires a valid user session or a specific authentication token to ensure security.\\n\\n**Permissions:** Users must have 'admin' or 'timetable_manager' roles to modify the timetable settings. The system checks these permissions to ensure that only authorized personnel can make changes to the configurations.\\n\\nUpon receiving a request, the handler first validates the user’s credentials and permissions. If the validation passes, it proceeds to parse the input data, ensuring all required fields are present and correctly formatted. The handler then interacts with various services such as the 'createConfig' in the 'config' module, where it manages the actual configuration logic such as creating or updating timetable settings. After successful configuration, a confirmation message or the updated settings object is sent back to the client as a response. This process involves detailed error handling to manage any exceptions or errors that might occur during the configuration process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-deleteRest.request.txt b/packages/leemons-openapi/lib/requests/config-deleteRest.request.txt new file mode 100644 index 0000000000..d466e9e5bf --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-deleteRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/delete.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/breakes/delete.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/get.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/config/entitiesFormat.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/breakes/get.js\n[object Object]", + "response": "{\"summary\":\"Delete timetable configuration data\",\"description\":\"This endpoint allows for the deletion of specific timetable configuration data. It is typically used to remove obsolete or erroneous configuration entries that are no longer required in the system.\\n\\n**Authentication:** User authentication is mandatory to ensure that only authorized personnel can delete configuration data. An invalid or missing authentication token will result in access being denied.\\n\\n**Permissions:** The user must have administrative permissions specifically for timetable configurations management. Without sufficient permissions, the request will be rejected.\\n\\nThe deletion process begins with the 'deleteRest' action which interfaces with the corresponding service method in the backend. This method performs a lookup to ensure that the configuration to be deleted exists and that the requesting user has the necessary permissions to proceed with the deletion. If these conditions are met, the configuration data is removed from the database. The flow involves error handling to manage any issues that might arise during the deletion process, such as missing data or database errors. On successful deletion, a confirmation response is sent back to the user, indicating that the data was successfully removed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-finishConfigRest.request.txt b/packages/leemons-openapi/lib/requests/config-finishConfigRest.request.txt new file mode 100644 index 0000000000..a842479017 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-finishConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'finishConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/finish.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/activateAdminConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/sendLaunchEmails.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-getAdminConfigRest.request.txt b/packages/leemons-openapi/lib/requests/config-getAdminConfigRest.request.txt new file mode 100644 index 0000000000..b46b9c720c --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-getAdminConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getAdminConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getFullByCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getGeneral.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getTenorApiKey.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-getCenterConfigRest.request.txt b/packages/leemons-openapi/lib/requests/config-getCenterConfigRest.request.txt new file mode 100644 index 0000000000..e0447c8810 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-getCenterConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getCenterConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getCenter.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-getConfigRest.request.txt b/packages/leemons-openapi/lib/requests/config-getConfigRest.request.txt new file mode 100644 index 0000000000..cbb4fcaf82 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-getConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary-aws-s3/backend/core/provider/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary-aws-s3/backend/core/provider/getConfig.js\n[object Object]", + "response": "{\"summary\":\"Fetch AWS S3 configuration settings\",\"description\":\"This endpoint retrieves the configuration settings for AWS S3 storage used by the leebrary plugin within the Leemons platform. It fetches details such as access keys, bucket names, and other essential configurations necessary for interacting with AWS S3 services.\\n\\n**Authentication:** User authentication is required to ensure that only authorized personnel access the AWS S3 configuration. A valid authentication token must be presented, or access is denied.\\n\\n**Permissions:** This endpoint requires administrative permissions. Only users with the 'admin' role or specific privileges aimed at system configuration management can access this endpoint.\\n\\nUpon receiving a request, this handler first verifies user authentication and permissions. If the validation is successful, it invokes the `getConfig` method within the 'provider' folder. This method internally uses the AWS SDK to fetch and return the current configuration settings from AWS S3. The received configuration details are then formatted appropriately and sent back to the client in a JSON response format, detailing key-value pairs of the configuration settings.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-getExternalCheckoutUrlRest.request.txt b/packages/leemons-openapi/lib/requests/config-getExternalCheckoutUrlRest.request.txt new file mode 100644 index 0000000000..e705f0150b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-getExternalCheckoutUrlRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getExternalCheckoutUrlRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/getExternalCheckoutUrl.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/fetchExternalIdentity.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-getExternalCustomerPortalUrlRest.request.txt b/packages/leemons-openapi/lib/requests/config-getExternalCustomerPortalUrlRest.request.txt new file mode 100644 index 0000000000..54a19412d3 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-getExternalCustomerPortalUrlRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getExternalCustomerPortalUrlRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/getExternalCustomerPortalUrl.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/fetchExternalIdentity.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-getExternalCustomerSubscriptionRest.request.txt b/packages/leemons-openapi/lib/requests/config-getExternalCustomerSubscriptionRest.request.txt new file mode 100644 index 0000000000..dcc9af025e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-getExternalCustomerSubscriptionRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getExternalCustomerSubscriptionRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/config/getExternalCustomerSubscription.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/fetchExternalIdentity.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-getGeneralConfigRest.request.txt b/packages/leemons-openapi/lib/requests/config-getGeneralConfigRest.request.txt new file mode 100644 index 0000000000..71ffe1dbd1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-getGeneralConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getGeneralConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getGeneral.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-getProgramConfigRest.request.txt b/packages/leemons-openapi/lib/requests/config-getProgramConfigRest.request.txt new file mode 100644 index 0000000000..3c5377a21d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-getProgramConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getProgramConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getProgram.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-getRest.request.txt b/packages/leemons-openapi/lib/requests/config-getRest.request.txt new file mode 100644 index 0000000000..6818e53468 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-getRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/get.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-getSystemDataFieldsConfigRest.request.txt b/packages/leemons-openapi/lib/requests/config-getSystemDataFieldsConfigRest.request.txt new file mode 100644 index 0000000000..1ddf17d535 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-getSystemDataFieldsConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getSystemDataFieldsConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/config/getSystemDataFieldsConfig.js\n[object Object]", + "response": "{\"summary\":\"Fetches system configuration data fields\",\"description\":\"This endpoint retrieves the configuration data fields specifically related to the system's operation and setup. It primarily serves as a utility for the system administration by providing essential configuration details necessary for system configuration and audits.\\n\\n**Authentication:** Users need to be authenticated to access this endpoint. Access without proper authentication will be denied, ensuring that only verified users can retrieve system configuration information.\\n\\n**Permissions:** Users need specific administrative permissions to retrieve these system configuration data fields. The exact permissions are defined within the system's role management framework, which restricts access to sensitive information to authorized personnel only.\\n\\nThe controller starts by executing the `getSystemDataFieldsConfig` method in the system's configuration module. This method compiles an array of configuration settings that are crucial for system setup and audits, focusing on aspects like security settings, data handling policies, and other operational parameters. The controller captures and formats these details, handing them over through a structured JSON response to the authenticated and authorized user, effectively supporting informed system management decisions.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-getTenorApiKeyRest.request.txt b/packages/leemons-openapi/lib/requests/config-getTenorApiKeyRest.request.txt new file mode 100644 index 0000000000..60873e4549 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-getTenorApiKeyRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getTenorApiKeyRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getTenorApiKey.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-hasRest.request.txt b/packages/leemons-openapi/lib/requests/config-hasRest.request.txt new file mode 100644 index 0000000000..a16e2ac5bf --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-hasRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'hasRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/has.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/config/entitiesFormat.js\n[object Object]", + "response": "{\"summary\":\"Checks configuration availability for given properties\",\"description\":\"This endpoint verifies the presence and availability of specified configuration properties in the system. It primarily aids in validation checks before application-specific configurations are altered or used.\\n\\n**Authentication:** User authentication is required to access this endpoint. Only authenticated users can initiate configuration checks to ensure secure access to configuration data.\\n\\n**Permissions:** Appropriate permissions are needed to query configuration settings. Users must possess 'config.read' permissions or similar to execute this request, ensuring that only authorized personnel can review or modify configurations.\\n\\nUpon receiving a request, this handler engages the `hasConfig` method located within the configuration management core. This method accepts a list of configuration keys and checks their existence and accessibility in the current system configuration. It processes each key individually, utilizing caching mechanisms if available to enhance performance and reduce direct fetches from the primary storage. The response generated confirms whether each queried configuration key is present, aiding clients in decision-making regarding configuration management or adjustments in the application flow.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-isSecondTimeRest.request.txt b/packages/leemons-openapi/lib/requests/config-isSecondTimeRest.request.txt new file mode 100644 index 0000000000..ebae3542f7 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-isSecondTimeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'isSecondTimeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-saveAdminConfigRest.request.txt b/packages/leemons-openapi/lib/requests/config-saveAdminConfigRest.request.txt new file mode 100644 index 0000000000..f88287346b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-saveAdminConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveAdminConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/saveFullByCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/saveTenorApiKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/saveProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/saveGeneral.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/saveCenter.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-saveConfigRest.request.txt b/packages/leemons-openapi/lib/requests/config-saveConfigRest.request.txt new file mode 100644 index 0000000000..26c3fc49a4 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-saveConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/core/config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/core/config/getConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/core/config/saveConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/core/config/getUserAgentsWithKeyValue.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/core/config/getValuesForUserAgentsAndKey.js\n[object Object]", + "response": "{\"summary\":\"Saves updated configuration settings for the email plugin\",\"description\":\"This endpoint allows for the saving of updated configuration settings specific to the email functionalities within the platform. It handles requests to update various email-related configurations which might include server details, auth tokens, and preferences among others.\\n\\n**Authentication:** The user must be authenticated to modify email configuration settings. This endpoint ensures that only authenticated requests are processed for security purposes.\\n\\n**Permissions:** Users require administrative privileges to update email configurations. The system checks for 'manage_emails_config' permission or equivalent administrative rights before proceeding with the update.\\n\\nUpon receiving a request, the `saveConfigRest` handler first validates the authentication and permissions of the user using middleware functions. If validation is successful, it proceeds to call the `saveConfig` method from the `Config` core. This method is responsible for updating the configuration records in the database with the provided new settings. Detailed validation of the input data is performed to ensure compliance with expected formats and values. After the update operation, the method responds with either a success message or an error detailing why the operation failed, encapsulating this in a standard JSON response format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-saveRest.request.txt b/packages/leemons-openapi/lib/requests/config-saveRest.request.txt new file mode 100644 index 0000000000..30d1f499a9 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-saveRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/save.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/get.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-saveSystemDataFieldsConfigRest.request.txt b/packages/leemons-openapi/lib/requests/config-saveSystemDataFieldsConfigRest.request.txt new file mode 100644 index 0000000000..8fa4c6a20e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-saveSystemDataFieldsConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveSystemDataFieldsConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/config/saveSystemDataFieldsConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/item-permissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/config/getSystemDataFieldsConfig.js\n[object Object]", + "response": "{\"summary\":\"Save system data fields configuration\",\"description\":\"This endpoint handles the update or creation of system-wide configuration data fields. These configurations control various aspects of how data fields are managed and stored across the platform.\\n\\n**Authentication:** Users must be logged in to modify system data fields configuration. Authentication ensures that only authorized users can alter these settings.\\n\\n**Permissions:** This endpoint requires administrator-level permissions. A user must have the 'admin' role to access and modify the system data fields configuration.\\n\\nThis method begins by validating the input received from the user against a predefined schema to ensure data integrity and security. Once validation is successful, the `saveSystemDataFieldsConfig` function from the backend's `config` core is called. This function takes the validated data and updates the existing system configuration if it exists, or creates a new configuration entry if it does not. The response from this operation will inform the user whether the update or creation was successful, including details of the record that was affected.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-setIsSecondTimeRest.request.txt b/packages/leemons-openapi/lib/requests/config-setIsSecondTimeRest.request.txt new file mode 100644 index 0000000000..06d9ab7e4d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-setIsSecondTimeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setIsSecondTimeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-client-manager/backend/core/helpers/checkSuperAdmin.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/config-updateRest.request.txt b/packages/leemons-openapi/lib/requests/config-updateRest.request.txt new file mode 100644 index 0000000000..edc3f26be3 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/config-updateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/config.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/config.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/config/entitiesFormat.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/timeToDayjs.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/weekDays.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/getWeekdays.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/breakes/create.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/breakes/delete.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/get.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/config/breakes/get.js\n[object Object]", + "response": "{\"summary\":\"Updates the timetable configuration settings\",\"description\":\"This endpoint allows for the updating of timetable configuration settings within the system. It is specifically designed to handle adjustments in the configuration parameters that affect how timetables are managed and displayed.\\n\\n**Authentication:** User authentication is required to access this endpoint. Without proper authentication, the request will be rejected, ensuring that only authorized users can make changes to the timetable configurations.\\n\\n**Permissions:** This endpoint requires users to have 'admin' or 'timetable_manager' roles. Users with these permissions can update configuration settings, which includes modifying details like timetable intervals, break times, and other related settings.\\n\\nUpon receiving the request, the `updateConfig` method from the `ConfigService` is called with necessary payload containing new configuration values. This method validates the payload against predefined schema to ensure data integrity and then proceeds to update the configurations in the database. If the update is successful, a confirmation response is sent back to the client. If there is an error during the process, such as validation failure or database issues, appropriate error messages are returned to ensure the client can react accordingly.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/courses-listCourseRest.request.txt b/packages/leemons-openapi/lib/requests/courses-listCourseRest.request.txt new file mode 100644 index 0000000000..0295f524f1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/courses-listCourseRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listCourseRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/course.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/course.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/listCourses.js\n[object Object]", + "response": "{\"summary\":\"List all courses available in the academic portfolio\",\"description\":\"This endpoint provides a comprehensive list of all courses available within the academic portfolio system. It retrieves details such as course identifier, title, and description that are available for enrollment or review by the user.\\n\\n**Authentication:** User authentication is required to access the list of courses. The system checks if the requesting user session is valid before proceeding with the request.\\n\\n**Permissions:** The user must have the 'view_courses' permission to access this data. Without sufficient permissions, the system denies access to the course listings.\\n\\nThe flow of the request starts when the endpoint receives a GET request. It then calls the `listCourses` method from within the 'courses' core module. This method queries the underlying database for all available courses, applying any necessary filters such as those pertaining to user permissions or specific department criteria. Once the data is fetched and formatted, it is returned as a JSON array back to the user through the response payload. Each course in the array includes essential information such as the course ID, name, and a brief description.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/courses-postCourseRest.request.txt b/packages/leemons-openapi/lib/requests/courses-postCourseRest.request.txt new file mode 100644 index 0000000000..aeb1440090 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/courses-postCourseRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postCourseRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/course.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/course.rest.js\n[object Object]", + "response": "{\"summary\":\"Create a new course in the academic portfolio\",\"description\":\"This endpoint allows for the creation of a new course within the academic portfolio system. It handles the course data submission and integrates it into the educational institution's curriculum system, ensuring the new course is registered correctly and available for student enrollment.\\n\\n**Authentication:** User authentication is mandatory to ensure security and proper access control. Only authenticated users can submit new courses to the system.\\n\\n**Permissions:** This endpoint requires the user to have 'course_creation' permission within their role. A user without sufficient permissions will be denied access to perform this operation.\\n\\nThe process begins when the endpoint receives a POST request containing the course details. The endpoint first verifies the user's authentication and authorization, ensuring they have the proper rights to create a course. Once verified, it invokes the `addCourse` method of the `CourseService`. This method takes care of validating the course data against the business rules and saves the course into the database. On successful creation, a confirmation is sent back to the user along with the details of the newly created course, such as its ID and name, in a structured JSON response. Error handling is meticulously integrated to manage any exceptions or validation failures, sending appropriate error messages to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/courses-putCourseRest.request.txt b/packages/leemons-openapi/lib/requests/courses-putCourseRest.request.txt new file mode 100644 index 0000000000..9f7921c4b5 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/courses-putCourseRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putCourseRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/course.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/course.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/updateCourse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/saveManagers.js\n[object Object]", + "response": "{\"summary\":\"Update existing course details\",\"description\":\"This endpoint updates the details of an existing course in the academic portfolio database. It allows for modifications of name, description, credits, and other course-related attributes that are essential for managing the academic offerings within the platform.\\n\\n**Authentication:** Users must be authenticated and have a valid session token to make updates to course details. Attempts to access this endpoint without authentication will result in a '401 Unauthorized' response.\\n\\n**Permissions:** This endpoint requires the user to have 'edit_course' permission. Users without this permission will receive a '403 Forbidden' error, indicating that they do not have enough rights to perform this operation.\\n\\nUpon receiving a request, the `putCourseRest` handler begins by validating the incoming data against the `courseSchema` using the `forms.js` validator. If validation fails, it responds with a '400 Bad Request' containing validation error details. If successful, it proceeds to invoke the `updateCourse` method from the `courses` core with the validated data. This method is responsible for applying the updates in the database. The final response reflects the outcome of the update operation, typically returning the updated course object or an error message if the update could not be performed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/curriculum-deleteCurriculumRest.request.txt b/packages/leemons-openapi/lib/requests/curriculum-deleteCurriculumRest.request.txt new file mode 100644 index 0000000000..51fa69fdd6 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/curriculum-deleteCurriculumRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteCurriculumRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/deleteCurriculum.js\n[object Object]", + "response": "{\"summary\":\"Delete a specified curriculum\",\"description\":\"This endpoint deletes a curriculum based on the provided curriculum ID. It is designed to handle deletion operations for curriculums in the Leemons platform, ensuring data associated with the curriculum is appropriately removed from the system.\\n\\n**Authentication:** Users need to be authenticated to perform deletion operations on curriculums. A valid authentication token must be presented to access this endpoint.\\n\\n**Permissions:** This endpoint requires the user to have administrative rights or specific deletion permissions related to curriculum management. Without the necessary permissions, the request will be denied.\\n\\nUpon receiving a delete request, the endpoint first validates the user's authentication and checks for the required permissions. If both checks are passed, it proceeds to invoke the `deleteCurriculum` method from the `curriculum` core. This method is responsible for all operations related to the removal of the curriculum from the database, including the deletion of any linked data that might disrupt the system's integrity if left behind. The operation's success or failure is then communicated back to the user through an appropriate HTTP response message, completing the curriculum deletion process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/curriculum-generateCurriculumRest.request.txt b/packages/leemons-openapi/lib/requests/curriculum-generateCurriculumRest.request.txt new file mode 100644 index 0000000000..94fb600050 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/curriculum-generateCurriculumRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'generateCurriculumRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/generateCurriculumNodesFromAcademicPortfolioByNodeLevels.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/nodeLevelsByCurriculum.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/getNodeLevelSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/curriculumByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodes/nodesTreeByCurriculum.js\n[object Object]", + "response": "{\"summary\":\"Generate curriculum structure based on academic portfolio\",\"description\":\"This endpoint allows the creation or updating of curriculum structures derived from an academic portfolio. The curriculum is built by analyzing the node levels provided in the portfolio and organizing them into a curriculum framework suitable for educational planning and tracking.\\n\\n**Authentication:** User authentication is mandatory for accessing this endpoint. Unauthenticated access attempts will be rejected.\\n\\n**Permissions:** The user must have 'curriculum_modify' permission to execute this operation. This ensures that only authorized personnel can make changes to curriculum structures.\\n\\nThe controller handler for this endpoint begins by invoking the `generateCurriculumNodesFromAcademicPortfolioByNodeLevels` function found within the curriculum core module. This function takes node levels from the user's academic portfolio as inputs and processes them to create a structured layout of curriculum nodes. Each node represents a specific academic or educational element that is part of a comprehensive curriculum. After generating these nodes, they are organized into a tree structure using the `nodesTreeByCurriculum` method, which aligns them according to their hierarchical relationships within the curriculum framework. The endpoint ultimately responds with a JSON structure representing the created or updated curriculum, detailing the arrangement of nodes and their respective levels.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/curriculum-getCurriculumRest.request.txt b/packages/leemons-openapi/lib/requests/curriculum-getCurriculumRest.request.txt new file mode 100644 index 0000000000..4812cb1d11 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/curriculum-getCurriculumRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getCurriculumRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/curriculumByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/nodeLevelsByCurriculum.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/getNodeLevelSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodes/nodesTreeByCurriculum.js\n[object Object]", + "response": "{\"summary\":\"Manage and retrieve detailed curriculum data\",\"description\":\"This endpoint facilitates the retrieval and management of detailed curriculum data including its structural components and associated levels. It primarily handles requests related to specific curriculum items or sets of curriculum data, adjusting its responses based on the provided identifiers.\\n\\n**Authentication:** Users need to be authenticated to interact with the curriculum data endpoints. Any requests without proper authentication will be denied access to the curriculum data.\\n\\n**Permissions:** The user must have appropriate permissions related to educational content management or specific rights granted for accessing or managing curriculum data.\\n\\nThe flow of this controller starts by validating the user's identity and permissions. It then proceeds to extract curriculum IDs from the request parameters and invokes the `getCurriculumByIds` method from the curriculum core service. This method retrieves data for each curriculum ID, including node levels and tree structures, by making subsequent calls to `nodeLevelsByCurriculum` and `nodesTreeByCurriculum`. The endpoint consolidates all this data to form a comprehensive view of the curriculum, which is then returned to the user in a structured JSON format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/curriculum-getDataForKeysRest.request.txt b/packages/leemons-openapi/lib/requests/curriculum-getDataForKeysRest.request.txt new file mode 100644 index 0000000000..030b573b9d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/curriculum-getDataForKeysRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getDataForKeysRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/getDataForKeys.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/getCurriculumSelectedContentValueByKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/getNodeLevelSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodes/nodesTreeByCurriculum.js\n[object Object]", + "response": "{\"summary\":\"Extracts specific curriculum data based on provided keys\",\"description\":\"This endpoint is designed to selectively retrieve detailed information from the curriculum based on a set of predefined keys. The data fetched may include details such as curriculum structure, content descriptions, learning outcomes, and any associated metadata that aids in educational planning and assessments.\\n\\n**Authentication:** User authentication is required to ensure secure access to the curriculum data. Users must provide valid credentials to interact with this endpoint.\\n\\n**Permissions:** This endpoint necessitates specific permissions tailored to access educational data. Users need to have the 'view_curriculum' permission granted to fetch curriculum-specific information effectively.\\n\\nUpon receiving a request, the `getDataForKeys` handler initiates by validating the provided keys against available data fields in the curriculum database. It employs the `getDataForKeys` method in the curriculum core to perform database queries that extract the relevant data based on these keys. This process includes error handling to manage scenarios where keys are invalid or data retrieval fails. The successful execution of this method results in compiling the requested curriculum data, which is then formatted into a JSON response and sent back to the requester, thus providing a clear and structured view of the curriculum based on specified criteria.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/curriculum-listCurriculumRest.request.txt b/packages/leemons-openapi/lib/requests/curriculum-listCurriculumRest.request.txt new file mode 100644 index 0000000000..93da4c4cf1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/curriculum-listCurriculumRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listCurriculumRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/listCurriculums.js\n[object Object]", + "response": "{\"summary\":\"List all curriculums available in the system\",\"description\":\"This endpoint lists all curriculums configured within the Leemons platform. It provides a comprehensive overview of the curriculum structures that are available for educational institutions to manage and utilize in their educational offerings.\\n\\n**Authentication:** Users must be authenticated to access the list of curriculums. Access to this endpoint requires valid user credentials, which are verified through the platform's authentication system. An invalid or missing authentication token will lead to access denial.\\n\\n**Permissions:** Appropriate permissions are required to view the list of curriculums. The user must have curriculum management roles or specific permissions that allow them to visualize curriculum configurations.\\n\\nAfter authentication, the `listCurriculums` method in the `curriculum` core is called. This method is responsible for querying the database for all curriculums and their relevant details such as titles, scopes, and applicable educational standards. The flow involves retrieving these data entries and formatting them into a structured response that the front end can display. The actual data handling includes sorting and potentially filtering curriculums based on user permissions and roles, ensuring that users receive content appropriate to their access rights. The response is then delivered in JSON format listing the curriculums.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/curriculum-postCurriculumRest.request.txt b/packages/leemons-openapi/lib/requests/curriculum-postCurriculumRest.request.txt new file mode 100644 index 0000000000..2981b440ee --- /dev/null +++ b/packages/leemons-openapi/lib/requests/curriculum-postCurriculumRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postCurriculumRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/addCurriculum.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/curriculumByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/nodeLevelsByCurriculum.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/getNodeLevelSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodes/nodesTreeByCurriculum.js\n[object Object]", + "response": "{\"summary\":\"Add a new curriculum\",\"description\":\"This endpoint is responsible for adding a new curriculum to the database. It handles the validation of input data to ensure adherence to required curriculum structures and saves the validated curriculum details in the database.\\n\\n**Authentication:** User authentication is required to access this endpoint. Without successful authentication, the endpoint will reject the request and inform the user of the need to log in.\\n\\n**Permissions:** The user must have the 'add_curriculum' permission to execute this action. Users without the appropriate permissions will receive an error indicating insufficient privileges.\\n\\nThe flow of this endpoint begins by parsing and validating the incoming data against a pre-defined schema to ensure it meets all requirements for a curriculum entity. If the data is valid, it proceeds to invoke the `addCurriculum` method in the curriculum core service with the sanitized data. This method takes care of interacting with the database to store the new curriculum details. Upon successful insertion, the endpoint returns a success message and details of the added curriculum. If any part of the process fails, appropriate error messages are generated and returned to the user, providing clarity on what went wrong.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/curriculum-publishCurriculumRest.request.txt b/packages/leemons-openapi/lib/requests/curriculum-publishCurriculumRest.request.txt new file mode 100644 index 0000000000..3b858d3fa4 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/curriculum-publishCurriculumRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'publishCurriculumRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/curriculum/publishCurriculum.js\n[object Object]", + "response": "{\"summary\":\"Publish curriculum configurations for availability\",\"description\":\"This endpoint is responsible for making curriculum configurations available for use across the platform. It involves validating and setting up the necessary details to ensure the curriculum can be accessed and utilized by the intended parties.\\n\\n**Authentication:** Users must be authenticated to perform this operation. A check is done to ensure that the request is accompanied by a valid authentication token.\\n\\n**Permissions:** The user needs to have 'curriculum_publish' permission to execute this operation. Any attempt by users lacking this permission will result in an authorization error.\\n\\nThe process begins by invoking the `publishCurriculum` method located in the `curriculum/index.js` file. The method receives parameters that define which curriculum is to be published and any specific settings associated with the publication process. It interacts with underlying databases and services to update curriculum states and propagate changes where necessary. This method ensures all configurable elements are correctly set and verifies the integrity of the data before marking the curriculum as published. Upon successful completion, the endpoint returns a response indicating the curriculum has been published.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/cycle-putCycleRest.request.txt b/packages/leemons-openapi/lib/requests/cycle-putCycleRest.request.txt new file mode 100644 index 0000000000..1b44a1878b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/cycle-putCycleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putCycleRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/cycle.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/cycle.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/cycle/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/cycle/updateCycle.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/saveManagers.js\n[object Object]", + "response": "{\"summary\":\"Update an academic cycle\",\"description\":\"This endpoint updates a specific academic cycle's details within the academic portfolio plugin of the `leemonade` platform. The endpoint facilitates the modification of cycle attributes such as start date, end date, and associated programs or courses.\\n\\n**Authentication:** Users need to be authenticated to update an academic cycle. Access to this functionality might be allowed only through secure and verified login sessions.\\n\\n**Permissions:** This functionality requires the user to have administrative rights over academic cycle management. Typically, this would include roles like Academic Administrator or System Administrator who has privileges to modify academic entities.\\n\\nUpon receiving a request, the endpoint first verifies user authentication and permissions. If valid, it then proceeds to invoke the `updateCycle` function from the `Cycle` core module. This function is responsible for checking the existence of the cycle and applying the updates if valid parameters are provided. Error handling mechanisms are employed to manage cases where the cycle does not exist or invalid data is provided. The response communicates the status of the operation along with any pertinent updated cycle information or error messages.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/dataset-getSchemaFieldLocaleRest.request.txt b/packages/leemons-openapi/lib/requests/dataset-getSchemaFieldLocaleRest.request.txt new file mode 100644 index 0000000000..ceaa3a874b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/dataset-getSchemaFieldLocaleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getSchemaFieldLocaleRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/getSchemaWithLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/datasetLocation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datesetLocation/existLocation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/getSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchemaLocale/getSchemaLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetValues/getKeysCanAction.js\n[object Object]", + "response": "{\"summary\":\"Fetches localized schema details for a specific field in a dataset.\",\"description\":\"This endpoint is responsible for retrieving the localized details of a specific schema field within a dataset. The localized details indicate variations or specifics such as localized labels or descriptions, according to different set locales which can support applications in providing multi-lingual features.\\n\\n**Authentication:** User authentication is mandatory, ensuring that only authenticated users can access the localized schema information. Absence of proper authentication will restrict access to the endpoint.\\n\\n**Permissions:** Users need to have adequate permissions related to viewing or managing dataset schemas to access this endpoint. This might include roles such as admin, editor, or specific roles granted access to the dataset management module.\\n\\nThe endpoint initiates by validating the user's authentication status and permissions. It then proceeds to call the `getSchemaFieldLocale` method from the dataset schema core services. This method accepts parameters such as `fieldId` and `locale`, and conducts a database query to fetch the corresponding localized data for the specified schema field. The result of this query is processed and returned as JSON, containing detailed localized information of the schema field, which supports front-end applications in rendering context-appropriate label or description based on user’s locale setting.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/dataset-getSchemaLocaleRest.request.txt b/packages/leemons-openapi/lib/requests/dataset-getSchemaLocaleRest.request.txt new file mode 100644 index 0000000000..36b3091e79 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/dataset-getSchemaLocaleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getSchemaLocaleRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/getSchemaWithLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/datasetLocation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datesetLocation/existLocation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/getSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchemaLocale/getSchemaLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetValues/getKeysCanAction.js\n[object Object]", + "response": "{\"summary\":\"Fetch localized schema information\",\"description\":\"This endpoint retrieves the schema definitions for datasets, localized to the currently set or specified locale. It primarily serves to provide clients such as frontend applications with the necessary configuration and definition to handle datasets correctly according to the localization settings.\\n\\n**Authentication:** Users must be authenticated to access localized schema information. Any requests without a valid session or authentication credentials will be denied access to this endpoint.\\n\\n**Permissions:** Users need specific permissions to fetch localized schema information; typically, this includes roles or rights that allow access to dataset management or administrative capabilities within the application.\\n\\nUpon receiving a request, the `getSchemaLocaleRest` handler executes a sequence of operations to fetch and return the requested schema information. It begins by validating the request parameters, ensuring the requested locale is supported. It then queries the underlying database using the `DatasetSchemaLocale` service to get the relevant localized schema data. The final response includes the schema configuration in a JSON format, tailored to the locale preferences of the requesting user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/dataset-getSchemaRest.request.txt b/packages/leemons-openapi/lib/requests/dataset-getSchemaRest.request.txt new file mode 100644 index 0000000000..f647a413b9 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/dataset-getSchemaRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getSchemaRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/getSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/datasetLocation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datesetLocation/existLocation.js\n[object Object]", + "response": "{\"summary\":\"Fetch dataset schema based on specifications\",\"description\":\"This endpoint retrieves the detailed schema for a specific dataset based on the given dataset identifier. It provides a comprehensive outline of the dataset's structure, including field types, mandatory rules, and other relevant metadata.\\n\\n**Authentication:** Access to this endpoint requires the user to be authenticated. A valid session or authentication token must be presented to ensure that the request is being made by a legitimate user.\\n\\n**Permissions:** Users must have the role or permission set that explicitly grants them access to view dataset schemas. Without these permissions, the request will be denied, ensuring data security and appropriate access control.\\n\\nAfter validating the user's authentication and permissions, the handler engages the `getSchema` function from the `datasetSchema` core module. This function is tasked with retrieving the schema details from the database using the dataset identifier provided in the request parameters. The entire operation is managed within the Moleculer service context, facilitating error handling and response formatting. The successful execution of this function results in a JSON object that describes the dataset schema, which is then relayed back to the user through the HTTP response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/dataset-removeFieldRest.request.txt b/packages/leemons-openapi/lib/requests/dataset-removeFieldRest.request.txt new file mode 100644 index 0000000000..ed6ab7c4a3 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/dataset-removeFieldRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeFieldRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/removeField.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datesetLocation/existLocation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/datasetLocation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/getSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/transformJsonOrUiSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/updateSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/datasetSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/transformPermissionKeysToObjects.js\n[object Object]", + "response": "{\"summary\":\"Removes a specified field from a dataset schema\",\"description\":\"This endpoint allows the deletion of a specific field from an existing dataset schema. The action updates the schema configuration by removing field entries and any associated validations or dependencies linked to that field in the dataset.\\n\\n**Authentication:** Users need to be authenticated to perform this operation. Any requests made without proper authentication will be rejected and the user will not be able to access the endpoint.\\n\\n**Permissions:** Users must have editing permissions on the dataset schema to execute this action. The necessary permissions are checked against the user's role and access rights before proceeding with the deletion of the field.\\n\\nThe process begins when the `removeFieldRest` action in `dataset.rest.js` receives a request specifying the field to be removed. It utilizes the `removeField` method from `datasetSchema` core module. The method performs a validation check using `exists.js` to ensure the dataset and the field exists before proceeding. Upon successful validation, it updates the schema by removing the field entry and updates any dependencies in the dataset. The updated dataset schema is saved and a success response is returned to the user, confirming that the field has been removed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/dataset-saveFieldRest.request.txt b/packages/leemons-openapi/lib/requests/dataset-saveFieldRest.request.txt new file mode 100644 index 0000000000..e8ec30db2a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/dataset-saveFieldRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveFieldRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/saveField.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datesetLocation/existLocation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/datasetLocation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/getSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/transformJsonOrUiSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/updateSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/datasetSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/transformPermissionKeysToObjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/addSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/recalculeEnumNames.js\n[object Object]", + "response": "{\"summary\":\"Save field details in a dataset schema\",\"description\":\"This endpoint is responsible for updating or adding field information to a specific dataset schema. It handles the addition or modification of data fields within an existing schema ensuring data integrity and compliance with the defined schema rules.\\n\\n**Authentication:** User authentication is required to ensure that only authorized personnel can make changes to dataset schemas. Unauthorized access is strictly monitored and prevented.\\n\\n**Permissions:** Users need the appropriate dataset management permissions. Without sufficient permissions, the operation will not be executed, and an error response will be returned.\\n\\nThe process begins when the endpoint receives a request containing new or updated field details. It first validates the user's authentication and permission levels. Once validated, the endpoint uses the `saveField` method from the `datasetSchema` core module. This method checks the validity of the provided field data against the existing schema definitions. If the data is valid, it proceeds to either add a new field or update an existing one in the database. The operation's success or failure, along with relevant messages, are then encapsulated in the response sent back to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/dataset-saveMultipleFieldsRest.request.txt b/packages/leemons-openapi/lib/requests/dataset-saveMultipleFieldsRest.request.txt new file mode 100644 index 0000000000..a84d9d7f95 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/dataset-saveMultipleFieldsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveMultipleFieldsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/saveMultipleFields.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/saveField.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datesetLocation/existLocation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/datasetLocation.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/getSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/transformJsonOrUiSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/updateSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/validations/datasetSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/transformPermissionKeysToObjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/addSchema.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-dataset/backend/core/datasetSchema/recalculeEnumNames.js\n[object Object]", + "response": "{\"summary\":\"Saves multiple fields in a dataset schema\",\"description\":\"This endpoint is responsible for the creation or update of multiple fields within a specific dataset schema in the system. It handles complex operations where multiple field definitions need to be saved simultaneously, ensuring data integrity and compliance with the dataset's structure.\\n\\n**Authentication:** The user needs to be authenticated to perform this operation. The system will validate the user's credentials and session to authorize the request.\\n\\n**Permissions:** Users must have 'edit' permissions on the dataset schema to add or update fields. Permissions are checked against the user's role and privileges prior to processing the request.\\n\\nUpon receiving the request, the handler initially validates the provided field data against the existing dataset schema format. It then interacts with the `saveMultipleFields` method in the backend dataset schema core, which is designed to handle updates or additions of multiple fields efficiently. This method processes each field individually, applying validation rules, handling data conversion, and ensuring that no conflicts occur with existing field definitions. After successful execution, the system updates the dataset schema in the data store, reflecting the changes made. A response is then generated to indicate the success of the operation, or failure details in case of an error.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/dependency-deleteDependencyRest.request.txt b/packages/leemons-openapi/lib/requests/dependency-deleteDependencyRest.request.txt new file mode 100644 index 0000000000..a23a26fb3d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/dependency-deleteDependencyRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteDependencyRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/removeRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/removeConditionGroupsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/removeConditionsByRule.js\n[object Object]", + "response": "{\"summary\":\"Removes specified dependencies and their related components\",\"description\":\"This endpoint facilitates the removal of dependencies along with their associated elements such as condition groups and conditions associated with any grading rule. Upon successful deletion, it ensures the integrity and cleanliness of the data by cascading the deletion process to related items.\\n\\n**Authentication:** Users need to be authenticated to perform this operation. Unauthorized access will be prevented, ensuring that only authenticated requests proceed to perform deletions.\\n\\n**Permissions:** Appropriate permissions are required to access this endpoint. The user must have administrative rights or specific permissions set to manipulate grade-related configurations to use this endpoint.\\n\\nThe process begins by the controller handling the request to delete a specific dependency. It calls the `removeDependency` method, which first checks for the existence of the dependency. It then proceeds to invoke additional methods like `removeConditionGroupsByRule` and `removeConditionsByRule` from respective modules to ensure all associated data is comprehensively removed. This methodical deletion prevents any orphaned entries and maintains the consistency of the database integrity. The final response confirms the successful deletion of all entities related to the dependency.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/dependency-listDependenciesRest.request.txt b/packages/leemons-openapi/lib/requests/dependency-listDependenciesRest.request.txt new file mode 100644 index 0000000000..ec2142f2df --- /dev/null +++ b/packages/leemons-openapi/lib/requests/dependency-listDependenciesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listDependenciesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/listRules.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/ruleByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/getRuleConditionsByRuleIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/getConditionsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/getConditionGroupsByRule.js\n[object Object]", + "response": "{\"summary\":\"List all grade-related dependencies\",\"description\":\"This endpoint lists all the dependencies associated with the grading system in the platform. It serves to provide a comprehensive overview of elements that impact or contribute to the construction of grades.\\n\\n**Authentication:** Users need to be authenticated to access the dependencies of the grading system. The request will be denied if the authentication credentials are not provided or are invalid.\\n\\n**Permissions:** Users must have the 'manage_grades' permission to view all the grading dependencies. Without sufficient permissions, access to this information will be restricted.\\n\\nUpon receiving a request, this endpoint calls the `listDependencies` method from the `GradesService`. This method performs a query to retrieve all dependency records related to the grades system from the database. The results are then compiled into a structured list that shows how different grading systems, conditions, and rules are interconnected. Finally, the endpoint returns this list in a structured JSON format, providing clients with clear insights into the dependencies shaping the grading processes.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/dependency-postDependencyRest.request.txt b/packages/leemons-openapi/lib/requests/dependency-postDependencyRest.request.txt new file mode 100644 index 0000000000..8cbb2f424f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/dependency-postDependencyRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postDependencyRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/addRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/addConditionGroup.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/addCondition.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/ruleByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/getRuleConditionsByRuleIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/getConditionsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/getConditionGroupsByRule.js\n[object Object]", + "response": "{\"summary\":\"Manage grade dependencies within a course structure\",\"description\":\"This endpoint is responsible for setting and managing the dependencies between different grades within the course structure. It ensures that certain prerequisites are set and met before a student can progress to subsequent modules or components.\\n\\n**Authentication:** User authentication is mandatory to ensure that only authorized personnel can modify grade dependencies. Access without proper authentication will prevent usage of this endpoint.\\n\\n**Permissions:** This endpoint requires the user to have administrative privileges related to grade management. Users must hold the appropriate permissions to alter grade dependencies within the course structure.\\n\\nUpon receiving a request, the `postDependencyRest` handler in the `dependency.rest.js` file first verifies user authentication and permissions, ensuring the user is authorized to perform actions related to grade dependencies. It then proceeds to parse the incoming request to extract and validate the necessary data regarding grade dependencies. This involves calling various methods and possibly interacting with other services to verify conditions and prerequisites are met. Finally, the validated data is processed to update or establish new dependencies in the data system, culminating in the response back to the user indicating the success or failure of the operations performed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/dependency-putDependencyRest.request.txt b/packages/leemons-openapi/lib/requests/dependency-putDependencyRest.request.txt new file mode 100644 index 0000000000..b87826093a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/dependency-putDependencyRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putDependencyRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/updateRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/removeConditionGroupsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/removeConditionsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/addConditionGroup.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/addCondition.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/ruleByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/getRuleConditionsByRuleIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/getConditionsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/getConditionGroupsByRule.js\n[object Object]", + "response": "{\"summary\":\"Update dependency relationships for a specific grading rule\",\"description\":\"This endpoint facilitates the updating of dependency relationships between different grading rules within the system. It is primarily used to adjust how various grading conditions impact one another, thereby modifying their execution sequence based on new or existing dependencies.\\n\\n**Authentication:** User authentication is mandatory for accessing this endpoint. Without proper authentication credentials, the request will be denied.\\n\\n**Permissions:** The user must possess adequate permissions related to grade management or rule adjustments. Specific permission checks are applied to ensure only authorized users can modify dependency rules.\\n\\nThe `putDependencyRest` handler commences by verifying user authentication and permissions. Subsequently, it fetches and analyzes the input data which comprises identifiers of grading rules and their new dependencies. This operation involves retrieving existing rules from the database, removing old dependencies, and establishing the new specified dependencies, facilitated by corresponding methods in the backend logic. The process encompasses validations to prevent circular dependencies and to ensure data integrity. Upon successful update, the system confirms modifications and provides a response indicating the successful restructuring of the grading rules' dependencies.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/deployment-manager-addManualDeploymentRest.request.txt b/packages/leemons-openapi/lib/requests/deployment-manager-addManualDeploymentRest.request.txt new file mode 100644 index 0000000000..f616771775 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/deployment-manager-addManualDeploymentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addManualDeploymentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/core/deployments/addDeployment.js\n[object Object]", + "response": "{\"summary\":\"Initiate a new manual deployment process\",\"description\":\"This endpoint facilitates the initiation of a new manual deployment in the leemons platform. It primarily serves as the starting point for deploying new configurations or services manually by the user.\\n\\n**Authentication:** Users must be authenticated to initiate a deployment process. Unauthorized access will be blocked and the system will only process requests from valid, logged-in users.\\n\\n**Permissions:** The user must have specific roles or permissions, typically like 'deployment-manager' or 'admin', allowing them to perform deployment-related actions within the system.\\n\\nThe process starts with the endpoint receiving a deployment configuration request. This request triggers the `addDeployment` method in the deployment manager's core logic. The method involves validating the provided deployment data against predefined schemas and ensuring all necessary components for the deployment are accounted for and correctly configured. Following the validation, the deployment data is saved to the system's database. Successful execution results in a response indicating the deployment has been initiated, along with details of the deployment record.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/deployment-manager-changeDeploymentConfigRest.request.txt b/packages/leemons-openapi/lib/requests/deployment-manager-changeDeploymentConfigRest.request.txt new file mode 100644 index 0000000000..b40e9fa895 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/deployment-manager-changeDeploymentConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'changeDeploymentConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/core/deployments/updateDeploymentConfig.js\n[object Object]", + "response": "{\"summary\":\"Updates deployment configuration for a specific project\",\"description\":\"This endpoint updates the deployment configuration for a given project within the system. It allows for modifications of settings and parameters that determine how deployments are handled for that project.\\n\\n**Authentication:** Users must be authenticated to modify deployment configurations. Authentication ensures that requests are made by legitimate users of the application.\\n\\n**Permissions:** Users need specific permissions related to deployment management. Typically, this includes administrative rights or specific role-based permissions that allow a user to modify deployment settings.\\n\\nThe endpoint processes the incoming request by first validating the user's credentials and permissions. If authentication or permission checks fail, the request is denied. Upon successful validation, the endpoint invokes the `updateDeploymentConfig` method from the `deployments` core. This method is responsible for updating the deployment configuration based on the provided parameters in the request body. It handles various checks and balances to ensure that the new configuration does not conflict with existing deployment rules and standards. Once updated, the function confirms the changes and responds back with a status indicating the successful update of the deployment configuration.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/deployment-manager-deploymentInfoRest.request.txt b/packages/leemons-openapi/lib/requests/deployment-manager-deploymentInfoRest.request.txt new file mode 100644 index 0000000000..6bcab818bb --- /dev/null +++ b/packages/leemons-openapi/lib/requests/deployment-manager-deploymentInfoRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deploymentInfoRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/core/deployments/getDeploymentInfo.js\n[object Object]", + "response": "{\"summary\":\"Fetches detailed information about a specific deployment\",\"description\":\"This endpoint retrieves detailed information about a deployment specified by the user. The information includes all relevant details such as configuration, version, status, etc., focusing on providing a comprehensive view of the deployment's current state.\\n\\n**Authentication:** This endpoint requires users to be authenticated. Users attempting to access deployment details without a valid authentication token will be denied.\\n\\n**Permissions:** Users need to have the 'view_deployment' permission to access this endpoint. This ensures that only authorized personnel can view sensitive deployment information.\\n\\nThe handler initiates by calling the `getDeploymentInfo` method from the deployment manager's core module. This method takes a deployment identifier from the request parameters and performs a query against the deployment database to retrieve all corresponding details. The process involves checking the user's permissions and the validity of the provided deployment ID. Once the data is fetched and verified, it culminates in the formation of a JSON object that includes the complete set of deployment details, which is then returned to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/deployment-manager-existDeploymentWithDomainRest.request.txt b/packages/leemons-openapi/lib/requests/deployment-manager-existDeploymentWithDomainRest.request.txt new file mode 100644 index 0000000000..7656e08e16 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/deployment-manager-existDeploymentWithDomainRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'existDeploymentWithDomainRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/core/deployments/isDomainInUse.js\n[object Object]", + "response": "{\"summary\":\"Checks if a deployment domain is already in use\",\"description\":\"This endpoint checks whether a specified domain is already in use for another deployment within the system. The purpose is to ensure that no two deployments share the same domain, thereby avoiding conflicts and maintaining domain uniqueness across the platform.\\n\\n**Authentication:** Users must be authenticated to perform this domain check. Any access attempt without proper authentication will be denied, ensuring that the endpoint's operation is secure.\\n\\n**Permissions:** Users need to have the 'deployments.manage' permission to check domain usage. This requirement helps ensure that only authorized personnel can perform actions that could potentially affect deployment configurations.\\n\\nUpon receiving a request, this endpoint invokes the `isDomainInUse` function from the `Deployments` core. This function receives the domain name as a parameter and checks against existing deployment records in the database to determine if the domain is already assigned. If the domain is in use, the function returns a boolean `true`, otherwise, it returns `false`. This result is then sent back to the client in a simple JSON format indicating the domain usage status. This streamlined check helps maintain operational integrity by preventing domain conflicts in subsequent deployment processes.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/deployment-manager-getConfigRest.request.txt b/packages/leemons-openapi/lib/requests/deployment-manager-getConfigRest.request.txt new file mode 100644 index 0000000000..af73d3b6dc --- /dev/null +++ b/packages/leemons-openapi/lib/requests/deployment-manager-getConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/core/deployments/getDeploymentConfig.js\n[object Object]", + "response": "{\"summary\":\"Fetch deployment configuration details\",\"description\":\"This endpoint retrieves the configuration details associated with a specific deployment. This encompasses fetching relevant configuration items such as environment settings, deployment scripts, and associated metadata that define how a deployment should be conducted within the system.\\n\\n**Authentication:** Users are required to be authenticated to ensure secure access to deployment configuration details. Authentication mechanisms must validate the user’s identity before allowing access to this endpoint.\\n\\n**Permissions:** Appropriate permissions must be verified before a user can retrieve deployment configuration details. Typically, users need to have 'deployment-manager' or 'administrator' roles to access this configuration information.\\n\\nBehind the scenes, this endpoint invokes the `getDeploymentConfig` action within the deployment-manager service. It initiates a process to load and return detailed configuration parameters specific to a given deployment. This involves parsing configuration files or accessing a database where these details are stored, ensuring that all returned data respects current operational and security policies. The final response includes a structured JSON object that encapsulates all necessary deployment settings.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/deployment-manager-getDeploymentTypeRest.request.txt b/packages/leemons-openapi/lib/requests/deployment-manager-getDeploymentTypeRest.request.txt new file mode 100644 index 0000000000..920b0e9ca6 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/deployment-manager-getDeploymentTypeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getDeploymentTypeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js\n[object Object]", + "response": "{\"summary\":\"Manage deployment type details\",\"description\":\"This endpoint is responsible for handling the management of deployment type details within the deployment manager. It allows operations such as fetching, updating, or deleting deployment type information depending on the provided method and parameters.\\n\\n**Authentication:** User authentication is required to access this endpoint. Requests without valid authentication will be denied, ensuring that only authorized users can manage deployment types.\\n\\n**Permissions:** Users need to have specific permissions related to deployment management. Without the necessary permissions, the request will not be processed, and an access denial message will be returned.\\n\\nThe handler begins by determining the method of the request (GET, POST, PATCH, DELETE) to appropriately handle the operation regarding deployment types. It then calls a specific internal service method based on the request method, such as `findDeploymentType`, `updateDeploymentType`, or `deleteDeploymentType`. These service methods interact with the database to perform the required operation and return the result to the handler. The final response to the client includes the outcome of the operation, which could be the details of a deployment type, confirmation of an update, or a status of deletion, formatted as a JSON response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/deployment-manager-infoRest.request.txt b/packages/leemons-openapi/lib/requests/deployment-manager-infoRest.request.txt new file mode 100644 index 0000000000..fa267e4af5 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/deployment-manager-infoRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'infoRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js\n[object Object]", + "response": "{\"summary\":\"Provide detailed deployment information\",\"description\":\"This endpoint fetches and provides detailed information regarding deployment processes managed by the Deployment Manager. This information helps users track the deployment state, access configuration details, and understand the overall progress and status of their deployment tasks.\\n\\n**Authentication:** User authentication is required to access deployment details. Access is denied if authentication credentials are invalid or absent.\\n\\n**Permissions:** To access this endpoint, users need specific permissions related to viewing deployment statuses. The exact permissions required are defined in the deployment manager's security configurations.\\n\\nInitially, the endpoint triggers the `fetchDeploymentDetails` method, which involves querying the database for detailed records pertaining to ongoing or completed deployments. This method processes the query result to format and structure the data accurately, ensuring it includes all necessary information about each deployment phase. This formatted data is then returned to the user via a well-defined JSON response structure, enabling the client's application to display or utilize the detailed deployment information effectively.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/deployment-manager-reloadAllDeploymentsRest.request.txt b/packages/leemons-openapi/lib/requests/deployment-manager-reloadAllDeploymentsRest.request.txt new file mode 100644 index 0000000000..6a28e813b6 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/deployment-manager-reloadAllDeploymentsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'reloadAllDeploymentsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/core/auto-init/reload-all-deployments.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-deployment-manager/backend/core/auto-init/getAllPluginsAndRelations.js\n[object Object]", + "response": "{\"summary\":\"Reload all deployment configurations\",\"description\":\"This endpoint reloads all the deployment configurations from the storage, ensuring that any updates or changes in the deployment settings are immediately reflected across the system. This is crucial for maintaining consistency and up-to-date operation parameters in dynamic environments.\\n\\n**Authentication:** Access to this endpoint requires the user to be authenticated. Without valid authentication, the system will deny access to this service.\\n\\n**Permissions:** Users must have administrative permissions specifically for deployment management. Access without sufficient permissions will result in a denial of service error.\\n\\nThe handler initiates by fetching all deployment configurations using the `getAllDeployments` method. This method interacts with the underlying database or file system to retrieve updated configurations. Upon successful retrieval, the system iterates through each deployment configuration to apply necessary updates or reinitializations as needed. This comprehensive refresh ensures that any subsystem or service relying on these configurations is synchronized with the latest deployment settings. The response concludes with a confirmation message indicating successful reload or an error message detailing any issues encountered during the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/document-assignDocumentRest.request.txt b/packages/leemons-openapi/lib/requests/document-assignDocumentRest.request.txt new file mode 100644 index 0000000000..9e5bffa2e7 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/document-assignDocumentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'assignDocumentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/assignDocument.js\n[object Object]", + "response": "{\"summary\":\"Assign document to a user or group\",\"description\":\"This endpoint is responsible for assigning a specific document to either a user or a group. The operation involves validating the document's availability and checking if the specified recipient is eligible to receive the document. The assignment is recorded in the system for tracking and management purposes.\\n\\n**Authentication:** User authentication is required to ensure that only authorized users can assign documents. An unauthenticated request will be rejected, prompting for valid user credentials.\\n\\n**Permissions:** The user must have 'document-assign' permission to perform this operation. Without the necessary permissions, the operation will not be executed, and an access denied message will be returned.\\n\\nThe flow starts with the validation of the provided document ID and recipient details through the `assignDocument` core method. If validation succeeds, the document's status is updated to reflect the new assignment, and pertinent details are recorded in the database. The recipient, whether a user or a group, is then notified of the document assignment. This entire process ensures a comprehensive approach to document management and access control within the system.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/document-deleteDocumentRest.request.txt b/packages/leemons-openapi/lib/requests/document-deleteDocumentRest.request.txt new file mode 100644 index 0000000000..d99c814cb4 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/document-deleteDocumentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteDocumentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/deleteDocument.js\n[object Object]", + "response": "{\"summary\":\"Delete a specified document\",\"description\":\"This endpoint is responsible for deleting a specific document identified by its unique ID. The operation entails removing the document from the database and ensuring that all associated data such as references or shared links are also appropriately handled.\\n\\n**Authentication:** Users need to be authenticated to execute this deletion. The process checks for a valid user session and compares the user's identity against the ownership or permission attributes of the document to be deleted.\\n\\n**Permissions:** The user must have administrative or specific rights over the document to execute a deletion. Permissions checks are implemented to ensure that only authorized users can delete documents.\\n\\nThe flow initiates when the `deleteDocument` action is called in the `document.rest.js` service file. This service then interacts with the `deleteDocument` core method defined in `deleteDocument.js`. The core method handles the logic for checking permissions, verifying document existence, and executing the delete operation in the database. Detailed error handling is implemented to manage cases like non-existent documents or insufficient permissions, ensuring the client receives clear and explanatory feedback. The method concludes by sending a response back to the client confirming the deletion or reporting any issues that occurred during the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/document-duplicateDocumentRest.request.txt b/packages/leemons-openapi/lib/requests/document-duplicateDocumentRest.request.txt new file mode 100644 index 0000000000..e579ad5876 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/document-duplicateDocumentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'duplicateDocumentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/duplicateDocument.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/getDocument.js\n[object Object]", + "response": "{\"summary\":\"Duplicates a specific document within the content system\",\"description\":\"This endpoint is responsible for creating a duplicate copy of a specified document. The process involves copying the document’s data and metadata, ensuring that the new document retains the essential characteristics of the original while being a distinct entity in the system.\\n\\n**Authentication:** User authentication is required to access this endpoint. Users must provide valid session credentials to ensure they are allowed to duplicate documents.\\n\\n**Permissions:** The user must have the 'duplicate_document' permission assigned to their role. Without this permission, the request to duplicate a document will be denied.\\n\\nThe duplication process begins by invoking the `duplicateDocument` function located in the backend core document logic. This function receives a document ID from the request's parameters and accesses the original document from the database. After retrieving the document, it performs a deep copy, including all related data such as attached files and metadata. The new copy is then saved under a new document ID with a reference to its origin. The final response from this endpoint provides the client with the ID of the newly duplicated document, confirming the successful completion of the operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/document-getDocumentRest.request.txt b/packages/leemons-openapi/lib/requests/document-getDocumentRest.request.txt new file mode 100644 index 0000000000..dcf66a247c --- /dev/null +++ b/packages/leemons-openapi/lib/requests/document-getDocumentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getDocumentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/getDocument.js\n[object Object]", + "response": "{\"summary\":\"Fetches document details based on provided parameters\",\"description\":\"This endpoint is responsible for retrieving detailed information about a specific document. It handles the request by identifying a document using given parameters and returns comprehensive details about the document to the requesting user.\\n\\n**Authentication:** Users need to be authenticated to request the document details. If authentication information is missing or incorrect, the endpoint will deny access.\\n\\n**Permissions:** This endpoint requires users to have specific roles or permissions set to access the document details. The necessary permissions depend on the document’s confidentiality and user's access rights within the system.\\n\\nUpon receiving a request, the `getDocumentRest` handler initiates the process by calling the `getDocument` function from the document core module. The function uses parameters passed in the request to query the database and retrieve the document data. This interaction involves validating the request data, ensuring proper authentication and authorization, and seamlessly handling data retrieval from the database. Following successful data acquisition, the function then formats the data appropriately and sends it back to the client as a JSON object, providing a clear and structured representation of the document.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/document-saveDocumentRest.request.txt b/packages/leemons-openapi/lib/requests/document-saveDocumentRest.request.txt new file mode 100644 index 0000000000..59b14361d5 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/document-saveDocumentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveDocumentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/saveDocument.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/updateDocument.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/createDocument.js\n[object Object]", + "response": "{\"summary\":\"Saves a document with the provided content updates\",\"description\":\"This endpoint allows users to save modifications to a document within the application. It accepts updated contents for an existing document, including text changes, format adjustments, and other related updates typically necessary for content management through a document editor interface.\\n\\n**Authentication:** Users must be authenticated to update documents. Proper session tokens must be included in the request to validate user identity and access rights.\\n\\n**Permissions:** Users need specific editing permissions for the document they attempt to modify. Without appropriate permissions, the request will be denied, safeguarding the document against unauthorized changes.\\n\\nUpon receiving the request, the endpoint invokes the `saveDocument` function from the `Document` core, which manages the document update process. The method receives the content updates along with a document identifier for accurate targeting within the database. It carries out a series of checks to confirm the user's rights to edit the document, then proceeds to update the document's entries in the database as specified in the request payload. Once the updates are successfully applied, the server responds with a confirmation of the changes, detailing the updated document's status and any relevant metadata associated with the modifications.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/document-shareDocumentRest.request.txt b/packages/leemons-openapi/lib/requests/document-shareDocumentRest.request.txt new file mode 100644 index 0000000000..7258585ffb --- /dev/null +++ b/packages/leemons-openapi/lib/requests/document-shareDocumentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'shareDocumentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-content-creator/backend/core/document/shareDocument.js\n[object Object]", + "response": "{\"summary\":\"Share a document with specified users or groups\",\"description\":\"This endpoint enables a user to share a specific document with one or more users or groups within the platform. The sharing process involves specifying the document ID, the target users or groups, and the permissions that those entities will have on the shared document.\\n\\n**Authentication:** User authentication is required to ensure that only authorized users can share documents. Unauthorized attempts will be blocked and logged.\\n\\n**Permissions:** The user must have ownership or sharing permissions with edit rights on the document to share it with others.\\n\\nThe process starts in the `shareDocumentRest` handler, which calls the `shareDocument` function from the core document module. This function takes input parameters such as document IDs, user or group IDs, and sharing permissions. It checks the user's rights over the document and then updates the database to reflect the new sharing settings. Internally, this may trigger notifications or logs to inform relevant users about the change in document access. The result of the operation is then formatted and returned as a standard JSON response, indicating the success or failure of the sharing request.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/email-providersRest.request.txt b/packages/leemons-openapi/lib/requests/email-providersRest.request.txt new file mode 100644 index 0000000000..624c9bbe98 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/email-providersRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'providersRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/core/email.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/emails/test.js\n[object Object]", + "response": "{\"summary\":\"Manage email configurations and send emails\",\"description\":\"This endpoint is responsible for handling email-related operations, including configuring email settings and dispatching emails to specified recipients. The operations may vary from setting up email preferences to actual delivery of messages depending on the actions triggered.\\n\\n**Authentication:** Users need to be authenticated to interact with the email services. The system ensures that only logged-in users can configure settings or send emails, protecting against unauthorized access.\\n\\n**Permissions:** This endpoint requires the user to have ‘email_management’ permission to configure settings and ‘send_email’ permission to dispatch emails. The permissions ensure that only users with adequate rights can perform these sensitive operations.\\n\\nThe flow begins when the email service receives a configuration or send request. It invokes the appropriate method in the ‘EmailService’ core, which might involve reading from or writing to the email configuration database, or calling an external email service API for dispatching emails. Throughout this process, various checks are performed to ensure that the user has the necessary authentication and permissions. Errors are handled gracefully, and success or failure responses are duly returned in a comprehensible format, keeping the client-side apprised of the operation status.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/email-removeProviderRest.request.txt b/packages/leemons-openapi/lib/requests/email-removeProviderRest.request.txt new file mode 100644 index 0000000000..31970b2a6b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/email-removeProviderRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeProviderRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/core/email.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/emails/test.js\n[object Object]", + "response": "{\"summary\":\"Remove an email provider configuration\",\"description\":\"This endpoint handles the deletion of a specific email provider's configuration from the system. The removal process is handled securely and ensures that all related data is also cleaned up properly.\\n\\n**Authentication:** Users need to be authenticated to perform this operation. A valid session token must be provided as part of the request headers to authorize the deletion operation.\\n\\n**Permissions:** Administrative permissions are required to access this endpoint. Users must have the 'email.admin' role assigned to successfully execute this action.\\n\\nUpon receiving the request, the handler first verifies that the provided session token corresponds to a user with the necessary administrative permissions. It then invokes the `removeProvider` method from the `EmailService`. This method locates the specific email provider configuration based on an identifier provided in the request and proceeds with its deletion from the database. Throughout this process, appropriate error handling mechanisms are in place to manage issues like non-existent identifiers or database errors, ensuring the response accurately reflects the outcome of the operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/email-saveProviderRest.request.txt b/packages/leemons-openapi/lib/requests/email-saveProviderRest.request.txt new file mode 100644 index 0000000000..2fd8e6fc7a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/email-saveProviderRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveProviderRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/core/email.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/emails/test.js\n[object Object]", + "response": "{\"summary\":\"Saves a new email service provider configuration\",\"description\":\"This endpoint allows the addition of a new email service provider configuration into the system. It handles the setup of email service credentials, server details, and other necessary configurations required to send emails through the specified provider.\\n\\n**Authentication:** Users must be authenticated to access this endpoint. Authentication ensures that only authorized users can add or modify email service provider configurations.\\n\\n**Permissions:** Users need to have 'admin' privileges to configure email service providers. This ensures that only users with sufficient permissions can make changes that affect email communications.\\n\\nThe endpoint workflow begins with the validation of the provided input parameters to ensure they meet the system's requirements for an email service provider configuration. It then proceeds to call the `addProvider` method from the `EmailService` core, which is responsible for incorporating the new provider settings into the database. This process involves storing sensitive information such as API keys and SMTP server details securely. Upon successful addition, the service returns a confirmation of the new configuration's save operation, and relevant details are logged for audit purposes.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/email-sendCustomTestRest.request.txt b/packages/leemons-openapi/lib/requests/email-sendCustomTestRest.request.txt new file mode 100644 index 0000000000..70edc5c381 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/email-sendCustomTestRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'sendCustomTestRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js\n[object Object]", + "response": "{\"summary\":\"Send customized test email to specified recipient\",\"description\":\"This endpoint allows sending a customized test email based on predefined templates and user-input variables. The primary use is for testing and validating email setup within the application configuration.\\n\\n**Authentication:** User authentication is mandatory to ensure secure access to email sending capabilities. Only authenticated users can invoke this functionality.\\n\\n**Permissions:** The user needs to have 'email_send_test' permissions to execute this action, ensuring that only privileged users can perform testing of the email system.\\n\\nUpon receiving the request, the `sendCustomTestRest` handler extracts necessary details such as recipient address, email template, and variable data from the request payload. It uses the `sendEmail` method from the `EmailService`, taking care to replace placeholders in the template with actual values provided in the variables payload. The entire process is managed asynchronously to handle potential high load and to provide faster system response. The outcome of the email sending operation—either successful sending or an error message—is then prepared as a JSON response to the original HTTP request.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/email-sendTestRest.request.txt b/packages/leemons-openapi/lib/requests/email-sendTestRest.request.txt new file mode 100644 index 0000000000..faaf16961d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/email-sendTestRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'sendTestRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js\n[object Object]", + "response": "{\"summary\":\"Send a test email to verify SMTP settings\",\"description\":\"This endpoint allows administrators to send a test email to verify the configuration and functionality of the SMTP settings in the system. This is critical for ensuring that the email communication services are operational and emails can be reliably sent from the platform.\\n\\n**Authentication:** User authentication is required to access this endpoint. Users must provide valid credentials to initiate the email sending process.\\n\\n**Permissions:** This endpoint requires administrator privileges. A user must have the 'admin' role or specific email management permissions in order to execute this test.\\n\\nThe `sendTestEmail` method is invoked when a request reaches this endpoint. It utilizes configured SMTP settings to send an email to a predefined recipient address. The method initiates a connection to the SMTP server, constructs the email based on parameters (like sender, recipient, subject, and body) provided in the request or predefined defaults, and sends the email. If the email is successfully sent, the server returns a success message; otherwise, it handles errors by capturing them and providing appropriate feedback to the user. This complete process ensures that any issues with email delivery can be identified and corrected promptly.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/emergencyPhones-getDatasetFormRest.request.txt b/packages/leemons-openapi/lib/requests/emergencyPhones-getDatasetFormRest.request.txt new file mode 100644 index 0000000000..0b905bf200 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/emergencyPhones-getDatasetFormRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getDatasetFormRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/emergencyPhones.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/emergencyPhones.rest.js\n[object Object]", + "response": "{\"summary\":\"Fetch emergency contact numbers for families\",\"description\":\"This endpoint provides a concise list of emergency phone numbers tailored for family use. It ensures that users can quickly access critical contact information in case of an emergency without navigating through multiple pages or systems.\\n\\n**Authentication:** User must be authenticated to retrieve emergency contact numbers. Access to this endpoint is denied if the user does not provide a valid authentication token.\\n\\n**Permissions:** This endpoint requires users to have the 'view_emergency_numbers' permission to access the list of emergency numbers. Users without this permission will receive an authorization error message.\\n\\nUpon receiving a request, the endpoint initially checks for user authentication and appropriate permissions. Once validated, it calls the `getFamilyEmergencyContacts` method from the `EmergencyService`. This method retrieves all relevant emergency contact numbers stored in the system database that are marked as important for families. The retrieved data is then formatted into a JSON response and sent back to the user, providing a streamlined and accessible list of emergency contacts for immediate reference.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/families-addRest.request.txt b/packages/leemons-openapi/lib/requests/families-addRest.request.txt new file mode 100644 index 0000000000..5c723d1481 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/families-addRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/users/getSessionFamilyPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/getFamilyMenuBuilderData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/family-members/addMember.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/family-members/existMember.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/profiles-config/getProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/profiles-config/getGuardianProfile.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/profiles-config/getStudentProfile.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/setDatasetValues.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/recalculeNumberOfMembers.js\n[object Object]", + "response": "{\"summary\":\"Add a new family record to the system\",\"description\":\"This endpoint is responsible for adding a new family record into the database. It typically involves receiving data pertaining to the family which may include unique identifiers, names, and related information used to create a new entry in the families table.\\n\\n**Authentication:** Users need to be authenticated to create a new family. The endpoint requires a valid user session token to proceed with the request.\\n\\n**Permissions:** Users need to have administrative rights or specific role-based permissions enabled to add a new family. These permissions ensure that only authorized personnel can make modifications to the family records.\\n\\nUpon receiving a request, the endpoint initially validates the provided data against predefined schemas to ensure compliance with the database structure. Following successful validation, the `add` method within the Families core service is called. This method involves constructing a database query to insert the new family data into the families table. After the database operation, the endpoint responds with the newly created family record or an appropriate error message if the operation fails.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/families-detailRest.request.txt b/packages/leemons-openapi/lib/requests/families-detailRest.request.txt new file mode 100644 index 0000000000..dea9cefb6c --- /dev/null +++ b/packages/leemons-openapi/lib/requests/families-detailRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'detailRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/users/canViewFamily.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/users/isFamilyMember.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/getMembers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/users/getSessionFamilyPermissions.js\n[object Object]", + "response": "{\"summary\":\"Provides detailed information about a specific family entity\",\"description\":\"This endpoint is designed for retrieving detailed data regarding a specific family entity within the application. It encapsulates comprehensive information about the family including its members and associated profiles.\\n\\n**Authentication:** Authorized access is mandatory, requiring users to be authenticated in order to retrieve family details. Unauthenticated requests will be denied.\\n\\n**Permissions:** This endpoint requires the user to have explicit permissions to view family information. Observing privacy and security standards, only permitted users, such as family members or authorized administrative personnel, can access the details.\\n\\nUpon receiving a request, the `detailRest` handler calls the `detail` function from the 'families' module. The function uses the provided family ID to fetch all relevant data from the database including membership information and other relevant attributes of the family entity. It processes this data to construct a detailed view of the family, considering user permissions and authentication status to manage data visibility. The result is a structured JSON object representing the detailed family profile, which is then returned to the client as the response payload.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/families-getDatasetFormRest.request.txt b/packages/leemons-openapi/lib/requests/families-getDatasetFormRest.request.txt new file mode 100644 index 0000000000..f5fdce32a0 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/families-getDatasetFormRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getDatasetFormRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js\n[object Object]", + "response": "{\"summary\":\"Fetches dataset form associated with family structures\",\"description\":\"This endpoint is designed to fetch the dataset form configurations that are used in creating or editing family structures within the system. The form is a critical component for users to input accurate data relevant to the family constructs outlined by the application's logic.\\n\\n**Authentication:** Users must be authenticated to view or interact with the family dataset forms. Authentication ensures that the request is associated with a valid and active user session.\\n\\n**Permissions:** Access to the dataset form is governed by specific permissions that ensure only users with 'edit families' capability or similar rights can fetch the form data. This ensures that sensitive information or tools used in managing family data are strictly regulated.\\n\\nUpon receiving a request, the handler for the `getDatasetFormRest` method begins by validating the user's authentication and permissions. If these checks pass, it calls the `getDatasetForm` service from the `familyFormService`. This service is responsible for retrieving the form configuration details from a stored layout or predefined configuration. The method ensures that the retrieved form matches the current user's permissions and operational scope to interact with family data. Once the data is fetched and validated, it is formatted appropriately and sent back as a JSON response, encapsulating all necessary fields and configurations required for the user interface to render the family data form correctly.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/families-listDetailPageRest.request.txt b/packages/leemons-openapi/lib/requests/families-listDetailPageRest.request.txt new file mode 100644 index 0000000000..85d2a2189f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/families-listDetailPageRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listDetailPageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/listDetailPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/getUserFamilyIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/users/canViewFamily.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/users/isFamilyMember.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/getMembers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/users/getSessionFamilyPermissions.js\n[object Object]", + "response": "{\"summary\":\"Displays detailed list of family members associated with the user\",\"description\":\"This endpoint delivers a detailed list and relationships of all family members associated with the authenticated user. This list might include sensitive information such as member roles, relationship status, and personal identifiers.\\n\\n**Authentication:** Users need to be authenticated to fetch their family details. The endpoint verifies the user's credentials and session validity before proceeding.\\n\\n**Permissions:** Users must have the 'view_family_details' permission enabled in their profile. Without this permission, the endpoint restricts access and returns an unauthorized access error.\\n\\nUpon receiving the request, the endpoint first retrieves the user's identity and associated family IDs through the `getUserFamilyIds` method. It then uses the `listDetailPage` function to fetch a comprehensive list of all family members, along with pertinent details like age, relationship, and roles within the family structure. This process may involve several layers of data processing, including security checks for data sensitivity and user permissions. Finally, data is formatted appropriately and sent back to the user as a detailed, structured JSON response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/families-listRest.request.txt b/packages/leemons-openapi/lib/requests/families-listRest.request.txt new file mode 100644 index 0000000000..96ec39e87e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/families-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/list.js\n[object Object]", + "response": "{\"summary\":\"Lists all family entities accessible to the user\",\"description\":\"This endpoint provides a comprehensive list of family entities that the user can access within the application. It consolidates data from various sources and presents a unified view to simplify user interactions with family records.\\n\\n**Authentication:** User authentication is required to ensure secure access to the family data. Only authorized users can retrieve the list based on their credentials.\\n\\n**Permissions:** The user must possess the appropriate permissions to view family entities. These permissions help in enforcing data security and access rights specific to user roles within the application.\\n\\nFollowing authentication and permission checks, the `listRest` controller in the family plugin initializes by calling the `list` method located in `families/index.js`. This method further interacts with underlying service layers to fetch and organize data pertinent to the families. The retrieval process takes into consideration the user's role and permissions to filter and return only those family records that the user is authorized to view. The final output is formatted and sent back as JSON data, which includes details of each family entity accessible to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/families-removeRest.request.txt b/packages/leemons-openapi/lib/requests/families-removeRest.request.txt new file mode 100644 index 0000000000..0b7480f548 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/families-removeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/getMembers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/removeDatasetValues.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/family-members/removeMember.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/family-members/existMember.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/profiles-config/getProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/profiles-config/getGuardianProfile.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/profiles-config/getStudentProfile.js\n[object Object]", + "response": "{\"summary\":\"Remove a specified family record\",\"description\":\"This endpoint removes a specific family entity from the database based on the provided family ID. It ensures that all associated data such as family members and any linked profiles are also updated or deleted appropriately to maintain database integrity.\\n\\n**Authentication:** Users need to be authenticated to perform deletion operations. The endpoint checks for a valid user session or token before proceeding with the removal process.\\n\\n**Permissions:** The user must have administrative rights or specific permissions set to delete family records. Without sufficient privileges, the request will be denied.\\n\\nThe removal process initiates by first verifying the existence of the family through the `exists` validation method which checks for the family's presence in the database. Upon successful validation, the `remove` method from the `families` core is called with necessary parameters such as the family ID. This method handles the deletion of the family record and triggers supplementary actions like removing related dataset values through `removeDatasetValues` method and updating or deleting associated family members using `removeMember` method. Each step ensures the comprehensive cleanup of all data linked to the family entity, culminating in a structured response that confirms the removal outcome.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/families-searchUsersRest.request.txt b/packages/leemons-openapi/lib/requests/families-searchUsersRest.request.txt new file mode 100644 index 0000000000..45de9f222b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/families-searchUsersRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'searchUsersRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/users/searchUsers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/profiles-config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/profiles-config/getGuardianProfile.js\n[object Object]", + "response": "{\"summary\":\"Search for users within the family members module\",\"description\":\"This endpoint allows searching for user profiles that are part of the family members system within the Leemonade platform. It handles queries to filter and return user data based on specified criteria, facilitating the management and overview of family configurations.\\n\\n**Authentication:** Users must be authenticated to access and search for family member details. The access is granted only upon successful authentication, ensuring data privacy and security.\\n\\n**Permissions:** The user must have the 'view_users' permission within their role to perform searches on family member data. This permission check ensures that only authorized personnel can access sensitive user information.\\n\\nThe process begins by invoking the 'searchUsers' method located in the 'families.rest.js', which interacts with the users' core system. The method utilizes the Moleculer query handling to fetch user data based on provided search parameters received from the client-side. After processing the query, the endpoint compiles the results into a structured format and returns this data to the requester in a JSON format, which includes details like user ID, names, and roles within family contexts.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/families-updateRest.request.txt b/packages/leemons-openapi/lib/requests/families-updateRest.request.txt new file mode 100644 index 0000000000..53e516573a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/families-updateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/services/rest/families.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/users/canUpdateFamily.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/users/isFamilyMember.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/users/getSessionFamilyPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/getMembers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/getFamilyMenuBuilderData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/family-members/removeMember.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/family-members/existMember.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/profiles-config/getProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/profiles-config/getGuardianProfile.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/profiles-config/getStudentProfile.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/family-members/addMember.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/setDatasetValues.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-families/backend/core/families/recalculeNumberOfMembers.js\n[object Object]", + "response": "{\"summary\":\"Updates family data based on specified changes\",\"description\":\"This endpoint allows for the modification of existing family data within the system. The operation includes the ability to alter family-related details such as family name, address, and other relevant attributes that are part of the family profile.\\n\\n**Authentication:** Users need to be authenticated to update family data. The system will reject requests from unauthenticated sessions.\\n\\n**Permissions:** The user must have the 'edit_family' permission to modify family data. Without this permission, the request will be denied, ensuring that only authorized users can make changes to family information.\\n\\nThe process begins by validating user authentication and checking for the necessary permissions. Upon successful validation, the `updateFamily` method from the `families` core is invoked with the updated data payload. This method handles the logic to update the family information in the database, ensuring data consistency and integrity. After the update operation, a confirmation of the update success is sent back in the response, along with the updated family details.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/feedback-assignFeedbackRest.request.txt b/packages/leemons-openapi/lib/requests/feedback-assignFeedbackRest.request.txt new file mode 100644 index 0000000000..b0f18798e1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/feedback-assignFeedbackRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'assignFeedbackRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback/assignFeedback.js\n[object Object]", + "response": "{\"summary\":\"Assign feedback to a specific target\",\"description\":\"This endpoint assigns user-generated feedback to a particular item or service within the platform. The functionality encapsulates user engagement by allowing feedback submissions to be directly attached to specific targets identified within the system.\\n\\n**Authentication:** Users need to be authenticated to submit feedback. The system checks for a valid session or token before processing the request.\\n\\n**Permissions:** The user must have the 'submit_feedback' permission to perform this action. Access without sufficient permissions will result in a denial of service error.\\n\\nThe process initiates with the `assignFeedback` method in the feedback core service. This method receives information about the feedback such as the target ID and the feedback details. It performs validation checks to ensure data integrity and compliance with established standards. Subsequently, the method interacts with the database backend to record the submitted feedback against the specified target, ensuring that all referencing and data relationships are properly maintained. The completion of the operation results in a confirmation response that the feedback has been successfully assigned, including any relevant metadata related to the assignment.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/feedback-deleteFeedbackRest.request.txt b/packages/leemons-openapi/lib/requests/feedback-deleteFeedbackRest.request.txt new file mode 100644 index 0000000000..3dcf6e337b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/feedback-deleteFeedbackRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteFeedbackRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback/deleteFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-questions/deleteFeedbackQuestions.js\n[object Object]", + "response": "{\"summary\":\"Deletes specific feedback based on ID\",\"description\":\"This endpoint facilitates the deletion of a user's feedback from the database. It typically involves the identification and removal of feedback based on the specified ID provided in the request.\\n\\n**Authentication:** User authentication is necessary to identify and validate the user's permission to delete feedback. The system must ensure that the stateful session or token provided is valid and active.\\n\\n**Permissions:** Appropriate permissions must be checked to ensure that the user possesses the required rights to delete feedback. This generally includes permissions like 'feedback.delete' or 'admin' role requirements.\\n\\nUpon receiving the request, the endpoint first verifies the user's authentication status and permissions. If these checks pass, it proceeds to invoke the `deleteFeedback` function from the 'feedback' core. This function handles the actual deletion logic, such as locating the specific feedback record by ID in the database and removing it. The successful execution of this function leads to the removal of the feedback, and the endpoint returns a confirmation message, indicating that the operation was successful. Errors during the process, like invalid IDs or insufficient permissions, cause it to return an appropriate error message along with an error status code.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/feedback-duplicateFeedbackRest.request.txt b/packages/leemons-openapi/lib/requests/feedback-duplicateFeedbackRest.request.txt new file mode 100644 index 0000000000..6c9608d2b7 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/feedback-duplicateFeedbackRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'duplicateFeedbackRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback/duplicateFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-questions/getQuestionsByFeedbackIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-questions/getFeedbackQuestionByIds.js\n[object Object]", + "response": "{\"summary\":\"Duplicate specific feedback item\",\"description\":\"This endpoint duplicates a specific feedback item based on the provided feedback ID. It is typically used in scenarios where feedback mechanisms need to replicate existing entries whilst retaining the original data integrity.\\n\\n**Authentication:** Users need to be authenticated to perform this duplication operation. Failing to provide valid authentication credentials will result in rejection of the request.\\n\\n**Permissions:** Users must have the 'duplicate_feedback' permission granted to execute this operation. The permission checks ensure that only authorized users can make duplications, adhering to the system's security protocols.\\n\\nUpon receiving a request with a valid feedback ID, the `duplicateFeedback` method in the feedback core is triggered. This method is responsible for first verifying that the feedback ID exists and that the user has the appropriate permissions to duplicate it. It then proceeds to create a copy of the original feedback, ensuring all linked information, such as feedback questions and responses, are correctly replicated. The process involves several transactional database operations to maintain data consistency and integrity. Finally, the endpoint responds with the new feedback ID of the duplicated item, confirming the successful operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/feedback-getFeedbackRest.request.txt b/packages/leemons-openapi/lib/requests/feedback-getFeedbackRest.request.txt new file mode 100644 index 0000000000..185c93b426 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/feedback-getFeedbackRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getFeedbackRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback/getFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-questions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-questions/getFeedbackQuestionByIds.js\n[object Object]", + "response": "{\"summary\":\"Collect and display user-specific feedback submissions\",\"description\":\"This endpoint handles the collection and retrieval of feedback submissions specific to a user within the application. It fetches feedback based on user-specific queries, ensuring tailored content delivery that is relevant to the individual's interactions or contributions within the platform.\\n\\n**Authentication:** User authentication is required to access this endpoint. Users must be logged in to view or submit their feedback, ensuring that feedback remains personal and secure.\\n\\n**Permissions:** Specific permissions regarding who can view or submit feedback are enforced. Users need appropriate permissions to perform these actions, typically dependent on their role within the application or specific administrative rights assigned to their profile.\\n\\nUpon receiving a request, the `getFeedbackRest` handler initiates by validating user authentication and permissions. The handler then proceeds to invoke the `getFeedback` method from the 'feedback' core. This method is responsible for accessing the database and retrieving feedback entries that match the criteria specific to the authenticated user. The process involves querying the database with parameters that include user identifiers and other relevant data filters. Once the data is fetched and compiled, it is returned to the user in a structured JSON format, providing a clear and concise overview of the feedback directly related to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/feedback-getFeedbackResultsRest.request.txt b/packages/leemons-openapi/lib/requests/feedback-getFeedbackResultsRest.request.txt new file mode 100644 index 0000000000..0c3d24945a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/feedback-getFeedbackResultsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getFeedbackResultsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-responses/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-responses/getFeedbackResults.js\n[object Object]", + "response": "{\"summary\":\"Collect feedback results aggregated by specified criteria\",\"description\":\"This endpoint aggregates and returns feedback results based on specific criteria such as survey ID, question type, or participant demographics. The aggregation helps in analyzing the feedback comprehensively.\\n\\n**Authentication:** Users must be authenticated to request feedback results. The endpoint validates the session or token provided for authentication before proceeding with the request.\\n\\n**Permissions:** Users need to have 'read_feedback' permission to access this data. Depending on the organization's settings, additional permissions related to data sensitivity might be enforced.\\n\\nThe processing begins with the retrieval of parameters specifying which feedback items need to be aggregated. It uses the `getFeedbackResults` function from the `feedback-responses` module, which fetches and computes the results based on the given criteria. This function consults several data sources, processes the data, and finally, prepares an aggregated result set. The results are then formatted into a structured response and sent back to the client as JSON. This method ensures that all data retrieval and processing are secure and efficient, adhering to the required data privacy standards.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/feedback-getFeedbackResultsWithTimeRest.request.txt b/packages/leemons-openapi/lib/requests/feedback-getFeedbackResultsWithTimeRest.request.txt new file mode 100644 index 0000000000..0e8f5a0b77 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/feedback-getFeedbackResultsWithTimeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getFeedbackResultsWithTimeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-responses/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-responses/getFeedbackResultsWithTime.js\n[object Object]", + "response": "{\"summary\":\"Retrieve feedback results over time\",\"description\":\"This endpoint fetches a series of feedback results, aggregated over a specified time period. The data retrieved can be used to analyze trends and patterns in feedback over time, aiding in comprehensive assessments and strategic planning.\\n\\n**Authentication:** Users must be authenticated to access this endpoint. Access attempts with invalid or missing authentication credentials will be rejected.\\n\\n**Permissions:** This endpoint requires users to have specific permissions related to feedback analysis. Users without the necessary permissions will not be able to retrieve feedback result data.\\n\\nThe processing of this request begins when the `getFeedbackResultsWithTimeRest` action is called in the service module. Initially, the request parameters specifying the time period are parsed. Following this, the `getFeedbackResultsWithTime` method from the 'feedback-responses' core module is invoked with these parameters. This method is responsible for querying the database to retrieve feedback data that fits the provided timeframe, processing it, and preparing it for a response. The result is then returned as a JSON object that encapsulates the feedback data, formatted to highlight key trends and statistics over the requested period.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/feedback-getUserAssignableResponsesRest.request.txt b/packages/leemons-openapi/lib/requests/feedback-getUserAssignableResponsesRest.request.txt new file mode 100644 index 0000000000..d9d32fce93 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/feedback-getUserAssignableResponsesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getUserAssignableResponsesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-responses/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-responses/getUserAssignableResponses.js\n[object Object]", + "response": "{\"summary\":\"Retrieve assignable feedback responses for a user\",\"description\":\"This endpoint fetches all feedback responses that a user can assign to others based on their role and permissions within the system. It focuses on identifying which feedback mechanisms and associated responses are available for delegation by a specific user.\\n\\n**Authentication:** User authentication is required to ensure that the request is made by a valid user and to ascertain the user’s role and permissions accurately.\\n\\n**Permissions:** The user must have permissions that allow assigning feedback to others. This typically includes administrative or supervisory roles that manage user interactions and feedback within the platform.\\n\\nUpon receiving a request, the `getUserAssignableResponsesRest` handler initiates by calling the `getUserAssignableResponses` function in the `feedback-responses` core module. This function performs a lookup to determine the feedback items that the user can assign based on the user's credentials, roles, and specific system-defined permissions. The function consults various data sources such as user roles, active permissions, and existing feedback assignment rules to compile a list of assignable feedback responses. Finally, a response with the list of assignable feedback items formatted as a JSON object is sent back to the caller.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/feedback-saveFeedbackRest.request.txt b/packages/leemons-openapi/lib/requests/feedback-saveFeedbackRest.request.txt new file mode 100644 index 0000000000..0b23a488ad --- /dev/null +++ b/packages/leemons-openapi/lib/requests/feedback-saveFeedbackRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveFeedbackRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback/saveFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-questions/deleteFeedbackQuestions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-questions/updateFeedbackQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-questions/createFeedbackQuestion.js\n[object Object]", + "response": "{\"summary\":\"Saves user feedback for a specific query or service\",\"description\":\"This endpoint allows users to submit feedback related to a specific part of the platform or service. The feedback data collected can include ratings, textual feedback, or other forms of user input related to their experience with the platform.\\n\\n**Authentication:** Users need to be authenticated to submit feedback. Only authenticated user sessions can post feedback, ensuring that feedback can be associated with a specific user account.\\n\\n**Permissions:** The user must have permission to access the specific service or platform component about which they are providing feedback. The required permissions depend on the organization's or platform's specific configuration and access control settings.\\n\\nThe `saveFeedbackRest` handler begins by validating the incoming data against predefined schemas to ensure all required fields are present and correctly formatted. Then, it invokes the `saveFeedback` method from the `Feedback` core service. This method deals with the business logic for saving the feedback into the system's database, including any necessary processing or transformation of feedback data. The process involves logging the feedback entry along with the user's details and the context of the feedback (e.g., the specific part of the service the feedback addresses). Once the feedback is successfully saved, a confirmation is sent back to the user in the form of a JSON response indicating the successful storage of their feedback.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/feedback-setInstanceTimestampRest.request.txt b/packages/leemons-openapi/lib/requests/feedback-setInstanceTimestampRest.request.txt new file mode 100644 index 0000000000..b796eb1ff3 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/feedback-setInstanceTimestampRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setInstanceTimestampRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback/setInstanceTimestamp.js\n[object Object]", + "response": "{\"summary\":\"Sets the timestamp for a specific feedback instance\",\"description\":\"This endpoint is responsible for updating the timestamp marking when certain feedback has been reviewed or modified within the system. It essentially marks a feedback entry with the current date and time to track its processing status.\\n\\n**Authentication:** Users need to be authenticated to perform this action. They must provide valid session credentials to authenticate their identity and grant them access to this endpoint.\\n\\n**Permissions:** The user must have the 'manage_feedback' permission to update timestamps on feedback entities. This ensures that only authorized personnel can make changes to feedback timing, maintaining the integrity and security of the data.\\n\\nThe flow begins with the `setInstanceTimestamp` method within the `feedback` core module. This method accepts certain parameters, such as the instance ID of the feedback, and updates the `timestamp` field of the specified feedback instance in the database. This action is performed after validating that the user has the necessary permissions and is authenticated. The response to this operation is typically a confirmation of the update, including the new timestamp value.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/feedback-setQuestionResponseRest.request.txt b/packages/leemons-openapi/lib/requests/feedback-setQuestionResponseRest.request.txt new file mode 100644 index 0000000000..c23c230a8e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/feedback-setQuestionResponseRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setQuestionResponseRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-responses/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-feedback/backend/core/feedback-responses/setQuestionResponse.js\n[object Object]", + "response": "{\"summary\":\"Records a user's response to feedback-related questions\",\"description\":\"This endpoint allows for the recording and updating of a user's responses to specific feedback questions presented within the platform. It provides a critical interaction within the user feedback loop, capturing valuable insights from users about various aspects of product or service usability, satisfaction, and overall experience.\\n\\n**Authentication:** Users need to be authenticated to submit their responses. The authentication verifies user identity and ensures that responses are correctly attributed to the user's account.\\n\\n**Permissions:** The user must have the 'feedback-response:create' permission to post new responses and 'feedback-response:edit' to update their existing responses. These permissions ensure that only authorized users can interact with feedback mechanisms accordingly.\\n\\nUpon receiving a request, the endpoint firstly checks the user's authentication status and permissions. If these checks are passed, the `setQuestionResponse` service method is invoked with parameters that identify the specific question and capture the user’s response. This method handles the intricate details of storing or updating the response data in the database. The process includes validation of the input data to comply with expected formats and constraints. Finally, an appropriate response is generated and sent back to the client, indicating the success or failure of the operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/file-abortMultipartRest.request.txt b/packages/leemons-openapi/lib/requests/file-abortMultipartRest.request.txt new file mode 100644 index 0000000000..0371965072 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/file-abortMultipartRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'abortMultipartRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/abortMultipart/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/abortMultipart/abortMultipart.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/abortMultipart/handleAbortMultipart.js\n[object Object]", + "response": "{\"summary\":\"Abort multipart upload process\",\"description\":\"This endpoint handles the cancellation of an ongoing multipart file upload session. It is designed to ensure that multipart upload operations can be safely terminated without leaving residual data fragments, thus helping in maintaining data consistency and storage optimization.\\n\\n**Authentication:** User authentication is required to execute this endpoint. An authenticated user context assures that only owners or authorized users abort the intended upload session.\\n\\n**Permissions:** This endpoint requires file-management permissions, specifically the right to modify or delete file upload sessions as delegated within the user's permission scope.\\n\\nUpon receiving a request to abort a multipart upload, the endpoint invokes the `abortMultipart` function from the corresponding service in the leebrary plugin. This function processes the session identifier provided in the request to locate and halt the active upload process. It then interacts with underlying storage mechanisms to ensure that all partial uploads are either discarded or flagged for cleanup, thereby freeing up resources and preventing partial data storage. The entire process is managed within the framework's structured error handling to ensure that any issues during the abort operation are captured and dealt with appropriately, and appropriate responses are relayed back to the client to reflect the success or failure of the abort operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/file-coverRest.request.txt b/packages/leemons-openapi/lib/requests/file-coverRest.request.txt new file mode 100644 index 0000000000..604537b870 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/file-coverRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'coverRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/buildQuery.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getUserPermissionsByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/getClassesPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getAssetPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canUnassignRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getRolePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/validateRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithFiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/find.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsCategoryData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsProgramsAggregatedById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/processFinalAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/dataForReturnFile/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/dataForReturnFile/dataForReturnFile.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/getById/getById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/dataForReturnFile/handleReadParams.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/dataForReturnFile/handleReadStream.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/dataForReturnFile/handleCommonFileDetails.js\n[object Object]", + "response": "{\"summary\":\"Manage file cover updates and retrievals\",\"description\":\"This endpoint handles the retrieval and updating of cover images for files within the leemons platform. It allows users to upload new cover images for specific files or retrieve existing ones, enhancing the file metadata and visual identification within user interfaces.\\n\\n**Authentication:** Users need to be authenticated in order to update or retrieve file covers. The system checks for a valid user session or access token before processing the request.\\n\\n**Permissions:** Users must have the appropriate file management permissions or specific rights granted for the file involved. Without sufficient permissions, the request will be denied.\\n\\nUpon receiving a request, the endpoint first verifies the authentication status and permissions of the user. If the user is authorized, the `coverRest` handler then either fetches the current cover image or processes the upload of a new one, depending on the request method (GET for retrieval, POST for upload). The implementation involves calls to the file system storage backend, with careful error handling and response management to ensure that users receive appropriate feedback on the outcome of their request—either providing the image file stream/source or success confirmation of the upload.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/file-fileRest.request.txt b/packages/leemons-openapi/lib/requests/file-fileRest.request.txt new file mode 100644 index 0000000000..45405141fa --- /dev/null +++ b/packages/leemons-openapi/lib/requests/file-fileRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'fileRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js\n[object Object]", + "response": "{\"summary\":\"Manages file operations within the Leebrary plugin\",\"description\":\"This endpoint handles various file operations such as uploading, retrieving, and managing files within the Leemons Leebrary plugin. It serves as an essential component for file management in the educational platform, enabling users to efficiently handle educational resources.\\n\\n**Authentication:** Users must be authenticated to perform any file operations. Authentication ensures that operations are secure and that files are accessed only by authorized users.\\n\\n**Permissions:** Users need specific permissions related to file management. These permissions determine what operations the user can perform, such as uploading new files, updating existing files, or deleting files.\\n\\nThe handling process starts with the specific file operation request from the user. Depending on the operation (upload, retrieve, delete, etc.), the endpoint executes the corresponding action in the backend. This includes interacting with the file system to store or fetch files, updating file metadata in the database, and ensuring that all file interactions respect user permissions and authentication status. The result of these operations is then formatted appropriately and sent back to the user as a response in JSON format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/file-finishMultipartRest.request.txt b/packages/leemons-openapi/lib/requests/file-finishMultipartRest.request.txt new file mode 100644 index 0000000000..4e39a12c7b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/file-finishMultipartRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'finishMultipartRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/finishMultipart/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/finishMultipart/finishMultipart.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/dataForReturnFile/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/dataForReturnFile/dataForReturnFile.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/getById/getById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/dataForReturnFile/handleReadParams.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/dataForReturnFile/handleReadStream.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/dataForReturnFile/handleCommonFileDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/createTemp.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/isReadableStream.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/streamToBuffer.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/getMetadataObject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/handleMetadata.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/getReadableFileSize.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/handleMediaInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/getMetaProps.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/getReadableBitrate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/getReadableDuration.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/pad.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/handleDocumentInfo.js\n[object Object]", + "response": "{\"summary\":\"Completes the multipart file upload process\",\"description\":\"This endpoint finalizes the multipart upload sequence for a file that has been uploaded in chunks. It assimilates all parts of the file that have been uploaded separately, constructs the final complete file, and makes it available for use or download.\\n\\n**Authentication:** Users must be authenticated to finalize multipart uploads. A valid session or token is required to prove the user's identity and ensure that the action is securely controlled.\\n\\n**Permissions:** Specific permissions are necessary for a user to complete a multipart upload. Typically, the user needs write or upload permissions on the destination where the file is being saved. This ensures that the user has the right to complete uploads to the specified directory or system.\\n\\nUpon receiving a request to finalize a multipart upload, the `finishMultipart` method in the file service is called. This method checks for all parts of the file stored temporarily during the upload process, verifies their integrity, and concatenates them into a single file. This process may involve validation of each part's checksums to ensure no data corruption occurred during transmission. Once verified and combined, the file is then processed for any needed metadata extraction or further validation based on the file type and service configuration. On successful completion, the concatenated file is made permanently available at its destination, and appropriate metadata is updated to reflect the new file's attributes.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/file-getUploadChunkUrlsRest.request.txt b/packages/leemons-openapi/lib/requests/file-getUploadChunkUrlsRest.request.txt new file mode 100644 index 0000000000..73e3ef3bac --- /dev/null +++ b/packages/leemons-openapi/lib/requests/file-getUploadChunkUrlsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getUploadChunkUrlsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/getUploadChunkUrls/getUploadChunkUrls.js\n[object Object]", + "response": "{\"summary\":\"Generate upload URLs for file chunks\",\"description\":\"This endpoint generates temporary URLs for uploading file chunks. These URLs are used to securely upload parts of a large file incrementally, which helps in handling large file uploads efficiently and reliably.\\n\\n**Authentication:** Users must be authenticated to generate upload chunk URLs. Access to this endpoint without valid authentication will result in a denial of service.\\n\\n**Permissions:** Users need specific permissions to generate upload chunk URLs, typically linked to rights to upload files or manage file uploads within the application.\\n\\nThe process initiated by this endpoint involves invoking the `getUploadChunkUrls` method located in the `files` core. This method calculates the number of chunks required based on the file size submitted by the user and creates a series of secure, temporary URLs for each chunk. Each URL is specifically generated to allow a part of the file to be uploaded to a designated storage location. The completion of this operation results in a response containing a list of these URLs, which the client can use to sequentially upload chunks of the large file.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/file-newMultipartRest.request.txt b/packages/leemons-openapi/lib/requests/file-newMultipartRest.request.txt new file mode 100644 index 0000000000..c74f9b3ec8 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/file-newMultipartRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'newMultipartRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/newMultipart/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/newMultipart/newMultipart.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/newMultipart/handleCreateFile.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/newMultipart/handleFileProvider.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/newMultipart/handleFileSystem.js\n[object Object]", + "response": "{\"summary\":\"Handle multipart file upload and initialization process\",\"description\":\"This endpoint is designed to handle the multipart file uploading and initialization process. It receives a file from the user and initiates a set of operations to securely store and register the file in the system's storage infrastructure.\\n\\n**Authentication:** All users must be authenticated to upload files. A secure session or valid authentication token is required to ensure that the request originates from a legitimate source.\\n\\n**Permissions:** Users need the 'upload_file' permission to perform file uploads. This ensures that only users with the appropriate rights can upload files, maintaining system integrity and security.\\n\\nThe process begins in the `newMultipartRest` action, which calls the `newMultipart` method in the `Files` core. This method orchestrates various tasks such as validating file types, preparing file storage, and interacting with different file storage providers. It delegates specific responsibilities to sub-methods like `handleCreateFile`, `handleFileProvider`, and `handleFileSystem`. These sub-methods manage detailed aspects of file storage, such as creating file database entries, selecting appropriate storage providers based on the configuration, and physically storing the files on disk or cloud storage. The result of this orchestrated process is a JSON object response containing details about the newly uploaded file including its access paths, metadata, and status.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/file-publicFileRest.request.txt b/packages/leemons-openapi/lib/requests/file-publicFileRest.request.txt new file mode 100644 index 0000000000..2ae2746e38 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/file-publicFileRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'publicFileRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js\n[object Object]", + "response": "{\"summary\":\"Provides public access to specific files\",\"description\":\"This endpoint allows public access to files specified by a file ID. It is primarily used for cases where files need to be shared with users who do not have authenticated sessions or specific permissions within the platform.\\n\\n**Authentication:** No user authentication is required to access the files through this endpoint. This allows for broader accessibility, making it suitable for public sharing scenarios.\\n\\n**Permissions:** There are no specific permissions required to use this endpoint. It is designed to be accessed without any user-based restriction, allowing both authenticated and unauthenticated users to retrieve files as long as they have the correct URL or file identifier.\\n\\nThe handler’s flow begins with extracting the file ID from the incoming request parameters. It then queries the underlying storage system or database using this file ID to locate and retrieve the specified file. If the file is successfully found, it streams the file content back to the client, thereby facilitating the file download or viewing process directly through the client’s browser or download manager. This process bypasses the typical user session verification and permission checks, hence serving the file to any requester with the correct direct link.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/file-publicFolderRest.request.txt b/packages/leemons-openapi/lib/requests/file-publicFolderRest.request.txt new file mode 100644 index 0000000000..a536981bf5 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/file-publicFolderRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'publicFolderRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js\n[object Object]", + "response": "{\"summary\":\"Access and manage public files\",\"description\":\"This endpoint enables users to access and manage files within a specified public folder. It allows the retrieval, addition, and updating of files in the public folder based on provided actions and parameters.\\n\\n**Authentication:** Users need to be authenticated to interact with public files. The authentication ensures that only authorized users can perform operations on files within the public folder.\\n\\n**Permissions:** This endpoint requires users to have specific permissions related to file management. The necessary permissions include reading, writing, and managing public files, depending on the action requested by the user.\\n\\nThe controller handler starts with the validation of user credentials and permissions. Once authentication and authorization are confirmed, it processes the incoming request to determine the required action (e.g., retrieve, add, or update files). Depending on the action, it interacts with the filesystem or database to perform the respective file operation. The process involves creating, reading, or modifying files within the public folder. Finally, the result of the operation is structured into an appropriate response format and sent back to the user, detailing the outcome of their request.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/file-uploadMultipartChunkRest.request.txt b/packages/leemons-openapi/lib/requests/file-uploadMultipartChunkRest.request.txt new file mode 100644 index 0000000000..9e36bedd98 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/file-uploadMultipartChunkRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'uploadMultipartChunkRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/createTemp.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/isReadableStream.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/upload/streamToBuffer.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/uploadMultipartChunk/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/files/uploadMultipartChunk/uploadMultipartChunk.js\n[object Object]", + "response": "{\"summary\":\"Handle chunked file uploads for large files\",\"description\":\"This endpoint facilitates the upload of large files in multiple chunks. It is specifically designed to handle cases where a file needs to be uploaded in segments to manage the load and ensure efficient data transfer over the network.\\n\\n**Authentication:** Users must be authenticated to perform file uploads. The endpoint verifies the identity of the uploader and ensures that a valid session exists before processing any uploaded content.\\n\\n**Permissions:** Users need to have the 'upload_file_chunk' permission. This ensures that only authorized users can initiate and continue chunked uploads, maintaining the security and integrity of the file-handling process.\\n\\nInitially, the endpoint invokes the `uploadMultipartChunk` method from the `Files` service. This method manages the reception of each file chunk, validating its part number and merging it with previous chunks if needed. It uses the `createTemp` function to temporarily store incoming chunks, while the `isReadableStream` checks if the incoming data stream is readable and not corrupted. Once all chunks have been received and verified, the `streamToBuffer` function compiles the chunks into a single file. An acknowledgment of successful upload or an error response detailing any issues during the process is then sent back to the client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/gateway-statusRest.request.txt b/packages/leemons-openapi/lib/requests/gateway-statusRest.request.txt new file mode 100644 index 0000000000..6bf3c3bd6d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/gateway-statusRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'statusRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-gateway/backend/services/rest/api.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-gateway/backend/services/rest/api.rest.js\n[object Object]", + "response": "{\"summary\":\"Check the operational status of the service\",\"description\":\"This endpoint checks and reports the current operational status of various service components. It provides a quick health check to ensure all parts of the system are functioning as expected, ideal for monitoring and preventative maintenance routines.\\n\\n**Authentication:** This endpoint does not require user authentication, enabling an unauthenticated status check.\\n\\n**Permissions:** No specific permissions are required to access this endpoint. It is available to any user or system checking the service status.\\n\\nThe status check works by invoking multiple internal methods designed to test the health and responsiveness of each service component. The flow begins with gathering data on various key components such as the database connectivity, external API responsiveness, and internal service communication. Each component's status is evaluated separately, aggregated into a final comprehensive status report, and returned as a JSON object. This complete status includes whether each component is online, operational, and any issues detected, providing clear visibility into the system's current state.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/gradeScales-canRemoveGradeScaleRest.request.txt b/packages/leemons-openapi/lib/requests/gradeScales-canRemoveGradeScaleRest.request.txt new file mode 100644 index 0000000000..47e4d399ef --- /dev/null +++ b/packages/leemons-openapi/lib/requests/gradeScales-canRemoveGradeScaleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'canRemoveGradeScaleRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeScales.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeScales.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/canRemoveGradeScale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/conditionsInGradeScale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/gradeTagsInGradeScale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/gradesInGradeScale.js\n[object Object]", + "response": "{\"summary\":\"Determine if a grade scale can be safely removed\",\"description\":\"This endpoint checks if a specified grade scale can be removed from the system without disrupting any associated data. It evaluates dependencies such as conditions, tags, and grades linked to the grade scale to ensure no active references could lead to data integrity issues if the scale were deleted.\\n\\n**Authentication:** Users need to be authenticated to perform this check. Access without proper authentication will prevent the endpoint from executing.\\n\\n**Permissions:** Users must have administrative or specific grade management permissions to verify the removability of a grade scale.\\n\\nThe handler begins by calling the `canRemoveGradeScale` method within the `grade-scales` core module. This method checks associated records in other tables like conditions, tags, and grades that might be using the grade scale. It consolidates this information to determine whether the scale is currently in use or if it can be freely removed. If no dependencies are found, the method returns a positive response, allowing for the safe deletion of the grade scale. This information is then formatted into a JSON response indicating whether removing the grade scale is feasible or not.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/gradeScales-postGradeScaleRest.request.txt b/packages/leemons-openapi/lib/requests/gradeScales-postGradeScaleRest.request.txt new file mode 100644 index 0000000000..a5b2213556 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/gradeScales-postGradeScaleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postGradeScaleRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeScales.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeScales.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/addGradeScale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]", + "response": "{\"summary\":\"Add a new grade scale\",\"description\":\"This endpoint is responsible for adding a new grade scale to the system. It handles the creation of a scalable metric system that can be used for evaluating student performance within the platform. The function of this endpoint is to receive grade scale details and incorporate them into the system's existing educational framework.\\n\\n**Authentication:** Users must be authenticated to submit new grade scales. The system verifies the user's credentials and session tokens to ensure legitimacy before proceeding with the request.\\n\\n**Permissions:** Users need to have specific administrative rights typically reserved for educational staff or system administrators. The required permissions involve managing or altering grade scales, which is a critical aspect of the educational settings control.\\n\\nUpon receiving a request, the `postGradeScaleRest` handler first validates the incoming data using predefined validation schemas located in the `forms.js`. If validation passes, it proceeds to call the `addGradeScale` method from the `grade-scales` core module. This method takes the validated data and adds a new grade scale to the database, ensuring that all necessary attributes are duly processed and stored. The operation may involve transactional controls to guarantee data integrity before finally responding to the user with the outcome of the operation, either successful addition or error details.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/gradeScales-putGradeScaleRest.request.txt b/packages/leemons-openapi/lib/requests/gradeScales-putGradeScaleRest.request.txt new file mode 100644 index 0000000000..ffae0a8158 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/gradeScales-putGradeScaleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putGradeScaleRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeScales.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeScales.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/updateGradeScale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]", + "response": "{\"summary\":\"Update an existing grade scale\",\"description\":\"This endpoint updates a specific grade scale's details based on the provided scale ID. It is designed to modify attributes like name, range, and descriptions of an existing grade item, reflecting changes across the platform where the grade scale is applied.\\n\\n**Authentication:** Users need to be authenticated to execute this update operation. Access without proper authentication will restrict the user from performing the update.\\n\\n**Permissions:** The user must have administrative rights or sufficient permissions related to grade management to update a grade scale. Lack of such permissions will prevent the grade scale modifications.\\n\\nUpon receiving the update request, the endpoint first verifies the user's authentication and authorization. It then proceeds to invoke the `updateGradeScale` method from the `grade-scales` service. This method handles the business logic to update the grade scale's details in the database, ensuring data integrity and consistency. If the update is successful, the endpoint responds with the updated grade scale details; otherwise, it handles errors by returning an appropriate error response indicating what went wrong during the update process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/gradeScales-removeGradeScaleRest.request.txt b/packages/leemons-openapi/lib/requests/gradeScales-removeGradeScaleRest.request.txt new file mode 100644 index 0000000000..59229b5e74 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/gradeScales-removeGradeScaleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeGradeScaleRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeScales.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeScales.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/removeGradeScale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/canRemoveGradeScale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/conditionsInGradeScale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/gradeTagsInGradeScale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/gradesInGradeScale.js\n[object Object]", + "response": "{\"summary\":\"Remove a specified grade scale\",\"description\":\"This endpoint allows for the deletion of a specific grade scale from the system, based on the provided grade scale identifier. It ensures that all related dependencies, such as conditions, tags, and actual grades associated with the grade scale, are appropriately handled before deletion to maintain data integrity.\\n\\n**Authentication:** Users must be authenticated to perform this operation. The system will deny access if the user's credentials are not verified.\\n\\n**Permissions:** Users need to have adequate permissions typically related to administrative rights on grade scale management to execute the removal of a grade scale.\\n\\nUpon receiving a request, the `removeGradeScaleRest` handler first invokes the `canRemoveGradeScale` method to check any related conditions, tags or grades that could be affected by removing the grade scale. If the necessary conditions are met, the `removeGradeScale` method from the `GradeScales` core module is triggered to delete the grade scale from the database. The process includes validating user permissions and ensuring all related entities that might be impacted are accounted for or notified about the removal. The response confirms the successful deletion or reports an error if the operation cannot be performed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/gradeTags-postGradeTagRest.request.txt b/packages/leemons-openapi/lib/requests/gradeTags-postGradeTagRest.request.txt new file mode 100644 index 0000000000..96128eeb8a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/gradeTags-postGradeTagRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postGradeTagRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeTags.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeTags.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/addGradeTag.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/getGradeTagsByIds.js\n[object Object]", + "response": "{\"summary\":\"Add a new grade tag\",\"description\":\"This endpoint allows for the creation of a new grade tag within the system, enabling categorization or tagging of grades based on predefined criteria.\\n\\n**Authentication:** User must be authenticated to create a new grade tag. Any API call without a valid authentication token will be rejected.\\n\\n**Permissions:** Users need to have 'manage_grade_tags' permission to execute this action. Without sufficient permissions, the request will be denied.\\n\\nUpon receiving a POST request at this endpoint, the `addGradeTag` function within the 'grade-tags' core module is invoked. This function is responsible for processing input parameters which define the properties of the grade tag (e.g., tag name, description, associated curriculum). It performs validation to ensure all required fields are present and correctly formatted. Following successful validation, the function attempts to create a new tag in the database. If the creation is successful, a confirmation message or the newly created tag's details are sent back to the client in the response. If there is an error during the creation process (such as duplicate tag names or database issues), an appropriate error message is relayed back to the client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/gradeTags-putGradeTagRest.request.txt b/packages/leemons-openapi/lib/requests/gradeTags-putGradeTagRest.request.txt new file mode 100644 index 0000000000..6a1e748c37 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/gradeTags-putGradeTagRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putGradeTagRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeTags.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeTags.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/updateGradeTag.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/getGradeTagsByIds.js\n[object Object]", + "response": "{\"summary\":\"Update grade tag details\",\"description\":\"This endpoint updates the information for an existing grade tag based on the given identifier. It modifies existing data such as the tag name, associated color, and potentially other metadata specific to the grade system.\\n\\n**Authentication:** Users need to be authenticated to perform an update on grade tags. Without valid authentication credentials, the request will be rejected.\\n\\n**Permissions:** This function requires administrative privileges or specific permissions related to grade management. Users without adequate permissions will receive an access denied response.\\n\\nThe function flow begins with the extraction of the grade tag ID and updates data from the request body. It then calls the `updateGradeTag` method from the `grade-tags` service with the extracted data. This method is responsible for validating the data against existing schemas and applying the updates to the database. Upon successful update, a confirmation is sent back to the client detailing the updated fields. In case of any errors during the update process, appropriate error messages are returned to the client, highlighting the issues encountered.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/gradeTags-removeGradeTagRest.request.txt b/packages/leemons-openapi/lib/requests/gradeTags-removeGradeTagRest.request.txt new file mode 100644 index 0000000000..8312f1f0a2 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/gradeTags-removeGradeTagRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeGradeTagRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeTags.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/gradeTags.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/removeGradeTag.js\n[object Object]", + "response": "{\"summary\":\"Removes a specified grade tag\",\"description\":\"This endpoint allows for the deletion of a grade tag from the system, based on the provided tag identifier. The process ensures the removal is handled safely and records are adjusted accordingly to maintain data integrity.\\n\\n**Authentication:** Users need to be authenticated to perform this action. Actions performed by unauthenticated users will be rejected and they will be prompted to log in.\\n\\n**Permissions:** The user must have administrative rights or specific permissions related to grade management in order to delete a grade tag. Unauthorized access will result in a permission denial response.\\n\\nThe `removeGradeTag` function is called within this endpoint, which initially validates the presence of the tag ID in the request. It then consults the `GradeTags` core to ensure the tag exists and is eligible for deletion. The core logic includes verifications to prevent the deletion if the tag is currently in use in any grade assessments or configurations, thereby preserving the integrity of related records. Once all conditions are met, the tag is removed from the records, and a success response is sent back to the user, confirming the deletion.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/grades-getGradeRest.request.txt b/packages/leemons-openapi/lib/requests/grades-getGradeRest.request.txt new file mode 100644 index 0000000000..deff7594ea --- /dev/null +++ b/packages/leemons-openapi/lib/requests/grades-getGradeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getGradeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/gradeByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/getGradeScalesByGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/getGradeTagsByGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/getGradeTagsByIds.js\n[object Object]", + "response": "{\"summary\":\"Fetches detailed grade information for specified IDs\",\"description\":\"This endpoint is designed to retrieve comprehensive grade details based on the provided grade IDs. The retrieved information includes but is not limited to the grade score, associated tags, and grading scale details.\\n\\n**Authentication:** Access to this endpoint requires the user to be logged in. Authentication ensures that grade information is securely accessed and protects the integrity of the data.\\n\\n**Permissions:** This endpoint requires that the user has permission to view the specific grades. Typically, this means that the user must either be the instructor for the course associated with the grades, an administrator, or the student to whom the grades belong.\\n\\nThe handler begins by receiving a list of grade IDs through the request parameters. It then calls the `gradeByIds` method in the `grades` core, which queries the database for the grade details corresponding to these IDs. Subsequently, it invokes the `getGradeScalesByGrade` and `getGradeTagsByGrade` from their respective modules to append additional contextual information about each grade. These operations amalgamate data from different sources to provide a thorough view of each grade's context and standing within an educational or training environment. The response then compiles and returns this data as a JSON object for the client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/grades-haveGradesRest.request.txt b/packages/leemons-openapi/lib/requests/grades-haveGradesRest.request.txt new file mode 100644 index 0000000000..416a119b96 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/grades-haveGradesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'haveGradesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/haveGrades.js\n[object Object]", + "response": "{\"summary\":\"Check grade availability for a user\",\"description\":\"This endpoint checks if grades are available for a specific user within the system. It determines the presence or absence of grades linked to the user’s profile, which can be useful for functions like displaying grade-related features or analytics on the user interface.\\n\\n**Authentication:** User authentication is essential for accessing this endpoint. The request must carry a valid authentication token, without which the request will be denied.\\n\\n**Permissions:** Specific permissions related to accessing or managing grades are required to consume this endpoint. Access without proper permissions will result in a denial of the request.\\n\\nUpon receiving a request, the `haveGrades` method in the backend core logic is invoked with pertinent user identifiers. This method interacts with the database to ascertain whether any grades are recorded against the user ID provided. The process involves querying the database and evaluating the existence of grade entries. If grades are present, the endpoint returns a positive acknowledgment, otherwise a negative one. The flow from request initiation to the response involves authenticating the user, verifying permissions, executing the query, and then formulating the appropriate response based on the query results.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/grades-listGradesRest.request.txt b/packages/leemons-openapi/lib/requests/grades-listGradesRest.request.txt new file mode 100644 index 0000000000..974b2e2124 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/grades-listGradesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listGradesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/listGrades.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/gradeByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/getGradeScalesByGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/getGradeTagsByGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/getGradeTagsByIds.js\n[object Object]", + "response": "{\"summary\":\"List all grades available in the system\",\"description\":\"This endpoint lists all grades currently available within the system. It allows the user to retrieve a comprehensive list of grade records, which include both active and archived grades.\\n\\n**Authentication:** Authentication is required to access this endpoint. Users need to provide a valid authentication token in their request headers to verify their identity.\\n\\n**Permissions:** Users need to have the 'view_grades' permission to access this endpoint. This ensures that only users with the appropriate role or permission settings can view the list of grades.\\n\\nUpon receiving a request, the `listGradesRest` handler calls the `listGrades` method from the Grades core module. This method queries the database to fetch all grade records, including details like grade name, associated tags, and scale. The response from the database is then formatted and returned as a JSON array, which includes all the pertinent details about each grade. The handler ensures that the response is structured properly and includes any necessary metadata before sending it back to the client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/grades-postGradeRest.request.txt b/packages/leemons-openapi/lib/requests/grades-postGradeRest.request.txt new file mode 100644 index 0000000000..66c20980a2 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/grades-postGradeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postGradeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/addGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/addGradeScale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/gradeByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/getGradeScalesByGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/getGradeTagsByGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/getGradeTagsByIds.js\n[object Object]", + "response": "{\"summary\":\"Add a new grade entry to the system\",\"description\":\"This endpoint allows for the creation of a new grade entry in the grading system. It is designed to receive grade details, validate them, and store them in the database accordingly.\\n\\n**Authentication:** User authentication is mandatory for accessing this endpoint. A valid user session or token is required to ensure that the request is authorized.\\n\\n**Permissions:** The user needs to have 'grade_add' permission to perform this action. Without the required permissions, the request will be rejected, and an error message will be returned.\\n\\nThe process begins with the 'postGradeRest' action that first validates the incoming request data against predefined schemas to ensure that all required fields are present and correctly formatted. Upon successful validation, the action then calls the 'addGrade' method from the 'grades' core module. This method takes responsibility for integrating the new grade data into the database. During this operation, it checks for any duplicate entries or conflicting data to maintain data integrity. Once the grade is successfully added to the database, a confirmation message is sent back to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/grades-putGradeRest.request.txt b/packages/leemons-openapi/lib/requests/grades-putGradeRest.request.txt new file mode 100644 index 0000000000..4b7c29085f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/grades-putGradeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putGradeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/updateGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/gradeByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/getGradeScalesByGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/getGradeTagsByGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/getGradeTagsByIds.js\n[object Object]", + "response": "{\"summary\":\"Updates a specific grade based on provided details\",\"description\":\"This endpoint allows for the updating of specific grade details within the system. It updates a grade entry based on the provided identifiers and new data values. This function typically handles changes in grade values, status, or associated metadata.\\n\\n**Authentication:** Users must be authenticated to update grade information. An invalid or missing authentication token will result in denied access to this endpoint.\\n\\n**Permissions:** The endpoint requires that the user has the appropriate rights to modify grade data, generally restricted to administrative or educational staff roles who manage grade records.\\n\\nUpon receiving the request, the handler first verifies user authentication and permissions. Assuming these checks pass, it proceeds to invoke the `updateGrade` method from the `grades` core. This method accepts the unique grade ID and the new data for the grade as parameters, interacting with the database to update the relevant grade entry. The operation's success or failure is communicated back to the client through a standard HTTP response, encapsulating either the updated grade data or an error message detailing why the operation could not be completed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/grades-removeGradeRest.request.txt b/packages/leemons-openapi/lib/requests/grades-removeGradeRest.request.txt new file mode 100644 index 0000000000..7565c10d65 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/grades-removeGradeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeGradeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grades/removeGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/rulesInGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-tags/removeGradeTagsByGrade.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/grade-scales/removeGradeScaleByGrade.js\n[object Object]", + "response": "{\"summary\":\"Remove a specific grade entry from the system\",\"description\":\"This endpoint is responsible for deleting a grade record by its unique identifier. The process ensures that all associated data, such as grade tags and grade scales, are also removed accordingly, ensuring data consistency across the platform.\\n\\n**Authentication:** Users must be authenticated to perform removal operations. This ensures that only authorized users can delete grade data.\\n\\n**Permissions:** The user must have the 'delete_grade' permission to execute this action. This permission check is crucial to prevent unauthorized data manipulation and maintain system security.\\n\\nUpon receiving a request to delete a grade, the endpoint first checks for the required permissions. If permissions are validated, it proceeds to invoke the `removeGrade` method from the `grades` core, which handles the deletion of the grade record from the database. Simultaneously, related data such as grade tags and scales are dealt with through respective removal methods: `removeGradeTagsByGrade` and `removeGradeScaleByGrade`. These methods ensure that all traces of the grade are completely eradicated from the database, maintaining the integrity and cleanliness of the data. The response to the client confirms the successful removal of the grade and associated data, marking the complete termination of the entry.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/groups-deleteGroupFromClassesUnderNodeTreeRest.request.txt b/packages/leemons-openapi/lib/requests/groups-deleteGroupFromClassesUnderNodeTreeRest.request.txt new file mode 100644 index 0000000000..3951d8efe8 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/groups-deleteGroupFromClassesUnderNodeTreeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteGroupFromClassesUnderNodeTreeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/removeGroupFromClassesUnderNodeTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramTreeTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getClassesUnderNodeTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTreeNodes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramKnowledges.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjectTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/getManagers.js\n[object Object]", + "response": "{\"summary\":\"Remove a group from classes under a specific node tree\",\"description\":\"This endpoint allows the removal of a specified group from all classes that fall under a given node tree in the academic portfolio system. It ensures that the group is disassociated from the appropriate classes to maintain up-to-date records.\\n\\n**Authentication:** Users must be authenticated to perform this removal operation. The server validates the user's credentials and session to confirm legitimacy before processing the request.\\n\\n**Permissions:** This operation requires the user to have administrative or specific management permissions related to academic portfolios. Without sufficient permissions, the request will be rejected.\\n\\nThe endpoint initiates by calling the `removeGroupFromClassesUnderNodeTree` method, which utilizes predefined logic in the academic portfolio's backend to identify all classes linked to a certain node tree. The method processes this identification in multiple steps including fetching relevant class details and subsequently removing the specified group from these classes. The action is handled through a series of database operations that ensure data integrity and consistency. On successful execution, the endpoint updates the system to reflect these changes, typically confirming the successful removal with a status response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/groups-duplicateGroupRest.request.txt b/packages/leemons-openapi/lib/requests/groups-duplicateGroupRest.request.txt new file mode 100644 index 0000000000..20a54937ba --- /dev/null +++ b/packages/leemons-openapi/lib/requests/groups-duplicateGroupRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'duplicateGroupRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/duplicateGroup.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramTreeTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/duplicateGroupWithClassesUnderNodeTreeByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getClassesUnderNodeTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTreeNodes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramKnowledges.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjectTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/getManagers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/duplicateClassesByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/processScheduleForClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClassStudentsMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClassStudents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]", + "response": "{\"summary\":\"Duplicate an academic group\",\"description\":\"This endpoint duplicates a specific academic group along with associated data within the academic portfolio system. The duplication process includes all pertinents details like group configurations, linked courses, and enrolments.\\n\\n**Authentication:** User authentication is necessary to ensure secure access to the duplication functionality. Without proper authentication, the request will be rejected.\\n\\n**Permissions:** Users must have 'group_management' permission to execute this operation. This allows only authorized personnel with the right privileges to perform duplications ensuring academic data integrity.\\n\\nUpon receiving a request, the `duplicateGroup` handler from the `group.rest.js` file is initiated. This handler first verifies user authentication and permissions. If the user is authenticated and has the necessary permissions, the handler then calls the `duplicateGroup` method from the `groups` core module. This method manages the duplication logic, which involves deep copying of the group's data and associated entities in the database. Once the duplication is successful, the response includes a confirmation with the details of the newly created duplicate group or an error message if the process fails.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/groups-duplicateGroupWithClassesUnderNodeTreeRest.request.txt b/packages/leemons-openapi/lib/requests/groups-duplicateGroupWithClassesUnderNodeTreeRest.request.txt new file mode 100644 index 0000000000..b107573e32 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/groups-duplicateGroupWithClassesUnderNodeTreeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'duplicateGroupWithClassesUnderNodeTreeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/duplicateGroupWithClassesUnderNodeTreeByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getClassesUnderNodeTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTreeNodes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramKnowledges.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjectTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/getManagers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/duplicateClassesByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/processScheduleForClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClassStudentsMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClassStudents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]", + "response": "{\"summary\":\"Duplicate a group along with its associated classes under a specific node tree\",\"description\":\"This endpoint duplicates a specified group along with its classes under a designated node tree within the academic portfolio system. The duplication process includes creating a complete copy of the group's structure, the associated classes, and any relational data linked under the specified node tree.\\n\\n**Authentication:** Users must be authenticated to initiate the duplication of groups and classes. A lack of authentication or an invalid token will prevent access to this endpoint.\\n\\n**Permissions:** The user must have the 'admin' role or specific duplication rights associated with their account to perform this task. Without sufficient permissions, the operation will be blocked with an access denied error.\\n\\nThe endpoint interacts with multiple backend services to accomplish the group and class duplication task. Initially, the process begins by validating user authentication and checking for necessary permissions in the context of the transaction. Upon successful validation, the `duplicateGroupWithClassesUnderNodeTreeByIds` function is invoked, which orchestrates the retrieval and duplication of the group and its classes based on the specified node IDs in the request. This involves deep copying of all related data structures and ensuring that relational integrity is maintained throughout the database. Finally, after the duplication process, the outcome is returned to the user, indicating success or providing error messages regarding any issues encountered during the operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/groups-listGroupRest.request.txt b/packages/leemons-openapi/lib/requests/groups-listGroupRest.request.txt new file mode 100644 index 0000000000..407471d50e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/groups-listGroupRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listGroupRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/listGroups.js\n[object Object]", + "response": "{\"summary\":\"Lists all academic groups\",\"description\":\"This endpoint lists all academic groups available within the platform. It retrieves a structured list of groups, including details such as group name, members, and associated curriculum.\\n\\n**Authentication:** User authentication is required to access this endpoint. Users need to provide a valid session token which will be verified before proceeding with the request.\\n\\n**Permissions:** Users must have the 'view_groups' permission to list all academic groups. Lack of this permission will result in a denial of access to this endpoint.\\n\\nThe process starts from the `listGroupRest` action in the 'group.rest.js' service file, which invokes the `listGroups` method located in `index.js` within the 'groups' core module. This method queries the database to gather all existing academic groups by applying relevant filters and permissions. It ensures the integrity and security of the data by filtering out groups based on the user's credentials and permissions provided within the session. The result is then formatted and returned back to the user in a JSON structure through the REST endpoint response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/groups-postGroupRest.request.txt b/packages/leemons-openapi/lib/requests/groups-postGroupRest.request.txt new file mode 100644 index 0000000000..d7758225a3 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/groups-postGroupRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postGroupRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/addGroup.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/getNextGroupIndex.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/addNextGroupIndex.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/saveManagers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/addKnowledgeArea.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/updateClassMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/updateClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/substages/existSubstageInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/setToAllClassesWithSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/removeByClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/existCourseInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/existGroupInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/group/isUsedInSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/processScheduleForClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/listKnowledgeAreas.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/updateKnowledgeArea.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/existKnowledgeInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/existsInCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/getKnowledgeAreaById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]", + "response": "{\"summary\":\"Adds a new academic group to the portfolio\",\"description\":\"This endpoint is responsible for adding a new group to the academic portfolio. It involves storing group-related information in the database, such as group name, associated program, and other metadata. The endpoint expects to receive the necessary data to create a new group which then is processed and stored.\\n\\n**Authentication:** Users must be logged in to interact with this endpoint. Without proper authentication, the request will not be processed.\\n\\n**Permissions:** This endpoint requires the user to have 'admin' privileges or specific role permissions that allow manipulation of academic group data.\\n\\nUpon receiving a request, the `addGroup` method in the `group.rest.js` file is called. This method further interacts with the `groups` core where the actual logic for adding a new group to the database is implemented. This includes generating a unique identifier for the group, validating the passed data against predefined schemas, and finally adding the group data to the database. Error handling mechanisms are also in place to manage any issues that may arise during data processing or database operations, ensuring the client receives appropriate feedback on the operation's outcome.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/groups-putGroupRest.request.txt b/packages/leemons-openapi/lib/requests/groups-putGroupRest.request.txt new file mode 100644 index 0000000000..6543eaf13f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/groups-putGroupRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putGroupRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/updateGroup.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/saveManagers.js\n[object Object]", + "response": "{\"summary\":\"Update an existing academic group\",\"description\":\"This endpoint updates the details of an existing academic group within the portfolio management system. The process includes modifying any group attributes such as name, description, and associated permissions or members based on provided data.\\n\\n**Authentication:** User must be authenticated to request an update to an academic group. Unauthenticated requests are rejected with an appropriate error message.\\n\\n**Permissions:** This endpoint requires the user to have 'group_edit' permission exclusively set for the targeted academic group. Absence of such permissions results in an authorization failure response.\\n\\nThe endpoint first validates the incoming data against the predefined validation rules set in 'forms.js' to ensure all required fields are included and correctly formatted. It then utilizes the 'updateGroup.js' method in the `groups` core module which performs the actual update operation on the database. Throughout the process, it engages various checks to confirm user permissions, group existence, and manage any relational constraints. The response is generated based on the success of the update operation, either confirming the updated group details or detailing any errors encountered during the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/i18n-getLangRest.request.txt b/packages/leemons-openapi/lib/requests/i18n-getLangRest.request.txt new file mode 100644 index 0000000000..e9b6777de2 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/i18n-getLangRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getLangRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/i18n.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/i18n.rest.js\n[object Object]", + "response": "{\"summary\":\"Retrieve available languages for the platform\",\"description\":\"This endpoint fetches all language settings currently available on the platform, providing a comprehensive list of all supported languages. This allows users or systems to understand what languages they can select for use in localizing the user interface or content.\\n\\n**Authentication:** User authentication is required to access this endpoint. Users must provide a valid session token that will be verified prior to allowing access to the language data.\\n\\n**Permissions:** Users need to have the 'view_languages' permission to retrieve the list of available languages. This ensures that only authorized personnel can view and potentially modify language settings.\\n\\nUpon receiving a request, the `getLangRest` handler calls the `getLanguages` method from the internationalization service. This method queries the database for all active languages marked as available in the system. The result set includes language codes, descriptions, and any relevant metadata associated with each language. After the data is retrieved, it's formatted into a JSON structure and returned in the response body to the requester. This endpoint ensures data consistency and secured access to language information within the platform.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/init-todayQuoteRest.request.txt b/packages/leemons-openapi/lib/requests/init-todayQuoteRest.request.txt new file mode 100644 index 0000000000..d329764345 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/init-todayQuoteRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'todayQuoteRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/init.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/init.rest.js\n[object Object]", + "response": "{\"summary\":\"Provides the quote of the day for the user\",\"description\":\"This endpoint serves the purpose of offering a motivational or inspirational 'Quote of the Day' to the user. These quotes may vary daily and can be specific to user's interests if set in the user's profile preferences.\\n\\n**Authentication:** User authentication is required to access this feature. Unauthorized access attempts will be blocked and logged for security reasons.\\n\\n**Permissions:** Users must have the 'read_quotes' permission enabled in their account settings to view the daily quote. Without this permission, access to the daily quote will not be granted.\\n\\nUpon receiving a request at this endpoint, the backend service first verifies the user's credentials and checks for the necessary permissions ('read_quotes'). If the authentication and permissions validation are successful, the service then proceeds to fetch the 'Quote of the Day' from a dedicated quotes management module integrated within the system. This module selects a quote based on the date and optionally the user's personal preferences stored in the user profile. The response, containing the quote, is then formulated in JSON format and sent back to the client, ensuring that each interaction is tailored and secure.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/knowledges-deleteSubjectTypeRest.request.txt b/packages/leemons-openapi/lib/requests/knowledges-deleteSubjectTypeRest.request.txt new file mode 100644 index 0000000000..68f09c0741 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/knowledges-deleteSubjectTypeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteSubjectTypeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/knowledge.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/knowledge.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/removeKnowledgeArea.js\n[object Object]", + "response": "{\"summary\":\"Deletes a specific knowledge area\",\"description\":\"This endpoint is responsible for the deletion of a specific knowledge area from the academic portfolio system. It effectively removes the entry from the database that matches the provided knowledge area identifier.\\n\\n**Authentication:** User authentication is required to access this endpoint, ensuring that only authenticated users can initiate deletion processes.\\n\\n**Permissions:** The user must have administrative rights or the specific permission to alter knowledge area data. This ensures that only authorized personnel can delete knowledge areas from the system.\\n\\nUpon receiving a request, the endpoint first verifies the authenticity of the user and checks if the user has the necessary permissions to proceed. It then invokes the `removeKnowledgeArea` core method, passing the identifier of the knowledge area to be deleted. This method interacts with the database to locate and remove the specified knowledge area. If the operation is successful, it returns a confirmation response to the user indicating that the knowledge area has been successfully deleted. Any issues during the process, such as database errors or permission denials, are handled appropriately and communicated back to the user through the response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/knowledges-listKnowledgeRest.request.txt b/packages/leemons-openapi/lib/requests/knowledges-listKnowledgeRest.request.txt new file mode 100644 index 0000000000..e7f3a6cc62 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/knowledges-listKnowledgeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listKnowledgeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/knowledge.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/knowledge.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/listKnowledgeAreas.js\n[object Object]", + "response": "{\"summary\":\"List available knowledge areas within the academic portfolio\",\"description\":\"This endpoint lists all available knowledge areas defined in the academic portfolio system. It is intended to provide an overview of all educational or research domains categorized within the platform.\\n\\n**Authentication:** Users must be authenticated to retrieve knowledge areas. Access without proper authorization will be denied, ensuring that only authorized personnel can obtain this information.\\n\\n**Permissions:** The user needs to have 'view_knowledge_areas' permission to access this data. If the user lacks the necessary permissions, the request will be rejected, ensuring compliance with the system's security protocols.\\n\\nUpon receiving a request, this endpoint calls the `listKnowledgeAreas()` method from the underlying knowledge management service. This method queries the database for all entries labeled as knowledge areas and compiles them into a structured list. This comprehensive processing involves checking the user's permissions, ensuring they have the rights to view the information. The data then is returned as a JSON array filled with knowledge areas, categorized and ready for further frontend use or application integration.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/knowledges-postKnowledgeRest.request.txt b/packages/leemons-openapi/lib/requests/knowledges-postKnowledgeRest.request.txt new file mode 100644 index 0000000000..75ef622bf3 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/knowledges-postKnowledgeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postKnowledgeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/knowledge.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/knowledge.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/addKnowledgeArea.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/saveManagers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/updateClassMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/updateClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/substages/existSubstageInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/setToAllClassesWithSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/removeByClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/existCourseInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/existGroupInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/group/isUsedInSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/processScheduleForClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]", + "response": "{\"summary\":\"Adds a new knowledge area to the academic portfolio\",\"description\":\"This endpoint allows for the addition of a new knowledge area into the system's academic portfolio. The action facilitates the creation and organization of knowledge areas as part of educational or institutional structuring.\\n\\n**Authentication:** Users must be authenticated to create a new knowledge area. The system requires valid authentication credentials for accessing this endpoint.\\n\\n**Permissions:** The user needs specific permissions related to managing academic content. The required permission is typically 'manage_academic_knowledge_areas' or a similar scope that authorizes the user to add and modify educational structures.\\n\\nThe process initiated by this endpoint involves the `addKnowledgeArea` function from the `knowledges` core module. Upon receiving the request, the method processes the input data, typically consisting of the knowledge area's name and description, and then inserts it into the database. This operation involves validating the input against predefined schemas to ensure compliance with data standards. After successful insertion, a confirmation is sent back to the user, providing feedback on the operation's success and the details of the newly added knowledge area.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/knowledges-putKnowledgeRest.request.txt b/packages/leemons-openapi/lib/requests/knowledges-putKnowledgeRest.request.txt new file mode 100644 index 0000000000..68b2ec051b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/knowledges-putKnowledgeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putKnowledgeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/knowledge.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/knowledge.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/knowledges/updateKnowledgeArea.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/saveManagers.js\n[object Object]", + "response": "{\"summary\":\"Updates the specified knowledge area\",\"description\":\"This endpoint updates an existing knowledge area within the academic portfolio system. It is used to modify specific details about a knowledge area, such as its title or description, ensuring that the academic portfolio remains current and accurate.\\n\\n**Authentication:** User authentication is required to access this endpoint. An authenticated session must be established, and valid credentials must be provided in the request.\\n\\n**Permissions:** This endpoint requires administrative permissions related to academic portfolio management. Users must have permissions to update knowledge areas to execute this operation successfully.\\n\\nUpon receiving a request, the endpoint initially verifies user credentials and permissions to ensure legitimacy and authority over the requested operations. It then proceeds to call the `updateKnowledgeArea` method located in the 'knowledges' core module. This method handles the business logic necessary to securely update details of the knowledge area in the database. The workflow includes validation of the incoming data against predefined schemas, checking for existing knowledge area records, and applying updates where applicable. Finally, the response confirms the successful update of the knowledge area, returning details about the updated entity or an error message if the update fails.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/locales-addRest.request.txt b/packages/leemons-openapi/lib/requests/locales-addRest.request.txt new file mode 100644 index 0000000000..aa37290d54 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/locales-addRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/services/rest/locales.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/services/rest/locales.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/create.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/validations/locale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/has.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/read.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/delete.js\n[object Object]", + "response": "{\"summary\":\"Manage multilingual locale settings\",\"description\":\"This endpoint is responsible for managing locale settings within a multilingual plugin environment. It handles the creation, reading, updating, and deletion of locale configurations, which are essential for supporting multiple languages across the plugin's functionalities.\\n\\n**Authentication:** Users need to be authenticated to interact with the locale settings. Depending on the platform configuration, this might require session tokens or other forms of identity verification to proceed.\\n\\n**Permissions:** Proper permissions are required to access or modify the locale settings. Typically, users need administrative privileges or must be part of a specific group that has rights to manage language settings and configurations.\\n\\nThe controller handles requests by determining the needed action (create, read, update, delete) based on the API endpoint accessed and the request method. It utilizes specific methods from the 'locale' core module like `create`, `read`, `update`, and `delete`, each tailored to operate with language and regional settings in a database. The input validation is ensured by the 'locale.js' validations file, which checks correctness before processing any data. The endpoint flows involve error handling to manage and respond to any issues during operations, ensuring that feedback regarding the execution is clear and concise. When successful, the endpoint returns a JSON object representing the status and any data relevant to the performed action.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/locales-listRest.request.txt b/packages/leemons-openapi/lib/requests/locales-listRest.request.txt new file mode 100644 index 0000000000..5a0f3e22e2 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/locales-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/services/rest/locales.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/services/rest/locales.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/create.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/validations/locale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/has.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/read.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-multilanguage/backend/core/locale/delete.js\n[object Object]", + "response": "{\"summary\":\"Lists all available locales for multilingual content management\",\"description\":\"This endpoint provides a comprehensive list of all locales supported in the multilingual content management system. It enables clients to retrieve a full array of locale identifiers which are necessary for managing translations and localizations within the platform.\\n\\n**Authentication:** Users need to be authenticated to access this list. The endpoint ensures that only authorized users can access language settings, maintaining a secure environment for managing sensitive locale data.\\n\\n**Permissions:** Users must possess 'view_locales' permission to access this endpoint. This requirement ensures that only users with adequate privileges can view and manage locales, aligning with the system's security protocols for sensitive data access.\\n\\nUpon receiving a request, the `listRest` handler initiates the process by invoking the `listLocales` method in the core locale management module. This method queries the system's internal database to fetch all active locales. The retrieved data is then formatted appropriately before being sent back to the client. The response includes a structured list of locale identifiers, each associated with its specific language and regional details, formatted as a JSON array. The completion of this method concludes the request-response cycle for this specific endpoint.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/mail-getPlatformEmailRest.request.txt b/packages/leemons-openapi/lib/requests/mail-getPlatformEmailRest.request.txt new file mode 100644 index 0000000000..9409bca1f4 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/mail-getPlatformEmailRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getPlatformEmailRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/mail.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/mail.rest.js\n[object Object]", + "response": "{\"summary\":\"Manage platform email settings\",\"description\":\"This endpoint manages the configuration and settings for the platform email system. It allows administrators to update how emails are handled, sent, and configured within the system.\\n\\n**Authentication:** Access to this endpoint requires the user to be authenticated. Only logged-in users with valid session tokens can proceed with requests to modify email settings.\\n\\n**Permissions:** This endpoint requires administrator-level permissions. Users need to have the 'admin-email-settings' permission to execute changes or updates to the email configurations.\\n\\nThe flow of the controller begins by verifying user authentication and permissions, ensuring that only authorized users can make changes to the email settings. Once authenticated and authorized, the `updateEmailConfig` method is called, which handles the logic for updating the email settings in the database. It takes inputs such as SMTP server details, port, and email formats, among others, and updates the existing configuration record. The method ensures that all inputs are valid and that changes are saved correctly, providing an appropriate response to indicate success or failure of the operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/mail-getProvidersRest.request.txt b/packages/leemons-openapi/lib/requests/mail-getProvidersRest.request.txt new file mode 100644 index 0000000000..f4210c71e3 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/mail-getProvidersRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getProvidersRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/mail.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/mail.rest.js\n[object Object]", + "response": "{\"summary\":\"Lists all available mail service providers\",\"description\":\"This endpoint fetches and lists all the mail service providers configured in the system. It allows the user to view various third-party providers that can be integrated for sending emails from the platform.\\n\\n**Authentication:** Users need to be authenticated to access this endpoint to ensure that only authorized users can view the available mail service providers.\\n\\n**Permissions:** Users must have the 'admin' role or specific permission to view mail service providers. Unauthorized access attempts will be logged and denied.\\n\\nThe function begins by validating user authentication and permissions. Once validated, the handler invokes a service method to retrieve all configured mail service providers from the system's configuration. This method checks the internal service registry for available providers, gathers their details (like provider name, configuration settings, and status), and then returns them in a structured list. This list is finally sent back to the client as a JSON response, providing a clear and concise overview of the mail service options available for use within the platform.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/mail-savePlatformEmailRest.request.txt b/packages/leemons-openapi/lib/requests/mail-savePlatformEmailRest.request.txt new file mode 100644 index 0000000000..9f83e2ce09 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/mail-savePlatformEmailRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'savePlatformEmailRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/mail.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/mail.rest.js\n[object Object]", + "response": "{\"summary\":\"Save platform-specific email configuration\",\"description\":\"This endpoint saves or updates the email configuration specific to a platform. It handles the creation or modification of settings such as SMTP server details, port, and authentication methods used for sending emails from the platform.\\n\\n**Authentication:** User authentication is required to access this endpoint. Unauthorized access is prevented, and a valid user session must be established.\\n\\n**Permissions:** This endpoint requires administrative permissions. Only users with administrative rights can modify email settings.\\n\\nUpon receiving a request, the `savePlatformEmailRest` handler first validates the provided data against predefined schemas to ensure they meet the platform's requirements for email configurations. If the validation passes, it proceeds to either update the existing email settings or create new ones if they do not already exist. This involves interacting with the platform's underlying database to store these configurations securely. Finally, a response is generated and sent back to the client indicating the success or failure of the operation, along with any relevant error messages if applicable.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/menu-addCustomForUserRest.request.txt b/packages/leemons-openapi/lib/requests/menu-addCustomForUserRest.request.txt new file mode 100644 index 0000000000..ea74985a69 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/menu-addCustomForUserRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addCustomForUserRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/validations/menu-item.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/core/menu-item/index.js\n[object Object]", + "response": "{\"summary\":\"Adds a custom menu item for a specific user\",\"description\":\"This endpoint allows for the addition of a custom menu item specifically tailored for a user. The process involves creating a unique menu item that does not typically appear in the standard menu configurations.\\n\\n**Authentication:** User authentication is mandatory for this endpoint. Users must provide valid credentials to perform this operation, ensuring that only authorized users can add custom menu items.\\n\\n**Permissions:** The user must have the 'manage_custom_menus' permission. This permission check ensures that only users with sufficient privileges can modify or add to the menu tailored to user-specific needs.\\n\\nThe handler initiates by validating the incoming data against a pre-defined schema to ensure all required fields are present and valid. Post-validation, the `addCustomMenuItemForUser` method from the `MenuService` is invoked with parameters including the user's ID and detailed menu item data. This method handles the logic of integrating the new item into the user's existing menu structure, while also checking for any potential conflicts or duplication issues. Once successfully added, the service returns confirmation of the addition, which is then relayed back to the user through the endpoint's response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/menu-getIfHasPermissionRest.request.txt b/packages/leemons-openapi/lib/requests/menu-getIfHasPermissionRest.request.txt new file mode 100644 index 0000000000..48fc12dd20 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/menu-getIfHasPermissionRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getIfHasPermissionRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/core/menu/index.js\n[object Object]", + "response": "{\"summary\":\"Checks and retrieves menu details based on user permissions\",\"description\":\"This endpoint validates user permissions and retrieves specific menu information if the user has the required access rights. This ensures that menu data is securely distributed among users with valid permissions.\\n\\n**Authentication:** The user must be authenticated to access this endpoint. It ensures that only recognized users can perform actions or retrieve information.\\n\\n**Permissions:** The user needs specific permissions related to menu access. Without the necessary permissions, the request will be denied, maintaining strict access control.\\n\\nUpon receiving a request, the `getIfHasPermissionRest` handler in the menu builder plugin first authenticates the user, ensuring that they are logged in and their session is valid. It then checks if the user has the required permissions to view or manage the requested menu. This involves querying a permissions database to verify user rights. If the user has the appropriate permissions, the handler proceeds to retrieve the menu data from the core menu system, leveraging methods defined in '/backend/core/menu/index.js'. The flow involves conditional checks and database interactions to fetch and return the relevant menu information. The final output is formatted and returned as a JSON response containing the menu details, adhering to the requested data structure.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/menu-getIfKnowHowToUseRest.request.txt b/packages/leemons-openapi/lib/requests/menu-getIfKnowHowToUseRest.request.txt new file mode 100644 index 0000000000..a74d98d630 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/menu-getIfKnowHowToUseRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getIfKnowHowToUseRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js\n[object Object]", + "response": "{\"summary\":\"Validate user's understanding of REST fundamental concepts\",\"description\":\"This endpoint assesses whether the user has adequate knowledge of RESTful concepts and principles. It serves as a preliminary check to advance users to more complex interactions within the application.\\n\\n**Authentication:** Users need to authenticate before attempting this validation. Unauthenticated requests are automatically rejected.\\n\\n**Permissions:** This endpoint requires the user to have basic user access. Specific roles or privileges are not required beyond standard user access rights.\\n\\nUpon invocation, this handler initializes by checking the user's session state to validate successful authentication. It then retrieves the user's profile data to ascertain their role and current status within the application. The process involves verifying if the user has previously passed any basic REST knowledge checks. This is conducted via a query to the user database or a relevant cache. Subsequent to this validation, the endpoint responds with a success or failure message delineating the user's competency in REST principles. If successful, the user may be redirected or granted access to make more complex RESTful requests within the system.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/menu-reOrderCustomUserItemsRest.request.txt b/packages/leemons-openapi/lib/requests/menu-reOrderCustomUserItemsRest.request.txt new file mode 100644 index 0000000000..876b3de5b4 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/menu-reOrderCustomUserItemsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'reOrderCustomUserItemsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/validations/menu-item.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/core/menu-item/index.js\n[object Object]", + "response": "{\"summary\":\"Reorders the menu items for a custom user\",\"description\":\"This endpoint facilitates the reordering of menu items specifically customized for a user, based on their unique preferences or permissions. The operation adjusts the order of menu items in a list format, ensuring the display order aligns with user- or administrator-defined preferences.\\n\\n**Authentication:** Users need to be authenticated to modify the order of menu items. Access to this endpoint requires a valid session or authentication token.\\n\\n**Permissions:** Users must have specific role permissions that allow them to rearrange menu items. Typically, this would include administrators or users with role-based access control rights specific to menu configuration.\\n\\nThe endpoint initiates by processing the passed order configuration, which includes identifying menu items and their new positions as defined in the request. It invokes the `updateOrder` method from the `MenuItemService`, which handles the reordering logic, interfacing directly with the database to update menu item positions accordingly. This process ensures that the new order is accurately reflected in subsequent menu displays, offering a tailored user interface experience. The response confirms the successful reordering of the menu items.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/menu-removeCustomForUserRest.request.txt b/packages/leemons-openapi/lib/requests/menu-removeCustomForUserRest.request.txt new file mode 100644 index 0000000000..63d352a1b9 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/menu-removeCustomForUserRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeCustomForUserRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/validations/menu-item.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/core/menu-item/index.js\n[object Object]", + "response": "{\"summary\":\"Remove custom menu settings for a specific user\",\"description\":\"This endpoint removes custom menu settings applied to a specific user, effectively resetting their menu experience to the default settings configured by the system.\\n\\n**Authentication:** The user needs to be logged-in to perform this operation. If the user's session is not active or the authentication token is missing, the request will be denied.\\n\\n**Permissions:** This operation requires administrative permissions related to menu configuration management. The user must have the 'menu.customize' permission to execute this action.\\n\\nThe flow of this operation begins with the 'removeCustomForUserRest' method in the 'menu.rest.js' service file. Once invoked, this method first checks for user authentication and permissions. If these checks pass, the method then calls the underlying business logic in the 'menu-item' core module, specifically targeting the remove customization functionality. It manipulates data related to user-specific menu items in the database, ensuring any custom settings are removed. On successful operation, a response indicating successful removal is sent back to the user; otherwise, an error message is generated detailing the failure reason.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/menu-setKnowHowToUseRest.request.txt b/packages/leemons-openapi/lib/requests/menu-setKnowHowToUseRest.request.txt new file mode 100644 index 0000000000..8ad6a47c04 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/menu-setKnowHowToUseRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setKnowHowToUseRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js\n[object Object]", + "response": "{\"summary\":\"Set user's understanding on using REST APIs\",\"description\":\"This endpoint ensures that a specific user has authenticated and acknowledged an understanding of how to utilize REST APIs effectively within the system. It updates user settings or preferences related to API usage.\\n\\n**Authentication:** This action requires the user to be logged in. A verification process checks if the incoming request has a valid authentication token associated with an active user session.\\n\\n**Permissions:** The user must have the 'api_usage_write' permission to update their REST API usage preferences. Without this permission, the request will be denied, ensuring that only authorized users can make such changes.\\n\\nThe handler initiates by verifying the user's authentication status using a security middleware that inspects the provided authentication token. Upon successful authentication, the handler then checks if the user possesses the necessary permissions. If all checks are positive, the method `setKnowHowToUseRest` from the 'MenuBuilderService' is called with user-specific parameters. This method updates the user's profile or settings indicating their proficiency or preferences in API usage. The response to this operation confirms the successful update of settings, providing a feedback mechanism to the frontend on the status of the operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/menu-updateCustomForUserRest.request.txt b/packages/leemons-openapi/lib/requests/menu-updateCustomForUserRest.request.txt new file mode 100644 index 0000000000..9012b92d45 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/menu-updateCustomForUserRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateCustomForUserRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/validations/menu-item.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-menu-builder/backend/core/menu-item/index.js\n[object Object]", + "response": "{\"summary\":\"Update custom settings for a user menu\",\"description\":\"This endpoint allows the modification of custom menu configurations for a specific user, ensuring the user's menu reflects any personalized changes such as order or visibility of menu items.\\n\\n**Authentication:** Users need to be authenticated to modify their menu settings. Without proper authentication, the request will not be processed.\\n\\n**Permissions:** This action requires the user to have permissions to alter their own menu settings. Typically, this might involve checking if the user has 'manage_menus' or equivalent permission within the system.\\n\\nUpon receiving a request, the 'updateCustomForUserRest' handler first validates the incoming data against the schema defined in 'menu-item.js'. It ensures all provided menu item adjustments adhere to the expected formats and values. If validation passes, it proceeds by invoking the `updateCustomForUser` method from the 'menu-item' core module. This method is responsible for applying the changes to the database, reflecting the custom user preferences for menu structure. The completion of this database update results in the final response, informing the client about the success or failure of the operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/messages-addClickRest.request.txt b/packages/leemons-openapi/lib/requests/messages-addClickRest.request.txt new file mode 100644 index 0000000000..e6683d2502 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/messages-addClickRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addClickRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/addClick.js\n[object Object]", + "response": "{\"summary\":\"Logs a new view or interaction with a specific message\",\"description\":\"This endpoint tracks user interactions with a message by logging each click or view event. It is designed to help in analyzing how messages are interacted with by users, allowing for improved message engagement and content refinements over time.\\n\\n**Authentication:** Users need to be logged in to log interactions with messages. This ensures that each interaction can be attributed to a specific user, enhancing the accuracy of the interaction data.\\n\\n**Permissions:** Users must have 'view' permissions on the board where the message is posted to interact with messages. If a user does not possess the required permissions, their interaction will not be logged, and they will receive an unauthorized access error.\\n\\nUpon receiving a request, the 'addClickRest' handler invokes the `addClick` method from the `messages` core module. This method takes parameters identifying the message and the user who interacted with it. It records each interaction as a click or view event in the database, tagging it with the user's ID and timestamp. The process ensures that all interactions are accurately logged and available for reporting and analytics. The response from this method confirms the successful logging of the interaction, returning a success status to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/messages-addViewRest.request.txt b/packages/leemons-openapi/lib/requests/messages-addViewRest.request.txt new file mode 100644 index 0000000000..157df6b2ac --- /dev/null +++ b/packages/leemons-openapi/lib/requests/messages-addViewRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addViewRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/addView.js\n[object Object]", + "response": "{\"summary\":\"Increment view count for a specific message\",\"description\":\"This endpoint increments the view count of a specific message on the board. The operation counts each view from users to provide insights into the popularity and engagement level of the message.\\n\\n**Authentication:** User authentication is required to track the views adequately and ensure that views are counted accurately for each user. A valid user session is necessary to perform this operation.\\n\\n**Permissions:** Users need to have 'read' permission for the specific message to increment its view count. Attempting to access the endpoint without appropriate permissions will result in access denial.\\n\\nInitially, the endpoint validates the user's authentication status and checks if the user has 'read' permission for the message in question. Upon successful validation, it calls the `addView` method from the `Messages` core, passing the message's unique identifier. This method updates the view count in the database. The flow ensures that each view is logged only once per user session, using session management techniques to prevent duplicate counts. The updated view count data is then committed to the database, ensuring consistency and accuracy throughout the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/messages-getActiveRest.request.txt b/packages/leemons-openapi/lib/requests/messages-getActiveRest.request.txt new file mode 100644 index 0000000000..76373aba02 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/messages-getActiveRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getActiveRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/getActive.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/getMessageIdsByFilters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/byIds.js\n[object Object]", + "response": "{\"summary\":\"Fetch active board messages for the current user\",\"description\":\"This endpoint fetches all active messages from the message board that are available or relevant to the current user. The endpoint is designed to provide users with ongoing communications and announcements that are active within the platform's ecosystem.\\n\\n**Authentication:** User authentication is required to ensure secure access to the messages relevant to the authenticated users only. Access is denied if authentication credentials are not provided or are invalid.\\n\\n**Permissions:** Specific permissions related to the viewing of board messages are required. Users need the appropriate rights to access different types of messages depending on their roles or group assignments within the platform.\\n\\nUpon receiving a request, the `getActive` method in the `messages` backend core is initiated. This method conducts a filtered query through the messages database to retrieve messages that are marked as 'active' and applicable to the user based on their profile and permissions. It processes these data points through various permissions checks and filters to ascertain that each returned message adheres to the security and relevance standards set by the platform. The final output is a list of message IDs, which is then passed to another method (`byIds`) to fetch the full details of each active message. The response from the endpoint will include these detailed messages formatted as JSON.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/messages-getOverlapsRest.request.txt b/packages/leemons-openapi/lib/requests/messages-getOverlapsRest.request.txt new file mode 100644 index 0000000000..47ed988221 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/messages-getOverlapsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getOverlapsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/getOverlapsWithOtherConfigurations.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/getMessageIdsByFilters.js\n[object Object]", + "response": "{\"summary\":\"Identify overlapping board message configurations\",\"description\":\"This endpoint checks for overlapping configurations in board messages. It is primarily used to prevent the scheduling of messages that may conflict with existing board configurations, ensuring clear and non-overlapping communication channels across various boards.\\n\\n**Authentication:** Users need to be authenticated to access this functionality. Authentication verifies user identity and ensures that actions performed are attributed to a specific and authorized user.\\n\\n**Permissions:** Appropriate permissions are required to access this endpoint. Users must have administrative or appropriate roles that grant them access to configure or manage board messages and their underlying settings.\\n\\nThe endpoint initiates by calling the `getOverlapsWithOtherConfigurations` method from the `messages` module. This method attempts to analyze the incoming configuration against the database records of other configurations to identify any overlaps. It sorts these configurations based on pre-established criteria to prioritize newer timestamps or critical configurations. After processing, the method returns detailed information about any overlaps found, which includes data such as timestamps, affected message IDs, and the specifics of the overlap. This data is then passed back through the response payload in JSON format, providing comprehensive insights to the requester about any potential conflicts in board message scheduling.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/messages-listRest.request.txt b/packages/leemons-openapi/lib/requests/messages-listRest.request.txt new file mode 100644 index 0000000000..1a8b416e51 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/messages-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/getMessageIdsByFilters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/byIds.js\n[object Object]", + "response": "{\"summary\":\"List all board messages accessible to the current user\",\"description\":\"This endpoint enables the retrieval of all board messages that the current user has permissions to access. It is designed to facilitate communication within groups or boards by displaying relevant messages.\\n\\n**Authentication:** Users need to be authenticated to view the messages. This ensures that only authorized users can access sensitive or private communications within their groups or boards.\\n\\n**Permissions:** The user must have the appropriate permissions to view messages in specific boards. Access will be denied if the user does not have the necessary rights to the board or group messages they are attempting to access.\\n\\nUpon receiving a request, the endpoint initially calls the `list` method from the `messages` core, which invokes the `getMessageIdsByFilters` method to filter message IDs based on user permissions and other applied filters. Subsequently, `byIds` aggregates these IDs to retrieve detailed message data. The flow completes with the assembly of all relevant message information into a consumable format for the client, effectively responding with a structured list of messages available to the user under the established permissions.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/messages-saveRest.request.txt b/packages/leemons-openapi/lib/requests/messages-saveRest.request.txt new file mode 100644 index 0000000000..de62af88c3 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/messages-saveRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/save.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/getOverlapsWithOtherConfigurations.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/getMessageIdsByFilters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/calculeStatusFromDates.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-board-messages/backend/core/messages/byIds.js\n[object Object]", + "response": "{\"summary\":\"Save new or update existing board messages\",\"description\":\"This endpoint handles the creation or updates of board messages within the platform. It provides a mechanism for administrators or authorized users to post messages, which may contain announcements, updates, or prompts to board members.\\n\\n**Authentication:** Users need to be authenticated to access or use this endpoint for posting messages. An incorrect or missing authentication token will restrict access to this functionality.\\n\\n**Permissions:** Specific permissions such as 'board-message-create' or 'board-message-edit' are required depending on the action the user intends to perform (creating a new message or updating an existing one).\\n\\nUpon receiving a request, the endpoint triggers the `save` method in the `messages` core service, which involves a series of processes such as validating the message data against predefined formats and rules in `validations/forms.js`. Once validated, the method determines whether it involves a new message creation or an update to an existing message based on the provided identifiers. For a new message, it adds the message to the database and returns a success status along with the message details. For updates, it checks for existing messages and applies updates accordingly. The response includes the status of the operation and any associated details about the saved message.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/modules-assignRest.request.txt b/packages/leemons-openapi/lib/requests/modules-assignRest.request.txt new file mode 100644 index 0000000000..fee3a31abe --- /dev/null +++ b/packages/leemons-openapi/lib/requests/modules-assignRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'assignRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/assignModule.js\n[object Object]", + "response": "{\"summary\":\"Assign a learning module to a specific user or group\",\"description\":\"This endpoint is responsible for assigning a learning module from the learning paths system to a user or a group of users. It allows administrators or authorized personnel to dynamically allocate educational content to different learners based on requirements or learning paths.\\n\\n**Authentication:** User authentication is mandatory to access this endpoint. Users are required to provide a valid authentication token to prove their identity and access rights before making requests to this endpoint.\\n\\n**Permissions:** Users need to have 'manage_learning_paths' permission to assign modules. Without the necessary permissions, the request will be rejected, ensuring that only authorized users can assign learning modules.\\n\\nThe controller starts by validating the user's authentication status and permissions. Upon successful validation, it invokes the `assignModule` function from the `modules` core logic. This function takes parameters such as module ID and user or group ID, and then interacts with the database to update the module assignments. The process involves checking the module's availability, the user's or group's eligibility, and then updating the assignment records in the database. The outcome of the operation is sent back to the user in the form of a success or error message, detailing the result of the assignment attempt.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/modules-createRest.request.txt b/packages/leemons-openapi/lib/requests/modules-createRest.request.txt new file mode 100644 index 0000000000..65c922da0f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/modules-createRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'createRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/createModule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/createAssetsAssignables.js\n[object Object]", + "response": "{\"summary\":\"Create a new learning module\",\"description\":\"This endpoint facilitates the creation of a new learning module within the leemons platform. The implementation includes constructing module details such as title, description, and associated learning assets based on input data.\\n\\n**Authentication:** A user must be authenticated to perform this action. Authentication ensures that requests to this endpoint are made by valid users of the platform.\\n\\n**Permissions:** The user needs to have the 'create_module' permission to be able to execute this action. This ensures only authorized users can add new learning modules.\\n\\nOnce the endpoint receives a request, it calls the `createModule` function from the `modules` core service. This function takes user-provided data such as module names, descriptions, and learning objective identifiers to assemble a new module instance. The process involves validating input data, ensuring correctness and completeness before creating the module in the database. Upon successful creation, the service returns details of the newly created module along with a status code indicating successful creation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/modules-duplicateRest.request.txt b/packages/leemons-openapi/lib/requests/modules-duplicateRest.request.txt new file mode 100644 index 0000000000..488bc41e42 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/modules-duplicateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'duplicateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/duplicateModule.js\n[object Object]", + "response": "{\"summary\":\"Duplicate a specific module\",\"description\":\"This endpoint handles the duplication of a module based on the provided module ID. The duplication process involves creating a complete copy of the existing module, including its configurations and associated data, under a new unique identifier.\\n\\n**Authentication:** Users need to be authenticated to initiate the duplication process. An access check ensures that only authenticated requests are processed.\\n\\n**Permissions:** The user must have the 'duplicate_module' permission. This permission check is critical to ensure that only authorized users can duplicate modules.\\n\\nUpon receiving the request, `duplicateModule` from the `ModuleService` is called with necessary parameters such as module ID and user context. This function orchestrates the cloning of the module's data, adjusting properties as needed to ensure integrity and uniqueness. Success or failure of the duplication is communicated back to the user through the HTTP response, which provides details of the newly created module or error messages if applicable.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/modules-publishRest.request.txt b/packages/leemons-openapi/lib/requests/modules-publishRest.request.txt new file mode 100644 index 0000000000..8399bd2315 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/modules-publishRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'publishRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/publishModule.js\n[object Object]", + "response": "{\"summary\":\"Publish learning module details\",\"description\":\"This endpoint publishes the details of a specific learning module. It updates the module's status to 'published', making it accessible to users based on the provided access configurations.\\n\\n**Authentication:** Users must be authenticated to perform this operation. The action checks for a valid session or token before proceeding with the publishing process.\\n\\n**Permissions:** The user must have 'module_publish' permission to execute this action. Any attempt without this permission will result in an access denied error.\\n\\nThe process begins in the `publishRest` action where a specific module's ID is received as a parameter. The action then interacts with `publishModule` from the `modules` core, which checks if the module exists and verifies the user's permission to publish it. If all validations pass, the module's status in the database is updated to 'published'. This transition allows the module to become visible and accessible to users according to the learning platform's visibility settings. The response from the action confirms the successful publication or returns an error if any part of the process fails.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/modules-removeRest.request.txt b/packages/leemons-openapi/lib/requests/modules-removeRest.request.txt new file mode 100644 index 0000000000..e844aecc6d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/modules-removeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/removeModule.js\n[object Object]", + "response": "{\"summary\":\"Remove a specific learning module\",\"description\":\"This endpoint facilitates the removal of a specified learning module by its unique identifier. The process deletes the module from the learning paths system, ensuring that it is no longer accessible or associated with any learning path.\\n\\n**Authentication:** This action requires the user to be authenticated. Only authenticated sessions can initiate the removal of a module.\\n\\n**Permissions:** The user must have administrative rights or specific deletion permissions for learning modules to execute this operation.\\n\\nThe endpoint invokes the `removeModule` method in the `Modules` service. This action flow starts when the endpoint receives a DELETE request containing the module's unique identifier. It then checks for user authentication and verifies if the user has the necessary permissions to remove a learning module. If all checks are pass, the `removeModule` method from the `modules` core uses this identifier to locate and delete the module from the database. The operation concludes by sending a success or error message back to the client, depending on the outcome of the deletion process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/modules-updateRest.request.txt b/packages/leemons-openapi/lib/requests/modules-updateRest.request.txt new file mode 100644 index 0000000000..fb911730b8 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/modules-updateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/updateModule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-learning-paths/backend/core/modules/createAssetsAssignables.js\n[object Object]", + "response": "{\"summary\":\"Updates specific learning module details\",\"description\":\"This endpoint allows for the modification of existing module details within the Leemons platform's Learning Paths plugin. The primary function is to update module information based on provided data, which can include changes to names, descriptions, and associated metadata of the module.\\n\\n**Authentication:** User authentication is mandatory to ensure that only authorized users can update modules. A valid session or token must be provided to access this endpoint.\\n\\n**Permissions:** The user must have 'module.edit' permission to update module details. Without the appropriate permissions, the endpoint will reject the request and return an authorization error.\\n\\nUpon receiving the update request, the `updateModule` function within the `modules` core is triggered, which first validates the provided data against the module schema. Assuming validation passes without errors, it proceeds to update the module details in the database. The function interacts with the database using a transaction to ensure that all data is consistently updated without errors. Upon successful update, a confirmation is sent back to the client indicating the successful modification of the module, along with the updated module data.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/node-levels-postNodeLevelsRest.request.txt b/packages/leemons-openapi/lib/requests/node-levels-postNodeLevelsRest.request.txt new file mode 100644 index 0000000000..2a92b8f5b8 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/node-levels-postNodeLevelsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postNodeLevelsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/nodeLevels.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/nodeLevels.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/addNodeLevels.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/nodeLevelsByCurriculum.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/getNodeLevelSchema.js\n[object Object]", + "response": "{\"summary\":\"Add new node levels to the curriculum\",\"description\":\"This endpoint allows for the addition of new node levels to a specified curriculum. It is designed to receive a structured set of node level data, validate it against predefined schemas, and subsequently integrate it into the curriculum's existing structure.\\n\\n**Authentication:** User authentication is mandatory to interact with this endpoint. Access is denied for non-authenticated or improperly authenticated requests.\\n\\n**Permissions:** The user must have 'curriculum_management' permission to add new node levels. Without this permission, the request will be rejected.\\n\\nUpon receiving the request, the endpoint calls the `addNodeLevels` function from the `nodeLevels` core module. This function processes the incoming data, ensuring all validations are met and that the data conforms to the required format and relations for inclusion in the curriculum. It involves complex logic to correctly place the node levels within the curriculum's structure and to handle any potential conflicts with existing nodes. If the operation is successful, a confirmation response is sent back to the client indicating that the new node levels have been added. If there are any errors during the process, the client receives an error message detailing the issue.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/node-levels-putNodeLevelRest.request.txt b/packages/leemons-openapi/lib/requests/node-levels-putNodeLevelRest.request.txt new file mode 100644 index 0000000000..f859d7a9c8 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/node-levels-putNodeLevelRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putNodeLevelRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/nodeLevels.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/nodeLevels.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/updateNodeLevel.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/validations/forms.js\n[object Object]", + "response": "{\"summary\":\"Update node level details\",\"description\":\"This endpoint allows updating of specific node level details within the Leemons platform curriculum management. The modifications can include changes to the hierarchy, labeling, or any associated attributes of a node level.\\n\\n**Authentication:** Users must be authenticated to modify node level details. Actions performed without valid authentication will result in access denial.\\n\\n**Permissions:** Users need to have `edit_node_level` permission to update details of a node level. Attempts to update without sufficient permissions will be blocked and logged for security audits.\\n\\nUpon receiving a request, the endpoint initiates the `updateNodeLevel` method from the `nodeLevels` core module. This method utilizes the passed data (typically in JSON format), which includes the specific changes to be made, along with the unique identifier of the node level. The procedure involves validation of the data against predefined schemas to ensure compliance with the platform's data standards. If validations pass, the method proceeds to apply the updates in the database. The success or failure of the operation, along with updated data if successful, is then conveyed back to the user through a standardized HTTP response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/node-postNodeRest.request.txt b/packages/leemons-openapi/lib/requests/node-postNodeRest.request.txt new file mode 100644 index 0000000000..25bf1d52f6 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/node-postNodeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postNodeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/node.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/node.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodes/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodes/addNode.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodes/reloadNodeFullNamesForCurriculum.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodes/nodesTreeByCurriculum.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/nodeLevelsByCurriculum.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodeLevels/getNodeLevelSchema.js\n[object Object]", + "response": "{\"summary\":\"Add a new curriculum node\",\"description\":\"This endpoint allows for the addition of a new node within a specified curriculum structure. A node can represent a modular unit such as a chapter, section, or a specific educational content item that fits within the broader curriculum framework.\\n\\n**Authentication:** User must be logged in to create a new node. A valid authentication token is required to proceed, and failure to provide one will result in a denial of access to this endpoint.\\n\\n**Permissions:** The user needs to have 'create_node' permission in their profile to perform this action. Without sufficient permissions, the system will reject the request to add a new node.\\n\\nDuring the execution flow of this endpoint, the `addNode` method from the `nodes` core is first invoked. This method takes incoming data which typically includes the node’s title, description, the curriculum it belongs to, and any other relevant metadata. It validates the data against predefined schemas to ensure compliance with the system's requirements. Upon successful validation, the data is inserted into the curriculum structure in the database. Confirmation of this insertion is then returned to the user along with the new node's details, all sent back as a JSON object in the HTTP response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/node-saveNodeRest.request.txt b/packages/leemons-openapi/lib/requests/node-saveNodeRest.request.txt new file mode 100644 index 0000000000..34d2988627 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/node-saveNodeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveNodeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/node.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/services/rest/node.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodes/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-curriculum/backend/core/nodes/saveNode.js\n[object Object]", + "response": "{\"summary\":\"Saves or updates curriculum node details\",\"description\":\"This endpoint is designed for the creation or updating of curriculum node details. It handles both the creation of new nodes and the updates to existing nodes, focusing on saving the data related to a specific curriculum structure, such as lectures, lessons, or topics within the educational platform.\\n\\n**Authentication:** User authentication is required to ensure that only logged-in users can alter curriculum nodes. Authenticated status is mandatory to proceed with any data modification.\\n\\n**Permissions:** Users need to have specific rights to create or edit curriculum nodes. The required permissions include role-based checks that ensure only authorized personnel such as educators or curriculum managers can modify the content.\\n\\nThe process begins with the `saveNodeRest` action receiving the request and extracting necessary data such as node details from the request body. It then calls the `saveNode` method from the `nodes` core module, passing the extracted data. This method is responsible for checking the existence of the node by ID, performing validations, and then either updating the existing node or creating a new one if it does not exist. All database interactions necessary for storing or updating the node are handled within this method. On successful completion of these operations, the method returns an acknowledgment that the node details have been successfully saved or updated, which is then relayed back to the user through a standardized API response format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/organization-getJsonThemeRest.request.txt b/packages/leemons-openapi/lib/requests/organization-getJsonThemeRest.request.txt new file mode 100644 index 0000000000..13c7158ffd --- /dev/null +++ b/packages/leemons-openapi/lib/requests/organization-getJsonThemeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getJsonThemeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/organization.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/organization.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/getOrganization.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/updateOrganization.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/compileTokens.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/transform.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/theme/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/theme/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/theme/findOne.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/getJsonTheme.js\n[object Object]", + "response": "{\"summary\":\"Fetches the theme configuration for the organization\",\"description\":\"This endpoint facilitates the retrieval of the current theme configuration JSON specific to the organization. This endpoint is typically used to support frontend operations that require theme data to customize user interfaces accordingly.\\n\\n**Authentication:** Users need to be authenticated to ensure secure access to organizational themes. Access attempts without proper authentication will result in restricted entry.\\n\\n**Permissions:** Users must possess adequate permission levels, typically admin rights, to fetch theme configurations. This ensures that only authorized personnel can access sensitive theme information.\\n\\nUpon receiving a request, the handler initiates by calling the `getJsonTheme` method within the `organization` core module. This method is responsible for extracting the theme details from the organization's configuration settings stored in the database. It processes the request by validating user credentials and permissions before serving the theme JSON. The method provides a comprehensive pipeline that includes fetching, validating, and returning the necessary data packaged in a structured JSON format to the requesting client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/organization-getRest.request.txt b/packages/leemons-openapi/lib/requests/organization-getRest.request.txt new file mode 100644 index 0000000000..079b01cd43 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/organization-getRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/organization.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/organization.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/getOrganization.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/updateOrganization.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/compileTokens.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/transform.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/theme/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/theme/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/theme/findOne.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/getJsonTheme.js\n[object Object]", + "response": "{\"summary\":\"Manage organizational settings and configurations\",\"description\":\"This endpoint provides the functionality to manage settings and configurations related to the organization within the admin plugin of the leemons platform. It can include operations such as retrieving, updating, or validating organization data and its related configurations.\\n\\n**Authentication:** Access to this endpoint requires the user to be authenticated. Failure to provide a valid authentication token will prevent the user from accessing the organization settings.\\n\\n**Permissions:** This endpoint requires the user to have administrative privileges or specific permissions related to organization management to ensure secure access and modification rights.\\n\\nThe process starts with a request to the `organization.rest.js` service, which acts as a router to different organization-related actions within the backend. Depending on the operation requested (retrieve, update, validate), the appropriate method from the `organization` core module is invoked. These methods access and manipulate data stored in persistent storage, handling tasks such as fetching current organization details (`getOrganization`), updating them (`updateOrganization`), or compiling organization-related tokens (`compileTokens`). Each of these methods ensures data integrity and compliance with platform standards before sending back the response, which includes the result of the operation in a JSON formatted structure.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/organization-postRest.request.txt b/packages/leemons-openapi/lib/requests/organization-postRest.request.txt new file mode 100644 index 0000000000..dd9cfaaff0 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/organization-postRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/organization.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/organization.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/getOrganization.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/updateOrganization.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/compileTokens.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/transform.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/theme/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/theme/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/theme/findOne.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/organization/getJsonTheme.js\n[object Object]", + "response": "{\"summary\":\"Update organization settings\",\"description\":\"This endpoint updates the organization details based on the given settings. This could include updates to organization name, address, contact details, and other organizational configurations relevant for the application.\\n\\n**Authentication:** It is required that users be authenticated to perform updates on the organization settings. Authentication ensures that only authorized users can make changes to sensitive organizational information.\\n\\n**Permissions:** The user must have administrative rights or specific role-based permissions to update organization settings. Without sufficient permissions, the request will be rejected to maintain organizational data integrity.\\n\\nThe flow begins with the `updateOrganization` handler in the `organization.rest.js` service file, which utilizes the `updateOrganization` core function from `updateOrganization.js`. This function is responsible for handling the logic to update the desired organizational settings in the database. It involves validation checks to ensure data integrity and authorization logic to verify that the user has the required permissions to make changes. Upon successful validation and authorization, the organization's data is updated in the database, and a success response is generated and sent back to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/package-assignPackageRest.request.txt b/packages/leemons-openapi/lib/requests/package-assignPackageRest.request.txt new file mode 100644 index 0000000000..7a8e22718b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/package-assignPackageRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'assignPackageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/package/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/package/assignPackage.js\n[object Object]", + "response": "{\"summary\":\"Assign a SCORM package to a user or group\",\"description\":\"This endpoint assigns a specific SCORM package to either a user or a group based on the parameters provided. This function is crucial for tailoring learning experiences to different users or groups within the educational platform.\\n\\n**Authentication:** Users need to be authenticated to assign SCORM packages. The endpoint checks for a valid session or token before proceeding with the assignment.\\n\\n**Permissions:** The user must have 'assign-package' permission to execute this action. Without the appropriate permissions, the request will be rejected, ensuring that only authorized personnel can assign learning materials.\\n\\nAfter authentication and permission checks, the `assignPackage` method in `package.core.js` is invoked with necessary parameters like package ID and user or group ID. This method interacts with the database to update or create entries that link the SCORM package with the specified users or groups. The process involves several validation steps to ensure the package exists and the user/group IDs are valid. Upon successful assignment, the system logs the action for auditing purposes and returns a success response to the client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/package-deletePackageRest.request.txt b/packages/leemons-openapi/lib/requests/package-deletePackageRest.request.txt new file mode 100644 index 0000000000..99a7a8a123 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/package-deletePackageRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deletePackageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/package/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/package/deletePackage.js\n[object Object]", + "response": "{\"summary\":\"Delete a specific SCORM package\",\"description\":\"This endpoint allows for the deletion of a specific SCORM package from the system. The operation effectively removes the specified package and all related data, ensuring that it is no longer accessible within the platform.\\n\\n**Authentication:** Users need to be authenticated to initiate deletion of a SCORM package. Any attempt to access this endpoint without valid authentication credentials will result in access being denied.\\n\\n**Permissions:** This endpoint requires the user to have administrative rights or specific permissions to delete SCORM packages. Users without the necessary permissions will be prevented from performing this operation.\\n\\nUpon receiving a delete request, the endpoint first verifies the authentication and permission of the requesting user. It then proceeds to call the `deletePackage` method from the `package` core module. This method handles the business logic for finding and removing the SCORM package from the database. If the specified package is successfully located and deleted, a confirmation is sent back to the user. The process ensures that all traces of the SCORM package are removed securely and efficiently, confirming the successful deletion to the client via an HTTP response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/package-duplicatePackageRest.request.txt b/packages/leemons-openapi/lib/requests/package-duplicatePackageRest.request.txt new file mode 100644 index 0000000000..13820c6e94 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/package-duplicatePackageRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'duplicatePackageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/package/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/package/duplicatePackage.js\n[object Object]", + "response": "{\"summary\":\"Duplicate a specific SCORM package\",\"description\":\"This endpoint duplicates a specified SCORM package within the Leemonade platform, making a complete copy of the package while preserving the original's content and settings.\\n\\n**Authentication:** Users must be authenticated to perform duplication operations on SCORM packages. Without proper authentication, the request will be denied.\\n\\n**Permissions:** Users need to have specific rights to duplicate SCORM packages. Typically, this would include permissions such as 'manage_package' or 'duplicate_package' within their role capabilities.\\n\\nThe duplication process begins by calling the `duplicatePackage` function defined in the 'duplicatePackage.js' file. This function is responsible for taking the original package's data, copying its entire structure, and files, and then saving it as a new entity in the database. The process ensures that all linked assets and dependencies are thoroughly cloned. As the final action, this newly created package instance is returned in the response, concluding the duplication venture.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/package-getPackageRest.request.txt b/packages/leemons-openapi/lib/requests/package-getPackageRest.request.txt new file mode 100644 index 0000000000..3d6861ba98 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/package-getPackageRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getPackageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/package/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/package/getPackage.js\n[object Object]", + "response": "{\"summary\":\"Fetches a specific SCORM package details\",\"description\":\"This endpoint retrieves detailed information about a specific SCORM package stored within the system. It focuses on providing comprehensive package data such as metadata, content structure, and user progress if applicable.\\n\\n**Authentication:** User authentication is required to access this endpoint. Users need to provide valid credentials to ensure they are authorized to access the package information.\\n\\n**Permissions:** Users must have the 'view_package' permission to retrieve SCORM package details. Without this permission, the endpoint will deny access.\\n\\nThe process begins with the handler in `package.rest.js` calling the `getPackage` action from the `Package` core. This action utilizes parameters sent through the request to identify and retrieve the specific SCORM package from the database. The method leverages several sub-methods to compile the necessary details about the package, ensuring that all relevant information such as version history, content files, and user-specific interactions (if any) are included. Finally, the compiled package data is returned to the user via a structured JSON response, encapsulating all aspects of the SCORM package.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/package-getSupportedVersionsRest.request.txt b/packages/leemons-openapi/lib/requests/package-getSupportedVersionsRest.request.txt new file mode 100644 index 0000000000..4a55e6554a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/package-getSupportedVersionsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getSupportedVersionsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js\n[object Object]", + "response": "{\"description\":\"{\\n \\\"summary\\\": \\\"Lists supported SCORM versions\\\",\\n \\\"description\\\": \\\"This endpoint provides a list of SCORM versions supported by the system. It is primarily used to ensure compatibility between the content packaged in a SCORM format and the platform.\\n\\n**Authentication:** User authentication is required to access this endpoint. Access will be denied if the authentication credentials are not provided or are invalid.\\n\\n**Permissions:** The user must have 'view' permissions on SCORM content to use this endpoint. Without adequate permissions, the request will be rejected with an appropriate error message.\\n\\nThe process begins when the `getSupportedVersionsRest` action is called, handling the request through the Moleculer framework. This action retrieves an array of supported SCORM versions from the service configuration or a similar data source. Each version in the list represents a SCORM version that is compatible with the platform. The array is then returned in the response, formatted in JSON, showing the versions that the client's content can be validated against.\\\"\\n}\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/package-savePackageRest.request.txt b/packages/leemons-openapi/lib/requests/package-savePackageRest.request.txt new file mode 100644 index 0000000000..9e370bb0f1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/package-savePackageRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'savePackageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/package/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/package/savePackage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/validations/forms.js\n[object Object]", + "response": "{\"summary\":\"Saves a SCORM package into the system\",\"description\":\"This endpoint allows for the uploading and saving of a SCORM package into the platform. It ensures that the package is valid and stores it accordingly, making it accessible for deployment in user courses.\\n\\n**Authentication:** Users must be authenticated to perform this operation. The endpoint requires a valid session or an authentication token to proceed with the request.\\n\\n**Permissions:** Appropriate permissions are necessary to manage SCORM packages. Users need to have the 'manage_scorm_packages' permission to execute this action.\\n\\nUpon receiving the request, the endpoint triggers the `savePackage` method in the SCORM package core module. This method takes charge of parsing the uploaded package data, validating its structure against the SCORM specifications, and saving it to the database. If the package meets all the necessary criteria, it is saved, and a success response is returned to the user. In cases where the validation fails, the endpoint responds with an error detailing the encountered issues. The entire process ensures data integrity and alignment with SCORM standards, centralized in a secure and systematic workflow.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/package-sharePackageRest.request.txt b/packages/leemons-openapi/lib/requests/package-sharePackageRest.request.txt new file mode 100644 index 0000000000..515dbdcfb9 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/package-sharePackageRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'sharePackageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/package/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/package/sharePackage.js\n[object Object]", + "response": "{\"summary\":\"Share a SCORM package with specified users or groups\",\"description\":\"This endpoint allows sharing of a SCORM package within the leemonade platform to selected users or groups. The sharing action, facilitated by this controller, makes a specific package available to others for their use in learning or training contexts.\\n\\n**Authentication:** Users must be authenticated to share SCORM packages. The action checks for a valid session or authentication token to proceed.\\n\\n**Permissions:** Users need to have 'share_package' permission to execute this action. Without this permission, the request will be denied.\\n\\nThe handler initiates its process by calling the `sharePackage` method from the `package` core with parameters for user IDs and/or group IDs. This method checks the existence of the package and validates the user's permission to share it. On successful validation, it updates the sharing settings in the database to reflect the new shared status with specified entities. It uses database transactions to ensure that all changes are accurate and consistent. After the sharing settings are successfully updated, it returns a success response indicating that the package has been shared.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/periods-addRest.request.txt b/packages/leemons-openapi/lib/requests/periods-addRest.request.txt new file mode 100644 index 0000000000..5acba5cd31 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/periods-addRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/periods.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/periods.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/core/periods/addPeriod.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/validation/validatePeriod.js\n[object Object]", + "response": "{\"summary\":\"Add a new academic period\",\"description\":\"This endpoint adds a new academic period to the system database. The new period information includes details such as its start and end dates, name, and unique identifier, strategically adding to the academic structure management.\\n\\n**Authentication:** User must be authenticated to add a new period. Failure to provide valid credentials will prevent access to this endpoint.\\n\\n**Permissions:** The user needs `manage_periods` permission to execute this action, ensuring only authorized personnel can modify academic periods.\\n\\nThe process begins with the endpoint calling the `addPeriod` method from the `periods` core service. This method first validates the incoming data using the `validatePeriod` function to check for correctness and completeness of the period data. After validation, it proceeds to insert the new period data into the database. Upon successful addition, the method returns a success response indicating that the period has been successfully added. This flow ensures the integrity and reliability of the academic period management.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/periods-listRest.request.txt b/packages/leemons-openapi/lib/requests/periods-listRest.request.txt new file mode 100644 index 0000000000..24478582c6 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/periods-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/periods.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/periods.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/core/periods/listPeriods.js\n[object Object]", + "response": "{\"summary\":\"List all academic periods\",\"description\":\"This endpoint lists all academic periods available within the system, allowing users to view various educational time frames such as semesters, quarters, or other academic sessions.\\n\\n**Authentication:** Users need to be authenticated to retrieve the list of periods. Access to this endpoint is denied if authentication credentials are not provided or are invalid.\\n\\n**Permissions:** This endpoint requires users to have the 'view_periods' permission. Users without this permission will not be able to access the list of academic periods.\\n\\nThe method responsible for handling the request starts by invoking the `listPeriods` function from the `periods` core. This function performs a query to the database to retrieve all the periods recorded in the system. Each period includes details such as the start date, end date, and type of the period. The server processes this data and returns it as a structured list in the response body, ensuring that clients can easily interpret and utilize the information on the academic periods.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/periods-removeRest.request.txt b/packages/leemons-openapi/lib/requests/periods-removeRest.request.txt new file mode 100644 index 0000000000..1e0da5b30d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/periods-removeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/periods.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/periods.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/core/periods/removePeriod.js\n[object Object]", + "response": "{\"summary\":\"Remove a specific educational period\",\"description\":\"This endpoint facilitates the deletion of an educational period from the system database. It is primarily used to manage lifecycle of periods ensuring that obsolete or mistaken entries can be cleaned up efficiently from the platform.\\n\\n**Authentication:** Users must be authenticated to perform this action. An invalid or missing authentication token will result in access being denied to this endpoint.\\n\\n**Permissions:** Adequate permissions are required to delete periods. Typically, this would necessitate administrative rights or specific role-based permissions that allow manipulation of period-related data.\\n\\nUpon receiving a request, this handler invokes the `removePeriod` method defined in the `periods/removePeriod.js` backend core file. The method uses the period's unique identifier, typically passed through the request parameters, to locate and remove the period from the database. The operation might involve validation checks such as confirming the existence of the period and ensuring that the requesting user has appropriate rights to delete it. Once the deletion is successful, confirmation of the action is sent back to the user, generally in the form of a simple success message or status code indicating that the period has been successfully removed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/permissions-getPermissionsWithActionsIfIHaveRest.request.txt b/packages/leemons-openapi/lib/requests/permissions-getPermissionsWithActionsIfIHaveRest.request.txt new file mode 100644 index 0000000000..a2f2a3c613 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/permissions-getPermissionsWithActionsIfIHaveRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getPermissionsWithActionsIfIHaveRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/permissions.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/permissions.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/getUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/helpers/cacheKeys.js\n[object Object]", + "response": "{\"summary\":\"Check and retrieve permissions for user-controlled actions\",\"description\":\"This endpoint evaluates and provides all permissions related to actions that a user can perform within the system, based on their current authentication and authorization status. It specifically fetches any permissions that are associated with actionable items or functions that the user has potential access to.\\n\\n**Authentication:** Users need to be authenticated to request and receive information about their actionable permissions. Without proper authentication, the endpoint will not provide any permissions data.\\n\\n**Permissions:** The user must possess sufficient access rights to inquire about their permissions. Typically, this requires user-level or elevated permissions depending on the structure and sensitivity of the permissions being inquired.\\n\\nThe handling of the request begins by utilizing the `getUserAgentPermissions` function from the `user-agents` core, which extracts the permissions based on the user's credentials. This function checks the database for all permissions linked to the user agent's ID. Subsequently, actions and their respective permissions are verified through a series of internal checks and balances to ensure that only relevant and permissible actions are returned to the user. The response is then compiled into a structured format, detailing each actionable permission and sent back through the endpoint in a JSON object format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/permissions-listRest.request.txt b/packages/leemons-openapi/lib/requests/permissions-listRest.request.txt new file mode 100644 index 0000000000..8a97454678 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/permissions-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/permissions.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/permissions.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/list.js\n[object Object]", + "response": "{\"summary\":\"List all permissions available in the system\",\"description\":\"This endpoint provides a comprehensive listing of all permissions that a user or system can be granted within the platform. It is primarily used to fetch a structured list of permissions, which helps in managing and assigning user roles and rights effectively.\\n\\n**Authentication:** User must be logged into the system to access this endpoint. Unauthorized access attempts will be rejected, ensuring that only authenticated users can retrieve permission information.\\n\\n**Permissions:** The user must have administrative rights or an equivalent level of permissions specifically allowing them to view all permissions. This is critical to ensure that only authorized personnel manage and view sensitive permission data.\\n\\nFrom the outset, the `listRest` handler function activates the core method from the `permissions` module, particularly targeting the `list.js` file. This method systematically gathers all permissions defined across the platform. It encapsulates both default and dynamically added permissions into a structured response. Each permission is associated with its respective module, allowing for easy identification and management. The endpoint processes this data, and the result is returned as a JSON object listing all permissions, which can then be utilized for further administrative tasks or audits.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/permissions-setRest.request.txt b/packages/leemons-openapi/lib/requests/permissions-setRest.request.txt new file mode 100644 index 0000000000..2f8d2cb12b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/permissions-setRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/permissions.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/permissions.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/set/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/set/set.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/set/checkIfRolesExist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/validateRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAssets/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAssets/getByAssets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getAssetPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAssets/handleOnlyShared.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getAssetIdFromPermissionName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAssets/handleItemPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/getRolePermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/buildQuery.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getUserPermissionsByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getClassesPermissions/getClassesPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canUnassignRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsWithFiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/bookmarks/find/find.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsTags.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsCategoryData.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/getAssetsProgramsAggregatedById.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/assets/getByIds/processFinalAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/set/handleAddPermissionsToUserAgent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/set/addPermissionsToUserAgent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAsset/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/getByAsset/getByAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/helpers/canAssignRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/set/handleAddPermissionsToAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/set/addPermissionsToAsset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/set/handleRemoveMissingPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/set/removeMissingUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/set/removeMissingUserAgent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/permissions/set/removeMissingPermissions.js\n[object Object]", + "response": "{\"summary\":\"Set permissions for a specific asset or user\",\"description\":\"This endpoint handles the setting of permissions for specific assets or users within the system. It allows administrators or authorized users to define who can access or modify certain resources, thereby enhancing control and security over sensitive information or functionalities.\\n\\n**Authentication:** Users need to be authenticated to access this endpoint. The presence and validity of an authentication token are crucial for processing the request.\\n\\n**Permissions:** This endpoint requires administrative privileges or specific role-based permissions that allow a user to manage and assign permissions within the platform.\\n\\nUpon receiving a request, the `setRest` action starts by parsing incoming data to identify the target (either an asset or a user) and the desired permissions to be set. It then invokes the `setPermissions` method from the permissions core logic, which checks existing permission levels, validates the roles of the involved parties, and applies the new settings accordingly. This process may involve multiple validation layers to ensure only authorized modifications are made. If successful, the method returns a confirmation of the updated permissions, which is then forwarded to the user as the final response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/platform-getDefaultLocaleRest.request.txt b/packages/leemons-openapi/lib/requests/platform-getDefaultLocaleRest.request.txt new file mode 100644 index 0000000000..8f44f395b7 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/platform-getDefaultLocaleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getDefaultLocaleRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/platform.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/platform.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]", + "response": "{\"summary\":\"Fetches the platform's default locale setting\",\"description\":\"This endpoint retrieves the default locale configured for the platform. It identifies the primary language and regional settings that are used across various functionalities where localized content is required.\\n\\n**Authentication:** Users do not need to be logged in to access the default locale. It is publicly accessible to provide a consistent user experience in terms of language and region right from the start of interaction with the platform.\\n\\n**Permissions:** No specific permissions are required to access this endpoint. It serves general platform information which is intended to be freely accessible to all users, ensuring that localization preferences can be resolved and applied even before user authentication.\\n\\nUpon receiving a request, the `getDefaultLocaleRest` action invokes the `getDefaultLocale` method from the platform core services. This method directly reads the locale configuration from the system settings, generally maintained in a configuration file or a database. The output of this method is the default locale setting such as 'en-US' or 'fr-FR', which is then returned to the requester in JSON format, ensuring that the client application can adjust its language and regional settings accordingly.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/platform-getLocalesRest.request.txt b/packages/leemons-openapi/lib/requests/platform-getLocalesRest.request.txt new file mode 100644 index 0000000000..3e5fa143f7 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/platform-getLocalesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getLocalesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/platform.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/platform.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getLocales.js\n[object Object]", + "response": "{\"summary\":\"Provides localized content for the platform\",\"description\":\"This endpoint retrieves all available language locales supported by the platform. It enables applications to offer multilingual support by providing a list of locales that users can select from to view content in their preferred language.\\n\\n**Authentication:** Users are required to be authenticated to access the list of supported locales. Unauthenticated requests are rejected, ensuring that only valid users can access locale information.\\n\\n**Permissions:** Access to this endpoint requires administrative rights. Only users with the 'admin' role are permitted to retrieve the list of locales, ensuring that managing available locales is restricted to authorized personnel only.\\n\\nUpon receiving a request, the `getLocales` function within the platform's core is invoked. This function queries the system's configuration files or database to gather all supported locales. The process involves validating the user's authentication and permissions before proceeding with the data retrieval. Finally, the gathered data is returned in a JSON array format, listing each locale along with its relevant properties such as language code and description, facilitating easy integration and selection by users.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/platform-getPlatformNameRest.request.txt b/packages/leemons-openapi/lib/requests/platform-getPlatformNameRest.request.txt new file mode 100644 index 0000000000..423f083345 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/platform-getPlatformNameRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getPlatformNameRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/platform.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/platform.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getName.js\n[object Object]", + "response": "{\"summary\":\"Fetch platform name configuration\",\"description\":\"This endpoint retrieves the platform name from the system configuration. This information is utilized to provide context or personalize user interactions with the system.\\n\\n**Authentication:** Users are not required to be authenticated to access this endpoint. It serves general information applicable to any user accessing the platform.\\n\\n**Permissions:** There are no specific permissions required to access this endpoint, since it provides non-sensitive, general information about the platform.\\n\\nUpon receiving a request, the handler triggers the `getPlatformName` function defined in the `platform` core module. This function is responsible for accessing the system’s configuration and extracting the name of the platform. The operation is straightforward, generally involving a read operation from a configuration file or a database query, depending on how the platform is set up. The result of this operation is then formatted properly and sent back to the requester in the response body as plain text or JSON, depending on the implementation specifics. The process ensures that any user or system interacting with the endpoint receives accurate and up-to-date information regarding the platform's name.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/platform-getThemeRest.request.txt b/packages/leemons-openapi/lib/requests/platform-getThemeRest.request.txt new file mode 100644 index 0000000000..df73581f64 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/platform-getThemeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getThemeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/platform.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/platform.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getTheme.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/query.js\n[object Object]", + "response": "{\"summary\":\"Fetches the current platform theme settings\",\"description\":\"This endpoint retrieves the theme settings currently active for the platform. It provides the appearance configurations that dictate the visual aspects of the platform’s user interface.\\n\\n**Authentication:** The user must be authenticated to access the theme settings. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** The user needs to have administrative permissions to access the theme settings. Without the required permissions, the endpoint will deny access to the theme configurations.\\n\\nOnce invoked, the `getTheme` handler in the backend service begins by confirming user authentication and checks for administrative permissions. If these checks pass, it then calls the `getTheme` method from the `Platform` core. This method accesses the database to retrieve the current theme settings applied to the platform. The results are then formatted and sent back as a JSON object representing the theme settings, ensuring that the administrator can view or modify the visual configurations as needed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/profiles-addAllPermissionsToAllProfilesRest.request.txt b/packages/leemons-openapi/lib/requests/profiles-addAllPermissionsToAllProfilesRest.request.txt new file mode 100644 index 0000000000..fea135cd79 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/profiles-addAllPermissionsToAllProfilesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addAllPermissionsToAllProfilesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/addAllPermissionsToAllProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/existName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/permissions/markAllUsersWithProfileToReloadPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/updateProfileTranslations.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getProfileRole.js\n[object Object]", + "response": "{\"summary\":\"Assign all available permissions to all user profiles\",\"description\":\"This endpoint globally updates all user profiles in the system by assigning all available permissions to them, ensuring every profile has access to every permission defined in the system.\\n\\n**Authentication:** User authentication is mandatory to execute this action. The service checks for valid session tokens before processing the request.\\n\\n**Permissions:** The user must have administrative permissions to update permissions across all profiles.\\n\\nUpon receiving a request, the handler invokes the `addAllPermissionsToAllProfiles` method from the `profiles` core module. This method iterates over all profiles stored in the database, and for each profile, it applies a set of predefined permissions. The permissions are retrieved from a central repository of permissions that define all possible actions users can perform within the system. This comprehensive application ensures that there are no discrepancies in permission assignments across different user profiles. Once all profiles are updated, a confirmation is sent back to the client indicating the successful update of permissions across all profiles.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/profiles-addRest.request.txt b/packages/leemons-openapi/lib/requests/profiles-addRest.request.txt new file mode 100644 index 0000000000..bd70391821 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/profiles-addRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/existName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/updateProfileTranslations.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/createNecessaryRolesForProfilesAccordingToCenters.js\n[object Object]", + "response": "{\"summary\":\"Add a new profile to the system\",\"description\":\"This endpoint allows for the addition of a new user profile within the system. It is responsible for creating profile entries that can be linked to specific user roles and permissions, aiding in access management and personalization of user experiences.\\n\\n**Authentication:** Users need to be authenticated to perform this action. Only users with administrative privileges can add new profiles.\\n\\n**Permissions:** The required permission for this endpoint is 'profile_add'. Without this permission, users cannot execute profile creation operations.\\n\\nThe process begins when the `add` method in the `profiles` core is called. This method involves several steps starting from validating the input data, checking for existing profiles with similar names using the `existName` method, and then proceeding to create a new profile if no duplicates are found. It integrates with `createNecessaryRolesForProfilesAccordingToCenters` to ensure necessary roles are assigned according to the user's center affiliations. The completion of the operation returns a confirmation of the profile creation or an error message detailing any issues encountered during the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/profiles-detailRest.request.txt b/packages/leemons-openapi/lib/requests/profiles-detailRest.request.txt new file mode 100644 index 0000000000..d15924e2c6 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/profiles-detailRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'detailRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/detailByUri.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/transformArrayToObject.js\n[object Object]", + "response": "{\"summary\":\"Provides detailed profile information by URI\",\"description\":\"This endpoint fetches detailed information of a user profile based on the provided URI. It aims to give a comprehensive view of a user's profile including personal details, roles, and any other related data defined within the scope of the endpoint.\\n\\n**Authentication:** Users need to be authenticated to access profile details. Access is denied if the authentication credentials are invalid or not provided.\\n\\n**Permissions:** This endpoint requires the user to have specific permissions to view detailed profile information. The required permission typically includes the ability to view user details or specific roles that involve administrative rights over user profiles.\\n\\nThe flow begins by the endpoint receiving a URI parameter that identifies a specific user profile. It then calls the `detailByUri` method from the `profiles` core module. This method is responsible for querying the database to retrieve all pertinent details associated with the given URI. The data fetched encompasses all comprehensive attributes and associations relevant to the user profile. Once data is successfully retrieved and compiled, it is formatted into a JSON structure and sent as a response to the client, providing all the necessary details about the user profile as specified by the requester's permissions.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/profiles-getProfileSysNameRest.request.txt b/packages/leemons-openapi/lib/requests/profiles-getProfileSysNameRest.request.txt new file mode 100644 index 0000000000..ef14b9e9d5 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/profiles-getProfileSysNameRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getProfileSysNameRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getProfileSysName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentProfile.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]", + "response": "{\"summary\":\"Fetch system name of a user profile\",\"description\":\"This endpoint retrieves the system name associated with a specific user profile. The system name is a unique identifier typically used for internal processing and integrations.\\n\\n**Authentication:** User authentication is required to access this endpoint. Unauthenticated requests are denied and result in an error.\\n\\n**Permissions:** Users need to have 'read' access rights to the profile data to utilize this endpoint. Without the necessary permissions, the system restricts data retrieval to safeguard user information.\\n\\nUpon request, the `getProfileSysNameRest` action invokes the `getProfileSysName` function from the `profiles` core module. This function processes the incoming request to determine the appropriate profile based on the user's context and extracts the system name from the profile data. It then returns this system name as a string in the HTTP response. The entire operation ensures that the user's data is accessed securely and only reveals the system name to those with the appropriate permissions.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/profiles-getRest.request.txt b/packages/leemons-openapi/lib/requests/profiles-getRest.request.txt new file mode 100644 index 0000000000..ae72713671 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/profiles-getRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/profiles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/profiles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/core/profiles/get.js\n[object Object]", + "response": "{\"summary\":\"Fetch user profiles based on specific criteria\",\"description\":\"This endpoint retrieves user profiles according to specific criteria provided. It aims to simplify user management by allowing administrators to view detailed information about user profiles in a filtered manner.\\n\\n**Authentication:** Users must be authenticated to access this endpoint. Adequate authentication ensures secure access to the user profile data.\\n\\n**Permissions:** Access is restricted to users who have administrative rights or specific permissions to manage user profiles. The required permissions ensure that only authorized personnel can view or modify user profile data.\\n\\nThe handler for this endpoint begins by calling the `getProfiles` method from the `profiles` core module. This method processes the request by extracting and validating criteria from the request parameters. After validation, it queries the database to fetch user profiles that match the given criteria. The database transaction is carefully handled to ensure data integrity and security. Upon successful retrieval, the profiles are formatted and returned to the user in JSON format, adhering to the specified data structure guidelines for client-side processing.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/profiles-listRest.request.txt b/packages/leemons-openapi/lib/requests/profiles-listRest.request.txt new file mode 100644 index 0000000000..bb3698d630 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/profiles-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/list.js\n[object Object]", + "response": "{\"summary\":\"Lists user profiles available in the system\",\"description\":\"This endpoint fetches a comprehensive list of all user profiles available within the platform. It aims to provide a structured overview useful for administrative purposes or user management interfaces.\\n\\n**Authentication:** Access to this endpoint requires the user to be logged in to the system. Any unauthorized access attempts will be rejected.\\n\\n**Permissions:** This endpoint requires the user to have administrative privileges or specific rights that allow the viewing of user profiles across the platform.\\n\\nUpon receiving a request, the endpoint initially ensures that the user is authenticated and authorized to access the data. This verification involves checking the user's authentication token and confirming that they have the necessary permissions. If authentication or authorization fails, the request is immediately rejected. Once verified, the endpoint calls the `listProfiles` method from the `Profiles` core. This method interacts with the database to retrieve all the profiles stored within it. Each profile is collected and formatted suitably before being sent back to the requester. The final output is delivered as a JSON array of profiles, each containing relevant details such as user IDs, names, and associated roles or permissions.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/profiles-setManyRest.request.txt b/packages/leemons-openapi/lib/requests/profiles-setManyRest.request.txt new file mode 100644 index 0000000000..4dcba4ceb5 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/profiles-setManyRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setManyRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/profiles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/profiles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/core/profiles/set.js\n[object Object]", + "response": "{\"summary\":\"Sets multiple user profiles in a bulk operation\",\"description\":\"This endpoint allows for the bulk updating or creation of user profiles within the system. The operation can set multiple profiles simultaneously, handling each one according to the details provided in the request body.\\n\\n**Authentication:** User authentication is required to execute this endpoint. Users attempting to access this endpoint without valid authentication will receive an error response indicating that authentication credentials are invalid or not provided.\\n\\n**Permissions:** Users need to have appropriate permissions to create or update profiles. Typically, this includes administrative rights or specific profile management permissions granted by the system administrator.\\n\\nInitially, the `setManyRest` handler in the Moleculer service calls the `SetMany` method from the backend’s core profile module. This method parses and validates the incoming data for each profile to be set. It checks for required fields, data integrity, and conformity to the expected format. After validation, it either updates existing profiles or creates new ones in the database, depending on whether the profiles already exist. The operation is transactional, ensuring that all profiles are set successfully or none at all, to maintain data consistency. Each profile's result is tracked, and a detailed summary of the creation or update process for each profile is compiled and returned to the user in a JSON format, indicating success or detailing any errors encountered.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/profiles-setRest.request.txt b/packages/leemons-openapi/lib/requests/profiles-setRest.request.txt new file mode 100644 index 0000000000..e24cb8ae47 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/profiles-setRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/profiles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/profiles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/core/profiles/set.js\n[object Object]", + "response": "{\"summary\":\"Set user profile parameters\",\"description\":\"This endpoint allows for the update or creation of a user's profile settings in the system. This function ensures that user preferences and settings are accurately recorded and maintained across sessions.\\n\\n**Authentication:** User authentication is mandatory to access and modify profile settings. Without proper authentication, the system denies any operations on profile settings.\\n\\n**Permissions:** The user must have the 'edit_profile' permission to update profile settings. Without this permission, the attempt to update or set profile settings will be blocked, ensuring that only authorized users can make changes to their profiles.\\n\\nThe endpoint works by invoking the `set` method in the `Profiles` core. This method handles both updating existing profile settings and creating new ones if they do not already exist. The process involves validating the input data against pre-defined schemas and then either updating the existing profile or inserting a new entry into the database. The entire operation is wrapped in transaction controls to ensure data integrity and consistency. After successful execution, the updated settings are returned in the response, providing instant confirmation to the user about the changes.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/profiles-updateRest.request.txt b/packages/leemons-openapi/lib/requests/profiles-updateRest.request.txt new file mode 100644 index 0000000000..4ac70f9814 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/profiles-updateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/existName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/permissions/markAllUsersWithProfileToReloadPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/updateProfileTranslations.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getProfileRole.js\n[object Object]", + "response": "{\"summary\":\"Updates user profile details\",\"description\":\"This endpoint allows for the updating of user profile details based on the provided profile information. The update can include changes in name, roles, and other specific profile attributes that are supported by the system.\\n\\n**Authentication:** Users need to be authenticated to update a profile. The endpoint validates the provided session or authentication token to ensure the request is made by a registered and logged-in user.\\n\\n**Permissions:** The executing user must have admin privileges or specific permission to update user profiles. Any attempt to update a profile without the required permissions will lead to a permission denial error.\\n\\nUpon receiving the update request, the handler first verifies user authentication and checks if the logged-in user has the necessary permissions. It calls the `existName` method to check if the provided new profile name already exists, ensuring uniqueness of profile names in the system. The `update` function is then executed from 'profiles/index.js', with parameters gathered from the request body, to apply the updates in the user database. This process involves interaction with several services to correctly update all elements related to the user profile, including roles and permissions. The success or failure of the operation, along with the updated profile details, is then sent back to the user in the form of a JSON response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-addStudentsToClassesUnderNodeTreeRest.request.txt b/packages/leemons-openapi/lib/requests/programs-addStudentsToClassesUnderNodeTreeRest.request.txt new file mode 100644 index 0000000000..a509b84be0 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-addStudentsToClassesUnderNodeTreeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addStudentsToClassesUnderNodeTreeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/addStudentsToClassesUnderNodeTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramTreeTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/addStudentsToClassesUnderNodeTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getClassesUnderNodeTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTreeNodes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramKnowledges.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjectTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/getManagers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClassStudents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]", + "response": "{\"summary\":\"Add students to classes linked with specific program node trees\",\"description\":\"This endpoint facilitates the dynamic enrollment of students into classes that fall under a given program's node tree structure. It primarily handles the automation of student-class assignments based on the hierarchical definitions and dependencies within the program nodes.\\n\\n**Authentication:** User authentication is required to ensure that only authorized personnel can manage and carry out student enrolments. An unauthorized, or improperly authenticated request will be denied access.\\n\\n**Permissions:** This action requires administrative permissions related to student management and program modifications. Only users with the necessary permissions can execute additions of students to classes.\\n\\nThe process starts by accepting a request which specifies the particular node tree and the students targeted for enrollment. It then invokes the `addStudentsToClassesUnderNodeTree` method, defined in the `backend/core/programs` directory. This method examines the node tree to delineate the classes affected. Subsequently, it iterates over the list of students, enrolling each into the appropriate classes defined under the node tree hierarchy. The entire operation is transactional, ensuring that all enrollments are either completed successfully or rolled back in case of an error, maintaining data integrity throughout the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-deleteProgramRest.request.txt b/packages/leemons-openapi/lib/requests/programs-deleteProgramRest.request.txt new file mode 100644 index 0000000000..4ba7348f7e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-deleteProgramRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteProgramRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/removeProgramByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programsByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramTreeTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/removeClassesByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/removeSubjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/removeSubjectCreditsBySubjectsIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/removeGroupByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/removeCourseByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/substages/removeSubstageByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/removeProgramConfigsByProgramIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/removeProgramCentersByProgramIds.js\n[object Object]", + "response": "{\"summary\":\"Delete specified academic programs\",\"description\":\"This endpoint allows for the deletion of one or more academic programs based on their unique identifiers. The deletion process removes the program entries and associated entities such as courses, groups, and student records from the academic portfolio system.\\n\\n**Authentication:** Users need to be authenticated to initiate deletion requests. Requests lacking proper authentication will be rejected, ensuring secure access to resource modifications.\\n\\n**Permissions:** Administrative-level permissions are required to delete academic programs. Users must have specific roles or privileges that grant them rights to alter or remove academic records, ensuring adherence to institutional policies.\\n\\nUpon receiving a request, the endpoint verifies user authentication and permissions. If these checks are satisfactory, it proceeds to call the `removeProgramByIds` method. This method coordinates with various service layers to ensure all related records, such as courses tied to the programs, are also identified and deleted. This comprehensive approach ensures data integrity and frees up resources previously allocated to the now-deleted programs. After successful deletion, a confirmation is sent back to the requestor indicating the status of the deletion process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-detailProgramRest.request.txt b/packages/leemons-openapi/lib/requests/programs-detailProgramRest.request.txt new file mode 100644 index 0000000000..b2076ea2b6 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-detailProgramRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'detailProgramRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programsByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramTreeTypes.js\n[object Object]", + "response": "{\"summary\":\"Details of a specific academic program\",\"description\":\"This endpoint retrieves comprehensive details of an academic program, including its structure, associated courses, subjects, and any other relevant information. It aims to provide users with a complete view of an academic program's configuration and offerings.\\n\\n**Authentication:** User must be authenticated to access the details of the academic program. Without proper authentication, the request will not proceed further.\\n\\n**Permissions:** Access to this endpoint is restricted to users who have permissions to view academic program details. Typically, this includes educational administrators, academic staff, or students who are part of the specified program.\\n\\nUpon receiving a request, the endpoint first validates the user authentication and checks for the necessary permissions. If validation is successful, it calls the `getDetailedProgram` method in the academic portfolio's program service. This method orchestrates several sub-methods to gather information about programs, their courses, subjects, and associated class groups from various parts of the database. It assembles all this data into a structured format that effectively represents the hierarchy and sequence of educational components within the program. The final response includes detailed information about the program, structured in a clear, readable JSON format to the client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-duplicateProgramRest.request.txt b/packages/leemons-openapi/lib/requests/programs-duplicateProgramRest.request.txt new file mode 100644 index 0000000000..8756fac82a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-duplicateProgramRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'duplicateProgramRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/duplicateProgramByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programsByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramTreeTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/substages/duplicateSubstageByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/duplicateGroupByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/duplicateCourseByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/duplicateSubjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/duplicateSubjectCreditsBySubjectsIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/duplicateProgramCentersByProgramIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/duplicateProgramConfigsByProgramIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/duplicateClassesByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/processScheduleForClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClassStudentsMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addClassStudents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]", + "response": "{\"summary\":\"Duplicate academic programs based on specified IDs\",\"description\":\"This endpoint duplicates one or more academic programs using their unique identifiers. The duplication process includes copying all details, configurations, associated subjects, courses, and any related entities under the programs to create new instances of each with new identifiers.\\n\\n**Authentication:** Users must be authenticated to use this endpoint. Unauthenticated users or those with invalid tokens will be denied access.\\n\\n**Permissions:** This endpoint requires administrative privileges or specific academic management permissions. Users without these permissions will be unable to execute the duplication process.\\n\\nThe endpoint begins by validating the provided program IDs against the database to ensure they exist and are accessible under the user's privileges. Subsequently, it invokes the `duplicateProgramByIds` method in the backend 'programs' core, which handles the intricacies of the duplication. This includes deep cloning of program configurations, subjects linked to the program, associated courses, and any other nested entities. Each cloned item is saved with new IDs ensuring no conflicts in the database. On successful completion, the endpoint responds with the IDs of the newly created programs, signifying a successful duplication.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-getProgramEvaluationSystemRest.request.txt b/packages/leemons-openapi/lib/requests/programs-getProgramEvaluationSystemRest.request.txt new file mode 100644 index 0000000000..2fcf89176f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-getProgramEvaluationSystemRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getProgramEvaluationSystemRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramEvaluationSystem.js\n[object Object]", + "response": "{\"summary\":\"Retrieve the program's evaluation system\",\"description\":\"This endpoint facilitates the retrieval of the evaluation system specifics for a given academic program. The focus is on providing detailed settings pertaining to how program performances are assessed, including grading schemes and evaluation procedures.\\n\\n**Authentication:** User authentication is a prerequisite for accessing this information. An absence of proper authentication will prevent access to the endpoint.\\n\\n**Permissions:** This endpoint requires that the user has administrative rights within the academic program. Specific permission checks include verifying user roles such as administrator or faculty member before proceeding.\\n\\nUpon receiving a request, this handler invokes the `getProgramEvaluationSystem` method from the `programs` core module. This method performs a query to fetch the evaluation system details from the program's data storage by leveraging the program identifier provided in the request. The comprehensive flow from request to response ensures that only authorized and authenticated users can access precise and relevant evaluation system data, adhered to predetermined permission protocols. The successful completion of the query resolves in transmitting the evaluation system data back to the requester through a meticulously structured JSON response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-getProgramTreeRest.request.txt b/packages/leemons-openapi/lib/requests/programs-getProgramTreeRest.request.txt new file mode 100644 index 0000000000..c390e38e17 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-getProgramTreeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getProgramTreeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramTreeTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTreeNodes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/common/getTree.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramKnowledges.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjectTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/getManagers.js\n[object Object]", + "response": "{\"summary\":\"Fetch the hierarchical structure of academic programs\",\"description\":\"This endpoint retrieves the hierarchical tree structure representing the organization of academic programs, detailing each level from general program categorizations down to specific subjects. The tree format aids in visualizing the relationship and dependency among various components of the programs.\\n\\n**Authentication:** Access requires users to be authenticated to ensure data security and integrity. Users must provide valid session tokens to proceed with data retrieval.\\n\\n**Permissions:** Users must have 'view_program' permissions to access this data. Attempting to access the endpoint without adequate permissions will result in an authorization error.\\n\\nUpon receiving a request, the endpoint first verifies the user's authentication and permissions. If the checks pass, it proceeds to call the method `getProgramTree` from the core 'programs' module. This method consults the database to gather comprehensive details of all academic program elements, organized in a hierarchical tree structure. The result encapsulates the relationships and dependencies in the program, aiming to provide a clear and useful representation for academic administration purposes. Each node in the tree typically represents a different level or component within the overall program structure, starting from general categories and moving down to specific courses and subjects.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-getUserProgramsRest.request.txt b/packages/leemons-openapi/lib/requests/programs-getUserProgramsRest.request.txt new file mode 100644 index 0000000000..fc4d74eeac --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-getUserProgramsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getUserProgramsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getUserPrograms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getUserProgramIds.js\n[object Object]", + "response": "{\"summary\":\"Retrieve academic programs associated with a user\",\"description\":\"This endpoint fetches all academic programs linked to a specific user within the academic portfolio platform. It is designed to provide an overview of the user's educational engagements and progress.\\n\\n**Authentication:** Users are required to be authenticated in order to access their list of academic programs. Authentication ensures that users only access programs where they have permissions or roles associated.\\n\\n**Permissions:** The user must have appropriate permissions or roles related to educational oversight or student status. Typically, only administrative staff or the users themselves can view their own academic program information.\\n\\nThe endpoint first validates the user's authentication token to establish session legitimacy. It then proceeds to invoke the `getUserPrograms` method from the programs core logic. This method accesses the database to retrieve all entries under the programs table associated with the user’s ID. The method extracts program data such as program name, status, and associated courses. Finally, it returns this compiled data in a JSON format as the response to the client, ensuring the user has a comprehensive view of their academic engagements.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-haveProgramsRest.request.txt b/packages/leemons-openapi/lib/requests/programs-haveProgramsRest.request.txt new file mode 100644 index 0000000000..d196cd087d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-haveProgramsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'haveProgramsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/havePrograms.js\n[object Object]", + "response": "{\"summary\":\"Check availability of academic programs\",\"description\":\"This endpoint checks whether there are any academic programs available in the system. It does not specify the details of the programs, but simply confirms their existence or non-existence.\\n\\n**Authentication:** Users must be authenticated to enquire about the availability of academic programs. Unauthenticated requests will be denied.\\n\\n**Permissions:** Users need specific permissions to view the status of academic programs. Without these permissions, the endpoint will not provide any information.\\n\\nUpon receiving a request, the endpoint accesses the `havePrograms` method in the `programs` core module. This method queries the system's database to check for any entries under the academic programs category. The process includes validating the user's credentials and permissions before proceeding with the database query. The response from this method will clearly indicate whether academic programs are available or not, without disclosing specific details about the programs.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-listProgramRest.request.txt b/packages/leemons-openapi/lib/requests/programs-listProgramRest.request.txt new file mode 100644 index 0000000000..42237870c5 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-listProgramRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listProgramRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/listPrograms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getUserProgramIds.js\n[object Object]", + "response": "{\"summary\":\"List all academic programs available to a user\",\"description\":\"This endpoint lists all academic programs that are accessible based on the user's role or permissions within the educational platform. It typically filters and returns a collection of programs that the user is either enrolled in or has administrative access to.\\n\\n**Authentication:** User authentication is required to access the list of programs. Users must provide valid authentication credentials to proceed. An insufficient or missing authentication token will restrict access to the program's information.\\n\\n**Permissions:** Users need specific permissions related to viewing academic programs. Typically, these permissions include roles like academic staff, administrator, or student permissions that allow them to view detailed program data.\\n\\nUpon receiving a request, the `listPrograms` method in the `programs` core is called. This method verifies the context of the user's request, checking for authentication and necessary permissions. Based on the authenticated user's role and permissions, it queries the database for accessible academic programs. The method then processes the received data, filtering and structuring the programs into a suitable format for response. Finally, a structured list of programs is sent back to the user in JSON format, encapsulating key details like program names, descriptions, and eligibility criteria.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-postProgramRest.request.txt b/packages/leemons-openapi/lib/requests/programs-postProgramRest.request.txt new file mode 100644 index 0000000000..157992736c --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-postProgramRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postProgramRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/addProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/substages/addSubstage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/addCourse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/getNextCourseIndex.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/addNextCourseIndex.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programsByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramTreeTypes.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/cycle/addCycle.js\n[object Object]", + "response": "{\"summary\":\"Add a new academic program to the system\",\"description\":\"This endpoint facilitates the addition of a new academic program into the academic portfolio management system. It involves creating a detailed record that describes all aspects of an academic program, such as its structure, subjects, and related courses.\\n\\n**Authentication:** User must be logged in to access this endpoint. Authentication ensures that only registered users can insert new academic programs into the system.\\n\\n**Permissions:** The user must have administrative rights or be granted specific permissions related to academic management to add a program. Without the necessary permissions, the endpoint access is restricted and the operation will not be executed.\\n\\nAfter receiving the API call, the handler initiates the `addProgram` method in the programs core API. This method processes input data, which includes program details such as name, description, and configuration settings. Once validated, the data is stored in the database, creating a new program. Upon successful creation, the system sends back a confirmation response including the ID of the newly created program, indicating successful operation. Throughout this process, the system ensures that all inputs are correctly formatted and that the user has the appropriate rights to perform the operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-programCoursesRest.request.txt b/packages/leemons-openapi/lib/requests/programs-programCoursesRest.request.txt new file mode 100644 index 0000000000..07e5f41ed4 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-programCoursesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'programCoursesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]", + "response": "{\"summary\":\"Fetch program courses associated with a specific academic program\",\"description\":\"This endpoint retrieves a list of all courses associated with a specified academic program. The result includes detailed information about each course such as titles, credits, and other relevant academic details.\\n\\n**Authentication:** Users must be authenticated to access the program courses list. An invalid or missing authentication token will result in access denial.\\n\\n**Permissions:** Users need to have the 'view_program_courses' permission to retrieve the list of courses. Without this permission, access to course information will be restricted.\\n\\nUpon receiving a request, this endpoint initiates by calling the `getProgramCourses` method from the `programs` core service. This method takes the program's identification details from the request parameters and queries the database to fetch all courses linked to the specified program. The method processes the data to format it appropriately, ensuring that all relevant academic information is included and well-presented in the response. Finally, the endpoint responds with a structured JSON containing the courses data, facilitating easy consumption and integration on the client side.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-programGroupsRest.request.txt b/packages/leemons-openapi/lib/requests/programs-programGroupsRest.request.txt new file mode 100644 index 0000000000..d14b44b9cf --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-programGroupsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'programGroupsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]", + "response": "{\"summary\":\"Manage academic program groups information\",\"description\":\"This endpoint allows for the administration of academic program groups within the platform, facilitating the creation, modification, and querying of program group details associated with different academic programs.\\n\\n**Authentication:** Access to this endpoint requires the user to be authenticated. Users who are not authenticated will not be able to execute operations related to program groups.\\n\\n**Permissions:** Users need to have specific permissions based on their roles such as administrator or academic staff to interact with program groups. This ensures that only authorized personnel can manage academic program data.\\n\\nThe endpoint begins by handling incoming requests in the `programs.rest.js` service. Depending on the request type, it then calls the appropriate method in the `programs/index.js` core file. For instance, if the request is to fetch program groups, the `getProgramGroups` method in `getProgramGroups.js` is activated. This method takes care of fetching all relevant program group details from the database, based on the program ID supplied through the request. The flow involves parsing the request data, validating user credentials and permissions, querying the database, and finally structuring the response that includes the program groups details formatted as a JSON object. This structured flow ensures a secure and efficient process from request to response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-programHasCoursesRest.request.txt b/packages/leemons-openapi/lib/requests/programs-programHasCoursesRest.request.txt new file mode 100644 index 0000000000..95372eaa59 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-programHasCoursesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'programHasCoursesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]", + "response": "{\"summary\":\"Checks if a program includes certain courses\",\"description\":\"This endpoint determines if a specified academic program includes one or more specific courses. It is typically used to verify program curriculum completeness or to assist in academic planning and advising.\\n\\n**Authentication:** Users need to be authenticated to access this endpoint. Unauthorized access attempts will be blocked and logged.\\n\\n**Permissions:** This function requires the user to have 'view_program_courses' permission. Without the necessary permissions, access to the data will be denied, and only a generic error message will be returned to the user.\\n\\nUpon receiving a request, the handler first authenticates the user and checks for the necessary permissions. If validation fails at any point, the process is terminated, and an appropriate error message is returned. If the checks are successful, the handler invokes the `getProgramCourses` method from the `programs` core module, passing the program's identification details. This method accesses the database to retrieve a list of courses associated with the specified program; it performs this by querying the program-course relationship data. Once the data is obtained and processed, the handler constructs a response containing information about whether the required courses are part of the program, then sends this response to the requester.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-programHasGroupsRest.request.txt b/packages/leemons-openapi/lib/requests/programs-programHasGroupsRest.request.txt new file mode 100644 index 0000000000..57670bf560 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-programHasGroupsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'programHasGroupsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]", + "response": "{\"summary\":\"Check membership of programs and their groups\",\"description\":\"This endpoint verifies if the specified programs contain any group associations and returns the membership status. The process determines the linkage between programs and their respective groups within the academic portfolio system.\\n\\n**Authentication:** Access to this endpoint requires the user to be authenticated. Failure to provide valid authentication details will prevent access to the endpoint functionality.\\n\\n**Permissions:** Users need to have specific permissions related to viewing or managing academic programs and groups. Without the requisite permissions, the request will not proceed.\\n\\nThe controller for this endpoint initiates by calling the `getProgramGroups` method from the `programs` core module. This method checks for existing group associations within each program by interacting with the database to retrieve all group links associated with the provided program IDs. It meticulously filters and aggregates the data to ensure that only relevant program-group relationships are considered. After processing, the endpoint compiles the results into a structured format and returns this information to the client, indicating which programs are associated with which groups, thereby facilitating effective academic management and planning.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-programHasSubstagesRest.request.txt b/packages/leemons-openapi/lib/requests/programs-programHasSubstagesRest.request.txt new file mode 100644 index 0000000000..a0328e4c4b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-programHasSubstagesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'programHasSubstagesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]", + "response": "{\"summary\":\"Determine if a program contains any substages\",\"description\":\"This endpoint checks if a specific academic program contains any substages or not. The primary operation of this endpoint is to ascertain the substage structure within a particular program, which is crucial for managing educational program layouts.\\n\\n**Authentication:** User authentication is mandatory to access this endpoint. Users must provide valid session credentials to proceed with querying the academic program substages.\\n\\n**Permissions:** Appropriate permissions are required to access this endpoint. Users should possess the 'view_programs' permission or similar rights that allow them to interact with academic program data.\\n\\nUpon receiving a request, the handler `programHasSubstagesRest` calls the `getProgramSubstages` method in the `programs` core. This method fetches the program details based on the provided program ID and evaluates whether there are any associated substages. The flow includes validating the user’s credentials and permissions, retrieving the program data from the database, and analyzing the presence of substages. The result, indicating either the existence or absence of substages, is then returned as a Boolean value to the client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-programSubstagesRest.request.txt b/packages/leemons-openapi/lib/requests/programs-programSubstagesRest.request.txt new file mode 100644 index 0000000000..7f309c5e01 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-programSubstagesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'programSubstagesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]", + "response": "{\"summary\":\"Manage academic program sub-stages\",\"description\":\"This endpoint manages the sub-stages of an academic program. It typically involves updating, retrieving, or deleting details related to various sub-stages within a specified academic program in the database.\\n\\n**Authentication:** The user must be authenticated to modify or access sub-stage information. Authentication ensures that only authorized users can manage such sensitive educational data.\\n\\n**Permissions:** The endpoint requires specific academic management permissions. Users need to have roles that include rights to modify educational structures or privileges to view program details.\\n\\nThe controller typically interacts with multiple core methods to handle the request effectively. Initially, it might check user authentication and authorization, followed by either fetching data using `getProgramSubstages` from the `programs` core or updating and deleting sub-stage information. This process may also include validation of input data to ensure integrity and appropriateness according to academic standards and database schemas. The results or confirmations are then sent back to the user, encapsulated in the HTTP response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/programs-putProgramRest.request.txt b/packages/leemons-openapi/lib/requests/programs-putProgramRest.request.txt new file mode 100644 index 0000000000..67d09080f6 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/programs-putProgramRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putProgramRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/updateProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/saveManagers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programsByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubstages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramGroups.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramSubjects.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramCycles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/getProgramTreeTypes.js\n[object Object]", + "response": "{\"description\":\"{\\n \\\"summary\\\": \\\"Updates an academic program\\\",\\n \\\"description\\\": \\\"This endpoint updates the details of an existing academic program based on the program ID provided. The updated details can include changes to the program's name, duration, associated courses, and other relevant academic parameters.\\n\\n**Authentication:** Users must be logged in to update an academic program. The system checks for a valid session token before processing the request.\\n\\n**Permissions:** The user needs to have 'program_update' permissions. Without the necessary permissions, the request will be rejected, and an authorization error will be returned.\\n\\nAfter receiving the request, the endpoint first authenticates the user and checks for the necessary permissions. It then processes the incoming data, validates the provided program ID, and uses the `updateProgram` method from the programs core to apply the changes to the database. This method interacts with the database to update the respective entries for the academic program. Upon successfully updating the program, a confirmation message is sent back to the user in the response, along with the updated program details. If there are any issues, such as the program not existing or invalid data, the endpoint returns an appropriate error message.\\\"\\n}\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/providers-deleteConfigRest.request.txt b/packages/leemons-openapi/lib/requests/providers-deleteConfigRest.request.txt new file mode 100644 index 0000000000..7af49364b9 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/providers-deleteConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/provider.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/provider.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/settings/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/settings/setActiveProvider/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/settings/setActiveProvider/setActiveProvider.js\n[object Object]", + "response": "{\"summary\":\"Delete a specific configuration setting\",\"description\":\"This endpoint handles the deletion of a specific configuration setting in the system. Given an ID, it will permanently remove the associated configuration from the database.\\n\\n**Authentication:** User must be logged in to execute this action. Authentication ensures that only valid and authorized users can delete configuration settings.\\n\\n**Permissions:** Specific 'admin' permissions are required to delete configuration settings. Users without the requisite permissions will be denied access to this endpoint.\\n\\nUpon receiving a DELETE request, the `deleteConfigRest` method first verifies the user's authentication and permissions. After validation, it proceeds to call the internal `deleteConfigById` service method, passing the unique configuration ID from the request. This service method interacts with the database to delete the specified configuration setting. If the operation is successful, the endpoint returns a confirmation message stating that the setting has been deleted. In case of errors during processing, appropriate error messages are generated and returned to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/providers-listRest.request.txt b/packages/leemons-openapi/lib/requests/providers-listRest.request.txt new file mode 100644 index 0000000000..39743659df --- /dev/null +++ b/packages/leemons-openapi/lib/requests/providers-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/provider.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/provider.rest.js\n[object Object]", + "response": "{\"summary\":\"Lists all resources in the Leebrary system\",\"description\":\"This endpoint facilitates the retrieval of all available resources stored within the Leebrary system. It filters and presents data based on specific query parameters such as resource type, tags, and user permissions, making it an essential tool for efficient resource management.\\n\\n**Authentication:** User authentication is required to access this endpoint. Users must provide a valid token that will be verified to ensure legitimacy and authority over the requested resources. Unauthorized access attempts will be logged and denied.\\n\\n**Permissions:** Users need to have the 'read_resources' permission to access the list of resources. This permission checks that the user has the requisite rights to view the resources in their query scope. Lack of required permissions will result in denial of access to the resource data.\\n\\nThe 'listRest' handler begins by validating the user's authentication status and permissions. Following successful validation, it utilizes the `getAllResources` method from the `ResourceService`. This method takes into account various filters such as resource type and user-specific tags. It interacts directly with the database to fetch all relevant resources, ensuring all security and privacy guidelines are adhered to. The fetched data is then compiled into a tuple or list and returned in a structured JSON format as the response to the client, effectively encapsulating all accessible resources as per user credentials and query parameters.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/providers-setConfigRest.request.txt b/packages/leemons-openapi/lib/requests/providers-setConfigRest.request.txt new file mode 100644 index 0000000000..0a298bab52 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/providers-setConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/provider.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/services/rest/provider.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/settings/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/settings/setProviderConfig/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/settings/setProviderConfig/setProviderConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/settings/setActiveProvider/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-leebrary/backend/core/settings/setActiveProvider/setActiveProvider.js\n[object Object]", + "response": "{\"summary\":\"Configures provider settings for the application\",\"description\":\"This endpoint is responsible for updating or setting the configuration parameters for a specified provider within the application. It primarily handles the integration settings that are essential for the functionality of external services or APIs used by the application.\\n\\n**Authentication:** User authentication is mandatory to ensure that only authorized personnel can alter provider configurations. An absence of valid session or authentication tokens results in access denial.\\n\\n**Permissions:** Appropriate permissions must be verified before a user can execute this operation. Typically, administrative or high-level management permissions are required to access and modify provider settings.\\n\\nUpon receiving a request, the endpoint first validates the user's authentication and authorization levels. If validation is successful, it proceeds to fetch the necessary data from the request body. The `setProviderConfig` method from the `Settings` service is then called with this data, updating or establishing the configuration for the chosen provider. The flow concludes with the method either returning a success response indicating that the changes have been applied successfully or an error message detailing why the operation failed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/public-serveFileRest.request.txt b/packages/leemons-openapi/lib/requests/public-serveFileRest.request.txt new file mode 100644 index 0000000000..c40d1f390d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/public-serveFileRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'serveFileRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/public.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/public.rest.js\n[object Object]", + "response": "{\"summary\":\"Serve SCORM content securely\",\"description\":\"This endpoint is responsible for securely delivering SCORM packages to authenticated users. The service ensures that only approved users can access the specific SCORM content, providing a vital layer in content security and compliance with eLearning standards.\\n\\n**Authentication:** User authentication is crucial for this endpoint. Users must provide valid credentials to access SCORM content. The service validates these credentials before serving any content, rejecting access attempts with invalid authentication tokens.\\n\\n**Permissions:** The access to SCORM content is tightly controlled. Users need specific permissions related to eLearning course access, which are verified during the request handling. Lack of adequate permissions results in access being denied.\\n\\nUpon receiving a request, the `serveFileRest` handler first checks the user's authentication status and permissions associated with the SCORM content being requested. It utilizes methods such as `verifyUserAuth` and `checkPermissions` to ensure that these criteria are met. If the user is authenticated and has the necessary permissions, the method then proceeds to fetch the requested SCORM file from the server's secure storage using the `getSCORMFile` method. This process involves accessing the filesystem securely to retrieve and serve the content to the user. The response includes the SCORM package data, delivered in a manner that adheres to HTTP and content security protocols.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/questions-getDetailsRest.request.txt b/packages/leemons-openapi/lib/requests/questions-getDetailsRest.request.txt new file mode 100644 index 0000000000..e5365fec44 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/questions-getDetailsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getDetailsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/questions.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/questions.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/getByIds.js\n[object Object]", + "response": "{\"summary\":\"Fetches question details based on provided IDs\",\"description\":\"This endpoint retrieves detailed information about a set of questions identified by their unique IDs. The operation is meant to gather detailed data including text, options, and expected answers for these questions, which could be used for assessments or information display purposes.\\n\\n**Authentication:** Users need to be authenticated in order to access question details. Unauthenticated requests will be denied access to this endpoint.\\n\\n**Permissions:** The endpoint requires users to have the 'view_questions' permission to ensure that only authorized users can fetch question details. Additional checks may be done against each question ID to verify that the user has access to the specific information.\\n\\nThe endpoint internally calls the `getByIds` method provided by the questions core API. This method takes an array of question IDs from the request and executes a query to retrieve their details from the database. Each question's data is then processed to include necessary information such as question text, choices, correct answers, and any additional metadata. The response from the API encapsulates this data in a structured format, responding back to the client with the requested question details in JSON.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/questionsBanks-deleteQuestionBankRest.request.txt b/packages/leemons-openapi/lib/requests/questionsBanks-deleteQuestionBankRest.request.txt new file mode 100644 index 0000000000..25b1e697ad --- /dev/null +++ b/packages/leemons-openapi/lib/requests/questionsBanks-deleteQuestionBankRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteQuestionBankRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/questionsBanks.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/questionsBanks.rest.js\n[object Object]", + "response": "{\"summary\":\"Deletes a specified question bank\",\"description\":\"This endpoint allows for the deletion of a specific question bank identified by its unique ID. The action ensures that only authorized users can delete a question bank, preserving the integrity and security of the data.\\n\\n**Authentication:** User authentication is required to access this endpoint. Users must supply valid credentials to proceed with the deletion operation.\\n\\n**Permissions:** Appropriate permissions are required to delete a question bank. Typically, users need to have administrative rights or specific role-based permissions to perform deletions on question banks.\\n\\nThe controller initiates the deletion process by verifying the user’s authentication and permissions. If the checks pass, it proceeds to call the `deleteQuestionBank` method, passing the unique ID of the question bank as an argument. This method interacts with the database to remove the corresponding entry. Upon successful deletion, the response confirms the removal of the question bank, providing feedback to the requester about the outcome of the operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/questionsBanks-getQuestionBankDetailRest.request.txt b/packages/leemons-openapi/lib/requests/questionsBanks-getQuestionBankDetailRest.request.txt new file mode 100644 index 0000000000..d0b8140e3d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/questionsBanks-getQuestionBankDetailRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getQuestionBankDetailRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/questionsBanks.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/questionsBanks.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/listQuestionsBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/saveQuestionsBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/removeSubjectsFromQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/addSubjectsToQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/updateCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/createCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/deleteQuestions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/updateQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/createQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/getQuestionsBanksDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/findByAssetIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/deleteQuestionBank.js\n[object Object]", + "response": "{\"summary\":\"Retrieve detailed information about a specific question bank\",\"description\":\"This endpoint fetches comprehensive details about a particular question bank identified by its unique ID. It provides a deep dive into the question bank's attributes, including associated categories, subjects, and individual questions contained within the bank.\\n\\n**Authentication:** Users must be authenticated to access the details of a question bank. Access attempts with invalid or missing authentication tokens will be denied.\\n\\n**Permissions:** The user must have the appropriate permissions to view the question bank details. Generally, this includes permissions like 'view_question_bank' or 'manage_question_bank', depending on the implementation specifics of the security policy in place.\\n\\nThe detailed flow of this controller handler begins with the receipt of the request that includes the question bank ID. The handler invokes the `getQuestionsBanksDetails` method from the `questions-banks` core module. This method is responsible for querying the database to retrieve all relevant data about the question bank, including meta-data, categories, associated subjects, and questions. Depending on the design, it may also involve additional model handlers to fetch related data from different tables or services. The response is then prepared, encapsulating all the fetched information in a well-structured JSON format, which is returned to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/questionsBanks-listQuestionBanksRest.request.txt b/packages/leemons-openapi/lib/requests/questionsBanks-listQuestionBanksRest.request.txt new file mode 100644 index 0000000000..ff7a6f9150 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/questionsBanks-listQuestionBanksRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listQuestionBanksRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/questionsBanks.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/questionsBanks.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/listQuestionsBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/saveQuestionsBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/removeSubjectsFromQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/addSubjectsToQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/updateCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/createCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/deleteQuestions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/updateQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/createQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/getQuestionsBanksDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/findByAssetIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/deleteQuestionBank.js\n[object Object]", + "response": "{\"summary\":\"Lists all question banks available to the user\",\"description\":\"This endpoint lists all the question banks that the user has access to, providing essential details for each question bank such as name, description, and related subjects. It is primarily used in educational platforms where question banks play a critical role in organizing quizzes and exams.\\n\\n**Authentication:** Users need to be authenticated to view the list of question banks. Unauthorized access requests will be rejected, requiring valid login credentials for access.\\n\\n**Permissions:** The user must have the 'view_question_banks' permission to access this endpoint. Additional permissions might be required to view detailed contents of each question bank, depending on the platform's configuration.\\n\\nThis handler initiates by calling the `listQuestionsBanks` method from the `questions-banks` core module. This method performs a query to retrieve all question banks that the current user is authorized to view based on their roles and permissions. The logic involves checking user permissions, filtering question banks according to these permissions, and finally compiling the data into a structured format. The response is then formatted to JSON and includes a list of question banks along with relevant attributes like bank ID, name, and description.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/questionsBanks-saveQuestionBanksRest.request.txt b/packages/leemons-openapi/lib/requests/questionsBanks-saveQuestionBanksRest.request.txt new file mode 100644 index 0000000000..e41727f0a8 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/questionsBanks-saveQuestionBanksRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveQuestionBanksRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/questionsBanks.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/questionsBanks.rest.js\n[object Object]", + "response": "{\"summary\":\"Store and manage question banks\",\"description\":\"This endpoint allows for the creation or updating of question banks in a centralized repository. It supports operations such as adding new questions, modifying existing questions, and organizing these questions into structured banks that can be used across various tests or assessments.\\n\\n**Authentication:** Users need to be authenticated to interact with the question banks. Only authenticated requests will be processed, and unauthorized access attempts will result in a denial of the service.\\n\\n**Permissions:** This endpoint requires administrative permissions related to question bank management. Users need specific roles or privileges to create or modify the content of question banks.\\n\\nUpon receiving a request, this handler validates the user's authentication and permissions to ensure they are eligible to modify or create question banks. It then proceeds to apply the provided changes to the database, either adding new entries or updating existing ones based on the supplied data. The operation might involve various method calls within the service to handle different aspects of the question bank management, such as validation of input data, enforcement of business rules, and the actual data persistence in the database. The response to the client will confirm the successful execution of the operation or provide error messages detailing any issues encountered during the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/regionalConfig-deleteRest.request.txt b/packages/leemons-openapi/lib/requests/regionalConfig-deleteRest.request.txt new file mode 100644 index 0000000000..069bb0f9d8 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/regionalConfig-deleteRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/services/rest/regionalConfig.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/services/rest/regionalConfig.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/core/regional-config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/core/regional-config/deleteRegionalConfig.js\n[object Object]", + "response": "{\"summary\":\"Delete a specific regional configuration\",\"description\":\"This endpoint handles the deletion of a specific regional configuration in the academic calendar system. By targeting a unique identifier, it allows for precise removal of regional configurations which are no longer needed or valid within the system.\\n\\n**Authentication:** Users need to be authenticated to perform deletion operations. Proper authentication ensures that only authorized users can delete configurations, preventing unauthorized changes.\\n\\n**Permissions:** Users must have administrative permissions specifically for managing regional configurations. These permissions ensure that only users with the correct access rights can carry out deletions, maintaining system integrity.\\n\\nThe process begins with the controller action, which invokes the `deleteRegionalConfig` method from the `regional-config` core. This method utilizes the passed identifier to locate and verify the existence of the configuration in the database. If found, it proceeds to delete the configuration. Upon successful deletion, a confirmation is sent back to the user, otherwise, an error message is generated indicating the failure of the operation. Each step carefully checks and logs the progress to ensure accuracy and traceability.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/regionalConfig-listRest.request.txt b/packages/leemons-openapi/lib/requests/regionalConfig-listRest.request.txt new file mode 100644 index 0000000000..2ccfba3c0a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/regionalConfig-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/services/rest/regionalConfig.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/services/rest/regionalConfig.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/core/regional-config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/core/regional-config/listRegionalConfigs.js\n[object Object]", + "response": "{\"summary\":\"List all regional configurations available\",\"description\":\"This endpoint fetches the list of all regional configurations applicable across different geographic or institutional setups. It is primarily used to gather all configurations that can be applied to academic calendars based on regional differences.\\n\\n**Authentication:** Users must be authenticated to retrieve regional configuration data. An absence of a valid authentication mechanism will prevent access to this endpoint.\\n\\n**Permissions:** This endpoint requires that the user have administrative rights or specific permissions related to managing or viewing academic configurations, ensuring that only authorized personnel handle sensitive regional setup data.\\n\\nUpon being called, this handler initiates a process by calling the `listRegionalConfigs` function from the academic calendar plugin's backend core. The process includes querying the database for entries that define various regional settings within the scope of academic activities. Each entry typically covers details such as dates, holidays, and other regional-specific information pertinent to the academic calendar. The resulting data is then formatted appropriately and returned as a JSON array, providing a comprehensive overview of all regional configurations stored in the system. Each configuration detailed helps in tailoring the academic system to better fit local needs and regulations.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/regionalConfig-saveRest.request.txt b/packages/leemons-openapi/lib/requests/regionalConfig-saveRest.request.txt new file mode 100644 index 0000000000..4674a36ea5 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/regionalConfig-saveRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/services/rest/regionalConfig.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/services/rest/regionalConfig.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/core/regional-config/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/core/regional-config/saveRegionalConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-calendar/backend/validations/forms.js\n[object Object]", + "response": "{\"summary\":\"Save regional configuration settings\",\"description\":\"This endpoint is responsible for saving the regional configurations for an academic calendar. The configurations may include settings like timezone, holiday schedules, and academic periods specific to a region or institution.\\n\\n**Authentication:** Users must be authenticated to modify regional configurations. An absence of valid authentication will prevent access to this endpoint.\\n\\n**Permissions:** Appropriate permissions are required to access this endpoint. Typically, only users with administrative rights or specific roles such as 'Academic Administrator' can update regional settings.\\n\\nUpon receiving the request, the handler in 'regionalConfig.rest.js' invokes the 'saveRegionalConfig' method from the 'regional-config' core module. This method processes the input data, ensuring all necessary validations are met, using the validation schema defined in 'forms.js'. If the data passes all validations, it proceeds to update or create the regional settings in the database. The result of this operation is then formulated into a response that confirms the success of the operation or provides error messages in case of failure.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/report-generateRest.request.txt b/packages/leemons-openapi/lib/requests/report-generateRest.request.txt new file mode 100644 index 0000000000..c886fbecdb --- /dev/null +++ b/packages/leemons-openapi/lib/requests/report-generateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'generateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-fundae/backend/services/rest/report.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-fundae/backend/services/rest/report.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-fundae/backend/core/report/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-fundae/backend/core/report/generate.js\n[object Object]", + "response": "{\"summary\":\"Generate detailed report for Fundae requirements\",\"description\":\"This endpoint is responsible for generating a comprehensive report based on Fundae training activities, ensuring that the dataset conforms to specific regulatory and operational standards set by Fundae. The generated reports aim to assist in administrative, compliance, and educational analysis.\\n\\n**Authentication:** Users must be authenticated and hold valid session credentials to initiate report generation. The API requires authentication tokens that validate user identity and session legitimacy.\\n\\n**Permissions:** The endpoint demands high-level permissions, specifically administrative or managerial access. Users without sufficient permissions cannot trigger the generation process or access the resulting data.\\n\\nUpon request, the `generateReport` handler in `report.rest.js` initiates the generation process. It calls upon the `ReportService` from the core, which in turn utilizes `generate.js` to execute the data compilation and report structuring. The process involves querying multiple databases and aggregating data relevant to Fundae standards, followed by applying business logic to format and finalize the report. This is meticulously designed to ensure accuracy and compliance with Fundae's requirements. The response is a detailed JSON object representing the outcomes of the report generation, usually in a format suitable for immediate application use or further administrative processing.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/report-listRest.request.txt b/packages/leemons-openapi/lib/requests/report-listRest.request.txt new file mode 100644 index 0000000000..9ebaeb944d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/report-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-fundae/backend/services/rest/report.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-fundae/backend/services/rest/report.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-fundae/backend/core/report/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-fundae/backend/core/report/listReports.js\n[object Object]", + "response": "{\"summary\":\"List all reports accessible by the user\",\"description\":\"This endpoint lists all the reports generated by the system that the authenticated user has access to. The reports can vary from usage statistics to performance analytics, depending on the user's role and permissions in the system.\\n\\n**Authentication:** User authentication is required to ensure secure access to the reports. Only authenticated users can retrieve their available reports list.\\n\\n**Permissions:** The user needs to have 'view_reports' permission to access this endpoint. If the user does not have the necessary permissions, the endpoint will return an unauthorized access error.\\n\\nUpon receiving a request, the `listReports` handler in the `ReportService` first checks for user authentication and required permissions. If authentication or permissions checks fail, it returns an appropriate error response. If the checks pass, it invokes the `listAllReports` method from the `Report` core. This core method queries the database for reports accessible to the user, based on their roles and permissions, and returns a structured list of report data. This data is then formatted appropriately and sent back to the user as a JSON response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/report-retryRest.request.txt b/packages/leemons-openapi/lib/requests/report-retryRest.request.txt new file mode 100644 index 0000000000..d4690a0f62 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/report-retryRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'retryRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-fundae/backend/services/rest/report.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-fundae/backend/services/rest/report.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-fundae/backend/core/report/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-fundae/backend/core/report/generate.js\n[object Object]", + "response": "{\"summary\":\"Performs retry operations on previously failed report generation tasks\",\"description\":\"This endpoint initiates retry operations for previously failed report generation tasks. It processes the failed tasks queued in the system and attempts to regenerate the reports based on the newer parameters or fixed logic implemented after the initial failure.\\n\\n**Authentication:** User authentication is required to access this endpoint. Only authenticated users with valid session tokens can initiate retry operations for report generation.\\n\\n**Permissions:** Users need to have specific administrative permissions to execute retry tasks on report generation. These permissions ensure that only authorized personnel manage and execute retries for critical data processing tasks.\\n\\nUpon receiving the retry request, the endpoint invokes the `retryReportGeneration` method from the `ReportService`. This method scans the queued logs for any reports that failed to generate initially. It then processes these logs to determine the cause of failure and applies fixes or updates parameters as needed. Subsequently, it attempts to regenerate the reports. The entire flow from checking the queue to processing and regenerating reports is managed within a transactional block to ensure data integrity and consistency. The outcome of each retry attempt, whether successful or failure, is logged for auditing purposes and returned in the response to provide feedback on the retry operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/roles-addRest.request.txt b/packages/leemons-openapi/lib/requests/roles-addRest.request.txt new file mode 100644 index 0000000000..a7e2080bfb --- /dev/null +++ b/packages/leemons-openapi/lib/requests/roles-addRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/roles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/roles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/markAllUsersInGroupToReloadPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/detailByUri.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/transformArrayToObject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/updateWithRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/checkIfCanCreateNUserAgentsInGroup.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/addWithRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existByName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/manyPermissionsHasManyActions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/hasActionMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/addPermissionMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/searchUsersWithRoleAndMarkAsReloadPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/removeUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/existUserAgent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/addUserAgent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/create.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/list.js\n[object Object]", + "response": "{\"summary\":\"Add role information into the system\",\"description\":\"This endpoint allows for the addition of new role data into the system. It specifically handles the creation of roles along with their respective permissions and associated details within the user management module of the platform.\\n\\n**Authentication:** Users must be logged in to create new roles. This endpoint requires a valid authentication token, which should be included in the request headers.\\n\\n**Permissions:** Users need to have 'create_role' permission to access this endpoint. Without this permission, the endpoint will deny the request, ensuring that only authorized users can add new roles.\\n\\nUpon receiving a request, the `add` action in the roles management service is called. The service first checks for the necessary permissions against the user's role. If validated, it processes the provided data to ensure it meets the format and validation standards set by the platform. Once the data is validated, it interacts with the underlying database to insert the new role record. A response is then generated based on the outcome of the database operation - success if the role is added correctly, or an error message detailing any issues encountered during the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/roles-detailRest.request.txt b/packages/leemons-openapi/lib/requests/roles-detailRest.request.txt new file mode 100644 index 0000000000..aee9f04053 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/roles-detailRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'detailRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/roles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/roles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/markAllUsersInGroupToReloadPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/detailByUri.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/transformArrayToObject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/updateWithRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/checkIfCanCreateNUserAgentsInGroup.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/addWithRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existByName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/manyPermissionsHasManyActions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/hasActionMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/addPermissionMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/searchUsersWithRoleAndMarkAsReloadPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/removeUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/existUserAgent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/addUserAgent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/create.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/list.js\n[object Object]", + "response": "{\"summary\":\"Provides detailed information about a specific role\",\"description\":\"This endpoint retrieves detailed information about a specified role within the system, including all related permissions, users associated with the role, and system-wide implications of the role.\\n\\n**Authentication:** This endpoint requires that the user must be logged in to access this information. Unauthenticated attempts to access this endpoint will be rejected.\\n\\n**Permissions:** The user needs to have 'admin' level permissions to view detailed role information. Attempting to access without sufficient permissions will result in access denial.\\n\\nThe process initiated by this endpoint involves fetching role details primarily from the `getRoleDetails` function within the `roles` service. The function queries the database to gather comprehensive details about the role, including linked permissions and users. Subsequently, the method may involve additional validation checks to ensure that the user requesting the information has the necessary permissions to view these details. The final response to the request will provide a complete set of information about the role structured in a JSON format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/roles-listRest.request.txt b/packages/leemons-openapi/lib/requests/roles-listRest.request.txt new file mode 100644 index 0000000000..d78b1c3a5d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/roles-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/roles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/roles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/markAllUsersInGroupToReloadPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/detailByUri.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/transformArrayToObject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/updateWithRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/checkIfCanCreateNUserAgentsInGroup.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/addWithRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existByName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/manyPermissionsHasManyActions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/hasActionMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/addPermissionMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/searchUsersWithRoleAndMarkAsReloadPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/removeUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/existUserAgent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/addUserAgent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/create.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/list.js\n[object Object]", + "response": "{\"summary\":\"List roles available in the system\",\"description\":\"This endpoint lists all the roles available within the system, providing a comprehensive overview of what types of roles users can be assigned to. It is particularly useful for system administrators or software managing user permissions and role-based access controls within the application.\\n\\n**Authentication:** Users need to be authenticated to access this list. Access will be denied if the authentication credentials are not provided or are invalid.\\n\\n**Permissions:** This endpoint requires administrative rights. A user must have the proper administrative role or permission set to access the roles list, ensuring that only authorized personnel can view sensitive role information.\\n\\nUpon receiving a request, this endpoint initiates by invoking the `listRoles` method within the roles management service. This method interacts with the database to retrieve all records from the roles collection. The resulting data includes detailed role identifiers, names, and any associated permissions or constraints each role bears. The response from the service is structured and returned to the requester in JSON format, outlining all roles with their respective details.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/roles-updateRest.request.txt b/packages/leemons-openapi/lib/requests/roles-updateRest.request.txt new file mode 100644 index 0000000000..23e82eefb1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/roles-updateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/roles.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/roles.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/markAllUsersInGroupToReloadPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/detailByUri.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/transformArrayToObject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/updateWithRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/checkIfCanCreateNUserAgentsInGroup.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/addWithRole.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existByName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/manyPermissionsHasManyActions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/hasActionMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/addPermissionMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/searchUsersWithRoleAndMarkAsReloadPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/removeUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/existUserAgent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/addUserAgent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/remove.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/create.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/list.js\n[object Object]", + "response": "{\"summary\":\"Update user roles\",\"description\":\"This endpoint updates the roles assigned to a user based on input specifications. It typically involves modifying specific role attributes or replacing an existing role with a new set in the system database.\\n\\n**Authentication:** Users must be authenticated to modify roles. Lack of proper authentication will prohibit access to this endpoint.\\n\\n**Permissions:** The user requires administrator level permissions to update roles, ensuring that only authorized personnel can make changes to role configurations.\\n\\nUpon receiving a request, the endpoint initially validates the user's authentication and authorization levels. It then employs a series of method calls beginning with `validateRoleUpdateParams`, which ensures the request parameters meet the necessary criteria for a valid role update. After validation, the `updateRole` function from the roles service is invoked, where the actual updates to the role records are performed based on the provided parameters. This may include changing the role name, description, or associated permissions. The response back to the client confirms the successful update of the roles, supplemented by any relevant data changes made during the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-adminAddUsersToRoomRest.request.txt b/packages/leemons-openapi/lib/requests/room-adminAddUsersToRoomRest.request.txt new file mode 100644 index 0000000000..4e380abc7a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-adminAddUsersToRoomRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'adminAddUsersToRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/adminAddUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/addUserAgents.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-adminChangeRoomImageRest.request.txt b/packages/leemons-openapi/lib/requests/room-adminChangeRoomImageRest.request.txt new file mode 100644 index 0000000000..753f90b205 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-adminChangeRoomImageRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'adminChangeRoomImageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/adminChangeRoomImage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-adminRemoveRoomRest.request.txt b/packages/leemons-openapi/lib/requests/room-adminRemoveRoomRest.request.txt new file mode 100644 index 0000000000..a8e11973bd --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-adminRemoveRoomRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'adminRemoveRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/adminRemoveRoom.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/remove.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-adminRemoveUserAgentRest.request.txt b/packages/leemons-openapi/lib/requests/room-adminRemoveUserAgentRest.request.txt new file mode 100644 index 0000000000..24380e711e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-adminRemoveUserAgentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'adminRemoveUserAgentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/adminRemoveUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/removeUserAgents.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-adminUpdateRoomNameRest.request.txt b/packages/leemons-openapi/lib/requests/room-adminUpdateRoomNameRest.request.txt new file mode 100644 index 0000000000..ef9d788944 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-adminUpdateRoomNameRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'adminUpdateRoomNameRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/adminUpdateRoomName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-createRoomRest.request.txt b/packages/leemons-openapi/lib/requests/room-createRoomRest.request.txt new file mode 100644 index 0000000000..eaeb61b4c1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-createRoomRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'createRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/addUserAgents.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-getMessagesRest.request.txt b/packages/leemons-openapi/lib/requests/room-getMessagesRest.request.txt new file mode 100644 index 0000000000..ef7829e62b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-getMessagesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getMessagesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/getMessages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/helpers/decrypt.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-getRoomListRest.request.txt b/packages/leemons-openapi/lib/requests/room-getRoomListRest.request.txt new file mode 100644 index 0000000000..79d595585b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-getRoomListRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRoomListRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/getUserAgentRoomsList.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/helpers/decrypt.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-getRoomRest.request.txt b/packages/leemons-openapi/lib/requests/room-getRoomRest.request.txt new file mode 100644 index 0000000000..b277605028 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-getRoomRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/get.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-getRoomsMessageCountRest.request.txt b/packages/leemons-openapi/lib/requests/room-getRoomsMessageCountRest.request.txt new file mode 100644 index 0000000000..2e61192788 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-getRoomsMessageCountRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRoomsMessageCountRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/getRoomsMessageCount.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-getUnreadMessagesRest.request.txt b/packages/leemons-openapi/lib/requests/room-getUnreadMessagesRest.request.txt new file mode 100644 index 0000000000..fcfad28883 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-getUnreadMessagesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getUnreadMessagesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/getUnreadMessages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-markMessagesAsReadRest.request.txt b/packages/leemons-openapi/lib/requests/room-markMessagesAsReadRest.request.txt new file mode 100644 index 0000000000..e3a1d24fd1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-markMessagesAsReadRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'markMessagesAsReadRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/markAsRead.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-searchRest.request.txt b/packages/leemons-openapi/lib/requests/room-searchRest.request.txt new file mode 100644 index 0000000000..fda7fdbccf --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-searchRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'searchRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/search.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-sendMessageRest.request.txt b/packages/leemons-openapi/lib/requests/room-sendMessageRest.request.txt new file mode 100644 index 0000000000..917d5948b2 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-sendMessageRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'sendMessageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/sendMessage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/config/getCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/helpers/encrypt.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-toggleAdminDisableRoomRest.request.txt b/packages/leemons-openapi/lib/requests/room-toggleAdminDisableRoomRest.request.txt new file mode 100644 index 0000000000..79709c7392 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-toggleAdminDisableRoomRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'toggleAdminDisableRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/toggleDisableRoom.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-toggleAdminMutedRoomRest.request.txt b/packages/leemons-openapi/lib/requests/room-toggleAdminMutedRoomRest.request.txt new file mode 100644 index 0000000000..8294d5b833 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-toggleAdminMutedRoomRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'toggleAdminMutedRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/toggleAdminMutedRoom.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-toggleAttachedRoomRest.request.txt b/packages/leemons-openapi/lib/requests/room-toggleAttachedRoomRest.request.txt new file mode 100644 index 0000000000..7a066b2ac9 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-toggleAttachedRoomRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'toggleAttachedRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/toggleAttachedRoom.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/room-toggleMutedRoomRest.request.txt b/packages/leemons-openapi/lib/requests/room-toggleMutedRoomRest.request.txt new file mode 100644 index 0000000000..1ee259511d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/room-toggleMutedRoomRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'toggleMutedRoomRest' property does in the '/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/core/room/toggleMutedRoom.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/private-plugins/leemons-plugin-comunica/backend/validations/exists.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/rules-deleteRuleRest.request.txt b/packages/leemons-openapi/lib/requests/rules-deleteRuleRest.request.txt new file mode 100644 index 0000000000..6907df9983 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/rules-deleteRuleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteRuleRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/removeRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/removeConditionGroupsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/removeConditionsByRule.js\n[object Object]", + "response": "{\"summary\":\"Delete a specific grading rule\",\"description\":\"This endpoint deletes a grading rule by its unique identifier. Once deleted, all associated condition groups and conditions tied to the rule are also removed from the system, ensuring that no orphan data remains.\\n\\n**Authentication:** The user must be authenticated to proceed with the deletion of a grading rule. Without proper authentication, the request will be rejected.\\n\\n**Permissions:** Users require administrative rights or specific permissions related to grading system management to delete grading rules. Insufficient permissions will result in access being denied.\\n\\nThe delete operation begins by the `deleteRuleRest` method intercepting the request with a specific rule ID. The method then calls the `removeRule` function in the backend/core rules, which handles the main deletion logic. This function sequentially executes `removeConditionGroupsByRule` and `removeConditionsByRule` to ensure all related entries are purged effectively. Post deletion, the method finalizes by sending a success response back to the client, confirming the completion of the deletion process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/rules-haveRulesRest.request.txt b/packages/leemons-openapi/lib/requests/rules-haveRulesRest.request.txt new file mode 100644 index 0000000000..7fdbd40089 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/rules-haveRulesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'haveRulesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/haveRules.js\n[object Object]", + "response": "{\"summary\":\"Checks the applicability of grading rules for a specific context\",\"description\":\"This endpoint assesses the application of defined grading rules within a given educational or testing scenario. It verifies whether certain grading criteria are met and determines the applicability of rules based on the context provided in the request.\\n\\n**Authentication:** User authentication is required to ensure that only authorized personnel can check and apply grading rules. An attempt to access this endpoint without a valid authentication token will result in denial of access.\\n\\n**Permissions:** This endpoint requires the user to have permissions to manage or view grading settings within the platform. Users without sufficient permissions will not be able to execute or view the results of this rule check.\\n\\nUpon receiving a request, the endpoint first validates user authentication and permissions. If these checks pass, it then proceeds to invoke the `haveRules` method from the `rules` core. This method analyzes the context provided — such as academic level, department, or specific test details — and retrieves all applicable grading rules from the database. It evaluates these rules to determine if they are applicable to the provided scenario, using a set of predefined logic criteria. The result of this process is a decision on whether the rules can be applied, along with any necessary details explaining the reasoning. This response is then serialized into JSON format and sent back to the requester, providing clear information on rule applicability.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/rules-listRulesRest.request.txt b/packages/leemons-openapi/lib/requests/rules-listRulesRest.request.txt new file mode 100644 index 0000000000..3d5fa380df --- /dev/null +++ b/packages/leemons-openapi/lib/requests/rules-listRulesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRulesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/listRules.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/ruleByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/getRuleConditionsByRuleIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/getConditionsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/getConditionGroupsByRule.js\n[object Object]", + "response": "{\"summary\":\"List all grading rules\",\"description\":\"This endpoint lists all grading rules defined in the system. It pulls data regarding different grading criteria that have been set up to evaluate learners' performance across various courses or assessments.\\n\\n**Authentication:** Users must be authenticated to access the list of grading rules. Unauthorized access attempts will be blocked at the API gateway level.\\n\\n**Permissions:** The user needs to have 'view_grading_rules' permission to query this endpoint. This ensures that only authorized personnel with the requisite permissions can view the grading configurations.\\n\\nUpon request, the handler initiates by invoking the `listRules` method from the Grades plugin's Rules core service. This method queries the database for all rule entries that define how grades should be calculated or awarded based on predefined conditions. Each rule might include specific conditions or criteria, which are also fetched by subsequent calls to `getConditionsByRule` or `getConditionGroupsByRule`, thus assembling a complete set of data pertaining to each rule. Finally, the fetched rules and their detailed specifications are compiled into a structured format and returned as a JSON response, ensuring the client receives comprehensive data on grading rules.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/rules-postRuleProcessRest.request.txt b/packages/leemons-openapi/lib/requests/rules-postRuleProcessRest.request.txt new file mode 100644 index 0000000000..55efed9bdc --- /dev/null +++ b/packages/leemons-openapi/lib/requests/rules-postRuleProcessRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postRuleProcessRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/processRulesForUserAgent.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/getRuleConditionsByRuleIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/getConditionsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/getConditionGroupsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/getUserAgentNotesForSubjects.js\n[object Object]", + "response": "{\"summary\":\"Processes grading rules based on user actions\",\"description\":\"This endpoint processes specific grading rules applicable to a user based on their actions within the platform. Depending on the conditions set up for each rule, this might include calculating grades, sending notifications, or adjusting user status.\\n\\n**Authentication:** User authentication is required to ensure that the rule processing is applied to the correct user account. Actions conducted without proper authentication will not be processed.\\n\\n**Permissions:** Users need to have sufficient permissions typically related to educational or administrative roles, for this endpoint to process grading rules on their behalf. Lack of required permissions will result in denial of service for the requested action.\\n\\nUpon receiving a request, the endpoint initially validates the user’s authentication status and permissions. It then uses a series of service calls including `processRulesForUserAgent`, `getRuleConditionsByRuleIds`, `getConditionsByRule`, and `getConditionGroupsByRule` to fetch relevant rules and conditions. These functions collectively determine which rules are applicable based on the user's recent activities or input data. Once applicable rules are identified, the endpoint executes these rules, potentially updating grades, triggering notifications, or modifying user-related data based on the outcomes of the rule processes. Finally, the results of the rule processing are compiled and sent back as a response to the user in a structured format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/rules-postRuleRest.request.txt b/packages/leemons-openapi/lib/requests/rules-postRuleRest.request.txt new file mode 100644 index 0000000000..f6d471bd40 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/rules-postRuleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postRuleRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/addRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/addConditionGroup.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/addCondition.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/ruleByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/getRuleConditionsByRuleIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/getConditionsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/getConditionGroupsByRule.js\n[object Object]", + "response": "{\"summary\":\"Add a new grading rule\",\"description\":\"This endpoint allows for the addition of a new grading rule within the system. The endpoint facilitates the creation of complex grading rules which can be associated with particular grades, subjects, or other academic criteria.\\n\\n**Authentication:** User authentication is required to ensure only authorized personnel can add or modify grading rules. A valid user session is needed to proceed with this operation.\\n\\n**Permissions:** This operation requires the user to have the 'manage_grading_rules' permission assigned. Without the proper permissions, the request will be rejected.\\n\\nUpon receiving a request, the endpoint first processes the input parameters to validate the structure and data of the grading rule. It then calls the `addRule` function from the `rules` core backend service. This function handles the insertion of the new rule data into the database, ensuring all associated conditions and condition groups are correctly linked. Once the addition is successful, a response is generated and sent back to the requester, confirming the creation of the rule. If there are any issues during the process, appropriate error messages are returned, guiding the user to resolve such issues.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/rules-putRuleRest.request.txt b/packages/leemons-openapi/lib/requests/rules-putRuleRest.request.txt new file mode 100644 index 0000000000..b80200aeed --- /dev/null +++ b/packages/leemons-openapi/lib/requests/rules-putRuleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putRuleRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/updateRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/removeConditionGroupsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/removeConditionsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/addConditionGroup.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/addCondition.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/ruleByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/rules/getRuleConditionsByRuleIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/conditions/getConditionsByRule.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/getConditionGroupsByRule.js\n[object Object]", + "response": "{\"summary\":\"Update a specified grading rule\",\"description\":\"This endpoint facilitates the update of a specific grading rule in the system. The rule details can be modified based on the provided inputs in the request, which include changes to conditions, condition groups, and other associated elements of the grading rule.\\n\\n**Authentication:** The user must be authenticated to update a grading rule. An invalid or absent authentication token will restrict access to this endpoint.\\n\\n**Permissions:** Appropriate permissions are required to update grading rules. The user must have administrative rights or specific permission flags set, such as 'update_grading_rule', to modify existing grading rules.\\n\\nUpon receiving a request, the `updateRule` action is called within the rules service. This action orchestrates a series of operations involving validation of input data against predefined schemas, removal of existing condition groups and conditions linked to the rule through `removeConditionGroupsByRule` and `removeConditionsByRule` respectively, and addition of new conditions and groups if provided, using the `addCondition` and `addConditionGroup` methods. Finally, the updated rule is fetched with its new configuration and conditions using `ruleByIds` to ensure the update was successful and the new setup is returned in the response in a consumable format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/scores-getRest.request.txt b/packages/leemons-openapi/lib/requests/scores-getRest.request.txt new file mode 100644 index 0000000000..57dc3e2260 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/scores-getRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/scores.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/scores.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/core/scores/getScores.js\n[object Object]", + "response": "{\"summary\":\"Fetch and calculate user scores\",\"description\":\"This endpoint is designed to calculate and return scores based on a user's activities within the application. The calculations are to reflect the user's performance and achievements across various metrics defined by the system architecture.\\n\\n**Authentication:** This endpoint requires users to be authenticated to ensure that scores are fetched for the rightful owner. Unauthorized access is strictly prohibited, and authentication mechanisms are in place to verify user credentials.\\n\\n**Permissions:** The user must have the appropriate permission to view scores. Typically, this includes roles such as student, teacher, or administrator, depending on the implementation specifics of the platform.\\n\\nFrom the initial request, the 'getRest' action utilizes the `getScores` method to retrieve all relevant scoring data associated with the user. It processes this information through a series of business logic layers implemented within the `scores.rest.js`. Each score component is derived and compiled based on user-specific activities and performance parameters. The data flow includes error handling to manage any inconsistencies or failures in data retrieval. Subsequently, the resolved data is formatted and sent back as a JSON response, providing a complete overview of the user's scores within the application.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/scores-removeRest.request.txt b/packages/leemons-openapi/lib/requests/scores-removeRest.request.txt new file mode 100644 index 0000000000..7c96458bc3 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/scores-removeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/scores.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/scores.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/core/scores/removeScores.js\n[object Object]", + "response": "{\"summary\":\"Removes specified score records\",\"description\":\"This endpoint handles the deletion of score records from the system. Authorized users can request the removal of specific scores identified by their unique identifiers. The operation ensures that only permissible records are deleted based on user rights and provided identifiers.\\n\\n**Authentication:** Users need to be authenticated to issue deletion commands for score records. Unauthenticated requests will be rejected, ensuring that only valid users can perform deletions.\\n\\n**Permissions:** The user must have the 'delete_scores' permission assigned to their role. Without this permission, the attempt to delete scores will be denied, ensuring system-wide integrity and access control are maintained.\\n\\nUpon receiving a delete request, the 'removeScores' handler in the 'scores.rest.js' service invokes the 'remove' method from the 'ScoresService'. The method uses parameters passed in the request to identify and validate the scores that should be deleted. It checks for user permissions and the existence of the scores in the database. If the validations pass, it proceeds to remove the scores. The process involves database operations to securely delete the records and then confirm the success of the operation to the user through an appropriate HTTP response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/scores-setRest.request.txt b/packages/leemons-openapi/lib/requests/scores-setRest.request.txt new file mode 100644 index 0000000000..bf7bda671e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/scores-setRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/scores.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/scores.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/core/scores/setScores.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/core/scores/removeScores.js\n[object Object]", + "response": "{\"summary\":\"Set academic scores for students\",\"description\":\"This endpoint is responsible for setting academic scores for students. It allows the bulk updating of scores across different subjects and terms as defined within the system's academic structures.\\n\\n**Authentication:** Users need to be authenticated in order to submit changes to students' scores. Missing or invalid authentication tokens will prevent access to this functionality.\\n\\n**Permissions:** This endpoint requires administrative rights or specific educator access to modify students' scores. Permissions are checked at the beginning of the request process to ensure the user possesses the necessary rights to update scores.\\n\\nThe process of setting scores begins with the `setScores` method in the scores service. This method receives a request containing the details of the scores to be updated, including student identifiers, the academic subjects, and the respective scores. It then performs a validation to ensure that all provided data meets the system's requirements and that the user has the right to modify these scores. Upon successful validation, it updates the scores in the database, logging each transaction for audit purposes. Finally, a response is generated and sent back to the client, indicating the status of the update operation, whether it was successful or if there were any errors.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/session-detailRest.request.txt b/packages/leemons-openapi/lib/requests/session-detailRest.request.txt new file mode 100644 index 0000000000..3fed1c0779 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/session-detailRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'detailRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/services/rest/session.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/services/rest/session.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/core/session/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/core/session/byIds.js\n[object Object]", + "response": "{\"summary\":\"Manage session details for attendance control\",\"description\":\"This endpoint is responsible for handling specific session-related requests in the attendance control module. It facilitates detailed operations on sessions such as retrieving, updating, or deleting session information based on given criteria.\\n\\n**Authentication:** User authentication is mandatory to ensure secure access to session details. Access is denied for requests without valid authentication credentials.\\n\\n**Permissions:** Users need specific permissions related to attendance control management. Without the required permissions, the request will not be processed.\\n\\nThe flow of the controller involves several key methods orchestrated to manage session details effectively. Initially, the endpoint extracts necessary details from the incoming request (such as session identifiers or relevant parameters). It then interacts with the `session` core model to execute operations like `getSessionDetailsById`, `updateSession`, or `deleteSession`. These operations involve querying the database and manipulating session data as requested. The processes are securely handled, ensuring that only authorized actions are performed, corresponding to the authenticated user's permission levels. The response is carefully formatted to provide clear and accurate session details or status updates, depending on the operation performed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/session-getClassSessionsRest.request.txt b/packages/leemons-openapi/lib/requests/session-getClassSessionsRest.request.txt new file mode 100644 index 0000000000..7bb4257fb7 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/session-getClassSessionsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getClassSessionsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/services/rest/session.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/services/rest/session.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/core/session/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/core/session/getTemporalSessions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/core/session/calculeSessionsBetweenDatesFromSchedule.js\n[object Object]", + "response": "{\"summary\":\"Calculate and fetch session data for class schedules\",\"description\":\"This endpoint calculates and retrieves session data between specified dates based on the class schedules. It handles the task of mapping out all class sessions that fall within the given date range and according to the pre-defined class schedules in the system.\\n\\n**Authentication:** Users must be authenticated to request the session information. Without proper authentication, the endpoint will deny access to the data.\\n\\n**Permissions:** This endpoint requires the user to have 'view_sessions' permission. Users lacking this permission will not be able to retrieve any session data.\\n\\nThe controller begins by invoking the `calculeSessionsBetweenDatesFromSchedule` method from the `Sessions` core, which takes in parameters for start and end dates, along with the schedule identifiers. This method computes all possible session occurrences within the provided dates and aligns them based on the class schedules. Once this calculation is complete, the result - a list of session times and details - is formatted and sent back through the response in JSON format, encompassing all sessions applicable within the specified date range.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/session-getTemporalSessionsRest.request.txt b/packages/leemons-openapi/lib/requests/session-getTemporalSessionsRest.request.txt new file mode 100644 index 0000000000..04c4d227b9 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/session-getTemporalSessionsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getTemporalSessionsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/services/rest/session.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/services/rest/session.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/core/session/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/core/session/getTemporalSessions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/core/session/calculeSessionsBetweenDatesFromSchedule.js\n[object Object]", + "response": "{\"summary\":\"Calculate temporal session intervals based on a user schedule\",\"description\":\"This endpoint calculates and retrieves all temporal session intervals for a specific user based on their defined schedule within a given date range. The functionality is crucial for planning and managing attendance in educational or organizational settings.\\n\\n**Authentication:** Users must be authenticated to access this functionality. An active session is required, and the user's credentials are verified against the session information stored on the server.\\n\\n**Permissions:** The user needs to have 'view_schedule' permission to retrieve and calculate session intervals. This permission ensures that only authorized users can access schedule-related data and operations.\\n\\nThe endpoint begins by invoking the `calculeSessionsBetweenDatesFromSchedule` method from the `Session` core, which is designed to compute all possible session intervals within the specified dates based on the user's schedule. This method internally handles the complexity of intersecting user-specific schedules with general availability and predefined constraints. The computed data is then formatted and returned as a JSON response, providing a structured list of calculated session intervals for the requested dates.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/session-saveRest.request.txt b/packages/leemons-openapi/lib/requests/session-saveRest.request.txt new file mode 100644 index 0000000000..0335f4a93f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/session-saveRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/services/rest/session.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/services/rest/session.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/core/session/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/core/session/save.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-attendance-control/backend/validations/forms.js\n[object Object]", + "response": "{\"summary\":\"Saves session data for a user\",\"description\":\"This endpoint is responsible for capturing and storing attendance-related session data for a specific user within the leemons platform. It primarily manages the session details and updates or creates attendance records based on the input data.\\n\\n**Authentication:** Users need to be authenticated to save session data. An absence of valid authentication will prevent access to this functionality.\\n\\n**Permissions:** The endpoint requires 'attendance-management' permission. Without this, users will not be able to save or modify session data.\\n\\nThe flow starts with the endpoint parsing the incoming request to extract session data details. It then calls the `saveSession` method from the `session` core, which handles the logic for checking existing records and updating them or creating new entries if no existing record matches. This involves critical checks on data validation and integrity to ensure that only valid and complete data is processed. Errors in processing or validation will result in specific error messages being returned. On successful completion, a confirmation is sent back to the user indicating that the data has been successfully saved.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/settings-enableMenuItemRest.request.txt b/packages/leemons-openapi/lib/requests/settings-enableMenuItemRest.request.txt new file mode 100644 index 0000000000..a8ff73c6f4 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/settings-enableMenuItemRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'enableMenuItemRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/settings.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/settings.rest.js\n[object Object]", + "response": "{\"summary\":\"Activates a specific menu item in the user interface\",\"description\":\"This endpoint enables a specific menu item in the system's user interface, making it visible and accessible to users. This action typically involves updating a configuration setting or database entry to reflect the new state of the menu item.\\n\\n**Authentication:** Users must be authenticated to modify the visibility of menu items. An invalid or missing authentication token will prevent access to this endpoint.\\n\\n**Permissions:** Users need specific administrative permissions related to UI configuration or menu management to enable a menu item. Without appropriate permissions, the request will be denied.\\n\\nUpon receiving a request, the `enableMenuItemRest` handler verifies the user's authentication and permission levels. If the validation passes, it proceeds to call the `enableMenuItem` method. This method updates the necessary configurations to set the menu item's status to active. The entire process involves validating the input, checking permissions, updating the setting via a database transaction, and finally, responding with the success status of the operation if all conditions are met.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/settings-findOneRest.request.txt b/packages/leemons-openapi/lib/requests/settings-findOneRest.request.txt new file mode 100644 index 0000000000..549c4cd4e6 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/settings-findOneRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'findOneRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/settings.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/settings.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/settings/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/settings/findOne.js\n[object Object]", + "response": "{\"summary\":\"Find a single setting by its specifications\",\"description\":\"This endpoint retrieves specific configuration settings based on several search criteria provided as input. It is designed to pinpoint and return granular details about a particular setting within the system's configuration pool.\\n\\n**Authentication:** Users need to be authenticated to perform this search. Access to this endpoint will be denied if authentication credentials are not valid or are missing.\\n\\n**Permissions:** Specific permissions related to settings management are required to access this endpoint. Users without sufficient permissions will not be able to retrieve setting details.\\n\\nThe handler begins by accepting a request that includes identification criteria for the desired setting. These criteria are processed by the `findOne` method in the `settings` core. This method makes a query to the system's database, attempting to locate a setting that matches the provided criteria. The result of this query is then returned to the user as a JSON object if successful. This process ensures that only the requested, authorized setting information is retrieved and disclosed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/settings-getLanguagesRest.request.txt b/packages/leemons-openapi/lib/requests/settings-getLanguagesRest.request.txt new file mode 100644 index 0000000000..235d67dc8e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/settings-getLanguagesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getLanguagesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/settings.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/settings.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/findOne.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/setLanguages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/getLanguages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/setDefaultLanguage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/registerAdmin.js\n[object Object]", + "response": "{\"summary\":\"Fetch available languages from the system\",\"description\":\"This endpoint retrieves the list of all languages currently supported or available within the system administration panel. The output includes language codes and corresponding language names arranged in a structured format.\\n\\n**Authentication:** Users need to be authenticated in order to fetch the list of available languages. Access to this endpoint requires valid user credentials, and any attempt to access it without proper authentication will be rejected.\\n\\n**Permissions:** The endpoint requires administrative permissions, specifically the 'view_languages' permission. Users without these permissions will not be allowed to access this endpoint and will receive an appropriate authorization error.\\n\\nUpon receiving a GET request, the `getLanguages` handler in `settings.rest.js` calls the corresponding method in the core settings module. This method queries the internal configuration or database to extract a detailed list of languages set up in the admin settings. This includes both default and optionally added languages by the system administrators. The response is then formatted into a JSON object that lists language codes alongside their full names and returned to the user making the request.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/settings-getProfilesRest.request.txt b/packages/leemons-openapi/lib/requests/settings-getProfilesRest.request.txt new file mode 100644 index 0000000000..b471ba65f5 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/settings-getProfilesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getProfilesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/settings.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/settings.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/settings/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/settings/getProfiles.js\n[object Object]", + "response": "{\"summary\":\"Fetch academic profiles based on user access\",\"description\":\"This endpoint fetches academic profiles from the academic portfolio system, tailored according to the access rights and roles of the requesting user. It aims to provide a personalized view of academic credentials, courses, and achievements stored within the system.\\n\\n**Authentication:** User authentication is mandatory for accessing this endpoint. Access will be denied if authentication credentials are not provided or are invalid.\\n\\n**Permissions:** The user needs to have 'view_profiles' permission to retrieve academic profiles. Without this permission, the server will return an unauthorized access error.\\n\\nUpon receiving a request, the `getProfilesRest` handler initiates the process by verifying user authentication and permissions. If verification is successful, it calls the `getProfiles` method from the `Settings` core module. This method queries the database for academic profiles that align with the user's roles and permissions, ensuring that each user only accesses information they are authorized to view. The resulting profiles are then formatted and returned as a JSON response, providing a comprehensive yet secure overview of academic data relevant to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/settings-isProfilesConfigRest.request.txt b/packages/leemons-openapi/lib/requests/settings-isProfilesConfigRest.request.txt new file mode 100644 index 0000000000..6556860118 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/settings-isProfilesConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'isProfilesConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/settings.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/settings.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/settings/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/settings/isProfilesConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/settings/getProfiles.js\n[object Object]", + "response": "{\"summary\":\"Check if user profile settings are configured\",\"description\":\"This endpoint examines the system's configuration to determine if the profile settings for a user have been correctly set up and configured. It primarily checks the presence and validity of certain user-specific configurations which are essential for further operations and access within the academic portfolio plugin.\\n\\n**Authentication:** Users need to be authenticated to check their profile configuration status. Any request without a valid session or authentication token will be rejected.\\n\\n**Permissions:** This action requires administrator-level permissions, as it involves accessing sensitive configuration data that could influence the accessibility and functionality of user profiles across the platform.\\n\\nUpon receiving a request, the handler initiates by calling the `isProfilesConfig` method from the Settings core. This method assesses whether the user profiles have all necessary configurations set based on predefined criteria stored within the system. It checks various configuration parameters and ensures they align with the required standards for a proper operational environment. The method returns a boolean indicating the existence and correctness of these configurations. The response communicated back to the client provides clear information on the configuration status, facilitating further user or admin actions based on the outcome.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/settings-setLanguagesRest.request.txt b/packages/leemons-openapi/lib/requests/settings-setLanguagesRest.request.txt new file mode 100644 index 0000000000..f28dc4741b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/settings-setLanguagesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setLanguagesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/settings.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/settings.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/findOne.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/setLanguages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/getLanguages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/setDefaultLanguage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/registerAdmin.js\n[object Object]", + "response": "{\"summary\":\"Set the available languages for the platform\",\"description\":\"This endpoint configures the available languages that can be used across the platform. It is typically called when setting up the platform initially or when languages need to be added or updated.\\n\\n**Authentication:** Users must be authenticated as platform administrators to modify the language settings. Authentication ensures that only authorized personnel can make changes to foundational configurations such as languages.\\n\\n**Permissions:** The endpoint requires administrative privileges. It explicitly checks that the user has the 'manage_languages' permission before proceeding with updates.\\n\\nUpon receiving a request, the 'setLanguagesRest' handler in `settings.rest.js` first validates the presence and format of the language data in the request body. It then calls the `setLanguages` method in the `settings` core module, passing along the language information. This method updates the language settings in the platform's configuration repository, ensuring compliance with the new settings. Once the update is successful, a confirmation response is sent back, and the platform begins to support the newly configured languages.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/settings-setProfilesRest.request.txt b/packages/leemons-openapi/lib/requests/settings-setProfilesRest.request.txt new file mode 100644 index 0000000000..95078ec4b6 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/settings-setProfilesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setProfilesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/settings.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/settings.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/settings/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/settings/setProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/settings/getProfiles.js\n[object Object]", + "response": "{\"summary\":\"Set user academic profiles\",\"description\":\"This endpoint sets or updates the academic profiles for a specific user. It primarily handles profile creation and modification activities within the user's academic portfolio.\\n\\n**Authentication:** User authentication is required to access and modify academic profiles. Authentication is validated via user tokens, and any operations without proper authentication will be rejected.\\n\\n**Permissions:** The user needs to have the 'edit_academic_profile' permission to modify profiles. Lack of sufficient permissions will prevent the user from performing updates on academic profiles.\\n\\nThe flow of the endpoint begins with the validation of user authentication and permissions. Upon successful validation, the `setProfiles` method from the `Settings` core module is invoked. This method takes the input payload containing profile data and processes updates or creations based on the supplied details. If the operation is successful, the method returns an acknowledgment of the changes. The entire process ensures that only authorized and authenticated users can alter academic profiles, maintaining data integrity and security within the system.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/settings-signupRest.request.txt b/packages/leemons-openapi/lib/requests/settings-signupRest.request.txt new file mode 100644 index 0000000000..00445e6ddb --- /dev/null +++ b/packages/leemons-openapi/lib/requests/settings-signupRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'signupRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/settings.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/services/rest/settings.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/findOne.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/setLanguages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/getLanguages.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/setDefaultLanguage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-admin/backend/core/settings/registerAdmin.js\n[object Object]", + "response": "{\"summary\":\"Registers a new administrator account\",\"description\":\"This endpoint facilitates the registration of a new administrator account in the system. It handles the creation and storage of administrator credentials and associated roles in the database.\\n\\n**Authentication:** The endpoint requires the initiating user to be logged in, usually with higher privileges such as a superadmin role.\\n\\n**Permissions:** The endpoint demands that the user has the 'admin-create' permission to allow the creation of new administrator accounts.\\n\\nThe flow begins with the `registerAdmin` method from the `settings` core being called. This function receives necessary input parameters such as username, password, and assigned roles, encapsulating them in a security context. It validates the provided data against predefined schema and requirements, then proceeds to check for any potential duplication of username in the database. Upon successful validation, the method executes an insert operation into the database to store the new administrator's data. Post registration, a confirmation is logged, and a success response is returned to the invoking client, indicating that the administrator has been successfully registered.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/settings-updateRest.request.txt b/packages/leemons-openapi/lib/requests/settings-updateRest.request.txt new file mode 100644 index 0000000000..f34637183a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/settings-updateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/settings.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/settings.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/settings/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/settings/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/settings/findOne.js\n[object Object]", + "response": "{\"summary\":\"Updates timetable settings for a specific user\",\"description\":\"This endpoint is used for updating the timetable settings specific to a user. It allows the updating of settings such as preferences and configurations related to that user's timetable management.\\n\\n**Authentication:** User authentication is required to ensure that the request is made by a valid, logged-in user. The session or token must be verified prior to processing the request.\\n\\n**Permissions:** The user must have the 'timetable-settings-update' permission to update timetable settings. This ensures that only authorized users can make changes to their timetable configurations.\\n\\nUpon receiving the update request, the handler first authenticates the user and checks required permissions. If authentication or authorization fails, it returns an appropriate error response. If successful, it invokes the `updateSettings` method in the settings core, passing necessary parameters such as user ID and new settings data. This method performs the update operation in the database and returns a success response indicating that the settings have been updated. Throughout the process, error handling mechanisms are in place to catch and respond to any issues that might occur during the update operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/socket-getConfigRest.request.txt b/packages/leemons-openapi/lib/requests/socket-getConfigRest.request.txt new file mode 100644 index 0000000000..5c69454ad9 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/socket-getConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/socket.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/socket.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/core/socket/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/core/socket/getConfig.js\n[object Object]", + "response": "{\"summary\":\"Fetch AWS IoT MQTT configuration settings\",\"description\":\"This endpoint retrieves the current configuration settings necessary for establishing a connection to the AWS IoT service via MQTT. These settings are essential for clients that need to communicate securely with IoT devices managed through AWS IoT.\\n\\n**Authentication:** Users must be authenticated to access the MQTT configuration settings. An invalid or missing authentication token will prevent access to this endpoint.\\n\\n**Permissions:** This endpoint requires users to have 'admin' permissions to access sensitive IoT configuration details.\\n\\nThe process begins in the `getConfigRest` action handler which directly calls the `getConfig` method from the `socket` core module. This method is responsible for loading and returning the current AWS IoT MQTT configuration, which includes endpoint details, certificates, and keys necessary for secure MQTT communication. The configuration data is then formatted as a JSON object and sent back to the client within the HTTP response body, ensuring that only authorized and properly authenticated users can obtain this sensitive information.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/socket-getCredentialsRest.request.txt b/packages/leemons-openapi/lib/requests/socket-getCredentialsRest.request.txt new file mode 100644 index 0000000000..5f00eda528 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/socket-getCredentialsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getCredentialsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/socket.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/socket.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/core/socket/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/core/socket/createCredentialsForUserSession.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/core/socket/aws.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/core/socket/createCredentials.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/core/socket/getEndpointData.js\n[object Object]", + "response": "{\"summary\":\"Generates and retrieves MQTT credentials for a user session\",\"description\":\"This endpoint generates and retrieves AWS IoT MQTT credentials for a user's session to securely communicate with MQTT topics. It facilitates secure messaging by integrating with AWS IoT Core for credential handling.\\n\\n**Authentication:** User authentication is required to access these MQTT credentials. If authentication fails, the endpoint will not provide any credentials.\\n\\n**Permissions:** The user must have permissions for MQTT communication setup in their user profile to access this endpoint. Without the necessary permissions, access to MQTT credentials will be denied.\\n\\nThe core workflow of the handler begins with the `createCredentialsForUserSession` function in the service layer, which is responsible for creating and associating the necessary AWS IoT credentials with the user's current session. This function internally calls `getEndpointData` to retrieve data specific to the AWS IoT endpoint, followed by `createCredentials` that invokes AWS services to generate the actual credentials. Once credentials are generated, they are sent back to the user in the form of a JSON object, enabling secure MQTT communication for the session.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/socket-setConfigRest.request.txt b/packages/leemons-openapi/lib/requests/socket-setConfigRest.request.txt new file mode 100644 index 0000000000..996295ace8 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/socket-setConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/socket.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/socket.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/core/socket/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/core/socket/setConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/core/socket/aws.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-mqtt-aws-iot/backend/core/socket/awsClient.js\n[object Object]", + "response": "{\"summary\":\"Configure AWS IoT MQTT connection settings\",\"description\":\"This endpoint updates the MQTT connection settings for AWS IoT specific to the user's account. It accepts new configuration parameters and applies them to ensure that the MQTT client connects appropriately using the latest credentials and configurations supplied by the user.\\n\\n**Authentication:** Users must be authenticated to modify their MQTT connection settings. If the authentication details are incorrect or missing, the request will be rejected.\\n\\n**Permissions:** The user must have administrator privileges to update the MQTT connection settings. This ensures that only authorized personnel can make changes that could impact the messaging infrastructure.\\n\\nUpon receiving a request, this endpoint first verifies user authentication and checks for administrative permissions. It then calls the `setConfig` method in the `awsClient` core module, passing the new configuration settings. This method handles the integration with AWS IoT to update the connection parameters based on the inputs. Successful completion of the operation will result in the updated connection settings being applied and a confirmation message being returned to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/status-getScormAssignationRest.request.txt b/packages/leemons-openapi/lib/requests/status-getScormAssignationRest.request.txt new file mode 100644 index 0000000000..e34d594740 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/status-getScormAssignationRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getScormAssignationRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/status.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/status.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/status/getScormAssignation.js\n[object Object]", + "response": "{\"summary\":\"Fetch SCORM assignation details for a user\",\"description\":\"This endpoint retrieves the SCORM assignation details assigned to a particular user within the leemons platform. Based on the user's unique identification, it finds the relevant SCORM content that has been allocated to them, generally for educational or training purposes.\\n\\n**Authentication:** Users need to be authenticated to access this endpoint. Unauthenticated requests are denied, ensuring that access is securely managed.\\n\\n**Permissions:** Users must have the 'view_scorm_assignations' permission to view SCORM assignation details. Without this permission, the API will restrict access to the requested resources.\\n\\nUpon receiving a request, this endpoint calls the `getScormAssignation` method in the backend core process. This method retrieves the SCORM assignment data linked to the user's ID supplied in the request context (`ctx`). It efficiently processes the information to ensure that the data concerning SCORM allocations is accurate, handling any exceptions or errors during the data retrieval. Finally, the results are formatted appropriately and sent back to the user, providing clear details of the SCORM assignation in question.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/status-updateStatusRest.request.txt b/packages/leemons-openapi/lib/requests/status-updateStatusRest.request.txt new file mode 100644 index 0000000000..905fd2792b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/status-updateStatusRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateStatusRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/status.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/services/rest/status.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scorm/backend/core/status/updateStatus.js\n[object Object]", + "response": "{\"summary\":\"Update SCORM package status for a user\",\"description\":\"This endpoint enables updating the status of a SCORM package linked to a specific user within the Leemons platform. It changes the state of user progress and interaction with the SCORM content to reflect recent activities or completion status.\\n\\n**Authentication:** User authentication is required to access and modify SCORM package status. Users must be logged in with valid credentials to successfully call this endpoint.\\n\\n**Permissions:** This endpoint requires that the user has permissions to modify SCORM package statuses, typically granted to educators or administrators who manage e-learning content and tracking.\\n\\nUpon receiving a request, the `updateStatusRest` handler invokes the `updateStatus` method in the `status` core service. This method performs several operations: it first validates the user's identity and permissions to ensure they are authorized to update SCORM statuses. It then processes the input data to adjust the relevant user's SCORM status in the database. This process includes error handling to manage possible exceptions such as invalid input or database errors. Finally, the response is formulated to indicate the success or failure of the update operation, along with appropriate status codes.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/subjectType-deleteSubjectTypeRest.request.txt b/packages/leemons-openapi/lib/requests/subjectType-deleteSubjectTypeRest.request.txt new file mode 100644 index 0000000000..f30797b5b7 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/subjectType-deleteSubjectTypeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteSubjectTypeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subjectType.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subjectType.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subject-type/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subject-type/removeSubjectType.js\n[object Object]", + "response": "{\"summary\":\"Remove a specific subject type from the academic portfolio\",\"description\":\"This endpoint removes a subject type from the academic portfolio system based on a provided identifier. The action ensures that all dependencies or related data are handled according to defined business rules prior to deletion, preventing any orphan records or inconsistent data states.\\n\\n**Authentication:** Users must be authenticated to perform this operation. Access to this endpoint will be denied if proper authentication credentials are not provided.\\n\\n**Permissions:** This endpoint requires administrative privileges or specific permissions related to academic structure management. Users without sufficient permissions will receive an error response indicating insufficient permissions.\\n\\nThe delete process initiates by verifying user permissions and authentication. Once authorized, the `removeSubjectType` method from the core `subject-type` module is called with the subject type's unique identifier. This method checks for any dependencies or related entities that might be impacted by the deletion of the subject type. Upon successful validation of all conditions, the subject type is removed from the database, and a confirmation message is returned to the user. If any issues arise during the process, appropriate error messages are generated and sent back in the response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/subjectType-listSubjectTypeRest.request.txt b/packages/leemons-openapi/lib/requests/subjectType-listSubjectTypeRest.request.txt new file mode 100644 index 0000000000..f026d6dc69 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/subjectType-listSubjectTypeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listSubjectTypeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subjectType.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subjectType.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subject-type/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subject-type/listSubjectType.js\n[object Object]", + "response": "{\"summary\":\"Lists all subject types available in the academic portfolio\",\"description\":\"This endpoint provides a comprehensive listing of all subject types defined in the academic portfolio management system. It is primarily used to retrieve and display a catalog of subject types for academic planning and management purposes.\\n\\n**Authentication:** User authentication is required to access the list of subject types. Users must be logged in with valid credentials to make requests to this endpoint.\\n\\n**Permissions:** Users need specific permissions to view the list of subject types. Typically, administrative access or permissions related to academic management are necessary to access this data.\\n\\nThe endpoint starts by invoking the `listSubjectType` method from the 'subject-type' core module. This method carries out a query to the system's database to fetch all existing subject type entries stored in the data model dedicated to academic structures. The result of this method is an array of subject type objects, each containing essential data such as type name, description, and applicable metadata. This array is then passed back through the Moleculer service to the client as a JSON response, giving a clear view of all available subject types that can be utilized for academic organization within the platform.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/subjectType-postSubjectTypeRest.request.txt b/packages/leemons-openapi/lib/requests/subjectType-postSubjectTypeRest.request.txt new file mode 100644 index 0000000000..a4b3ad6f85 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/subjectType-postSubjectTypeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postSubjectTypeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subjectType.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subjectType.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subject-type/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subject-type/addSubjectType.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/saveManagers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/updateClassMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/updateClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/substages/existSubstageInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/setToAllClassesWithSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/removeByClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/course/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/existCourseInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/groups/existGroupInProgram.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/group/isUsedInSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/processScheduleForClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/listSessionClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/addComunicaRoomsBetweenStudentsAndTeachers.js\n[object Object]", + "response": "{\"summary\":\"Adds a new subject type to the academic portfolio\",\"description\":\"This endpoint allows for the creation of a new subject type within the academic portfolio system. A subject type might categorize subjects into various academic disciplines or types, such as mathematics, science, arts, etc.\\n\\n**Authentication:** Users need to be authenticated to create a new subject type. The action will validate user credentials before processing the request.\\n\\n**Permissions:** Only users with administrational privileges over the academic portfolio are allowed to add new subject types, ensuring that only authorized personnel can make these alterations.\\n\\nUpon receiving a request, the `postSubjectType` action in the `subjectType.rest.js` file is triggered. This action internally calls the `addSubjectType` method from the `subject-type` core module. This method, after validating the input parameters, proceeds to insert the new subject type into the system's database. Once the database operation is successful, a confirmation response is returned to the client, indicating the successful creation of the new subject type.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/subjectType-putSubjectTypeRest.request.txt b/packages/leemons-openapi/lib/requests/subjectType-putSubjectTypeRest.request.txt new file mode 100644 index 0000000000..037e329397 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/subjectType-putSubjectTypeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putSubjectTypeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subjectType.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subjectType.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subject-type/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subject-type/updateSubjectType.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/managers/saveManagers.js\n[object Object]", + "response": "{\"summary\":\"Updates a subject type\",\"description\":\"This endpoint is responsible for updating the details of an existing subject type in the academic portfolio system. It allows modifications to attributes like name, description, or any other subject type-specific details as defined in the system.\\n\\n**Authentication:** Users must be authenticated to update subject types. Access without proper authentication will prevent the request from proceeding.\\n\\n**Permissions:** Usage of this endpoint requires administrative permissions related to academic management or specific permissions granted to manage and edit subject types.\\n\\nThe process starts in the `putSubjectTypeRest` handler which gathers the input data, primarily consisting of changes to be applied to an existing subject type. This data is then passed to a service method named `updateSubjectType`, located in the `subject-type` core module. This method handles the detailed logic to verify existing data, apply the updates, and save the changes in the database. It ensures that all updates adhere to predefined schemas and business rules, returning the updated subject data or an error message if the update fails.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/subjects-deleteSubjectRest.request.txt b/packages/leemons-openapi/lib/requests/subjects-deleteSubjectRest.request.txt new file mode 100644 index 0000000000..734aefb159 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/subjects-deleteSubjectRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteSubjectRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/deleteSubjectWithClasses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/removeClassesByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/removeSubjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/removeSubjectCreditsBySubjectsIds.js\n[object Object]", + "response": "{\"summary\":\"Delete a subject and its associated classes from the academic portfolio\",\"description\":\"This endpoint allows for the deletion of a subject and all its associated classes within the academic portfolio system. It ensures the removal of the subject record and any linked class records from the database, maintaining data integrity and consistency.\\n\\n**Authentication:** Users need to be authenticated to perform deletions. Only requests with valid authentication tokens will be processed.\\n\\n**Permissions:** This endpoint requires administrative permissions related to subject and class management. Users must have the 'manage_subjects' and 'manage_classes' permissions to execute this action.\\n\\nThe process begins with the validation of the subject's ID provided in the request. The handler then invokes the `deleteSubjectWithClasses` method of the `subjects` core, which internally calls `removeClassesByIds` for any classes linked to the subject. This ensures all data related to the subject, including the classes, is eliminated properly. Following successful deletion, the method updates any affected relational entities and returns a confirmation of the deletion. The response includes a status message indicating the successful removal of the subject and its classes.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/subjects-getSubjectCreditsRest.request.txt b/packages/leemons-openapi/lib/requests/subjects-getSubjectCreditsRest.request.txt new file mode 100644 index 0000000000..a43f63853b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/subjects-getSubjectCreditsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getSubjectCreditsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/getSubjectCredits.js\n[object Object]", + "response": "{\"summary\":\"Calculates and retrieves credits for a given subject\",\"description\":\"This endpoint is designed to calculate and provide the total number of credits attributed to a specific academic subject. The calculation considers various factors including the academic level, subject requirements, and any special considerations within the academic institution's guidelines.\\n\\n**Authentication:** Users need to be authenticated to access this endpoint. Without proper authentication, the endpoint will reject the request, ensuring that only authorized personnel can access sensitive academic information.\\n\\n**Permissions:** This endpoint requires the user to have 'view_academic_credits' permission. Users without this permission will not be able to retrieve credit information, ensuring that access is restricted based on user roles within the educational institution.\\n\\nUpon receiving a request, the `getSubjectCreditsRest` handler in the `subject.rest.js` first validates the input parameters to ensure they match the expected format and values. It then calls the `getSubjectCredits` method from the `subjects` core module. This method performs the necessary calculations and database queries to determine the credit value associated with the subject. The calculated credits are then prepared and returned in the response body as JSON data, providing a clear and concise representation of the subject's credit value.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/subjects-listSubjectCreditsForProgramRest.request.txt b/packages/leemons-openapi/lib/requests/subjects-listSubjectCreditsForProgramRest.request.txt new file mode 100644 index 0000000000..e4f3a2a447 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/subjects-listSubjectCreditsForProgramRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listSubjectCreditsForProgramRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/listSubjectCreditsForProgram.js\n[object Object]", + "response": "{\"summary\":\"List subject credits for a specific academic program\",\"description\":\"This endpoint lists all subject credits associated with a particular academic program. It is designed to help users understand the credit requirements and the distribution of credits across different subjects within the specified program.\\n\\n**Authentication:** Users need to be authenticated to access the information about subject credits. Authentication ensures that only authorized users can view sensitive academic program details.\\n\\n**Permissions:** Users must have the appropriate permissions related to academic management or specific program oversight to access this endpoint. Permissions are checked to verify that the user has adequate rights to view academic program credit distributions.\\n\\nThe process begins by the endpoint receiving a request which includes identifiers for the specific academic program. The handler, `listSubjectCreditsForProgramRest`, calls the `listSubjectCreditsForProgram` method in the `subjects` core module. This method consults the database to retrieve detailed information on all subjects and their associated credits for the given program. The data is then formatted and returned to the user as a structured JSON response, providing a clear breakdown of credits by subject within the program.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/subjects-listSubjectRest.request.txt b/packages/leemons-openapi/lib/requests/subjects-listSubjectRest.request.txt new file mode 100644 index 0000000000..a00434db1a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/subjects-listSubjectRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listSubjectRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/listSubjects.js\n[object Object]", + "response": "{\"summary\":\"List all subjects related to a specific academic portfolio\",\"description\":\"This endpoint lists all subjects associated with a specific academic portfolio based on provided criteria such as program and term. It primarily serves educational staff and students by providing an overview of subjects they might be interested in or are already enrolled in.\\n\\n**Authentication:** Users need to be authenticated to retrieve subject details. Access to the endpoint is restricted based on user's session validation.\\n\\n**Permissions:** This endpoint requires that the user has the 'view_subjects' permission within their role. Users without sufficient permissions will be denied access to the subject list.\\n\\nThe process begins when the endpoint 'listSubjects' is invoked from the subject REST service. This calls the 'listSubjects' method in the backend's core subject module, which in turn might interact with a database to retrieve relevant subject information based on the input parameters such as academic program and term identifiers. The method consolidates the data, applying any necessary filters such as checking permissions or roles of the user, before sending back a list of subjects. Each subject is represented as an object within an array, providing a comprehensive overview needed by the frontend for display or further processing.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/subjects-postSubjectRest.request.txt b/packages/leemons-openapi/lib/requests/subjects-postSubjectRest.request.txt new file mode 100644 index 0000000000..cfc51ea0da --- /dev/null +++ b/packages/leemons-openapi/lib/requests/subjects-postSubjectRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postSubjectRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/addSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/setSubjectCredits.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/setSubjectInternalId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/getCourseIndex.js\n[object Object]", + "response": "{\"summary\":\"Add new subject to academic portfolio\",\"description\":\"This endpoint is designed to add a new subject to a user's academic portfolio within the Leemonade platform, ensuring that all necessary academic details are accurately recorded.\\n\\n**Authentication:** Users need to be authenticated to access this endpoint, as it involves sensitive user-specific academic data.\\n\\n**Permissions:** This endpoint requires that the user has `academic-write` permission to allow the addition of academic records.\\n\\nUpon receiving the API call, the `postSubjectRest` handler orchestrates several functions to ensure the subject is correctly added to the database. Initially, it calls `addSubject` from the `subjects` core module, which is responsible for validating the input data and then inserting the subject details into the database. After the subject is added, the handler may invoke `setSubjectCredits` and `setSubjectInternalId` for further configuration specific to the academic institution's requirements. The entire process ensures data integrity and adherence to the academic module's rules before responding to the client with a successful operation acknowledgment.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/subjects-putSubjectCreditsRest.request.txt b/packages/leemons-openapi/lib/requests/subjects-putSubjectCreditsRest.request.txt new file mode 100644 index 0000000000..507613b872 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/subjects-putSubjectCreditsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putSubjectCreditsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/setSubjectCredits.js\n[object Object]", + "response": "{\"summary\":\"Updates the credit value for a specified subject\",\"description\":\"This endpoint updates the credit value for a subject within the academic portfolio. The modification pertains to how many credits a particular subject is worth in the academic curriculum, reflecting changes directly into the academic records and related calculations for student progress and curriculum planning.\\n\\n**Authentication:** Users need to be authenticated to update subject credits. The system will check for a valid session or api token before processing the request.\\n\\n**Permissions:** This endpoint requires administrative permissions related to academic management. Only users with the role of 'Academic Administrator' or similar permissions can update subject credits.\\n\\nUpon receiving a request, the handler first validates the incoming data against predefined schemas to ensure the subject identifier and new credit values are correctly formatted. It then calls the `setSubjectCredits` method from the `subjects` core module, which updates the credit value in the persistent storage (usually a database). This method logs the change transaction for auditing purposes. The process is designed to handle errors smoothly, returning meaningful error messages if the update cannot be completed, ensuring the client understands why the request failed. The successful update results in a confirmation message to the user, indicating the credits have been successfully updated.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/subjects-putSubjectRest.request.txt b/packages/leemons-openapi/lib/requests/subjects-putSubjectRest.request.txt new file mode 100644 index 0000000000..8ba506d89d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/subjects-putSubjectRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putSubjectRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/updateSubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/classByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/programs/programHasSequentialCourses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/substage/removeByClass.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/classes/substage/changeClassSubstageBySubject.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/setSubjectCredits.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/setSubjectInternalId.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/courses/getCourseIndex.js\n[object Object]", + "response": "{\"summary\":\"Updates specific details of a subject within the academic portfolio\",\"description\":\"This endpoint allows for the modification of specific details related to a subject in the academic manager’s portfolio. It primarily facilitates updates to fields such as subject name, credit values, and internal identifiers within the context of an educational institution's system.\\n\\n**Authentication:** User authentication is mandatory to access this endpoint. Requests without valid authentication will be rejected.\\n\\n**Permissions:** This endpoint requires the user to have 'edit_subject' permissions within their role to update subject details. Unauthorized access attempts will lead to a denial of service.\\n\\nThe process begins by validating the provided JSON payload against the defined schema to ensure all required fields are present and properly formatted. It then calls the `updateSubject` method located in the 'subjects' core, which handles the updating of subject details in the database. This method uses both the subject ID and details from the request payload to apply updates. On successful update, a confirmation response is sent back to the client, otherwise, appropriate error messages are generated and returned based on the issue encountered during the update.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/subjects-subjectsByIdsRest.request.txt b/packages/leemons-openapi/lib/requests/subjects-subjectsByIdsRest.request.txt new file mode 100644 index 0000000000..42f8e4681e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/subjects-subjectsByIdsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'subjectsByIdsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-academic-portfolio/backend/core/subjects/subjectByIds.js\n[object Object]", + "response": "{\"summary\":\"Retrieve subjects based on a list of given IDs\",\"description\":\"This endpoint retrieves detailed information about subjects identified by a list of unique IDs. The data returned typically includes details such as the subject name, category, credits, and associated instructors or departments.\\n\\n**Authentication:** Access to this endpoint requires the user to be authenticated. An authentication token must be provided, and it's verified to ensure validity before proceeding with data retrieval.\\n\\n**Permissions:** The user needs specific permissions related to academic data access. Typically, this includes permissions like 'view_subjects' or 'academic_portfolio_access'. Users without the necessary permissions will receive an access denied message.\\n\\nUpon receiving the request, the `subjectsByIdsRest` handler initially validates the presence and formatting of the subject IDs in the request. It then calls the `subjectByIds` method located in the `subjects` core module. This method is responsible for querying the database for the specified subject IDs, aggregating the required details, and performing any necessary data transformations to conform to the expected response structure. Finally, the handler returns the subject data as a JSON object in the response body, formatted according to the endpoint's specification.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tasks-createRest.request.txt b/packages/leemons-openapi/lib/requests/tasks-createRest.request.txt new file mode 100644 index 0000000000..f0465bdb7c --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tasks-createRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'createRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/core/task/create.js\n[object Object]", + "response": "{\"description\":\"{\\n \\\"summary\\\": \\\"Create new task in the system\\\",\\n \\\"description\\\": \\\"This endpoint is designed for the creation of a new task within the system. It processes user's input to register a new task with specified attributes such as title, description, priority, and due date among others.\\n\\n**Authentication:** User authentication is required to access this endpoint. Users must provide valid credentials to be able to submit new tasks.\\n\\n**Permissions:** The user must have task creation permissions. Typically, this would be granted to users who are project managers or team leads with rights to manage tasks within their jurisdiction.\\n\\nThe processing of the `createRest` handler involves several steps. Firstly, the handler receives the task data sent by the client, which includes all necessary task attributes. It then verifies the user's authorization and permissions to create a new task. After validation, the `create` method from `tasks.core` is called, passing the task data and user's details. This method primarily handles the business logic for task registration, which includes data validation, setting default values, and saving the new task to the database. Upon successful database entry, a success response is returned to the user, confirming the task creation along with the details of the newly created task.\\\"\\n}\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tasks-duplicateRest.request.txt b/packages/leemons-openapi/lib/requests/tasks-duplicateRest.request.txt new file mode 100644 index 0000000000..c4c1a1620d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tasks-duplicateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'duplicateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/core/task/duplicate.js\n[object Object]", + "response": "{\"summary\":\"Duplicates a specific task\",\"description\":\"This endpoint is responsible for duplicating an existing task identified by its unique ID. It copies the task details and creates a new task with the same attributes but a new identifier.\\n\\n**Authentication:** Users must be logged in to duplicate a task. Requests without valid authentication will be rejected.\\n\\n**Permissions:** A user needs to have edit or create permissions on tasks to perform duplication. Without the necessary permissions, the endpoint will deny access to the task duplication functionality.\\n\\nThe controller initiates the duplication process by calling the `duplicate` function from the `task` core module. It receives the task ID to be duplicated from the request parameters. The `duplicate` function internally handles the task of fetching the existing task data, cloning its details while generating a new task ID, and saving the new task entry in the database. It ensures that all linked items, such as subtasks and attachments, are also duplicated appropriately. Once the duplication is complete, the new task details are returned in the response, signalling successful operation.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tasks-getRest.request.txt b/packages/leemons-openapi/lib/requests/tasks-getRest.request.txt new file mode 100644 index 0000000000..ab2235adcb --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tasks-getRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/core/task/get.js\n[object Object]", + "response": "{\"summary\":\"Retrieves task details based on the provided task identifier\",\"description\":\"This endpoint retrieves the specific details of a task identified by its unique identifier. It aims to provide comprehensive information about an individual task, including its status, assigned users, deadlines, and other relevant metadata which are crucial for managing tasks within a project.\\n\\n**Authentication:** User must be logged in to access this endpoint. Authentication ensures that the user's session is valid for security purposes.\\n\\n**Permissions:** Appropriate permissions are required to access this task's details. These permissions ensure that users are only able to retrieve tasks to which they have been granted explicit access rights.\\n\\nUpon receiving a request, this endpoint invokes the `getTask` method from the `tasks` service, which is responsible for querying the database with the task's unique identifier. The method processes the request by validating the user’s identity and permissions before retrieving the task data. The process involves multiple checks for authentication and authorization to ensure secure and compliant access to the task information. Once validated, the task data is fetched and formatted before being sent back to the user as a JSON object that contains the detailed information about the task.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tasks-publishRest.request.txt b/packages/leemons-openapi/lib/requests/tasks-publishRest.request.txt new file mode 100644 index 0000000000..b01ad116bd --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tasks-publishRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'publishRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/core/task/publish.js\n[object Object]", + "response": "{\"summary\":\"Publish a new task within the platform\",\"description\":\"This endpoint handles the publication of a new task in the leemons platform. It involves creating task entries in the backend data store and setting up necessary configurations to track and manage these tasks as part of the broader application environment.\\n\\n**Authentication:** Users need to be authenticated to utilize this endpoint. The absence of a valid authentication mechanism or session will prevent the user from performing any operations associated with task publication.\\n\\n**Permissions:** Proper permissions are required to publish tasks. Users attempting to access this endpoint must possess task creation or management rights as dictated by the leemons platform's security policies.\\n\\nFollowing authentication and permission checks, the `publishRest` action invokes the core method `publishTask` from the `tasks` module, which performs the task data validation, creation, and initial setup. This method ensures that all task data complies with the predefined schemas and handles state tracking from creation to publication. The result of this method is a new task instance that is recorded in the database and configured for tracking and management within the leemons ecosystem. The response back to the client indicates successful task creation and includes details of the newly created task.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tasks-removeRest.request.txt b/packages/leemons-openapi/lib/requests/tasks-removeRest.request.txt new file mode 100644 index 0000000000..057d186d56 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tasks-removeRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/core/task/remove.js\n[object Object]", + "response": "{\"summary\":\"Remove a specified task\",\"description\":\"This endpoint allows for the deletion of a specific task based on the task ID provided. The purpose is to permanently remove a task record from the system, ensuring that all its associated data is also cleared appropriately from the database.\\n\\n**Authentication:** Users need to be logged in to perform deletion operations. Authentication is required to ensure that a user can only delete tasks they are authorized to remove.\\n\\n**Permissions:** This endpoint requires the user to have task deletion permissions. If the user does not have the appropriate permissions, the request will be denied, ensuring system security and data integrity.\\n\\nUpon receiving a deletion request, the `removeRest` handler in the `tasks.rest.js` file calls the `remove` method from the `task` core (`remove.js`). The method takes the task ID from the request parameters and proceeds to check if the task exists and if the user has the necessary permissions to delete it. If these conditions are met, the task is removed using a database call that specifically targets this entry. Subsequent related data such as task logs or sub-tasks may also be cleared, depending on the system's configuration and relationships defined within the database. The process culminates in a response that confirms the deletion or provides an error message detailing why the task could not be deleted.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tasks-searchRest.request.txt b/packages/leemons-openapi/lib/requests/tasks-searchRest.request.txt new file mode 100644 index 0000000000..0970311eaf --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tasks-searchRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'searchRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/core/task/search.js\n[object Object]", + "response": "{\"summary\":\"Searches and retrieves task details based on specified criteria\",\"description\":\"This endpoint enables the searching and retrieval of tasks based on multiple filter criteria such as tags, status, or deadlines. It facilitates the efficient management and overview of tasks within the leemons platform, allowing users to quickly locate specific tasks or sets of tasks that meet the queried conditions.\\n\\n**Authentication:** Users need to be authenticated to search tasks. Unauthorized access is strictly controlled and any unauthenticated request will be rejected.\\n\\n**Permissions:** This endpoint requires that the user has the 'task_view' permission. Users without sufficient permissions will not be able to access task details or carry out searches.\\n\\nUpon receiving a search request, the `searchRest` handler in `tasks.rest.js` interacts with the `search` function defined in `search.js` within the `leemons-plugin-tasks` backend. This function constructs a query based on the provided parameters and executes a database search through the Moleculer data service. The searching mechanism can handle various types of filters simultaneously and integrates complex querying capabilities to accommodate different user needs. Once the search is completed, the tasks that match the criteria are compiled and returned in a structured JSON format, providing a concise and detailed view of each task.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tasks-updateRest.request.txt b/packages/leemons-openapi/lib/requests/tasks-updateRest.request.txt new file mode 100644 index 0000000000..bb1997b638 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tasks-updateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tasks/backend/core/task/update.js\n[object Object]", + "response": "{\"summary\":\"Update a specific task\",\"description\":\"This endpoint updates the details of an existing task based on the provided task ID and updates sent in the request body. Only fields specified in the request will be updated, ensuring minimal data manipulation and maintaining data integrity.\\n\\n**Authentication:** Users must be authenticated to modify task details. An invalid or missing authentication token will prevent access to this endpoint.\\n\\n**Permissions:** Users need to have 'edit_task' permissions to update a task. Without appropriate permissions, the request will be rejected, ensuring strict compliance with user roles and privileges.\\n\\nThe endpoint begins by invoking the 'updateTask' method from the 'task' core module. This method takes 'ctx' (context) parameter, which includes user authentication information, and 'data' parameter containing fields to be updated. The method checks for user permissions and validates the fields against pre-set criteria to avoid undesirable data updates. Upon successful validation, it interacts with the database to update the specific fields of the task in question. The completion of the action sends a response back with the updated task details, indicating a successful operation or returning an error message in case of failure.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-assignTestRest.request.txt b/packages/leemons-openapi/lib/requests/tests-assignTestRest.request.txt new file mode 100644 index 0000000000..68f44908f7 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-assignTestRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'assignTestRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/listTests.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getTestsDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/getQuestionsBanksDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/saveTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceTimestamp.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setQuestionResponse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/findQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/calculeUserAgentInstanceNote.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getUserQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getConfigByInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getQuestionClues.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/assignTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getInstanceFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getAssignSavedConfigs.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/updateAssignSavedConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteAssignSavedConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/duplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/duplicateQuestionBank.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/saveQuestionsBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/removeSubjectsFromQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/addSubjectsToQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/updateCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/createCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/deleteQuestions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/updateQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/createQuestion.js\n[object Object]", + "response": "{\"summary\":\"Assign a specific test to a group or individual users\",\"description\":\"This endpoint assigns a specific test to either a group of users or individual users based on the criteria specified in the request. The assignment involves mapping a test instance to the specified users or groups, enabling them to access and complete the test within a set timeframe.\\n\\n**Authentication:** Users need to be authenticated to perform this operation. Proper authentication ensures that only authorized users can assign tests.\\n\\n**Permissions:** This endpoint requires the user to have administrative or teacher-level permissions, specifically the rights to manage and assign tests within the system.\\n\\nUpon receiving the request, the `assignTestRest` handler first validates the user's authentication status and permissions. If the user is authenticated and has the necessary permissions, the handler proceeds to parse the input parameters which include the test ID and the identifiers for users or groups. The logic then interacts with the `assignTest` method in the backend's core test module, which handles the assignment logic, including the verification of test existence and user/group eligibility. The method updates the database entries to reflect the new assignments and returns a success response if the assignments are made successfully, or an appropriate error message otherwise.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-deleteAssignConfigRest.request.txt b/packages/leemons-openapi/lib/requests/tests-deleteAssignConfigRest.request.txt new file mode 100644 index 0000000000..a0856f4a61 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-deleteAssignConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteAssignConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteAssignSavedConfig.js\n[object Object]", + "response": "{\"summary\":\"Deletes assigned configuration data\",\"description\":\"This endpoint handles the removal of specific configuration data assigned to a user or a certain system function within the platform. It specifically looks for configurations that have been previously saved and are no longer required or valid, ensuring the system's data integrity and customization relevance are maintained.\\n\\n**Authentication:** Users need to be authenticated to perform deletion operations on configurations. Failure to provide valid authentication credentials will prevent access to this functionality.\\n\\n**Permissions:** The endpoint requires administrative rights or specific role-based permissions, designed to ensure that only authorized personnel can delete sensitive configuration data.\\n\\nUpon receiving a delete request, the `deleteAssignConfigRest` action within the `tests.rest.js` file initiates the process by verifying user credentials and permissions. It then calls the `deleteAssignSavedConfig` method from the backend's core logic, passing necessary parameters such as configuration identifiers. This method interacts with the backend database or configuration storage to effectively remove the designated entries. The process is logged for auditing purposes, and upon successful completion, a confirmation response is sent back to the user indicating the successful deletion of the configuration data.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-deleteTestRest.request.txt b/packages/leemons-openapi/lib/requests/tests-deleteTestRest.request.txt new file mode 100644 index 0000000000..89cf099429 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-deleteTestRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteTestRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteTest.js\n[object Object]", + "response": "{\"summary\":\"Deletes a specific test\",\"description\":\"This endpoint allows for the deletion of a specific test identified by its unique ID. The deletion process permanently removes the test from the system, including all associated data.\\n\\n**Authentication:** User authentication is required to ensure that only authorized users can delete tests. A verification process checks whether the provided user credentials match with an existing user session.\\n\\n**Permissions:** The user must have 'delete_tests' permission to execute this action. If the user lacks this permission, the request is denied with an appropriate error message.\\n\\nUpon receiving the delete request, the `deleteTest` action in the `tests.rest.js` file gets triggered. This action starts by verifying the user's authentication status and permissions. If authentication or permissions checks fail, it immediately returns a response indicating the lack of authorization. If checks pass, the action calls the `deleteTestById` method from the `tests` core module. This method executes a database query to remove the test based on the provided ID. The completion of this operation models the final response where the success or failure of the deletion is communicated back to the client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-duplicateRest.request.txt b/packages/leemons-openapi/lib/requests/tests-duplicateRest.request.txt new file mode 100644 index 0000000000..c1f5ecd204 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-duplicateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'duplicateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/duplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getTestsDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/getQuestionsBanksDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/duplicateQuestionBank.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/saveQuestionsBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/removeSubjectsFromQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/addSubjectsToQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/updateCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/createCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/deleteQuestions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/updateQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/createQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/saveTest.js\n[object Object]", + "response": "{\"summary\":\"Duplicate a specific test configuration\",\"description\":\"This endpoint allows for the duplication of a specific test configuration within the system. Cloning the details and setups of the chosen test to create a new, identical entry under a new identifier.\\n\\n**Authentication:** User authentication is required to access this duplication feature. Users must be logged into their accounts to initiate the duplication process.\\n\\n**Permissions:** Adequate permissions must be granted for users to be able to duplicate test configurations. Typically, this includes permissions to read and create tests within the system.\\n\\nUpon receiving a request, the `duplicateTest` action in the `Tests` service is invoked with necessary parameters such as the test identifier. This action uses a method to fetch all data related to the original test from the database, then creates a new test entry by copying all fetched details. Post duplication, a new unique test ID is generated for the newly created test, ensuring no conflicts with existing entries. The flow completes with a response to the client including the details of the newly duplicated test, encapsulated within a standardized format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-getAssignConfigsRest.request.txt b/packages/leemons-openapi/lib/requests/tests-getAssignConfigsRest.request.txt new file mode 100644 index 0000000000..bcb0a5455a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-getAssignConfigsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getAssignConfigsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getAssignSavedConfigs.js\n[object Object]", + "response": "{\"summary\":\"Assigns saved configurations to a user or entity\",\"description\":\"This endpoint is responsible for associating saved configurations with a specific user or entity based on provided criteria. The functionality ensures that personalized settings or preferences are retained and applied as needed across different sessions or interactions.\\n\\n**Authentication:** User authentication is mandatory to ensure that the assignment of configurations is secure and specific to an authorized user. Unauthorized access or unauthenticated requests are systematically rejected.\\n\\n**Permissions:** The user must have the appropriate permissions to modify or assign configurations. This typically includes administrative rights or specific role-based permissions that allow for configuration management.\\n\\nThe handler begins by extracting necessary parameters from the request, such as user or entity identifiers and the specific configuration details to be applied. It then invokes a method from the configuration management service to validate the existence and appropriateness of the configurations for assignment. Following validation, the configurations are applied to the intended user or entity. The process involves database transactions to ensure that the changes are persistently stored and retrievable in future sessions. Once successfully applied, the service constructs and sends a response back to the client, confirming the successful assignment of the configurations.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-getInstanceFeedbackRest.request.txt b/packages/leemons-openapi/lib/requests/tests-getInstanceFeedbackRest.request.txt new file mode 100644 index 0000000000..955f3705be --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-getInstanceFeedbackRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getInstanceFeedbackRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/listTests.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getTestsDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/getQuestionsBanksDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/saveTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceTimestamp.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setQuestionResponse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/findQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/calculeUserAgentInstanceNote.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getUserQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getConfigByInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getQuestionClues.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/assignTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getInstanceFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getAssignSavedConfigs.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/updateAssignSavedConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteAssignSavedConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/duplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/duplicateQuestionBank.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/saveQuestionsBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/removeSubjectsFromQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/addSubjectsToQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/updateCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/createCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/deleteQuestions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/updateQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/createQuestion.js\n[object Object]", + "response": "{\"summary\":\"Retrieve user-specific feedback for an instance\",\"description\":\"This endpoint is designed to fetch feedback about a specific instance that pertains to the user. The feedback may include performance metrics, user's responses, and general comments about the instance's completion.\\n\\n**Authentication:** Users must be authenticated to access the feedback related to the instances they are involved with. The endpoint requires a valid session token to ensure that the feedback provided is specific to the requesting user's account.\\n\\n**Permissions:** The user needs to have 'view_feedback' permission to retrieve information on this endpoint. Without the appropriate permissions, the server will reject the request indicating insufficient permissions.\\n\\nUpon receiving a request, the handler first verifies the user's credentials and permissions using middleware components that check for a valid session and proper permission flags. It then proceeds to call a service method 'getInstanceFeedback' from the core logic layer, which queries the database for detailed feedback linked to the user and the specified instance. The data workflow involves gathering comprehensive feedback details, processing them as necessary, and returning them to the user, formatted suitably for easy interpretation. The final output is delivered as a JSON object containing structured feedback data.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-getTestRest.request.txt b/packages/leemons-openapi/lib/requests/tests-getTestRest.request.txt new file mode 100644 index 0000000000..5e710afcbc --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-getTestRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getTestRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/listTests.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getTestsDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/getQuestionsBanksDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/saveTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceTimestamp.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setQuestionResponse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/findQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/calculeUserAgentInstanceNote.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getUserQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getConfigByInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getQuestionClues.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/assignTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getInstanceFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getAssignSavedConfigs.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/updateAssignSavedConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteAssignSavedConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/duplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/duplicateQuestionBank.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/saveQuestionsBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/removeSubjectsFromQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/addSubjectsToQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/updateCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/createCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/deleteQuestions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/updateQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/createQuestion.js\n[object Object]", + "response": "{\"summary\":\"Fetch detailed test information based on test ID\",\"description\":\"This endpoint retrieves detailed information about a specific test by its unique identifier. It is primarily used to obtain all relevant details required by the frontend to display or process a particular test.\\n\\n**Authentication:** Users need to be authenticated to request test details to ensure that the information is secure and only accessible to users within the permitted roles or access rights.\\n\\n**Permissions:** This endpoint requires the user to have 'view_tests' permission. Without this permission, the user's request to access test details will be denied, safeguarding sensitive test information.\\n\\nUpon receiving a request, the handler first verifies that the user is authenticated and has the necessary permissions. If these conditions are met, the handler calls a service method specifically designed to fetch test data from the database using the provided test ID. This method incorporates business logic to handle different scenarios such as test availability or access rights. Finally, the processed data, which includes complete test details such as questions, configurations, and metadata, is returned to the user formatted as a JSON object.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-getUserQuestionResponsesRest.request.txt b/packages/leemons-openapi/lib/requests/tests-getUserQuestionResponsesRest.request.txt new file mode 100644 index 0000000000..4faf91dfe4 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-getUserQuestionResponsesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getUserQuestionResponsesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getUserQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/findQuestionResponses.js\n[object Object]", + "response": "{\"summary\":\"Fetches user-specific question responses\",\"description\":\"This endpoint fetches responses to questions that have been submitted by a specific user in the system. It aggregates responses across different assessments or tests where the user participated, providing a comprehensive view of the user's interactions and answers.\\n\\n**Authentication:** User authentication is strictly required to access this endpoint. Users must provide a valid authentication token which is verified for integrity and validity before processing the request.\\n\\n**Permissions:** This endpoint requires the user to have specific permissions related to viewing test responses. Typically, permissions such as `view_tests` or `view_user_responses` are checked to ensure authorized access.\\n\\nUpon receiving a request, the handler first validates the user's authentication status and permissions. If either check fails, an error response is returned. Otherwise, it proceeds to invoke the `getUserQuestionResponses` method from the tests core logic. This method compiles data related to the user's question responses by querying the database for entries that match the user's ID across various tests. The resulting data set, formatted as JSON, details the questions, their corresponding responses made by the user, and contextual details like the date of the test and the labels associated with each question. The response is then structured and sent back to the user, providing a clear and detailed overview of their test interactions.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-listTestsRest.request.txt b/packages/leemons-openapi/lib/requests/tests-listTestsRest.request.txt new file mode 100644 index 0000000000..82c2ec1f56 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-listTestsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listTestsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/listTests.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getTestsDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/getQuestionsBanksDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/saveTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceTimestamp.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setQuestionResponse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/findQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/calculeUserAgentInstanceNote.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getUserQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getConfigByInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getQuestionClues.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/assignTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getInstanceFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getAssignSavedConfigs.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/updateAssignSavedConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteAssignSavedConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/duplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/duplicateQuestionBank.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/saveQuestionsBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/removeSubjectsFromQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/addSubjectsToQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/updateCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/createCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/deleteQuestions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/updateQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/createQuestion.js\n[object Object]", + "response": "{\"summary\":\"List all tests available to the user\",\"description\":\"This endpoint retrieves all test configurations available to the currently authenticated user. The retrieved information includes details such as the test name, description, and associated subjects.\\n\\n**Authentication:** Users need to be logged in to access this endpoint. An invalid or missing authentication token will result in access being denied.\\n\\n**Permissions:** Users need to have 'view tests' permission to retrieve the list of available tests. If the user does not have the required permissions, access to the test data is denied.\\n\\nThe endpoint initializes by calling the `listTests` method from the `Tests` core service, which validates the user's credentials and permissions. If authentication and authorization are validated, the method queries the database for tests that the user is permitted to access based on the roles and permissions associated with their account. The data retrieved includes essential test details necessary for users to manage or partake in tests. Finally, the data is formatted and sent back to the user as a JSON response, containing an array of test objects.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-saveTestRest.request.txt b/packages/leemons-openapi/lib/requests/tests-saveTestRest.request.txt new file mode 100644 index 0000000000..e6bafe827f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-saveTestRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveTestRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/listTests.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getTestsDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/getQuestionsBanksDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/saveTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceTimestamp.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setQuestionResponse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/findQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/calculeUserAgentInstanceNote.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getUserQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getConfigByInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getQuestionClues.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/assignTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getInstanceFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getAssignSavedConfigs.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/updateAssignSavedConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteAssignSavedConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/duplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/duplicateQuestionBank.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/saveQuestionsBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/removeSubjectsFromQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/addSubjectsToQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/updateCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/createCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/deleteQuestions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/updateQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/createQuestion.js\n[object Object]", + "response": "{\"summary\":\"Saves a new test configuration\",\"description\":\"This endpoint is responsible for saving a test configuration to the database. It allows the client to store all necessary details about a test including its structure, associated questions, and metadata.\\n\\n**Authentication:** Users must be authenticated to save a test configuration. This action ensures that only authorized users can create or modify tests.\\n\\n**Permissions:** The endpoint requires administrative or specific module-related permissions to ensure that only users with the right to create or edit tests can perform this operation.\\n\\nUpon receiving the API call, the `saveTestRest` handler initially validates the input to ensure it contains valid and complete test details. It then utilizes the `saveTest` method from the core `tests` service. This method involves a series of processes including the validation of allowed fields, association of the test with the appropriate user context, and the insertion of the test into the database. If successful, the saved test details are returned in the response, along with a confirmation message. Error handling is implemented to catch and return any issues that might arise during the process, such as validation failures or database errors.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-setInstanceFeedbackRest.request.txt b/packages/leemons-openapi/lib/requests/tests-setInstanceFeedbackRest.request.txt new file mode 100644 index 0000000000..9aff42ad67 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-setInstanceFeedbackRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setInstanceFeedbackRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/listTests.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getTestsDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/getQuestionsBanksDetails.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/saveTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceTimestamp.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setQuestionResponse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/findQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/calculeUserAgentInstanceNote.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getUserQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getConfigByInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getQuestionClues.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/assignTest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getInstanceFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceFeedback.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getAssignSavedConfigs.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/updateAssignSavedConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/deleteAssignSavedConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/duplicate.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/duplicateQuestionBank.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions-banks/saveQuestionsBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/removeSubjectsFromQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-subjects/addSubjectsToQuestionBanks.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/updateCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/question-bank-categories/createCategory.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/deleteQuestions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/updateQuestion.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/createQuestion.js\n[object Object]", + "response": "{\"summary\":\"Set feedback for a test instance\",\"description\":\"This endpoint allows setting user-specific feedback for a particular test instance. The feedback can include comments, scores, or any formative feedback aimed to be shown to the user after completing the test.\\n\\n**Authentication:** Users must be authenticated to submit feedback. Lack of proper authentication will prevent access to this functionality.\\n\\n**Permissions:** The user needs to have 'edit-feedback' permission for the specific test instance to submit or update feedback.\\n\\nThis operation begins by decoding and verifying the user's authentication token to ensure validity and current session activity. Upon successful authentication, the method checks if the authenticated user has the required permission 'edit-feedback' for the test instance in question. If the permission checks succeed, the feedback data provided in the request body is processed and saved into the database linked to the specific test instance. The feedback storage is handled by a dedicated service method within the Moleculer service, which ensures the data integrity and provides error handling in case of database issues. Once successfully stored, the API returns a success message to the client, indicating that the feedback has been set.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-setInstanceTimestampRest.request.txt b/packages/leemons-openapi/lib/requests/tests-setInstanceTimestampRest.request.txt new file mode 100644 index 0000000000..1ad30bb67d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-setInstanceTimestampRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setInstanceTimestampRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setInstanceTimestamp.js\n[object Object]", + "response": "{\"summary\":\"Sets the current instance timestamp for a specific test configuration\",\"description\":\"This endpoint updates the timestamp for a test instance in the test configuration database. This operation is crucial for tracking and logging purposes, specifically for identifying when certain test activities occurred.\\n\\n**Authentication:** Users must be authenticated to update a test instance timestamp. Authentication ensures that only authorized personnel can make such updates to maintain test integrity.\\n\\n**Permissions:** This endpoint requires administrative permissions related to test management. Users without the appropriate permissions will not be able to update timestamps.\\n\\nUpon receiving a request, the `setInstanceTimestamp` function is invoked from the `Tests` service. This function retrieves the test instance details based on the provided instance identifier and proceeds to update the timestamp field with the current server time. This operation involves a transaction-like mechanism, ensuring that the timestamp update is atomic and error-free. The method concludes by returning a success status if the update is completed without any issues, otherwise, it will return an appropriate error response.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-setQuestionResponseRest.request.txt b/packages/leemons-openapi/lib/requests/tests-setQuestionResponseRest.request.txt new file mode 100644 index 0000000000..f96e15a262 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-setQuestionResponseRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setQuestionResponseRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/setQuestionResponse.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/findQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/calculeUserAgentInstanceNote.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/getUserQuestionResponses.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/questions/getByIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getConfigByInstance.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/helpers/getQuestionClues.js\n[object Object]", + "response": "{\"summary\":\"Stores a user’s response to a specific test question\",\"description\":\"This endpoint is responsible for recording a user's response to a given question in a test scenario. It ensures that the response is saved in the appropriate format and associated with the correct user and test instance.\\n\\n**Authentication:** User authentication is required to ensure that responses are recorded for the correct user. An absence of valid authentication will prevent the endpoint from processing the request.\\n\\n**Permissions:** Specific permissions related to test-taking capabilities are required for a user to submit their responses. The exact permissions should be defined based on the level of access the user has to the test and the type of questions they are allowed to answer.\\n\\nUpon receiving a request, this endpoint invokes the `setQuestionResponse` method within the `Tests` service. This method processes the input, which includes the user's ID, the test ID, the question ID, and the user's response. The method verifies the validity of the data and checks against user permissions. Once validated, the response is stored in a database with the necessary metadata such as timestamp and user details. The process is designed to ensure data integrity and security, providing a reliable way for users to submit their test responses.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/tests-updateAssignConfigRest.request.txt b/packages/leemons-openapi/lib/requests/tests-updateAssignConfigRest.request.txt new file mode 100644 index 0000000000..2c09dcf185 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/tests-updateAssignConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateAssignConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-tests/backend/core/tests/updateAssignSavedConfig.js\n[object Object]", + "response": "{\"summary\":\"Update assignment configuration settings\",\"description\":\"This endpoint allows for updating the saved configuration settings related to assignments within the system. It handles the modifications of specific configurations and ensures that changes are applied and persisted appropriately across the platform.\\n\\n**Authentication:** Users need to be authenticated to perform an update on assignment configuration settings. A valid user session must be present, and an API key or access token may be required to authenticate the request.\\n\\n**Permissions:** The user must have the 'admin' role or specific update permissions for assignment configurations. Without the requisite permissions, the request will be rejected, and an access denied error will be returned.\\n\\nThe endpoint involves several key operations from the moment a request is received. Initially, it validates the incoming data against pre-defined schemas to ensure that all provided information is correct and complete. If validation passes, the endpoint then proceeds to call upon the 'updateConfig' method within the configurations service, passing necessary parameters such as the new configuration details and context information. This method is responsible for checking existing configurations, applying updates, and saving these changes to a persistent storage system, such as a database. Once the update operation is successfully completed, a confirmation response is sent back to the client indicating that the configuration has been updated.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/timetable-countRest.request.txt b/packages/leemons-openapi/lib/requests/timetable-countRest.request.txt new file mode 100644 index 0000000000..794b643d06 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/timetable-countRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'countRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/timetables/count.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/timetable/timeFiltersQuery.js\n[object Object]", + "response": "{\"summary\":\"Counts the number of timetables based on provided filters\",\"description\":\"This endpoint provides the count of timetables that match certain criteria specified through filters. It essentially serves to inform the client about the quantity of timetables, facilitating operations like pagination in the user interface.\\n\\n**Authentication:** User authentication is mandatory for accessing this endpoint. Without a valid user session, the request will be rejected.\\n\\n**Permissions:** This endpoint requires the user to have `view_timetable` permission to proceed with fetching the count of timetables. Users without sufficient permissions will receive an access denial response.\\n\\nUpon receiving a request, the endpoint triggers the `countTimetables` action from the `TimetableService`. This action utilizes the `timeFiltersQuery` function from the helpers to generate a query based on the input parameters, which are assumed to include date ranges and possibly other constraints pertaining to timetables. The query is then executed in the database through the `count.js` method in the core module, which efficiently counts the entries matching the criteria without retrieving the full data sets. The result, a numerical value indicating the count of timetables, is then returned to the client in a straightforward JSON format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/timetable-createRest.request.txt b/packages/leemons-openapi/lib/requests/timetable-createRest.request.txt new file mode 100644 index 0000000000..46df1b4b76 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/timetable-createRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'createRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/timetables/create.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/timeToDayjs.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/validateDay.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/weekDays.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/getWeekdays.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/timetables/count.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/timetable/timeFiltersQuery.js\n[object Object]", + "response": "{\"summary\":\"Create a new timetable entry\",\"description\":\"This endpoint is responsible for creating a new timetable entry in the leemons plugin system, including all necessary scheduling details from the provided data.\\n\\n**Authentication:** User authentication is required to ensure only authorized users can create new timetable entries. An unauthorized access attempt will result in denial of the service.\\n\\n**Permissions:** The user must have 'timetable.create' permissions to be able to add new timetable entries. Lack of proper permissions will prevent the user from executing this action.\\n\\nThe endpoint initiates the process by calling the `create` method in the timetable core module. This involves several steps: firstly, validating the input data against predefined schemas to ensure all required fields are present and correctly formatted. Next, it utilizes the `timeToDayjs` helper to convert time data into a suitable format for processing. Assuming validation passes, the `create` method proceeds to insert the new entry into the database with all the relevant details provided in the request. After successful insertion, a response is generated and returned to the user indicating the successful creation of the timetable entry.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/timetable-deleteRest.request.txt b/packages/leemons-openapi/lib/requests/timetable-deleteRest.request.txt new file mode 100644 index 0000000000..5273d7371e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/timetable-deleteRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/timetables/delete.js\n[object Object]", + "response": "{\"summary\":\"Delete a specific timetable\",\"description\":\"This endpoint handles the deletion of a specific timetable based on the provided identifier. It ensures that the data deletion is managed cleanly without leaving orphaned data or references.\\n\\n**Authentication:** Users must be authenticated to delete timetables. The system checks for a valid session or authentication token before processing the request.\\n\\n**Permissions:** This endpoint requires the user to have administrative rights or specific permissions tailored to modifying or deleting timetable data. Without the necessary permissions, the request will be denied.\\n\\nUpon receiving a request, the endpoint first validates the presence and correctness of the timetable ID. It then calls the `deleteTimetable` function from the timetables core logic. This function checks for the existence of the timetable in the database and proceeds with the deletion if it exists and the user has appropriate rights. The deletion process also involves any cleanup necessary to maintain data integrity, such as removing associated time slots or user assignments. After successful deletion, a confirmation message is sent back to the user, indicating the successful removal of the timetable.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/timetable-getRest.request.txt b/packages/leemons-openapi/lib/requests/timetable-getRest.request.txt new file mode 100644 index 0000000000..78006c712d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/timetable-getRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/timetables/get.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/timetable/timeFiltersQuery.js\n[object Object]", + "response": "{\"summary\":\"Provides a timetable based on user-defined filters and rules\",\"description\":\"This endpoint retrieves a user-specific timetable based on predefined filters and rules. The timetable includes classes, timeslots, and potentially other relevant academic resources that are configured per user or group requirements.\\n\\n**Authentication:** User authentication is required to ensure secure access to the pertinent timetable data. An unauthorized or expired session will prevent access to this endpoint.\\n\\n**Permissions:** This endpoint requires the 'view_timetable' permission. Users without this permission will not be able to retrieve timetable information.\\n\\nUpon request, the endpoint initially invokes the 'get' method from `timetables` core, which uses the `timeFiltersQuery` helper to process input filters and query parameters. These parameters define user-specific needs such as class times, preferred days, and any other relevant filters. The 'get' method interacts with the database to fetch timetable data that matches the specified criteria. The processed data is then formatted suitably and returned as a JSON object, providing a structured response that includes all timetable entries relevant to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/timetable-updateRest.request.txt b/packages/leemons-openapi/lib/requests/timetable-updateRest.request.txt new file mode 100644 index 0000000000..27e61807df --- /dev/null +++ b/packages/leemons-openapi/lib/requests/timetable-updateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/timetables/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/timeToDayjs.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/validateDay.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/weekDays.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-timetable/backend/core/helpers/dayjs/getWeekdays.js\n[object Object]", + "response": "{\"summary\":\"Update timetable details\",\"description\":\"This endpoint updates specific details within a timetable. Depending on the request, it can modify aspects like event times, participants, or other related metadata of a timetable entry.\\n\\n**Authentication:** Users need to be authenticated to update a timetable. Access to this endpoint requires valid user credentials, which must be verified before any modification can proceed.\\n\\n**Permissions:** User must have edit permissions for the timetable they attempt to update. Unauthorized access attempts will result in an error and no changes will be made to the timetable.\\n\\nThe process within the controller starts by validating the incoming data against predefined schemas to ensure all required fields are present and correctly formatted. Next, the `updateTimetable` method within the `timetables` core uses this validated data to update the specified timetable entry in the data repository. This involves complex transactions like date calculations and potential conflict resolutions with existing timetable entries. After successful data modification, a response is sent back confirming the updates, or in the case of errors, detailed error messages are returned.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-activateUserRest.request.txt b/packages/leemons-openapi/lib/requests/users-activateUserRest.request.txt new file mode 100644 index 0000000000..d2514f8025 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-activateUserRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'activateUserRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-activeUserAgentRest.request.txt b/packages/leemons-openapi/lib/requests/users-activeUserAgentRest.request.txt new file mode 100644 index 0000000000..cc82ced623 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-activeUserAgentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'activeUserAgentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/active.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/groups/checkIfCanCreateNUserAgentsInGroup.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-agentDetailForPageRest.request.txt b/packages/leemons-openapi/lib/requests/users-agentDetailForPageRest.request.txt new file mode 100644 index 0000000000..31c88896a5 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-agentDetailForPageRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'agentDetailForPageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/contacts/userAgentsAreContacts.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/agentDetailForPage.js\n[object Object]", + "response": "{\"summary\":\"Provides detailed information about a user agent's profile for a specific page\",\"description\":\"This endpoint is designed to fetch detailed information about a user agent's profile tailored for rendering on a particular page. The information typically includes detailed user agent data which is crucial for frontend displays such as user dashboards or profile pages.\\n\\n**Authentication:** Users need to be authenticated to request their agent detail for a page. Accessing this endpoint without valid authentication will result in a denial of the request.\\n\\n**Permissions:** The user must have the permission to view the specific user agent's details. The necessary permissions involve querying user agent-related data that might be sensitive.\\n\\nUpon receiving a request, the endpoint first validates the provided authentication tokens to ensure that the requestor has the rights to access the information. The method `agentDetailForPage` in the `UserAgents` service is then called with necessary parameters like user agent ID and context. This function queries the database to retrieve detailed information about the user agent. This includes personal details, assigned roles, permissions, and other relevant data necessary for the user interface. The response from this call is then formatted appropriately and returned as a JSON object representing the user agent's profile suitable for page-specific uses.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-canRegisterPasswordRest.request.txt b/packages/leemons-openapi/lib/requests/users-canRegisterPasswordRest.request.txt new file mode 100644 index 0000000000..0ed433dc03 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-canRegisterPasswordRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'canRegisterPasswordRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{\"summary\":\"Determine if a user can register a new password\",\"description\":\"This endpoint checks if a user is eligible to register a new password based on specific criteria defined by the system. The evaluation includes checks against user's current password state, security policies, and any other pre-defined system requirements.\\n\\n**Authentication:** Users must be logged in to perform this action. They need to provide valid authentication credentials before making the request to ensure secure access to the password registration facility.\\n\\n**Permissions:** The user needs to have specific permissions that allow them to update or change their password. Without these permissions, the request will be rejected and the action will not be performed.\\n\\nUpon receiving a request, the handler initiates a series of checks to assess the eligibility of the user for password registration. It starts by verifying user authentication and then consulting the system's policy to determine if the user's current conditions satisfy the requirements for registering a new password. This may involve checking for the time since the last password change, password complexity requirements, and any other related security measures. If the checks are passed, the endpoint indicates that the user can proceed with password registration, otherwise, it denies the request with appropriate feedback.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-canResetRest.request.txt b/packages/leemons-openapi/lib/requests/users-canResetRest.request.txt new file mode 100644 index 0000000000..877718297a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-canResetRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'canResetRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{\"summary\":\"Determine if a user can reset their password\",\"description\":\"This endpoint checks if the requesting user has the ability to perform a password reset. It assesses various conditions such as the user's account status, any specific locks, or security settings that might prevent a password reset operation.\\n\\n**Authentication:** User authentication is required to access this endpoint. A valid session or security token needs to be presented to allow for the identity verification of the requester.\\n\\n**Permissions:** Users need to have the 'user.canResetPassword' permission explicitly set in their profile to initiate a password reset. Without this permission, the request will be denied, ensuring that only authorized users can attempt to reset their passwords.\\n\\nThe flow of this controller involves initially receiving the request and extracting the user's credential details from it. This information is then used to check against existing records and configurations in a security module that enforces password policies and user account states. Dependent on these conditions, the function `canUserResetPassword` is executed, which evaluates if the user meets all the requirements for a password reset. It considers factors like account status (active, locked, etc.), security policies regarding password resets, and any recent activity that might influence security decisions. If all conditions are satisfied, the endpoint will confirm that the password reset can proceed.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-centerProfileTokenRest.request.txt b/packages/leemons-openapi/lib/requests/users-centerProfileTokenRest.request.txt new file mode 100644 index 0000000000..fdd3ae5937 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-centerProfileTokenRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'centerProfileTokenRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-centersRest.request.txt b/packages/leemons-openapi/lib/requests/users-centersRest.request.txt new file mode 100644 index 0000000000..750ea57f95 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-centersRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'centersRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{\"summary\":\"Manages centers associated with user roles\",\"description\":\"This endpoint handles the management and association of centers with different user roles within the platform. It is designed to facilitate the administration of access permissions and functionalities across different organizational structures in a multi-centered organization setup.\\n\\n**Authentication:** Users need to be authenticated to manage centers tied to user roles. The system checks if the session contains a valid authentication token before proceeding with any operations.\\n\\n**Permissions:** Users must possess administrative privileges or specific role management permissions to alter or manage center-role associations. Lack of adequate permissions will lead to access denial.\\n\\nThe flow begins with authentication verification to ensure active and legitimate session status. Post authentication, the system checks for specific permissions related to center and role management. If permissions are validated, the handler proceeds to invoke various core methods that manage the assignment or association of centers to different roles based on the rules defined in the business logic. These operations might include creating new associations, modifying existing ones, or listing centers based on role specifications. Each operation interacts with the database to retrieve or update information, ensuring that all changes are persistently reflected.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-contactsRest.request.txt b/packages/leemons-openapi/lib/requests/users-contactsRest.request.txt new file mode 100644 index 0000000000..e7c7a46487 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-contactsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'contactsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/contacts/getUserAgentContacts.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentProfile.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/contacts/getProfileContacts.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/searchUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-createBulkRest.request.txt b/packages/leemons-openapi/lib/requests/users-createBulkRest.request.txt new file mode 100644 index 0000000000..e2af661f2d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-createBulkRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'createBulkRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-createSuperAdminRest.request.txt b/packages/leemons-openapi/lib/requests/users-createSuperAdminRest.request.txt new file mode 100644 index 0000000000..441cf443dd --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-createSuperAdminRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'createSuperAdminRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-deleteUserAgentRest.request.txt b/packages/leemons-openapi/lib/requests/users-deleteUserAgentRest.request.txt new file mode 100644 index 0000000000..fb3db74b57 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-deleteUserAgentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'deleteUserAgentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/deleteById.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-detailForPageRest.request.txt b/packages/leemons-openapi/lib/requests/users-detailForPageRest.request.txt new file mode 100644 index 0000000000..49cda65707 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-detailForPageRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'detailForPageRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/contacts/userAgentsAreContacts.js\n[object Object]", + "response": "{\"summary\":\"Provides detailed user information for a specific page\",\"description\":\"This endpoint is designed to fetch and display detailed information about a user that is pertinent to a specific page view. This involves collating user details that enhance the user experience by tailoring page content to individual user profiles.\\n\\n**Authentication:** The user must be logged in to access detailed information about themselves or others, depending on the permissions granted. Authentication ensures that requests are made by known users.\\n\\n**Permissions:** User must have the 'view_details' permission for accessing detailed information. This permission check ensures that only authorized users can access sensitive data.\\n\\nFrom the initial API call, the method `detailForPage` is triggered within the user's service context. This method performs various checks, starting with authentication verification followed by permission checks. Upon successful validation, it retrieves user-specific data tailored to enhance the content of the page where the user info is displayed. The data retrieval involves querying the database for user attributes and settings that are relevant to the page context. The response from this method is then formatted into JSON and sent back to the client, providing a rich, context-specific view of the user's data.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-detailRest.request.txt b/packages/leemons-openapi/lib/requests/users-detailRest.request.txt new file mode 100644 index 0000000000..0ccc26ce1e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-detailRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'detailRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{\"summary\":\"Provides detailed user profile information\",\"description\":\"This endpoint retrieves detailed information about a user's profile based on the provided user ID. The details include various attributes such as name, email, roles, and associated permissions within the system.\\n\\n**Authentication:** User authentication is required to access this endpoint. A valid session token must be provided in the request header to verify the user's identity and session validity.\\n\\n**Permissions:** The user needs to have the 'view_profile' permission to retrieve detailed user information. Access without sufficient permissions will lead to a denial of the request.\\n\\nUpon receiving the request, the server handler first checks for a valid session token and then proceeds to verify if the logged-in user has the necessary permissions to view user profiles. If these checks pass, the 'getUserDetails' method from the user management service is called with the user ID extracted from the request path. This method interacts with the database to fetch all relevant information about the user. The final response includes a comprehensive JSON object containing all the details of the user's profile.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-disableUserAgentRest.request.txt b/packages/leemons-openapi/lib/requests/users-disableUserAgentRest.request.txt new file mode 100644 index 0000000000..af76d24e69 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-disableUserAgentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'disableUserAgentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/disable.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-getActiveUserAgentsCountByProfileSysNameRest.request.txt b/packages/leemons-openapi/lib/requests/users-getActiveUserAgentsCountByProfileSysNameRest.request.txt new file mode 100644 index 0000000000..964cee7c8b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-getActiveUserAgentsCountByProfileSysNameRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getActiveUserAgentsCountByProfileSysNameRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getActiveUserAgentsCountByProfileSysName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/detailBySysName.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/permissions/transformArrayToObject.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-getDataForUserAgentDatasetsRest.request.txt b/packages/leemons-openapi/lib/requests/users-getDataForUserAgentDatasetsRest.request.txt new file mode 100644 index 0000000000..b46047225d --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-getDataForUserAgentDatasetsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getDataForUserAgentDatasetsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getDataForUserAgentDatasets.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-getRememberLoginRest.request.txt b/packages/leemons-openapi/lib/requests/users-getRememberLoginRest.request.txt new file mode 100644 index 0000000000..948adfd35a --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-getRememberLoginRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRememberLoginRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-getUserAgentsInfoRest.request.txt b/packages/leemons-openapi/lib/requests/users-getUserAgentsInfoRest.request.txt new file mode 100644 index 0000000000..3fadad8eea --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-getUserAgentsInfoRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getUserAgentsInfoRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-initSuperRest.request.txt b/packages/leemons-openapi/lib/requests/users-initSuperRest.request.txt new file mode 100644 index 0000000000..21a5e1e0de --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-initSuperRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'initSuperRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-bulk-data/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-bulk-data/backend/services/rest/users.rest.js\n[object Object]", + "response": "{\"summary\":\"Initialize superuser capabilities for specified users\",\"description\":\"This endpoint facilitates the initialization of superuser capabilities for selected users within the Leemonade platform specifically within the context of bulk user operations. This is typically used in cases where advanced level permissions need to be assigned programmatically to users who are managing various operational aspects.\\n\\n**Authentication:** User authentication is mandatory to verify the legitimacy and authorization of the requester. Unauthenticated access requests will be denied, ensuring secure operations within the platform.\\n\\n**Permissions:** The execution of this endpoint requires administrative privileges. Only users who possess such elevated permissions can initiate superuser status assignments, maintaining strict control over powerful platform capabilities.\\n\\nThe endpoint processes requests by first determining if the `ctx` (context) contains a valid authenticated user session. If the session is valid, it checks if the user has administrative permissions. If both conditions are satisfied, the `initSuperRest` action within `users.rest.js` interacts with the underlying user management systems to assign superuser rights. It uses specific methods to update user statuses in the database, ensuring that the changes adhere to security and operational protocols of the Leemonade platform. After successful updates, it returns confirmation of superuser status initialization to the requester.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-listRest.request.txt b/packages/leemons-openapi/lib/requests/users-listRest.request.txt new file mode 100644 index 0000000000..a5507558e8 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-listRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'listRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-loginRest.request.txt b/packages/leemons-openapi/lib/requests/users-loginRest.request.txt new file mode 100644 index 0000000000..c95cc8a6dd --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-loginRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'loginRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{\"summary\":\"Authenticate and generate session token for user\",\"description\":\"This endpoint handles user authentication processes including validating user credentials and generating a session token. The token can then be used for subsequent requests that require user authentication.\\n\\n**Authentication:** No prior authentication is needed for this endpoint since its primary function is to authenticate users.\\n\\n**Permissions:** This endpoint requires no explicit permissions since it is accessible to any user who needs to authenticate.\\n\\nUpon receiving the request, the endpoint first validates the provided user credentials against stored records using the `comparePassword` method. If the credentials are valid, the `generateJWTToken` method is invoked to create a new JWT token. This token encapsulates the user's identity and permissions, enabling authorized access to protected resources. The response, if successful, includes the JWT token and perhaps other user-related information essential for subsequent interactions with the API.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-profileTokenRest.request.txt b/packages/leemons-openapi/lib/requests/users-profileTokenRest.request.txt new file mode 100644 index 0000000000..33147bbaea --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-profileTokenRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'profileTokenRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-profilesRest.request.txt b/packages/leemons-openapi/lib/requests/users-profilesRest.request.txt new file mode 100644 index 0000000000..99ed2430f9 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-profilesRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'profilesRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{\"summary\":\"Manage user profiles and settings\",\"description\":\"This endpoint allows for the management and retrieval of user profiles, including settings related to user preferences and security configurations. It serves as a central point for user-related information handling within the system.\\n\\n**Authentication:** Users need to be authenticated in order to access and manipulate their profile data. Authentication verification is required to ensure secure access to personal information.\\n\\n**Permissions:** Adequate permissions are required to access or modify different levels of user profile information. Specific roles or privileges determine the extent of data that can be managed or viewed. Permissions checks are integral to secure and appropriate data access.\\n\\nThe process begins with the `profilesRest` handler, which interacts with multiple backend services to fetch or update user details. Calls may include fetching user data from the database, updating security settings, and managing user preferences. Each action within the handler is secured and validated against user permissions and authentication status, ensuring that only authorized actions are performed. The response is systematically formatted to reflect the result of the requested operation, whether it's data retrieval or a confirmation of updates made.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-recoverRest.request.txt b/packages/leemons-openapi/lib/requests/users-recoverRest.request.txt new file mode 100644 index 0000000000..9be929b3c8 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-recoverRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'recoverRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{\"summary\":\"Initiates user password recovery\",\"description\":\"This endpoint facilitates the password recovery process for users who have forgotten their login credentials. It typically involves the user entering their email address, to which a password reset link is sent if the email is associated with an existing account.\\n\\n**Authentication:** No prior authentication is required to access this endpoint, making it accessible for users who cannot log in.\\n\\n**Permissions:** There are no specific permissions required to access this endpoint. However, security measures are in place to ensure that the password reset process is secure and accessible only to the rightful account owner.\\n\\nUpon receiving a password recovery request, the endpoint validates the provided email address against the users database. If the email is found, the system generates a secure token and sends a password reset email to the corresponding user's email address. This token is typically embedded within a URL provided in the email, allowing the user to reset their password in a secure manner. The process ensures that sensitive user information remains protected throughout, without compromising the ease of access to the recovery feature.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-registerPasswordRest.request.txt b/packages/leemons-openapi/lib/requests/users-registerPasswordRest.request.txt new file mode 100644 index 0000000000..4a6dbbc14e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-registerPasswordRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'registerPasswordRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{\"summary\":\"Registers a new password for the user\",\"description\":\"This endpoint allows a user to register a new password as part of the user account setup or password reset process. The registration involves validating the password strength and ensuring it complies with the platform's security requirements.\\n\\n**Authentication:** User authentication is not required for this endpoint as it typically part of an initial setup or password reset flow.\\n\\n**Permissions:** No permissions are required to access this endpoint as it is designed for users who are in the process of setting up their account or resetting their password.\\n\\nUpon receiving a password registration request, the endpoint validates the provided password against defined security policies to ensure it meets the minimum security standards. If the password is valid, it proceeds to securely hash the password using bcrypt and updates the user's password in the database. This process ensures that the user's new password is securely stored and ready for use in subsequent authentications. The response to the client confirms whether the password was successfully registered or provides details about any errors encountered during the process.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-removeRememberLoginRest.request.txt b/packages/leemons-openapi/lib/requests/users-removeRememberLoginRest.request.txt new file mode 100644 index 0000000000..0c3f1aac77 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-removeRememberLoginRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'removeRememberLoginRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-resetRest.request.txt b/packages/leemons-openapi/lib/requests/users-resetRest.request.txt new file mode 100644 index 0000000000..8cea6b315e --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-resetRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'resetRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{\"summary\":\"Reset user password\",\"description\":\"This endpoint allows a user to reset their password using a valid reset token received via email. It facilitates users in recovering access to their accounts when they have forgotten their current password.\\n\\n**Authentication:** No prior user authentication is required to access this endpoint as it is designed for users who are unable to log in due to forgotten passwords.\\n\\n**Permissions:** There are no specific permissions needed to initiate a password reset request; however, the process requires a valid reset token which serves as a temporary authorization proving the request's legitimacy.\\n\\nThe reset process is initiated when the user submits a request to this endpoint with the required reset token and a new password. The `reset` action in the users service first validates the provided reset token to ensure it is active and legitimate. It then proceeds to encrypt the new password using secure hashing algorithms and updates the user's password in the database. Upon successful update, the token is marked as used, preventing reuse, thus enhancing security. The user receives confirmation of the reset either via a success response or an error message if any step fails.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-saveDataForUserAgentDatasetsRest.request.txt b/packages/leemons-openapi/lib/requests/users-saveDataForUserAgentDatasetsRest.request.txt new file mode 100644 index 0000000000..731c240496 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-saveDataForUserAgentDatasetsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'saveDataForUserAgentDatasetsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/saveDataForUserAgentDatasets.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-searchUserAgentsRest.request.txt b/packages/leemons-openapi/lib/requests/users-searchUserAgentsRest.request.txt new file mode 100644 index 0000000000..a22291884b --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-searchUserAgentsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'searchUserAgentsRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/searchUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/contacts/getUserAgentContacts.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentProfile.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/contacts/getProfileContacts.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-sendWelcomeEmailToUserRest.request.txt b/packages/leemons-openapi/lib/requests/users-sendWelcomeEmailToUserRest.request.txt new file mode 100644 index 0000000000..74a9ac0263 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-sendWelcomeEmailToUserRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'sendWelcomeEmailToUserRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-setRememberLoginRest.request.txt b/packages/leemons-openapi/lib/requests/users-setRememberLoginRest.request.txt new file mode 100644 index 0000000000..972b439eb9 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-setRememberLoginRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setRememberLoginRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-updateSessionConfigRest.request.txt b/packages/leemons-openapi/lib/requests/users-updateSessionConfigRest.request.txt new file mode 100644 index 0000000000..79247ef9fe --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-updateSessionConfigRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateSessionConfigRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-updateUserAgentRest.request.txt b/packages/leemons-openapi/lib/requests/users-updateUserAgentRest.request.txt new file mode 100644 index 0000000000..cda19895bf --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-updateUserAgentRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateUserAgentRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/update.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-updateUserAvatarRest.request.txt b/packages/leemons-openapi/lib/requests/users-updateUserAvatarRest.request.txt new file mode 100644 index 0000000000..c80c2e0694 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-updateUserAvatarRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateUserAvatarRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/users-updateUserRest.request.txt b/packages/leemons-openapi/lib/requests/users-updateUserRest.request.txt new file mode 100644 index 0000000000..95fe846f6f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/users-updateUserRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateUserRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/exist.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/existMany.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/encryptPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/checkIfCanCreateNUserAgentsInRoleProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesProfiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/roles/getRolesCenters.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/addCenterProfilePermissionToUserAgents.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addUserAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/calendar/addCalendarToUserAgentsIfNeedByUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/init.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/list.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/login.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/bcrypt/comparePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/generateJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/getJWTPrivateKey.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/isSuperAdmin.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getSuperAdminUserIds.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/reset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getResetConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/verifyJWTToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getHostname.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/update.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/setUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/setPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addBulk.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/validations/forms.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/profiles/getRoleForRelationshipProfileCenter.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/platform/getDefaultLocale.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/recover.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/setUserForRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendWelcomeEmailToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centers.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canReset.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profiles.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/profileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/detailForPage.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-preferences/getPreferences.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserDatasetInfo.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateEmail.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updatePassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/canRegisterPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/getRegisterPasswordConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/hasPermissionCTX.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/user-agents/permissions/updateUserAgentPermissions.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/registerPassword.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/sendActivationEmailsByProfileToUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/centerProfileToken.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateAvatar.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/activateUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/addFirstSuperAdminUser.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/userSessionCheckUserAgentDatasets.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/detailForJWT.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/updateSessionConfig.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/users/jwt/addSessionConfigToToken.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/weights-getRest.request.txt b/packages/leemons-openapi/lib/requests/weights-getRest.request.txt new file mode 100644 index 0000000000..862b9d6b4f --- /dev/null +++ b/packages/leemons-openapi/lib/requests/weights-getRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/weights.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/weights.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/core/weights/getWeights.js\n[object Object]", + "response": "{\"summary\":\"Calculate and retrieve weighted scores for assigned tasks\",\"description\":\"This endpoint calculates and retrieves weighted scores for various tasks assigned to users. It processes data according to configured weighting parameters to ensure precise calculation of task performance metrics.\\n\\n**Authentication:** Users must be authenticated to access this endpoint. Requests made without proper authentication will be rejected, ensuring that only authorized users can retrieve score data.\\n\\n**Permissions:** This endpoint requires users to have specific permissions related to viewing scores. Without sufficient permissions, the request will not be processed, and access will be denied.\\n\\nThe endpoint begins by invoking the `getWeights` method from the `Weights` core module. It uses the passed context (ctx), which includes user details and authentication state, to verify permissions and user identity. The method aggregates score data from various sources, relying on predefined weights, which are applied to calculate the final score for each task. The results are then formatted into a response that provides detailed score information, adhering to the strict data protection and privacy guidelines outlined in the user's permissions.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/weights-setRest.request.txt b/packages/leemons-openapi/lib/requests/weights-setRest.request.txt new file mode 100644 index 0000000000..fb282abaef --- /dev/null +++ b/packages/leemons-openapi/lib/requests/weights-setRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'setRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/weights.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/services/rest/weights.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/core/weights/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/core/weights/setWeight.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-scores/backend/validation/validateWeight.js\n[object Object]", + "response": "{\"summary\":\"Set weight configuration for student assessments\",\"description\":\"This endpoint sets or updates the weights associated with different components of student assessments within a given context. Weights determine how various elements contribute to the final calculation of a student's score.\\n\\n**Authentication:** User authentication is required to access this endpoint. Unauthenticated requests will be rejected, ensuring that only authorized users can manage weight configurations.\\n\\n**Permissions:** The user must have administrative privileges or specific permissions related to score management. Without the necessary permissions, the request will be denied, maintaining strict access control to sensitive operations.\\n\\nUpon receiving a request, this endpoint first validates the input data using the `validateWeight.js` validator to ensure all provided values are correct and adhere to required formats. If validation fails, the endpoint immediately returns an error response. If validation is successful, the `setWeight.js` method in the `weights` core is called with the passed data. This method handles the logic of adding or updating weight entries in the database, ensuring data integrity and applying any required business logic. On successful completion, the endpoint returns a success message, and in cases of failure, it provides a detailed error message to help diagnose the issue.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/widgets-getZoneRest.request.txt b/packages/leemons-openapi/lib/requests/widgets-getZoneRest.request.txt new file mode 100644 index 0000000000..6a23236fe1 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/widgets-getZoneRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'getZoneRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-widgets/backend/services/rest/widgets.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-widgets/backend/services/rest/widgets.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-widgets/backend/core/widgetZone/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-widgets/backend/core/widgetZone/get.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/requests/xapi-addStatementRest.request.txt b/packages/leemons-openapi/lib/requests/xapi-addStatementRest.request.txt new file mode 100644 index 0000000000..7bfc96aad0 --- /dev/null +++ b/packages/leemons-openapi/lib/requests/xapi-addStatementRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'addStatementRest' property does in the '/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-xapi/backend/services/rest/xapi.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-xapi/backend/services/rest/xapi.rest.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-xapi/backend/core/xapi/statement/index.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-xapi/backend/core/xapi/statement/add.js\n[object Object]\n/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-xapi/backend/validations/forms.js\n[object Object]", + "response": "{}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/lib/services.js b/packages/leemons-openapi/lib/services.js new file mode 100644 index 0000000000..25a6ce296d --- /dev/null +++ b/packages/leemons-openapi/lib/services.js @@ -0,0 +1,75 @@ +const fs = require('fs'); +const path = require('path'); +const os = require('os'); + +const { readFile } = require('./files'); + +/** + * Builds the file path + * @param {Array} components - The components of the action name + * @returns {string} The file path + */ +function buildServicePath({ plugin, service }) { + return path.join( + '..', + '..', + 'plugins', + `leemons-plugin-${plugin}`, + 'backend', + 'services', + `${service}.service.js` + ); +} + +/** + * Finds the service file in the given directory. + * @param {string} directoryPath - The path of the directory. + * @param {string} service - The service to find. + * @returns {string|null} The path of the service file or null if not found. + */ +function findServiceFile(directoryPath, service) { + const files = fs.readdirSync(directoryPath); + + const serviceFiles = files.filter((file) => file.endsWith('.service.js')); + + for (let i = 0; i < serviceFiles.length; i++) { + const serviceFilePath = path.join(directoryPath, serviceFiles[i]); + const fileContent = readFile(serviceFilePath); + const regex = /name:\s*['"`](?:[^'"`]*\.)?([^'"`]*)['"`]/; + const match = fileContent.match(regex); + + const serviceNameInFile = match ? match[1] : null; + + if (serviceNameInFile === service) { + return serviceFilePath; + } + } + + return null; +} + +function parseServiceFile(file) { + const serviceFileContent = fs.readFileSync(file, 'utf8'); + const serviceNameMatch = serviceFileContent.match(/name:\s*['"`](?:[^'"`]*\.)?([^'"`]*)['"`]/); + const service = serviceNameMatch ? serviceNameMatch[1] : null; + + const lines = serviceFileContent.split(os.EOL); + const importLine = lines.find( + (line) => line.includes(`require('./`) && line.endsWith(`.rest');`) + ); + + const match = importLine?.match(/require\('(.*)'\)/); + + if (!match || !match[1]) { + throw new Error(`Openapi: service in ${file} has not REST actions`); + } + const controllerFile = path.resolve(path.dirname(file), `${match[1]}.js`); + + return { service, controllerFile }; +} + +module.exports = { + buildServicePath, + findServiceFile, + parseServiceFile, +}; diff --git a/packages/leemons-openapi/mixin.js b/packages/leemons-openapi/mixin.js new file mode 100644 index 0000000000..333721b210 --- /dev/null +++ b/packages/leemons-openapi/mixin.js @@ -0,0 +1,910 @@ +/* eslint-disable no-param-reassign */ +const swaggerUiAssetPath = require('swagger-ui-dist').getAbsoluteFSPath(); +const fs = require('fs'); +const _ = require('lodash'); + +const convert = require('@openapi-contrib/json-schema-to-openapi-schema').default; + +const UNRESOLVED_ACTION_NAME = 'unknown-action'; + +/** + * This is a Moleculer mixin for generating OpenAPI documentation for your services. + * It automatically generates an OpenAPI (Swagger) JSON document based on your service definitions. + * It also provides a Swagger UI for interactive API exploration. + * Based on https://www.npmjs.com/package/moleculer-auto-openapi + * + * This mixin contains three actions: + * 1. Assets: Serves the static files required for the Swagger UI. + * 2. Generate JSON Document: Generates the OpenAPI document based on the services and actions in the application. + * 3. Swagger UI: Provides a user interface for interacting with the API. This action is only available in non-production environments. + */ + +const mixin = { + name: `openapi`, + settings: { + port: process.env.PORT || 3000, + onlyLocal: false, // build schema from only local services + schemaPath: '/api/openapi/openapi.json', + uiPath: '/api/openapi/ui', + // set //unpkg.com/swagger-ui-dist@3.38.0 for fetch assets from unpkg + assetsPath: '/api/openapi/assets', + // names of moleculer-web services which contains urls, by default - all + collectOnlyFromWebServices: [], + requestBodyAndResponseBodyAreSameOnMethods: [ + /* 'post', + 'patch', + 'put', */ + ], + requestBodyAndResponseBodyAreSameDescription: + 'The answer may vary slightly from what is indicated here. Contain id and/or other additional attributes.', + openapi: { + openapi: '3.0.3', + info: { + description: '', + version: '0.0.0', + title: 'Api docs', + }, + tags: [], + paths: {}, + security: [ + { + JWTToken: [], + }, + ], + components: { + schemas: { + // Standart moleculer schemas + DbMixinList: { + type: 'object', + properties: { + rows: { + type: 'array', + items: { + type: 'object', + }, + }, + totalCount: { + type: 'number', + }, + }, + }, + DbMixinFindList: { + type: 'array', + items: { + type: 'object', + }, + }, + Item: { + type: 'object', + }, + }, + securitySchemes: { + JWTToken: { + type: 'apiKey', + in: 'header', + name: 'authorization', + }, + }, + responses: { + // Standart moleculer responses + ServerError: { + description: 'Server errors: 500, 501, 400, 404 and etc...', + content: { + 'application/json': { + schema: { + type: 'object', + properties: { + name: { + type: 'string', + }, + message: { + type: 'string', + }, + code: { + type: 'integer', + }, + }, + example: { + name: 'Error', + message: 'LeemonsError is not defined', + code: 500, + }, + }, + }, + }, + }, + UnauthorizedError: { + description: 'Need auth', + content: { + 'application/json': { + schema: { + type: 'object', + example: { + pluginName: 'leebrary', + pluginVersion: 1, + httpStatusCode: 401, + message: '[LeemonsMiddlewareAuthenticated] No authorization header', + }, + }, + }, + }, + }, + ValidationError: { + description: 'Fields invalid', + content: { + 'application/json': { + schema: { + type: 'object', + properties: { + code: { + type: 'integer', + example: 422, + }, + type: { + type: 'string', + example: 'VALIDATION_ERROR', + }, + data: { + type: 'array', + items: { + type: 'object', + properties: { + instancePath: { + type: 'string', + example: '', + }, + schemaPath: { + type: 'string', + example: '#/required', + }, + keyword: { + type: 'string', + example: 'required', + }, + params: { + type: 'object', + properties: { + missingProperty: { + type: 'string', + example: 'name', + }, + }, + }, + message: { + type: 'string', + example: "must have required property 'name'", + }, + }, + }, + }, + retryable: { + type: 'boolean', + example: false, + }, + message: { + type: 'string', + example: 'Parameters validation error!', + }, + }, + }, + }, + }, + }, + ReturnedData: { + description: '', + content: { + 'application/json': { + schema: { + oneOf: [ + { + $ref: '#/components/schemas/DbMixinList', + }, + { + $ref: '#/components/schemas/DbMixinFindList', + }, + { + $ref: '#/components/schemas/Item', + }, + ], + }, + }, + }, + }, + FileNotExist: { + description: 'File not exist', + content: { + 'application/json': { + schema: { + type: 'object', + example: { + name: 'MoleculerClientError', + message: 'File missing in the request', + code: 400, + }, + }, + }, + }, + }, + FileTooBig: { + description: 'File too big', + content: { + 'application/json': { + schema: { + type: 'object', + example: { + name: 'PayloadTooLarge', + message: 'Payload too large', + code: 413, + type: 'PAYLOAD_TOO_LARGE', + data: { + fieldname: 'file', + filename: '4b2005c0b8.png', + encoding: '7bit', + mimetype: 'image/png', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + actions: { + generateDocs: { + openapi: { + // you can declare custom Path Item Object + // which override autogenerated object from params + // https://github.com/OAI/OpenAPI-Specification/blob/b748a884fa4571ffb6dd6ed9a4d20e38e41a878c/versions/3.0.3.md#path-item-object-example + summary: 'OpenAPI schema url', + + // you custom response + // https://github.com/OAI/OpenAPI-Specification/blob/b748a884fa4571ffb6dd6ed9a4d20e38e41a878c/versions/3.0.3.md#response-object-examples + responses: { + 200: { + description: '', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/OpenAPIModel', + }, + }, + }, + }, + }, + + // you custom tag + // https://github.com/OAI/OpenAPI-Specification/blob/b748a884fa4571ffb6dd6ed9a4d20e38e41a878c/versions/3.0.3.md#fixed-fields-8 + tags: ['openapi'], + + // components which attached to root of docx + // https://github.com/OAI/OpenAPI-Specification/blob/b748a884fa4571ffb6dd6ed9a4d20e38e41a878c/versions/3.0.3.md#components-object + components: { + schemas: { + // you custom schema + // https://github.com/OAI/OpenAPI-Specification/blob/b748a884fa4571ffb6dd6ed9a4d20e38e41a878c/versions/3.0.3.md#models-with-polymorphism-support + OpenAPIModel: { + type: 'object', + properties: { + openapi: { + example: '3.0.3', + type: 'string', + description: 'OpenAPI version', + }, + info: { + type: 'object', + properties: { + description: { + type: 'string', + }, + }, + }, + tags: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + required: ['openapi'], + }, + }, + }, + }, + handler() { + return this.generateSchema(); + }, + }, + assets: { + openapi: { + summary: 'OpenAPI assets', + description: 'Return files from swagger-ui-dist folder', + }, + params: { + file: { + type: 'enum', + values: [ + `swagger-ui.css`, + `swagger-ui.css.map`, + `swagger-ui-bundle.js`, + `swagger-ui-bundle.js.map`, + `swagger-ui-standalone-preset.js`, + `swagger-ui-standalone-preset.js.map`, + ], + }, + }, + handler(ctx) { + if (ctx.params.file.indexOf('.css') > -1) { + ctx.meta.$responseType = 'text/css'; + } else if (ctx.params.file.indexOf('.js') > -1) { + ctx.meta.$responseType = 'text/javascript'; + } else { + ctx.meta.$responseType = 'application/octet-stream'; + } + + return fs.createReadStream(`${swaggerUiAssetPath}/${ctx.params.file}`); + }, + }, + }, + methods: { + commonPathItemObjectResponses(params) { + const defaultResponses = { + 200: { + $ref: '#/components/responses/ReturnedData', + }, + 401: { + $ref: '#/components/responses/UnauthorizedError', + }, + // 422: { + // $ref: '#/components/responses/ValidationError', + // }, + default: { + $ref: '#/components/responses/ServerError', + }, + }; + + if (params && Object.keys(params).length) { + defaultResponses[422] = { + $ref: '#/components/responses/ValidationError', + }; + } + return defaultResponses; + }, + fetchServicesWithActions() { + return this.broker.call('$node.services', { + withActions: true, + onlyLocal: this.settings.onlyLocal, + }); + }, + fetchAliasesForService(service) { + return this.broker.call(`${service}.listAliases`); + }, + async generateSchema() { + const doc = _.cloneDeep(this.settings.openapi); + + const nodes = await this.fetchServicesWithActions(); + + const routes = await this.collectRoutes(nodes); + + await this.attachParamsAndOpenapiFromEveryActionToRoutes(routes, nodes); + + this.attachRoutesToDoc(routes, doc); + + return doc; + }, + async attachParamsAndOpenapiFromEveryActionToRoutes(routes, nodes) { + const routeActions = Object.keys(routes); + const promises = routeActions.map(async (routeAction) => { + const node = nodes.find((n) => Object.keys(n.actions).includes(routeAction)); + if (node) { + const actionProps = node.actions[routeAction]; + if (actionProps.params) { + routes[routeAction].params = await convert(actionProps.params); + } else if (actionProps.openapi && actionProps.openapi['x-request']) { + routes[routeAction].params = actionProps.openapi + ? actionProps.openapi['x-request'] || {} + : {}; + } else { + routes[routeAction].params = {}; + } + routes[routeAction].openapi = actionProps.openapi || null; + } + }); + await Promise.all(promises); + }, + async collectRoutes(nodes) { + const routes = {}; + const promises = nodes.map(async (node) => { + if (node.name === 'gateway') { + let service = node.name; + if (Object.prototype.hasOwnProperty.call(node, 'version') && node.version !== undefined) { + service = `v${node.version}.${service}`; + } + const autoAliases = await this.fetchAliasesForService(service); + const convertedRoute = this.convertAutoAliasesToRoute(autoAliases); + this.buildActionRouteStructFromAliases(convertedRoute, routes); + } + }); + await Promise.all(promises); + return routes; + }, + /** + * @link https://github.com/moleculerjs/moleculer-web/blob/155ccf1d3cb755dafd434e84eb95e35ee324a26d/src/index.js#L229 + * @param autoAliases + * @returns {{path: string, aliases: {}}} + */ + convertAutoAliasesToRoute(autoAliases) { + const route = { + path: '', + autoAliases: true, + aliases: {}, + }; + + autoAliases.forEach((obj) => { + const alias = `${obj.methods} ${obj.fullPath}`; + route.aliases[alias] = obj.actionName || UNRESOLVED_ACTION_NAME; + }); + + return route; + }, + /** + * convert `GET /table`: `table.get` + * to {action: { + * actionType:'multipart|null', + * params: {}, + * autoAliases: true|undefined + * paths: [ + * {base: 'api/uploads', alias: 'GET /table'} + * ] + * openapi: null + * }} + * @param route + * @param routes + * @returns {{}} + */ + buildActionRouteStructFromAliases(route, routes) { + Object.keys(route.aliases).forEach((alias) => { + const aliasInfo = route.aliases[alias]; + let actionType = aliasInfo.type; + + let action = ''; + if (aliasInfo.action) { + action = aliasInfo.action; + } else if (Array.isArray(aliasInfo)) { + action = aliasInfo[aliasInfo.length - 1]; + } else if (typeof aliasInfo !== 'string') { + action = UNRESOLVED_ACTION_NAME; + } else { + action = aliasInfo; + } + // support actions like multipart:import.proceedFile + if (action.includes(':')) { + [actionType, action] = action.split(':'); + } + + if (!routes[action]) { + routes[action] = { + actionType, + params: {}, + paths: [], + openapi: null, + }; + } + + routes[action].paths.push({ + base: route.path || '', + alias, + autoAliases: route.autoAliases, + openapi: aliasInfo.openapi || null, + }); + }); + + return routes; + }, + attachRoutesToDoc(routes, doc) { + // route to openapi paths + Object.keys(routes) + .sort() + .forEach((action) => { + const { paths, params, actionType, openapi = {} } = routes[action]; + const service = action.split('.').slice(0, -1).join('.'); + + this.addTagToDoc(doc, service); + + paths.forEach((path) => { + this.processPath(path, doc, service, params, actionType, openapi, action); + }); + }); + }, + processPath(path, doc, service, params, actionType, openapi, action) { + // parse method and path from: POST /api/table + const [tmpMethod, subPath] = path.alias.split(' '); + const method = tmpMethod.toLowerCase(); + + // convert /:table to /{table} + const openapiPath = this.formatParamUrl(this.normalizePath(`${path.base}/${subPath}`)); + + const [queryParams, addedQueryParams] = this.extractParamsFromUrl(openapiPath); + + if (!doc.paths[openapiPath]) { + doc.paths[openapiPath] = {}; + } + + if (doc.paths[openapiPath][method]) { + return; + } + + this.createPathItemObject(doc, openapiPath, method, service, params, queryParams); + this.handleMethod(doc, openapiPath, method, params, addedQueryParams, action); + this.handleActionType(doc, openapiPath, method, actionType, queryParams); + this.mergeOpenapiValues(doc, openapiPath, method, openapi, path); + this.addTagsAndComponents(doc, openapiPath, method); + this.setSummary(doc, openapiPath, method, openapi, params, action, path); + }, + createPathItemObject(doc, openapiPath, method, service, params, queryParams) { + // Path Item Object + // https://github.com/OAI/OpenAPI-Specification/blob/b748a884fa4571ffb6dd6ed9a4d20e38e41a878c/versions/3.0.3.md#path-item-object-example + doc.paths[openapiPath][method] = { + summary: '', + tags: [service], + // rawParams: params, + parameters: [...queryParams], + responses: { + // attach common responses + ...this.commonPathItemObjectResponses(params), + }, + }; + }, + handleMethod(doc, openapiPath, method, params, addedQueryParams, action) { + if (method === 'get' || method === 'delete') { + doc.paths[openapiPath][method].parameters.push( + ...this.moleculerParamsToQuery(params.properties, addedQueryParams, params.required) + ); + } else { + const schemaName = action; + this.createSchemaFromParams(doc, schemaName, params, addedQueryParams); + if (params && Object.keys(params).length) { + doc.paths[openapiPath][method].requestBody = { + content: { + 'application/json': { + schema: { + $ref: `#/components/schemas/${schemaName}`, + }, + }, + }, + }; + } + } + + if (this.settings.requestBodyAndResponseBodyAreSameOnMethods.includes(method)) { + doc.paths[openapiPath][method].responses[200] = { + description: this.settings.requestBodyAndResponseBodyAreSameDescription, + ...doc.paths[openapiPath][method].requestBody, + }; + } + }, + handleActionType(doc, openapiPath, method, actionType, queryParams) { + // if multipart/stream convert fo formData/binary + if (actionType === 'multipart' || actionType === 'stream') { + doc.paths[openapiPath][method] = { + ...doc.paths[openapiPath][method], + parameters: [...queryParams], + requestBody: this.getFileContentRequestBodyScheme(openapiPath, method, actionType), + }; + } + }, + mergeOpenapiValues(doc, openapiPath, method, openapi, path) { + // merge values from action + doc.paths[openapiPath][method] = this.mergePathItemObjects( + doc.paths[openapiPath][method], + openapi + ); + + // merge values which exist in web-api service + // in routes or custom function + doc.paths[openapiPath][method] = this.mergePathItemObjects( + doc.paths[openapiPath][method], + path.openapi + ); + }, + addTagsAndComponents(doc, openapiPath, method) { + // add tags to root of scheme + if (doc.paths[openapiPath][method].tags) { + doc.paths[openapiPath][method].tags.forEach((name) => { + this.addTagToDoc(doc, name); + }); + } + + // add components to root of scheme + if (doc.paths[openapiPath][method].components) { + doc.components = this.mergeObjects( + doc.components, + doc.paths[openapiPath][method].components + ); + delete doc.paths[openapiPath][method].components; + } + }, + setSummary(doc, openapiPath, method, openapi, params, action, path) { + const myDoc = doc.paths[openapiPath][method] || {}; + + myDoc.summary = ` + ${myDoc.summary} + (${action}) + `.trim(); + }, + addTagToDoc(doc, tagName) { + const exist = doc.tags.some((v) => v.name === tagName); + if (!exist && tagName) { + doc.tags.push({ + name: tagName, + }); + } + }, + /** + * Convert moleculer params to openapi query params + * @param obj + * @param exclude{Array} + * @returns {[]} + */ + moleculerParamsToQuery(obj = {}, exclude = [], required = []) { + const out = []; + + Object.keys(obj).forEach((fieldName) => { + if (exclude.includes(fieldName)) { + return; + } + + const node = obj[fieldName]; + + // array nodes + if (Array.isArray(node) || (node.type && node.type === 'array')) { + const item = { + name: `${fieldName}[]`, + description: node.description, + in: 'query', + schema: node, + required: required.includes(fieldName), + }; + out.push(item); + return; + } + + out.push({ + in: 'query', + name: fieldName, + description: node.description, + schema: node, + required: required.includes(fieldName), + }); + }); + + return out; + }, + /** + * Convert moleculer params to openapi definitions(components schemas) + * @param doc + * @param schemeName + * @param obj + * @param exclude{Array} + * @param parentNode + */ + createSchemaFromParams(doc, schemeName, obj, exclude = []) { + if (exclude.includes(schemeName)) { + return; + } + + // Schema model + // https://github.com/OAI/OpenAPI-Specification/blob/b748a884fa4571ffb6dd6ed9a4d20e38e41a878c/versions/3.0.3.md#models-with-polymorphism-support + doc.components.schemas[schemeName] = obj; + + if (obj.required?.length === 0) { + delete obj.required; + } + }, + + mergePathItemObjects(orig = {}, toMerge = {}) { + Object.keys(toMerge || {}).forEach((key) => { + // merge components + if (key === 'components') { + orig[key] = this.mergeObjects(orig[key], toMerge[key]); + } + // merge responses + else if (key === 'responses') { + orig[key] = this.mergeObjects(orig[key], toMerge[key]); + + // iterate codes + Object.keys(orig[key]).forEach((code) => { + // remove $ref if exist content + if (orig[key][code] && orig[key][code].content) { + delete orig[key][code].$ref; + } + }); + } + // replace non components attributes + else { + orig[key] = toMerge[key]; + } + }); + return orig; + }, + mergeObjects(orig = {}, toMerge = {}) { + Object.keys(toMerge).forEach((key) => { + orig[key] = { + ...(orig[key] || {}), + ...toMerge[key], + }; + }); + return orig; + }, + /** + * replace // to / + * @param path + * @returns {string} + */ + normalizePath(path = '') { + path = path.replace(/\/{2,}/g, '/'); + return path; + }, + /** + * convert /:table to /{table} + * @param url + * @returns {string|string} + */ + formatParamUrl(url = '') { + let start = url.indexOf('/:'); + if (start === -1) { + return url; + } + + const end = url.indexOf('/', ++start); + + if (end === -1) { + return `${url.slice(0, start)}{${url.slice(++start)}}`; + } + + return this.formatParamUrl( + `${url.slice(0, start)}{${url.slice(++start, end)}}${url.slice(end)}` + ); + }, + /** + * extract params from /{table} + * @param url + * @returns {[]} + */ + extractParamsFromUrl(url = '') { + const params = []; + const added = []; + + const matches = [...this.matchAll(/{(\w+)}/g, url)]; + matches.forEach((match) => { + const [, name] = match; + + added.push(name); + params.push({ name, in: 'path', required: true, schema: { type: 'string' } }); + }); + + return [params, added]; + }, + /** + * matchAll polyfill for es8 and older + * @param regexPattern + * @param sourceString + * @returns {[]} + */ + matchAll(regexPattern, sourceString) { + const output = []; + let match; + // make sure the pattern has the global flag + const regexPatternWithGlobal = RegExp(regexPattern, 'g'); + for ( + match = regexPatternWithGlobal.exec(sourceString); + match !== null; + match = regexPatternWithGlobal.exec(sourceString) + ) { + // get rid of the string copy + delete match.input; + // store the match data + output.push(match); + } + return output; + }, + getFileContentRequestBodyScheme(openapiPath, method, actionType) { + return { + content: { + ...(actionType === 'multipart' + ? { + 'multipart/form-data': { + schema: { + type: 'object', + properties: { + file: { + type: 'array', + items: { + type: 'string', + format: 'binary', + }, + }, + someField: { + type: 'string', + }, + }, + }, + }, + } + : { + 'application/octet-stream': { + schema: { + type: 'string', + format: 'binary', + }, + }, + }), + }, + }; + }, + }, + started() { + if (process.env.NODE_ENV !== 'production') { + this.logger.info( + `📜OpenAPI Docs server is available at http://0.0.0.0:${this.settings.port}${this.settings.uiPath}` + ); + } + }, +}; + +const ui = { + openapi: { + summary: 'OpenAPI ui', + description: 'You can provide any schema file in query param', + }, + params: { + url: { $$t: 'Schema url', type: 'string', optional: true }, + }, + handler(ctx) { + ctx.meta.$responseType = 'text/html; charset=utf-8'; + + return ` + + + OpenAPI UI + + + + +
+

Loading...

+ +
+ + + + + + + `; + }, +}; +// Swagger UI disabled in production +if (process.env.NODE_ENV !== 'production') { + mixin.actions.ui = ui; +} + +module.exports = mixin; diff --git a/packages/leemons-openapi/package.json b/packages/leemons-openapi/package.json new file mode 100644 index 0000000000..233dc41162 --- /dev/null +++ b/packages/leemons-openapi/package.json @@ -0,0 +1,40 @@ +{ + "name": "@leemons/openapi", + "version": "0.0.40", + "description": "", + "main": "index.js", + "bin": { + "leemons-openapi": "bin/createOpenapiFiles.js" + }, + "keywords": [], + "author": { + "email": "hi@leemons.io", + "name": "Leemons Edtech Solutions", + "url": "https://www.leemons.io" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "maintainers": [ + { + "email": "hi@leemons.io", + "name": "Leemons Edutech Solutions", + "url": "https://www.leemons.io" + } + ], + "license": "MIT", + "dependencies": { + "@leemons/error": "0.0.40", + "@leemons/service-name-parser": "0.0.40", + "@openapi-contrib/json-schema-to-openapi-schema": "^3.0.0", + "axios": "^1.6.1", + "espree": "^9.6.1", + "estraverse": "^5.2.0", + "json-schema-generator": "^2.0.6", + "lodash": "^4.17.21", + "prettier": "^2.8.8", + "swagger-ui-dist": "^5.9.3", + "uglify-js": "^3.17.4" + } +} diff --git a/packages/leemons-openapi/requests/assignableInstances-sendReminderRest.request.txt b/packages/leemons-openapi/requests/assignableInstances-sendReminderRest.request.txt new file mode 100644 index 0000000000..e2ff026258 --- /dev/null +++ b/packages/leemons-openapi/requests/assignableInstances-sendReminderRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'sendReminderRest' property does in the '/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendReminder/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendReminder/sendReminder.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstance/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstance/getInstance.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getInstances.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getUserPermissions/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getUserPermissions/getUserPermissions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getRoleMatchingActions/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getRoleMatchingActions/getRoleMatchingActions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getPermissionName/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getPermissionName/getPermissionName.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getTeacherPermissions/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getTeacherPermissions/getTeacherPermissions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getRelatedInstances.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/classes/listInstanceClasses.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/classes/listClasses.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/findDates.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignables/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignables/getAssignables.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/getUserPermissions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getRoleMatchingActions/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getRoleMatchingActions/getRoleMatchingActions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getPermissionName/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getPermissionName/getPermissionName.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/getParentPermissions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/getParentAssignables.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getTeacherPermissions/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getTeacherPermissions/getTeacherPermissions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/roles/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/roles/getRoles.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/subjects/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/subjects/getSubjects.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getAssignationsData.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignationsOfInstance/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignationsOfInstance/getAssignationsOfInstance.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getAssignations.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/checkPermissions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getClassesWithSubject.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getRelatedAssignationsTimestamps.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getRelatedAssignations.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/findAssignationDates.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/findInstanceDates.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getGrades.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getAssignationStatus.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getInstancesSubjects.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/sendEmail.js\n[object Object]", + "response": "{\"summary\":\"Send reminder notifications for pending assignables\",\"description\":\"This endpoint triggers the sending of reminder notifications to users about pending assignments or tasks within an assignable instance. By invoking this endpoint, the system will process the pending actions for each user and send out notifications accordingly.\\n\\n**Authentication:** Users must be authenticated to trigger reminder notifications. Without proper authentication, the request will be rejected.\\n\\n**Permissions:** Users need specific permissions to send reminders. Only users with the 'send_reminder' permission on the assignable instance are authorized to perform this action.\\n\\nUpon receiving the request, the `sendReminderRest` action first validates the user's authentication status and checks if the user has the appropriate permissions to send reminders. It then calls the `sendReminder` method which handles the retrieval of pending assignables for the user. The method constructs reminder notifications based on the assignments' due dates and details. Lastly, the `sendEmail` method is utilized to dispatch the notifications via email to the users, ensuring they are aware of their pending tasks. The full process aims to streamline user engagement and efficiency in managing assignables.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/requests/assignableInstances-updateRest.request.txt b/packages/leemons-openapi/requests/assignableInstances-updateRest.request.txt new file mode 100644 index 0000000000..81225c34ad --- /dev/null +++ b/packages/leemons-openapi/requests/assignableInstances-updateRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'updateRest' property does in the '/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/updateInstance/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/updateInstance/updateInstance.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/helpers/validators/instance.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getUserPermission/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getUserPermission/getUserPermission.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getPermissionName/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getPermissionName/getPermissionName.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getTeacherPermission/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getTeacherPermission/getTeacherPermission.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/classes/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/classes/listInstanceClasses.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/classes/listClasses.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getRoleMatchingActions/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getRoleMatchingActions/getRoleMatchingActions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstance/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstance/getInstance.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getInstances.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getUserPermissions/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getUserPermissions/getUserPermissions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getTeacherPermissions/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/getTeacherPermissions/getTeacherPermissions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getRelatedInstances.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/findDates.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignables/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignables/getAssignables.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/getUserPermissions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getRoleMatchingActions/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getRoleMatchingActions/getRoleMatchingActions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getPermissionName/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/helpers/getPermissionName/getPermissionName.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/getParentPermissions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getUserPermissions/getParentAssignables.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getTeacherPermissions/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/assignables/users/getTeacherPermissions/getTeacherPermissions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/roles/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/roles/getRoles.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/subjects/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/subjects/getSubjects.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getAssignationsData.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignationsOfInstance/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignationsOfInstance/getAssignationsOfInstance.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getAssignations.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/checkPermissions.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getClassesWithSubject.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getRelatedAssignationsTimestamps.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getRelatedAssignations.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/findAssignationDates.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/findInstanceDates.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getGrades.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/getAssignations/getAssignationStatus.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/getInstances/getInstancesSubjects.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/helpers/getDiff.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/dates/updateDates.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/dates/getDates.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/dates/unregisterDates.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/dates/registerDates.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/classes/updateClasses.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/classes/unregisterClass.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/classes/registerClass.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/updateInstance/createRelatedInstance.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/createInstance/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/createInstance/createInstance.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignable/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignables/getAssignable/getAssignable.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/registerPermission/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/registerPermission/registerPermission.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getPermissionType/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/helpers/getPermissionType/getPermissionType.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/createInstance/getTeachersOfGivenClasses.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/teachers/addTeachersToAssignableInstance.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/createInstance/createEventAndAddToUsers.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/calendar/registerEvent/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/calendar/registerEvent/registerEvent.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/dates/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/addPermissionToUser/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/permissions/instances/users/addPermissionToUser/addPermissionToUser.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/createAssignation.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/helpers/validators/assignation.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/getAllTeachers.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/createInstanceRoom.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/createGroupRoom.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/checkIfStudentIsOnInstance.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/assignations/createAssignation/addUserSubjectRoom.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/sendEmail/sendEmail.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/grades/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/grades/registerGrade.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/validations/validateGrade.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/createInstance/emitLeemonsEvent.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/updateInstance/updateEventAndAddToUsers.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/calendar/updateEvent/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-assignables/backend/core/instances/calendar/updateEvent/updateEvent.js\n[object Object]", + "response": "{\"summary\":\"Updates a specific assignable instance\",\"description\":\"This endpoint allows for the modification of an existing assignable instance based on the provided data. It updates the instance's details, configurations, and relationships in the system. The action typically involves altering attributes such as titles, descriptions, or associated metadata.\\n\\n**Authentication:** To access this endpoint, the user must be authenticated. Any request without a valid authentication token will be rejected.\\n\\n**Permissions:** This endpoint requires the user to have appropriate permissions to modify the specified instance. Without the necessary permissions, the user's request to update the instance will be denied.\\n\\nThe handler delegates the task by calling the `updateInstance` method from the `Instances` core. The request payload is first validated to ensure all necessary data is present and conforms to the expected schema. Next, the method checks if the user has required permissions using `getUserPermission` or `getTeacherPermission` depending on the user's role. If authorized, it continues to update the instance details by invoking `updateInstance.js` within the core, which interacts with the database to persist changes. It may involve additional helper functions from the `validators` folder and updating relationships, such as subjects and dates, through the respective core functions. Upon successful update, it returns a confirmation response, and in the case of failures or errors, appropriate error messages are sent back to the user.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/requests/dependency-postDependencyRest.request.txt b/packages/leemons-openapi/requests/dependency-postDependencyRest.request.txt new file mode 100644 index 0000000000..59cde3bd1b --- /dev/null +++ b/packages/leemons-openapi/requests/dependency-postDependencyRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postDependencyRest' property does in the '/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/addRule.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/addConditionGroup.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/conditions/addCondition.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/ruleByIds.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/getRuleConditionsByRuleIds.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/conditions/getConditionsByRule.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/getConditionGroupsByRule.js\n[object Object]", + "response": "{\"summary\":\"Manage grading dependencies\",\"description\":\"This endpoint is responsible for creating or updating dependencies related to the grading system within the application. Dependencies may include, but are not limited to, associations between various grading rules, condition groups, and conditions that together define the logic for grading within the platform.\\n\\n**Authentication:** Users must be authenticated to modify the grading dependencies. Unauthenticated requests will be rejected and the user will be prompted to log in.\\n\\n**Permissions:** Users need to have adequate permission levels, typically administrative rights, to manage grading dependencies. Without the proper permissions, the request will be denied.\\n\\nUpon receipt of the request, the `postDependencyRest` action is invoked which then delegates the task to an internal method, perhaps labeled `createOrUpdateDependency`. This method would handle the validation of input data (using schemas defined in `validations/forms.js`) and orchestrate the creation or update process by calling other service methods such as `addRule` from `core/rules/addRule.js`, `addConditionGroup` from `core/condition-groups/addConditionGroup.js`, and `addCondition` from `core/conditions/addCondition.js`. The service methods collaborate to ensure dependencies are set up or modified correctly, taking into account any pre-existing rules, condition groups, and conditions fetched from database operations through methods like `ruleByIds`, `getRuleConditionsByRuleIds`, `getConditionsByRule`, and `getConditionGroupsByRule`. The result is then formatted and sent back as a response to the client, indicating the successful handling of grading dependencies.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/requests/dependency-putDependencyRest.request.txt b/packages/leemons-openapi/requests/dependency-putDependencyRest.request.txt new file mode 100644 index 0000000000..3242f19889 --- /dev/null +++ b/packages/leemons-openapi/requests/dependency-putDependencyRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putDependencyRest' property does in the '/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/updateRule.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/removeConditionGroupsByRule.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/conditions/removeConditionsByRule.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/addConditionGroup.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/conditions/addCondition.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/ruleByIds.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/getRuleConditionsByRuleIds.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/conditions/getConditionsByRule.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/getConditionGroupsByRule.js\n[object Object]", + "response": "{\"summary\":\"Update a specific dependency record\",\"description\":\"This endpoint updates an existing dependency record within the grading system based on provided data that includes the updated attributes for the dependency. The endpoint ensures that only valid changes are applied to the existing record, maintaining data integrity and the correct operation of the grade dependency logic.\\n\\n**Authentication:** Users must be authenticated to update a dependency record. Without proper authentication, the request will be rejected and access to the endpoint will be denied.\\n\\n**Permissions:** Users need to have the 'update_dependency' permission to make changes to dependency records. Attempting to update without adequate permissions will result in the denial of the request.\\n\\nUpon receiving a request, the handler calls a method that validates the incoming data against a predefined schema to ensure that all required fields are present and properly formatted. If the validation passes, it proceeds to fetch the specific dependency record based on an identifier (usually a record ID) provided in the request's parameters. The next step involves the `updateDependency` method from the `Dependency` core, which performs the actual update operation in the database. It applies the received changes to the relevant record while enforcing any necessary business logic to maintain the relationships between grade dependencies. After successfully updating the record, the endpoint responds with the updated data, providing confirmation and visibility of the changes to the client.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/requests/rules-postRuleRest.request.txt b/packages/leemons-openapi/requests/rules-postRuleRest.request.txt new file mode 100644 index 0000000000..f8beafbc3d --- /dev/null +++ b/packages/leemons-openapi/requests/rules-postRuleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'postRuleRest' property does in the '/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/addRule.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/addConditionGroup.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/conditions/addCondition.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/ruleByIds.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/getRuleConditionsByRuleIds.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/conditions/getConditionsByRule.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/getConditionGroupsByRule.js\n[object Object]", + "response": "{\"summary\":\"Create or update grading rules\",\"description\":\"This endpoint is responsible for adding or updating rules used for grading within the system. It facilitates the creation of new grading criteria or the modification of existing ones to reflect changes in grading policies or procedures.\\n\\n**Authentication:** Users must be authenticated to modify grading rules. Only requests from authenticated sessions will be processed, while unauthenticated requests will be rejected.\\n\\n**Permissions:** Users must have the appropriate permissions to create or update grading rules. The action requires administrative level permissions, or specific roles granted the capability to manage academic grading configurations.\\n\\nUpon receiving a request, the `postRuleRest` handler begins the process by validating input parameters against predefined schemas to ensure all required rule data is present and correctly formatted. It then proceeds to call the `addRule` method from the `rules` core, passing in the rule data. This method is responsible for either inserting a new rule into the database or updating an existing one if an identifier is provided. The method involves complex business logic, including evaluating conditions and manipulating condition groups associated with the rules. After the operation is successful, the endpoint returns a status code indicating the creation or update of the rule along with any relevant rule details in the response body.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/requests/rules-putRuleRest.request.txt b/packages/leemons-openapi/requests/rules-putRuleRest.request.txt new file mode 100644 index 0000000000..0a4b32f114 --- /dev/null +++ b/packages/leemons-openapi/requests/rules-putRuleRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'putRuleRest' property does in the '/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/updateRule.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/validations/forms.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/removeConditionGroupsByRule.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/conditions/removeConditionsByRule.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/addConditionGroup.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/conditions/addCondition.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/ruleByIds.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/rules/getRuleConditionsByRuleIds.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/conditions/getConditionsByRule.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-grades/backend/core/condition-groups/getConditionGroupsByRule.js\n[object Object]", + "response": "{\"summary\":\"Update an existing grading rule\",\"description\":\"This endpoint allows for the modification of an existing grading rule within the system. It is responsible for updating rule details such as name, description, and the associated conditions and condition groups that define the grading logic.\\n\\n**Authentication:** Users must be authenticated and possess a valid session token to interact with this endpoint. Unauthorized users will be prevented from accessing this functionality.\\n\\n**Permissions:** The user must have appropriate permissions to modify grading rules, typically reserved for educational staff with administrative privileges or roles such as 'Instructor' or 'Administrator'.\\n\\nUpon receiving a request, the handler begins by invoking the `updateRule` method from the `rules` core, which processes the incoming data to update the specified grading rule. It handles the deletion of old condition groups and conditions associated with the rule by calling `removeConditionGroupsByRule` and `removeConditionsByRule`. Subsequently, it adds new condition groups and conditions through `addConditionGroup` and `addCondition` methods. The flow continues with retrieval of the updated rule information using `ruleByIds` and `getRuleConditionsByRuleIds` methods to fetch the rule and its detailed conditions. Finally, the endpoint constructs a comprehensive response detailing the updated rule, which is returned to the user in JSON format.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/requests/users-contactsRest.request.txt b/packages/leemons-openapi/requests/users-contactsRest.request.txt new file mode 100644 index 0000000000..96c1d4a80f --- /dev/null +++ b/packages/leemons-openapi/requests/users-contactsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'contactsRest' property does in the '/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/core/user-agents/contacts/getUserAgentContacts.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentProfile.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/core/profiles/contacts/getProfileContacts.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/core/user-agents/searchUserAgents.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]", + "response": "{\"summary\":\"Manage user agent contacts\",\"description\":\"This endpoint is responsible for managing contacts related to a user agent within the system. It involves operations such as listing, updating, creating, or deleting contact information for a user agent.\\n\\n**Authentication:** Users must be authenticated to manage contact information. Access to this endpoint requires a valid session or authentication token.\\n\\n**Permissions:** Access to this endpoint is restricted based on user roles and permissions. Only authorized users with the necessary permissions can manage user agent contacts.\\n\\nUpon receiving a request, the handler first validates the user's authentication and authorization. Assuming the user is permitted, the handler then processes the request by interacting with the underlying services responsible for user agent contacts. Actions such as retrieving the list of contacts, updating contact details, creating new contacts, or removing existing ones are carried out. These operations are orchestrated by invoking methods from the corresponding user agent contacts service, which interact with the database to perform the necessary CRUD (Create, Read, Update, Delete) operations. The final response from this endpoint will include the outcome of these actions, typically in the form of confirmation of success, the updated contact list, or an error message if applicable.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-openapi/requests/users-searchUserAgentsRest.request.txt b/packages/leemons-openapi/requests/users-searchUserAgentsRest.request.txt new file mode 100644 index 0000000000..401a578102 --- /dev/null +++ b/packages/leemons-openapi/requests/users-searchUserAgentsRest.request.txt @@ -0,0 +1,5 @@ +{ + "systemMessage": "Respond as if you were an expert in REST APIs for JavaScript using the Moleculer framework.Return a valid JSON object with only 'summary' and 'description' properties that can be used to document, using OpenAPI specifications, what the handler of the 'searchUserAgentsRest' property does in the '/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js' file, which is an action in the Moleculer JavaScript framework.\nI want 'summary' only have a short resume of what the controller does. Don't start it with \"This handler\" or \"This Endpoint\", only the summary.\nI want the description to be in markdown format and contain the following information (each point should be clearly separated into a different paragraph):\n* Short detailed description of what the handler does. It should always start with \"This endpoint\" and should not contain information about the parameters it receives and the response it returns, only what is expected to be done.\n* Authentication: Information about whether the user needs to be logged in to use the endpoint. It should start with '**Authentication:**\"\n* Permissions: Information about the permissions required for the user to use the endpoint. It should start with \"**Permissions:**\"\n* Fully detailed description of what the controller handler, and the methods the controller flow from request to response, does.\nYou can use this response as example: '{\"summary\":\"Retrieve assets owned by the current user\",\"description\":\"This endpoint retrieves all digital assets that are owned by the currently authenticated user. The collection of assets returned includes those that the user has created or have been shared with them within the platform.\\n\\n**Authentication:** The users must be authenticated to access their digital assets. An invalid or missing authentication token will result in endpoint access denial.\\n\\n**Permissions:** No specific permissions are called out for this endpoint; however, it's implied that users can only access assets that they have rights to view based on the asset's ownership and sharing properties.\\n\\nThe endpoint starts by invoking the `getByUser` method from the `Pins` core, passing in the `ctx` (context) parameter which includes user authentication information. This method leverages a database call to find all pins associated with the user's agent ID. These pins represent the user's digital assets within the platform. The result is a promise that, when resolved, returns the list of assets that the authenticated user owns or has access to. The HTTP response contains these assets in a JSON array format.\"}'\n", + "userMessage": "/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/services/rest/users.rest.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/core/user-agents/index.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/core/user-agents/searchUserAgents.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/core/user-agents/contacts/getUserAgentContacts.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentProfile.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/core/profiles/contacts/getProfileContacts.js\n[object Object]\n/Users/rvillares/Desktop/workdir/leemonade/leemons-saas/leemons/plugins/leemons-plugin-users/backend/core/user-agents/getUserAgentsInfo.js\n[object Object]", + "response": "{\"summary\":\"Searches and returns a list of user agents\",\"description\":\"This endpoint performs a search query to retrieve a list of user agents matching the provided criteria. The search can be based on various attributes such as name, email, or role, and the results include user agents that meet the search parameters.\\n\\n**Authentication:** Users must be logged in to perform a search on user agents. An unauthenticated request will be denied access to this endpoint.\\n\\n**Permissions:** Specific permissions are required for a user to search user agents. The user must have the 'list_user_agents' permission or equivalent rights defined within the system's security policy.\\n\\nThe `searchUserAgentsRest` action begins by extracting the search parameters from the request. It then calls the `searchUserAgents` method in the user agents core, passing these parameters. The search process involves querying the system's database, applying filters based on the input parameters, and potentially involving additional sorting or pagination features. Once the search is complete, the resulting list of user agents is returned to the requesting user in a structured JSON format, containing essential details for each agent.\",\"AIGenerated\":true}" +} \ No newline at end of file diff --git a/packages/leemons-runner/lib/runner.js b/packages/leemons-runner/lib/runner.js index fd99acac0b..071e964621 100644 --- a/packages/leemons-runner/lib/runner.js +++ b/packages/leemons-runner/lib/runner.js @@ -9,6 +9,7 @@ const os = require('os'); const cluster = require('cluster'); const kleur = require('kleur'); const { mongoose } = require('@leemons/mongodb'); +const { ControllerValidator } = require('@leemons/validator'); // Register Babel for JSX files require('@babel/register')({ @@ -493,7 +494,7 @@ class LeemonsRunner { } // Create service broker - this.broker = new ServiceBroker({ ...this.config }); + this.broker = new ServiceBroker({ ...this.config, validator: new ControllerValidator() }); this.broker.runner = this; this.loadServices(); diff --git a/packages/leemons-validator/src/controllerValidator.js b/packages/leemons-validator/src/controllerValidator.js new file mode 100644 index 0000000000..c8b2789311 --- /dev/null +++ b/packages/leemons-validator/src/controllerValidator.js @@ -0,0 +1,73 @@ +const Ajv = require('ajv'); +const addFormats = require('ajv-formats'); +const addKeywords = require('ajv-keywords'); + +const { + Validators, + Errors: { ValidationError }, +} = require('moleculer'); + +class ControllerValidator extends Validators.Base { + constructor(options = {}) { + super(); + this.validator = new Ajv({ ...options, allErrors: true }); + + addKeywords(this.validator); + addFormats(this.validator); + this.fallbackValidator = new Validators.Fastest(); + } + + compile(schema) { + const validate = this.validator.compile(schema); + return (params) => this.validate(params, validate); + } + + // eslint-disable-next-line class-methods-use-this + async validate(params, validate) { + const isValid = await validate(params); + if (!isValid) throw new ValidationError('Parameters validation error!', null, validate.errors); + return isValid; + } + + /** + * Register validator as a middleware + * + * @memberof ParamValidator + */ + middleware() { + const self = this; + + const processCheckResponse = function check(ctx, handler, res) { + if (res === true) return handler(ctx); + return Promise.reject(new ValidationError('Parameters validation error!', null, res)); + }; + + return { + name: 'Validator', + localAction: function validatorMiddleware(handler, action) { + if (!action.params?.properties || typeof action.params?.properties !== 'object') { + // no schema to validate for => just return back the handler directly + if (!action.params || typeof action.params !== 'object') return handler; + + // fallback to the fastest validator (moleculer's default validator) + const checkFn = self.fallbackValidator.compile(action.params); + return async function validateContextParams(ctx) { + const res = await checkFn(ctx.params); + if (res !== true) return processCheckResponse(ctx, handler, res); + return handler(ctx); + }; + } + + // Wrap a param validator when the params are specified + const checkFn = self.compile(action.params); + return async function validateContextParams(ctx) { + const res = await checkFn(ctx.params != null ? ctx.params : {}); + if (res !== true) return processCheckResponse(ctx, handler, res); + return handler(ctx); + }; + }, + }; + } +} + +module.exports = { ControllerValidator }; diff --git a/packages/leemons-validator/src/index.js b/packages/leemons-validator/src/index.js index 73738897a8..1d857e582b 100644 --- a/packages/leemons-validator/src/index.js +++ b/packages/leemons-validator/src/index.js @@ -1,10 +1,12 @@ -/* eslint-disable global-require */ - const { localeRegex, localeRegexString } = require('./validations/localeCode'); +const { LeemonsValidator } = require('./validator'); +const { validateSchema } = require('./types'); +const { ControllerValidator } = require('./controllerValidator'); module.exports = { - ...require('./validator'), - ...require('./types'), + LeemonsValidator, + validateSchema, + ControllerValidator, localeRegex, localeRegexString, }; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/config.rest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/config.rest.js index dc2bf18779..a9822f356c 100644 --- a/plugins/leemons-plugin-academic-calendar/backend/services/rest/config.rest.js +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/config.rest.js @@ -10,9 +10,12 @@ const { } = require('@leemons/middlewares'); const { getConfig, saveConfig } = require('../../core/config'); +const getRest = require('./openapi/config/getRest'); +const saveRest = require('./openapi/config/saveRest'); /** @type {ServiceSchema} */ module.exports = { getRest: { + openapi: getRest.openapi, rest: { method: 'GET', path: '/:programId', @@ -39,6 +42,7 @@ module.exports = { }, }, saveRest: { + openapi: saveRest.openapi, rest: { method: 'POST', path: '/', diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/getRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/getRest.js new file mode 100644 index 0000000000..a3098b5663 --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Configure academic calendar settings', + description: `This endpoint allows for the configuration of academic calendar settings within the Leemons platform. It enables the adjustment and saving of parameters such as term dates, holiday periods, and other related academic calendar details. + +**Authentication:** User authentication is required to access this endpoint. Unauthenticated access will be prevented, and users must have a valid session or token to proceed. + +**Permissions:** This endpoint requires administrative privileges. Users must have the \`admin-academic-calendar\` permission to modify the academic calendar settings. + +From the initial API call, the handler invokes the \`getConfig\` method from the 'config' core module. This method retrieves the current configuration settings from the system's database. Following this, users can modify these settings through a form-based interface provided in the frontend. Upon submission, the \`setConfig\` method is called with the new configuration data. This method updates the settings in the database, ensuring that any changes are persisted across the system. Finally, a success response is sent back to the user, confirming the update has been successfully applied.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/saveRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/saveRest.js new file mode 100644 index 0000000000..0dcd5c78bf --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/saveRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveRest'); +const { schema: xRequest } = require('./schemas/request/saveRest'); + +const openapi = { + summary: 'Saves updated configuration settings for the academic calendar', + description: `This endpoint handles the saving of modified configuration settings specific to the academic calendar within the application. It involves updating configuration details such as term dates, academic events, and other relevant settings that govern the academic calendar functionality. + +**Authentication:** Users must be authenticated before they can update configuration settings. An absence of a valid authentication session will prevent access to this functionality. + +**Permissions:** This endpoint requires administrative rights or specific permissions related to academic calendar management. Without these permissions, the user will be denied the ability to save changes to the configuration. + +After receiving the configuration data from the client, this handler first validates the incoming data against predefined schemas to ensure compliance with expected formats and types. Upon successful validation, the \`saveConfig\` function from the \`config\` core module is called with the new configuration data. This function updates the settings in the persistent storage, such as a database or a configuration file. Once the update is successfully completed, a confirmation response is sent back to the client indicating successful saving of the configuration.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/schemas/request/getRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/schemas/request/getRest.js new file mode 100644 index 0000000000..5f8fe13b6f --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/schemas/request/getRest.js @@ -0,0 +1,15 @@ +// automatic hash: e2786f9f74778debc7ac46c42eed301ed905b61bb113d287d52d906dec85fdf8 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + programId: { + type: 'string', + minLength: 1, + }, + }, + required: ['programId'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/schemas/request/saveRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/schemas/request/saveRest.js new file mode 100644 index 0000000000..50cd9cf1a2 --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/schemas/request/saveRest.js @@ -0,0 +1,80 @@ +// automatic hash: 0f7817644465c64df7309677d6aa023c21e7683974cd6dd6a1b3bcb29eb8ef29 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + regionalConfig: { + type: 'string', + minLength: 1, + }, + courseDates: { + type: 'object', + properties: { + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209': + { + type: 'object', + properties: { + startDate: { + type: 'string', + minLength: 1, + }, + endDate: { + type: 'string', + minLength: 1, + }, + }, + required: ['startDate', 'endDate'], + }, + }, + required: [ + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209', + ], + }, + substagesDates: { + type: 'object', + properties: { + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209': + { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: [ + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209', + ], + }, + courseEvents: { + type: 'object', + properties: { + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209': + { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: [ + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209', + ], + }, + program: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'regionalConfig', + 'courseDates', + 'substagesDates', + 'courseEvents', + 'program', + ], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/schemas/response/getRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/schemas/response/getRest.js new file mode 100644 index 0000000000..9a39769841 --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/schemas/response/getRest.js @@ -0,0 +1,217 @@ +// automatic hash: 4e660eb91faef45f4783b8ef3cb98a33516425f3b85b424d9d1fec240acdd1fc +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + config: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + program: { + type: 'string', + minLength: 1, + }, + __v: { + type: 'number', + }, + courseDates: { + type: 'object', + properties: { + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209': + { + type: 'object', + properties: { + startDate: { + type: 'string', + minLength: 1, + }, + endDate: { + type: 'string', + minLength: 1, + }, + }, + required: ['startDate', 'endDate'], + }, + }, + required: [ + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209', + ], + }, + courseEvents: { + type: 'object', + properties: { + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209': + { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: [ + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209', + ], + }, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + deletedAt: {}, + id: { + type: 'string', + minLength: 1, + }, + regionalConfig: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + center: { + type: 'string', + minLength: 1, + }, + regionalEvents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + localEvents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + daysOffEvents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'center', + 'regionalEvents', + 'localEvents', + 'daysOffEvents', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + substagesDates: { + type: 'object', + properties: { + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209': + { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: [ + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209', + ], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + allCoursesHaveSameConfig: { + type: 'boolean', + }, + allCoursesHaveSameDates: { + type: 'boolean', + }, + allCoursesHaveSameDays: { + type: 'boolean', + }, + breaks: {}, + }, + required: [ + '_id', + 'deploymentID', + 'isDeleted', + 'program', + '__v', + 'courseDates', + 'courseEvents', + 'createdAt', + 'id', + 'regionalConfig', + 'substagesDates', + 'updatedAt', + 'allCoursesHaveSameConfig', + 'allCoursesHaveSameDates', + 'allCoursesHaveSameDays', + ], + }, + }, + required: ['status', 'config'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/schemas/response/saveRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/schemas/response/saveRest.js new file mode 100644 index 0000000000..9a39769841 --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/config/schemas/response/saveRest.js @@ -0,0 +1,217 @@ +// automatic hash: 4e660eb91faef45f4783b8ef3cb98a33516425f3b85b424d9d1fec240acdd1fc +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + config: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + program: { + type: 'string', + minLength: 1, + }, + __v: { + type: 'number', + }, + courseDates: { + type: 'object', + properties: { + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209': + { + type: 'object', + properties: { + startDate: { + type: 'string', + minLength: 1, + }, + endDate: { + type: 'string', + minLength: 1, + }, + }, + required: ['startDate', 'endDate'], + }, + }, + required: [ + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209', + ], + }, + courseEvents: { + type: 'object', + properties: { + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209': + { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: [ + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209', + ], + }, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + deletedAt: {}, + id: { + type: 'string', + minLength: 1, + }, + regionalConfig: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + center: { + type: 'string', + minLength: 1, + }, + regionalEvents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + localEvents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + daysOffEvents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'center', + 'regionalEvents', + 'localEvents', + 'daysOffEvents', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + substagesDates: { + type: 'object', + properties: { + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209': + { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: [ + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Groups:662f65cd9f06d6bbeb628209', + ], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + allCoursesHaveSameConfig: { + type: 'boolean', + }, + allCoursesHaveSameDates: { + type: 'boolean', + }, + allCoursesHaveSameDays: { + type: 'boolean', + }, + breaks: {}, + }, + required: [ + '_id', + 'deploymentID', + 'isDeleted', + 'program', + '__v', + 'courseDates', + 'courseEvents', + 'createdAt', + 'id', + 'regionalConfig', + 'substagesDates', + 'updatedAt', + 'allCoursesHaveSameConfig', + 'allCoursesHaveSameDates', + 'allCoursesHaveSameDays', + ], + }, + }, + required: ['status', 'config'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/deleteRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/deleteRest.js new file mode 100644 index 0000000000..8e2d6884c9 --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/deleteRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteRest'); +const { schema: xRequest } = require('./schemas/request/deleteRest'); + +const openapi = { + summary: 'Delete a specific regional configuration', + description: `This endpoint handles the deletion of a specific regional configuration in the academic calendar system. By targeting a unique identifier, it allows for precise removal of regional configurations which are no longer needed or valid within the system. + +**Authentication:** Users need to be authenticated to perform deletion operations. Proper authentication ensures that only authorized users can delete configurations, preventing unauthorized changes. + +**Permissions:** Users must have administrative permissions specifically for managing regional configurations. These permissions ensure that only users with the correct access rights can carry out deletions, maintaining system integrity. + +The process begins with the controller action, which invokes the \`deleteRegionalConfig\` method from the \`regional-config\` core. This method utilizes the passed identifier to locate and verify the existence of the configuration in the database. If found, it proceeds to delete the configuration. Upon successful deletion, a confirmation is sent back to the user, otherwise, an error message is generated indicating the failure of the operation. Each step carefully checks and logs the progress to ensure accuracy and traceability.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/listRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/listRest.js new file mode 100644 index 0000000000..7a6bc08b00 --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'List all regional configurations available', + description: `This endpoint fetches the list of all regional configurations applicable across different geographic or institutional setups. It is primarily used to gather all configurations that can be applied to academic calendars based on regional differences. + +**Authentication:** Users must be authenticated to retrieve regional configuration data. An absence of a valid authentication mechanism will prevent access to this endpoint. + +**Permissions:** This endpoint requires that the user have administrative rights or specific permissions related to managing or viewing academic configurations, ensuring that only authorized personnel handle sensitive regional setup data. + +Upon being called, this handler initiates a process by calling the \`listRegionalConfigs\` function from the academic calendar plugin's backend core. The process includes querying the database for entries that define various regional settings within the scope of academic activities. Each entry typically covers details such as dates, holidays, and other regional-specific information pertinent to the academic calendar. The resulting data is then formatted appropriately and returned as a JSON array, providing a comprehensive overview of all regional configurations stored in the system. Each configuration detailed helps in tailoring the academic system to better fit local needs and regulations.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/saveRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/saveRest.js new file mode 100644 index 0000000000..96a1bc6b32 --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/saveRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveRest'); +const { schema: xRequest } = require('./schemas/request/saveRest'); + +const openapi = { + summary: 'Save regional configuration settings', + description: `This endpoint is responsible for saving the regional configurations for an academic calendar. The configurations may include settings like timezone, holiday schedules, and academic periods specific to a region or institution. + +**Authentication:** Users must be authenticated to modify regional configurations. An absence of valid authentication will prevent access to this endpoint. + +**Permissions:** Appropriate permissions are required to access this endpoint. Typically, only users with administrative rights or specific roles such as 'Academic Administrator' can update regional settings. + +Upon receiving the request, the handler in 'regionalConfig.rest.js' invokes the 'saveRegionalConfig' method from the 'regional-config' core module. This method processes the input data, ensuring all necessary validations are met, using the validation schema defined in 'forms.js'. If the data passes all validations, it proceeds to update or create the regional settings in the database. The result of this operation is then formulated into a response that confirms the success of the operation or provides error messages in case of failure.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/request/deleteRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/request/deleteRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/request/deleteRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/request/listRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/request/listRest.js new file mode 100644 index 0000000000..6dbab3e3d7 --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/request/listRest.js @@ -0,0 +1,15 @@ +// automatic hash: 38102a3da02ba8ae3ec61433f847dadc156588e210fc79fef7b15cb02cae9546 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + center: { + type: 'string', + minLength: 1, + }, + }, + required: ['center'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/request/saveRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/request/saveRest.js new file mode 100644 index 0000000000..cd215a6c1c --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/request/saveRest.js @@ -0,0 +1,46 @@ +// automatic hash: 5b6030c9ee8a823a2615448ab1472bd73ccffef849442f9e55dfe641a0ce1425 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + name: { + type: 'string', + minLength: 1, + }, + center: { + type: 'string', + minLength: 1, + }, + daysOffEvents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + localEvents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + regionalEvents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: [ + 'name', + 'center', + 'daysOffEvents', + 'localEvents', + 'regionalEvents', + ], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/response/deleteRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/response/deleteRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/response/deleteRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/response/listRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/response/listRest.js new file mode 100644 index 0000000000..e1d89bb669 --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/response/listRest.js @@ -0,0 +1,100 @@ +// automatic hash: dda9295181fe2c7e822f4348dbeeae80a74206cfec7b404d34baf19f75f7dd55 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + regionalConfigs: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'center', + 'isDeleted', + '__v', + 'assignedToAProgram', + 'currentlyInUse', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + center: { + type: 'string', + minLength: 1, + }, + regionalEvents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + localEvents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + daysOffEvents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + assignedToAProgram: { + type: 'boolean', + }, + currentlyInUse: { + type: 'boolean', + }, + }, + }, + }, + }, + required: ['status', 'regionalConfigs'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/response/saveRest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/response/saveRest.js new file mode 100644 index 0000000000..7f38ad52d1 --- /dev/null +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/openapi/regionalConfig/schemas/response/saveRest.js @@ -0,0 +1,85 @@ +// automatic hash: 6e13e7c45cdf6af8a94316d11b41a8024f4c87cfdfc64972642ec50e34818e09 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + regionalConfig: { + type: 'object', + properties: { + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + center: { + type: 'string', + minLength: 1, + }, + regionalEvents: { + type: 'string', + minLength: 1, + }, + localEvents: { + type: 'string', + minLength: 1, + }, + daysOffEvents: { + type: 'string', + minLength: 1, + }, + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + 'id', + 'deploymentID', + 'name', + 'center', + 'regionalEvents', + 'localEvents', + 'daysOffEvents', + '_id', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + }, + required: ['status', 'regionalConfig'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-calendar/backend/services/rest/regionalConfig.rest.js b/plugins/leemons-plugin-academic-calendar/backend/services/rest/regionalConfig.rest.js index 25728362d0..a7d182de29 100644 --- a/plugins/leemons-plugin-academic-calendar/backend/services/rest/regionalConfig.rest.js +++ b/plugins/leemons-plugin-academic-calendar/backend/services/rest/regionalConfig.rest.js @@ -14,9 +14,13 @@ const { deleteRegionalConfig, } = require('../../core/regional-config'); +const listRest = require('./openapi/regionalConfig/listRest'); +const deleteRest = require('./openapi/regionalConfig/deleteRest'); +const saveRest = require('./openapi/regionalConfig/saveRest'); /** @type {ServiceSchema} */ module.exports = { listRest: { + openapi: listRest.openapi, rest: { method: 'GET', path: '/list/:center', @@ -43,6 +47,7 @@ module.exports = { }, }, deleteRest: { + openapi: deleteRest.openapi, rest: { method: 'DELETE', path: '/:id', @@ -69,6 +74,7 @@ module.exports = { }, }, saveRest: { + openapi: saveRest.openapi, rest: { method: 'POST', path: '/save', diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js index 825922200c..02ada6dc0e 100644 --- a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/class.rest.js @@ -17,20 +17,46 @@ const { updateClassMany } = require('../../core/classes/updateClassMany'); const { addInstanceClass } = require('../../core/classes/addInstanceClass'); const { listClasses } = require('../../core/classes/listClasses'); const { listSubjectClasses } = require('../../core/classes/listSubjectClasses'); -const { addClassStudentsMany } = require('../../core/classes/addClassStudentsMany'); -const { addClassTeachersMany } = require('../../core/classes/addClassTeachersMany'); +const { + addClassStudentsMany, +} = require('../../core/classes/addClassStudentsMany'); +const { + addClassTeachersMany, +} = require('../../core/classes/addClassTeachersMany'); const { listStudentClasses } = require('../../core/classes/listStudentClasses'); const { listTeacherClasses } = require('../../core/classes/listTeacherClasses'); const { removeClassesByIds } = require('../../core/classes/removeClassesByIds'); -const { remove: removeStudentFromClass } = require('../../core/classes/student/remove'); +const { + remove: removeStudentFromClass, +} = require('../../core/classes/student/remove'); const { listSessionClasses } = require('../../core/classes/listSessionClasses'); -const { classDetailForDashboard } = require('../../core/classes/classDetailForDashboard'); +const { + classDetailForDashboard, +} = require('../../core/classes/classDetailForDashboard'); const { classByIds } = require('../../core/classes/classByIds'); const { getUserEnrollments } = require('../../core/classes'); +const haveClassesRest = require('./openapi/classes/haveClassesRest'); +const postClassRest = require('./openapi/classes/postClassRest'); +const putClassRest = require('./openapi/classes/putClassRest'); +const putClassManyRest = require('./openapi/classes/putClassManyRest'); +const postClassInstanceRest = require('./openapi/classes/postClassInstanceRest'); +const listClassRest = require('./openapi/classes/listClassRest'); +const listSubjectClassesRest = require('./openapi/classes/listSubjectClassesRest'); +const listMultipleSubjectsClassesRest = require('./openapi/classes/listMultipleSubjectsClassesRest'); +const postClassStudentsRest = require('./openapi/classes/postClassStudentsRest'); +const postClassTeachersRest = require('./openapi/classes/postClassTeachersRest'); +const listStudentClassesRest = require('./openapi/classes/listStudentClassesRest'); +const listTeacherClassesRest = require('./openapi/classes/listTeacherClassesRest'); +const removeClassRest = require('./openapi/classes/removeClassRest'); +const removeStudentRest = require('./openapi/classes/removeStudentRest'); +const listSessionClassesRest = require('./openapi/classes/listSessionClassesRest'); +const classDetailForDashboardRest = require('./openapi/classes/classDetailForDashboardRest'); +const classByIdsRest = require('./openapi/classes/classByIdsRest'); /** @type {ServiceSchema} */ module.exports = { haveClassesRest: { + openapi: haveClassesRest.openapi, rest: { path: '/have', method: 'GET', @@ -51,6 +77,7 @@ module.exports = { }, }, postClassRest: { + openapi: postClassRest.openapi, rest: { path: '/', method: 'POST', @@ -71,6 +98,7 @@ module.exports = { }, }, putClassRest: { + openapi: putClassRest.openapi, rest: { path: '/', method: 'PUT', @@ -91,6 +119,7 @@ module.exports = { }, }, putClassManyRest: { + openapi: putClassManyRest.openapi, rest: { path: '/many', method: 'PUT', @@ -111,6 +140,7 @@ module.exports = { }, }, postClassInstanceRest: { + openapi: postClassInstanceRest.openapi, rest: { path: '/instance', method: 'POST', @@ -131,6 +161,7 @@ module.exports = { }, }, listClassRest: { + openapi: listClassRest.openapi, rest: { path: '/', method: 'GET', @@ -171,6 +202,7 @@ module.exports = { }, }, listSubjectClassesRest: { + openapi: listSubjectClassesRest.openapi, rest: { path: '/subjects/class', method: 'GET', @@ -212,6 +244,7 @@ module.exports = { }, }, listMultipleSubjectsClassesRest: { + openapi: listMultipleSubjectsClassesRest.openapi, rest: { path: '/subjects/multiple', method: 'POST', @@ -253,6 +286,7 @@ module.exports = { }, }, postClassStudentsRest: { + openapi: postClassStudentsRest.openapi, rest: { path: '/students', method: 'POST', @@ -273,6 +307,7 @@ module.exports = { }, }, postClassTeachersRest: { + openapi: postClassTeachersRest.openapi, rest: { path: '/teachers', method: 'POST', @@ -293,6 +328,7 @@ module.exports = { }, }, listStudentClassesRest: { + openapi: listStudentClassesRest.openapi, rest: { path: '/student/:id', method: 'GET', @@ -331,6 +367,7 @@ module.exports = { }, }, listTeacherClassesRest: { + openapi: listTeacherClassesRest.openapi, rest: { path: '/teacher/:id', method: 'GET', @@ -370,6 +407,7 @@ module.exports = { }, }, removeClassRest: { + openapi: removeClassRest.openapi, rest: { path: '/:id', method: 'DELETE', @@ -385,11 +423,16 @@ module.exports = { }), ], async handler(ctx) { - const data = await removeClassesByIds({ ids: ctx.params.id, soft: true, ctx }); + const data = await removeClassesByIds({ + ids: ctx.params.id, + soft: true, + ctx, + }); return { status: 200, data }; }, }, removeStudentRest: { + openapi: removeStudentRest.openapi, rest: { path: '/remove/students', method: 'POST', @@ -414,6 +457,7 @@ module.exports = { }, }, listSessionClassesRest: { + openapi: listSessionClassesRest.openapi, rest: { path: '/session', method: 'POST', @@ -425,17 +469,22 @@ module.exports = { }, }, classDetailForDashboardRest: { + openapi: classDetailForDashboardRest.openapi, rest: { path: '/dashboard/:id', method: 'GET', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const data = await classDetailForDashboard({ classId: ctx.params.id, ctx }); + const data = await classDetailForDashboard({ + classId: ctx.params.id, + ctx, + }); return { status: 200, ...data }; }, }, classByIdsRest: { + openapi: classByIdsRest.openapi, rest: { // raw porque a diferencia del get a '/' no utiliza mongoDBPaginate(); path: '/raw-list', @@ -481,7 +530,12 @@ module.exports = { }); if (validator.validate(ctx.params)) { const { userAgentIds, centerId, contactUserAgentId } = ctx.params; - const data = await getUserEnrollments({ userAgentIds, centerId, contactUserAgentId, ctx }); + const data = await getUserEnrollments({ + userAgentIds, + centerId, + contactUserAgentId, + ctx, + }); return { status: 200, data }; } throw validator.error; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js index 4d2d765319..cfe58a3b09 100644 --- a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/common.rest.js @@ -11,7 +11,9 @@ const { LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); -const { listClassesSubjects } = require('../../core/common/listClassesSubjects'); +const { + listClassesSubjects, +} = require('../../core/common/listClassesSubjects'); const { getTree, getClassesUnderNodeTree, @@ -19,9 +21,16 @@ const { getStudentsByTags, } = require('../../core/common'); +const listClassSubjectsRest = require('./openapi/common/listClassSubjectsRest'); +const getTreeRest = require('./openapi/common/getTreeRest'); +const getClassesUnderNodeTreeRest = require('./openapi/common/getClassesUnderNodeTreeRest'); +const addStudentsToClassesUnderNodeTreeRest = require('./openapi/common/addStudentsToClassesUnderNodeTreeRest'); +const addTeachersToClassesUnderNodeTreeRest = require('./openapi/common/addTeachersToClassesUnderNodeTreeRest'); +const getStudentsByTagsRest = require('./openapi/common/getStudentsByTagsRest'); /** @type {ServiceSchema} */ module.exports = { listClassSubjectsRest: { + openapi: listClassSubjectsRest.openapi, rest: { path: '/class-subjects', method: 'GET', @@ -49,13 +58,19 @@ module.exports = { }); if (validator.validate(ctx.params)) { const { program, course, group } = ctx.params; - const { classes, subjects } = await listClassesSubjects({ program, course, group, ctx }); + const { classes, subjects } = await listClassesSubjects({ + program, + course, + group, + ctx, + }); return { status: 200, classes, subjects }; } throw validator.error; }, }, getTreeRest: { + openapi: getTreeRest.openapi, rest: { path: '/tree', method: 'GET', @@ -87,6 +102,7 @@ module.exports = { }, }, getClassesUnderNodeTreeRest: { + openapi: getClassesUnderNodeTreeRest.openapi, rest: { path: '/classes-under-node-tree', method: 'GET', @@ -113,11 +129,17 @@ module.exports = { .replaceAll(' ', '') .split(','); } - const classes = await getClassesUnderNodeTree({ nodeTypes, nodeType, nodeId, ctx }); + const classes = await getClassesUnderNodeTree({ + nodeTypes, + nodeType, + nodeId, + ctx, + }); return { status: 200, classes }; }, }, addStudentsToClassesUnderNodeTreeRest: { + openapi: addStudentsToClassesUnderNodeTreeRest.openapi, rest: { path: '/add-students-to-classes-under-node-tree', method: 'POST', @@ -144,11 +166,17 @@ module.exports = { .replaceAll(' ', '') .split(','); } - const classes = await getClassesUnderNodeTree({ nodeTypes, nodeType, nodeId, ctx }); + const classes = await getClassesUnderNodeTree({ + nodeTypes, + nodeType, + nodeId, + ctx, + }); return { status: 200, classes }; }, }, addTeachersToClassesUnderNodeTreeRest: { + openapi: addTeachersToClassesUnderNodeTreeRest.openapi, rest: { path: '/add-teachers-to-classes-under-node-tree', method: 'POST', @@ -175,6 +203,7 @@ module.exports = { }, }, getStudentsByTagsRest: { + openapi: getStudentsByTagsRest.openapi, rest: { path: '/students/by/tags', method: 'POST', diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/course.rest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/course.rest.js index 997bed4ea1..ba911df815 100644 --- a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/course.rest.js +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/course.rest.js @@ -9,11 +9,19 @@ const { LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); -const { updateCourse, listCourses, getCourseById } = require('../../core/courses'); +const { + updateCourse, + listCourses, + getCourseById, +} = require('../../core/courses'); +const postCourseRest = require('./openapi/courses/postCourseRest'); +const putCourseRest = require('./openapi/courses/putCourseRest'); +const listCourseRest = require('./openapi/courses/listCourseRest'); /** @type {ServiceSchema} */ module.exports = { postCourseRest: { + openapi: postCourseRest.openapi, rest: { path: '/', method: 'POST', @@ -37,6 +45,7 @@ module.exports = { }, }, putCourseRest: { + openapi: putCourseRest.openapi, rest: { path: '/', method: 'PUT', @@ -57,6 +66,7 @@ module.exports = { }, }, listCourseRest: { + openapi: listCourseRest.openapi, rest: { path: '/', method: 'GET', diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/cycle.rest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/cycle.rest.js index c8477c7437..9432b1d892 100644 --- a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/cycle.rest.js +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/cycle.rest.js @@ -11,9 +11,11 @@ const { const { updateCycle } = require('../../core/cycle'); +const putCycleRest = require('./openapi/cycle/putCycleRest'); /** @type {ServiceSchema} */ module.exports = { putCycleRest: { + openapi: putCycleRest.openapi, rest: { path: '/', method: 'PUT', diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js index 4055620158..bdcf7325e5 100644 --- a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/group.rest.js @@ -19,9 +19,16 @@ const { getGroupById, } = require('../../core/groups'); +const postGroupRest = require('./openapi/groups/postGroupRest'); +const deleteGroupFromClassesUnderNodeTreeRest = require('./openapi/groups/deleteGroupFromClassesUnderNodeTreeRest'); +const putGroupRest = require('./openapi/groups/putGroupRest'); +const listGroupRest = require('./openapi/groups/listGroupRest'); +const duplicateGroupWithClassesUnderNodeTreeRest = require('./openapi/groups/duplicateGroupWithClassesUnderNodeTreeRest'); +const duplicateGroupRest = require('./openapi/groups/duplicateGroupRest'); /** @type {ServiceSchema} */ module.exports = { postGroupRest: { + openapi: postGroupRest.openapi, rest: { path: '/', method: 'POST', @@ -42,6 +49,7 @@ module.exports = { }, }, deleteGroupFromClassesUnderNodeTreeRest: { + openapi: deleteGroupFromClassesUnderNodeTreeRest.openapi, rest: { path: '/group-from-classes-under-node-tree', method: 'DELETE', @@ -62,6 +70,7 @@ module.exports = { }, }, putGroupRest: { + openapi: putGroupRest.openapi, rest: { path: '/', method: 'PUT', @@ -82,6 +91,7 @@ module.exports = { }, }, listGroupRest: { + openapi: listGroupRest.openapi, rest: { path: '/', method: 'GET', @@ -143,6 +153,7 @@ module.exports = { }, }, duplicateGroupWithClassesUnderNodeTreeRest: { + openapi: duplicateGroupWithClassesUnderNodeTreeRest.openapi, rest: { path: '/:id/duplicate-with-classes-under-node-tree', method: 'POST', @@ -166,6 +177,7 @@ module.exports = { }, }, duplicateGroupRest: { + openapi: duplicateGroupRest.openapi, rest: { path: '/duplicate', method: 'POST', diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/knowledge.rest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/knowledge.rest.js index 3fd115b6fe..887060cc82 100644 --- a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/knowledge.rest.js +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/knowledge.rest.js @@ -15,13 +15,22 @@ const { updateKnowledgeArea, listKnowledgeAreas, } = require('../../core/knowledges'); -const { removeKnowledgeArea } = require('../../core/knowledges/removeKnowledgeArea'); -const { getKnowledgeAreaById } = require('../../core/knowledges/getKnowledgeAreaById'); +const { + removeKnowledgeArea, +} = require('../../core/knowledges/removeKnowledgeArea'); +const { + getKnowledgeAreaById, +} = require('../../core/knowledges/getKnowledgeAreaById'); const { permissions } = require('../../config/constants'); +const postKnowledgeRest = require('./openapi/knowledges/postKnowledgeRest'); +const putKnowledgeRest = require('./openapi/knowledges/putKnowledgeRest'); +const listKnowledgeRest = require('./openapi/knowledges/listKnowledgeRest'); +const deleteSubjectTypeRest = require('./openapi/knowledges/deleteSubjectTypeRest'); /** @type {ServiceSchema} */ module.exports = { postKnowledgeRest: { + openapi: postKnowledgeRest.openapi, rest: { path: '/', method: 'POST', @@ -42,6 +51,7 @@ module.exports = { }, }, putKnowledgeRest: { + openapi: putKnowledgeRest.openapi, rest: { path: '/', method: 'PUT', @@ -62,6 +72,7 @@ module.exports = { }, }, listKnowledgeRest: { + openapi: listKnowledgeRest.openapi, rest: { path: '/', method: 'GET', @@ -102,6 +113,7 @@ module.exports = { }, }, deleteSubjectTypeRest: { + openapi: deleteSubjectTypeRest.openapi, rest: { path: '/:id', method: 'DELETE', diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/classByIdsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/classByIdsRest.js new file mode 100644 index 0000000000..f5ca1ba8ed --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/classByIdsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/classByIdsRest'); +const { schema: xRequest } = require('./schemas/request/classByIdsRest'); + +const openapi = { + summary: 'Retrieve classes based on given IDs', + description: `This endpoint retrieves detailed information about academic classes specified by their unique identifiers (IDs). The main purpose is to fetch specific class details that can facilitate educational management tasks. + +**Authentication:** Users need to be logged in to access this endpoint. Authentication ensures that only authorized users can retrieve information based on their roles and permissions. + +**Permissions:** This endpoint requires the user to have specific permissions such as 'view_class_details'. Access without proper permissions will lead to a denial of the request. + +Upon receiving a request, the \`classByIdsRest\` handler invokes the \`classByIds\` method, located in the 'classByIds.js' core file. This method queries the database to obtain detailed information about each class whose ID was provided in the request. It processes the input ID array, performs the necessary database lookups, and handles potential errors such as missing IDs or inaccessible database entries. The result, a collection of class details, is then formatted appropriately and sent back to the user in the response body.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/classDetailForDashboardRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/classDetailForDashboardRest.js new file mode 100644 index 0000000000..0cf142e72c --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/classDetailForDashboardRest.js @@ -0,0 +1,32 @@ +const { schema } = require('./schemas/response/classDetailForDashboardRest'); +const { + schema: xRequest, +} = require('./schemas/request/classDetailForDashboardRest'); + +const openapi = { + summary: + "Displays detailed information about classes for the user's dashboard", + description: `This endpoint provides a comprehensive overview of a specific class, tailored for display on the user's dashboard. It includes insights and metrics relevant to the class's progress, teaching effectiveness, and student engagement. + +**Authentication:** User authentication is required to ensure secure access to the class details. Only authenticated users can view class-related data, protecting sensitive educational information. + +**Permissions:** Users need to have the 'view_class_dashboard' permission. This ensures that only users with the necessary rights can access detailed class insights, maintaining confidentiality and integrity of educational data. + +Upon receiving a request, the \`classDetailForDashboardRest\` method within \`class.rest.js\` begins by validating the provided class ID against the database. It uses this ID to fetch detailed information about the class, such as attendance rates, student performance metrics, and recent assessments. The data fetching process involves several service calls to different parts of the system, including attendance services and grade management systems. Once all data is compiled, the method formats it into a user-friendly response, which is then sent back to the client as a JSON object, offering a detailed view suitable for a dashboard presentation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/haveClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/haveClassesRest.js new file mode 100644 index 0000000000..4d3587ffd2 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/haveClassesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/haveClassesRest'); +const { schema: xRequest } = require('./schemas/request/haveClassesRest'); + +const openapi = { + summary: 'Checks the existence of classes within the academic system', + description: `This endpoint checks if there are any classes currently existing or active within the academic portfolio of the leemons platform. This function helps in understanding whether the system is populated with academic classes. + +**Authentication:** Users need to be authenticated to query for class existence. An unauthenticated request will not be processed. + +**Permissions:** Querying the class existence requires academic-admin rights or a similarly privileged role that can access academic data. + +The endpoint calls the \`haveClasses\` method from the \`HaveClasses\` core. This method performs a database query to check for the presence of any classes within the system's database. The query checks against multiple parameters to ascertain the activeness and existence of classes. Upon execution, it yields a boolean result indicating the presence (true) or absence (false) of classes in the academic portfolio. This result is then passed back through the API to the requester in the form of a simple JSON response indicating success or failure of the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listClassRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listClassRest.js new file mode 100644 index 0000000000..34cd194906 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listClassRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listClassRest'); +const { schema: xRequest } = require('./schemas/request/listClassRest'); + +const openapi = { + summary: 'Lists all classes available to the user based on specific criteria', + description: `This endpoint provides a list of all academic classes that are available or relevant to the user, filtered based on specific criteria such as department, program, and academic level. The list can include classes the user is teaching, enrolled in, or has permissions to view. + +**Authentication:** User authentication is required to access the list of classes. Only authenticated users can query the class details, ensuring that sensitive educational information remains protected. + +**Permissions:** This endpoint requires the user to have teaching, enrollment, or administrative permissions related to the classes they wish to view. Access is denied if the user lacks appropriate permissions for the requested classes. + +From the initial HTTP request to the response, the \`listClassesRest\` method begins by verifying the user's authentication and permissions. It then proceeds to gather the classes by calling the \`listClasses\` method from the academic portfolio services. This method uses filters provided in the request to retrieve relevant class data from the database. The retrieved data is then formatted appropriately and sent back to the user in the form of a JSON structured response, providing a comprehensive list of classes tailored to the user's accessibility and criteria.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listMultipleSubjectsClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listMultipleSubjectsClassesRest.js new file mode 100644 index 0000000000..e36fda5585 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listMultipleSubjectsClassesRest.js @@ -0,0 +1,33 @@ +const { + schema, +} = require('./schemas/response/listMultipleSubjectsClassesRest'); +const { + schema: xRequest, +} = require('./schemas/request/listMultipleSubjectsClassesRest'); + +const openapi = { + summary: 'List multiple subject classes based on specified criteria', + description: `This endpoint provides a detailed list of subject classes based on the specified criteria. It is designed to help users efficiently retrieve information about different classes within various subjects as a consolidated response. This can include classes across different departments or faculties, filtered according to the input parameters, which are encapsulated within the request. + +**Authentication:** Users need to be authenticated to request this information. Access to the endpoint requires the user to provide valid authentication credentials, which will be verified prior to data retrieval. + +**Permissions:** Specific permissions are required to access this endpoint. Users must have the 'view_classes' permission assigned to their role. Without this permission, the endpoint will deny access to the requested information. + +Upon receiving a request, the 'listMultipleSubjectsClassesRest' handler initiates by extracting and validating the input parameters from the request. It then invokes the 'listSubjectClasses' method from the academic portfolio's backend services, passing along necessary criteria for class filtration. This method interacts with the database to retrieve data about subject classes that match the given parameters. The process encapsulates error handling to ensure that any issues during data retrieval are managed, resulting in either a successful response with the data or an error message detailing the failure. The final response to the client is formatted as a JSON array containing the details about the classes, structured according to the specified requirements of the client-side application.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listSessionClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listSessionClassesRest.js new file mode 100644 index 0000000000..721cd9f30c --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listSessionClassesRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/listSessionClassesRest'); +const { + schema: xRequest, +} = require('./schemas/request/listSessionClassesRest'); + +const openapi = { + summary: 'Lists session classes associated with the user', + description: `This endpoint lists all the class sessions associated with the currently authenticated user's active academic sessions. It filters classes based on user’s session and role within the academic portfolio, thereby providing a tailored view according to the user’s academic engagement. + +**Authentication:** Users need to be authenticated to retrieve their session classes. Unauthenticated requests will not be processed. + +**Permissions:** This endpoint requires the user to have the 'view_classes' permission within their academic portfolio. Without sufficient permissions, the user will not be able to access the class list. + +The process begins by validating the user's authentication and permissions. Once validation is complete, the endpoint invokes the \`listSessionClasses\` method from the \`ClassesService\`. This service fetches the classes from the database that are linked to the user’s current active sessions, by examining user roles and associations within each class environment. Each class fetched includes details such as class name, subject, and schedule, structured to align with the user’s academic requirements. The resulting data is then formatted into a JSON structure and returned as a HTTP response, providing a comprehensive list of relevant session classes.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listStudentClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listStudentClassesRest.js new file mode 100644 index 0000000000..3a49911542 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listStudentClassesRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/listStudentClassesRest'); +const { + schema: xRequest, +} = require('./schemas/request/listStudentClassesRest'); + +const openapi = { + summary: 'List all classes associated with a specific student', + description: `This endpoint lists all the academic classes that a specific student is currently enrolled in or has completed. This involves fetching data that includes the class details, timings, and any other related academic information that pertains to the student's academic record. + +**Authentication:** Users need to be authenticated to access the list of classes for a student. Authentication ensures that only authorized users such as educational staff or the students themselves can access personal academic information. + +**Permissions:** Permissions required include roles such as academic staff or administrator. Specific access rights might be required to view detailed student class data to ensure confidentiality and adherence to educational standards. + +Upon request, the 'listStudentClassesRest' handler in the 'class.rest.js' starts by validating the user's authentication and permission levels. The main process involves calling the \`listStudentClasses\` function from the \`classes\` core module, which retrieves all class data associated with the student's ID provided in the request. This function queries the database for relevant class entries and compiles them into a structured format. The response is then prepared to include all pertinent details about the classes, formatted in JSON for client-side integration.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listSubjectClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listSubjectClassesRest.js new file mode 100644 index 0000000000..0cd0a04f27 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listSubjectClassesRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/listSubjectClassesRest'); +const { + schema: xRequest, +} = require('./schemas/request/listSubjectClassesRest'); + +const openapi = { + summary: 'List subject classes based on provided criteria', + description: `This endpoint lists all subject classes that match the provided criteria. It is primarily used to retrieve detailed information about classes linked to specific subjects in the academic portfolio of the educational institution. + +**Authentication:** Users must be authenticated to access this endpoint. Unauthenticated requests will be denied, ensuring that only authorized users can fetch class data. + +**Permissions:** Access to this endpoint requires \`view_classes\` permission. Users without this permission will not be able to retrieve any class data, safeguarding sensitive academic information. + +The endpoint initiates by calling the \`listSubjectClassesRest\` method, which accesses the \`listSubjectClasses\` from the core classes module. This method takes search parameters specified by the user and queries the academic database to find matching class entries. The search can be based on various criteria such as subject ID, time of year, or teacher ID. Once the relevant classes are identified, they are formatted and returned as a JSON array, providing comprehensive details like class schedules, involved instructors, and subject correlation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listTeacherClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listTeacherClassesRest.js new file mode 100644 index 0000000000..a126bc6203 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/listTeacherClassesRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/listTeacherClassesRest'); +const { + schema: xRequest, +} = require('./schemas/request/listTeacherClassesRest'); + +const openapi = { + summary: 'Lists classes associated with a specific teacher', + description: `This endpoint provides a list of all classes that a specific teacher is associated with, allowing users to view the teaching schedule, enrolled courses, and any relevant educational data tied to that teacher. + +**Authentication:** User authentication is required to access this endpoint. Access will be denied for requests without a valid authentication token or session. + +**Permissions:** The user must have the 'view_teacher_classes' permission to retrieve this information. Without appropriate permissions, the request will result in access denial. + +The endpoint operates by first validating the authentication and permissions of the requester. Upon successful validation, it invokes the 'listTeacherClasses' method from the academic portfolio core. This method queries the database to fetch detailed class records where the teacher's ID matches the specified in the request. Each class detail includes the course title, schedule times, and participating student count. The process ensures efficient data retrieval and structuring to produce a meaningful output formatted as a JSON list, returned in the endpoint's response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/postClassInstanceRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/postClassInstanceRest.js new file mode 100644 index 0000000000..944a35a7f5 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/postClassInstanceRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postClassInstanceRest'); +const { schema: xRequest } = require('./schemas/request/postClassInstanceRest'); + +const openapi = { + summary: 'Create an instance of a class within the academic portfolio', + description: `This endpoint handles the creation of a new class instance within the academic portfolio management system. It typically involves specifying details such as the class name, associated course, and instructor details. This creation process is integral to maintaining an up-to-date academic structure in educational or institutional settings. + +**Authentication:** Users need to be authenticated to create a class instance. Only logged-in users can initiate the creation process, ensuring secure and authorized access. + +**Permissions:** Creation of a class instance requires specific permissions, generally reserved for administrative or educational personnel. These permissions ensure that only authorized users can add new classes to the academic portfolio. + +The endpoint initiates by processing the provided input which includes necessary details about the class through the \`addClassInstance\` method. This method validates the input against predefined criteria to ensure compliance with the academic standards and structure. After validation, it proceeds to add the new class instance to the database, handling any constraints or relations inherent in the academic model, such as linking the class to a specific course and assigning an instructor. The response from the endpoint confirms the successful creation of the class instance with relevant details or provides error messages in case of issues during the creation process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/postClassRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/postClassRest.js new file mode 100644 index 0000000000..a1431bfd98 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/postClassRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postClassRest'); +const { schema: xRequest } = require('./schemas/request/postClassRest'); + +const openapi = { + summary: 'Add new class entry to the academic portfolio', + description: `This endpoint facilitates the addition of a new class entry into the academic portfolio system, effectively allowing the system to track and organize classes as part of an educational institution's offerings. + +**Authentication:** User authentication is required to ensure that only authorized personnel can add class entries. Users must be logged in and have a valid session token to proceed. + +**Permissions:** This action requires administrative rights or specific role-based permissions associated with academic management and entry modification. Proper permission checks are enforced to prevent unauthorized modifications. + +Upon receiving a request, the endpoint invokes the \`addClass\` method from the academic portfolio module. This method internally validates the provided data against predefined schemas and checks for the existence of necessary attributes such as course identifiers and subject details. After validation, the entry is created in the database, and a confirmation is sent back to the requester indicating successful addition or providing error messages in case of failure. The process ensures data integrity and aligns with the institution’s academic structure and rules.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/postClassStudentsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/postClassStudentsRest.js new file mode 100644 index 0000000000..0d443e5203 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/postClassStudentsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postClassStudentsRest'); +const { schema: xRequest } = require('./schemas/request/postClassStudentsRest'); + +const openapi = { + summary: 'Registers multiple students to a class', + description: `This endpoint is responsible for adding a list of students to a specific class within the academic portfolio system. It typically receives a list of student identifiers and a class identifier, then processes these inputs to add each student to the class in the system database. + +**Authentication:** User authentication is required to access this endpoint. Only authenticated users with valid session tokens can initiate the process of adding students to a class. + +**Permissions:** Specific permissions such as 'manage_class_students' or 'class_edit' might be required to perform this operation. Users without appropriate permissions will be denied access to this functionality. + +The process begins with the validation of input data to ensure that all necessary parameters like student IDs and the class ID are provided and valid. Subsequent calls are made to the \`addClassStudents\` method in the backend logic, which interacts with the database to register each student into the designated class. The method checks for existing records to avoid duplicates and handles possible exceptions or errors during the process. Successfully added students are then confirmed, and the endpoint returns a success response, indicating that the students have been successfully added to the class.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/postClassTeachersRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/postClassTeachersRest.js new file mode 100644 index 0000000000..7cee9e63da --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/postClassTeachersRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postClassTeachersRest'); +const { schema: xRequest } = require('./schemas/request/postClassTeachersRest'); + +const openapi = { + summary: 'Assign multiple teachers to a class', + description: `This endpoint is responsible for mapping multiple teachers to a specific class, ensuring that these teachers are associated with that class in the academic portfolio. This operation is crucial for managing class responsibilities and access for teachers in the educational management system. + +**Authentication:** Users need to be authenticated to access and modify the teachers' assignments for classes. An improper or missing authentication will prevent access to this endpoint. + +**Permissions:** The user needs to have administrative rights or specific role-based permissions that allow them to manage teacher assignments within classes. These permissions are necessary to ensure that only authorized personnel can make changes to the academic assignments. + +Upon receiving a request, the endpoint first validates the user's authentication and authorization levels. Post validation, it invokes methods from the \`Classes\` service, particularly \`addMultipleTeachersToClass\`, which accepts class ID and teacher IDs. This service then interacts with the underlying database to update the class records by associating them with the specified teacher IDs. The process involves checks and balances to ensure that the data integrity is maintained throughout the transaction. Finally, a successful operation will confirm the updated associations via a response, detailing the newly created links between the specified class and its teachers.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/putClassManyRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/putClassManyRest.js new file mode 100644 index 0000000000..d93baa655e --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/putClassManyRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putClassManyRest'); +const { schema: xRequest } = require('./schemas/request/putClassManyRest'); + +const openapi = { + summary: 'Update multiple class records', + description: `This endpoint facilitates the bulk updating of class records in the system. It is specifically designed to handle multiple updates at once, enhancing efficiency and minimizing the need for repetitive API calls for individual updates. + +**Authentication:** Users need to be authentically signed in to access this endpoint. Any attempt to access it without proper authentication will be denied. + +**Permissions:** This function requires the user to have 'edit_class_records' permission to update class details. Without this permission, the request will be rejected. + +Upon receiving the request, this endpoint initiates the \`updateClassMany\` service action. This action accepts an array of class objects, each containing updated information and an identifier for each class. The method iterates through each object, applying updates where the identifiers match existing records. This process involves validating the new data against existing schema rules to ensure consistency and data integrity. After successful updates, a summary of the affected records (e.g., number of classes updated) is sent back in the HTTP response. This allows clients to verify the extent of changes made.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/putClassRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/putClassRest.js new file mode 100644 index 0000000000..bcf27ea846 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/putClassRest.js @@ -0,0 +1,32 @@ +const { schema } = require('./schemas/response/putClassRest'); +const { schema: xRequest } = require('./schemas/request/putClassRest'); + +const openapi = { + // summary: "Summary", + description: `{ + "summary": "Update class details in the academic portfolio", + "description": "This endpoint allows for the updating of specific class details within the academic portfolio subsystem of the Leemonade platform. It is utilized primarily to modify class attributes such as name, schedule, and associated teacher or course data. + +**Authentication:** Users must be authenticated prior to accessing this endpoint. A valid session or authentication token is mandatory, and any unauthorized access attempt will result in an error response, ensuring security compliance. + +**Permissions:** Appropriate permissions are required to access this endpoint. Typically, the user must have administrative rights or specific academic staff privileges to modify class data. Permission checks are performed to ensure that only authorized users can perform updates. + +The process begins with the validation of the input data to ensure that it conforms to expected formats and values. Next, the \`updateClass\` method in the \`class.rest.js\` service is invoked, which interplays with various backend logic such as \`existCourseInProgram\`, \`existGroupInProgram\`, and \`isUsedInSubject\` to validate the current state before applying any updates. If validation passes, the class details are updated in the database using transactional operations to ensure data integrity. A response is then generated and sent back, indicating the successful update or detailing any errors encountered during the process." +}`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/removeClassRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/removeClassRest.js new file mode 100644 index 0000000000..4e9a87b32d --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/removeClassRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeClassRest'); +const { schema: xRequest } = require('./schemas/request/removeClassRest'); + +const openapi = { + summary: 'Removes multiple class entities by their IDs', + description: `This endpoint is designed to handle the removal of several class entities specified by their unique identifiers within the academic portfolio system. The process ensures that the specific classes are correctly identified and then deleted from the system's database. + +**Authentication:** Users must be authenticated to execute this operation. Access to this functionality will be denied if authentication credentials are invalid or absent. + +**Permissions:** This endpoint requires that the user has administrative rights or specific permissions related to academic class management. Without these permissions, the request will be rejected. + +The endpoint initiates by interpreting the received class IDs provided in the request. It calls the \`removeClassesByIds\` method from the \`Classes\` core module. This method internally checks each ID to confirm their existence and validates the user's permission to delete each class. Once validation is complete, it proceeds to delete the classes from the system's database. The transaction ensures atomicity to make sure all specified classes are removed effectively and safely. Upon successful completion of the operation, the response confirms the successful deletion of the classes, and in the case of any error during the process, an error message is returned specifying the issue.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/removeStudentRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/removeStudentRest.js new file mode 100644 index 0000000000..fc719e0039 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/removeStudentRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeStudentRest'); +const { schema: xRequest } = require('./schemas/request/removeStudentRest'); + +const openapi = { + summary: 'Removes a student from an academic class', + description: `This endpoint is responsible for removing a specific student from a designated academic class. The targeted student is disassociated from the class records in the database, effectively updating the class's enrollment status. + +**Authentication:** User authentication is required to ensure secure access to this endpoint. An attempt to access without a valid authentication session or token will be rejected. + +**Permissions:** The user must have administrative rights or specific permission to modify class enrollments, especially in the context of managing academic portfolios. + +The flow of processing in this handler starts by receiving the student's unique identifier and the associated class ID. The \`removeStudentFromClass\` method within the \`ClassService\` is then invoked, where database operations are performed to detach the student from the respective class. These operations include checking that the class exists and that the student is currently enrolled in it. Upon successful removal, the service updates the class enrollment records. Error handling is incorporated to address scenarios such as non-existent classes, non-enrolled students, or database access issues, ensuring that the response accurately reflects the outcome of the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/classByIdsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/classByIdsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/classByIdsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/classDetailForDashboardRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/classDetailForDashboardRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/classDetailForDashboardRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/haveClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/haveClassesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/haveClassesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listClassRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listClassRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listClassRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listMultipleSubjectsClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listMultipleSubjectsClassesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listMultipleSubjectsClassesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listSessionClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listSessionClassesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listSessionClassesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listStudentClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listStudentClassesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listStudentClassesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listSubjectClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listSubjectClassesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listSubjectClassesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listTeacherClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listTeacherClassesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/listTeacherClassesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/postClassInstanceRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/postClassInstanceRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/postClassInstanceRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/postClassRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/postClassRest.js new file mode 100644 index 0000000000..7d50fd0cd9 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/postClassRest.js @@ -0,0 +1,89 @@ +// automatic hash: 0c505b5cd7ae1f30f3c196ae40dd1b6687ec609a1f5f0a56ca9c4470c0d00d2a +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + subject: { + type: 'string', + minLength: 1, + }, + color: { + type: 'string', + minLength: 1, + }, + seats: { + type: 'number', + }, + virtualUrl: { + type: 'string', + minLength: 1, + }, + program: { + type: 'string', + minLength: 1, + }, + teachers: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['teacher', 'type'], + properties: { + teacher: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + schedule: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['start', 'end', 'duration', 'day', 'dayWeek'], + properties: { + start: { + type: 'string', + minLength: 1, + }, + end: { + type: 'string', + minLength: 1, + }, + duration: { + type: 'number', + }, + day: { + type: 'string', + minLength: 1, + }, + dayWeek: { + type: 'number', + }, + }, + }, + }, + classWithoutGroupId: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'subject', + 'color', + 'seats', + 'virtualUrl', + 'program', + 'teachers', + 'schedule', + 'classWithoutGroupId', + ], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/postClassStudentsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/postClassStudentsRest.js new file mode 100644 index 0000000000..3e71fdb085 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/postClassStudentsRest.js @@ -0,0 +1,25 @@ +// automatic hash: 3ae8d3005a67ddd1286cd3bb9e7629a26b5f64fb4c38a05bd40c9fca10c64fab +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + students: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + class: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['students', 'class'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/postClassTeachersRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/postClassTeachersRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/postClassTeachersRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/putClassManyRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/putClassManyRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/putClassManyRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/putClassRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/putClassRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/putClassRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/removeClassRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/removeClassRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/removeClassRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/removeStudentRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/removeStudentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/request/removeStudentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/classByIdsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/classByIdsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/classByIdsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/classDetailForDashboardRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/classDetailForDashboardRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/classDetailForDashboardRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/haveClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/haveClassesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/haveClassesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listClassRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listClassRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listClassRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listMultipleSubjectsClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listMultipleSubjectsClassesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listMultipleSubjectsClassesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listSessionClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listSessionClassesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listSessionClassesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listStudentClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listStudentClassesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listStudentClassesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listSubjectClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listSubjectClassesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listSubjectClassesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listTeacherClassesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listTeacherClassesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/listTeacherClassesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/postClassInstanceRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/postClassInstanceRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/postClassInstanceRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/postClassRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/postClassRest.js new file mode 100644 index 0000000000..959044bc81 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/postClassRest.js @@ -0,0 +1,935 @@ +// automatic hash: 216102e011aef1a74cbffa09b581cfab60e8dee86e1737375ebee27e9906b691 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + class: { + type: 'object', + properties: { + id: { + type: 'string', + minLength: 1, + }, + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + program: { + type: 'string', + minLength: 1, + }, + seats: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + virtualUrl: { + type: 'string', + minLength: 1, + }, + classWithoutGroupId: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + image: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + assigner: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor', 'assigner'], + }, + duplicable: { + type: 'boolean', + }, + assignable: {}, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + 'duplicable', + 'downloadable', + 'tags', + 'pinned', + ], + }, + subject: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + program: { + type: 'string', + minLength: 1, + }, + course: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + color: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + icon: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + assigner: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor', 'assigner'], + }, + duplicable: { + type: 'boolean', + }, + assignable: {}, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + 'duplicable', + 'downloadable', + 'tags', + 'pinned', + ], + }, + image: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + assigner: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor', 'assigner'], + }, + duplicable: { + type: 'boolean', + }, + assignable: {}, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + 'duplicable', + 'downloadable', + 'tags', + 'pinned', + ], + }, + credits: { + type: 'number', + }, + internalId: { + type: 'string', + minLength: 1, + }, + courses: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + subjectType: {}, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'program', + 'course', + 'color', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'icon', + 'image', + 'credits', + 'internalId', + 'courses', + ], + }, + subjectType: {}, + classes: {}, + parentClass: {}, + knowledges: {}, + substages: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + courses: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + index: { + type: 'number', + }, + program: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + metadata: { + type: 'object', + properties: { + minCredits: {}, + maxCredits: {}, + }, + required: [], + }, + isAlone: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'index', + 'program', + 'type', + 'metadata', + 'isAlone', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + groups: {}, + students: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + parentStudents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + schedule: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'class', + 'day', + 'dayWeek', + 'start', + 'end', + 'duration', + 'isDeleted', + '__v', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + class: { + type: 'string', + minLength: 1, + }, + day: { + type: 'string', + minLength: 1, + }, + dayWeek: { + type: 'number', + }, + start: { + type: 'string', + minLength: 1, + }, + end: { + type: 'string', + minLength: 1, + }, + duration: { + type: 'number', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + }, + }, + teachers: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['teacher', 'type'], + properties: { + teacher: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + }, + required: [ + 'id', + '_id', + 'deploymentID', + 'program', + 'seats', + 'color', + 'virtualUrl', + 'classWithoutGroupId', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'image', + 'subject', + 'substages', + 'courses', + 'students', + 'parentStudents', + 'schedule', + 'teachers', + ], + }, + }, + required: ['status', 'class'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/postClassStudentsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/postClassStudentsRest.js new file mode 100644 index 0000000000..a1394984c7 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/postClassStudentsRest.js @@ -0,0 +1,928 @@ +// automatic hash: 98a6ab717d2bbe433db146f0ad20849bb27ea6d0bfde388e5b466d56f830e52f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + class: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'program', + 'seats', + 'color', + 'virtualUrl', + 'classWithoutGroupId', + 'isDeleted', + '__v', + ], + properties: { + id: { + type: 'string', + minLength: 1, + }, + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + program: { + type: 'string', + minLength: 1, + }, + seats: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + virtualUrl: { + type: 'string', + minLength: 1, + }, + classWithoutGroupId: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + image: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + assigner: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor', 'assigner'], + }, + duplicable: { + type: 'boolean', + }, + assignable: {}, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + 'duplicable', + 'downloadable', + 'tags', + 'pinned', + ], + }, + subject: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + program: { + type: 'string', + minLength: 1, + }, + course: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + color: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + icon: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + assigner: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor', 'assigner'], + }, + duplicable: { + type: 'boolean', + }, + assignable: {}, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + 'duplicable', + 'downloadable', + 'tags', + 'pinned', + ], + }, + image: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + assigner: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor', 'assigner'], + }, + duplicable: { + type: 'boolean', + }, + assignable: {}, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + 'duplicable', + 'downloadable', + 'tags', + 'pinned', + ], + }, + credits: { + type: 'number', + }, + internalId: { + type: 'string', + minLength: 1, + }, + courses: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + subjectType: {}, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'program', + 'course', + 'color', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'icon', + 'image', + 'credits', + 'internalId', + 'courses', + ], + }, + subjectType: {}, + classes: {}, + parentClass: {}, + knowledges: {}, + substages: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + courses: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + index: { + type: 'number', + }, + program: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + metadata: { + type: 'object', + properties: { + minCredits: {}, + maxCredits: {}, + }, + required: [], + }, + isAlone: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'index', + 'program', + 'type', + 'metadata', + 'isAlone', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + groups: {}, + students: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + parentStudents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + schedule: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'class', + 'day', + 'dayWeek', + 'start', + 'end', + 'duration', + 'isDeleted', + '__v', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + class: { + type: 'string', + minLength: 1, + }, + day: { + type: 'string', + minLength: 1, + }, + dayWeek: { + type: 'number', + }, + start: { + type: 'string', + minLength: 1, + }, + end: { + type: 'string', + minLength: 1, + }, + duration: { + type: 'number', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + }, + }, + teachers: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['teacher', 'type'], + properties: { + teacher: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + }, + }, + }, + }, + required: ['status', 'class'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/postClassTeachersRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/postClassTeachersRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/postClassTeachersRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/putClassManyRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/putClassManyRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/putClassManyRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/putClassRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/putClassRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/putClassRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/removeClassRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/removeClassRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/removeClassRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/removeStudentRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/removeStudentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/classes/schemas/response/removeStudentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/addStudentsToClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/addStudentsToClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..81ac02e8e7 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/addStudentsToClassesUnderNodeTreeRest.js @@ -0,0 +1,33 @@ +const { + schema, +} = require('./schemas/response/addStudentsToClassesUnderNodeTreeRest'); +const { + schema: xRequest, +} = require('./schemas/request/addStudentsToClassesUnderNodeTreeRest'); + +const openapi = { + summary: 'Adds students to classes under a specified node tree', + description: `This endpoint is designed to add students to specified classes found under a node tree in the academic portfolio system. The process involves identifying the classes linked to a given node tree and updating those classes with new student enrolments. + +**Authentication:** Users need to be authenticated to perform this operation. Access to this endpoint is controlled by an authentication mechanism that verifies the user's identity and session validity before proceeding. + +**Permissions:** The user must have 'academic_admin' role or specific permission 'manage_classes_students' to execute this operation. Attempting to use this endpoint without adequate permissions will result in access being denied. + +The operation initiated by this endpoint starts with fetching the classes associated with the specified node tree. This is typically achieved by invoking the \`getClassesUnderNodeTree\` method which queries the database to retrieve all relevant class entries. Subsequently, the endpoint proceeds to add students to these classes by utilizing a batch update method, ensuring all specified students are correctly registered across the identified classes. This comprehensive method handles both the verification of class existence and the validity of student IDs before finalizing the enrolment, thereby maintaining data integrity and operational coherence within the system.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/addTeachersToClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/addTeachersToClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..bd190c9d72 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/addTeachersToClassesUnderNodeTreeRest.js @@ -0,0 +1,33 @@ +const { + schema, +} = require('./schemas/response/addTeachersToClassesUnderNodeTreeRest'); +const { + schema: xRequest, +} = require('./schemas/request/addTeachersToClassesUnderNodeTreeRest'); + +const openapi = { + summary: 'Assign teachers to classes within a specific node tree', + description: `This endpoint assigns teachers to all classes that are linked to a specific node tree within the organizational structure of the academic portfolio. The structure and linkage determine where the teachers are needed and which classes they should be associated with. + +**Authentication:** This endpoint requires users to be authenticated to ensure that only authorized personnel can assign teachers to classes. + +**Permissions:** Users need to have administrative or academic coordinator permissions to access this functionality. The permission checks ensure that only users with the right level of access can make changes to the academic structure. + +Upon receiving a request, the endpoint first verifies the user's authentication status and permissions. If the verification is successful, it proceeds to interact with the \`addTeachersToClassesUnderNodeTree\` method in the \`common\` core. This method fetches all classes under the specified node tree and then assigns the designated teachers to these classes. The operation involves multiple database interactions managed through the Moleculer microservices framework to handle the data efficiently and securely. Once the teachers are successfully assigned, the endpoint sends a confirmation response indicating the successful assignment of teachers to the classes.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/getClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/getClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..318820b1de --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/getClassesUnderNodeTreeRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getClassesUnderNodeTreeRest'); +const { + schema: xRequest, +} = require('./schemas/request/getClassesUnderNodeTreeRest'); + +const openapi = { + summary: 'Retrieve classes under a specific node tree', + description: `This endpoint fetches all class details located under a specified node tree hierarchy within the academic system. It processes the node tree structure and lists all classes linked under the nodes encompassed by the specified root node. + +**Authentication:** User authentication is mandatory to access this endpoint. Users without a valid session or authentication token will be denied access. + +**Permissions:** Necessary permissions include access to the academic program data. Users must have roles that grant visibility or management of class information under the specified node hierarchy. + +Upon receiving a request, this endpoint initiates by calling the \`getClassesUnderNodeTree\` function from the \`Common\` core module, submitting the node ID and leveraging a recursive search to trace through the node tree hierarchy. The operation accesses interconnected nodes and aggregates classes belonging to each node. The action leverages database queries to fetch and compile lists of classes, ensuring the returning data is constructed accurately based on user permissions and authenticated session. The endpoint concludes by packaging this list into a JSON response format, providing a consolidated view of class data structured under the queried node tree.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/getStudentsByTagsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/getStudentsByTagsRest.js new file mode 100644 index 0000000000..ae71f1e2b2 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/getStudentsByTagsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getStudentsByTagsRest'); +const { schema: xRequest } = require('./schemas/request/getStudentsByTagsRest'); + +const openapi = { + summary: 'Fetch students associated with specified tags', + description: `This endpoint fetches a list of students who are associated with a set of specified tags. It is primarily used in academic portfolio management systems to categorize and retrieve students based on specific criteria represented by tags. + +**Authentication:** Users must be authenticated to query students by tags. Unauthenticated access will result in denial of service. + +**Permissions:** This endpoint requires the user to have administrative rights or specific permissions that allow access to student data based on tags. Without the appropriate permissions, the request will be rejected. + +The controller starts by validating the incoming request to ensure that it contains valid tags. It then calls the \`getStudentsByTags\` method in the \`common\` core, which performs a database query to retrieve all students matching the specified tags. This method utilizes complex query parameters to accurately filter the students' data according to the provided tags. Once the data is fetched, it's formatted and returned as a JSON array in the HTTP response, providing a comprehensive list of students tailored to the query parameters.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/getTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/getTreeRest.js new file mode 100644 index 0000000000..2c2ebecb79 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/getTreeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getTreeRest'); +const { schema: xRequest } = require('./schemas/request/getTreeRest'); + +const openapi = { + summary: 'Generate a hierarchical tree structure for academic entities', + description: `This endpoint generates a comprehensive hierarchical tree structure representing various academic entities such as courses, programs, and subjects within the platform. This structured output is aimed at providing a clear and navigable visual representation for users, facilitating easier academic planning and management. + +**Authentication:** User authentication is mandatory to access this endpoint. Proper credentials need to be provided to ensure authorized access, and failure to authenticate will restrict the user's access to the endpoint. + +**Permissions:** Adequate permissions are required to access different levels of academic information. Depending on the user's role (e.g., student, instructor, administrator), permissions will dictate the visibility and interactability with the hierarchical structure. + +From the initial request to the response, this handler starts by invoking several lower-level methods to gather necessary data about programs, courses, and subjects from the database. This data is then processed to form a nested hierarchical tree structure. Each node in the tree is created by respective methods such as \`getProgramCourses\`, \`getProgramSubjects\`, which fetch and organize data based on the relationship between academic entities. The response from this handler is a well-structured JSON object that provides clients with a ready-to-use hierarchical view of all academic entities relevant to the user based on their permissions and roles.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/listClassSubjectsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/listClassSubjectsRest.js new file mode 100644 index 0000000000..108ea6093f --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/listClassSubjectsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listClassSubjectsRest'); +const { schema: xRequest } = require('./schemas/request/listClassSubjectsRest'); + +const openapi = { + summary: 'Lists class subjects associated with specific classes', + description: `This endpoint retrieves a list of subjects associated with specified classes. It is primarily utilized for generating detailed views of academic schedules or portfolios within the educational institution's management system. + +**Authentication:** User authentication is required for accessing this endpoint. Access is denied if the user is not authenticated or the session has expired. + +**Permissions:** Users need to have the 'view_classes' permission. Without this permission, users will not be able to retrieve information on class subjects, enforcing data access restrictions based on user roles within the institution. + +This handler invokes the \`listClassesSubjects\` function from the \`common\` core module. The process starts by extracting class identifiers from the request parameters. These identifiers are then used to query the database through the \`listClassesSubjects\`, which retrieves all subjects related to the classes. The queried data includes subject names, codes, and associated teacher details. After the data is collected, it's formatted into a structured response that includes all necessary details about each subject related to the classes in question. This result is then returned to the client as a JSON array.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/addStudentsToClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/addStudentsToClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/addStudentsToClassesUnderNodeTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/addTeachersToClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/addTeachersToClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/addTeachersToClassesUnderNodeTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/getClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/getClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/getClassesUnderNodeTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/getStudentsByTagsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/getStudentsByTagsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/getStudentsByTagsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/getTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/getTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/getTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/listClassSubjectsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/listClassSubjectsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/request/listClassSubjectsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/addStudentsToClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/addStudentsToClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/addStudentsToClassesUnderNodeTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/addTeachersToClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/addTeachersToClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/addTeachersToClassesUnderNodeTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/getClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/getClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/getClassesUnderNodeTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/getStudentsByTagsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/getStudentsByTagsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/getStudentsByTagsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/getTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/getTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/getTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/listClassSubjectsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/listClassSubjectsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/common/schemas/response/listClassSubjectsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/listCourseRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/listCourseRest.js new file mode 100644 index 0000000000..9cc48c97ae --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/listCourseRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listCourseRest'); +const { schema: xRequest } = require('./schemas/request/listCourseRest'); + +const openapi = { + summary: 'List all courses available in the academic portfolio', + description: `This endpoint provides a comprehensive list of all courses available within the academic portfolio system. It retrieves details such as course identifier, title, and description that are available for enrollment or review by the user. + +**Authentication:** User authentication is required to access the list of courses. The system checks if the requesting user session is valid before proceeding with the request. + +**Permissions:** The user must have the 'view_courses' permission to access this data. Without sufficient permissions, the system denies access to the course listings. + +The flow of the request starts when the endpoint receives a GET request. It then calls the \`listCourses\` method from within the 'courses' core module. This method queries the underlying database for all available courses, applying any necessary filters such as those pertaining to user permissions or specific department criteria. Once the data is fetched and formatted, it is returned as a JSON array back to the user through the response payload. Each course in the array includes essential information such as the course ID, name, and a brief description.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/postCourseRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/postCourseRest.js new file mode 100644 index 0000000000..1859780b05 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/postCourseRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postCourseRest'); +const { schema: xRequest } = require('./schemas/request/postCourseRest'); + +const openapi = { + summary: 'Create a new course in the academic portfolio', + description: `This endpoint allows for the creation of a new course within the academic portfolio system. It handles the course data submission and integrates it into the educational institution's curriculum system, ensuring the new course is registered correctly and available for student enrollment. + +**Authentication:** User authentication is mandatory to ensure security and proper access control. Only authenticated users can submit new courses to the system. + +**Permissions:** This endpoint requires the user to have 'course_creation' permission within their role. A user without sufficient permissions will be denied access to perform this operation. + +The process begins when the endpoint receives a POST request containing the course details. The endpoint first verifies the user's authentication and authorization, ensuring they have the proper rights to create a course. Once verified, it invokes the \`addCourse\` method of the \`CourseService\`. This method takes care of validating the course data against the business rules and saves the course into the database. On successful creation, a confirmation is sent back to the user along with the details of the newly created course, such as its ID and name, in a structured JSON response. Error handling is meticulously integrated to manage any exceptions or validation failures, sending appropriate error messages to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/putCourseRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/putCourseRest.js new file mode 100644 index 0000000000..0b43e538ac --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/putCourseRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putCourseRest'); +const { schema: xRequest } = require('./schemas/request/putCourseRest'); + +const openapi = { + summary: 'Update existing course details', + description: `This endpoint updates the details of an existing course in the academic portfolio database. It allows for modifications of name, description, credits, and other course-related attributes that are essential for managing the academic offerings within the platform. + +**Authentication:** Users must be authenticated and have a valid session token to make updates to course details. Attempts to access this endpoint without authentication will result in a '401 Unauthorized' response. + +**Permissions:** This endpoint requires the user to have 'edit_course' permission. Users without this permission will receive a '403 Forbidden' error, indicating that they do not have enough rights to perform this operation. + +Upon receiving a request, the \`putCourseRest\` handler begins by validating the incoming data against the \`courseSchema\` using the \`forms.js\` validator. If validation fails, it responds with a '400 Bad Request' containing validation error details. If successful, it proceeds to invoke the \`updateCourse\` method from the \`courses\` core with the validated data. This method is responsible for applying the updates in the database. The final response reflects the outcome of the update operation, typically returning the updated course object or an error message if the update could not be performed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/request/listCourseRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/request/listCourseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/request/listCourseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/request/postCourseRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/request/postCourseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/request/postCourseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/request/putCourseRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/request/putCourseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/request/putCourseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/response/listCourseRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/response/listCourseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/response/listCourseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/response/postCourseRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/response/postCourseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/response/postCourseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/response/putCourseRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/response/putCourseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/courses/schemas/response/putCourseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/cycle/putCycleRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/cycle/putCycleRest.js new file mode 100644 index 0000000000..15acf59499 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/cycle/putCycleRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putCycleRest'); +const { schema: xRequest } = require('./schemas/request/putCycleRest'); + +const openapi = { + summary: 'Update an academic cycle', + description: `This endpoint updates a specific academic cycle's details within the academic portfolio plugin of the \`leemonade\` platform. The endpoint facilitates the modification of cycle attributes such as start date, end date, and associated programs or courses. + +**Authentication:** Users need to be authenticated to update an academic cycle. Access to this functionality might be allowed only through secure and verified login sessions. + +**Permissions:** This functionality requires the user to have administrative rights over academic cycle management. Typically, this would include roles like Academic Administrator or System Administrator who has privileges to modify academic entities. + +Upon receiving a request, the endpoint first verifies user authentication and permissions. If valid, it then proceeds to invoke the \`updateCycle\` function from the \`Cycle\` core module. This function is responsible for checking the existence of the cycle and applying the updates if valid parameters are provided. Error handling mechanisms are employed to manage cases where the cycle does not exist or invalid data is provided. The response communicates the status of the operation along with any pertinent updated cycle information or error messages.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/cycle/schemas/request/putCycleRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/cycle/schemas/request/putCycleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/cycle/schemas/request/putCycleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/cycle/schemas/response/putCycleRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/cycle/schemas/response/putCycleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/cycle/schemas/response/putCycleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/deleteGroupFromClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/deleteGroupFromClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..e87f729307 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/deleteGroupFromClassesUnderNodeTreeRest.js @@ -0,0 +1,33 @@ +const { + schema, +} = require('./schemas/response/deleteGroupFromClassesUnderNodeTreeRest'); +const { + schema: xRequest, +} = require('./schemas/request/deleteGroupFromClassesUnderNodeTreeRest'); + +const openapi = { + summary: 'Remove a group from classes under a specific node tree', + description: `This endpoint allows the removal of a specified group from all classes that fall under a given node tree in the academic portfolio system. It ensures that the group is disassociated from the appropriate classes to maintain up-to-date records. + +**Authentication:** Users must be authenticated to perform this removal operation. The server validates the user's credentials and session to confirm legitimacy before processing the request. + +**Permissions:** This operation requires the user to have administrative or specific management permissions related to academic portfolios. Without sufficient permissions, the request will be rejected. + +The endpoint initiates by calling the \`removeGroupFromClassesUnderNodeTree\` method, which utilizes predefined logic in the academic portfolio's backend to identify all classes linked to a certain node tree. The method processes this identification in multiple steps including fetching relevant class details and subsequently removing the specified group from these classes. The action is handled through a series of database operations that ensure data integrity and consistency. On successful execution, the endpoint updates the system to reflect these changes, typically confirming the successful removal with a status response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/duplicateGroupRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/duplicateGroupRest.js new file mode 100644 index 0000000000..62221a72bf --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/duplicateGroupRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/duplicateGroupRest'); +const { schema: xRequest } = require('./schemas/request/duplicateGroupRest'); + +const openapi = { + summary: 'Duplicate an academic group', + description: `This endpoint duplicates a specific academic group along with associated data within the academic portfolio system. The duplication process includes all pertinents details like group configurations, linked courses, and enrolments. + +**Authentication:** User authentication is necessary to ensure secure access to the duplication functionality. Without proper authentication, the request will be rejected. + +**Permissions:** Users must have 'group_management' permission to execute this operation. This allows only authorized personnel with the right privileges to perform duplications ensuring academic data integrity. + +Upon receiving a request, the \`duplicateGroup\` handler from the \`group.rest.js\` file is initiated. This handler first verifies user authentication and permissions. If the user is authenticated and has the necessary permissions, the handler then calls the \`duplicateGroup\` method from the \`groups\` core module. This method manages the duplication logic, which involves deep copying of the group's data and associated entities in the database. Once the duplication is successful, the response includes a confirmation with the details of the newly created duplicate group or an error message if the process fails.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/duplicateGroupWithClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/duplicateGroupWithClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..99f0b0ee33 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/duplicateGroupWithClassesUnderNodeTreeRest.js @@ -0,0 +1,34 @@ +const { + schema, +} = require('./schemas/response/duplicateGroupWithClassesUnderNodeTreeRest'); +const { + schema: xRequest, +} = require('./schemas/request/duplicateGroupWithClassesUnderNodeTreeRest'); + +const openapi = { + summary: + 'Duplicate a group along with its associated classes under a specific node tree', + description: `This endpoint duplicates a specified group along with its classes under a designated node tree within the academic portfolio system. The duplication process includes creating a complete copy of the group's structure, the associated classes, and any relational data linked under the specified node tree. + +**Authentication:** Users must be authenticated to initiate the duplication of groups and classes. A lack of authentication or an invalid token will prevent access to this endpoint. + +**Permissions:** The user must have the 'admin' role or specific duplication rights associated with their account to perform this task. Without sufficient permissions, the operation will be blocked with an access denied error. + +The endpoint interacts with multiple backend services to accomplish the group and class duplication task. Initially, the process begins by validating user authentication and checking for necessary permissions in the context of the transaction. Upon successful validation, the \`duplicateGroupWithClassesUnderNodeTreeByIds\` function is invoked, which orchestrates the retrieval and duplication of the group and its classes based on the specified node IDs in the request. This involves deep copying of all related data structures and ensuring that relational integrity is maintained throughout the database. Finally, after the duplication process, the outcome is returned to the user, indicating success or providing error messages regarding any issues encountered during the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/listGroupRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/listGroupRest.js new file mode 100644 index 0000000000..67491f56f2 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/listGroupRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listGroupRest'); +const { schema: xRequest } = require('./schemas/request/listGroupRest'); + +const openapi = { + summary: 'Lists all academic groups', + description: `This endpoint lists all academic groups available within the platform. It retrieves a structured list of groups, including details such as group name, members, and associated curriculum. + +**Authentication:** User authentication is required to access this endpoint. Users need to provide a valid session token which will be verified before proceeding with the request. + +**Permissions:** Users must have the 'view_groups' permission to list all academic groups. Lack of this permission will result in a denial of access to this endpoint. + +The process starts from the \`listGroupRest\` action in the 'group.rest.js' service file, which invokes the \`listGroups\` method located in \`index.js\` within the 'groups' core module. This method queries the database to gather all existing academic groups by applying relevant filters and permissions. It ensures the integrity and security of the data by filtering out groups based on the user's credentials and permissions provided within the session. The result is then formatted and returned back to the user in a JSON structure through the REST endpoint response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/postGroupRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/postGroupRest.js new file mode 100644 index 0000000000..0b1e163150 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/postGroupRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postGroupRest'); +const { schema: xRequest } = require('./schemas/request/postGroupRest'); + +const openapi = { + summary: 'Adds a new academic group to the portfolio', + description: `This endpoint is responsible for adding a new group to the academic portfolio. It involves storing group-related information in the database, such as group name, associated program, and other metadata. The endpoint expects to receive the necessary data to create a new group which then is processed and stored. + +**Authentication:** Users must be logged in to interact with this endpoint. Without proper authentication, the request will not be processed. + +**Permissions:** This endpoint requires the user to have 'admin' privileges or specific role permissions that allow manipulation of academic group data. + +Upon receiving a request, the \`addGroup\` method in the \`group.rest.js\` file is called. This method further interacts with the \`groups\` core where the actual logic for adding a new group to the database is implemented. This includes generating a unique identifier for the group, validating the passed data against predefined schemas, and finally adding the group data to the database. Error handling mechanisms are also in place to manage any issues that may arise during data processing or database operations, ensuring the client receives appropriate feedback on the operation's outcome.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/putGroupRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/putGroupRest.js new file mode 100644 index 0000000000..f32ed9a593 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/putGroupRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putGroupRest'); +const { schema: xRequest } = require('./schemas/request/putGroupRest'); + +const openapi = { + summary: 'Update an existing academic group', + description: `This endpoint updates the details of an existing academic group within the portfolio management system. The process includes modifying any group attributes such as name, description, and associated permissions or members based on provided data. + +**Authentication:** User must be authenticated to request an update to an academic group. Unauthenticated requests are rejected with an appropriate error message. + +**Permissions:** This endpoint requires the user to have 'group_edit' permission exclusively set for the targeted academic group. Absence of such permissions results in an authorization failure response. + +The endpoint first validates the incoming data against the predefined validation rules set in 'forms.js' to ensure all required fields are included and correctly formatted. It then utilizes the 'updateGroup.js' method in the \`groups\` core module which performs the actual update operation on the database. Throughout the process, it engages various checks to confirm user permissions, group existence, and manage any relational constraints. The response is generated based on the success of the update operation, either confirming the updated group details or detailing any errors encountered during the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/deleteGroupFromClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/deleteGroupFromClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/deleteGroupFromClassesUnderNodeTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/duplicateGroupRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/duplicateGroupRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/duplicateGroupRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/duplicateGroupWithClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/duplicateGroupWithClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/duplicateGroupWithClassesUnderNodeTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/listGroupRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/listGroupRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/listGroupRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/postGroupRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/postGroupRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/postGroupRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/putGroupRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/putGroupRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/request/putGroupRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/deleteGroupFromClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/deleteGroupFromClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/deleteGroupFromClassesUnderNodeTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/duplicateGroupRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/duplicateGroupRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/duplicateGroupRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/duplicateGroupWithClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/duplicateGroupWithClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/duplicateGroupWithClassesUnderNodeTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/listGroupRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/listGroupRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/listGroupRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/postGroupRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/postGroupRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/postGroupRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/putGroupRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/putGroupRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/groups/schemas/response/putGroupRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/deleteSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/deleteSubjectTypeRest.js new file mode 100644 index 0000000000..9719e144a7 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/deleteSubjectTypeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteSubjectTypeRest'); +const { schema: xRequest } = require('./schemas/request/deleteSubjectTypeRest'); + +const openapi = { + summary: 'Deletes a specific knowledge area', + description: `This endpoint is responsible for the deletion of a specific knowledge area from the academic portfolio system. It effectively removes the entry from the database that matches the provided knowledge area identifier. + +**Authentication:** User authentication is required to access this endpoint, ensuring that only authenticated users can initiate deletion processes. + +**Permissions:** The user must have administrative rights or the specific permission to alter knowledge area data. This ensures that only authorized personnel can delete knowledge areas from the system. + +Upon receiving a request, the endpoint first verifies the authenticity of the user and checks if the user has the necessary permissions to proceed. It then invokes the \`removeKnowledgeArea\` core method, passing the identifier of the knowledge area to be deleted. This method interacts with the database to locate and remove the specified knowledge area. If the operation is successful, it returns a confirmation response to the user indicating that the knowledge area has been successfully deleted. Any issues during the process, such as database errors or permission denials, are handled appropriately and communicated back to the user through the response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/listKnowledgeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/listKnowledgeRest.js new file mode 100644 index 0000000000..a6885834cc --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/listKnowledgeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listKnowledgeRest'); +const { schema: xRequest } = require('./schemas/request/listKnowledgeRest'); + +const openapi = { + summary: 'List available knowledge areas within the academic portfolio', + description: `This endpoint lists all available knowledge areas defined in the academic portfolio system. It is intended to provide an overview of all educational or research domains categorized within the platform. + +**Authentication:** Users must be authenticated to retrieve knowledge areas. Access without proper authorization will be denied, ensuring that only authorized personnel can obtain this information. + +**Permissions:** The user needs to have 'view_knowledge_areas' permission to access this data. If the user lacks the necessary permissions, the request will be rejected, ensuring compliance with the system's security protocols. + +Upon receiving a request, this endpoint calls the \`listKnowledgeAreas()\` method from the underlying knowledge management service. This method queries the database for all entries labeled as knowledge areas and compiles them into a structured list. This comprehensive processing involves checking the user's permissions, ensuring they have the rights to view the information. The data then is returned as a JSON array filled with knowledge areas, categorized and ready for further frontend use or application integration.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/postKnowledgeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/postKnowledgeRest.js new file mode 100644 index 0000000000..697e0320c6 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/postKnowledgeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postKnowledgeRest'); +const { schema: xRequest } = require('./schemas/request/postKnowledgeRest'); + +const openapi = { + summary: 'Adds a new knowledge area to the academic portfolio', + description: `This endpoint allows for the addition of a new knowledge area into the system's academic portfolio. The action facilitates the creation and organization of knowledge areas as part of educational or institutional structuring. + +**Authentication:** Users must be authenticated to create a new knowledge area. The system requires valid authentication credentials for accessing this endpoint. + +**Permissions:** The user needs specific permissions related to managing academic content. The required permission is typically 'manage_academic_knowledge_areas' or a similar scope that authorizes the user to add and modify educational structures. + +The process initiated by this endpoint involves the \`addKnowledgeArea\` function from the \`knowledges\` core module. Upon receiving the request, the method processes the input data, typically consisting of the knowledge area's name and description, and then inserts it into the database. This operation involves validating the input against predefined schemas to ensure compliance with data standards. After successful insertion, a confirmation is sent back to the user, providing feedback on the operation's success and the details of the newly added knowledge area.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/putKnowledgeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/putKnowledgeRest.js new file mode 100644 index 0000000000..2342aaafbe --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/putKnowledgeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putKnowledgeRest'); +const { schema: xRequest } = require('./schemas/request/putKnowledgeRest'); + +const openapi = { + summary: 'Updates the specified knowledge area', + description: `This endpoint updates an existing knowledge area within the academic portfolio system. It is used to modify specific details about a knowledge area, such as its title or description, ensuring that the academic portfolio remains current and accurate. + +**Authentication:** User authentication is required to access this endpoint. An authenticated session must be established, and valid credentials must be provided in the request. + +**Permissions:** This endpoint requires administrative permissions related to academic portfolio management. Users must have permissions to update knowledge areas to execute this operation successfully. + +Upon receiving a request, the endpoint initially verifies user credentials and permissions to ensure legitimacy and authority over the requested operations. It then proceeds to call the \`updateKnowledgeArea\` method located in the 'knowledges' core module. This method handles the business logic necessary to securely update details of the knowledge area in the database. The workflow includes validation of the incoming data against predefined schemas, checking for existing knowledge area records, and applying updates where applicable. Finally, the response confirms the successful update of the knowledge area, returning details about the updated entity or an error message if the update fails.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/request/deleteSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/request/deleteSubjectTypeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/request/deleteSubjectTypeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/request/listKnowledgeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/request/listKnowledgeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/request/listKnowledgeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/request/postKnowledgeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/request/postKnowledgeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/request/postKnowledgeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/request/putKnowledgeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/request/putKnowledgeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/request/putKnowledgeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/response/deleteSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/response/deleteSubjectTypeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/response/deleteSubjectTypeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/response/listKnowledgeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/response/listKnowledgeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/response/listKnowledgeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/response/postKnowledgeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/response/postKnowledgeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/response/postKnowledgeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/response/putKnowledgeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/response/putKnowledgeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/knowledges/schemas/response/putKnowledgeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/addStudentsToClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/addStudentsToClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..0179e5a364 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/addStudentsToClassesUnderNodeTreeRest.js @@ -0,0 +1,33 @@ +const { + schema, +} = require('./schemas/response/addStudentsToClassesUnderNodeTreeRest'); +const { + schema: xRequest, +} = require('./schemas/request/addStudentsToClassesUnderNodeTreeRest'); + +const openapi = { + summary: 'Add students to classes linked with specific program node trees', + description: `This endpoint facilitates the dynamic enrollment of students into classes that fall under a given program's node tree structure. It primarily handles the automation of student-class assignments based on the hierarchical definitions and dependencies within the program nodes. + +**Authentication:** User authentication is required to ensure that only authorized personnel can manage and carry out student enrolments. An unauthorized, or improperly authenticated request will be denied access. + +**Permissions:** This action requires administrative permissions related to student management and program modifications. Only users with the necessary permissions can execute additions of students to classes. + +The process starts by accepting a request which specifies the particular node tree and the students targeted for enrollment. It then invokes the \`addStudentsToClassesUnderNodeTree\` method, defined in the \`backend/core/programs\` directory. This method examines the node tree to delineate the classes affected. Subsequently, it iterates over the list of students, enrolling each into the appropriate classes defined under the node tree hierarchy. The entire operation is transactional, ensuring that all enrollments are either completed successfully or rolled back in case of an error, maintaining data integrity throughout the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/deleteProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/deleteProgramRest.js new file mode 100644 index 0000000000..2c124ae88a --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/deleteProgramRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteProgramRest'); +const { schema: xRequest } = require('./schemas/request/deleteProgramRest'); + +const openapi = { + summary: 'Delete specified academic programs', + description: `This endpoint allows for the deletion of one or more academic programs based on their unique identifiers. The deletion process removes the program entries and associated entities such as courses, groups, and student records from the academic portfolio system. + +**Authentication:** Users need to be authenticated to initiate deletion requests. Requests lacking proper authentication will be rejected, ensuring secure access to resource modifications. + +**Permissions:** Administrative-level permissions are required to delete academic programs. Users must have specific roles or privileges that grant them rights to alter or remove academic records, ensuring adherence to institutional policies. + +Upon receiving a request, the endpoint verifies user authentication and permissions. If these checks are satisfactory, it proceeds to call the \`removeProgramByIds\` method. This method coordinates with various service layers to ensure all related records, such as courses tied to the programs, are also identified and deleted. This comprehensive approach ensures data integrity and frees up resources previously allocated to the now-deleted programs. After successful deletion, a confirmation is sent back to the requestor indicating the status of the deletion process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/detailProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/detailProgramRest.js new file mode 100644 index 0000000000..df1f11500e --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/detailProgramRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/detailProgramRest'); +const { schema: xRequest } = require('./schemas/request/detailProgramRest'); + +const openapi = { + summary: 'Details of a specific academic program', + description: `This endpoint retrieves comprehensive details of an academic program, including its structure, associated courses, subjects, and any other relevant information. It aims to provide users with a complete view of an academic program's configuration and offerings. + +**Authentication:** User must be authenticated to access the details of the academic program. Without proper authentication, the request will not proceed further. + +**Permissions:** Access to this endpoint is restricted to users who have permissions to view academic program details. Typically, this includes educational administrators, academic staff, or students who are part of the specified program. + +Upon receiving a request, the endpoint first validates the user authentication and checks for the necessary permissions. If validation is successful, it calls the \`getDetailedProgram\` method in the academic portfolio's program service. This method orchestrates several sub-methods to gather information about programs, their courses, subjects, and associated class groups from various parts of the database. It assembles all this data into a structured format that effectively represents the hierarchy and sequence of educational components within the program. The final response includes detailed information about the program, structured in a clear, readable JSON format to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/duplicateProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/duplicateProgramRest.js new file mode 100644 index 0000000000..8768483407 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/duplicateProgramRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/duplicateProgramRest'); +const { schema: xRequest } = require('./schemas/request/duplicateProgramRest'); + +const openapi = { + summary: 'Duplicate academic programs based on specified IDs', + description: `This endpoint duplicates one or more academic programs using their unique identifiers. The duplication process includes copying all details, configurations, associated subjects, courses, and any related entities under the programs to create new instances of each with new identifiers. + +**Authentication:** Users must be authenticated to use this endpoint. Unauthenticated users or those with invalid tokens will be denied access. + +**Permissions:** This endpoint requires administrative privileges or specific academic management permissions. Users without these permissions will be unable to execute the duplication process. + +The endpoint begins by validating the provided program IDs against the database to ensure they exist and are accessible under the user's privileges. Subsequently, it invokes the \`duplicateProgramByIds\` method in the backend 'programs' core, which handles the intricacies of the duplication. This includes deep cloning of program configurations, subjects linked to the program, associated courses, and any other nested entities. Each cloned item is saved with new IDs ensuring no conflicts in the database. On successful completion, the endpoint responds with the IDs of the newly created programs, signifying a successful duplication.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/getProgramEvaluationSystemRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/getProgramEvaluationSystemRest.js new file mode 100644 index 0000000000..19c5ab8f56 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/getProgramEvaluationSystemRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getProgramEvaluationSystemRest'); +const { + schema: xRequest, +} = require('./schemas/request/getProgramEvaluationSystemRest'); + +const openapi = { + summary: "Retrieve the program's evaluation system", + description: `This endpoint facilitates the retrieval of the evaluation system specifics for a given academic program. The focus is on providing detailed settings pertaining to how program performances are assessed, including grading schemes and evaluation procedures. + +**Authentication:** User authentication is a prerequisite for accessing this information. An absence of proper authentication will prevent access to the endpoint. + +**Permissions:** This endpoint requires that the user has administrative rights within the academic program. Specific permission checks include verifying user roles such as administrator or faculty member before proceeding. + +Upon receiving a request, this handler invokes the \`getProgramEvaluationSystem\` method from the \`programs\` core module. This method performs a query to fetch the evaluation system details from the program's data storage by leveraging the program identifier provided in the request. The comprehensive flow from request to response ensures that only authorized and authenticated users can access precise and relevant evaluation system data, adhered to predetermined permission protocols. The successful completion of the query resolves in transmitting the evaluation system data back to the requester through a meticulously structured JSON response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/getProgramTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/getProgramTreeRest.js new file mode 100644 index 0000000000..2e7ad1f9b1 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/getProgramTreeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getProgramTreeRest'); +const { schema: xRequest } = require('./schemas/request/getProgramTreeRest'); + +const openapi = { + summary: 'Fetch the hierarchical structure of academic programs', + description: `This endpoint retrieves the hierarchical tree structure representing the organization of academic programs, detailing each level from general program categorizations down to specific subjects. The tree format aids in visualizing the relationship and dependency among various components of the programs. + +**Authentication:** Access requires users to be authenticated to ensure data security and integrity. Users must provide valid session tokens to proceed with data retrieval. + +**Permissions:** Users must have 'view_program' permissions to access this data. Attempting to access the endpoint without adequate permissions will result in an authorization error. + +Upon receiving a request, the endpoint first verifies the user's authentication and permissions. If the checks pass, it proceeds to call the method \`getProgramTree\` from the core 'programs' module. This method consults the database to gather comprehensive details of all academic program elements, organized in a hierarchical tree structure. The result encapsulates the relationships and dependencies in the program, aiming to provide a clear and useful representation for academic administration purposes. Each node in the tree typically represents a different level or component within the overall program structure, starting from general categories and moving down to specific courses and subjects.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/getUserProgramsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/getUserProgramsRest.js new file mode 100644 index 0000000000..ba734d8139 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/getUserProgramsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getUserProgramsRest'); +const { schema: xRequest } = require('./schemas/request/getUserProgramsRest'); + +const openapi = { + summary: 'Retrieve academic programs associated with a user', + description: `This endpoint fetches all academic programs linked to a specific user within the academic portfolio platform. It is designed to provide an overview of the user's educational engagements and progress. + +**Authentication:** Users are required to be authenticated in order to access their list of academic programs. Authentication ensures that users only access programs where they have permissions or roles associated. + +**Permissions:** The user must have appropriate permissions or roles related to educational oversight or student status. Typically, only administrative staff or the users themselves can view their own academic program information. + +The endpoint first validates the user's authentication token to establish session legitimacy. It then proceeds to invoke the \`getUserPrograms\` method from the programs core logic. This method accesses the database to retrieve all entries under the programs table associated with the user’s ID. The method extracts program data such as program name, status, and associated courses. Finally, it returns this compiled data in a JSON format as the response to the client, ensuring the user has a comprehensive view of their academic engagements.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/haveProgramsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/haveProgramsRest.js new file mode 100644 index 0000000000..3bbe6a85a3 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/haveProgramsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/haveProgramsRest'); +const { schema: xRequest } = require('./schemas/request/haveProgramsRest'); + +const openapi = { + summary: 'Check availability of academic programs', + description: `This endpoint checks whether there are any academic programs available in the system. It does not specify the details of the programs, but simply confirms their existence or non-existence. + +**Authentication:** Users must be authenticated to enquire about the availability of academic programs. Unauthenticated requests will be denied. + +**Permissions:** Users need specific permissions to view the status of academic programs. Without these permissions, the endpoint will not provide any information. + +Upon receiving a request, the endpoint accesses the \`havePrograms\` method in the \`programs\` core module. This method queries the system's database to check for any entries under the academic programs category. The process includes validating the user's credentials and permissions before proceeding with the database query. The response from this method will clearly indicate whether academic programs are available or not, without disclosing specific details about the programs.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/listProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/listProgramRest.js new file mode 100644 index 0000000000..ba9cf84adb --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/listProgramRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listProgramRest'); +const { schema: xRequest } = require('./schemas/request/listProgramRest'); + +const openapi = { + summary: 'List all academic programs available to a user', + description: `This endpoint lists all academic programs that are accessible based on the user's role or permissions within the educational platform. It typically filters and returns a collection of programs that the user is either enrolled in or has administrative access to. + +**Authentication:** User authentication is required to access the list of programs. Users must provide valid authentication credentials to proceed. An insufficient or missing authentication token will restrict access to the program's information. + +**Permissions:** Users need specific permissions related to viewing academic programs. Typically, these permissions include roles like academic staff, administrator, or student permissions that allow them to view detailed program data. + +Upon receiving a request, the \`listPrograms\` method in the \`programs\` core is called. This method verifies the context of the user's request, checking for authentication and necessary permissions. Based on the authenticated user's role and permissions, it queries the database for accessible academic programs. The method then processes the received data, filtering and structuring the programs into a suitable format for response. Finally, a structured list of programs is sent back to the user in JSON format, encapsulating key details like program names, descriptions, and eligibility criteria.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/postProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/postProgramRest.js new file mode 100644 index 0000000000..7f2134eef2 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/postProgramRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postProgramRest'); +const { schema: xRequest } = require('./schemas/request/postProgramRest'); + +const openapi = { + summary: 'Add a new academic program to the system', + description: `This endpoint facilitates the addition of a new academic program into the academic portfolio management system. It involves creating a detailed record that describes all aspects of an academic program, such as its structure, subjects, and related courses. + +**Authentication:** User must be logged in to access this endpoint. Authentication ensures that only registered users can insert new academic programs into the system. + +**Permissions:** The user must have administrative rights or be granted specific permissions related to academic management to add a program. Without the necessary permissions, the endpoint access is restricted and the operation will not be executed. + +After receiving the API call, the handler initiates the \`addProgram\` method in the programs core API. This method processes input data, which includes program details such as name, description, and configuration settings. Once validated, the data is stored in the database, creating a new program. Upon successful creation, the system sends back a confirmation response including the ID of the newly created program, indicating successful operation. Throughout this process, the system ensures that all inputs are correctly formatted and that the user has the appropriate rights to perform the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programCoursesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programCoursesRest.js new file mode 100644 index 0000000000..df444885f8 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programCoursesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/programCoursesRest'); +const { schema: xRequest } = require('./schemas/request/programCoursesRest'); + +const openapi = { + summary: 'Fetch program courses associated with a specific academic program', + description: `This endpoint retrieves a list of all courses associated with a specified academic program. The result includes detailed information about each course such as titles, credits, and other relevant academic details. + +**Authentication:** Users must be authenticated to access the program courses list. An invalid or missing authentication token will result in access denial. + +**Permissions:** Users need to have the 'view_program_courses' permission to retrieve the list of courses. Without this permission, access to course information will be restricted. + +Upon receiving a request, this endpoint initiates by calling the \`getProgramCourses\` method from the \`programs\` core service. This method takes the program's identification details from the request parameters and queries the database to fetch all courses linked to the specified program. The method processes the data to format it appropriately, ensuring that all relevant academic information is included and well-presented in the response. Finally, the endpoint responds with a structured JSON containing the courses data, facilitating easy consumption and integration on the client side.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programGroupsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programGroupsRest.js new file mode 100644 index 0000000000..4cd6c4bca2 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programGroupsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/programGroupsRest'); +const { schema: xRequest } = require('./schemas/request/programGroupsRest'); + +const openapi = { + summary: 'Manage academic program groups information', + description: `This endpoint allows for the administration of academic program groups within the platform, facilitating the creation, modification, and querying of program group details associated with different academic programs. + +**Authentication:** Access to this endpoint requires the user to be authenticated. Users who are not authenticated will not be able to execute operations related to program groups. + +**Permissions:** Users need to have specific permissions based on their roles such as administrator or academic staff to interact with program groups. This ensures that only authorized personnel can manage academic program data. + +The endpoint begins by handling incoming requests in the \`programs.rest.js\` service. Depending on the request type, it then calls the appropriate method in the \`programs/index.js\` core file. For instance, if the request is to fetch program groups, the \`getProgramGroups\` method in \`getProgramGroups.js\` is activated. This method takes care of fetching all relevant program group details from the database, based on the program ID supplied through the request. The flow involves parsing the request data, validating user credentials and permissions, querying the database, and finally structuring the response that includes the program groups details formatted as a JSON object. This structured flow ensures a secure and efficient process from request to response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programHasCoursesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programHasCoursesRest.js new file mode 100644 index 0000000000..b03f2411b8 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programHasCoursesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/programHasCoursesRest'); +const { schema: xRequest } = require('./schemas/request/programHasCoursesRest'); + +const openapi = { + summary: 'Checks if a program includes certain courses', + description: `This endpoint determines if a specified academic program includes one or more specific courses. It is typically used to verify program curriculum completeness or to assist in academic planning and advising. + +**Authentication:** Users need to be authenticated to access this endpoint. Unauthorized access attempts will be blocked and logged. + +**Permissions:** This function requires the user to have 'view_program_courses' permission. Without the necessary permissions, access to the data will be denied, and only a generic error message will be returned to the user. + +Upon receiving a request, the handler first authenticates the user and checks for the necessary permissions. If validation fails at any point, the process is terminated, and an appropriate error message is returned. If the checks are successful, the handler invokes the \`getProgramCourses\` method from the \`programs\` core module, passing the program's identification details. This method accesses the database to retrieve a list of courses associated with the specified program; it performs this by querying the program-course relationship data. Once the data is obtained and processed, the handler constructs a response containing information about whether the required courses are part of the program, then sends this response to the requester.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programHasGroupsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programHasGroupsRest.js new file mode 100644 index 0000000000..ce22855b8b --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programHasGroupsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/programHasGroupsRest'); +const { schema: xRequest } = require('./schemas/request/programHasGroupsRest'); + +const openapi = { + summary: 'Check membership of programs and their groups', + description: `This endpoint verifies if the specified programs contain any group associations and returns the membership status. The process determines the linkage between programs and their respective groups within the academic portfolio system. + +**Authentication:** Access to this endpoint requires the user to be authenticated. Failure to provide valid authentication details will prevent access to the endpoint functionality. + +**Permissions:** Users need to have specific permissions related to viewing or managing academic programs and groups. Without the requisite permissions, the request will not proceed. + +The controller for this endpoint initiates by calling the \`getProgramGroups\` method from the \`programs\` core module. This method checks for existing group associations within each program by interacting with the database to retrieve all group links associated with the provided program IDs. It meticulously filters and aggregates the data to ensure that only relevant program-group relationships are considered. After processing, the endpoint compiles the results into a structured format and returns this information to the client, indicating which programs are associated with which groups, thereby facilitating effective academic management and planning.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programHasSubstagesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programHasSubstagesRest.js new file mode 100644 index 0000000000..b34827a3b2 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programHasSubstagesRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/programHasSubstagesRest'); +const { + schema: xRequest, +} = require('./schemas/request/programHasSubstagesRest'); + +const openapi = { + summary: 'Determine if a program contains any substages', + description: `This endpoint checks if a specific academic program contains any substages or not. The primary operation of this endpoint is to ascertain the substage structure within a particular program, which is crucial for managing educational program layouts. + +**Authentication:** User authentication is mandatory to access this endpoint. Users must provide valid session credentials to proceed with querying the academic program substages. + +**Permissions:** Appropriate permissions are required to access this endpoint. Users should possess the 'view_programs' permission or similar rights that allow them to interact with academic program data. + +Upon receiving a request, the handler \`programHasSubstagesRest\` calls the \`getProgramSubstages\` method in the \`programs\` core. This method fetches the program details based on the provided program ID and evaluates whether there are any associated substages. The flow includes validating the user’s credentials and permissions, retrieving the program data from the database, and analyzing the presence of substages. The result, indicating either the existence or absence of substages, is then returned as a Boolean value to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programSubstagesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programSubstagesRest.js new file mode 100644 index 0000000000..5c2337f0eb --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/programSubstagesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/programSubstagesRest'); +const { schema: xRequest } = require('./schemas/request/programSubstagesRest'); + +const openapi = { + summary: 'Manage academic program sub-stages', + description: `This endpoint manages the sub-stages of an academic program. It typically involves updating, retrieving, or deleting details related to various sub-stages within a specified academic program in the database. + +**Authentication:** The user must be authenticated to modify or access sub-stage information. Authentication ensures that only authorized users can manage such sensitive educational data. + +**Permissions:** The endpoint requires specific academic management permissions. Users need to have roles that include rights to modify educational structures or privileges to view program details. + +The controller typically interacts with multiple core methods to handle the request effectively. Initially, it might check user authentication and authorization, followed by either fetching data using \`getProgramSubstages\` from the \`programs\` core or updating and deleting sub-stage information. This process may also include validation of input data to ensure integrity and appropriateness according to academic standards and database schemas. The results or confirmations are then sent back to the user, encapsulated in the HTTP response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/putProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/putProgramRest.js new file mode 100644 index 0000000000..17abbf14d4 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/putProgramRest.js @@ -0,0 +1,32 @@ +const { schema } = require('./schemas/response/putProgramRest'); +const { schema: xRequest } = require('./schemas/request/putProgramRest'); + +const openapi = { + // summary: "Summary", + description: `{ + "summary": "Updates an academic program", + "description": "This endpoint updates the details of an existing academic program based on the program ID provided. The updated details can include changes to the program's name, duration, associated courses, and other relevant academic parameters. + +**Authentication:** Users must be logged in to update an academic program. The system checks for a valid session token before processing the request. + +**Permissions:** The user needs to have 'program_update' permissions. Without the necessary permissions, the request will be rejected, and an authorization error will be returned. + +After receiving the request, the endpoint first authenticates the user and checks for the necessary permissions. It then processes the incoming data, validates the provided program ID, and uses the \`updateProgram\` method from the programs core to apply the changes to the database. This method interacts with the database to update the respective entries for the academic program. Upon successfully updating the program, a confirmation message is sent back to the user in the response, along with the updated program details. If there are any issues, such as the program not existing or invalid data, the endpoint returns an appropriate error message." +}`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/addStudentsToClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/addStudentsToClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/addStudentsToClassesUnderNodeTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/deleteProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/deleteProgramRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/deleteProgramRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/detailProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/detailProgramRest.js new file mode 100644 index 0000000000..ecc7d74d57 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/detailProgramRest.js @@ -0,0 +1,19 @@ +// automatic hash: 9e5e43674831ebd55625548740924da125f82d64b12ccc8cf142006eaf1fdc9e +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + withClasses: { + type: 'string', + minLength: 1, + }, + id: { + type: 'string', + minLength: 1, + }, + }, + required: ['withClasses', 'id'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/duplicateProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/duplicateProgramRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/duplicateProgramRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/getProgramEvaluationSystemRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/getProgramEvaluationSystemRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/getProgramEvaluationSystemRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/getProgramTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/getProgramTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/getProgramTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/getUserProgramsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/getUserProgramsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/getUserProgramsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/haveProgramsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/haveProgramsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/haveProgramsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/listProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/listProgramRest.js new file mode 100644 index 0000000000..0e021d8739 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/listProgramRest.js @@ -0,0 +1,23 @@ +// automatic hash: 51a7960d20d1f09e987142cd6f308723ede62502ee81b26d05b430856cfe0ab7 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + page: { + type: 'string', + minLength: 1, + }, + size: { + type: 'string', + minLength: 1, + }, + center: { + type: 'string', + minLength: 1, + }, + }, + required: ['page', 'size', 'center'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/postProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/postProgramRest.js new file mode 100644 index 0000000000..fe60e8af26 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/postProgramRest.js @@ -0,0 +1,108 @@ +// automatic hash: 0905d044225da8e772b0ff29302b74ddfa2130a1c180668d3be572b3d3f4089a +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + name: { + type: 'string', + minLength: 1, + }, + abbreviation: { + type: 'string', + minLength: 1, + }, + centers: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + color: { + type: 'string', + minLength: 1, + }, + image: { + type: 'string', + minLength: 1, + }, + evaluationSystem: { + type: 'string', + minLength: 1, + }, + cycles: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + haveCycles: { + type: 'boolean', + }, + maxNumberOfCourses: { + type: 'number', + }, + credits: {}, + totalHours: {}, + moreThanOneAcademicYear: { + type: 'boolean', + }, + hasSubjectTypes: { + type: 'boolean', + }, + hideStudentsToStudents: { + type: 'boolean', + }, + hoursPerCredit: {}, + numberOfSubstages: { + type: 'number', + }, + sequentialCourses: { + type: 'boolean', + }, + substages: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + useAutoAssignment: { + type: 'boolean', + }, + useCustomSubjectIds: { + type: 'boolean', + }, + haveKnowledge: { + type: 'boolean', + }, + maxSubstageAbbreviationIsOnlyNumbers: { + type: 'boolean', + }, + }, + required: [ + 'name', + 'abbreviation', + 'centers', + 'color', + 'image', + 'evaluationSystem', + 'cycles', + 'haveCycles', + 'maxNumberOfCourses', + 'moreThanOneAcademicYear', + 'hasSubjectTypes', + 'hideStudentsToStudents', + 'numberOfSubstages', + 'sequentialCourses', + 'substages', + 'useAutoAssignment', + 'useCustomSubjectIds', + 'haveKnowledge', + 'maxSubstageAbbreviationIsOnlyNumbers', + ], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programCoursesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programCoursesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programCoursesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programGroupsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programGroupsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programGroupsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programHasCoursesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programHasCoursesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programHasCoursesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programHasGroupsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programHasGroupsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programHasGroupsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programHasSubstagesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programHasSubstagesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programHasSubstagesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programSubstagesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programSubstagesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/programSubstagesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/putProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/putProgramRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/request/putProgramRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/addStudentsToClassesUnderNodeTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/addStudentsToClassesUnderNodeTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/addStudentsToClassesUnderNodeTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/deleteProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/deleteProgramRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/deleteProgramRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/detailProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/detailProgramRest.js new file mode 100644 index 0000000000..93c99fc9a8 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/detailProgramRest.js @@ -0,0 +1,1527 @@ +// automatic hash: 96aec05c48ffdeffd60de2dc72627c81dd31bec53afecf3b8c001edb1385aea6 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + program: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + color: { + type: 'string', + minLength: 1, + }, + abbreviation: { + type: 'string', + minLength: 1, + }, + credits: {}, + maxGroupAbbreviationIsOnlyNumbers: { + type: 'boolean', + }, + maxNumberOfCourses: { + type: 'number', + }, + courseCredits: { + type: 'number', + }, + hideCoursesInTree: { + type: 'boolean', + }, + moreThanOneAcademicYear: { + type: 'boolean', + }, + numberOfSubstages: { + type: 'number', + }, + maxSubstageAbbreviationIsOnlyNumbers: { + type: 'boolean', + }, + haveKnowledge: { + type: 'boolean', + }, + treeType: { + type: 'number', + }, + totalHours: {}, + hideStudentsToStudents: { + type: 'boolean', + }, + evaluationSystem: { + type: 'string', + minLength: 1, + }, + isArchived: { + type: 'boolean', + }, + hasSubjectTypes: { + type: 'boolean', + }, + useCustomSubjectIds: { + type: 'boolean', + }, + useAutoAssignment: { + type: 'boolean', + }, + sequentialCourses: { + type: 'boolean', + }, + hoursPerCredit: {}, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + image: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor'], + }, + duplicable: { + type: 'boolean', + }, + assignable: {}, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + 'duplicable', + 'downloadable', + 'tags', + 'pinned', + ], + }, + imageUrl: { + type: 'string', + minLength: 1, + }, + hasKnowledgeAreas: { + type: 'boolean', + }, + treeTypeNodes: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + centers: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + groups: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + courses: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'index', + 'program', + 'type', + 'isAlone', + 'isDeleted', + '__v', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + index: { + type: 'number', + }, + program: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + metadata: { + type: 'object', + properties: { + minCredits: {}, + maxCredits: {}, + }, + required: [], + }, + isAlone: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + }, + }, + knowledgeAreas: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + subjects: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'program', + 'course', + 'color', + 'isDeleted', + '__v', + 'icon', + 'image', + 'credits', + 'internalId', + 'compiledInternalId', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + program: { + type: 'string', + minLength: 1, + }, + course: { + type: 'string', + minLength: 1, + }, + color: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + icon: { + type: 'string', + minLength: 1, + }, + image: { + type: 'string', + minLength: 1, + }, + courses: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + credits: { + type: 'number', + }, + internalId: { + type: 'string', + minLength: 1, + }, + compiledInternalId: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + subjectTypes: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + substages: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + customSubstages: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + cycles: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + classes: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'program', + 'seats', + 'color', + 'virtualUrl', + 'classWithoutGroupId', + 'isDeleted', + '__v', + ], + properties: { + id: { + type: 'string', + minLength: 1, + }, + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + program: { + type: 'string', + minLength: 1, + }, + seats: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + virtualUrl: { + type: 'string', + minLength: 1, + }, + classWithoutGroupId: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + image: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + assigner: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor', 'assigner'], + }, + duplicable: { + type: 'boolean', + }, + assignable: {}, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + 'duplicable', + 'downloadable', + 'tags', + 'pinned', + ], + }, + subject: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + program: { + type: 'string', + minLength: 1, + }, + subject: { + type: 'string', + minLength: 1, + }, + __v: { + type: 'number', + }, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + credits: { + type: 'number', + }, + deletedAt: {}, + id: { + type: 'string', + minLength: 1, + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + compiledInternalId: { + type: 'string', + minLength: 1, + }, + internalId: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + course: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + color: { + type: 'string', + minLength: 1, + }, + icon: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + assigner: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor', 'assigner'], + }, + duplicable: { + type: 'boolean', + }, + assignable: {}, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + 'duplicable', + 'downloadable', + 'tags', + 'pinned', + ], + }, + image: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + assigner: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor', 'assigner'], + }, + duplicable: { + type: 'boolean', + }, + assignable: {}, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + 'duplicable', + 'downloadable', + 'tags', + 'pinned', + ], + }, + courses: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + subjectType: {}, + }, + required: [ + '_id', + 'deploymentID', + 'isDeleted', + 'program', + 'subject', + '__v', + 'createdAt', + 'credits', + 'id', + 'updatedAt', + 'compiledInternalId', + 'internalId', + 'name', + 'course', + 'color', + 'icon', + 'image', + 'courses', + ], + }, + subjectType: {}, + classes: {}, + parentClass: {}, + knowledges: {}, + substages: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + courses: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + index: { + type: 'number', + }, + program: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + metadata: { + type: 'object', + properties: { + minCredits: {}, + maxCredits: {}, + }, + required: [], + }, + isAlone: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'index', + 'program', + 'type', + 'metadata', + 'isAlone', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + groups: {}, + students: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + parentStudents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + schedule: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'class', + 'day', + 'dayWeek', + 'start', + 'end', + 'duration', + 'isDeleted', + '__v', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + class: { + type: 'string', + minLength: 1, + }, + day: { + type: 'string', + minLength: 1, + }, + dayWeek: { + type: 'number', + }, + start: { + type: 'string', + minLength: 1, + }, + end: { + type: 'string', + minLength: 1, + }, + duration: { + type: 'number', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + }, + }, + teachers: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['teacher', 'type'], + properties: { + teacher: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + }, + }, + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'color', + 'abbreviation', + 'maxGroupAbbreviationIsOnlyNumbers', + 'maxNumberOfCourses', + 'courseCredits', + 'hideCoursesInTree', + 'moreThanOneAcademicYear', + 'numberOfSubstages', + 'maxSubstageAbbreviationIsOnlyNumbers', + 'haveKnowledge', + 'treeType', + 'hideStudentsToStudents', + 'evaluationSystem', + 'isArchived', + 'hasSubjectTypes', + 'useCustomSubjectIds', + 'useAutoAssignment', + 'sequentialCourses', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'image', + 'imageUrl', + 'hasKnowledgeAreas', + 'treeTypeNodes', + 'centers', + 'groups', + 'courses', + 'knowledgeAreas', + 'subjects', + 'subjectTypes', + 'substages', + 'customSubstages', + 'cycles', + 'classes', + ], + }, + }, + required: ['status', 'program'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/duplicateProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/duplicateProgramRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/duplicateProgramRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/getProgramEvaluationSystemRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/getProgramEvaluationSystemRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/getProgramEvaluationSystemRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/getProgramTreeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/getProgramTreeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/getProgramTreeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/getUserProgramsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/getUserProgramsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/getUserProgramsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/haveProgramsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/haveProgramsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/haveProgramsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/listProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/listProgramRest.js new file mode 100644 index 0000000000..1c41d67513 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/listProgramRest.js @@ -0,0 +1,407 @@ +// automatic hash: 68469a0a48654bcdb7947087a8637f26cc104e0359d80c1e3a4a990be24d8613 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + data: { + type: 'object', + properties: { + items: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'color', + 'abbreviation', + 'maxGroupAbbreviationIsOnlyNumbers', + 'maxNumberOfCourses', + 'courseCredits', + 'hideCoursesInTree', + 'moreThanOneAcademicYear', + 'numberOfSubstages', + 'maxSubstageAbbreviationIsOnlyNumbers', + 'haveKnowledge', + 'treeType', + 'hideStudentsToStudents', + 'evaluationSystem', + 'isArchived', + 'hasSubjectTypes', + 'useCustomSubjectIds', + 'useAutoAssignment', + 'sequentialCourses', + 'isDeleted', + '__v', + 'imageUrl', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + color: { + type: 'string', + minLength: 1, + }, + abbreviation: { + type: 'string', + minLength: 1, + }, + credits: {}, + maxGroupAbbreviationIsOnlyNumbers: { + type: 'boolean', + }, + maxNumberOfCourses: { + type: 'number', + }, + courseCredits: { + type: 'number', + }, + hideCoursesInTree: { + type: 'boolean', + }, + moreThanOneAcademicYear: { + type: 'boolean', + }, + numberOfSubstages: { + type: 'number', + }, + maxSubstageAbbreviationIsOnlyNumbers: { + type: 'boolean', + }, + haveKnowledge: { + type: 'boolean', + }, + treeType: { + type: 'number', + }, + totalHours: {}, + hideStudentsToStudents: { + type: 'boolean', + }, + evaluationSystem: { + type: 'string', + minLength: 1, + }, + isArchived: { + type: 'boolean', + }, + hasSubjectTypes: { + type: 'boolean', + }, + useCustomSubjectIds: { + type: 'boolean', + }, + useAutoAssignment: { + type: 'boolean', + }, + sequentialCourses: { + type: 'boolean', + }, + hoursPerCredit: {}, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + image: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor'], + }, + duplicable: { + type: 'boolean', + }, + assignable: {}, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + 'duplicable', + 'downloadable', + 'tags', + 'pinned', + ], + }, + imageUrl: { + type: 'string', + minLength: 1, + }, + centers: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + }, + }, + count: { + type: 'number', + }, + totalCount: { + type: 'number', + }, + totalPages: { + type: 'number', + }, + page: { + type: 'number', + }, + size: { + type: 'number', + }, + nextPage: { + type: 'number', + }, + prevPage: { + type: 'number', + }, + canGoPrevPage: { + type: 'boolean', + }, + canGoNextPage: { + type: 'boolean', + }, + }, + required: [ + 'items', + 'count', + 'totalCount', + 'totalPages', + 'page', + 'size', + 'nextPage', + 'prevPage', + 'canGoPrevPage', + 'canGoNextPage', + ], + }, + }, + required: ['status', 'data'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/postProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/postProgramRest.js new file mode 100644 index 0000000000..2f41376523 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/postProgramRest.js @@ -0,0 +1,511 @@ +// automatic hash: 0649cedf463e53ca3a4109c969af86fe6f40a0f485e64251b3c09d877de27784 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + program: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + color: { + type: 'string', + minLength: 1, + }, + abbreviation: { + type: 'string', + minLength: 1, + }, + credits: {}, + maxGroupAbbreviationIsOnlyNumbers: { + type: 'boolean', + }, + maxNumberOfCourses: { + type: 'number', + }, + courseCredits: { + type: 'number', + }, + hideCoursesInTree: { + type: 'boolean', + }, + moreThanOneAcademicYear: { + type: 'boolean', + }, + numberOfSubstages: { + type: 'number', + }, + maxSubstageAbbreviationIsOnlyNumbers: { + type: 'boolean', + }, + haveKnowledge: { + type: 'boolean', + }, + treeType: { + type: 'number', + }, + totalHours: {}, + hideStudentsToStudents: { + type: 'boolean', + }, + evaluationSystem: { + type: 'string', + minLength: 1, + }, + isArchived: { + type: 'boolean', + }, + hasSubjectTypes: { + type: 'boolean', + }, + useCustomSubjectIds: { + type: 'boolean', + }, + useAutoAssignment: { + type: 'boolean', + }, + sequentialCourses: { + type: 'boolean', + }, + hoursPerCredit: {}, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + image: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor'], + }, + duplicable: { + type: 'boolean', + }, + assignable: {}, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + 'duplicable', + 'downloadable', + 'tags', + 'pinned', + ], + }, + imageUrl: { + type: 'string', + minLength: 1, + }, + hasKnowledgeAreas: { + type: 'boolean', + }, + treeTypeNodes: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + centers: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + groups: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + courses: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'index', + 'program', + 'type', + 'isAlone', + 'isDeleted', + '__v', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + index: { + type: 'number', + }, + program: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + metadata: { + type: 'object', + properties: { + minCredits: {}, + maxCredits: {}, + }, + required: [], + }, + isAlone: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + }, + }, + knowledgeAreas: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + subjects: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + subjectTypes: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + substages: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + customSubstages: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + cycles: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'color', + 'abbreviation', + 'maxGroupAbbreviationIsOnlyNumbers', + 'maxNumberOfCourses', + 'courseCredits', + 'hideCoursesInTree', + 'moreThanOneAcademicYear', + 'numberOfSubstages', + 'maxSubstageAbbreviationIsOnlyNumbers', + 'haveKnowledge', + 'treeType', + 'hideStudentsToStudents', + 'evaluationSystem', + 'isArchived', + 'hasSubjectTypes', + 'useCustomSubjectIds', + 'useAutoAssignment', + 'sequentialCourses', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'image', + 'imageUrl', + 'hasKnowledgeAreas', + 'treeTypeNodes', + 'centers', + 'groups', + 'courses', + 'knowledgeAreas', + 'subjects', + 'subjectTypes', + 'substages', + 'customSubstages', + 'cycles', + ], + }, + }, + required: ['status', 'program'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programCoursesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programCoursesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programCoursesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programGroupsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programGroupsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programGroupsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programHasCoursesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programHasCoursesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programHasCoursesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programHasGroupsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programHasGroupsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programHasGroupsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programHasSubstagesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programHasSubstagesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programHasSubstagesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programSubstagesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programSubstagesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/programSubstagesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/putProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/putProgramRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/programs/schemas/response/putProgramRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/enableMenuItemRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/enableMenuItemRest.js new file mode 100644 index 0000000000..7289cf3256 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/enableMenuItemRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/enableMenuItemRest'); +const { schema: xRequest } = require('./schemas/request/enableMenuItemRest'); + +const openapi = { + summary: 'Enables a specific menu item for the academic portfolio', + description: `This endpoint enables a particular menu item within the academic portfolio system. The toggle primarily targets administrative functionalities that are driven by the UI component configuration, allowing for modular activation or deactivation of features. + +**Authentication:** User must be authenticated to modify the menu item settings. An invalid or missing authentication token will prevent access to this endpoint. + +**Permissions:** The user requires administrative permissions specifically tailored for configuration or settings management within the academic portfolio. Without these permissions, the endpoint restricts execution of the command. + +The endpoint workflow involves calling the \`enableMenuItem\` method which is part of the \`SettingsService\`. Once invoked, the method receives an identifier for the menu item and toggles its state to enabled. This process modifies the system's configuration, reflecting changes immediately across user interfaces that depend on these menu settings. The comprehensive handling ensures that only authorized users can alter the state of user interface components, maintaining system integrity and user-specific customization.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/findOneRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/findOneRest.js new file mode 100644 index 0000000000..bdca092ff7 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/findOneRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/findOneRest'); +const { schema: xRequest } = require('./schemas/request/findOneRest'); + +const openapi = { + summary: 'Fetch specific academic portfolio settings', + description: `This endpoint retrieves specific settings related to the academic portfolio of a user based on provided criteria. The settings might include configurations related to the user's academic performance, preferences, or system settings unique to the academic portfolio platform. + +**Authentication:** User authentication is necessary to ensure that access is granted to only those who own or are granted permission to manage particular academic portfolio settings. + +**Permissions:** Access to this endpoint requires specific permissions related to academic portfolio management. Users must have the appropriate role or permission set that allows interaction with academic portfolio settings. + +Upon receiving a request, this handler initiates by calling the \`findOneRest\` action, which is designed to fetch particular academic portfolio settings based on the context and parameters provided. Internally, \`findOneRest\` interacts with the 'settings' module by leveraging the \`findOne.js\` service. This service executes a detailed query to locate and retrieve the specified settings from the database. The flow involves authenticating the user, verifying permissions, constructing the query from the request parameters, executing the query, and then finally formatting and returning the results as a JSON object in the response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/getProfilesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/getProfilesRest.js new file mode 100644 index 0000000000..7d15d6cfcf --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/getProfilesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getProfilesRest'); +const { schema: xRequest } = require('./schemas/request/getProfilesRest'); + +const openapi = { + summary: 'Fetch academic profiles based on user access', + description: `This endpoint fetches academic profiles from the academic portfolio system, tailored according to the access rights and roles of the requesting user. It aims to provide a personalized view of academic credentials, courses, and achievements stored within the system. + +**Authentication:** User authentication is mandatory for accessing this endpoint. Access will be denied if authentication credentials are not provided or are invalid. + +**Permissions:** The user needs to have 'view_profiles' permission to retrieve academic profiles. Without this permission, the server will return an unauthorized access error. + +Upon receiving a request, the \`getProfilesRest\` handler initiates the process by verifying user authentication and permissions. If verification is successful, it calls the \`getProfiles\` method from the \`Settings\` core module. This method queries the database for academic profiles that align with the user's roles and permissions, ensuring that each user only accesses information they are authorized to view. The resulting profiles are then formatted and returned as a JSON response, providing a comprehensive yet secure overview of academic data relevant to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/isProfilesConfigRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/isProfilesConfigRest.js new file mode 100644 index 0000000000..f6fc7f4536 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/isProfilesConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/isProfilesConfigRest'); +const { schema: xRequest } = require('./schemas/request/isProfilesConfigRest'); + +const openapi = { + summary: 'Check if user profile settings are configured', + description: `This endpoint examines the system's configuration to determine if the profile settings for a user have been correctly set up and configured. It primarily checks the presence and validity of certain user-specific configurations which are essential for further operations and access within the academic portfolio plugin. + +**Authentication:** Users need to be authenticated to check their profile configuration status. Any request without a valid session or authentication token will be rejected. + +**Permissions:** This action requires administrator-level permissions, as it involves accessing sensitive configuration data that could influence the accessibility and functionality of user profiles across the platform. + +Upon receiving a request, the handler initiates by calling the \`isProfilesConfig\` method from the Settings core. This method assesses whether the user profiles have all necessary configurations set based on predefined criteria stored within the system. It checks various configuration parameters and ensures they align with the required standards for a proper operational environment. The method returns a boolean indicating the existence and correctness of these configurations. The response communicated back to the client provides clear information on the configuration status, facilitating further user or admin actions based on the outcome.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/enableMenuItemRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/enableMenuItemRest.js new file mode 100644 index 0000000000..311312fe93 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/enableMenuItemRest.js @@ -0,0 +1,15 @@ +// automatic hash: 247f5021097d6f19bbeee0406b158b5ecbbeb2670b6155ddb898fe80351e57d2 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + key: { + type: 'string', + minLength: 1, + }, + }, + required: ['key'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/findOneRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/findOneRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/findOneRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/getProfilesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/getProfilesRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/getProfilesRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/isProfilesConfigRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/isProfilesConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/isProfilesConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/setProfilesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/setProfilesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/setProfilesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/updateRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/enableMenuItemRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/enableMenuItemRest.js new file mode 100644 index 0000000000..70d26e658c --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/enableMenuItemRest.js @@ -0,0 +1,15 @@ +// automatic hash: b2b8585d23a650b6d5e1b23da1186698d3b6fdb56bd60476d35096313d856257 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + item: {}, + }, + required: ['status'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/findOneRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/findOneRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/findOneRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/getProfilesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/getProfilesRest.js new file mode 100644 index 0000000000..fd29d51c23 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/getProfilesRest.js @@ -0,0 +1,28 @@ +// automatic hash: 0188bfd7555f27da9855921f5297ed2872fc875fbccb35f196f2f5ee3e1025fe +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + profiles: { + type: 'object', + properties: { + teacher: { + type: 'string', + minLength: 1, + }, + student: { + type: 'string', + minLength: 1, + }, + }, + required: ['teacher', 'student'], + }, + }, + required: ['status', 'profiles'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/isProfilesConfigRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/isProfilesConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/isProfilesConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/setProfilesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/setProfilesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/setProfilesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/updateRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/setProfilesRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/setProfilesRest.js new file mode 100644 index 0000000000..2adccb65d4 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/setProfilesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/setProfilesRest'); +const { schema: xRequest } = require('./schemas/request/setProfilesRest'); + +const openapi = { + summary: 'Set user academic profiles', + description: `This endpoint sets or updates the academic profiles for a specific user. It primarily handles profile creation and modification activities within the user's academic portfolio. + +**Authentication:** User authentication is required to access and modify academic profiles. Authentication is validated via user tokens, and any operations without proper authentication will be rejected. + +**Permissions:** The user needs to have the 'edit_academic_profile' permission to modify profiles. Lack of sufficient permissions will prevent the user from performing updates on academic profiles. + +The flow of the endpoint begins with the validation of user authentication and permissions. Upon successful validation, the \`setProfiles\` method from the \`Settings\` core module is invoked. This method takes the input payload containing profile data and processes updates or creations based on the supplied details. If the operation is successful, the method returns an acknowledgment of the changes. The entire process ensures that only authorized and authenticated users can alter academic profiles, maintaining data integrity and security within the system.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/updateRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/updateRest.js new file mode 100644 index 0000000000..a2219aec6c --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/settings/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Update academic portfolio settings', + description: `This endpoint updates the academic portfolio settings based on the provided input values. The operation typically includes changing parameters such as grading schemas, assessment standards, and visibility permissions among other configurable settings of the academic portfolio module. + +**Authentication:** User authentication is mandatory for accessing this endpoint. Users attempting to update settings without proper authentication credentials will be denied access. + +**Permissions:** Users need to have specific administrative permissions related to academic portfolio management. These permissions ensure that only authorized personnel can make changes to the settings. + +The endpoint leverages the \`updateSettings\` method defined in the \`settings\` core module. The flow begins when the request data is received and validated against predefined schemas to ensure all required fields are present and correctly formatted. Upon successful validation, the \`updateSettings\` method is called with the relevant data. This method primarily handles the interaction with the database to update the existing settings record. If the update is successful, a confirmation is sent back to the client. If there is an error during the update, such as a database write failure, the error details are captured and an appropriate response is returned to the client, indicating the failure of the update operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/deleteSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/deleteSubjectTypeRest.js new file mode 100644 index 0000000000..2730183e0d --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/deleteSubjectTypeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteSubjectTypeRest'); +const { schema: xRequest } = require('./schemas/request/deleteSubjectTypeRest'); + +const openapi = { + summary: 'Remove a specific subject type from the academic portfolio', + description: `This endpoint removes a subject type from the academic portfolio system based on a provided identifier. The action ensures that all dependencies or related data are handled according to defined business rules prior to deletion, preventing any orphan records or inconsistent data states. + +**Authentication:** Users must be authenticated to perform this operation. Access to this endpoint will be denied if proper authentication credentials are not provided. + +**Permissions:** This endpoint requires administrative privileges or specific permissions related to academic structure management. Users without sufficient permissions will receive an error response indicating insufficient permissions. + +The delete process initiates by verifying user permissions and authentication. Once authorized, the \`removeSubjectType\` method from the core \`subject-type\` module is called with the subject type's unique identifier. This method checks for any dependencies or related entities that might be impacted by the deletion of the subject type. Upon successful validation of all conditions, the subject type is removed from the database, and a confirmation message is returned to the user. If any issues arise during the process, appropriate error messages are generated and sent back in the response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/listSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/listSubjectTypeRest.js new file mode 100644 index 0000000000..e44f7d3bf6 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/listSubjectTypeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listSubjectTypeRest'); +const { schema: xRequest } = require('./schemas/request/listSubjectTypeRest'); + +const openapi = { + summary: 'Lists all subject types available in the academic portfolio', + description: `This endpoint provides a comprehensive listing of all subject types defined in the academic portfolio management system. It is primarily used to retrieve and display a catalog of subject types for academic planning and management purposes. + +**Authentication:** User authentication is required to access the list of subject types. Users must be logged in with valid credentials to make requests to this endpoint. + +**Permissions:** Users need specific permissions to view the list of subject types. Typically, administrative access or permissions related to academic management are necessary to access this data. + +The endpoint starts by invoking the \`listSubjectType\` method from the 'subject-type' core module. This method carries out a query to the system's database to fetch all existing subject type entries stored in the data model dedicated to academic structures. The result of this method is an array of subject type objects, each containing essential data such as type name, description, and applicable metadata. This array is then passed back through the Moleculer service to the client as a JSON response, giving a clear view of all available subject types that can be utilized for academic organization within the platform.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/postSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/postSubjectTypeRest.js new file mode 100644 index 0000000000..cedf83d7df --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/postSubjectTypeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postSubjectTypeRest'); +const { schema: xRequest } = require('./schemas/request/postSubjectTypeRest'); + +const openapi = { + summary: 'Adds a new subject type to the academic portfolio', + description: `This endpoint allows for the creation of a new subject type within the academic portfolio system. A subject type might categorize subjects into various academic disciplines or types, such as mathematics, science, arts, etc. + +**Authentication:** Users need to be authenticated to create a new subject type. The action will validate user credentials before processing the request. + +**Permissions:** Only users with administrational privileges over the academic portfolio are allowed to add new subject types, ensuring that only authorized personnel can make these alterations. + +Upon receiving a request, the \`postSubjectType\` action in the \`subjectType.rest.js\` file is triggered. This action internally calls the \`addSubjectType\` method from the \`subject-type\` core module. This method, after validating the input parameters, proceeds to insert the new subject type into the system's database. Once the database operation is successful, a confirmation response is returned to the client, indicating the successful creation of the new subject type.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/putSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/putSubjectTypeRest.js new file mode 100644 index 0000000000..687d6d0e6a --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/putSubjectTypeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putSubjectTypeRest'); +const { schema: xRequest } = require('./schemas/request/putSubjectTypeRest'); + +const openapi = { + summary: 'Updates a subject type', + description: `This endpoint is responsible for updating the details of an existing subject type in the academic portfolio system. It allows modifications to attributes like name, description, or any other subject type-specific details as defined in the system. + +**Authentication:** Users must be authenticated to update subject types. Access without proper authentication will prevent the request from proceeding. + +**Permissions:** Usage of this endpoint requires administrative permissions related to academic management or specific permissions granted to manage and edit subject types. + +The process starts in the \`putSubjectTypeRest\` handler which gathers the input data, primarily consisting of changes to be applied to an existing subject type. This data is then passed to a service method named \`updateSubjectType\`, located in the \`subject-type\` core module. This method handles the detailed logic to verify existing data, apply the updates, and save the changes in the database. It ensures that all updates adhere to predefined schemas and business rules, returning the updated subject data or an error message if the update fails.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/request/deleteSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/request/deleteSubjectTypeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/request/deleteSubjectTypeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/request/listSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/request/listSubjectTypeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/request/listSubjectTypeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/request/postSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/request/postSubjectTypeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/request/postSubjectTypeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/request/putSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/request/putSubjectTypeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/request/putSubjectTypeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/response/deleteSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/response/deleteSubjectTypeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/response/deleteSubjectTypeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/response/listSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/response/listSubjectTypeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/response/listSubjectTypeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/response/postSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/response/postSubjectTypeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/response/postSubjectTypeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/response/putSubjectTypeRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/response/putSubjectTypeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjectType/schemas/response/putSubjectTypeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/deleteSubjectRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/deleteSubjectRest.js new file mode 100644 index 0000000000..44f545873e --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/deleteSubjectRest.js @@ -0,0 +1,30 @@ +const { schema } = require('./schemas/response/deleteSubjectRest'); +const { schema: xRequest } = require('./schemas/request/deleteSubjectRest'); + +const openapi = { + summary: + 'Delete a subject and its associated classes from the academic portfolio', + description: `This endpoint allows for the deletion of a subject and all its associated classes within the academic portfolio system. It ensures the removal of the subject record and any linked class records from the database, maintaining data integrity and consistency. + +**Authentication:** Users need to be authenticated to perform deletions. Only requests with valid authentication tokens will be processed. + +**Permissions:** This endpoint requires administrative permissions related to subject and class management. Users must have the 'manage_subjects' and 'manage_classes' permissions to execute this action. + +The process begins with the validation of the subject's ID provided in the request. The handler then invokes the \`deleteSubjectWithClasses\` method of the \`subjects\` core, which internally calls \`removeClassesByIds\` for any classes linked to the subject. This ensures all data related to the subject, including the classes, is eliminated properly. Following successful deletion, the method updates any affected relational entities and returns a confirmation of the deletion. The response includes a status message indicating the successful removal of the subject and its classes.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/getSubjectCreditsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/getSubjectCreditsRest.js new file mode 100644 index 0000000000..bec6fd6f99 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/getSubjectCreditsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getSubjectCreditsRest'); +const { schema: xRequest } = require('./schemas/request/getSubjectCreditsRest'); + +const openapi = { + summary: 'Calculates and retrieves credits for a given subject', + description: `This endpoint is designed to calculate and provide the total number of credits attributed to a specific academic subject. The calculation considers various factors including the academic level, subject requirements, and any special considerations within the academic institution's guidelines. + +**Authentication:** Users need to be authenticated to access this endpoint. Without proper authentication, the endpoint will reject the request, ensuring that only authorized personnel can access sensitive academic information. + +**Permissions:** This endpoint requires the user to have 'view_academic_credits' permission. Users without this permission will not be able to retrieve credit information, ensuring that access is restricted based on user roles within the educational institution. + +Upon receiving a request, the \`getSubjectCreditsRest\` handler in the \`subject.rest.js\` first validates the input parameters to ensure they match the expected format and values. It then calls the \`getSubjectCredits\` method from the \`subjects\` core module. This method performs the necessary calculations and database queries to determine the credit value associated with the subject. The calculated credits are then prepared and returned in the response body as JSON data, providing a clear and concise representation of the subject's credit value.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/listSubjectCreditsForProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/listSubjectCreditsForProgramRest.js new file mode 100644 index 0000000000..70b9f94a41 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/listSubjectCreditsForProgramRest.js @@ -0,0 +1,33 @@ +const { + schema, +} = require('./schemas/response/listSubjectCreditsForProgramRest'); +const { + schema: xRequest, +} = require('./schemas/request/listSubjectCreditsForProgramRest'); + +const openapi = { + summary: 'List subject credits for a specific academic program', + description: `This endpoint lists all subject credits associated with a particular academic program. It is designed to help users understand the credit requirements and the distribution of credits across different subjects within the specified program. + +**Authentication:** Users need to be authenticated to access the information about subject credits. Authentication ensures that only authorized users can view sensitive academic program details. + +**Permissions:** Users must have the appropriate permissions related to academic management or specific program oversight to access this endpoint. Permissions are checked to verify that the user has adequate rights to view academic program credit distributions. + +The process begins by the endpoint receiving a request which includes identifiers for the specific academic program. The handler, \`listSubjectCreditsForProgramRest\`, calls the \`listSubjectCreditsForProgram\` method in the \`subjects\` core module. This method consults the database to retrieve detailed information on all subjects and their associated credits for the given program. The data is then formatted and returned to the user as a structured JSON response, providing a clear breakdown of credits by subject within the program.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/listSubjectRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/listSubjectRest.js new file mode 100644 index 0000000000..fe8c467df2 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/listSubjectRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listSubjectRest'); +const { schema: xRequest } = require('./schemas/request/listSubjectRest'); + +const openapi = { + summary: 'List all subjects related to a specific academic portfolio', + description: `This endpoint lists all subjects associated with a specific academic portfolio based on provided criteria such as program and term. It primarily serves educational staff and students by providing an overview of subjects they might be interested in or are already enrolled in. + +**Authentication:** Users need to be authenticated to retrieve subject details. Access to the endpoint is restricted based on user's session validation. + +**Permissions:** This endpoint requires that the user has the 'view_subjects' permission within their role. Users without sufficient permissions will be denied access to the subject list. + +The process begins when the endpoint 'listSubjects' is invoked from the subject REST service. This calls the 'listSubjects' method in the backend's core subject module, which in turn might interact with a database to retrieve relevant subject information based on the input parameters such as academic program and term identifiers. The method consolidates the data, applying any necessary filters such as checking permissions or roles of the user, before sending back a list of subjects. Each subject is represented as an object within an array, providing a comprehensive overview needed by the frontend for display or further processing.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/postSubjectRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/postSubjectRest.js new file mode 100644 index 0000000000..057cc08077 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/postSubjectRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postSubjectRest'); +const { schema: xRequest } = require('./schemas/request/postSubjectRest'); + +const openapi = { + summary: 'Add new subject to academic portfolio', + description: `This endpoint is designed to add a new subject to a user's academic portfolio within the Leemonade platform, ensuring that all necessary academic details are accurately recorded. + +**Authentication:** Users need to be authenticated to access this endpoint, as it involves sensitive user-specific academic data. + +**Permissions:** This endpoint requires that the user has \`academic-write\` permission to allow the addition of academic records. + +Upon receiving the API call, the \`postSubjectRest\` handler orchestrates several functions to ensure the subject is correctly added to the database. Initially, it calls \`addSubject\` from the \`subjects\` core module, which is responsible for validating the input data and then inserting the subject details into the database. After the subject is added, the handler may invoke \`setSubjectCredits\` and \`setSubjectInternalId\` for further configuration specific to the academic institution's requirements. The entire process ensures data integrity and adherence to the academic module's rules before responding to the client with a successful operation acknowledgment.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/putSubjectCreditsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/putSubjectCreditsRest.js new file mode 100644 index 0000000000..2218c60763 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/putSubjectCreditsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putSubjectCreditsRest'); +const { schema: xRequest } = require('./schemas/request/putSubjectCreditsRest'); + +const openapi = { + summary: 'Updates the credit value for a specified subject', + description: `This endpoint updates the credit value for a subject within the academic portfolio. The modification pertains to how many credits a particular subject is worth in the academic curriculum, reflecting changes directly into the academic records and related calculations for student progress and curriculum planning. + +**Authentication:** Users need to be authenticated to update subject credits. The system will check for a valid session or api token before processing the request. + +**Permissions:** This endpoint requires administrative permissions related to academic management. Only users with the role of 'Academic Administrator' or similar permissions can update subject credits. + +Upon receiving a request, the handler first validates the incoming data against predefined schemas to ensure the subject identifier and new credit values are correctly formatted. It then calls the \`setSubjectCredits\` method from the \`subjects\` core module, which updates the credit value in the persistent storage (usually a database). This method logs the change transaction for auditing purposes. The process is designed to handle errors smoothly, returning meaningful error messages if the update cannot be completed, ensuring the client understands why the request failed. The successful update results in a confirmation message to the user, indicating the credits have been successfully updated.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/putSubjectRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/putSubjectRest.js new file mode 100644 index 0000000000..3ce2cba999 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/putSubjectRest.js @@ -0,0 +1,30 @@ +const { schema } = require('./schemas/response/putSubjectRest'); +const { schema: xRequest } = require('./schemas/request/putSubjectRest'); + +const openapi = { + summary: + 'Updates specific details of a subject within the academic portfolio', + description: `This endpoint allows for the modification of specific details related to a subject in the academic manager’s portfolio. It primarily facilitates updates to fields such as subject name, credit values, and internal identifiers within the context of an educational institution's system. + +**Authentication:** User authentication is mandatory to access this endpoint. Requests without valid authentication will be rejected. + +**Permissions:** This endpoint requires the user to have 'edit_subject' permissions within their role to update subject details. Unauthorized access attempts will lead to a denial of service. + +The process begins by validating the provided JSON payload against the defined schema to ensure all required fields are present and properly formatted. It then calls the \`updateSubject\` method located in the 'subjects' core, which handles the updating of subject details in the database. This method uses both the subject ID and details from the request payload to apply updates. On successful update, a confirmation response is sent back to the client, otherwise, appropriate error messages are generated and returned based on the issue encountered during the update.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/deleteSubjectRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/deleteSubjectRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/deleteSubjectRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/getSubjectCreditsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/getSubjectCreditsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/getSubjectCreditsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/listSubjectCreditsForProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/listSubjectCreditsForProgramRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/listSubjectCreditsForProgramRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/listSubjectRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/listSubjectRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/listSubjectRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/postSubjectRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/postSubjectRest.js new file mode 100644 index 0000000000..59c173fea4 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/postSubjectRest.js @@ -0,0 +1,47 @@ +// automatic hash: 0ae522a04f2aafc8dda045f3d7414bf99fd3ea1db4bc66db8a12fe6db0c9ebba +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + name: { + type: 'string', + minLength: 1, + }, + course: {}, + internalId: { + type: 'string', + minLength: 1, + }, + program: { + type: 'string', + minLength: 1, + }, + credits: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + image: { + type: 'string', + minLength: 1, + }, + icon: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'name', + 'internalId', + 'program', + 'credits', + 'color', + 'image', + 'icon', + ], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/putSubjectCreditsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/putSubjectCreditsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/putSubjectCreditsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/putSubjectRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/putSubjectRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/putSubjectRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/subjectsByIdsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/subjectsByIdsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/request/subjectsByIdsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/deleteSubjectRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/deleteSubjectRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/deleteSubjectRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/getSubjectCreditsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/getSubjectCreditsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/getSubjectCreditsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/listSubjectCreditsForProgramRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/listSubjectCreditsForProgramRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/listSubjectCreditsForProgramRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/listSubjectRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/listSubjectRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/listSubjectRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/postSubjectRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/postSubjectRest.js new file mode 100644 index 0000000000..af51af063d --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/postSubjectRest.js @@ -0,0 +1,90 @@ +// automatic hash: 54ef9778f739050c5f4f59dbd62c8244a359e90a9cbb33561e8914d352717869 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + subject: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + program: { + type: 'string', + minLength: 1, + }, + course: { + type: 'string', + minLength: 1, + }, + color: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + icon: { + type: 'string', + minLength: 1, + }, + image: { + type: 'string', + minLength: 1, + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'program', + 'course', + 'color', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'icon', + 'image', + ], + }, + }, + required: ['status', 'subject'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/putSubjectCreditsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/putSubjectCreditsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/putSubjectCreditsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/putSubjectRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/putSubjectRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/putSubjectRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/subjectsByIdsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/subjectsByIdsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/schemas/response/subjectsByIdsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/subjectsByIdsRest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/subjectsByIdsRest.js new file mode 100644 index 0000000000..3966454039 --- /dev/null +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/openapi/subjects/subjectsByIdsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/subjectsByIdsRest'); +const { schema: xRequest } = require('./schemas/request/subjectsByIdsRest'); + +const openapi = { + summary: 'Retrieve subjects based on a list of given IDs', + description: `This endpoint retrieves detailed information about subjects identified by a list of unique IDs. The data returned typically includes details such as the subject name, category, credits, and associated instructors or departments. + +**Authentication:** Access to this endpoint requires the user to be authenticated. An authentication token must be provided, and it's verified to ensure validity before proceeding with data retrieval. + +**Permissions:** The user needs specific permissions related to academic data access. Typically, this includes permissions like 'view_subjects' or 'academic_portfolio_access'. Users without the necessary permissions will receive an access denied message. + +Upon receiving the request, the \`subjectsByIdsRest\` handler initially validates the presence and formatting of the subject IDs in the request. It then calls the \`subjectByIds\` method located in the \`subjects\` core module. This method is responsible for querying the database for the specified subject IDs, aggregating the required details, and performing any necessary data transformations to conform to the expected response structure. Finally, the handler returns the subject data as a JSON object in the response body, formatted according to the endpoint's specification.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js index f7298f49ce..c4aae4b781 100644 --- a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/programs.rest.js @@ -32,9 +32,27 @@ const { getAcademicTree, } = require('../../core/programs'); +const getProgramTreeRest = require('./openapi/programs/getProgramTreeRest'); +const haveProgramsRest = require('./openapi/programs/haveProgramsRest'); +const postProgramRest = require('./openapi/programs/postProgramRest'); +const putProgramRest = require('./openapi/programs/putProgramRest'); +const listProgramRest = require('./openapi/programs/listProgramRest'); +const detailProgramRest = require('./openapi/programs/detailProgramRest'); +const programHasCoursesRest = require('./openapi/programs/programHasCoursesRest'); +const programHasGroupsRest = require('./openapi/programs/programHasGroupsRest'); +const programHasSubstagesRest = require('./openapi/programs/programHasSubstagesRest'); +const programCoursesRest = require('./openapi/programs/programCoursesRest'); +const programGroupsRest = require('./openapi/programs/programGroupsRest'); +const programSubstagesRest = require('./openapi/programs/programSubstagesRest'); +const deleteProgramRest = require('./openapi/programs/deleteProgramRest'); +const duplicateProgramRest = require('./openapi/programs/duplicateProgramRest'); +const addStudentsToClassesUnderNodeTreeRest = require('./openapi/programs/addStudentsToClassesUnderNodeTreeRest'); +const getUserProgramsRest = require('./openapi/programs/getUserProgramsRest'); +const getProgramEvaluationSystemRest = require('./openapi/programs/getProgramEvaluationSystemRest'); /** @type {ServiceSchema} */ module.exports = { getProgramTreeRest: { + openapi: getProgramTreeRest.openapi, rest: { path: '/:id/tree', method: 'GET', @@ -55,6 +73,7 @@ module.exports = { }, }, haveProgramsRest: { + openapi: haveProgramsRest.openapi, rest: { path: '/have', method: 'GET', @@ -75,6 +94,7 @@ module.exports = { }, }, postProgramRest: { + openapi: postProgramRest.openapi, rest: { path: '/', method: 'POST', @@ -99,6 +119,7 @@ module.exports = { }, }, putProgramRest: { + openapi: putProgramRest.openapi, rest: { path: '/', method: 'PUT', @@ -134,11 +155,15 @@ module.exports = { }), ], async handler(ctx) { - const program = await updateProgramConfiguration({ data: ctx.params, ctx }); + const program = await updateProgramConfiguration({ + data: ctx.params, + ctx, + }); return { status: 200, program }; }, }, listProgramRest: { + openapi: listProgramRest.openapi, rest: { path: '/', method: 'GET', @@ -178,6 +203,7 @@ module.exports = { }, }, detailProgramRest: { + openapi: detailProgramRest.openapi, rest: { path: '/:id', method: 'GET', @@ -196,7 +222,9 @@ module.exports = { const truthyValues = ['true', true, '1']; const _withClasses = truthyValues.includes(ctx.params.withClasses); const _showArchived = truthyValues.includes(ctx.params.showArchived); - const _withStudentsAndTeachers = truthyValues.includes(ctx.params.withStudentsAndTeachers); + const _withStudentsAndTeachers = truthyValues.includes( + ctx.params.withStudentsAndTeachers + ); const [program] = await programsByIds({ ids: ctx.params.id, @@ -205,7 +233,8 @@ module.exports = { withStudentsAndTeachers: _withStudentsAndTeachers, ctx, }); - if (!program) throw new LeemonsError(ctx, { message: 'Program not found' }); + if (!program) + throw new LeemonsError(ctx, { message: 'Program not found' }); return { status: 200, program }; }, }, @@ -233,6 +262,7 @@ module.exports = { }, }, programHasCoursesRest: { + openapi: programHasCoursesRest.openapi, rest: { path: '/:id/has/courses', method: 'GET', @@ -253,6 +283,7 @@ module.exports = { }, }, programHasGroupsRest: { + openapi: programHasGroupsRest.openapi, rest: { path: '/:id/has/groups', method: 'GET', @@ -273,6 +304,7 @@ module.exports = { }, }, programHasSubstagesRest: { + openapi: programHasSubstagesRest.openapi, rest: { path: '/:id/has/substages', method: 'GET', @@ -293,6 +325,7 @@ module.exports = { }, }, programCoursesRest: { + openapi: programCoursesRest.openapi, rest: { path: '/:id/courses', method: 'GET', @@ -313,6 +346,7 @@ module.exports = { }, }, programGroupsRest: { + openapi: programGroupsRest.openapi, rest: { path: '/:id/groups', method: 'GET', @@ -333,6 +367,7 @@ module.exports = { }, }, programSubstagesRest: { + openapi: programSubstagesRest.openapi, rest: { path: '/:id/substages', method: 'GET', @@ -368,15 +403,23 @@ module.exports = { }), ], async handler(ctx) { - const program = await programsByIds({ ids: ctx.params.id, showArchived: true, ctx }); + const program = await programsByIds({ + ids: ctx.params.id, + showArchived: true, + ctx, + }); if (program?.length) { const { subjects } = program[0]; return { status: 200, data: subjects?.length > 0 }; } - throw new LeemonsError(ctx, { message: 'Program not found', httpStatusCode: 404 }); + throw new LeemonsError(ctx, { + message: 'Program not found', + httpStatusCode: 404, + }); }, }, deleteProgramRest: { + openapi: deleteProgramRest.openapi, rest: { path: '/:id', method: 'DELETE', @@ -401,6 +444,7 @@ module.exports = { }, }, duplicateProgramRest: { + openapi: duplicateProgramRest.openapi, rest: { path: '/:id/duplicate', method: 'POST', @@ -425,6 +469,7 @@ module.exports = { }, }, addStudentsToClassesUnderNodeTreeRest: { + openapi: addStudentsToClassesUnderNodeTreeRest.openapi, rest: { path: '/add-students-to-classes-under-node-tree', method: 'POST', @@ -448,6 +493,7 @@ module.exports = { }, }, getUserProgramsRest: { + openapi: getUserProgramsRest.openapi, rest: { path: '/user', method: 'GET', @@ -459,13 +505,17 @@ module.exports = { }, }, getProgramEvaluationSystemRest: { + openapi: getProgramEvaluationSystemRest.openapi, rest: { path: '/:id/evaluation-system', method: 'GET', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const evaluationSystem = await getProgramEvaluationSystem({ id: ctx.params.id, ctx }); + const evaluationSystem = await getProgramEvaluationSystem({ + id: ctx.params.id, + ctx, + }); return { status: 200, evaluationSystem }; }, }, diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/settings.rest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/settings.rest.js index 6cabc87675..8cf4e01134 100644 --- a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/settings.rest.js +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/settings.rest.js @@ -18,9 +18,16 @@ const { } = require('../../core/settings'); const settingsSchema = require('../../models/settings'); +const getProfilesRest = require('./openapi/settings/getProfilesRest'); +const setProfilesRest = require('./openapi/settings/setProfilesRest'); +const isProfilesConfigRest = require('./openapi/settings/isProfilesConfigRest'); +const findOneRest = require('./openapi/settings/findOneRest'); +const updateRest = require('./openapi/settings/updateRest'); +const enableMenuItemRest = require('./openapi/settings/enableMenuItemRest'); /** @type {ServiceSchema} */ module.exports = { getProfilesRest: { + openapi: getProfilesRest.openapi, rest: { path: '/profiles', method: 'GET', @@ -32,6 +39,7 @@ module.exports = { }, }, setProfilesRest: { + openapi: setProfilesRest.openapi, rest: { path: '/profiles', method: 'PUT', @@ -52,6 +60,7 @@ module.exports = { }, }, isProfilesConfigRest: { + openapi: isProfilesConfigRest.openapi, rest: { path: '/profiles/is-config', method: 'GET', @@ -72,6 +81,7 @@ module.exports = { }, }, findOneRest: { + openapi: findOneRest.openapi, rest: { path: '/', method: 'GET', @@ -92,6 +102,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { path: '/', method: 'POST', @@ -122,6 +133,7 @@ module.exports = { }, // TODO Verificar que esto se va a usar enableMenuItemRest: { + openapi: enableMenuItemRest.openapi, rest: { path: '/enable-menu-item', method: 'POST', diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js index 39ccee3783..2ad4c8fcdf 100644 --- a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subject.rest.js @@ -28,12 +28,25 @@ const { listSubjects, subjectByIds, } = require('../../core/subjects'); -const { duplicateSubjectByIds } = require('../../core/subjects/duplicateSubjectByIds'); -const { duplicateClassesByIds } = require('../../core/classes/duplicateClassesByIds'); +const { + duplicateSubjectByIds, +} = require('../../core/subjects/duplicateSubjectByIds'); +const { + duplicateClassesByIds, +} = require('../../core/classes/duplicateClassesByIds'); +const postSubjectRest = require('./openapi/subjects/postSubjectRest'); +const putSubjectRest = require('./openapi/subjects/putSubjectRest'); +const deleteSubjectRest = require('./openapi/subjects/deleteSubjectRest'); +const putSubjectCreditsRest = require('./openapi/subjects/putSubjectCreditsRest'); +const getSubjectCreditsRest = require('./openapi/subjects/getSubjectCreditsRest'); +const listSubjectCreditsForProgramRest = require('./openapi/subjects/listSubjectCreditsForProgramRest'); +const listSubjectRest = require('./openapi/subjects/listSubjectRest'); +const subjectsByIdsRest = require('./openapi/subjects/subjectsByIdsRest'); /** @type {ServiceSchema} */ module.exports = { postSubjectRest: { + openapi: postSubjectRest.openapi, rest: { path: '/subject', method: 'POST', @@ -54,6 +67,7 @@ module.exports = { }, }, putSubjectRest: { + openapi: putSubjectRest.openapi, rest: { path: '/subject', method: 'PUT', @@ -74,6 +88,7 @@ module.exports = { }, }, deleteSubjectRest: { + openapi: deleteSubjectRest.openapi, rest: { path: '/:id', method: 'DELETE', @@ -96,6 +111,7 @@ module.exports = { }, }, putSubjectCreditsRest: { + openapi: putSubjectCreditsRest.openapi, rest: { path: '/credits', method: 'PUT', @@ -113,11 +129,17 @@ module.exports = { async handler(ctx) { validatePutSubjectCredits(ctx.params); const { subject, program, credits } = ctx.params; - const subjectCredits = await setSubjectCredits({ subject, program, credits, ctx }); + const subjectCredits = await setSubjectCredits({ + subject, + program, + credits, + ctx, + }); return { status: 200, subjectCredits }; }, }, getSubjectCreditsRest: { + openapi: getSubjectCreditsRest.openapi, rest: { path: '/credits', method: 'GET', @@ -138,6 +160,7 @@ module.exports = { }, }, listSubjectCreditsForProgramRest: { + openapi: listSubjectCreditsForProgramRest.openapi, rest: { path: '/credits/list', method: 'GET', @@ -155,11 +178,15 @@ module.exports = { async handler(ctx) { validateGetSubjectCreditsProgram(ctx.params); const { program } = ctx.params; - const subjectCredits = await listSubjectCreditsForProgram({ program, ctx }); + const subjectCredits = await listSubjectCreditsForProgram({ + program, + ctx, + }); return { status: 200, subjectCredits }; }, }, listSubjectRest: { + openapi: listSubjectRest.openapi, rest: { path: '/subject', method: 'GET', @@ -227,6 +254,7 @@ module.exports = { // }, // }, subjectsByIdsRest: { + openapi: subjectsByIdsRest.openapi, rest: { path: '/', method: 'GET', diff --git a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subjectType.rest.js b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subjectType.rest.js index 97619a1924..fedd4dc46a 100644 --- a/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subjectType.rest.js +++ b/plugins/leemons-plugin-academic-portfolio/backend/services/rest/subjectType.rest.js @@ -18,9 +18,14 @@ const { } = require('../../core/subject-type'); const { permissions } = require('../../config/constants'); +const postSubjectTypeRest = require('./openapi/subjectType/postSubjectTypeRest'); +const putSubjectTypeRest = require('./openapi/subjectType/putSubjectTypeRest'); +const listSubjectTypeRest = require('./openapi/subjectType/listSubjectTypeRest'); +const deleteSubjectTypeRest = require('./openapi/subjectType/deleteSubjectTypeRest'); /** @type {ServiceSchema} */ module.exports = { postSubjectTypeRest: { + openapi: postSubjectTypeRest.openapi, rest: { path: '/', method: 'POST', @@ -41,6 +46,7 @@ module.exports = { }, }, putSubjectTypeRest: { + openapi: putSubjectTypeRest.openapi, rest: { path: '/', method: 'PUT', @@ -61,6 +67,7 @@ module.exports = { }, }, listSubjectTypeRest: { + openapi: listSubjectTypeRest.openapi, rest: { path: '/', method: 'GET', @@ -100,6 +107,7 @@ module.exports = { }, }, deleteSubjectTypeRest: { + openapi: deleteSubjectTypeRest.openapi, rest: { path: '/:id', method: 'DELETE', diff --git a/plugins/leemons-plugin-admin/backend/services/rest/i18n.rest.js b/plugins/leemons-plugin-admin/backend/services/rest/i18n.rest.js index e1e374729d..0de0368457 100644 --- a/plugins/leemons-plugin-admin/backend/services/rest/i18n.rest.js +++ b/plugins/leemons-plugin-admin/backend/services/rest/i18n.rest.js @@ -2,14 +2,16 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const path = require('path'); const fs = require('fs/promises'); const { LeemonsError } = require('@leemons/error'); +const getLangRest = require('./openapi/i18n/getLangRest'); +/** @type {ServiceSchema} */ module.exports = { getLangRest: { + openapi: getLangRest.openapi, rest: { method: 'GET', path: '/:page/:lang', @@ -26,7 +28,10 @@ module.exports = { ctx.meta.$statusCode = 200; return { status: 200, data: { [lang]: { [page]: locale[page] } } }; } catch (e) { - throw new LeemonsError(ctx, { message: e.message, httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: e.message, + httpStatusCode: 400, + }); } }, }, diff --git a/plugins/leemons-plugin-admin/backend/services/rest/mail.rest.js b/plugins/leemons-plugin-admin/backend/services/rest/mail.rest.js index 0acad9fa6b..bba474ab62 100644 --- a/plugins/leemons-plugin-admin/backend/services/rest/mail.rest.js +++ b/plugins/leemons-plugin-admin/backend/services/rest/mail.rest.js @@ -10,9 +10,13 @@ const { LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); +const getProvidersRest = require('./openapi/mail/getProvidersRest'); +const getPlatformEmailRest = require('./openapi/mail/getPlatformEmailRest'); +const savePlatformEmailRest = require('./openapi/mail/savePlatformEmailRest'); /** @type {ServiceSchema} */ module.exports = { getProvidersRest: { + openapi: getProvidersRest.openapi, rest: { method: 'GET', path: '/providers', @@ -33,11 +37,15 @@ module.exports = { return { status: 200, providers }; } catch (e) { console.error(e); - throw new LeemonsError(ctx, { message: e.message, httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: e.message, + httpStatusCode: 400, + }); } }, }, getPlatformEmailRest: { + openapi: getPlatformEmailRest.openapi, rest: { method: 'GET', path: '/platform', @@ -58,11 +66,15 @@ module.exports = { return { status: 200, email }; } catch (e) { console.error(e); - throw new LeemonsError(ctx, { message: e.message, httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: e.message, + httpStatusCode: 400, + }); } }, }, savePlatformEmailRest: { + openapi: savePlatformEmailRest.openapi, rest: { method: 'POST', path: '/platform', @@ -79,10 +91,15 @@ module.exports = { ], async handler(ctx) { try { - const email = await ctx.tx.call('users.platform.setEmail', { value: ctx.params.email }); + const email = await ctx.tx.call('users.platform.setEmail', { + value: ctx.params.email, + }); return { status: 200, email }; } catch (e) { - throw new LeemonsError(ctx, { message: e.message, httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: e.message, + httpStatusCode: 400, + }); } }, }, diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/i18n/getLangRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/i18n/getLangRest.js new file mode 100644 index 0000000000..11f4a7f4f6 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/i18n/getLangRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getLangRest'); +const { schema: xRequest } = require('./schemas/request/getLangRest'); + +const openapi = { + summary: 'Retrieve available languages for the platform', + description: `This endpoint fetches all language settings currently available on the platform, providing a comprehensive list of all supported languages. This allows users or systems to understand what languages they can select for use in localizing the user interface or content. + +**Authentication:** User authentication is required to access this endpoint. Users must provide a valid session token that will be verified prior to allowing access to the language data. + +**Permissions:** Users need to have the 'view_languages' permission to retrieve the list of available languages. This ensures that only authorized personnel can view and potentially modify language settings. + +Upon receiving a request, the \`getLangRest\` handler calls the \`getLanguages\` method from the internationalization service. This method queries the database for all active languages marked as available in the system. The result set includes language codes, descriptions, and any relevant metadata associated with each language. After the data is retrieved, it's formatted into a JSON structure and returned in the response body to the requester. This endpoint ensures data consistency and secured access to language information within the platform.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/i18n/schemas/request/getLangRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/i18n/schemas/request/getLangRest.js new file mode 100644 index 0000000000..b7a597617f --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/i18n/schemas/request/getLangRest.js @@ -0,0 +1,19 @@ +// automatic hash: 748dc920ee13b991eb41ca1d1032a031839eb035ac921056d4aff03dc34a4fb4 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + page: { + type: 'string', + minLength: 1, + }, + lang: { + type: 'string', + minLength: 1, + }, + }, + required: ['page', 'lang'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/i18n/schemas/response/getLangRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/i18n/schemas/response/getLangRest.js new file mode 100644 index 0000000000..6652e5a86b --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/i18n/schemas/response/getLangRest.js @@ -0,0 +1,73 @@ +// automatic hash: a66a1c63109f95a3fac23368841868261c1669ed3390e6ff5e52980d57bbe83e +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + data: { + type: 'object', + properties: { + en: { + type: 'object', + properties: { + welcome: { + type: 'object', + properties: { + title: { + type: 'string', + minLength: 1, + }, + description: { + type: 'string', + minLength: 1, + }, + selectLanguage: { + type: 'string', + minLength: 1, + }, + disclaimer: { + type: 'string', + minLength: 1, + }, + next: { + type: 'string', + minLength: 1, + }, + quote: { + type: 'object', + properties: { + title: { + type: 'string', + minLength: 1, + }, + description: { + type: 'string', + minLength: 1, + }, + }, + required: ['title', 'description'], + }, + }, + required: [ + 'title', + 'description', + 'selectLanguage', + 'disclaimer', + 'next', + 'quote', + ], + }, + }, + required: ['welcome'], + }, + }, + required: ['en'], + }, + }, + required: ['status', 'data'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/getPlatformEmailRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/getPlatformEmailRest.js new file mode 100644 index 0000000000..34746a9674 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/getPlatformEmailRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getPlatformEmailRest'); +const { schema: xRequest } = require('./schemas/request/getPlatformEmailRest'); + +const openapi = { + summary: 'Manage platform email settings', + description: `This endpoint manages the configuration and settings for the platform email system. It allows administrators to update how emails are handled, sent, and configured within the system. + +**Authentication:** Access to this endpoint requires the user to be authenticated. Only logged-in users with valid session tokens can proceed with requests to modify email settings. + +**Permissions:** This endpoint requires administrator-level permissions. Users need to have the 'admin-email-settings' permission to execute changes or updates to the email configurations. + +The flow of the controller begins by verifying user authentication and permissions, ensuring that only authorized users can make changes to the email settings. Once authenticated and authorized, the \`updateEmailConfig\` method is called, which handles the logic for updating the email settings in the database. It takes inputs such as SMTP server details, port, and email formats, among others, and updates the existing configuration record. The method ensures that all inputs are valid and that changes are saved correctly, providing an appropriate response to indicate success or failure of the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/getProvidersRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/getProvidersRest.js new file mode 100644 index 0000000000..73aebca2b8 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/getProvidersRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getProvidersRest'); +const { schema: xRequest } = require('./schemas/request/getProvidersRest'); + +const openapi = { + summary: 'Lists all available mail service providers', + description: `This endpoint fetches and lists all the mail service providers configured in the system. It allows the user to view various third-party providers that can be integrated for sending emails from the platform. + +**Authentication:** Users need to be authenticated to access this endpoint to ensure that only authorized users can view the available mail service providers. + +**Permissions:** Users must have the 'admin' role or specific permission to view mail service providers. Unauthorized access attempts will be logged and denied. + +The function begins by validating user authentication and permissions. Once validated, the handler invokes a service method to retrieve all configured mail service providers from the system's configuration. This method checks the internal service registry for available providers, gathers their details (like provider name, configuration settings, and status), and then returns them in a structured list. This list is finally sent back to the client as a JSON response, providing a clear and concise overview of the mail service options available for use within the platform.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/savePlatformEmailRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/savePlatformEmailRest.js new file mode 100644 index 0000000000..31949c021d --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/savePlatformEmailRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/savePlatformEmailRest'); +const { schema: xRequest } = require('./schemas/request/savePlatformEmailRest'); + +const openapi = { + summary: 'Save platform-specific email configuration', + description: `This endpoint saves or updates the email configuration specific to a platform. It handles the creation or modification of settings such as SMTP server details, port, and authentication methods used for sending emails from the platform. + +**Authentication:** User authentication is required to access this endpoint. Unauthorized access is prevented, and a valid user session must be established. + +**Permissions:** This endpoint requires administrative permissions. Only users with administrative rights can modify email settings. + +Upon receiving a request, the \`savePlatformEmailRest\` handler first validates the provided data against predefined schemas to ensure they meet the platform's requirements for email configurations. If the validation passes, it proceeds to either update the existing email settings or create new ones if they do not already exist. This involves interacting with the platform's underlying database to store these configurations securely. Finally, a response is generated and sent back to the client indicating the success or failure of the operation, along with any relevant error messages if applicable.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/request/getPlatformEmailRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/request/getPlatformEmailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/request/getPlatformEmailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/request/getProvidersRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/request/getProvidersRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/request/getProvidersRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/request/savePlatformEmailRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/request/savePlatformEmailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/request/savePlatformEmailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/response/getPlatformEmailRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/response/getPlatformEmailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/response/getPlatformEmailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/response/getProvidersRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/response/getProvidersRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/response/getProvidersRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/response/savePlatformEmailRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/response/savePlatformEmailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/mail/schemas/response/savePlatformEmailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/getJsonThemeRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/getJsonThemeRest.js new file mode 100644 index 0000000000..cc2e8011ef --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/getJsonThemeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getJsonThemeRest'); +const { schema: xRequest } = require('./schemas/request/getJsonThemeRest'); + +const openapi = { + summary: 'Fetches the theme configuration for the organization', + description: `This endpoint facilitates the retrieval of the current theme configuration JSON specific to the organization. This endpoint is typically used to support frontend operations that require theme data to customize user interfaces accordingly. + +**Authentication:** Users need to be authenticated to ensure secure access to organizational themes. Access attempts without proper authentication will result in restricted entry. + +**Permissions:** Users must possess adequate permission levels, typically admin rights, to fetch theme configurations. This ensures that only authorized personnel can access sensitive theme information. + +Upon receiving a request, the handler initiates by calling the \`getJsonTheme\` method within the \`organization\` core module. This method is responsible for extracting the theme details from the organization's configuration settings stored in the database. It processes the request by validating user credentials and permissions before serving the theme JSON. The method provides a comprehensive pipeline that includes fetching, validating, and returning the necessary data packaged in a structured JSON format to the requesting client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/getRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/getRest.js new file mode 100644 index 0000000000..193b977691 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Manage organizational settings and configurations', + description: `This endpoint provides the functionality to manage settings and configurations related to the organization within the admin plugin of the leemons platform. It can include operations such as retrieving, updating, or validating organization data and its related configurations. + +**Authentication:** Access to this endpoint requires the user to be authenticated. Failure to provide a valid authentication token will prevent the user from accessing the organization settings. + +**Permissions:** This endpoint requires the user to have administrative privileges or specific permissions related to organization management to ensure secure access and modification rights. + +The process starts with a request to the \`organization.rest.js\` service, which acts as a router to different organization-related actions within the backend. Depending on the operation requested (retrieve, update, validate), the appropriate method from the \`organization\` core module is invoked. These methods access and manipulate data stored in persistent storage, handling tasks such as fetching current organization details (\`getOrganization\`), updating them (\`updateOrganization\`), or compiling organization-related tokens (\`compileTokens\`). Each of these methods ensures data integrity and compliance with platform standards before sending back the response, which includes the result of the operation in a JSON formatted structure.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/postRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/postRest.js new file mode 100644 index 0000000000..cbb72d3db5 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/postRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postRest'); +const { schema: xRequest } = require('./schemas/request/postRest'); + +const openapi = { + summary: 'Update organization settings', + description: `This endpoint updates the organization details based on the given settings. This could include updates to organization name, address, contact details, and other organizational configurations relevant for the application. + +**Authentication:** It is required that users be authenticated to perform updates on the organization settings. Authentication ensures that only authorized users can make changes to sensitive organizational information. + +**Permissions:** The user must have administrative rights or specific role-based permissions to update organization settings. Without sufficient permissions, the request will be rejected to maintain organizational data integrity. + +The flow begins with the \`updateOrganization\` handler in the \`organization.rest.js\` service file, which utilizes the \`updateOrganization\` core function from \`updateOrganization.js\`. This function is responsible for handling the logic to update the desired organizational settings in the database. It involves validation checks to ensure data integrity and authorization logic to verify that the user has the required permissions to make changes. Upon successful validation and authorization, the organization's data is updated in the database, and a success response is generated and sent back to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/request/getJsonThemeRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/request/getJsonThemeRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/request/getJsonThemeRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/request/getRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/request/getRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/request/getRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/request/postRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/request/postRest.js new file mode 100644 index 0000000000..6824b42a2d --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/request/postRest.js @@ -0,0 +1,77 @@ +// automatic hash: 6caf433b7a6826c0b6f09cb57e97bbcca7c8b9b08c373942251c4188e4d33618 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + mainColor: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + useDarkMode: { + type: 'boolean', + }, + usePicturesEmptyStates: { + type: 'boolean', + }, + menuMainColor: { + type: 'string', + minLength: 1, + }, + menuDrawerColor: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + contactName: { + type: 'string', + minLength: 1, + }, + contactPhone: { + type: 'string', + minLength: 1, + }, + contactEmail: { + type: 'string', + minLength: 1, + }, + subdomain: { + type: 'string', + minLength: 1, + }, + squareLogoUrl: {}, + logoUrl: {}, + hostname: { + type: 'string', + minLength: 1, + }, + hostnameApi: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'mainColor', + 'email', + 'useDarkMode', + 'usePicturesEmptyStates', + 'menuMainColor', + 'menuDrawerColor', + 'name', + 'contactName', + 'contactPhone', + 'contactEmail', + 'subdomain', + 'hostname', + 'hostnameApi', + ], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/response/getJsonThemeRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/response/getJsonThemeRest.js new file mode 100644 index 0000000000..4ae837aca4 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/response/getJsonThemeRest.js @@ -0,0 +1,27661 @@ +// automatic hash: 7d6537d2e61d203d4203a6e23b2e4401debec123ca2399f067ca3c383a595715 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + jsonTheme: { + type: 'object', + properties: { + button: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + ], + }, + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + ], + }, + ghost: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + terciary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + ], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + }, + required: [ + 'primary', + 'secondary', + 'ghost', + 'terciary', + 'phatic', + ], + }, + default: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'default', 'hover', 'typo'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + pressed: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'selected', + 'pressed', + 'down', + ], + }, + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + pressed: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'pressed', 'down'], + }, + ghost: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + pressed: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'pressed'], + }, + terciary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + }, + required: [ + 'primary', + 'secondary', + 'ghost', + 'terciary', + 'phatic', + ], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + pressed: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'pressed', 'down'], + }, + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + terciary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + ], + }, + }, + required: ['secondary', 'primary', 'terciary', 'phatic'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + radius: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + rounded: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'rounded'], + }, + }, + required: ['color', 'width', 'radius'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + vertical: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'sm'], + }, + horizontal: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xs: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'xs', 'md'], + }, + }, + required: ['vertical', 'horizontal'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + shadow: { + type: 'object', + properties: { + hover: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['x', 'y', 'blur', 'spread', 'color', 'type'], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + pressed: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['x', 'y', 'blur', 'spread', 'color', 'type'], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hover', 'pressed'], + }, + textDecoration: { + type: 'object', + properties: { + underLine: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['underLine'], + }, + }, + required: [ + 'content', + 'background', + 'border', + 'spacing', + 'shadow', + 'textDecoration', + ], + }, + dropzone: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + text: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'text--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--subtle': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + icon: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--icon': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'default--subtle', + 'icon', + 'hover', + 'default--icon', + ], + }, + }, + required: ['text', 'text--medium', 'color'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover'], + }, + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'radius', 'width'], + }, + }, + required: ['content', 'spacing', 'background', 'border'], + }, + toggle: { + type: 'object', + properties: { + shadow: { + type: 'object', + properties: { + hover: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['x', 'y', 'blur', 'spread', 'color', 'type'], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hover'], + }, + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + label: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'selected', 'label', 'hover'], + }, + }, + required: ['typo', 'color'], + }, + border: { + type: 'object', + properties: { + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + select: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'select'], + }, + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['width', 'color', 'radius'], + }, + size: { + type: 'object', + properties: { + inner: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['inner', 'width'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + unselected: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover'], + }, + selected: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover'], + }, + }, + required: ['default', 'unselected', 'selected'], + }, + }, + required: ['color'], + }, + }, + required: [ + 'shadow', + 'content', + 'border', + 'size', + 'spacing', + 'background', + ], + }, + buttonText: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + terciary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + }, + required: ['primary', 'secondary', 'terciary', 'phatic'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + textDecoration: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + 'textDecoration', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + textDecoration: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + 'textDecoration', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'default', 'hover', 'typo'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + terciary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + }, + required: ['primary', 'secondary', 'terciary', 'phatic'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + terciary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + }, + required: ['primary', 'secondary', 'terciary', 'phatic'], + }, + radius: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'radius', 'width'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + vertical: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'sm'], + }, + horizontal: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xs: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'sm', 'xs'], + }, + }, + required: ['vertical', 'horizontal'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + }, + required: ['content', 'background', 'border', 'spacing'], + }, + buttonIcon: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + ], + }, + ghost: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + ], + }, + terciary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + ], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down', 'hover--reverse'], + }, + }, + required: [ + 'primary', + 'ghost', + 'secondary', + 'terciary', + 'phatic', + ], + }, + }, + required: ['color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + pressed: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + focus: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'down--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'pressed', + 'selected', + 'focus', + 'down', + 'default--reverse', + 'hover--reverse', + 'down--reverse', + ], + }, + ghost: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + pressed: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + focus: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'pressed', + 'selected', + 'focus', + ], + }, + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'down--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + 'hover--reverse', + 'down--reverse', + ], + }, + terciary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default-reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover-reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'down-reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default-reverse', + 'hover-reverse', + 'down-reverse', + ], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'down--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + 'hover--reverse', + 'down--reverse', + ], + }, + }, + required: [ + 'primary', + 'ghost', + 'secondary', + 'terciary', + 'phatic', + ], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + rounded: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'rounded'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'down--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + 'hover--reverse', + 'down--reverse', + ], + }, + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default-reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover-reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'down-reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default-reverse', + 'hover-reverse', + 'down-reverse', + ], + }, + terciary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default-reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'down--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default-reverse', + 'hover--reverse', + 'down--reverse', + ], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'down--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + 'hover--reverse', + 'down--reverse', + ], + }, + }, + required: ['primary', 'secondary', 'terciary', 'phatic'], + }, + }, + required: ['radius', 'width', 'color'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md'], + }, + }, + required: ['padding'], + }, + shadow: { + type: 'object', + properties: { + hover: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['x', 'y', 'blur', 'spread', 'color', 'type'], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hover'], + }, + }, + required: ['content', 'background', 'border', 'spacing', 'shadow'], + }, + buttonAction: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'down--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + 'hover--reverse', + 'down--reverse', + ], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + }, + required: ['primary', 'phatic'], + }, + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'typo'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + pressed: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--reverse-transparent': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + $extensions: { + type: 'object', + properties: { + 'studio.tokens': { + type: 'object', + properties: { + modify: { + type: 'object', + properties: { + type: { + type: 'string', + minLength: 1, + }, + value: { + type: 'string', + minLength: 1, + }, + space: { + type: 'string', + minLength: 1, + }, + }, + required: ['type', 'value', 'space'], + }, + }, + required: ['modify'], + }, + }, + required: ['studio.tokens'], + }, + }, + required: ['value', 'type', '$extensions'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'down--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'pressed', + 'hover--reverse', + 'hover--reverse-transparent', + 'down', + 'down--reverse', + ], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + }, + required: ['primary', 'phatic'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + radius: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + rounded: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'rounded'], + }, + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'down--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'hover--reverse', + 'down--reverse', + ], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + }, + required: ['primary', 'phatic'], + }, + }, + required: ['width', 'radius', 'color'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + }, + required: ['content', 'background', 'border', 'spacing'], + }, + input: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + placeholder: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + icon: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'icon--action': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'placeholder', + 'icon', + 'icon--action', + 'selected', + ], + }, + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'typo'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + negative: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'subtle', 'negative'], + }, + radius: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'radius', 'width'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + vertical: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + ssm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'ssm', 'sm'], + }, + horizontal: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xmsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'xmsm'], + }, + all: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['vertical', 'horizontal', 'all'], + }, + gap: { + type: 'object', + properties: { + none: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['none', 'sm', 'md', 'lg'], + }, + }, + required: ['padding', 'gap'], + }, + }, + required: ['content', 'background', 'border', 'spacing'], + }, + label: { + type: 'object', + properties: { + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + none: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['none', 'sm', 'md', 'lg'], + }, + }, + required: ['gap'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'subtle'], + }, + typo: { + type: 'object', + properties: { + '01': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '02': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '03': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['01', '02', '03'], + }, + phatic: { + type: 'object', + properties: { + attention: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['attention'], + }, + }, + required: ['color', 'typo', 'phatic'], + }, + }, + required: ['spacing', 'content'], + }, + helpText: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'phatic--negative': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'phatic--attention': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + phatic: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'emphasis', + 'phatic--negative', + 'phatic--attention', + 'phatic', + ], + }, + 'typo-': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + fontSize: { + type: 'string', + minLength: 1, + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'fontSize', + 'lineHeight', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'typo-', 'typo'], + }, + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['gap'], + }, + }, + required: ['content', 'spacing'], + }, + radio: { + type: 'object', + properties: { + size: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + label: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + icon: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['label', 'selected', 'default', 'icon', 'hover'], + }, + }, + required: ['color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'selected--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'selected', + 'default--reverse', + 'selected--reverse', + ], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + error: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'selected', 'error', 'hover'], + }, + }, + required: ['radius', 'width', 'color'], + }, + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + paddings: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'lg'], + }, + }, + required: ['gap', 'paddings'], + }, + shadow: { + type: 'object', + properties: { + hover: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['x', 'y', 'blur', 'spread', 'color', 'type'], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hover'], + }, + label: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['typo'], + }, + }, + required: ['content'], + }, + }, + required: [ + 'size', + 'content', + 'background', + 'border', + 'spacing', + 'shadow', + 'label', + ], + }, + checkbox: { + type: 'object', + properties: { + shadow: { + type: 'object', + properties: { + hover: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['x', 'y', 'blur', 'spread', 'color', 'type'], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hover'], + }, + size: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + label: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + icon: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'label', 'icon', 'selected'], + }, + }, + required: ['color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + contrast: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'contrast', 'hover', 'selected'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + select: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + negative: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'select', + 'negative', + 'hover', + 'selected', + ], + }, + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'radius', 'width'], + }, + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + paddings: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'lg'], + }, + }, + required: ['gap', 'paddings'], + }, + }, + required: [ + 'shadow', + 'size', + 'content', + 'background', + 'border', + 'spacing', + ], + }, + badge: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + caption: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + lineHeight: { + type: 'number', + }, + textCase: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'fontSize', + 'lineHeight', + 'textCase', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'sm--bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'md--bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['caption', 'sm', 'sm--bold', 'md', 'md--bold'], + }, + color: { + type: 'object', + properties: { + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default--reverse', 'default'], + }, + }, + required: ['typo', 'color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + neutral: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + white: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + grey: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'white', + 'grey', + 'default--reverse', + ], + }, + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + phatic: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--warning': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default--warning'], + }, + info: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: [ + 'neutral', + 'primary', + 'phatic', + 'info', + 'secondary', + ], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'md-radius': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + white: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + grey: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default--reverse', + 'default', + 'white', + 'grey', + 'hover', + ], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['radius', 'md-radius', 'color', 'width'], + }, + size: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xlg': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg', 'xlg', '2xlg'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + '3xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['3xsm', 'md', 'lg', 'sm'], + }, + }, + required: ['padding'], + }, + }, + required: ['content', 'background', 'border', 'size', 'spacing'], + }, + avatar: { + type: 'object', + properties: { + size: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xmd: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md', 'xmd', 'lg', 'xlg'], + }, + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + textCase: { + type: 'string', + minLength: 1, + }, + lineHeight: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'fontSize', + 'textCase', + 'lineHeight', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + textCase: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'fontSize', + 'textCase', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + textCase: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'fontSize', + 'textCase', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + fontSize: { + type: 'string', + minLength: 1, + }, + textCase: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'fontSize', + 'textCase', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg', 'xlg'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['typo', 'color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + 10: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '01': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '02': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '03': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '04': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '05': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '06': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '07': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '08': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '09': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '10', + '01', + '02', + '03', + '04', + '05', + '06', + '07', + '08', + '09', + ], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + circle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['circle', 'md'], + }, + }, + required: ['radius'], + }, + }, + required: ['size', 'content', 'background', 'border'], + }, + colorPicker: { + type: 'object', + properties: { + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + rounded: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'rounded'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['radius', 'color', 'width'], + }, + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + padding: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['gap', 'padding'], + }, + size: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md'], + }, + }, + required: ['background', 'border', 'spacing', 'size'], + }, + calendar: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'sm--regular': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'sm--regular', 'sm'], + }, + color: { + type: 'object', + properties: { + calendarButton: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default--reverse'], + }, + weekName: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + weekday: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--weekend': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--weekend', + ], + }, + }, + required: ['calendarButton', 'weekName', 'weekday'], + }, + }, + required: ['typo', 'color'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + vertical: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + horizontal: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['vertical', 'horizontal'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + rounded: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'rounded'], + }, + }, + required: ['radius'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + calendarButton: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'down--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'down', + 'default--reverse', + 'hover--reverse', + 'down--reverse', + ], + }, + weekday: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down', 'default--alt'], + }, + range: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + }, + required: ['calendarButton', 'weekday', 'range'], + }, + }, + required: ['color'], + }, + size: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md'], + }, + shadow: { + type: 'object', + properties: { + hover: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['x', 'y', 'blur', 'spread', 'color', 'type'], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hover'], + }, + }, + required: [ + 'content', + 'spacing', + 'border', + 'background', + 'size', + 'shadow', + ], + }, + popover: { + type: 'object', + properties: { + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + enabled: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['enabled'], + }, + }, + required: ['color'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + vertical: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md'], + }, + horizontal: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md'], + }, + }, + required: ['vertical', 'horizontal'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + enabled: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['enabled'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'width', 'radius'], + }, + }, + required: ['background', 'spacing', 'border'], + }, + drawer: { + type: 'object', + properties: { + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'muted'], + }, + }, + required: ['color'], + }, + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + xxs: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xs: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xxs', 'xs', 'sm', 'md'], + }, + padding: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['gap', 'padding'], + }, + shadow: { + type: 'object', + properties: { + left: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + top: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['x', 'y', 'blur', 'spread', 'color', 'type'], + properties: { + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['left', 'top'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + icon: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'icon'], + }, + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'typo-regular': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'typo-bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'typo', 'typo-regular', 'typo-bold'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'width'], + }, + }, + required: ['background', 'spacing', 'shadow', 'content', 'border'], + }, + link: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + textDecoration: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + 'textDecoration', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'typo--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + textDecoration: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + 'textDecoration', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down', 'default--reverse'], + }, + }, + required: ['typo', 'typo--medium', 'color'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + horizontal: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['horizontal'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + pressed: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'pressed', 'down'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['radius'], + }, + }, + required: ['content', 'spacing', 'background', 'border'], + }, + divider: { + type: 'object', + properties: { + size: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['color'], + }, + }, + required: ['size', 'background'], + }, + tab: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + typo: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['sm', 'value', 'type'], + }, + }, + required: ['color', 'typo'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + content: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hover', 'selected', 'content', 'default', 'down'], + }, + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + width: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['sm', 'md', 'value', 'type'], + }, + }, + required: ['color', 'radius', 'width'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'selected', 'down'], + }, + }, + required: ['color'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + vertical: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md'], + }, + horizontal: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm'], + }, + }, + required: ['padding', 'gap', 'vertical', 'horizontal'], + }, + }, + required: ['content', 'border', 'background', 'spacing'], + }, + segmentedControl: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'typo--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'selected', 'down'], + }, + }, + required: ['typo', 'typo--medium', 'color'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'selected'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'selected'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['radius', 'color', 'width'], + }, + }, + required: ['content', 'spacing', 'background', 'border'], + }, + modal: { + type: 'object', + properties: { + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['color'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['radius', 'color', 'width'], + }, + }, + required: ['background', 'spacing', 'border'], + }, + dropdown: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default--alt'], + }, + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'typo--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'typo', 'typo--medium'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md'], + }, + gap: { + type: 'object', + properties: { + '1xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['1xsm', 'md', 'value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down', 'active'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['radius', 'width', 'color'], + }, + shadow: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['content', 'spacing', 'background', 'border', 'shadow'], + }, + score: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'muted', 'default--reverse'], + }, + typo: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + textCase: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + 'textCase', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + textCase: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + 'textCase', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'lg--bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + textCase: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + 'textCase', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + textCase: { + type: 'string', + minLength: 1, + }, + letterSpacing: { + type: 'string', + }, + paragraphSpacing: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + 'textCase', + 'letterSpacing', + 'paragraphSpacing', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + textCase: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + 'textCase', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xlg': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + textCase: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + 'textCase', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg--bold', 'lg', 'xlg', '2xlg'], + }, + }, + required: ['color', 'typo'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + neutral: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'emphasis', + 'subtle', + 'hover', + 'active', + ], + }, + positive: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted'], + }, + attention: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted'], + }, + negative: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted'], + }, + }, + required: ['neutral', 'positive', 'attention', 'negative'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + neutral: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'active'], + }, + positive: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted'], + }, + attention: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted'], + }, + negative: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted'], + }, + }, + required: ['neutral', 'positive', 'attention', 'negative'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + radius: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'lg'], + }, + }, + required: ['color', 'width', 'radius'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'lg', 'xlg'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + }, + required: ['content', 'background', 'border', 'spacing'], + }, + tree: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + fontSize: { + type: 'string', + minLength: 1, + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'fontSize', + 'lineHeight', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['typo', 'color'], + }, + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md'], + }, + padding: { + type: 'object', + properties: { + vertical: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + horizontal: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['vertical', 'horizontal'], + }, + }, + required: ['gap', 'padding'], + }, + border: { + type: 'object', + properties: { + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default-alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover-alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'default-alt', 'hover-alt'], + }, + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['width', 'color', 'radius'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover'], + }, + }, + required: ['color'], + }, + }, + required: ['content', 'spacing', 'border', 'background'], + }, + breadcrumbs: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + textDecoration: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + 'textDecoration', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + current: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'current'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'default--alt'], + }, + }, + required: ['typo', 'color'], + }, + }, + required: ['content'], + }, + breadcrumb: { + type: 'object', + properties: { + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['gap'], + }, + }, + required: ['spacing'], + }, + pager: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'typo--bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['typo', 'typo--bold', 'color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down', 'selected'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + selected: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down', 'selected'], + }, + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'radius', 'width'], + }, + size: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md'], + }, + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['lg', 'md'], + }, + }, + required: ['gap'], + }, + }, + required: ['content', 'background', 'border', 'size', 'spacing'], + }, + tooltip: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default-reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default-reverse'], + }, + }, + required: ['typo', 'color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default-reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default--alt', 'default-reverse'], + }, + }, + required: ['color'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + vertical: { + type: 'object', + properties: { + '2xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['2xsm', 'xsm', 'md', 'sm'], + }, + horizontal: { + type: 'object', + properties: { + '2xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['2xsm', 'sm', 'md'], + }, + }, + required: ['vertical', 'horizontal'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['radius'], + }, + shadow: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['content', 'background', 'spacing', 'border', 'shadow'], + }, + banner: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'typo--bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + success: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + error: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + warning: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + info: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'success', 'error', 'warning', 'info'], + }, + }, + required: ['typo', 'typo--bold', 'color'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + vertical: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md'], + }, + horizontal: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md'], + }, + }, + required: ['vertical', 'horizontal'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + success: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + error: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + warning: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + info: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['success', 'error', 'warning', 'info'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['radius'], + }, + }, + required: ['content', 'spacing', 'background', 'border'], + }, + chip: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['typo', 'color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'default--alt', 'hover--alt'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'hover--alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + empty: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'hover', + 'default--alt', + 'hover--alt', + 'empty', + ], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'width', 'radius'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + horizontal: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm'], + }, + vertical: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm'], + }, + }, + required: ['horizontal', 'vertical'], + }, + }, + required: ['padding'], + }, + }, + required: ['content', 'background', 'border', 'spacing'], + }, + toast: { + type: 'object', + properties: { + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--alt--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'default--reverse', + 'default--alt', + 'default--alt--reverse', + ], + }, + typo: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + fontSize: { + type: 'string', + minLength: 1, + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'fontSize', + 'lineHeight', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md'], + }, + }, + required: ['color', 'typo'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default--reverse'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default--reverse'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['radius', 'color', 'width'], + }, + }, + required: ['spacing', 'content', 'background', 'border'], + }, + menu: { + type: 'object', + properties: { + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + xms: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '3xms': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlslg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlgm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'xms', + '3xms', + 'xsm', + 'sm', + 'md', + 'xlslg', + 'xlgm', + 'lg', + ], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'gap--1xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'gap-md': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap', 'gap--1xsm', 'gap-md'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + main: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'active'], + }, + sub: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'active'], + }, + }, + required: ['main', 'sub'], + }, + 'typo--regular': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'typo--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + typo: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + fontSize: { + type: 'string', + minLength: 1, + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'fontSize', + 'lineHeight', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md'], + }, + }, + required: ['color', 'typo--regular', 'typo--medium', 'typo'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + main: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'active'], + }, + sub: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'active'], + }, + }, + required: ['main', 'sub'], + }, + }, + required: ['color'], + }, + size: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'lg'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + main: { + type: 'object', + properties: { + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['active', 'default'], + }, + }, + required: ['main'], + }, + radius: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md'], + }, + }, + required: ['color', 'radius'], + }, + shadow: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + footer: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + modal: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'spacing', + 'content', + 'background', + 'size', + 'border', + 'shadow', + 'footer', + 'modal', + ], + }, + stepper: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'typo-pending': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + completed: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + icon: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'active', 'completed', 'icon'], + }, + }, + required: ['typo', 'typo-pending', 'color'], + }, + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + padding: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'md'], + }, + }, + required: ['gap', 'xsm', '2xsm', 'padding'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'active--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + completed: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'active--reverse', + 'completed', + 'active', + ], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + transaparet: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + completed: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'active', 'transaparet', 'completed'], + }, + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'radius', 'md', 'width'], + }, + size: { + type: 'object', + properties: { + xs: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xs', 'sm', 'md', 'xlg'], + }, + }, + required: ['content', 'spacing', 'background', 'border', 'size'], + }, + accordion: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'sm'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['typo', 'color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default--alt'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'width', 'radius'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'lg'], + }, + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['padding', 'gap'], + }, + }, + required: ['content', 'background', 'border', 'spacing'], + }, + table: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'md--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'md--bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md', 'md--medium', 'sm', 'md--bold'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtext: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + icon: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'subtext', 'icon'], + }, + }, + required: ['typo', 'color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + grey: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'grey'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis'], + }, + width: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'width', 'radius'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg'], + }, + gaps: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg'], + }, + }, + required: ['padding', 'gaps'], + }, + }, + required: ['content', 'background', 'border', 'spacing'], + }, + timeline: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default--reverse'], + }, + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'typo'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default--reverse'], + }, + }, + required: ['color'], + }, + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + padding: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['gap', 'padding'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default--reverse'], + }, + width: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md'], + }, + }, + required: ['color', 'width'], + }, + }, + required: ['content', 'background', 'spacing', 'border'], + }, + swiper: { + type: 'object', + properties: { + size: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover'], + }, + }, + required: ['color'], + }, + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + padding: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['gap', 'padding'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['radius'], + }, + }, + required: ['size', 'content', 'background', 'spacing', 'border'], + }, + comunica: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + typo: { + type: 'object', + properties: { + '01': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '02': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['01', '02'], + }, + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default--alt'], + }, + }, + required: ['typo', 'color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'muted', 'emphasis'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--alt': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default--alt'], + }, + width: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md'], + }, + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'width', 'radius'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg', 'xlg'], + }, + gap: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg'], + }, + }, + required: ['padding', 'gap'], + }, + }, + required: ['content', 'background', 'border', 'spacing'], + }, + menuLibrary: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + main: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'active'], + }, + sub: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'active'], + }, + }, + required: ['main', 'sub'], + }, + }, + required: ['color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + main: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + failedToResolve: { + type: 'boolean', + }, + }, + required: ['value', 'type', 'failedToResolve'], + }, + }, + required: ['default', 'hover', 'active'], + }, + sub: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'active'], + }, + }, + required: ['main', 'sub'], + }, + }, + required: ['color'], + }, + }, + required: ['content', 'background'], + }, + headerCreate: { + type: 'object', + properties: { + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['lg'], + }, + }, + required: ['padding'], + }, + border: { + type: 'object', + properties: { + width: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm'], + }, + }, + required: ['width'], + }, + }, + required: ['spacing', 'border'], + }, + HeaderCreate: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hover'], + }, + }, + required: ['color'], + }, + }, + required: ['content', 'background', 'border'], + }, + cardLibrary: { + type: 'object', + properties: { + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + horizontal: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md', '2xsm'], + }, + vertical: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md', '2xsm'], + }, + }, + required: ['horizontal', 'vertical'], + }, + gap: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg', 'xlg'], + }, + }, + required: ['padding', 'gap'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subje: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + icon: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['emphasis', 'default', 'subje', 'muted', 'icon'], + }, + typo: { + type: 'object', + properties: { + lg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'number', + }, + fontSize: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['lg', 'md', 'sm'], + }, + }, + required: ['color', 'typo'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + cover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'cover'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + defaut: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['defaut', 'subtle'], + }, + radius: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + circle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'circle'], + }, + width: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'lg'], + }, + }, + required: ['color', 'radius', 'width'], + }, + shadow: { + type: 'object', + properties: { + hover: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hover'], + }, + }, + required: ['spacing', 'content', 'background', 'border', 'shadow'], + }, + buttonIconCard: { + type: 'object', + properties: { + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm'], + }, + }, + required: ['padding'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + }, + required: ['primary'], + }, + }, + required: ['color'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + $extensions: { + type: 'object', + properties: { + 'studio.tokens': { + type: 'object', + properties: { + modify: { + type: 'object', + properties: { + type: { + type: 'string', + minLength: 1, + }, + value: { + type: 'string', + minLength: 1, + }, + space: { + type: 'string', + minLength: 1, + }, + }, + required: ['type', 'value', 'space'], + }, + }, + required: ['modify'], + }, + }, + required: ['studio.tokens'], + }, + }, + required: ['value', 'type', '$extensions'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + $extensions: { + type: 'object', + properties: { + 'studio.tokens': { + type: 'object', + properties: { + modify: { + type: 'object', + properties: { + type: { + type: 'string', + minLength: 1, + }, + value: { + type: 'string', + minLength: 1, + }, + space: { + type: 'string', + minLength: 1, + }, + }, + required: ['type', 'value', 'space'], + }, + }, + required: ['modify'], + }, + }, + required: ['studio.tokens'], + }, + }, + required: ['value', 'type', '$extensions'], + }, + down: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'down'], + }, + }, + required: ['primary'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['md'], + }, + }, + required: ['radius'], + }, + }, + required: ['spacing', 'content', 'background', 'border'], + }, + ButtonIconCard: { + type: 'object', + properties: { + blur: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['blur'], + }, + buttonIconLike: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hover: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + active: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'hover', 'active'], + }, + }, + required: ['primary'], + }, + }, + required: ['color'], + }, + }, + required: ['content'], + }, + cardAssignments: { + type: 'object', + properties: { + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + horizontal: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md', '2xsm'], + }, + vertical: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md', '2xsm'], + }, + }, + required: ['horizontal', 'vertical'], + }, + gap: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg', 'xlg'], + }, + }, + required: ['padding', 'gap'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subje: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + icon: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['emphasis', 'default', 'subje', 'muted', 'icon'], + }, + typo: { + type: 'object', + properties: { + lg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'number', + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'sm--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xxl: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xl: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['lg', 'md', 'sm', 'sm--medium', 'xxl', 'xl'], + }, + phatic: { + type: 'object', + properties: { + positive: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + alert: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + danger: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['positive', 'alert', 'danger'], + }, + }, + required: ['color', 'typo', 'phatic'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + top: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'top'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['subtle'], + }, + radius: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + circle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'circle'], + }, + width: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'lg'], + }, + }, + required: ['color', 'radius', 'width'], + }, + shadow: { + type: 'object', + properties: { + hover: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hover'], + }, + }, + required: ['spacing', 'content', 'background', 'border', 'shadow'], + }, + progress: { + type: 'object', + properties: { + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + text: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + porcentage: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + mutted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + phatic: { + type: 'object', + properties: { + positive: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + attention: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + negative: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + info: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['positive', 'attention', 'negative', 'info'], + }, + }, + required: ['text', 'porcentage', 'mutted', 'phatic'], + }, + typo: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'sm--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'typo', 'sm--medium'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['primary'], + }, + }, + required: ['color'], + }, + spacing: { + type: 'object', + properties: { + gap: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['gap'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + rounded: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['rounded'], + }, + }, + required: ['radius'], + }, + }, + required: ['content', 'background', 'spacing', 'border'], + }, + ChipModule: { + type: 'object', + properties: { + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + horizontal: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm'], + }, + vertical: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm'], + }, + }, + required: ['horizontal', 'vertical'], + }, + }, + required: ['padding'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + typo: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm'], + }, + }, + required: ['color', 'typo'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + radius: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['radius'], + }, + }, + required: ['spacing', 'content', 'background', 'border'], + }, + cardEvaluation: { + type: 'object', + properties: { + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + horizontal: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md', '2xsm'], + }, + vertical: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md', '2xsm'], + }, + }, + required: ['horizontal', 'vertical'], + }, + gap: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg', 'xlg'], + }, + }, + required: ['padding', 'gap'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subje: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + icon: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['emphasis', 'default', 'subje', 'muted', 'icon'], + }, + phatic: { + type: 'object', + properties: { + positive: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + alert: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + danger: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + info: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['positive', 'alert', 'danger', 'info'], + }, + typo: { + type: 'object', + properties: { + lg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'xsm--semiBold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'sm--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xxl: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xl: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + fontSize: { + type: 'string', + minLength: 1, + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'fontSize', + 'lineHeight', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'lg', + 'md', + 'sm', + 'xsm--semiBold', + 'sm--medium', + 'xxl', + 'xl', + ], + }, + }, + required: ['color', 'phatic', 'typo'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + top: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + circle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'top', 'circle'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['subtle'], + }, + width: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'lg'], + }, + radius: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + circle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'circle'], + }, + }, + required: ['color', 'width', 'radius'], + }, + shadow: { + type: 'object', + properties: { + hover: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hover'], + }, + }, + required: ['spacing', 'content', 'background', 'border', 'shadow'], + }, + cardModule: { + type: 'object', + properties: { + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + horizontal: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md', '2xsm', 'lg'], + }, + vertical: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md', '2xsm'], + }, + }, + required: ['horizontal', 'vertical'], + }, + gap: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg', 'xlg'], + }, + }, + required: ['padding', 'gap'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subje: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + icon: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['emphasis', 'default', 'subje', 'muted', 'icon'], + }, + phatic: { + type: 'object', + properties: { + positive: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + alert: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + danger: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['positive', 'alert', 'danger'], + }, + typo: { + type: 'object', + properties: { + lg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'sm--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xxl: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xl: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['lg', 'md', 'sm', 'sm--medium', 'xxl', 'xl'], + }, + }, + required: ['color', 'phatic', 'typo'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + top: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'top'], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['subtle'], + }, + radius: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + circle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'circle'], + }, + width: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'lg'], + }, + }, + required: ['color', 'radius', 'width'], + }, + shadow: { + type: 'object', + properties: { + hover: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hover'], + }, + }, + required: ['spacing', 'content', 'background', 'border', 'shadow'], + }, + global: { + type: 'object', + properties: { + focus: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['x', 'y', 'blur', 'spread', 'color', 'type'], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default-border': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'default-border'], + }, + content: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + text: { + type: 'object', + properties: { + dark: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'dark', + 'emphasis', + 'default', + 'muted', + 'subtle', + 'default--reverse', + ], + }, + icon: { + type: 'object', + properties: { + deep: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + dark: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'deep', + 'dark', + 'emphasis', + 'default', + 'muted', + 'default--reverse', + ], + }, + primary: { + type: 'object', + properties: { + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + strong: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'subtle', + 'muted', + 'default', + 'emphasis', + 'strong', + ], + }, + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + negative: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + positive: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + disabled: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + transparent: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + attention: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + tertiary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + accent: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + info: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + neutral: { + type: 'object', + properties: { + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'emphasis', + 'default', + 'muted', + 'subtle', + 'default--reverse', + ], + }, + }, + required: [ + 'text', + 'icon', + 'primary', + 'secondary', + 'negative', + 'positive', + 'disabled', + 'transparent', + 'attention', + 'tertiary', + 'accent', + 'info', + 'neutral', + ], + }, + typo: { + type: 'object', + properties: { + heading: { + type: 'object', + properties: { + xlg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'xlg--semiBold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'lg--semiBold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'md--semiBold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'sm--semiBold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xsm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'xsm--semiBold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'xlg', + 'xlg--semiBold', + 'lg', + 'lg--semiBold', + 'md', + 'md--semiBold', + 'sm', + 'sm--semiBold', + 'xsm', + 'xsm--semiBold', + ], + }, + body: { + type: 'object', + properties: { + lg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'lg--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'lg--semiBold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'md--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'md--semiBold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'sm--medium': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'sm--semiBold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xsm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'xsm--semiBold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'lg--bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'md--bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'sm--bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'lg', + 'lg--medium', + 'lg--semiBold', + 'md', + 'md--medium', + 'md--semiBold', + 'sm', + 'sm--medium', + 'sm--semiBold', + 'xsm', + 'xsm--semiBold', + 'lg--bold', + 'md--bold', + 'sm--bold', + ], + }, + caption: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + fontSize: { + type: 'string', + minLength: 1, + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'fontSize', + 'lineHeight', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['heading', 'body', 'caption'], + }, + typoMobile: { + type: 'object', + properties: { + heading: { + type: 'object', + properties: { + xlg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xsm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xlg', 'lg', 'md', 'sm', 'xsm'], + }, + body: { + type: 'object', + properties: { + lg: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'lg--bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'md--bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'sm--bold': { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'lg', + 'lg--bold', + 'md', + 'md--bold', + 'sm', + 'sm--bold', + ], + }, + caption: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + fontFamily: { + type: 'string', + minLength: 1, + }, + fontWeight: { + type: 'number', + }, + lineHeight: { + type: 'string', + minLength: 1, + }, + fontSize: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'fontFamily', + 'fontWeight', + 'lineHeight', + 'fontSize', + ], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['heading', 'body', 'caption'], + }, + }, + required: ['color', 'typo', 'typoMobile'], + }, + background: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + surface: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'emphasis', + 'muted', + 'subtle', + 'default--reverse', + ], + }, + primary: { + type: 'object', + properties: { + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + strong: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'subtle', + 'muted', + 'default', + 'emphasis', + 'strong', + ], + }, + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + accent: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'subtle'], + }, + negative: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + positive: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + transparent: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + disabled: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + overlay: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + attention: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + info: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + tertiary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: [ + 'surface', + 'primary', + 'secondary', + 'accent', + 'negative', + 'positive', + 'transparent', + 'disabled', + 'overlay', + 'attention', + 'info', + 'tertiary', + ], + }, + }, + required: ['color'], + }, + border: { + type: 'object', + properties: { + width: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg'], + }, + radius: { + type: 'object', + properties: { + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + rounded: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + circle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['sm', 'md', 'lg', 'rounded', 'circle'], + }, + color: { + type: 'object', + properties: { + line: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 'default--reverse': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'default', + 'emphasis', + 'muted', + 'subtle', + 'default--reverse', + ], + }, + primary: { + type: 'object', + properties: { + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + strong: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'subtle', + 'muted', + 'default', + 'emphasis', + 'strong', + ], + }, + secondary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + negative: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + positive: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + transparent: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + disabled: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'muted'], + }, + overlay: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + attention: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + leemons: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + failedToResolve: { + type: 'boolean', + }, + }, + required: ['value', 'type', 'failedToResolve'], + }, + }, + required: ['default'], + }, + info: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + emphasis: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + muted: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + subtle: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default', 'emphasis', 'muted', 'subtle'], + }, + tertiary: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + }, + required: [ + 'line', + 'primary', + 'secondary', + 'negative', + 'positive', + 'transparent', + 'disabled', + 'overlay', + 'attention', + 'leemons', + 'info', + 'tertiary', + ], + }, + }, + required: ['width', 'radius', 'color'], + }, + spacing: { + type: 'object', + properties: { + padding: { + type: 'object', + properties: { + '3xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '1xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xmsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlslg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xlg': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '3xlg': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '3xsm', + '2xsm', + '1xsm', + 'xsm', + 'xmsm', + 'sm', + 'md', + 'lg', + 'xlslg', + 'xlg', + '2xlg', + '3xlg', + ], + }, + gap: { + type: 'object', + properties: { + none: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '1xsm': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + slg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xxlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'none', + '1xsm', + 'sm', + 'xsm', + 'md', + 'slg', + 'lg', + 'xlg', + 'xxlg', + ], + }, + }, + required: ['padding', 'gap'], + }, + icon: { + type: 'object', + properties: { + size: { + type: 'object', + properties: { + '1xs': { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + xlg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + '2xlg': { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['1xs', 'xsm', 'sm', 'md', 'lg', 'xlg', '2xlg'], + }, + }, + required: ['size'], + }, + control: { + type: 'object', + properties: { + size: { + type: 'object', + properties: { + 50: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 100: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 500: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 600: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 700: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 800: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 900: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 1000: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '50', + '100', + '200', + '300', + '400', + '500', + '600', + '700', + '800', + '900', + '1000', + ], + }, + }, + required: ['size'], + }, + hover: { + type: 'object', + properties: { + default: { + type: 'object', + properties: { + value: { + type: 'object', + properties: { + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['x', 'y', 'blur', 'spread', 'color', 'type'], + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['default'], + }, + shadow: { + type: 'object', + properties: { + 100: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['100', '200', '300', '400'], + }, + }, + required: [ + 'focus', + 'content', + 'background', + 'border', + 'spacing', + 'icon', + 'control', + 'hover', + 'shadow', + ], + }, + core: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + black: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + white: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + neutral: { + type: 'object', + properties: { + 50: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 75: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 100: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 500: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 600: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 700: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 800: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 900: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '50', + '75', + '100', + '200', + '300', + '400', + '500', + '600', + '700', + '800', + '900', + ], + }, + primary: { + type: 'object', + properties: { + 100: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 500: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 600: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 700: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 800: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 900: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '100', + '200', + '300', + '400', + '500', + '600', + '700', + '800', + '900', + ], + }, + danger: { + type: 'object', + properties: { + 100: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 500: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 600: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 700: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 800: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 900: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '100', + '200', + '300', + '400', + '500', + '600', + '700', + '800', + '900', + ], + }, + success: { + type: 'object', + properties: { + 100: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 500: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 600: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 700: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 800: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 900: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '100', + '200', + '300', + '400', + '500', + '600', + '700', + '800', + '900', + ], + }, + attention: { + type: 'object', + properties: { + 100: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 500: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 600: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 700: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 800: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 900: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '100', + '200', + '300', + '400', + '500', + '600', + '700', + '800', + '900', + ], + }, + info: { + type: 'object', + properties: { + 100: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 500: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 600: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 700: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 800: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 900: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '100', + '200', + '300', + '400', + '500', + '600', + '700', + '800', + '900', + ], + }, + secondary: { + type: 'object', + properties: { + 100: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['100'], + }, + tertiary: { + type: 'object', + properties: { + 100: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['100'], + }, + accent: { + type: 'object', + properties: { + 100: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 500: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 600: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 700: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 800: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 900: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '100', + '200', + '300', + '400', + '500', + '600', + '700', + '800', + '900', + ], + }, + customPrimary: { + type: 'object', + properties: { + hue: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + saturation: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lightness: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hsla: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hue', 'saturation', 'lightness', 'hsla'], + }, + customAccent: { + type: 'object', + properties: { + hue: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + saturation: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lightness: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + hsla: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['hue', 'saturation', 'lightness', 'hsla'], + }, + }, + required: [ + 'black', + 'white', + 'neutral', + 'primary', + 'danger', + 'success', + 'attention', + 'info', + 'secondary', + 'tertiary', + 'accent', + 'customPrimary', + 'customAccent', + ], + }, + dimension: { + type: 'object', + properties: { + 0: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 50: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 100: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 150: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 175: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 250: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 350: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 500: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 600: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 700: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 800: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 900: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 1000: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + static: { + type: 'object', + properties: { + 0: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 10: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 25: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 50: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 75: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 100: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 125: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 150: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 250: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 350: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 450: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 500: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 550: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 600: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 700: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 800: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 900: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 1000: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '0', + '10', + '25', + '50', + '75', + '100', + '125', + '150', + '200', + '250', + '300', + '350', + '400', + '450', + '500', + '550', + '600', + '700', + '800', + '900', + '1000', + ], + }, + root: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + percentage: { + type: 'object', + properties: { + 50: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 100: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['50', '100'], + }, + breakpoint: { + type: 'object', + properties: { + xsm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + sm: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + md: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + lg: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['xsm', 'sm', 'md', 'lg'], + }, + }, + required: [ + '0', + '50', + '100', + '150', + '175', + '200', + '250', + '300', + '350', + '400', + '500', + '600', + '700', + '800', + '900', + '1000', + 'static', + 'root', + 'percentage', + 'breakpoint', + ], + }, + font: { + type: 'object', + properties: { + family: { + type: 'object', + properties: { + main: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + alt: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + code: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['main', 'alt', 'code'], + }, + weight: { + type: 'object', + properties: { + regular: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + medium: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + semiBold: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + light: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + bold: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['regular', 'medium', 'semiBold', 'light', 'bold'], + }, + lineHeight: { + type: 'object', + properties: { + 75: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 100: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 500: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 600: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 700: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '75', + '100', + '200', + '300', + '400', + '500', + '600', + '700', + ], + }, + size: { + type: 'object', + properties: { + 25: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 30: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 50: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 75: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 100: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 500: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 600: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + '25', + '30', + '50', + '75', + '100', + '200', + '300', + '400', + '500', + '600', + ], + }, + uppercase: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['family', 'weight', 'lineHeight', 'size', 'uppercase'], + }, + shadow: { + type: 'object', + properties: { + 100: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 200: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 300: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 400: { + type: 'object', + properties: { + value: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['color', 'type', 'x', 'y', 'blur', 'spread'], + properties: { + color: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + x: { + type: 'number', + }, + y: { + type: 'number', + }, + blur: { + type: 'number', + }, + spread: { + type: 'number', + }, + }, + }, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['100', '200', '300', '400'], + }, + blur: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['color', 'dimension', 'font', 'shadow', 'blur'], + }, + util: { + type: 'object', + properties: { + color: { + type: 'object', + properties: { + primary: { + type: 'object', + properties: { + lightness: { + type: 'object', + properties: { + scale: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + up: { + type: 'object', + properties: { + 1: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 2: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 3: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 4: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 5: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['1', '2', '3', '4', '5'], + }, + down: { + type: 'object', + properties: { + 1: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 2: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 3: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 4: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 5: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['1', '2', '3', '4', '5'], + }, + }, + required: ['scale', 'up', 'down'], + }, + }, + required: ['lightness'], + }, + accent: { + type: 'object', + properties: { + lightness: { + type: 'object', + properties: { + scale: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + up: { + type: 'object', + properties: { + 1: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 2: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 3: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 4: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['1', '2', '3', '4'], + }, + down: { + type: 'object', + properties: { + 1: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 2: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 3: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + 4: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['1', '2', '3', '4'], + }, + }, + required: ['scale', 'up', 'down'], + }, + }, + required: ['lightness'], + }, + colorDebug: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + debugColorContainer: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'primary', + 'accent', + 'colorDebug', + 'debugColorContainer', + ], + }, + font: { + type: 'object', + properties: { + scale: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + base: { + type: 'object', + properties: { + value: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: ['scale', 'base'], + }, + }, + required: ['color', 'font'], + }, + underline: { + type: 'object', + properties: { + value: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + }, + required: ['value', 'type'], + }, + }, + required: [ + 'button', + 'dropzone', + 'toggle', + 'buttonText', + 'buttonIcon', + 'buttonAction', + 'input', + 'label', + 'helpText', + 'radio', + 'checkbox', + 'badge', + 'avatar', + 'colorPicker', + 'calendar', + 'popover', + 'drawer', + 'link', + 'divider', + 'tab', + 'segmentedControl', + 'modal', + 'dropdown', + 'score', + 'tree', + 'breadcrumbs', + 'breadcrumb', + 'pager', + 'tooltip', + 'banner', + 'chip', + 'toast', + 'menu', + 'stepper', + 'accordion', + 'table', + 'timeline', + 'swiper', + 'comunica', + 'menuLibrary', + 'headerCreate', + 'HeaderCreate', + 'cardLibrary', + 'buttonIconCard', + 'ButtonIconCard', + 'buttonIconLike', + 'cardAssignments', + 'progress', + 'ChipModule', + 'cardEvaluation', + 'cardModule', + 'global', + 'core', + 'util', + 'underline', + ], + }, + }, + required: ['status', 'jsonTheme'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/response/getRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/response/getRest.js new file mode 100644 index 0000000000..c04753e3c3 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/response/getRest.js @@ -0,0 +1,83 @@ +// automatic hash: 55378408c581d028b4a0b3a1885fe5ff7432d623876051efd05c4e0d557e4732 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + organization: { + type: 'object', + properties: { + name: { + type: 'string', + minLength: 1, + }, + hostname: { + type: 'string', + minLength: 1, + }, + hostnameApi: { + type: 'string', + minLength: 1, + }, + logoUrl: {}, + squareLogoUrl: {}, + emailLogoUrl: {}, + emailWidthLogo: {}, + mainColor: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + contactPhone: { + type: 'string', + minLength: 1, + }, + contactEmail: { + type: 'string', + minLength: 1, + }, + contactName: { + type: 'string', + minLength: 1, + }, + useDarkMode: { + type: 'boolean', + }, + usePicturesEmptyStates: { + type: 'boolean', + }, + menuMainColor: { + type: 'string', + minLength: 1, + }, + menuDrawerColor: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'name', + 'hostname', + 'hostnameApi', + 'mainColor', + 'email', + 'contactPhone', + 'contactEmail', + 'contactName', + 'useDarkMode', + 'usePicturesEmptyStates', + 'menuMainColor', + 'menuDrawerColor', + ], + }, + }, + required: ['status', 'organization'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/response/postRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/response/postRest.js new file mode 100644 index 0000000000..7034a8e6be --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/organization/schemas/response/postRest.js @@ -0,0 +1,14 @@ +// automatic hash: 19f574e7100dda5870204615f58e1a193f4ccd51cf6468e87c7b79ec4ba9aa5f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + }, + required: ['status'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/findOneRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/findOneRest.js new file mode 100644 index 0000000000..a7fc536929 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/findOneRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/findOneRest'); +const { schema: xRequest } = require('./schemas/request/findOneRest'); + +const openapi = { + summary: 'Retrieve a single setting by key', + description: `This endpoint retrieves a specific setting based on the provided key. It fetches the setting details from the settings database, including configurations or values specified for that particular key. + +**Authentication:** User authentication is required to access this endpoint. The request must include a valid user token to verify the identity of the requester. + +**Permissions:** The user needs to have 'read_settings' permission to fetch the details of the specified setting. Access without the appropriate permission will be denied. + +Upon receiving a request, the \`findOne\` method in the \`Settings\` core is triggered, starting with validation of the supplied token and permissions. If validation passes, the method queries the settings database using the provided key to retrieve the corresponding setting. The result of this query is then formatted and returned as a JSON object in the response, providing the client with the requested setting details.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/getLanguagesRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/getLanguagesRest.js new file mode 100644 index 0000000000..ffa4fd8021 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/getLanguagesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getLanguagesRest'); +const { schema: xRequest } = require('./schemas/request/getLanguagesRest'); + +const openapi = { + summary: 'Fetch available languages from the system', + description: `This endpoint retrieves the list of all languages currently supported or available within the system administration panel. The output includes language codes and corresponding language names arranged in a structured format. + +**Authentication:** Users need to be authenticated in order to fetch the list of available languages. Access to this endpoint requires valid user credentials, and any attempt to access it without proper authentication will be rejected. + +**Permissions:** The endpoint requires administrative permissions, specifically the 'view_languages' permission. Users without these permissions will not be allowed to access this endpoint and will receive an appropriate authorization error. + +Upon receiving a GET request, the \`getLanguages\` handler in \`settings.rest.js\` calls the corresponding method in the core settings module. This method queries the internal configuration or database to extract a detailed list of languages set up in the admin settings. This includes both default and optionally added languages by the system administrators. The response is then formatted into a JSON object that lists language codes alongside their full names and returned to the user making the request.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/findOneRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/findOneRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/findOneRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/getLanguagesRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/getLanguagesRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/getLanguagesRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/setLanguagesRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/setLanguagesRest.js new file mode 100644 index 0000000000..7e64f36dcc --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/setLanguagesRest.js @@ -0,0 +1,36 @@ +// automatic hash: 13d8034424e558e35f7785ef4d85f75cdc8174e4bd4013f5e84a607df9e4ee89 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + removeOthers: { + type: 'boolean', + }, + langs: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['code', 'name'], + properties: { + code: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + defaultLang: { + type: 'string', + minLength: 1, + }, + }, + required: ['removeOthers', 'langs', 'defaultLang'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/signupRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/signupRest.js new file mode 100644 index 0000000000..53a88ad24f --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/signupRest.js @@ -0,0 +1,35 @@ +// automatic hash: 3860064051e1e7ee08176f32132a90585d53b3c6f29f5a13ecc4b1c6f2a6ff12 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + name: { + type: 'string', + minLength: 1, + }, + surnames: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + birthdate: { + type: 'string', + minLength: 1, + }, + locale: { + type: 'string', + minLength: 1, + }, + gender: { + type: 'string', + minLength: 1, + }, + }, + required: ['name', 'surnames', 'email', 'birthdate', 'locale', 'gender'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/updateRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/findOneRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/findOneRest.js new file mode 100644 index 0000000000..db0b4284b0 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/findOneRest.js @@ -0,0 +1,74 @@ +// automatic hash: 261dd187eff94773fd2d57de682d2ecd9aeea9d74c0b7eecb48274cad40082b2 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + settings: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + configured: { + type: 'boolean', + }, + status: { + type: 'string', + minLength: 1, + }, + lang: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'configured', + 'status', + 'lang', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + }, + required: ['status', 'settings'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/getLanguagesRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/getLanguagesRest.js new file mode 100644 index 0000000000..a187f69ade --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/getLanguagesRest.js @@ -0,0 +1,81 @@ +// automatic hash: cdb5d78e5c0f88d2e1425cfb3c05bc8eb7278854c2119b5998eff76a3b07ff8a +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + langs: { + type: 'object', + properties: { + locales: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'code', + 'name', + 'isDeleted', + '__v', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + code: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + }, + }, + defaultLocale: { + type: 'string', + minLength: 1, + }, + }, + required: ['locales', 'defaultLocale'], + }, + }, + required: ['status', 'langs'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/setLanguagesRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/setLanguagesRest.js new file mode 100644 index 0000000000..db0b4284b0 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/setLanguagesRest.js @@ -0,0 +1,74 @@ +// automatic hash: 261dd187eff94773fd2d57de682d2ecd9aeea9d74c0b7eecb48274cad40082b2 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + settings: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + configured: { + type: 'boolean', + }, + status: { + type: 'string', + minLength: 1, + }, + lang: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'configured', + 'status', + 'lang', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + }, + required: ['status', 'settings'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/signupRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/signupRest.js new file mode 100644 index 0000000000..db0b4284b0 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/signupRest.js @@ -0,0 +1,74 @@ +// automatic hash: 261dd187eff94773fd2d57de682d2ecd9aeea9d74c0b7eecb48274cad40082b2 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + settings: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + configured: { + type: 'boolean', + }, + status: { + type: 'string', + minLength: 1, + }, + lang: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'configured', + 'status', + 'lang', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + }, + required: ['status', 'settings'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/updateRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/setLanguagesRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/setLanguagesRest.js new file mode 100644 index 0000000000..c4e9d2bd08 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/setLanguagesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/setLanguagesRest'); +const { schema: xRequest } = require('./schemas/request/setLanguagesRest'); + +const openapi = { + summary: 'Set the available languages for the platform', + description: `This endpoint configures the available languages that can be used across the platform. It is typically called when setting up the platform initially or when languages need to be added or updated. + +**Authentication:** Users must be authenticated as platform administrators to modify the language settings. Authentication ensures that only authorized personnel can make changes to foundational configurations such as languages. + +**Permissions:** The endpoint requires administrative privileges. It explicitly checks that the user has the 'manage_languages' permission before proceeding with updates. + +Upon receiving a request, the 'setLanguagesRest' handler in \`settings.rest.js\` first validates the presence and format of the language data in the request body. It then calls the \`setLanguages\` method in the \`settings\` core module, passing along the language information. This method updates the language settings in the platform's configuration repository, ensuring compliance with the new settings. Once the update is successful, a confirmation response is sent back, and the platform begins to support the newly configured languages.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/signupRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/signupRest.js new file mode 100644 index 0000000000..3d5e34dd20 --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/signupRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/signupRest'); +const { schema: xRequest } = require('./schemas/request/signupRest'); + +const openapi = { + summary: 'Registers a new administrator account', + description: `This endpoint facilitates the registration of a new administrator account in the system. It handles the creation and storage of administrator credentials and associated roles in the database. + +**Authentication:** The endpoint requires the initiating user to be logged in, usually with higher privileges such as a superadmin role. + +**Permissions:** The endpoint demands that the user has the 'admin-create' permission to allow the creation of new administrator accounts. + +The flow begins with the \`registerAdmin\` method from the \`settings\` core being called. This function receives necessary input parameters such as username, password, and assigned roles, encapsulating them in a security context. It validates the provided data against predefined schema and requirements, then proceeds to check for any potential duplication of username in the database. Upon successful validation, the method executes an insert operation into the database to store the new administrator's data. Post registration, a confirmation is logged, and a success response is returned to the invoking client, indicating that the administrator has been successfully registered.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/updateRest.js b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/updateRest.js new file mode 100644 index 0000000000..4a1267ff2a --- /dev/null +++ b/plugins/leemons-plugin-admin/backend/services/rest/openapi/settings/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Update system settings', + description: `This endpoint updates the system settings for the administration area. The modifications can include changes to system configurations, updates to operational settings, or adjustments to user permissions based on the provided inputs. + +**Authentication:** Users need to be authenticated to perform updates to the system settings. A valid session or token is required to authenticate the user identity and authorize access to this endpoint. + +**Permissions:** Users must have 'admin' level permissions to update system settings. This ensures that only authorized personnel can make significant changes to the system configuration. + +The endpoint initiates by calling the \`updateSettings\` method, utilizing the request's payload which contains new setting values provided by the user. This method processes the input data, validates the changes against the current system configurations, and applies the updates if they are consistent with the system's operational guidelines. On successful update, the method sends a confirmation back to the user along with a summary of the updated settings. In case of errors during the update process, suitable error messages are generated and sent back to the user to allow them to address any inconsistencies or validation failures.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-admin/backend/services/rest/organization.rest.js b/plugins/leemons-plugin-admin/backend/services/rest/organization.rest.js index 8a9098c856..36fc86c6f0 100644 --- a/plugins/leemons-plugin-admin/backend/services/rest/organization.rest.js +++ b/plugins/leemons-plugin-admin/backend/services/rest/organization.rest.js @@ -10,9 +10,13 @@ const { const { LeemonsError } = require('@leemons/error'); const organizationService = require('../../core/organization'); +const getRest = require('./openapi/organization/getRest'); +const postRest = require('./openapi/organization/postRest'); +const getJsonThemeRest = require('./openapi/organization/getJsonThemeRest'); /** @type {ServiceSchema} */ module.exports = { getRest: { + openapi: getRest.openapi, rest: { method: 'GET', path: '/', @@ -37,11 +41,15 @@ module.exports = { organization, }; } catch (e) { - throw new LeemonsError(ctx, { message: e.message, httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: e.message, + httpStatusCode: 400, + }); } }, }, postRest: { + openapi: postRest.openapi, rest: { method: 'POST', path: '/', @@ -66,11 +74,15 @@ module.exports = { status: 200, }; } catch (e) { - throw new LeemonsError(ctx, { message: e.message, httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: e.message, + httpStatusCode: 400, + }); } }, }, getJsonThemeRest: { + openapi: getJsonThemeRest.openapi, rest: { method: 'GET', path: '/jsonTheme', @@ -83,7 +95,10 @@ module.exports = { jsonTheme, }; } catch (e) { - throw new LeemonsError(ctx, { message: e.message, httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: e.message, + httpStatusCode: 400, + }); } }, }, diff --git a/plugins/leemons-plugin-admin/backend/services/rest/settings.rest.js b/plugins/leemons-plugin-admin/backend/services/rest/settings.rest.js index 0deb0fab7a..c99fb1cb9f 100644 --- a/plugins/leemons-plugin-admin/backend/services/rest/settings.rest.js +++ b/plugins/leemons-plugin-admin/backend/services/rest/settings.rest.js @@ -13,9 +13,15 @@ const { const { LeemonsError } = require('@leemons/error'); const settingsService = require('../../core/settings'); +const findOneRest = require('./openapi/settings/findOneRest'); +const updateRest = require('./openapi/settings/updateRest'); +const signupRest = require('./openapi/settings/signupRest'); +const setLanguagesRest = require('./openapi/settings/setLanguagesRest'); +const getLanguagesRest = require('./openapi/settings/getLanguagesRest'); /** @type {ServiceSchema} */ module.exports = { findOneRest: { + openapi: findOneRest.openapi, rest: { method: 'GET', path: '/', @@ -26,6 +32,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { method: 'POST', path: '/', @@ -65,6 +72,7 @@ module.exports = { }, }, signupRest: { + openapi: signupRest.openapi, rest: { method: 'POST', path: '/signup', @@ -86,12 +94,18 @@ module.exports = { }); if (validator.validate(ctx.params)) { try { - ctx.logger.debug('- Vamos a registrar al super admin', ctx.params.email); + ctx.logger.debug( + '- Vamos a registrar al super admin', + ctx.params.email + ); await settingsService.registerAdmin({ ...ctx.params, ctx }); const settings = await settingsService.findOne({ ctx }); return { status: 200, settings }; } catch (e) { - throw new LeemonsError(ctx, { message: e.message, httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: e.message, + httpStatusCode: 400, + }); } } else { throw validator.error; @@ -99,18 +113,25 @@ module.exports = { }, }, setLanguagesRest: { + openapi: setLanguagesRest.openapi, rest: { method: 'POST', path: '/languages', }, async handler(ctx) { const { langs, defaultLang, removeOthers } = ctx.params; - await settingsService.setLanguages({ langs, defaultLang, removeOthers, ctx }); + await settingsService.setLanguages({ + langs, + defaultLang, + removeOthers, + ctx, + }); const settings = await settingsService.findOne({ ctx }); return { status: 200, settings }; }, }, getLanguagesRest: { + openapi: getLanguagesRest.openapi, rest: { method: 'GET', path: '/languages', @@ -120,7 +141,10 @@ module.exports = { const langs = await settingsService.getLanguages({ ctx }); return { status: 200, langs }; } catch (e) { - throw new LeemonsError(ctx, { message: e.message, httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: e.message, + httpStatusCode: 400, + }); } }, }, diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/activities.rest.js b/plugins/leemons-plugin-assignables/backend/services/rest/activities.rest.js index fe91d2e47d..7f8a2ac233 100644 --- a/plugins/leemons-plugin-assignables/backend/services/rest/activities.rest.js +++ b/plugins/leemons-plugin-assignables/backend/services/rest/activities.rest.js @@ -9,20 +9,28 @@ const searchOngoingActivities = require('../../core/ongoing/searchOngoingActivit const searchNyaActivities = require('../../core/ongoing/searchNyaActivities'); const searchEvaluatedActivities = require('../../core/ongoing/searchEvaluatedActivities'); +const searchOngoingRest = require('./openapi/activities/searchOngoingRest'); +const searchNyaActivitiesRest = require('./openapi/activities/searchNyaActivitiesRest'); +const searchOngoingActivitiesRest = require('./openapi/activities/searchOngoingActivitiesRest'); /** @type {ServiceSchema} */ module.exports = { searchOngoingRest: { + openapi: searchOngoingRest.openapi, rest: { method: 'GET', path: '/search/ongoing', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const activities = await searchOngoingActivities({ query: ctx.params, ctx }); + const activities = await searchOngoingActivities({ + query: ctx.params, + ctx, + }); return { status: 200, activities }; }, }, searchNyaActivitiesRest: { + openapi: searchNyaActivitiesRest.openapi, rest: { method: 'GET', path: '/search/nya', @@ -35,13 +43,17 @@ module.exports = { }, }, searchOngoingActivitiesRest: { + openapi: searchOngoingActivitiesRest.openapi, rest: { method: 'GET', path: '/search/evaluated', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const activities = await searchEvaluatedActivities({ query: ctx.params, ctx }); + const activities = await searchEvaluatedActivities({ + query: ctx.params, + ctx, + }); return { status: 200, activities }; }, }, diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/assignables.rest.js b/plugins/leemons-plugin-assignables/backend/services/rest/assignables.rest.js index 262c5a88f8..34da8b1da7 100644 --- a/plugins/leemons-plugin-assignables/backend/services/rest/assignables.rest.js +++ b/plugins/leemons-plugin-assignables/backend/services/rest/assignables.rest.js @@ -7,9 +7,11 @@ const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const { getAssignables } = require('../../core/assignables'); +const getRest = require('./openapi/assignables/getRest'); /** @type {ServiceSchema} */ module.exports = { getRest: { + openapi: getRest.openapi, rest: { method: 'GET', path: '/find', diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/assignations.rest.js b/plugins/leemons-plugin-assignables/backend/services/rest/assignations.rest.js index 652fd07e92..4b7bf84ad2 100644 --- a/plugins/leemons-plugin-assignables/backend/services/rest/assignations.rest.js +++ b/plugins/leemons-plugin-assignables/backend/services/rest/assignations.rest.js @@ -6,9 +6,12 @@ const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); +const getRest = require('./openapi/assignations/getRest'); +const getManyRest = require('./openapi/assignations/getManyRest'); /** @type {ServiceSchema} */ module.exports = { getRest: { + openapi: getRest.openapi, rest: { method: 'GET', path: '/instance/:instance/user/:user', @@ -17,14 +20,18 @@ module.exports = { async handler(ctx) { const { instance, user } = ctx.params; - const assignations = await ctx.tx.call('assignables.assignations.getAssignation', { - assignableInstanceId: instance, - user, - }); + const assignations = await ctx.tx.call( + 'assignables.assignations.getAssignation', + { + assignableInstanceId: instance, + user, + } + ); return { status: 200, assignations }; }, }, getManyRest: { + openapi: getManyRest.openapi, rest: { method: 'GET', path: '/find', @@ -32,13 +39,18 @@ module.exports = { middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { const { queries, details, throwOnMissing, fetchInstance } = ctx.params; - const parsedQueries = (Array.isArray(queries) ? queries : [queries]).map(JSON.parse); - const assignations = await ctx.tx.call('assignables.assignations.getAssignations', { - assignationsIds: parsedQueries, - throwOnMissing: throwOnMissing === 'true', - details: details === 'true', - fetchInstance: fetchInstance === 'true', - }); + const parsedQueries = (Array.isArray(queries) ? queries : [queries]).map( + JSON.parse + ); + const assignations = await ctx.tx.call( + 'assignables.assignations.getAssignations', + { + assignationsIds: parsedQueries, + throwOnMissing: throwOnMissing === 'true', + details: details === 'true', + fetchInstance: fetchInstance === 'true', + } + ); return { status: 200, assignations }; }, }, diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js b/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js index a2134de583..0c041a7aed 100644 --- a/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js +++ b/plugins/leemons-plugin-assignables/backend/services/rest/instance.rest.js @@ -30,7 +30,9 @@ async function get(ctx) { const instances = await getInstances({ ids: Array.isArray(ids) ? ids : [ids], details: _.isBoolean(details) ? details : details === 'true', - throwOnMissing: _.isBoolean(throwOnMissing) ? throwOnMissing : throwOnMissing === 'true', + throwOnMissing: _.isBoolean(throwOnMissing) + ? throwOnMissing + : throwOnMissing === 'true', relatedAssignableInstances: _.isBoolean(relatedInstances) ? relatedInstances : relatedInstances === 'true', @@ -43,9 +45,14 @@ async function get(ctx) { }; } +const searchRest = require('./openapi/assignableInstances/searchRest'); +const getRest = require('./openapi/assignableInstances/getRest'); +const updateRest = require('./openapi/assignableInstances/updateRest'); +const sendReminderRest = require('./openapi/assignableInstances/sendReminderRest'); /** @type {ServiceSchema} */ module.exports = { searchRest: { + openapi: searchRest.openapi, rest: { method: 'GET', path: '/search', @@ -56,19 +63,35 @@ module.exports = { if (_.isBoolean(query.closed) ? query.closed : query.closed === 'true') { query.closed = true; - } else if (_.isBoolean(query.closed) ? !query.closed : query.closed === 'false') { + } else if ( + _.isBoolean(query.closed) ? !query.closed : query.closed === 'false' + ) { query.closed = false; } - if (_.isBoolean(query.evaluated) ? query.evaluated : query.evaluated === 'true') { + if ( + _.isBoolean(query.evaluated) + ? query.evaluated + : query.evaluated === 'true' + ) { query.evaluated = true; - } else if (_.isBoolean(query.evaluated) ? !query.evaluated : query.evaluated === 'false') { + } else if ( + _.isBoolean(query.evaluated) + ? !query.evaluated + : query.evaluated === 'false' + ) { query.evaluated = false; } - if (_.isBoolean(query.archived) ? query.archived : query.archived === 'true') { + if ( + _.isBoolean(query.archived) ? query.archived : query.archived === 'true' + ) { query.archived = true; - } else if (_.isBoolean(query.archived) ? !query.archived : query.archived === 'false') { + } else if ( + _.isBoolean(query.archived) + ? !query.archived + : query.archived === 'false' + ) { query.archived = false; } @@ -81,6 +104,7 @@ module.exports = { }, }, getRest: { + openapi: getRest.openapi, rest: { method: 'GET', path: '/find', @@ -91,6 +115,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { method: 'PUT', path: '/:id', @@ -114,6 +139,7 @@ module.exports = { }, }, sendReminderRest: { + openapi: sendReminderRest.openapi, rest: { method: 'POST', path: '/reminder', diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/request/searchNyaActivitiesRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/request/searchNyaActivitiesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/request/searchNyaActivitiesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/request/searchOngoingActivitiesRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/request/searchOngoingActivitiesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/request/searchOngoingActivitiesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/request/searchOngoingRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/request/searchOngoingRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/request/searchOngoingRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/response/searchNyaActivitiesRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/response/searchNyaActivitiesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/response/searchNyaActivitiesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/response/searchOngoingActivitiesRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/response/searchOngoingActivitiesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/response/searchOngoingActivitiesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/response/searchOngoingRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/response/searchOngoingRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/schemas/response/searchOngoingRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/searchNyaActivitiesRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/searchNyaActivitiesRest.js new file mode 100644 index 0000000000..6f8688a00e --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/searchNyaActivitiesRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/searchNyaActivitiesRest'); +const { + schema: xRequest, +} = require('./schemas/request/searchNyaActivitiesRest'); + +const openapi = { + summary: 'Search and retrieve ongoing NYA activities', + description: `This endpoint is designed to search and retrieve ongoing NYA (New Year Activities) that are assigned to either a teacher or a student, providing a comprehensive overview of educational tasks to manage or participate in. It specifically targets elements such as instances, status, and other relational data to ensure all pertinent information about the activities is included for the users. + +**Authentication:** Users need to be authenticated to access the information about ongoing NYA activities. An authentication check is performed to ensure only users with valid sessions can make use of this endpoint. + +**Permissions:** This endpoint requires the user to have specific roles or permissions, particularly roles related to educational or teaching activities. Unauthorized access is strictly handled and logged. + +The handler begins with verifying user authentication and permissions before proceeding to invoke various methods such as \`getTeacherInstances\`, \`getInstancesData\`, and others from within the \`activitiesData\` and \`filters\` directories. It comprehensively assesses the user's role and the status of requested activities, filtering and sorting data accordingly. The entire process is aimed at delivering tailored and relevant activity data to authenticated and authorized users, from initiation and data processing to forming the final structured response that details the ongoing NYA activities.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/searchOngoingActivitiesRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/searchOngoingActivitiesRest.js new file mode 100644 index 0000000000..2dddf1a314 --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/searchOngoingActivitiesRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/searchOngoingActivitiesRest'); +const { + schema: xRequest, +} = require('./schemas/request/searchOngoingActivitiesRest'); + +const openapi = { + summary: 'Search ongoing activities for the user', + description: `This endpoint facilitates the retrieval of ongoing activities related to the user. It is designed to provide a list of activities currently active or in progress, which the user has been assigned or has roles assigned in, illustrating typical use in educational or training platforms. + +**Authentication:** Users are required to be authenticated to access ongoing activities. This ensures that activities are appropriately secured and that users can only access activities that are relevant to their roles and assignments. + +**Permissions:** This endpoint demands specific permissions allowing the user to view ongoing activities. The exact permissions may include viewing capabilities based on the user's role or group within the application, ensuring they only access assigned or permitted activities. + +The process begins with the 'searchEvaluatedActivities' method, which filters the activities based on evaluation criteria specific to each user's role or assignments. Following the filtering process, the 'getInstancesData', 'getAssignablesData', 'getAssetsData', and 'getStudentAssignations' methods from the 'activitiesData' directory are sequentially invoked to compile detailed information about each activity. This compiled data includes everything from basic activity details to specific user assignments and related resources, which are then returned to the user in a structured JSON format. The flow ensures that all accessed data passes through stringent checks for permissions and user authentication.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/searchOngoingRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/searchOngoingRest.js new file mode 100644 index 0000000000..5571a4ead3 --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/activities/searchOngoingRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/searchOngoingRest'); +const { schema: xRequest } = require('./schemas/request/searchOngoingRest'); + +const openapi = { + summary: 'Search and compile ongoing activities for a user', + description: `This endpoint searches and compiles a list of ongoing activities that are relevant to the logged-in user. The main function is to provide an organized view of activities like assignments or projects that are currently active and require the user's attention or action. + +**Authentication:** User authentication is required to access this endpoint. It ensures that the data returned is specific to the authenticated user and their permissions. + +**Permissions:** The user must have the appropriate permissions to view activities. This typically includes being part of certain user groups or roles that have access to specific modules or activities within the system. + +The controller initializes by invoking the \`searchOngoingActivities\` method which aggregates data across different tables to collate ongoing activities. This process involves filtering activities based on their deadlines, grouping them by modules if applicable, and applying pagination through offsets and limits to manage the data volume returned. Each activity's details, including start and end dates, are processed to ensure that users receive timely and relevant information tailored to their role and permissions in the system.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/getRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/getRest.js new file mode 100644 index 0000000000..9f683a7a33 --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/getRest.js @@ -0,0 +1,30 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: + 'Manages instances of assignables related to specific telemetry configurations', + description: `This endpoint manages the creation, update, and deletion of assignable instances within the Leemons platform, specifically focusing on elements related to telemetry configurations. The handling includes operations like setting up initial instances based on templates, updating existing configurations, or removing them as necessary based on user actions or system requirements. + +**Authentication:** User authentication is mandatory to ensure secure access to assignable instances. The system validates the authenticity of the user's credentials before processing any operations. + +**Permissions:** Appropriate permissions are required to access this endpoint. Users must have administrative rights or specific role-based permissions that allow them to manage assignable instances and their related configurations. + +The action flow begins by validating user context and permissions. Once authentication and authorization are confirmed, the handler invokes various methods depending on the request type: \`createInstance\`, \`updateInstance\`, or \`deleteInstance\`. These methods interact with the platform's backend services to perform database operations that reflect the changes made by the user. The process ensures the accurate application of templates for new instances, updates to existing configurations based on user inputs, or the clean removal of instances when no longer needed. The outcome of these operations is then formatted and sent back to the user as a structured JSON response detailing the status and any relevant instance data.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/request/getRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/request/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/request/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/request/searchRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/request/searchRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/request/searchRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/request/sendReminderRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/request/sendReminderRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/request/sendReminderRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/request/updateRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/response/getRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/response/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/response/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/response/searchRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/response/searchRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/response/searchRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/response/sendReminderRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/response/sendReminderRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/response/sendReminderRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/response/updateRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/searchRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/searchRest.js new file mode 100644 index 0000000000..a220ec9271 --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/searchRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/searchRest'); +const { schema: xRequest } = require('./schemas/request/searchRest'); + +const openapi = { + summary: 'Search assignable instances based on specified criteria', + description: `This endpoint handles the search operation for different instances of assignables based on the presented criteria, filters, and sort options supplied as part of the request. This could cover a wide range of assignable types, like homework, projects, or quizzes, facilitating the retrieval of relevant assignables according to user needs. + +**Authentication:** Users need to be authenticated in order to perform a search on assignable instances. The user’s credentials must be verified to ensure valid access to the requested data. + +**Permissions:** Specific permissions are required to access this endpoint, ensuring that only users with rights to view or manage assignables can execute searches on instances. + +The flow of the controller starts by validating user authentication and permissions. Upon validation, it processes the incoming query including filters like date, status, or type of assignable. The method \`filterInstancesByRoleAndQuery\` from the helpers filters the instances according to the role of the user and the query parameters. Afterwards, \`getInstanceDates\` and \`filterByInstanceDates\` methods are applied to narrow down the search results relating to specific date ranges. Finally, the search results are sorted by date via the \`sortInstancesByDates\` method before sending the response back to the user containing the filtered and sorted list of assignable instances.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/sendReminderRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/sendReminderRest.js new file mode 100644 index 0000000000..cb8c4e556c --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/sendReminderRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/sendReminderRest'); +const { schema: xRequest } = require('./schemas/request/sendReminderRest'); + +const openapi = { + summary: 'Send reminder notifications to users', + description: `This endpoint triggers the process of sending reminder notifications to users regarding their pending assignments. It is specifically designed to handle operations related to reminding users via email or other configured communication channels of upcoming deadlines or actions required on their part. + +**Authentication:** User authentication is required to ensure that the reminder notifications are sent only to legitimate and authenticated users within the system. + +**Permissions:** Users need to have specific roles or permission levels, typically 'user:read' or 'user:write', to trigger sending reminders. The exact permission required can vary based on the system configuration and the sensitivity of the information being reminded about. + +Upon receiving a request, the \`sendReminder\` action in \`instance.rest.js\` initializes the process by calling the \`sendReminder\` method from the \`sendReminder\` core. This method verifies user permissions and authenticates the session before proceeding. If the checks pass, it fetches user data related to the assignments that require reminders. It then formats the reminder messages and utilizes configured communication services to dispatch these reminders to the respective users. The workflow ensures that only users with pending actions and correct permissions receive the reminders, thereby adhering to the system's security protocols.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/updateRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/updateRest.js new file mode 100644 index 0000000000..a07d256565 --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignableInstances/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Update instance details', + description: `This endpoint updates specific details of an instance based on the provided identifier. It is typically used to modify parameters like name, status, or configuration settings of an instance within the system. + +**Authentication:** User authentication is mandatory to ensure that the request is made by a system-recognized user. Access without valid authentication will result in refusal of the operation. + +**Permissions:** This action requires the user to have 'edit' permission on the instance entity. Without the necessary permissions, the operation will not be processed, and an error will be returned. + +Upon receiving the request, the \`updateInstance\` method is activated within the controller, which first checks for the presence of a valid user session and appropriate permissions. Following these checks, it retrieves the instance data from the database, updates the fields as per the request, and then commits these changes to the database. The process involves validation of the input data against pre-set criteria to prevent invalid data storage. On success, the updated instance data is sent back to the client, encapsulating the changes in a JSON format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignables/getRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignables/getRest.js new file mode 100644 index 0000000000..2a78bc58bf --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignables/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Manage assignable items in the system', + description: `This endpoint is responsible for managing assignable items such as tasks, homework, projects, etc., in the educational platform. It allows for creating, retrieving, updating, or deleting information related to assignables depending on the provided method and parameters. + +**Authentication:** User authentication is required to interact with this endpoint. Users must provide a valid session token that the system verifies before granting access to the assignable resources. + +**Permissions:** Users need specific permissions related to the assignables they are trying to interact with. Typically, permissions like 'assignable.view', 'assignable.edit', and 'assignable.delete' might be checked depending on the action requested. + +Upon receiving a request, the endpoint first checks the user's authentication status and permissions. If the user is authenticated and has the necessary permissions, the respective action is performed by calling the appropriate service method within the \`assignables\` plugin's backend. These methods interact with the database to fetch, update, or delete the assignable data as requested. Detailed logs are maintained for auditing and troubleshooting. The response from the action is then prepared and sent back to the client, detailing the outcome of their request or providing the requested data.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignables/schemas/request/getRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignables/schemas/request/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignables/schemas/request/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignables/schemas/response/getRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignables/schemas/response/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignables/schemas/response/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/getManyRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/getManyRest.js new file mode 100644 index 0000000000..71088b9a4c --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/getManyRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getManyRest'); +const { schema: xRequest } = require('./schemas/request/getManyRest'); + +const openapi = { + summary: 'Fetches multiple assignations based on specified criteria', + description: `This endpoint fetches a list of assignations based on various filtering, sorting, and pagination parameters. It is intended to provide a comprehensive overview of assignations that meet specified criteria, aiding in efficient data management and retrieval within the application. + +**Authentication:** Users must be authenticated to request the assignation data. Authentication tokens must be provided as part of the request headers to verify user identity and session validity. + +**Permissions:** Proper permissions are required to access this endpoint. Users need to have roles or rights specifically granting them access to view assignations. Failure to meet these permission checks will result in access being denied. + +Upon receiving a request, the \`getManyRest\` handler initiates a process to validate user authentication and authorization. Post validation, it employs a series of methods to apply filters, execute sorting mechanisms, and handle pagination details. The final data retrieval involves querying the database with the formulated conditions to compile a list of assignations that match the provided parameters. The result set is then formatted and delivered as a structured JSON response, providing the client with the requested data on assignations.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/getRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/getRest.js new file mode 100644 index 0000000000..ca1ecf9031 --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Manage assignment operations for users', + description: `This endpoint handles various operations related to user assignments within a platform, potentially including creating, deleting, updating, or retrieving assignments depending on the implemented methods. + +**Authentication:** Users need to be authenticated to perform operations on assignments. Access is restricted based on user authentication status, and attempts to access the endpoint without proper authentication will result in access being denied. + +**Permissions:** Specific permissions related to assignment management must be granted to the user. These permissions determine the types of operations the user can perform on assignments (like create, delete, update, retrieve). + +Upon receiving a request, the endpoint first verifies user authentication and permissions. If authentication or permissions checks fail, it returns an error response. If checks are successful, it proceeds to call the specific method associated with the action (create, delete, update, retrieve) on the assignments. This involves interfacing with database services to fetch or modify assignment data accordingly. Finally, the request results are formatted and returned to the user in JSON format, reflecting the outcome of their requested operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/schemas/request/getManyRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/schemas/request/getManyRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/schemas/request/getManyRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/schemas/request/getRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/schemas/request/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/schemas/request/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/schemas/response/getManyRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/schemas/response/getManyRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/schemas/response/getManyRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/schemas/response/getRest.js b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/schemas/response/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-assignables/backend/services/rest/openapi/assignations/schemas/response/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/assistance.rest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/assistance.rest.js index bd08179830..db9304717d 100644 --- a/plugins/leemons-plugin-attendance-control/backend/services/rest/assistance.rest.js +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/assistance.rest.js @@ -11,9 +11,11 @@ const { LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); +const rollCallRest = require('./openapi/assistance/rollCallRest'); /** @type {ServiceSchema} */ module.exports = { rollCallRest: { + openapi: rollCallRest.openapi, rest: { path: '/roll-call', method: 'POST', diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/assistance/rollCallRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/assistance/rollCallRest.js new file mode 100644 index 0000000000..ea7999a6ed --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/assistance/rollCallRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/rollCallRest'); +const { schema: xRequest } = require('./schemas/request/rollCallRest'); + +const openapi = { + summary: 'Manage attendance roll calls', + description: `This endpoint is designed to handle the management of attendance roll calls for classes or sessions. It facilitates the creation, modification, and viewing of roll call records for participants in educational or professional settings. + +**Authentication:** User authentication is mandatory for access. Without valid credentials, users will be prevented from performing any operations related to roll calls. + +**Permissions:** Users need specific permissions related to attendance management. Typically, this will include permissions like 'view_attendance', 'edit_attendance', and 'manage_attendance' depending on the level of access required for the operation. + +The controller flow begins with the incoming request which is authenticated and authorized to ensure the user has the necessary rights. Following authentication, the endpoint processes the request by calling respective methods such as \`createRollCall\`, \`editRollCall\`, or \`getRollCallDetails\`, depending on the action specified. These methods interact with underlying data storage systems to record or retrieve the necessary attendance information. Detailed error handling is incorporated to manage situations where the request cannot be fulfilled due to invalid inputs or conditions that do not meet business rules. The final response is generated and returned to the user in JSON format, providing either the requested data or an error message detailing any issues encountered.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/assistance/schemas/request/rollCallRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/assistance/schemas/request/rollCallRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/assistance/schemas/request/rollCallRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/assistance/schemas/response/rollCallRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/assistance/schemas/response/rollCallRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/assistance/schemas/response/rollCallRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/detailRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/detailRest.js new file mode 100644 index 0000000000..3e969f675f --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/detailRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/detailRest'); +const { schema: xRequest } = require('./schemas/request/detailRest'); + +const openapi = { + summary: 'Manage session details for attendance control', + description: `This endpoint is responsible for handling specific session-related requests in the attendance control module. It facilitates detailed operations on sessions such as retrieving, updating, or deleting session information based on given criteria. + +**Authentication:** User authentication is mandatory to ensure secure access to session details. Access is denied for requests without valid authentication credentials. + +**Permissions:** Users need specific permissions related to attendance control management. Without the required permissions, the request will not be processed. + +The flow of the controller involves several key methods orchestrated to manage session details effectively. Initially, the endpoint extracts necessary details from the incoming request (such as session identifiers or relevant parameters). It then interacts with the \`session\` core model to execute operations like \`getSessionDetailsById\`, \`updateSession\`, or \`deleteSession\`. These operations involve querying the database and manipulating session data as requested. The processes are securely handled, ensuring that only authorized actions are performed, corresponding to the authenticated user's permission levels. The response is carefully formatted to provide clear and accurate session details or status updates, depending on the operation performed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/getClassSessionsRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/getClassSessionsRest.js new file mode 100644 index 0000000000..4c03a892e0 --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/getClassSessionsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getClassSessionsRest'); +const { schema: xRequest } = require('./schemas/request/getClassSessionsRest'); + +const openapi = { + summary: 'Calculate and fetch session data for class schedules', + description: `This endpoint calculates and retrieves session data between specified dates based on the class schedules. It handles the task of mapping out all class sessions that fall within the given date range and according to the pre-defined class schedules in the system. + +**Authentication:** Users must be authenticated to request the session information. Without proper authentication, the endpoint will deny access to the data. + +**Permissions:** This endpoint requires the user to have 'view_sessions' permission. Users lacking this permission will not be able to retrieve any session data. + +The controller begins by invoking the \`calculeSessionsBetweenDatesFromSchedule\` method from the \`Sessions\` core, which takes in parameters for start and end dates, along with the schedule identifiers. This method computes all possible session occurrences within the provided dates and aligns them based on the class schedules. Once this calculation is complete, the result - a list of session times and details - is formatted and sent back through the response in JSON format, encompassing all sessions applicable within the specified date range.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/getTemporalSessionsRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/getTemporalSessionsRest.js new file mode 100644 index 0000000000..275b37f5ef --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/getTemporalSessionsRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getTemporalSessionsRest'); +const { + schema: xRequest, +} = require('./schemas/request/getTemporalSessionsRest'); + +const openapi = { + summary: 'Calculate temporal session intervals based on a user schedule', + description: `This endpoint calculates and retrieves all temporal session intervals for a specific user based on their defined schedule within a given date range. The functionality is crucial for planning and managing attendance in educational or organizational settings. + +**Authentication:** Users must be authenticated to access this functionality. An active session is required, and the user's credentials are verified against the session information stored on the server. + +**Permissions:** The user needs to have 'view_schedule' permission to retrieve and calculate session intervals. This permission ensures that only authorized users can access schedule-related data and operations. + +The endpoint begins by invoking the \`calculeSessionsBetweenDatesFromSchedule\` method from the \`Session\` core, which is designed to compute all possible session intervals within the specified dates based on the user's schedule. This method internally handles the complexity of intersecting user-specific schedules with general availability and predefined constraints. The computed data is then formatted and returned as a JSON response, providing a structured list of calculated session intervals for the requested dates.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/saveRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/saveRest.js new file mode 100644 index 0000000000..c5aa1f81a8 --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/saveRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveRest'); +const { schema: xRequest } = require('./schemas/request/saveRest'); + +const openapi = { + summary: 'Saves session data for a user', + description: `This endpoint is responsible for capturing and storing attendance-related session data for a specific user within the leemons platform. It primarily manages the session details and updates or creates attendance records based on the input data. + +**Authentication:** Users need to be authenticated to save session data. An absence of valid authentication will prevent access to this functionality. + +**Permissions:** The endpoint requires 'attendance-management' permission. Without this, users will not be able to save or modify session data. + +The flow starts with the endpoint parsing the incoming request to extract session data details. It then calls the \`saveSession\` method from the \`session\` core, which handles the logic for checking existing records and updating them or creating new entries if no existing record matches. This involves critical checks on data validation and integrity to ensure that only valid and complete data is processed. Errors in processing or validation will result in specific error messages being returned. On successful completion, a confirmation is sent back to the user indicating that the data has been successfully saved.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/request/detailRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/request/detailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/request/detailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/request/getClassSessionsRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/request/getClassSessionsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/request/getClassSessionsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/request/getTemporalSessionsRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/request/getTemporalSessionsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/request/getTemporalSessionsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/request/saveRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/request/saveRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/request/saveRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/response/detailRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/response/detailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/response/detailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/response/getClassSessionsRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/response/getClassSessionsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/response/getClassSessionsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/response/getTemporalSessionsRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/response/getTemporalSessionsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/response/getTemporalSessionsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/response/saveRest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/response/saveRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/openapi/session/schemas/response/saveRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-attendance-control/backend/services/rest/session.rest.js b/plugins/leemons-plugin-attendance-control/backend/services/rest/session.rest.js index a36c7acd65..8dc5891777 100644 --- a/plugins/leemons-plugin-attendance-control/backend/services/rest/session.rest.js +++ b/plugins/leemons-plugin-attendance-control/backend/services/rest/session.rest.js @@ -12,9 +12,14 @@ const { } = require('@leemons/middlewares'); const { getTemporalSessions, byIds, save } = require('../../core/session'); +const getTemporalSessionsRest = require('./openapi/session/getTemporalSessionsRest'); +const getClassSessionsRest = require('./openapi/session/getClassSessionsRest'); +const detailRest = require('./openapi/session/detailRest'); +const saveRest = require('./openapi/session/saveRest'); /** @type {ServiceSchema} */ module.exports = { getTemporalSessionsRest: { + openapi: getTemporalSessionsRest.openapi, rest: { path: '/temporal/:class', method: 'GET', @@ -38,6 +43,7 @@ module.exports = { }, }, getClassSessionsRest: { + openapi: getClassSessionsRest.openapi, rest: { path: '/class/sessions', method: 'POST', @@ -63,6 +69,7 @@ module.exports = { }, }, detailRest: { + openapi: detailRest.openapi, rest: { path: '/detail/:id', method: 'GET', @@ -86,6 +93,7 @@ module.exports = { }, }, saveRest: { + openapi: saveRest.openapi, rest: { path: '/save', method: 'POST', diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js index 415f72d523..ea0eb21b08 100644 --- a/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/messages.rest.js @@ -19,9 +19,16 @@ const { addView, } = require('../../core/messages'); +const listRest = require('./openapi/messages/listRest'); +const saveRest = require('./openapi/messages/saveRest'); +const getOverlapsRest = require('./openapi/messages/getOverlapsRest'); +const getActiveRest = require('./openapi/messages/getActiveRest'); +const addClickRest = require('./openapi/messages/addClickRest'); +const addViewRest = require('./openapi/messages/addViewRest'); /** @type {ServiceSchema} */ module.exports = { listRest: { + openapi: listRest.openapi, rest: { method: 'POST', path: '/list', @@ -63,6 +70,7 @@ module.exports = { }, }, saveRest: { + openapi: saveRest.openapi, rest: { method: 'POST', path: '/save', @@ -86,6 +94,7 @@ module.exports = { }, }, getOverlapsRest: { + openapi: getOverlapsRest.openapi, rest: { method: 'POST', path: '/overlaps', @@ -109,6 +118,7 @@ module.exports = { }, }, getActiveRest: { + openapi: getActiveRest.openapi, rest: { method: 'POST', path: '/active', @@ -123,6 +133,7 @@ module.exports = { }, }, addClickRest: { + openapi: addClickRest.openapi, rest: { method: 'POST', path: '/click', @@ -137,6 +148,7 @@ module.exports = { }, }, addViewRest: { + openapi: addViewRest.openapi, rest: { method: 'POST', path: '/view', diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/addClickRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/addClickRest.js new file mode 100644 index 0000000000..970fccc2d3 --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/addClickRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addClickRest'); +const { schema: xRequest } = require('./schemas/request/addClickRest'); + +const openapi = { + summary: 'Logs a new view or interaction with a specific message', + description: `This endpoint tracks user interactions with a message by logging each click or view event. It is designed to help in analyzing how messages are interacted with by users, allowing for improved message engagement and content refinements over time. + +**Authentication:** Users need to be logged in to log interactions with messages. This ensures that each interaction can be attributed to a specific user, enhancing the accuracy of the interaction data. + +**Permissions:** Users must have 'view' permissions on the board where the message is posted to interact with messages. If a user does not possess the required permissions, their interaction will not be logged, and they will receive an unauthorized access error. + +Upon receiving a request, the 'addClickRest' handler invokes the \`addClick\` method from the \`messages\` core module. This method takes parameters identifying the message and the user who interacted with it. It records each interaction as a click or view event in the database, tagging it with the user's ID and timestamp. The process ensures that all interactions are accurately logged and available for reporting and analytics. The response from this method confirms the successful logging of the interaction, returning a success status to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/addViewRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/addViewRest.js new file mode 100644 index 0000000000..ffc310fb86 --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/addViewRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addViewRest'); +const { schema: xRequest } = require('./schemas/request/addViewRest'); + +const openapi = { + summary: 'Increment view count for a specific message', + description: `This endpoint increments the view count of a specific message on the board. The operation counts each view from users to provide insights into the popularity and engagement level of the message. + +**Authentication:** User authentication is required to track the views adequately and ensure that views are counted accurately for each user. A valid user session is necessary to perform this operation. + +**Permissions:** Users need to have 'read' permission for the specific message to increment its view count. Attempting to access the endpoint without appropriate permissions will result in access denial. + +Initially, the endpoint validates the user's authentication status and checks if the user has 'read' permission for the message in question. Upon successful validation, it calls the \`addView\` method from the \`Messages\` core, passing the message's unique identifier. This method updates the view count in the database. The flow ensures that each view is logged only once per user session, using session management techniques to prevent duplicate counts. The updated view count data is then committed to the database, ensuring consistency and accuracy throughout the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/getActiveRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/getActiveRest.js new file mode 100644 index 0000000000..7edd8f3ec8 --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/getActiveRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getActiveRest'); +const { schema: xRequest } = require('./schemas/request/getActiveRest'); + +const openapi = { + summary: 'Fetch active board messages for the current user', + description: `This endpoint fetches all active messages from the message board that are available or relevant to the current user. The endpoint is designed to provide users with ongoing communications and announcements that are active within the platform's ecosystem. + +**Authentication:** User authentication is required to ensure secure access to the messages relevant to the authenticated users only. Access is denied if authentication credentials are not provided or are invalid. + +**Permissions:** Specific permissions related to the viewing of board messages are required. Users need the appropriate rights to access different types of messages depending on their roles or group assignments within the platform. + +Upon receiving a request, the \`getActive\` method in the \`messages\` backend core is initiated. This method conducts a filtered query through the messages database to retrieve messages that are marked as 'active' and applicable to the user based on their profile and permissions. It processes these data points through various permissions checks and filters to ascertain that each returned message adheres to the security and relevance standards set by the platform. The final output is a list of message IDs, which is then passed to another method (\`byIds\`) to fetch the full details of each active message. The response from the endpoint will include these detailed messages formatted as JSON.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/getOverlapsRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/getOverlapsRest.js new file mode 100644 index 0000000000..7eb1aee22f --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/getOverlapsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getOverlapsRest'); +const { schema: xRequest } = require('./schemas/request/getOverlapsRest'); + +const openapi = { + summary: 'Identify overlapping board message configurations', + description: `This endpoint checks for overlapping configurations in board messages. It is primarily used to prevent the scheduling of messages that may conflict with existing board configurations, ensuring clear and non-overlapping communication channels across various boards. + +**Authentication:** Users need to be authenticated to access this functionality. Authentication verifies user identity and ensures that actions performed are attributed to a specific and authorized user. + +**Permissions:** Appropriate permissions are required to access this endpoint. Users must have administrative or appropriate roles that grant them access to configure or manage board messages and their underlying settings. + +The endpoint initiates by calling the \`getOverlapsWithOtherConfigurations\` method from the \`messages\` module. This method attempts to analyze the incoming configuration against the database records of other configurations to identify any overlaps. It sorts these configurations based on pre-established criteria to prioritize newer timestamps or critical configurations. After processing, the method returns detailed information about any overlaps found, which includes data such as timestamps, affected message IDs, and the specifics of the overlap. This data is then passed back through the response payload in JSON format, providing comprehensive insights to the requester about any potential conflicts in board message scheduling.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/listRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/listRest.js new file mode 100644 index 0000000000..cba8e55c81 --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'List all board messages accessible to the current user', + description: `This endpoint enables the retrieval of all board messages that the current user has permissions to access. It is designed to facilitate communication within groups or boards by displaying relevant messages. + +**Authentication:** Users need to be authenticated to view the messages. This ensures that only authorized users can access sensitive or private communications within their groups or boards. + +**Permissions:** The user must have the appropriate permissions to view messages in specific boards. Access will be denied if the user does not have the necessary rights to the board or group messages they are attempting to access. + +Upon receiving a request, the endpoint initially calls the \`list\` method from the \`messages\` core, which invokes the \`getMessageIdsByFilters\` method to filter message IDs based on user permissions and other applied filters. Subsequently, \`byIds\` aggregates these IDs to retrieve detailed message data. The flow completes with the assembly of all relevant message information into a consumable format for the client, effectively responding with a structured list of messages available to the user under the established permissions.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/saveRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/saveRest.js new file mode 100644 index 0000000000..d25d4a68a8 --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/saveRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveRest'); +const { schema: xRequest } = require('./schemas/request/saveRest'); + +const openapi = { + summary: 'Save new or update existing board messages', + description: `This endpoint handles the creation or updates of board messages within the platform. It provides a mechanism for administrators or authorized users to post messages, which may contain announcements, updates, or prompts to board members. + +**Authentication:** Users need to be authenticated to access or use this endpoint for posting messages. An incorrect or missing authentication token will restrict access to this functionality. + +**Permissions:** Specific permissions such as 'board-message-create' or 'board-message-edit' are required depending on the action the user intends to perform (creating a new message or updating an existing one). + +Upon receiving a request, the endpoint triggers the \`save\` method in the \`messages\` core service, which involves a series of processes such as validating the message data against predefined formats and rules in \`validations/forms.js\`. Once validated, the method determines whether it involves a new message creation or an update to an existing message based on the provided identifiers. For a new message, it adds the message to the database and returns a success status along with the message details. For updates, it checks for existing messages and applies updates accordingly. The response includes the status of the operation and any associated details about the saved message.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/addClickRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/addClickRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/addClickRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/addViewRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/addViewRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/addViewRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/getActiveRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/getActiveRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/getActiveRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/getOverlapsRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/getOverlapsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/getOverlapsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/listRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/saveRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/saveRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/request/saveRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/addClickRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/addClickRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/addClickRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/addViewRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/addViewRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/addViewRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/getActiveRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/getActiveRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/getActiveRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/getOverlapsRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/getOverlapsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/getOverlapsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/listRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/saveRest.js b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/saveRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-board-messages/backend/services/rest/openapi/messages/schemas/response/saveRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-bulk-data/backend/services/rest/bulk.rest.js b/plugins/leemons-plugin-bulk-data/backend/services/rest/bulk.rest.js index 28bad06d38..eee430913c 100644 --- a/plugins/leemons-plugin-bulk-data/backend/services/rest/bulk.rest.js +++ b/plugins/leemons-plugin-bulk-data/backend/services/rest/bulk.rest.js @@ -73,7 +73,9 @@ async function bulkData({ docPath, ctx }) { // ······························································· // LOCALES - ctx.logger.debug(chalk`{cyan.bold BULK} {gray Init Platform & locales ...}`); + ctx.logger.debug( + chalk`{cyan.bold BULK} {gray Init Platform & locales ...}` + ); await initLocales({ file: docPath, ctx }); currentPhase = LOAD_PHASES.LOCALES; @@ -113,15 +115,23 @@ async function bulkData({ docPath, ctx }) { ctx.logger.info(chalk`{cyan.bold BULK} COMPLETED Users plugin`); currentPhase = LOAD_PHASES.USERS; - ctx.logger.debug(chalk`{cyan.bold BULK} {gray Starting Academic Rules plugin ...}`); - config.grades = await initGrades({ file: docPath, centers: config.centers, ctx }); + ctx.logger.debug( + chalk`{cyan.bold BULK} {gray Starting Academic Rules plugin ...}` + ); + config.grades = await initGrades({ + file: docPath, + centers: config.centers, + ctx, + }); ctx.logger.info(chalk`{cyan.bold BULK} COMPLETED Academic Rules plugin`); currentPhase = LOAD_PHASES.GRADES; // ······························································· // MEDIA LIBRARY - ctx.logger.debug(chalk`{cyan.bold BULK} {gray Starting Leebrary plugin ...}`); + ctx.logger.debug( + chalk`{cyan.bold BULK} {gray Starting Leebrary plugin ...}` + ); config.assets = await initLibrary({ file: docPath, config, ctx }); ctx.logger.info(chalk`{cyan.bold BULK} COMPLETED Leebrary plugin`); currentPhase = LOAD_PHASES.LIBRARY; @@ -129,19 +139,31 @@ async function bulkData({ docPath, ctx }) { // ······························································· // ACADEMIC PORTFOLIO -> Da error por duplicación de userAgentPermisions, expected & handled in academic portfolio - ctx.logger.debug(chalk`{cyan.bold BULK} {gray Starting Academic Portfolio plugin ...}`); - config.programs = await initAcademicPortfolio({ file: docPath, config, ctx }); - ctx.logger.info(chalk`{cyan.bold BULK} COMPLETED Academic Portfolio plugin`); + ctx.logger.debug( + chalk`{cyan.bold BULK} {gray Starting Academic Portfolio plugin ...}` + ); + config.programs = await initAcademicPortfolio({ + file: docPath, + config, + ctx, + }); + ctx.logger.info( + chalk`{cyan.bold BULK} COMPLETED Academic Portfolio plugin` + ); currentPhase = LOAD_PHASES.AP; - ctx.logger.debug(chalk`{cyan.bold BULK} {gray Updating Leebrary plugin with AP conf ...}`); + ctx.logger.debug( + chalk`{cyan.bold BULK} {gray Updating Leebrary plugin with AP conf ...}` + ); await updateLibrary({ file: docPath, config, ctx }); ctx.logger.info(chalk`{cyan.bold BULK} UPDATED Leebrary plugin`); // ······························································· // CALENDAR & KANBAN - ctx.logger.debug(chalk`{cyan.bold BULK} {gray Starting Calendar plugin ...}`); + ctx.logger.debug( + chalk`{cyan.bold BULK} {gray Starting Calendar plugin ...}` + ); await initCalendar({ file: docPath, config, ctx }); ctx.logger.info(chalk`{cyan.bold BULK} COMPLETED Calendar plugin`); currentPhase = LOAD_PHASES.CALENDAR; @@ -179,7 +201,11 @@ async function loadFromFile(ctx, { isAsync = false }) { const file = await createTempFile({ readStream: ctx.params }); if (isAsync) { bulkData({ docPath: file.path, ctx }); - return { status: 200, currentPhase: 'Proccessing file', overallProgress: '0%' }; + return { + status: 200, + currentPhase: 'Proccessing file', + overallProgress: '0%', + }; } await bulkData({ docPath: file.path, ctx }); return { status: 200 }; @@ -190,11 +216,18 @@ async function loadFromFile(ctx, { isAsync = false }) { httpStatusCode: 500, }); } - throw new LeemonsError(ctx, { message: 'Unexpected error', httpStatusCode: 500 }); + throw new LeemonsError(ctx, { + message: 'Unexpected error', + httpStatusCode: 500, + }); } +const loadRest = require('./openapi/bulk/loadRest'); +const statusRest = require('./openapi/bulk/statusRest'); +/** @type {ServiceSchema} */ module.exports = { loadRest: { + openapi: loadRest.openapi, rest: { path: '/load-from-file', method: 'POST', @@ -217,6 +250,7 @@ module.exports = { }, }, statusRest: { + openapi: statusRest.openapi, rest: { path: '/load-from-file', method: 'GET', diff --git a/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/loadRest.js b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/loadRest.js new file mode 100644 index 0000000000..812295c788 --- /dev/null +++ b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/loadRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/loadRest'); +const { schema: xRequest } = require('./schemas/request/loadRest'); + +const openapi = { + summary: 'Manages bulk data operations for the Leemons platform', + description: `This endpoint handles the manipulation and management of bulk data within the Leemons platform. It allows for batch processing of data operations such as imports, exports, and updates, streamlining tasks that require handling large volumes of data simultaneously. + +**Authentication:** Users need to be authenticated to perform bulk data operations. Proper authentication ensures secure access to the functionality, preventing unauthorized data manipulation. + +**Permissions:** This endpoint requires specific permissions related to bulk data management. Only users granted these permissions can execute bulk data operations to maintain data integrity and security within the platform. + +From the initial request, the \`loadRest\` handler orchestrates multiple stages of data processing. It begins by validating the user's authentication and permissions. Once validated, it engages various service methods designed to handle specific bulk data tasks, such as parsing large datasets or updating multiple records based on predefined criteria. These operations might utilize optimized database transactions to handle large-scale changes efficiently. The flow from request to response is meticulously structured to maintain performance and error handling, ensuring that the user receives clear feedback on the operation's outcome.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/schemas/request/loadRest.js b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/schemas/request/loadRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/schemas/request/loadRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/schemas/request/statusRest.js b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/schemas/request/statusRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/schemas/request/statusRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/schemas/response/loadRest.js b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/schemas/response/loadRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/schemas/response/loadRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/schemas/response/statusRest.js b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/schemas/response/statusRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/schemas/response/statusRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/statusRest.js b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/statusRest.js new file mode 100644 index 0000000000..994f7d44eb --- /dev/null +++ b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/bulk/statusRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/statusRest'); +const { schema: xRequest } = require('./schemas/request/statusRest'); + +const openapi = { + summary: 'Check bulk data processing status', + description: `This endpoint checks the current status of a bulk data processing task. It allows users to monitor the progress of data uploads or other asynchronous bulk operations they have initiated. + +**Authentication:** User authentication is required to track the progress of their own bulk data processing tasks. If unauthenticated, the endpoint will restrict access. + +**Permissions:** This endpoint requires users to have 'bulk_data_view' permission to check the status of bulk data processing tasks. Access without the appropriate permissions will result in a denial of service. + +Upon receiving a request, the endpoint uses the \`checkStatus\` method in the BulkDataService. This method queries the database to retrieve the current status and details of the requested bulk data processing task. The query filters tasks based on the user's session information to ensure that users can only access data related to their tasks. The response includes detailed information about the task's progression, such as the percentage completed, any errors encountered, and the expected time of completion. The output is formatted as a JSON object and returned to the user, providing a clear and informative status update.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/users/initSuperRest.js b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/users/initSuperRest.js new file mode 100644 index 0000000000..c583203882 --- /dev/null +++ b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/users/initSuperRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/initSuperRest'); +const { schema: xRequest } = require('./schemas/request/initSuperRest'); + +const openapi = { + summary: 'Initialize superuser capabilities for specified users', + description: `This endpoint facilitates the initialization of superuser capabilities for selected users within the Leemonade platform specifically within the context of bulk user operations. This is typically used in cases where advanced level permissions need to be assigned programmatically to users who are managing various operational aspects. + +**Authentication:** User authentication is mandatory to verify the legitimacy and authorization of the requester. Unauthenticated access requests will be denied, ensuring secure operations within the platform. + +**Permissions:** The execution of this endpoint requires administrative privileges. Only users who possess such elevated permissions can initiate superuser status assignments, maintaining strict control over powerful platform capabilities. + +The endpoint processes requests by first determining if the \`ctx\` (context) contains a valid authenticated user session. If the session is valid, it checks if the user has administrative permissions. If both conditions are satisfied, the \`initSuperRest\` action within \`users.rest.js\` interacts with the underlying user management systems to assign superuser rights. It uses specific methods to update user statuses in the database, ensuring that the changes adhere to security and operational protocols of the Leemonade platform. After successful updates, it returns confirmation of superuser status initialization to the requester.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/users/schemas/request/initSuperRest.js b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/users/schemas/request/initSuperRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/users/schemas/request/initSuperRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/users/schemas/response/initSuperRest.js b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/users/schemas/response/initSuperRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-bulk-data/backend/services/rest/openapi/users/schemas/response/initSuperRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-bulk-data/backend/services/rest/users.rest.js b/plugins/leemons-plugin-bulk-data/backend/services/rest/users.rest.js index bad1773a8c..75a662c874 100644 --- a/plugins/leemons-plugin-bulk-data/backend/services/rest/users.rest.js +++ b/plugins/leemons-plugin-bulk-data/backend/services/rest/users.rest.js @@ -1,7 +1,10 @@ const { LeemonsError } = require('@leemons/error'); +const initSuperRest = require('./openapi/users/initSuperRest'); +/** @type {ServiceSchema} */ module.exports = { initSuperRest: { + openapi: initSuperRest.openapi, rest: { path: '/init-super', method: 'POST', @@ -10,7 +13,9 @@ module.exports = { if (process.env.NODE_ENV !== 'production') { try { if (!ctx.params.password) - throw new Error('A password field must be included in the request body'); + throw new Error( + 'A password field must be included in the request body' + ); await ctx.call('admin.settings.setLanguages', { langs: { code: 'es', name: 'Español' }, @@ -32,10 +37,16 @@ module.exports = { return { status: 200 }; } catch (e) { - throw new LeemonsError(ctx, { message: e.message, httpStatusCode: 500 }); + throw new LeemonsError(ctx, { + message: e.message, + httpStatusCode: 500, + }); } } else { - throw new LeemonsError(ctx, { message: 'Endpoint disabled', httpStatusCode: 401 }); + throw new LeemonsError(ctx, { + message: 'Endpoint disabled', + httpStatusCode: 401, + }); } }, }, diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js b/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js index 549d14b762..f13517b62a 100644 --- a/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js +++ b/plugins/leemons-plugin-calendar/backend/services/rest/calendar.rest.js @@ -10,7 +10,10 @@ const { LeemonsMiddlewareAuthenticated, LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); -const { getCalendarsToFrontend, getScheduleToFrontend } = require('../../core/calendar'); +const { + getCalendarsToFrontend, + getScheduleToFrontend, +} = require('../../core/calendar'); const eventTypesService = require('../../core/event-types'); const kanbanColumnsService = require('../../core/kanban-columns'); const listKanbanEventOrders = require('../../core/kanban-event-orders'); @@ -22,9 +25,30 @@ const { removeFromUser, } = require('../../core/events'); +const getCalendarRest = require('./openapi/calendar/getCalendarRest'); +const getScheduleRest = require('./openapi/calendar/getScheduleRest'); +const getEventTypesRest = require('./openapi/calendar/getEventTypesRest'); +const addEventRest = require('./openapi/calendar/addEventRest'); +const updateEventRest = require('./openapi/calendar/updateEventRest'); +const updateEventSubTasksRest = require('./openapi/calendar/updateEventSubTasksRest'); +const removeEventRest = require('./openapi/calendar/removeEventRest'); +const listKanbanColumnsRest = require('./openapi/calendar/listKanbanColumnsRest'); +const listKanbanEventOrdersRest = require('./openapi/calendar/listKanbanEventOrdersRest'); +const saveKanbanEventOrdersRest = require('./openapi/calendar/saveKanbanEventOrdersRest'); +const addCalendarConfigRest = require('./openapi/calendar/addCalendarConfigRest'); +const updateCalendarConfigRest = require('./openapi/calendar/updateCalendarConfigRest'); +const listCalendarConfigRest = require('./openapi/calendar/listCalendarConfigRest'); +const detailCalendarConfigRest = require('./openapi/calendar/detailCalendarConfigRest'); +const removeCalendarConfigRest = require('./openapi/calendar/removeCalendarConfigRest'); +const getCentersWithOutAssignRest = require('./openapi/calendar/getCentersWithOutAssignRest'); +const getCalendarConfigCalendarsRest = require('./openapi/calendar/getCalendarConfigCalendarsRest'); +const addConfigEventRest = require('./openapi/calendar/addConfigEventRest'); +const updateConfigEventRest = require('./openapi/calendar/updateConfigEventRest'); +const removeConfigEventRest = require('./openapi/calendar/removeConfigEventRest'); /** @type {ServiceSchema} */ module.exports = { getCalendarRest: { + openapi: getCalendarRest.openapi, rest: { method: 'POST', path: '/', @@ -45,6 +69,7 @@ module.exports = { }, }, getScheduleRest: { + openapi: getScheduleRest.openapi, rest: { method: 'POST', path: '/schedule', @@ -65,6 +90,7 @@ module.exports = { }, }, getEventTypesRest: { + openapi: getEventTypesRest.openapi, rest: { method: 'GET', path: '/event-types', @@ -76,6 +102,7 @@ module.exports = { }, }, addEventRest: { + openapi: addEventRest.openapi, rest: { method: 'POST', path: '/add/event', @@ -87,6 +114,7 @@ module.exports = { }, }, updateEventRest: { + openapi: updateEventRest.openapi, rest: { method: 'POST', path: '/update/event', @@ -108,11 +136,16 @@ module.exports = { __v, ...body } = ctx.params.event; - const event = await updateFromUser({ id: ctx.params.id, data: body, ctx }); + const event = await updateFromUser({ + id: ctx.params.id, + data: body, + ctx, + }); return { status: 200, event }; }, }, updateEventSubTasksRest: { + openapi: updateEventSubTasksRest.openapi, rest: { method: 'POST', path: '/update/event-subtask', @@ -124,6 +157,7 @@ module.exports = { }, }, removeEventRest: { + openapi: removeEventRest.openapi, rest: { method: 'POST', path: '/remove/event', @@ -135,6 +169,7 @@ module.exports = { }, }, listKanbanColumnsRest: { + openapi: listKanbanColumnsRest.openapi, rest: { method: 'GET', path: '/kanban/list/columns', @@ -146,6 +181,7 @@ module.exports = { }, }, listKanbanEventOrdersRest: { + openapi: listKanbanEventOrdersRest.openapi, rest: { method: 'GET', path: '/kanban/list/event/orders', @@ -157,6 +193,7 @@ module.exports = { }, }, saveKanbanEventOrdersRest: { + openapi: saveKanbanEventOrdersRest.openapi, rest: { method: 'POST', path: '/kanban/save/event/orders', @@ -168,6 +205,7 @@ module.exports = { }, }, addCalendarConfigRest: { + openapi: addCalendarConfigRest.openapi, rest: { method: 'POST', path: '/configs/add', @@ -183,11 +221,15 @@ module.exports = { }), ], async handler(ctx) { - const config = await calendarConfigsService.add({ ...ctx.params.config, ctx }); + const config = await calendarConfigsService.add({ + ...ctx.params.config, + ctx, + }); return { status: 200, config }; }, }, updateCalendarConfigRest: { + openapi: updateCalendarConfigRest.openapi, rest: { method: 'POST', path: '/configs/update/:id', @@ -212,6 +254,7 @@ module.exports = { }, }, listCalendarConfigRest: { + openapi: listCalendarConfigRest.openapi, rest: { method: 'GET', path: '/configs/list', @@ -234,6 +277,7 @@ module.exports = { }, }, detailCalendarConfigRest: { + openapi: detailCalendarConfigRest.openapi, rest: { method: 'GET', path: '/configs/detail/:id', @@ -257,6 +301,7 @@ module.exports = { }, }, removeCalendarConfigRest: { + openapi: removeCalendarConfigRest.openapi, rest: { method: 'DELETE', path: '/configs/remove/:id', @@ -280,6 +325,7 @@ module.exports = { }, }, getCentersWithOutAssignRest: { + openapi: getCentersWithOutAssignRest.openapi, rest: { method: 'GET', path: '/configs/centers-with-out-assign', @@ -302,6 +348,7 @@ module.exports = { }, }, getCalendarConfigCalendarsRest: { + openapi: getCalendarConfigCalendarsRest.openapi, rest: { method: 'GET', path: '/configs/calendars/:id', @@ -326,6 +373,7 @@ module.exports = { }, }, addConfigEventRest: { + openapi: addConfigEventRest.openapi, rest: { method: 'POST', path: '/configs/event/add', @@ -349,6 +397,7 @@ module.exports = { }, }, updateConfigEventRest: { + openapi: updateConfigEventRest.openapi, rest: { method: 'POST', path: '/configs/event/update', @@ -372,6 +421,7 @@ module.exports = { }, }, removeConfigEventRest: { + openapi: removeConfigEventRest.openapi, rest: { method: 'POST', path: '/configs/event/remove', diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/addCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/addCalendarConfigRest.js new file mode 100644 index 0000000000..89bab5c795 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/addCalendarConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addCalendarConfigRest'); +const { schema: xRequest } = require('./schemas/request/addCalendarConfigRest'); + +const openapi = { + summary: 'Add a new calendar configuration', + description: `This endpoint enables the creation of a new calendar configuration within the system. It allows for setting up various properties and rules associated with specific calendars, enhancing the customization and functionality for users. + +**Authentication:** Users must be authenticated to access this endpoint. This ensures that only logged-in users can create new calendar configurations, providing a level of security and user data integrity. + +**Permissions:** The user needs to have 'calendar_create' permission to execute this action. This requirement ensures that only users with the necessary rights can make changes to the calendar configurations. + +After receiving the request, the \`addCalendarConfigRest\` handler initiates a process to validate the provided data against predefined schemas. If the data is valid, it calls the \`add\` method from the \`calendar-configs\` core module which interacts with the database to insert new configuration records. This process includes error handling to manage any issues that arise during the database operation. Upon successful creation, a confirmation response is generated and sent back to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/addConfigEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/addConfigEventRest.js new file mode 100644 index 0000000000..55ffc796c1 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/addConfigEventRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addConfigEventRest'); +const { schema: xRequest } = require('./schemas/request/addConfigEventRest'); + +const openapi = { + summary: 'Adds a new configuration event to a calendar', + description: `This endpoint allows the creation of a new event within a specific calendar configuration. The event details such as title, time, and description are sent to the server, and a new event entry is created in the database associated with the indicated calendar. + +**Authentication:** Users need to be authenticated to add events. Any attempt to access this endpoint without a valid authentication token will result in denial of access. + +**Permissions:** Users must have the 'calendar.manage' permission to add new events to a calendar. Without this permission, the server will reject the request. + +Upon receiving a request, the \`addConfigEventRest\` handler in the \`calendar.rest.js\` file triggers the \`addEvent\` method in the \`CalendarConfigs\` core service. This method processes the input data, checking for validity and completeness, then interacts with the database to insert the new event record. Once the addition is successful, a response indicating the successful creation of the event is sent back to the client. Error handling is incorporated to manage and respond to any issues that occur during the event creation process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/addEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/addEventRest.js new file mode 100644 index 0000000000..3662cb3b39 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/addEventRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addEventRest'); +const { schema: xRequest } = require('./schemas/request/addEventRest'); + +const openapi = { + summary: 'Adds a new event to the calendar', + description: `This endpoint allows users to add a new event to the calendar system. The operation includes creating an event entry in the database and may involve notifications to other users based on the event details provided. + +**Authentication:** User authentication is required to ensure the security of the event data. Only authenticated users can add events. + +**Permissions:** Users need to have event creation privileges. Specific roles or permissions must be checked before allowing a user to create an event. + +Upon receiving a request to create an event, the \`addEventRest\` handler calls the \`addFromUser\` method in the events core module which processes the user's data along with the event information. It checks for necessary permissions and authentication status of the user. Following validation, it proceeds to add the event data into the calendar's database. If the event creation involves notifying other users, the \`addToCalendar\` method in the notifications core module is triggered, managing the notification logic as per the defined settings.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/detailCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/detailCalendarConfigRest.js new file mode 100644 index 0000000000..3eb2371d8f --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/detailCalendarConfigRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/detailCalendarConfigRest'); +const { + schema: xRequest, +} = require('./schemas/request/detailCalendarConfigRest'); + +const openapi = { + summary: 'Displays detailed configuration of a specific calendar', + description: `This endpoint retrieves detailed configuration data for a specific calendar based on the provided calendar ID. The endpoint aims to provide essential configuration details that might include settings like visibility, editing permissions, event rules, and other relevant attributes that define the behavior of the calendar. + +**Authentication:** Users need to be authenticated to request calendar configuration details. Attempting to access this endpoint without a valid authentication token will result in a denial of service. + +**Permissions:** The user must have the 'view_calendar_details' permission. Without this permission, the endpoint will restrict access, ensuring that only authorized users can view detailed calendar configurations. + +Upon receiving a request, the endpoint first verifies user authentication and checks if the user has the required permissions to view calendar details. If these checks are passed, the service calls the \`detail\` method in the 'calendar-configs' core with the identifier of the calendar to pull detailed information. This method interacts with the database to fetch comprehensive data about the calendar's configuration. The response is then formatted into a structured JSON object containing all relevant calendar configurations, which is sent back to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getCalendarConfigCalendarsRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getCalendarConfigCalendarsRest.js new file mode 100644 index 0000000000..ddd2e7fae4 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getCalendarConfigCalendarsRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getCalendarConfigCalendarsRest'); +const { + schema: xRequest, +} = require('./schemas/request/getCalendarConfigCalendarsRest'); + +const openapi = { + summary: 'Fetches calendar configurations associated with a specific center', + description: `This endpoint retrieves all configurations of the calendar associated with a given center ID, primarily focusing on organizing and managing calendar events relevant to the specific center. + +**Authentication:** User authentication is required to ensure secure access to calendar configurations. Users must provide valid credentials to interact with this endpoint. + +**Permissions:** The user needs to have 'view_calendar_configurations' permission to fetch calendar settings. This ensures that only authorized personnel can access sensitive calendar data. + +The process flow begins with the \`getCalendars\` method in the \`calendar-configs\` core. This method takes the center ID from the request parameter and accesses the database to retrieve all calendar configurations related to that center. The method handles data querying and ensures that only appropriate data is fetched based on the provided center ID. The response returns a detailed list of calendar configurations, including types of events, scheduling details, and customization options, formatted as a JSON object.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getCalendarRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getCalendarRest.js new file mode 100644 index 0000000000..88ee7b5872 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getCalendarRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getCalendarRest'); +const { schema: xRequest } = require('./schemas/request/getCalendarRest'); + +const openapi = { + summary: 'Manage calendar configurations by center', + description: `This endpoint is responsible for handling calendar configurations associated with a specific center. It allows operations such as retrieving, updating, and deleting calendar configurations based on the provided center ID. + +**Authentication:** Users need to be authenticated to interact with calendar configurations. Failure to provide a valid authentication token will result in denial of access to the endpoint. + +**Permissions:** Users must have administrative roles or specific permissions related to calendar management within the center. These permissions check ensures that only authorized personnel can manage or access calendar configurations. + +Upon receiving a request, the endpoint first verifies user authentication and permissions. If these checks are successful, the \`getByCenterId\` method from the \`calendar-configs\` core is called, receiving the center ID as its argument. This method queries the database for all calendar configurations linked to the specified center. The process involves database operations to ensure data integrity and privacy. Finally, the response is formulated based on the retrieved data, which includes detailed information about each calendar configuration, and sent back to the client in a structured JSON format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getCentersWithOutAssignRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getCentersWithOutAssignRest.js new file mode 100644 index 0000000000..c54dc7d318 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getCentersWithOutAssignRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getCentersWithOutAssignRest'); +const { + schema: xRequest, +} = require('./schemas/request/getCentersWithOutAssignRest'); + +const openapi = { + summary: 'Fetch centers without assigned calendars', + description: `This endpoint fetches all educational or organizational centers that currently do not have any calendar configurations assigned to them. The result helps administrators to identify which entities need attention for calendar setup. + +**Authentication:** Users need to be authenticated to ensure secure access to this information. Authentication is verified by checking the provided user token against active sessions or user databases. + +**Permissions:** This endpoint requires administrative permissions as it deals with broad organizational data that involves multiple centers. Users must have the 'manage_calendars' or equivalent rights to invoke this endpoint. + +After authentication and permission checks are validated, the endpoint proceeds by invoking the \`getCentersWithOutAssign\` method of the \`CalendarConfigs\` core service. This method performs a database query to list all centers that lack associated calendar configurations. The process involves filtering data based on specific attributes and associations in the organizational model. The outcome is then formatted and returned in a structured JSON response, listing the centers in question.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getEventTypesRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getEventTypesRest.js new file mode 100644 index 0000000000..7e53ff7d12 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getEventTypesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getEventTypesRest'); +const { schema: xRequest } = require('./schemas/request/getEventTypesRest'); + +const openapi = { + summary: 'List all event types available in the calendar', + description: `This endpoint lists all event types that are available within the calendar system. It is responsible for retrieving a structured list of event types, which may include their unique identifiers, descriptions, and other relevant metadata. + +**Authentication:** Access to this endpoint requires the user to be authenticated. An authentication check is performed to ensure only authenticated users can retrieve the list of event types. + +**Permissions:** Users need to have the appropriate permissions to view event types. This typically involves permissions related to accessing or managing calendar events within the system. + +Upon receiving a request, the handler invokes the \`listEventTypes\` function from the calendar's event-types core module. This function queries the database for all existing event types and compiles them into a list. Each event type in the list includes details such as the name, description, and any relevant configuration settings. After retrieval, the data is formatted and sent back to the client as a JSON response, providing a comprehensive overview of available event types in the calendar.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getScheduleRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getScheduleRest.js new file mode 100644 index 0000000000..4d5855f285 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/getScheduleRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getScheduleRest'); +const { schema: xRequest } = require('./schemas/request/getScheduleRest'); + +const openapi = { + summary: "Fetches a user's schedule for display on the frontend", + description: `This endpoint extracts and formats a specific user’s schedule to be suitably displayed on a frontend application. The schedule encompasses all calendar entries, including personal events and system-wide notifications that are applicable to the user. + +**Authentication:** Users must be authenticated to retrieve their schedule. Failure to provide valid authentication credentials will prevent access to this endpoint. + +**Permissions:** The user needs to have the 'view_schedule' permission to fetch their personal schedule data. Without this permission, the endpoint will restrict access and return an unauthorized error. + +The endpoint begins by invoking the \`getScheduleToFrontend\` function from the \`calendar\` module in \`leemons-plugin-calendar\`'s backend. This function takes user identification (extracted from the authentication context) and consults the backend's calendar database to gather all relevant schedule entries. It processes this data to ensure that it conforms to the requirements for user-friendly display, including formatting of date and time according to user locale settings. Finally, the method returns the processed schedule data as a JSON object, which is then sent back to the client as the HTTP response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/listCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/listCalendarConfigRest.js new file mode 100644 index 0000000000..b62a950e52 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/listCalendarConfigRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/listCalendarConfigRest'); +const { + schema: xRequest, +} = require('./schemas/request/listCalendarConfigRest'); + +const openapi = { + summary: 'List all calendar configurations', + description: `This endpoint lists all calendar configurations available within the system. It retrieves a comprehensive list of calendar setups and their related settings, formatted for easy viewing or further processing by the client application. + +**Authentication:** Users need to be authenticated to request the list of calendar configurations. Unauthorized access attempts will be rejected. + +**Permissions:** Users require specific permissions to view all calendar configurations. The required permissions depend on the organization's settings and the user's role within the application. + +Upon receiving a request, the \`listCalendarConfigRest\` handler first verifies the user's authentication status and permissions. This verification ensures that only authorized users can access the calendar configuration data. If authentication and permission checks are passed, the handler then calls the \`list\` method from the \`CalendarConfigs\` core service. This method gathers all available calendar configurations from the database and formats them into a structured list. The response to the client contains this list in a JSON format, making it suitable for further usage in various application scenarios.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/listKanbanColumnsRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/listKanbanColumnsRest.js new file mode 100644 index 0000000000..83a8de81c5 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/listKanbanColumnsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listKanbanColumnsRest'); +const { schema: xRequest } = require('./schemas/request/listKanbanColumnsRest'); + +const openapi = { + summary: 'List all Kanban columns associated with a specific calendar', + description: `This endpoint fetches a list of all Kanban columns that are associated with a specific calendar within the leemons plugin calendar system. The endpoint serves as a utility for front-end services to render organized Kanban views based on the user's calendar data. + +**Authentication:** Users must be authenticated to request the list of Kanban columns. De-authenticated or improperly authenticated requests will be promptly denied, safeguarding the user-specific data. + +**Permissions:** Proper access rights are required to view the Kanban columns. Typically, users need permissions to access the specific calendar or project management features that relate to Kanban management. + +The process begins when the \`listKanbanColumnsRest\` action is invoked, pulling the relevant calendar ID from the request parameters. It then calls the \`list\` method from the \`kanban-columns\` core module. This module queries the database for all columns linked to the specified calendar ID, ensuring that the response is tailored to the authenticated user's context and permissions. Each column is then formatted appropriately before being sent back to the client as a JSON array in the HTTP response. This ensures users receive an accurate, up-to-date representation of their calendar's Kanban layout.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/listKanbanEventOrdersRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/listKanbanEventOrdersRest.js new file mode 100644 index 0000000000..8b7fcf0509 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/listKanbanEventOrdersRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/listKanbanEventOrdersRest'); +const { + schema: xRequest, +} = require('./schemas/request/listKanbanEventOrdersRest'); + +const openapi = { + summary: 'Lists all Kanban event orders associated with a user', + description: `This endpoint provides a list of all Kanban event orders that are associated with the authenticated user's calendar. Events are sorted according to their order in the Kanban board, which represents their priority or sequence in the user's workflow. + +**Authentication:** Users must be logged in to access their Kanban event orders. The endpoint checks for a valid session or token before proceeding with the request. + +**Permissions:** This endpoint requires the 'view_kanban_events' permission, indicating that the user has the right to view Kanban events within their scope of accessibility. + +Upon receiving a GET request, \`listKanbanEventOrdersRest\` initially verifies the user's authentication status and permissions. If the checks are valid, it then calls the \`list\` function from 'kanban-event-orders' directory, which queries the database for all Kanban events linked to the user. This data retrieval involves sorting mechanisms based on pre-defined criteria such as event priority or scheduled dates. After successful retrieval, the Kanban event data is formatted and returned as a JSON response to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/removeCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/removeCalendarConfigRest.js new file mode 100644 index 0000000000..c33221911e --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/removeCalendarConfigRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/removeCalendarConfigRest'); +const { + schema: xRequest, +} = require('./schemas/request/removeCalendarConfigRest'); + +const openapi = { + summary: 'Remove a specific calendar configuration', + description: `This endpoint is responsible for deleting a calendar configuration identified by its unique ID. The operation removes the specified configuration from the system, which includes all associated scheduling and metadata, effectively rendering the calendar unusable for future activities. + +**Authentication:** Users need to be authenticated to perform this operation. A valid session or authentication token must be provided to authorize the request. + +**Permissions:** Users require specific permissions related to calendar management. Typically, this includes permissions like 'calendar.delete' or 'admin.calendar' to ensure that only authorized personnel can remove calendar configurations. + +Upon receiving the request, the \`removeCalendarConfigRest\` action first verifies user's authentication and permissions. It then proceeds to invoke the \`remove\` method from the \`CalendarConfigs\` core. This method is tasked with executing the deletion of the calendar configuration from the database. If the deletion is successful, the endpoint returns a confirmation message. If the specified configuration does not exist or the user lacks adequate permissions, it responds with an appropriate error message.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/removeConfigEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/removeConfigEventRest.js new file mode 100644 index 0000000000..464dfbb205 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/removeConfigEventRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeConfigEventRest'); +const { schema: xRequest } = require('./schemas/request/removeConfigEventRest'); + +const openapi = { + summary: 'Remove a specific calendar configuration event', + description: `This endpoint handles the deletion of a specific event from a calendar configuration. The event to be deleted is identified by its unique event ID, which must be provided as part of the request. The operation ensures that the specified event is properly removed from the system's calendar configuration, maintaining the integrity of the remaining calendar events. + +**Authentication:** Users must be authenticated and possess a valid session token to access this endpoint. Unauthorized access attempts will be logged and denied. + +**Permissions:** The user needs to have administrative rights or specific permissions on the calendar module to perform event deletions. Lack of appropriate permissions will result in an access denial response. + +Upon receiving the request, the server invokes the \`removeEvent\` method from the \`CalendarConfigs\` core. This method takes the event ID from the request parameters and performs a query to locate the event within the database. If the event is found, it proceeds with the deletion process, which involves removing the event record and ensuring that any references to this event in other parts of the application are also updated or removed as necessary. The method concludes by returning a success message if the deletion is successful, or an error message detailing why the deletion could not be completed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/removeEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/removeEventRest.js new file mode 100644 index 0000000000..11dfe4b917 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/removeEventRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeEventRest'); +const { schema: xRequest } = require('./schemas/request/removeEventRest'); + +const openapi = { + summary: 'Removes a specific event from the calendar', + description: `This endpoint removes an existing event based on the provided event ID. The operation checks if the event exists and if the user has appropriate permissions to delete the event. The deletion is either a soft delete or a hard delete based on certain conditions like event recurrence or links. + +**Authentication:** Users need to be authenticated to perform deletion of an event. An invalid or missing authentication token will result in endpoint access denial. + +**Permissions:** The user requires specific permissions to delete events. Typically, this includes permissions like 'event.delete' or 'admin' rights on the calendar where the event is scheduled. + +The process begins with the \`removeOrCancel\` function, which first verifies if the user has the required permissions to delete the event. It then checks if the event needs a soft delete (just marking the event as deleted) or a hard delete (completely removing all traces of the event from the database). This decision is based on factors such as whether the event is recurring or has dependencies, such as linked events or notifications. After the appropriate deletion operation, a confirmation is sent back to the user indicating the success of the deletion, or an error message is returned in case of failure.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/saveKanbanEventOrdersRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/saveKanbanEventOrdersRest.js new file mode 100644 index 0000000000..a761b7ec78 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/saveKanbanEventOrdersRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/saveKanbanEventOrdersRest'); +const { + schema: xRequest, +} = require('./schemas/request/saveKanbanEventOrdersRest'); + +const openapi = { + summary: 'Save Kanban event order configurations', + description: `This endpoint is designed to save changes to the order of kanban events as defined by the user in a calendar application. The updated order reflects how events are displayed or prioritized in the user's kanban view. + +**Authentication:** Users need to be authenticated to modify the order of kanban events. Access to this functionality is restricted based on user authentication status. + +**Permissions:** This endpoint requires the user to have the 'edit_kanban_order' permission. Without this, the user's request to reorder kanban events will be denied. + +Upon receiving a request, the \`saveKanbanEventOrdersRest\` method in the \`calendar.rest.js\` controller validates the user's authentication and permissions. If validation succeeds, it then calls the \`save\` method from the \`kanban-event-orders\` core module. This method processes the input, which typically includes an array of event IDs and the desired order. It ensures that the order changes comply with business logic, such as checking for conflicts or invalid data. Once the order is successfully updated in the database, the endpoint sends a response that indicates success to the client, along with possibly returning the updated order of events.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/addCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/addCalendarConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/addCalendarConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/addConfigEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/addConfigEventRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/addConfigEventRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/addEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/addEventRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/addEventRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/detailCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/detailCalendarConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/detailCalendarConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getCalendarConfigCalendarsRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getCalendarConfigCalendarsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getCalendarConfigCalendarsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getCalendarRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getCalendarRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getCalendarRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getCentersWithOutAssignRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getCentersWithOutAssignRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getCentersWithOutAssignRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getEventTypesRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getEventTypesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getEventTypesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getScheduleRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getScheduleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/getScheduleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/listCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/listCalendarConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/listCalendarConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/listKanbanColumnsRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/listKanbanColumnsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/listKanbanColumnsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/listKanbanEventOrdersRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/listKanbanEventOrdersRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/listKanbanEventOrdersRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/removeCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/removeCalendarConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/removeCalendarConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/removeConfigEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/removeConfigEventRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/removeConfigEventRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/removeEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/removeEventRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/removeEventRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/saveKanbanEventOrdersRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/saveKanbanEventOrdersRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/saveKanbanEventOrdersRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/updateCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/updateCalendarConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/updateCalendarConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/updateConfigEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/updateConfigEventRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/updateConfigEventRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/updateEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/updateEventRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/updateEventRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/updateEventSubTasksRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/updateEventSubTasksRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/request/updateEventSubTasksRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/addCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/addCalendarConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/addCalendarConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/addConfigEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/addConfigEventRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/addConfigEventRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/addEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/addEventRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/addEventRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/detailCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/detailCalendarConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/detailCalendarConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getCalendarConfigCalendarsRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getCalendarConfigCalendarsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getCalendarConfigCalendarsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getCalendarRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getCalendarRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getCalendarRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getCentersWithOutAssignRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getCentersWithOutAssignRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getCentersWithOutAssignRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getEventTypesRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getEventTypesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getEventTypesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getScheduleRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getScheduleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/getScheduleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/listCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/listCalendarConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/listCalendarConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/listKanbanColumnsRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/listKanbanColumnsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/listKanbanColumnsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/listKanbanEventOrdersRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/listKanbanEventOrdersRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/listKanbanEventOrdersRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/removeCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/removeCalendarConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/removeCalendarConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/removeConfigEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/removeConfigEventRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/removeConfigEventRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/removeEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/removeEventRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/removeEventRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/saveKanbanEventOrdersRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/saveKanbanEventOrdersRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/saveKanbanEventOrdersRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/updateCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/updateCalendarConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/updateCalendarConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/updateConfigEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/updateConfigEventRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/updateConfigEventRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/updateEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/updateEventRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/updateEventRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/updateEventSubTasksRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/updateEventSubTasksRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/schemas/response/updateEventSubTasksRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/updateCalendarConfigRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/updateCalendarConfigRest.js new file mode 100644 index 0000000000..c5a8e7e211 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/updateCalendarConfigRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/updateCalendarConfigRest'); +const { + schema: xRequest, +} = require('./schemas/request/updateCalendarConfigRest'); + +const openapi = { + summary: 'Update an existing calendar configuration', + description: `This endpoint updates a specific calendar configuration by applying provided modifications to aspects such as name, settings, and associated events. The modifications only affect the targeted calendar configuration. + +**Authentication:** Users need to authenticate to access and modify the calendar configurations. Updates are rejected if the user's session is unauthenticated or expired. + +**Permissions:** Users must have the 'calendar.modify' permission to update calendar configurations. Unauthorized attempts will result in denial of the operation. + +The endpoint begins with validation of the request payload against predefined schema rules, ensuring all required modifications are present and correctly formatted. It then proceeds to check user permissions and, if permitted, fetches the specified calendar configuration from the database using the 'findByConfigId' method from the calendar service. After retrieving the configuration, it applies the requested changes and updates the database record. Finally, it sends back an HTTP response to the client indicating the success of the operation, including details of the updated configuration in JSON.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/updateConfigEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/updateConfigEventRest.js new file mode 100644 index 0000000000..c14efb14f9 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/updateConfigEventRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateConfigEventRest'); +const { schema: xRequest } = require('./schemas/request/updateConfigEventRest'); + +const openapi = { + summary: 'Updates a calendar event configuration', + description: `This endpoint updates specific details of an existing calendar event configuration. Events can include various parameters like time, description, participants, and other metadata which can be modified through this endpoint. + +**Authentication:** Users must be authenticated to request updates to a calendar event configuration. This ensures that only valid and authenticated users can make changes to event details. + +**Permissions:** Users need to have edit permissions for the specific calendar event. The required permission might be something like 'calendar_event_edit', which ensures that only users with the necessary rights can make updates to the events. + +Upon receiving the request at the 'updateConfigEventRest' handler, the method first verifies user authentication and checks if the user holds the required permissions to edit the event. After validation, it calls the \`updateEvent\` method in the calendar configuration service. This method handles the logic for updating the event details in the database, ensuring that all provided changes comply with business rules and data integrity. The response to the client indicates whether the update was successful or if any errors occurred during the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/updateEventRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/updateEventRest.js new file mode 100644 index 0000000000..c73a497c37 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/updateEventRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateEventRest'); +const { schema: xRequest } = require('./schemas/request/updateEventRest'); + +const openapi = { + summary: "Update an existing event's details", + description: `This endpoint allows for the modification of an existing event's details based on the provided event identifier. It adjusts the properties like the event's name, duration, and any associated metadata. The update process ensures that only valid and permitted changes are applied to the event. + +**Authentication:** Users are required to be authenticated in order to perform an update operation on an event. Unauthenticated requests will be rejected. + +**Permissions:** The user must have edit permissions for the particular event they attempt to update. If the user lacks the necessary permissions, the request will be denied and an error message returned. + +The endpoint begins by validating the user's authentication status and permissions for the event specified in the request. Upon successful authentication and authorization, it calls the \`update\` method located in the \`Events\` core module, passing necessary parameters like the event ID and the new data to be updated. This method handles the logic of verifying which pieces of event information can be updated, ensuring data integrity and adherence to any constraints set within the application's business rules. Once updates are applied, it saves the changes to the database and returns an acknowledgment response to the client that the event was successfully updated.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/updateEventSubTasksRest.js b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/updateEventSubTasksRest.js new file mode 100644 index 0000000000..4d2fed2b49 --- /dev/null +++ b/plugins/leemons-plugin-calendar/backend/services/rest/openapi/calendar/updateEventSubTasksRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/updateEventSubTasksRest'); +const { + schema: xRequest, +} = require('./schemas/request/updateEventSubTasksRest'); + +const openapi = { + summary: 'Updates event sub-tasks assigned to a user', + description: `This endpoint handles the update of sub-tasks linked to specific events within the calendar for a particular user. It ensures that any changes in task status or details are correctly reflected and synchronized across user views and event management systems. + +**Authentication:** Users must be logged in to update event sub-tasks. Authentication is required to ensure that only authorized users can make changes to events they have access to. + +**Permissions:** This endpoint requires the user to have 'event_update' rights. Permissions are checked to ensure that the currently logged-in user has the appropriate rights to modify sub-tasks within the event. + +After receiving the request, the controller first verifies user authentication and permissions. If authentication or permissions checks fail, it returns an error response. If checks pass, it then proceeds to invoke the \`updateEventSubTasksFromUser\` method. This method takes in parameters related to the user's ID and event details, then interacts with the database to update relevant sub-task entries. Changes may involve altering status, descriptions, deadlines, or other sub-task properties. The method aims to ensure data integrity and consistency across the calendar application, updating entries and providing a success status back to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js b/plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js index c5e2849b47..2cbc5c090a 100644 --- a/plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js +++ b/plugins/leemons-plugin-comunica/backend/services/rest/config.rest.js @@ -21,9 +21,17 @@ const { } = require('../../core/config'); // TODO AÑADIR PERMISOS +const getGeneralConfigRest = require('./openapi/config/getGeneralConfigRest'); +const getCenterConfigRest = require('./openapi/config/getCenterConfigRest'); +const getProgramConfigRest = require('./openapi/config/getProgramConfigRest'); +const getRest = require('./openapi/config/getRest'); +const saveRest = require('./openapi/config/saveRest'); +const getAdminConfigRest = require('./openapi/config/getAdminConfigRest'); +const saveAdminConfigRest = require('./openapi/config/saveAdminConfigRest'); /** @type {ServiceSchema} */ module.exports = { getGeneralConfigRest: { + openapi: getGeneralConfigRest.openapi, rest: { path: '/general', method: 'GET', @@ -35,6 +43,7 @@ module.exports = { }, }, getCenterConfigRest: { + openapi: getCenterConfigRest.openapi, rest: { path: '/center/:center', method: 'GET', @@ -46,6 +55,7 @@ module.exports = { }, }, getProgramConfigRest: { + openapi: getProgramConfigRest.openapi, rest: { path: '/program/:program', method: 'GET', @@ -57,17 +67,22 @@ module.exports = { }, }, getRest: { + openapi: getRest.openapi, rest: { path: '/', method: 'GET', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const config = await get({ userAgent: ctx.meta.userSession.userAgents[0].id, ctx }); + const config = await get({ + userAgent: ctx.meta.userSession.userAgents[0].id, + ctx, + }); return { status: 200, config }; }, }, saveRest: { + openapi: saveRest.openapi, rest: { path: '/', method: 'POST', @@ -83,6 +98,7 @@ module.exports = { }, }, getAdminConfigRest: { + openapi: getAdminConfigRest.openapi, rest: { path: '/admin/config/:center', method: 'GET', @@ -106,6 +122,7 @@ module.exports = { }, }, saveAdminConfigRest: { + openapi: saveAdminConfigRest.openapi, rest: { path: '/admin/config/:center', method: 'POST', diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getAdminConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getAdminConfigRest.js new file mode 100644 index 0000000000..1569c443a0 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getAdminConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getAdminConfigRest'); +const { schema: xRequest } = require('./schemas/request/getAdminConfigRest'); + +const openapi = { + summary: 'Manage administrative configuration settings', + description: `This endpoint manages and retrieves the comprehensive administrative configuration settings for the platform. This encompasses fetching, updating, and verifying the settings associated with various administrative parameters within the system. + +**Authentication:** Users need to be authenticated and recognized as administrators to access this endpoint. Unauthorized access will be blocked, and the user will also be notified about the necessary authentication requirements if they are not met. + +**Permissions:** This endpoint requires the user to have administrative privileges. The system checks for 'admin_config_access' permission specifically. If the user does not have the required permission, the request will be rejected, and an error message will be issued detailing lack of permissions. + +Upon receiving a request, the 'getAdminConfigRest' handler initiates by validating the user's authentication and permission levels. It then proceeds to consult several service methods like 'getFullByCenter', 'getGeneral', 'getCenter', and 'getProgram' to gather comprehensive configuration data spread across different administrative levels and contexts of the platform. These methods collectively contribute to forming a complete configuration dataset that is then returned in a structured response to the client, distinctly outlining each section of the relevant configuration data.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getCenterConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getCenterConfigRest.js new file mode 100644 index 0000000000..bda738b70d --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getCenterConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getCenterConfigRest'); +const { schema: xRequest } = require('./schemas/request/getCenterConfigRest'); + +const openapi = { + summary: 'Retrieve configuration details of a center', + description: `This endpoint fetches and returns the detailed configuration settings of a specific center within the Leemons platform. Typical settings can include general information, active modules, and specific policies applied to the center. + +**Authentication:** Users need to be authenticated to access the configuration details of a center. The endpoint will reject requests without valid authentication credentials. + +**Permissions:** Access to this endpoint requires the 'view_center_config' permission, ensuring that only users with the necessary rights can view center configuration details. + +The handler initiates by calling the \`getConfig\` method in the \`config.rest.js\` service file, which further invokes the \`getCenter\` function from the \`getCenter.js\` in the core config directory. This function is responsible for retrieving the center-specific settings from the database based on the center ID provided in the request. It consolidates configuration details, applies any necessary transformations or filters, and finally, returns these details to the requester in a structured JSON format. Comprehensive error handling is implemented to manage cases where the center ID is invalid or the user does not hold the required permissions.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getGeneralConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getGeneralConfigRest.js new file mode 100644 index 0000000000..170897994d --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getGeneralConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getGeneralConfigRest'); +const { schema: xRequest } = require('./schemas/request/getGeneralConfigRest'); + +const openapi = { + summary: 'Retrieve general configuration settings for the platform', + description: `This endpoint fetches the general configuration settings of the Leemons platform engine. This includes settings that define behaviors and properties that affect various functionalities across the entire platform. + +**Authentication:** This endpoint requires the user to be authenticated before accessing the general configurations. An unauthorized access attempt will result in a rejection of the request. + +**Permissions:** Adequate permissions are necessary to retrieve these settings. Typically, only administrators or users with high-level privileges have the ability to access general configuration details. + +The process begins with the endpoint invoking the \`getGeneral\` method located within the \`config\` core of the leemons-plugin-comunica. This method is responsible for gathering all relevant configuration settings from a centralized configuration store. The information retrieved includes key-value pairs that represent the most crucial operational parameters for the platform. The configuration details are then formatted and returned as a JSON object, providing the client with a comprehensive view of the platform's operational baseline settings.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getProgramConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getProgramConfigRest.js new file mode 100644 index 0000000000..1f83a953b4 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getProgramConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getProgramConfigRest'); +const { schema: xRequest } = require('./schemas/request/getProgramConfigRest'); + +const openapi = { + summary: 'Fetches configuration details of a specific program', + description: `This endpoint is responsible for retrieving configuration details related to a specified program within the leemons platform. It is designed to ensure users have access to the necessary configuration settings which can involve various parameters and system settings linked to a particular program. + +**Authentication:** User must be authenticated to access the configuration details of the program. This is vital to ensure that only authorized users can access sensitive program settings. + +**Permissions:** The endpoint requires that the user have specific roles or permission grants, typically \`admin\` or \`config_manager\`, to retrieve program configuration details. + +Once invoked, the endpoint executes the \`getProgramConfig\` action from the \`ConfigService\`. This action calls the underlying \`getConfig\` method defined in the \`config\` core module, passing along necessary identifiers such as program ID retrieved from the request parameters. The process includes validation checks to ensure the requestor has required permissions and is authenticated. Upon successful validation, the method queries the database for specified program's configuration using the program ID, then formats and returns this data in a structured JSON response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getRest.js new file mode 100644 index 0000000000..f8bb04c009 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Retrieve configuration settings for the user', + description: `This endpoint retrieves the current configuration settings for the authenticated user. It allows users to view their configuration settings without modifying any data. + +**Authentication:** User authentication is necessary to access the configuration settings. Users must provide valid session credentials to proceed. + +**Permissions:** Users need to have 'view_configuration' permission to fetch their configuration data through this endpoint. + +The process begins by calling the \`getConfig\` method within the \`ConfigService\`, utilizing the user's identification details provided in the request's context (\`ctx\`). This method interacts with the underlying configuration management system to retrieve the specific settings associated with the user's account. The response is then formulated based on the retrieved data, encapsulating the configuration settings in the form of a JSON object. The entire flow ensures that only authorized and authenticated users can access their configuration settings.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/saveAdminConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/saveAdminConfigRest.js new file mode 100644 index 0000000000..13ca34dae2 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/saveAdminConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveAdminConfigRest'); +const { schema: xRequest } = require('./schemas/request/saveAdminConfigRest'); + +const openapi = { + summary: 'Save admin configurations for the comunication platform', + description: `This endpoint facilitates the saving of comprehensive administrative configurations for the communication platform. It is tasked with handling updates and storage of setups related to general, program, center, and various specific configurations under administrative privileges. + +**Authentication:** User authentication is mandatory for access to this endpoint. Presence of a valid authorization token is required to ensure the user is authenticated before proceeding with any operations. + +**Permissions:** Adequate administrative privileges are required to interact with this endpoint. The user must possess rights to modify system-wide settings that impact various aspects of the communication platform. + +Upon receiving a request, the \`saveAdminConfigRest\` endpoint initially validates the provided input data against predefined schemas to ensure compliance with the expected format and data types. It leverages various internal methods such as \`saveGeneral\`, \`saveCenter\`, \`saveProgram\`, and \`saveFullByCenter\` from the \`config\` core, each responsible for updating specific segments of the system configurations. These methods operate by altering settings in the database, ensuring that changes are both preserved and correctly implemented according to the administrative standards. The culmination of this process results in a response signaling the successful update of the configurations, accompanied by the new settings state.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/saveRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/saveRest.js new file mode 100644 index 0000000000..f6b5df275b --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/saveRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveRest'); +const { schema: xRequest } = require('./schemas/request/saveRest'); + +const openapi = { + summary: 'Save configuration settings', + description: `This endpoint allows for the saving of configuration settings in the system. It is used to update or add new configuration parameters to the system's existing config database. + +**Authentication:** Users must be authenticated to modify configuration settings. Access to this endpoint is restricted to authenticated sessions where the user possesses valid credentials. + +**Permissions:** The user must have 'admin' role or specific configuration management permissions to update or save configurations. These permissions ensure that only authorized personnel can make changes to critical system settings. + +The endpoint initiates by invoking the \`saveConfig\` method from the \`ConfigService\`. This method takes key-value pairs of configuration settings from the request body, checks for the user's permissions, and updates the database entries accordingly. The operation uses transaction controls to ensure data integrity during the save process. If the save operation is successful, a confirmation message is returned in the response to the client, indicating the success of the configuration update. If there is a failure, appropriate error handling sequences are initiated and error messages are returned in the response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getAdminConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getAdminConfigRest.js new file mode 100644 index 0000000000..6dbab3e3d7 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getAdminConfigRest.js @@ -0,0 +1,15 @@ +// automatic hash: 38102a3da02ba8ae3ec61433f847dadc156588e210fc79fef7b15cb02cae9546 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + center: { + type: 'string', + minLength: 1, + }, + }, + required: ['center'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getCenterConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getCenterConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getCenterConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getGeneralConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getGeneralConfigRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getGeneralConfigRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getProgramConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getProgramConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getProgramConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/saveAdminConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/saveAdminConfigRest.js new file mode 100644 index 0000000000..d53438a43c --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/saveAdminConfigRest.js @@ -0,0 +1,67 @@ +// automatic hash: bc7efbc7e2681c06314ae8fb668f0275bb21792d072b681fea37139fe154c7f8 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + center: { + type: 'string', + minLength: 1, + }, + enabled: { + type: 'boolean', + }, + studentsCanAddTeachersToGroups: { + type: 'boolean', + }, + tenorApiKey: {}, + program: { + type: 'object', + properties: { + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Programs:662f65cd9f06d6bbeb6281f6': + { + type: 'object', + properties: { + enableSubjectsRoom: { + type: 'boolean', + }, + teachersCanDisableSubjectsRooms: { + type: 'boolean', + }, + teachersCanMuteStudents: { + type: 'boolean', + }, + onlyTeachersCanWriteInSubjectsRooms: { + type: 'boolean', + }, + }, + required: [ + 'enableSubjectsRoom', + 'teachersCanDisableSubjectsRooms', + 'teachersCanMuteStudents', + 'onlyTeachersCanWriteInSubjectsRooms', + ], + }, + }, + required: [ + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Programs:662f65cd9f06d6bbeb6281f6', + ], + }, + enableStudentsChats: { + type: 'boolean', + }, + enableStudentsCreateGroups: { + type: 'boolean', + }, + }, + required: [ + 'center', + 'enabled', + 'studentsCanAddTeachersToGroups', + 'program', + 'enableStudentsChats', + 'enableStudentsCreateGroups', + ], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/saveRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/saveRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/request/saveRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getAdminConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getAdminConfigRest.js new file mode 100644 index 0000000000..72f03dad4d --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getAdminConfigRest.js @@ -0,0 +1,71 @@ +// automatic hash: 5a2dec483bf830edc21554c5000b013f00f83f3af75607227e361663d3b156f2 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + config: { + type: 'object', + properties: { + enabled: { + type: 'boolean', + }, + enableStudentsChats: { + type: 'boolean', + }, + enableStudentsCreateGroups: { + type: 'boolean', + }, + studentsCanAddTeachersToGroups: { + type: 'boolean', + }, + tenorApiKey: {}, + program: { + type: 'object', + properties: { + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Programs:662f65cd9f06d6bbeb6281f6': + { + type: 'object', + properties: { + enableSubjectsRoom: { + type: 'boolean', + }, + teachersCanDisableSubjectsRooms: { + type: 'boolean', + }, + teachersCanMuteStudents: { + type: 'boolean', + }, + onlyTeachersCanWriteInSubjectsRooms: { + type: 'boolean', + }, + }, + required: [ + 'enableSubjectsRoom', + 'teachersCanDisableSubjectsRooms', + 'teachersCanMuteStudents', + 'onlyTeachersCanWriteInSubjectsRooms', + ], + }, + }, + required: [ + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Programs:662f65cd9f06d6bbeb6281f6', + ], + }, + }, + required: [ + 'enabled', + 'enableStudentsChats', + 'enableStudentsCreateGroups', + 'studentsCanAddTeachersToGroups', + 'program', + ], + }, + }, + required: ['status', 'config'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getCenterConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getCenterConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getCenterConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getGeneralConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getGeneralConfigRest.js new file mode 100644 index 0000000000..94135b9204 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getGeneralConfigRest.js @@ -0,0 +1,23 @@ +// automatic hash: ab5b8df7b66a4742d43bc34233f8f0a0306d9ba41b527f5550706960a02b986f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + config: { + type: 'object', + properties: { + enabled: { + type: 'boolean', + }, + }, + required: ['enabled'], + }, + }, + required: ['status', 'config'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getProgramConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getProgramConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getProgramConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/saveAdminConfigRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/saveAdminConfigRest.js new file mode 100644 index 0000000000..1058737684 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/saveAdminConfigRest.js @@ -0,0 +1,71 @@ +// automatic hash: bd2d175865c2ba477d52a42fbb6613af28a6c561bf382d88e4e6d0c362aeb3d2 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + config: { + type: 'object', + properties: { + enabled: { + type: 'boolean', + }, + studentsCanAddTeachersToGroups: { + type: 'boolean', + }, + tenorApiKey: {}, + program: { + type: 'object', + properties: { + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Programs:662f65cd9f06d6bbeb6281f6': + { + type: 'object', + properties: { + enableSubjectsRoom: { + type: 'boolean', + }, + teachersCanDisableSubjectsRooms: { + type: 'boolean', + }, + teachersCanMuteStudents: { + type: 'boolean', + }, + onlyTeachersCanWriteInSubjectsRooms: { + type: 'boolean', + }, + }, + required: [ + 'enableSubjectsRoom', + 'teachersCanDisableSubjectsRooms', + 'teachersCanMuteStudents', + 'onlyTeachersCanWriteInSubjectsRooms', + ], + }, + }, + required: [ + 'lrn:local:academic-portfolio:local:662f652a421c6b5e1e839b6c:Programs:662f65cd9f06d6bbeb6281f6', + ], + }, + enableStudentsChats: { + type: 'boolean', + }, + enableStudentsCreateGroups: { + type: 'boolean', + }, + }, + required: [ + 'enabled', + 'studentsCanAddTeachersToGroups', + 'program', + 'enableStudentsChats', + 'enableStudentsCreateGroups', + ], + }, + }, + required: ['status', 'config'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/saveRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/saveRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/config/schemas/response/saveRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminAddUsersToRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminAddUsersToRoomRest.js new file mode 100644 index 0000000000..4b46d61d4c --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminAddUsersToRoomRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/adminAddUsersToRoomRest'); +const { + schema: xRequest, +} = require('./schemas/request/adminAddUsersToRoomRest'); + +const openapi = { + summary: 'Add user agents to a room with admin privileges', + description: `This endpoint allows an admin to add multiple user agents to a specific room. The operation is performed only if the initiating user possesses sufficient administrative rights. + +**Authentication:** The user must be authenticated and identified as an administrator to execute this action. Unauthorized or unauthenticated requests are rejected. + +**Permissions:** The user needs to have 'admin' level permissions specifically for room management. This includes the ability to modify room memberships and settings. + +Upon receiving a request, the endpoint initially verifies if the authenticated user has administrative rights with respect to room management. If the verification succeeds, it proceeds to invoke the \`adminAddUserAgents\` function from the \`room\` core module. This function takes a list of user agent IDs and the target room ID, then adds these user agents to the room if they are not already present. The operation handles each addition transactionally, ensuring that all specified user agents are added successfully or none at all, in case of errors. Detailed logs are maintained for the operations to facilitate debugging and auditing. Upon completion, a success message or an error message, detailing the reason for failure, is sent back in the response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminChangeRoomImageRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminChangeRoomImageRest.js new file mode 100644 index 0000000000..d975f77014 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminChangeRoomImageRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/adminChangeRoomImageRest'); +const { + schema: xRequest, +} = require('./schemas/request/adminChangeRoomImageRest'); + +const openapi = { + summary: 'Change room image by admin', + description: `This endpoint allows an administrator to update the image associated with a specific room within the platform. The administrator can upload a new image file that will replace the existing room image. + +**Authentication:** User authentication is required to ensure that the request is made by a verified admin account. An invalid or missing token will restrict access to this endpoint. + +**Permissions:** This operation requires administrative permissions specifically tailored for room management. The user needs to have the 'admin:changeRoomImage' permission to execute this action, ensuring that only authorized personnel can modify room images. + +From an implementation perspective, this endpoint initially validates the provided inputs using dedicated validation methods. Once validation is passed, it invokes the \`adminChangeRoomImage\` function of the 'Room' core module. This function handles the logic for the image update, including file verification, deletion of the old image, and updating the room's image data in the database. The response will either be a success message confirming the image update or an error message detailing any issues encountered during the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminRemoveRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminRemoveRoomRest.js new file mode 100644 index 0000000000..9a341bcada --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminRemoveRoomRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/adminRemoveRoomRest'); +const { schema: xRequest } = require('./schemas/request/adminRemoveRoomRest'); + +const openapi = { + summary: 'Remove a room from the system by an admin', + description: `This endpoint allows administrative users to remove a specific room from the system. The action ensures that only authorized administrative personnel can manage and remove rooms, maintaining system integrity and access control. + +**Authentication:** Users must be authenticated and identified as administrators to perform this action. Any attempt to access this endpoint without proper authentication or administrative rights will be denied. + +**Permissions:** The user executing this endpoint must have administrative permissions specifically granted for managing and removing rooms. Access without adequate permissions will result in a failure to execute the desired operation. + +Upon receiving a request, the \`adminRemoveRoomRest\` handler first checks the authentication and permissions of the user trying to access the endpoint. If the user is authenticated and has the necessary permissions, it proceeds to call the \`adminRemoveRoom\` method from the \`room\` core. This method involves validating the existence of the room and ensuring that no constraints are violated by its removal. Once validation is successful, the room is removed from the system database, and a confirmation response is sent back to the requestor indicating successful deletion.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminRemoveUserAgentRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminRemoveUserAgentRest.js new file mode 100644 index 0000000000..4a634f8197 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminRemoveUserAgentRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/adminRemoveUserAgentRest'); +const { + schema: xRequest, +} = require('./schemas/request/adminRemoveUserAgentRest'); + +const openapi = { + summary: 'Remove user agents from a room by an admin', + description: `This endpoint allows admins to remove one or more user agents from a specific room. The admin provides the identifiers for the room and the user agents, and the service ensures that these agents are properly removed from the room, maintaining room integrity and access controls. + +**Authentication:** Admins need to be authenticated to execute this operation. Non-authenticated requests or requests from non-admin users will be denied access to this functionality. + +**Permissions:** The user must have administrative permissions specifically for room management. Without adequate permissions, the request will be rejected to uphold security protocols and manage room access properly. + +The flow begins with the \`adminRemoveUserAgents\` method being called from the \`room.rest.js\` service file. This method first verifies the admin's credentials and permissions to manage room settings. Upon successful validation, it proceeds to invoke the \`removeUserAgents\` method from the \`core/room\` module, providing the necessary user and room identifiers. This core method handles the logical removal of user agents from the database, ensuring that all associated data integrity constraints are adhered to. A successful operation results in a confirmation of removal, while any failures in the process due to invalid data or server errors are handled gracefully and reported back to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminUpdateRoomNameRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminUpdateRoomNameRest.js new file mode 100644 index 0000000000..a0c7a38e39 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/adminUpdateRoomNameRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/adminUpdateRoomNameRest'); +const { + schema: xRequest, +} = require('./schemas/request/adminUpdateRoomNameRest'); + +const openapi = { + summary: 'Updates the name of a specific room', + description: `This endpoint allows the administrator to update the name of an existing room in the platform. The update is applied to the room identified by a unique ID provided in the request parameters. This action involves changing the room's name in the database to a new value specified by the admin. + +**Authentication:** User must be logged in as an administrator to perform this action. An invalid or missing authentication token will result in endpoint access denial. + +**Permissions:** The user must have 'admin' role permissions to update room names. This ensures that only authorized personnel can make changes to critical data such as room identifications. + +The process begins by the endpoint retrieving the room ID and the new name from the request. It then calls the \`adminUpdateRoomName\` function from \`room.index.js\`, passing the necessary parameters. This function checks for the room's existence using the \`exists\` validation method in \`exists.js\`, ensuring the operation doesn't occur on non-existent entities. Upon success, the new name is updated in the room's database entry. The entire transaction is handled safely to prevent data inconsistencies and unauthorized access, completing with a response that indicates the success of the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/createRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/createRoomRest.js new file mode 100644 index 0000000000..9592f21c72 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/createRoomRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/createRoomRest'); +const { schema: xRequest } = require('./schemas/request/createRoomRest'); + +const openapi = { + summary: 'Create a new communication room', + description: `This endpoint is responsible for creating a new communication room within the platform. Each room facilitates a designated space for users to interact through messages or shared content. + +**Authentication:** Users must be authenticated to create new rooms. Attempts to access this endpoint without a valid authentication token will be rejected. + +**Permissions:** Users need to have the 'create_room' permission assigned to their role to successfully execute this action. Without the appropriate permissions, the endpoint will deny the room creation request. + +The process begins in the \`createRoomRest\` handler by calling the \`addRoom\` method from the \`room\` core. This method takes necessary room details from the request payload and proceeds to verify the existence of similar room identifiers to avoid duplicates. On successful verification, it initiates the room creation in the database. Post room creation, the handler optionally adds user agents to the room through the \`addUserAgents\` method, allowing specified users immediate access to the room. The flow concludes with a response that includes the details of the newly created room, encapsulating the room's ID and other relevant data.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getMessagesRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getMessagesRest.js new file mode 100644 index 0000000000..85ce09e6c6 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getMessagesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getMessagesRest'); +const { schema: xRequest } = require('./schemas/request/getMessagesRest'); + +const openapi = { + summary: 'Fetches all messages for a specific room', + description: `This endpoint retrieves all the messages associated with a specified chat room. It helps in displaying conversation history to the user based on the room they select or are actively participating in. + +**Authentication:** Users must be logged in to fetch messages from a chat room. If the authentication details are not provided or are invalid, the request will be denied. + +**Permissions:** Users need to have the appropriate permissions to view the messages in a chat room. These permissions ensure that only participants of the chat room or specific roles authorized by the application's access control can retrieve the conversation history. + +The getMessagesRest handler initiates the process by invoking the \`getMessages\` function from the \`room\` core module. The function requires the room's unique identifier, which is extracted from the request parameters. Upon receiving the request, the function checks the room's existence and the user's access level. It then proceeds to fetch all relevant messages using a decrypted method of data retrieval to ensure security and privacy of the communication. Each message is processed to conform to the format necessary for client-side rendering before being returned as a list in the response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getRoomListRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getRoomListRest.js new file mode 100644 index 0000000000..5f4e759f11 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getRoomListRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRoomListRest'); +const { schema: xRequest } = require('./schemas/request/getRoomListRest'); + +const openapi = { + summary: 'Lists all chat rooms associated with the current user', + description: `This endpoint fetches a list of chat rooms that the current user is a part of. It ensures that the user can communicate with other participants in the system through the available chat rooms. + +**Authentication:** Users need to be logged in to retrieve their list of chat rooms. Lack of authentication will prevent access to this endpoint. + +**Permissions:** The user must have the 'view_chat_rooms' permission to access this information. Without this permission, the request will be rejected. + +Upon receiving a request at this endpoint, the 'getRoomListRest' handler first verifies the user's authentication status and permissions. Upon validation, it calls the \`getUserAgentRoomsList\` method from the \`room\` core module. This method checks the user's ID against the room participants list stored in the database, collecting all the rooms where the user has an association. The method returns a list of room details, which includes the room name, ID, and other relevant metadata. Finally, the response is prepared and sent back to the user, detailing the rooms they are connected to, structured as a JSON array.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getRoomRest.js new file mode 100644 index 0000000000..ad14fb7d04 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getRoomRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRoomRest'); +const { schema: xRequest } = require('./schemas/request/getRoomRest'); + +const openapi = { + summary: 'Retrieve room details by ID', + description: `This endpoint fetches detailed information about a specific room within the Leemonade platform. It identifies the room based on the unique ID provided in the request and returns comprehensive data about the room configuration and its attributes. + +**Authentication:** The user must be authenticated to access the detailed information of a room. Unauthenticated requests would be automatically rejected with an appropriate error response. + +**Permissions:** Users need to have 'room.view' permission to access this endpoint. Without sufficient permissions, the access to the room details will be denied, ensuring that only authorized users can retrieve sensitive room data. + +This handler, \`getRoomRest\`, starts by validating the provided room ID using the \`exists.js\` validation script to ensure the room ID is present in the system. Upon successful validation, the \`get.js\` from the \`room\` core module is invoked, which handles the database queries to fetch and return the room details. The process flows systematically, from validating user authentication and permissions to executing the core retrieval logic, ensuring a secure and efficient data delivery. The final response encapsulates the room details in a JSON format, providing a precise and structured data view to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getRoomsMessageCountRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getRoomsMessageCountRest.js new file mode 100644 index 0000000000..8889098936 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getRoomsMessageCountRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getRoomsMessageCountRest'); +const { + schema: xRequest, +} = require('./schemas/request/getRoomsMessageCountRest'); + +const openapi = { + summary: 'Counts messages across multiple rooms', + description: `This endpoint is responsible for counting the number of messages in various rooms available in the system. It aggregates message data across different room entities and provides a count that reflects the total communication activity within those rooms. The function does not filter by user or room properties, focusing instead on a comprehensive count across all data points. + +**Authentication:** Users must be authenticated to access this endpoint. Unauthorized access is systematically denied, ensuring that only authenticated users can retrieve message counts. + +**Permissions:** This endpoint requires the user to have the 'view_messages' permission to proceed with the data retrieval. Any user without this specific permission will not be able to execute this endpoint and receive the messages count. + +Upon receiving a request, the endpoint triggers the \`getRoomsMessageCount\` function from the \`room\` core module. This function queries the database to retrieve the number of messages in each room, using a method that efficiently counts messages without retrieving the full message data, optimizing both time and resource consumption. The results are then compiled into a single response object, which is returned to the requester in a structured JSON format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getUnreadMessagesRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getUnreadMessagesRest.js new file mode 100644 index 0000000000..027f225950 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/getUnreadMessagesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getUnreadMessagesRest'); +const { schema: xRequest } = require('./schemas/request/getUnreadMessagesRest'); + +const openapi = { + summary: 'Fetch unread messages for a specified chat room', + description: `This endpoint fetches all unread messages from a specific chat room, aiming to update the current user on any messages they have not yet seen. The primary functionality is to enhance communication efficiency by ensuring users are abreast with all recent messages. + +**Authentication:** Access to this endpoint requires that the user is authenticated. If authentication details are absent or incorrect, the request will not proceed. + +**Permissions:** Users need to have adequate permissions to access chat room information. Typically, this includes permissions to view messages within a given room. Without these permissions, the request will be denied. + +Upon receiving a request, this endpoint initiates by calling the \`getUnreadMessages\` method from the \`room\` core module. The method executes a query to filter out messages that have not been marked as read by the user, based on the user's ID and the room's ID. After retrieving these messages, they are conveyed back in a structured JSON format, encompassing details such as the sender, timestamp, and content of each unread message. This systematic retrieval is crucial for maintaining accurate and up-to-date dialogue threads within the application.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/markMessagesAsReadRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/markMessagesAsReadRest.js new file mode 100644 index 0000000000..8a3c5bd5c2 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/markMessagesAsReadRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/markMessagesAsReadRest'); +const { + schema: xRequest, +} = require('./schemas/request/markMessagesAsReadRest'); + +const openapi = { + summary: 'Marks specified messages as read by the user', + description: `This endpoint marks one or more messages as read for a user within a specified communication room. Once marked, messages will not appear as unread in the user interface of the communication tool. + +**Authentication:** User authentication is required to access and modify the read status of messages. Only authenticated users can mark messages as read, ensuring that the action is securely attributed to the correct user account. + +**Permissions:** Users must have read access to the room in which the messages were sent to mark them as read. The endpoint verifies user permissions to ensure they are authorized to modify message statuses within the room. + +The flow begins in the \`markMessagesAsReadRest\` action handler in \`room.rest.js\`, which delegates to the \`markAsRead\` method in \`room/index.js\`. This method processes the list of message IDs provided in the request, checking each message for the user's access rights. It uses the \`exists.js\` validation to ensure the messages exist before proceeding. Once all permissions and existence checks are satisfied, the method updates the read status of the messages in the database. The response then confirms the successful update of the message statuses to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminAddUsersToRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminAddUsersToRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminAddUsersToRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminChangeRoomImageRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminChangeRoomImageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminChangeRoomImageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminRemoveRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminRemoveRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminRemoveRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminRemoveUserAgentRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminRemoveUserAgentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminRemoveUserAgentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminUpdateRoomNameRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminUpdateRoomNameRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/adminUpdateRoomNameRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/createRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/createRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/createRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getMessagesRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getMessagesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getMessagesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getRoomListRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getRoomListRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getRoomListRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getRoomsMessageCountRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getRoomsMessageCountRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getRoomsMessageCountRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getUnreadMessagesRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getUnreadMessagesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/getUnreadMessagesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/markMessagesAsReadRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/markMessagesAsReadRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/markMessagesAsReadRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/sendMessageRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/sendMessageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/sendMessageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/toggleAdminDisableRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/toggleAdminDisableRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/toggleAdminDisableRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/toggleAdminMutedRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/toggleAdminMutedRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/toggleAdminMutedRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/toggleAttachedRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/toggleAttachedRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/toggleAttachedRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/toggleMutedRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/toggleMutedRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/request/toggleMutedRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminAddUsersToRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminAddUsersToRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminAddUsersToRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminChangeRoomImageRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminChangeRoomImageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminChangeRoomImageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminRemoveRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminRemoveRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminRemoveRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminRemoveUserAgentRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminRemoveUserAgentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminRemoveUserAgentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminUpdateRoomNameRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminUpdateRoomNameRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/adminUpdateRoomNameRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/createRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/createRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/createRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getMessagesRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getMessagesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getMessagesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getRoomListRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getRoomListRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getRoomListRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getRoomsMessageCountRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getRoomsMessageCountRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getRoomsMessageCountRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getUnreadMessagesRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getUnreadMessagesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/getUnreadMessagesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/markMessagesAsReadRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/markMessagesAsReadRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/markMessagesAsReadRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/sendMessageRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/sendMessageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/sendMessageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/toggleAdminDisableRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/toggleAdminDisableRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/toggleAdminDisableRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/toggleAdminMutedRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/toggleAdminMutedRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/toggleAdminMutedRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/toggleAttachedRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/toggleAttachedRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/toggleAttachedRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/toggleMutedRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/toggleMutedRoomRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/schemas/response/toggleMutedRoomRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/sendMessageRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/sendMessageRest.js new file mode 100644 index 0000000000..ce3b040e93 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/sendMessageRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/sendMessageRest'); +const { schema: xRequest } = require('./schemas/request/sendMessageRest'); + +const openapi = { + summary: 'Send a message to a specified room', + description: `This endpoint allows a user to send a message to a specified room in the communication platform. The operation includes validating the user's rights to post in the room, checking the message content for compliance with platform policies, and storing the message in the database for retrieval by room members. + +**Authentication:** The user must be authenticated to send messages. A valid authentication token is required to process the message sending request. + +**Permissions:** Users need to have appropriate permissions to post messages in the specified room. This usually includes being a member of the room or having special privileges as a moderator or admin. + +The process starts by validating the user's authentication token to ensure it is active and valid. Once authenticated, the \`sendMessage\` method is invoked with parameters including the user ID and room ID alongside the message content. The handler conducts a permissions check to ascertain if the user has the right to post in the room. Following permissions validation, the message content is processed to ensure it adheres to message standards and policies before being stored in the room's database. Finally, a confirmation of message delivery is sent back to the user along with any potential errors encountered during the message submission process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/toggleAdminDisableRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/toggleAdminDisableRoomRest.js new file mode 100644 index 0000000000..601663218f --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/toggleAdminDisableRoomRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/toggleAdminDisableRoomRest'); +const { + schema: xRequest, +} = require('./schemas/request/toggleAdminDisableRoomRest'); + +const openapi = { + summary: 'Toggle administrative disablement of a specific room', + description: `This endpoint allows administrators to toggle the disabled status of a specific room within the system. When a room is disabled, it is not accessible to users until it is re-enabled. + +**Authentication:** Users must be authenticated and identified as administrators to access this function. Unauthorized access will be prevented, ensuring secure management of room statuses. + +**Permissions:** The user must have the 'admin.room.toggleDisable' permission to execute this action. This ensures that only authorized personnel can alter the availability of rooms. + +The handler initiates by calling the \`toggleDisableRoom\` method located within the room module's core logic. This method accepts a unique room identifier and checks the current state of the room. If the room is enabled, it will be disabled; if it is disabled, it will be enabled. This toggling is recorded in the system's audit trails for compliance and tracking purposes. The response signifies successful execution of the command and updates the current state of the room accordingly, all encapsulated within a transactional boundary to maintain data integrity.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/toggleAdminMutedRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/toggleAdminMutedRoomRest.js new file mode 100644 index 0000000000..928815c2e6 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/toggleAdminMutedRoomRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/toggleAdminMutedRoomRest'); +const { + schema: xRequest, +} = require('./schemas/request/toggleAdminMutedRoomRest'); + +const openapi = { + summary: 'Toggle admin mute status in a room', + description: `This endpoint allows the toggling of the mute status for admins within a specified room. It is used to either mute or unmute admins based on the current status, effectively controlling their ability to participate audibly in room communications. + +**Authentication:** User must be authenticated to modify admin mute settings in a room. Authentication ensures that only authorized users can affect the communication dynamics of the room. + +**Permissions:** This endpoint requires the user to have administrative rights within the room or platform. The permission to toggle mute settings is crucial to maintain control over the room's communication environment. + +Upon receiving a request, the endpoint initially checks for user authentication and confirms that the required permissions are met. It then proceeds to call the \`toggleAdminMutedRoom\` method from the core room functionality. This method checks the current mute status of the admin in the specified room and toggles it. Depending on the current state, if the admin is muted, they will be unmuted and vice versa. This operation involves updating room settings in the database and reflects changes immediately in the room’s communication flow. The result of this operation is a confirmation of the new mute status, which is sent back to the requester in the response payload.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/toggleAttachedRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/toggleAttachedRoomRest.js new file mode 100644 index 0000000000..3900db9c73 --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/toggleAttachedRoomRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/toggleAttachedRoomRest'); +const { + schema: xRequest, +} = require('./schemas/request/toggleAttachedRoomRest'); + +const openapi = { + summary: 'Toggle the attachment status of a room', + description: `This endpoint enables the toggling of a room's attachment status in the system. It is used primarily to change the state of a room between being attached or detached from a particular user or entity session. + +**Authentication:** Users need to be authenticated to perform this action. Access will be denied for unauthorized requests. + +**Permissions:** The user must have administrative rights or specific permissions related to room management to execute this operation. + +The process begins with the controller retrieving the room ID and the target attachment state from the request body. It then calls the \`toggleAttachedRoom\` method from the \`room\` core service. This method checks the existing state of the room and toggles it accordingly, ensuring that all data integrity and state dependencies are handled correctly. The outcome of this operation (success or failure) is then returned to the user as part of the HTTP response, detailing whether the toggle was successful and the current state of the room.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/toggleMutedRoomRest.js b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/toggleMutedRoomRest.js new file mode 100644 index 0000000000..8ce0ace37e --- /dev/null +++ b/plugins/leemons-plugin-comunica/backend/services/rest/openapi/room/toggleMutedRoomRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/toggleMutedRoomRest'); +const { schema: xRequest } = require('./schemas/request/toggleMutedRoomRest'); + +const openapi = { + summary: 'Toggle muting state of a specified room', + description: `This endpoint toggles the muting state of a room specified by its ID. When triggered, it alternates the room's current mute status—either muting or unmuting it depending on the existing state. + +**Authentication:** Users need to be authenticated to toggle the mute status of a room. The system verifies user credentials and session validity before processing the request. + +**Permissions:** The user must have administrative rights or specific permissions to modify the muting state of a room to ensure secure and authorized access. + +The process begins with the REST layer receiving a toggle request, which is then forwarded to the \`toggleMutedRoom\` method in the room core module. This method checks the current state of the room's mute status and switches it. The updated state is persisted in the database ensuring that the changes are stored consistently. A response is then generated to signify the successful toggling of the room's mute status, providing confirmation back to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js b/plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js index e4fe6edd83..f42fbb32c8 100644 --- a/plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js +++ b/plugins/leemons-plugin-comunica/backend/services/rest/room.rest.js @@ -32,9 +32,27 @@ const { getRoomsMessageCount, } = require('../../core/room'); +const getRoomListRest = require('./openapi/room/getRoomListRest'); +const getMessagesRest = require('./openapi/room/getMessagesRest'); +const sendMessageRest = require('./openapi/room/sendMessageRest'); +const markMessagesAsReadRest = require('./openapi/room/markMessagesAsReadRest'); +const getRoomRest = require('./openapi/room/getRoomRest'); +const toggleMutedRoomRest = require('./openapi/room/toggleMutedRoomRest'); +const toggleAdminMutedRoomRest = require('./openapi/room/toggleAdminMutedRoomRest'); +const toggleAdminDisableRoomRest = require('./openapi/room/toggleAdminDisableRoomRest'); +const adminRemoveUserAgentRest = require('./openapi/room/adminRemoveUserAgentRest'); +const adminUpdateRoomNameRest = require('./openapi/room/adminUpdateRoomNameRest'); +const adminAddUsersToRoomRest = require('./openapi/room/adminAddUsersToRoomRest'); +const adminRemoveRoomRest = require('./openapi/room/adminRemoveRoomRest'); +const createRoomRest = require('./openapi/room/createRoomRest'); +const adminChangeRoomImageRest = require('./openapi/room/adminChangeRoomImageRest'); +const toggleAttachedRoomRest = require('./openapi/room/toggleAttachedRoomRest'); +const getUnreadMessagesRest = require('./openapi/room/getUnreadMessagesRest'); +const getRoomsMessageCountRest = require('./openapi/room/getRoomsMessageCountRest'); /** @type {ServiceSchema} */ module.exports = { getRoomListRest: { + openapi: getRoomListRest.openapi, rest: { path: '/list', method: 'GET', @@ -49,6 +67,7 @@ module.exports = { }, }, getMessagesRest: { + openapi: getMessagesRest.openapi, rest: { path: '/:key/messages', method: 'GET', @@ -64,6 +83,7 @@ module.exports = { }, }, sendMessageRest: { + openapi: sendMessageRest.openapi, rest: { path: '/:key/messages', method: 'POST', @@ -79,6 +99,7 @@ module.exports = { }, }, markMessagesAsReadRest: { + openapi: markMessagesAsReadRest.openapi, rest: { path: '/:key/messages/read', method: 'POST', @@ -94,6 +115,7 @@ module.exports = { }, }, getRoomRest: { + openapi: getRoomRest.openapi, rest: { path: '/:key', method: 'GET', @@ -109,6 +131,7 @@ module.exports = { }, }, toggleMutedRoomRest: { + openapi: toggleMutedRoomRest.openapi, rest: { path: '/:key/mute', method: 'POST', @@ -124,6 +147,7 @@ module.exports = { }, }, toggleAdminMutedRoomRest: { + openapi: toggleAdminMutedRoomRest.openapi, rest: { path: '/:key/admin/mute', method: 'POST', @@ -139,6 +163,7 @@ module.exports = { }, }, toggleAdminDisableRoomRest: { + openapi: toggleAdminDisableRoomRest.openapi, rest: { path: '/:key/admin/disable', method: 'POST', @@ -154,6 +179,7 @@ module.exports = { }, }, adminRemoveUserAgentRest: { + openapi: adminRemoveUserAgentRest.openapi, rest: { path: '/:key/admin/remove', method: 'POST', @@ -170,6 +196,7 @@ module.exports = { }, }, adminUpdateRoomNameRest: { + openapi: adminUpdateRoomNameRest.openapi, rest: { path: '/:key/admin/name', method: 'POST', @@ -185,6 +212,7 @@ module.exports = { }, }, adminAddUsersToRoomRest: { + openapi: adminAddUsersToRoomRest.openapi, rest: { path: '/:key/admin/users', method: 'POST', @@ -200,6 +228,7 @@ module.exports = { }, }, adminRemoveRoomRest: { + openapi: adminRemoveRoomRest.openapi, rest: { path: '/:key/admin/remove', method: 'POST', @@ -215,6 +244,7 @@ module.exports = { }, }, createRoomRest: { + openapi: createRoomRest.openapi, rest: { path: '/create', method: 'POST', @@ -232,7 +262,10 @@ module.exports = { const room = await add({ ...ctx.params, key, - adminUserAgents: ctx.params.type === 'chat' ? [] : ctx.meta.userSession.userAgents[0].id, + adminUserAgents: + ctx.params.type === 'chat' + ? [] + : ctx.meta.userSession.userAgents[0].id, ctx, }); @@ -240,6 +273,7 @@ module.exports = { }, }, adminChangeRoomImageRest: { + openapi: adminChangeRoomImageRest.openapi, rest: { path: '/:key/admin/image', method: 'POST', @@ -256,6 +290,7 @@ module.exports = { }, }, toggleAttachedRoomRest: { + openapi: toggleAttachedRoomRest.openapi, rest: { path: '/:key/attach', method: 'POST', @@ -271,6 +306,7 @@ module.exports = { }, }, getUnreadMessagesRest: { + openapi: getUnreadMessagesRest.openapi, rest: { path: '/messages/unread', method: 'POST', @@ -286,6 +322,7 @@ module.exports = { }, }, getRoomsMessageCountRest: { + openapi: getRoomsMessageCountRest.openapi, rest: { path: '/messages/count', method: 'POST', diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js index 4f18e909ae..7e13a9e6ef 100644 --- a/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/document.rest.js @@ -26,7 +26,9 @@ const getPermissions = (permissionsArr, actions = null) => { (obj, [permission, _actions]) => ({ ...obj, [permission]: { - actions: _actions.includes('admin') ? _actions : ['admin', ..._actions], + actions: _actions.includes('admin') + ? _actions + : ['admin', ..._actions], }, }), {} @@ -39,9 +41,16 @@ const getPermissions = (permissionsArr, actions = null) => { }; }; +const saveDocumentRest = require('./openapi/document/saveDocumentRest'); +const getDocumentRest = require('./openapi/document/getDocumentRest'); +const deleteDocumentRest = require('./openapi/document/deleteDocumentRest'); +const duplicateDocumentRest = require('./openapi/document/duplicateDocumentRest'); +const assignDocumentRest = require('./openapi/document/assignDocumentRest'); +const shareDocumentRest = require('./openapi/document/shareDocumentRest'); /** @type {ServiceSchema} */ module.exports = { saveDocumentRest: { + openapi: saveDocumentRest.openapi, rest: { method: 'POST', path: '/', @@ -49,7 +58,10 @@ module.exports = { middlewares: [ LeemonsMiddlewareAuthenticated(), LeemonsMiddlewareNecessaryPermits({ - allowedPermissions: getPermissions(permissions.creator, ['create', 'update']), + allowedPermissions: getPermissions(permissions.creator, [ + 'create', + 'update', + ]), }), ], async handler(ctx) { @@ -59,6 +71,7 @@ module.exports = { }, }, getDocumentRest: { + openapi: getDocumentRest.openapi, rest: { method: 'GET', path: '/:id', @@ -70,6 +83,7 @@ module.exports = { }, }, deleteDocumentRest: { + openapi: deleteDocumentRest.openapi, rest: { method: 'DELETE', path: '/:id', @@ -86,6 +100,7 @@ module.exports = { }, }, duplicateDocumentRest: { + openapi: duplicateDocumentRest.openapi, rest: { method: 'POST', path: '/duplicate', @@ -93,7 +108,10 @@ module.exports = { middlewares: [ LeemonsMiddlewareAuthenticated(), LeemonsMiddlewareNecessaryPermits({ - allowedPermissions: getPermissions(permissions.creator, ['create', 'update']), + allowedPermissions: getPermissions(permissions.creator, [ + 'create', + 'update', + ]), }), ], async handler(ctx) { @@ -106,6 +124,7 @@ module.exports = { }, }, assignDocumentRest: { + openapi: assignDocumentRest.openapi, rest: { method: 'POST', path: '/assign', @@ -113,7 +132,10 @@ module.exports = { middlewares: [ LeemonsMiddlewareAuthenticated(), LeemonsMiddlewareNecessaryPermits({ - allowedPermissions: getPermissions(permissions.creator, ['create', 'update']), + allowedPermissions: getPermissions(permissions.creator, [ + 'create', + 'update', + ]), }), ], async handler(ctx) { @@ -123,6 +145,7 @@ module.exports = { }, }, shareDocumentRest: { + openapi: shareDocumentRest.openapi, rest: { method: 'POST', path: '/share', @@ -130,7 +153,11 @@ module.exports = { middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { const { assignableId, canAccess } = ctx.params; - const docPermissions = await shareDocument({ id: assignableId, canAccess, ctx }); + const docPermissions = await shareDocument({ + id: assignableId, + canAccess, + ctx, + }); return { status: 200, docPermissions }; }, }, diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/assignDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/assignDocumentRest.js new file mode 100644 index 0000000000..2ab135404a --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/assignDocumentRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/assignDocumentRest'); +const { schema: xRequest } = require('./schemas/request/assignDocumentRest'); + +const openapi = { + summary: 'Assign document to a user or group', + description: `This endpoint is responsible for assigning a specific document to either a user or a group. The operation involves validating the document's availability and checking if the specified recipient is eligible to receive the document. The assignment is recorded in the system for tracking and management purposes. + +**Authentication:** User authentication is required to ensure that only authorized users can assign documents. An unauthenticated request will be rejected, prompting for valid user credentials. + +**Permissions:** The user must have 'document-assign' permission to perform this operation. Without the necessary permissions, the operation will not be executed, and an access denied message will be returned. + +The flow starts with the validation of the provided document ID and recipient details through the \`assignDocument\` core method. If validation succeeds, the document's status is updated to reflect the new assignment, and pertinent details are recorded in the database. The recipient, whether a user or a group, is then notified of the document assignment. This entire process ensures a comprehensive approach to document management and access control within the system.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/deleteDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/deleteDocumentRest.js new file mode 100644 index 0000000000..598a6fae0e --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/deleteDocumentRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteDocumentRest'); +const { schema: xRequest } = require('./schemas/request/deleteDocumentRest'); + +const openapi = { + summary: 'Delete a specified document', + description: `This endpoint is responsible for deleting a specific document identified by its unique ID. The operation entails removing the document from the database and ensuring that all associated data such as references or shared links are also appropriately handled. + +**Authentication:** Users need to be authenticated to execute this deletion. The process checks for a valid user session and compares the user's identity against the ownership or permission attributes of the document to be deleted. + +**Permissions:** The user must have administrative or specific rights over the document to execute a deletion. Permissions checks are implemented to ensure that only authorized users can delete documents. + +The flow initiates when the \`deleteDocument\` action is called in the \`document.rest.js\` service file. This service then interacts with the \`deleteDocument\` core method defined in \`deleteDocument.js\`. The core method handles the logic for checking permissions, verifying document existence, and executing the delete operation in the database. Detailed error handling is implemented to manage cases like non-existent documents or insufficient permissions, ensuring the client receives clear and explanatory feedback. The method concludes by sending a response back to the client confirming the deletion or reporting any issues that occurred during the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/duplicateDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/duplicateDocumentRest.js new file mode 100644 index 0000000000..04564e9c66 --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/duplicateDocumentRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/duplicateDocumentRest'); +const { schema: xRequest } = require('./schemas/request/duplicateDocumentRest'); + +const openapi = { + summary: 'Duplicates a specific document within the content system', + description: `This endpoint is responsible for creating a duplicate copy of a specified document. The process involves copying the document’s data and metadata, ensuring that the new document retains the essential characteristics of the original while being a distinct entity in the system. + +**Authentication:** User authentication is required to access this endpoint. Users must provide valid session credentials to ensure they are allowed to duplicate documents. + +**Permissions:** The user must have the 'duplicate_document' permission assigned to their role. Without this permission, the request to duplicate a document will be denied. + +The duplication process begins by invoking the \`duplicateDocument\` function located in the backend core document logic. This function receives a document ID from the request's parameters and accesses the original document from the database. After retrieving the document, it performs a deep copy, including all related data such as attached files and metadata. The new copy is then saved under a new document ID with a reference to its origin. The final response from this endpoint provides the client with the ID of the newly duplicated document, confirming the successful completion of the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/getDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/getDocumentRest.js new file mode 100644 index 0000000000..e24752c209 --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/getDocumentRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getDocumentRest'); +const { schema: xRequest } = require('./schemas/request/getDocumentRest'); + +const openapi = { + summary: 'Fetches document details based on provided parameters', + description: `This endpoint is responsible for retrieving detailed information about a specific document. It handles the request by identifying a document using given parameters and returns comprehensive details about the document to the requesting user. + +**Authentication:** Users need to be authenticated to request the document details. If authentication information is missing or incorrect, the endpoint will deny access. + +**Permissions:** This endpoint requires users to have specific roles or permissions set to access the document details. The necessary permissions depend on the document’s confidentiality and user's access rights within the system. + +Upon receiving a request, the \`getDocumentRest\` handler initiates the process by calling the \`getDocument\` function from the document core module. The function uses parameters passed in the request to query the database and retrieve the document data. This interaction involves validating the request data, ensuring proper authentication and authorization, and seamlessly handling data retrieval from the database. Following successful data acquisition, the function then formats the data appropriately and sends it back to the client as a JSON object, providing a clear and structured representation of the document.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/saveDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/saveDocumentRest.js new file mode 100644 index 0000000000..7129ab96fc --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/saveDocumentRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveDocumentRest'); +const { schema: xRequest } = require('./schemas/request/saveDocumentRest'); + +const openapi = { + summary: 'Saves a document with the provided content updates', + description: `This endpoint allows users to save modifications to a document within the application. It accepts updated contents for an existing document, including text changes, format adjustments, and other related updates typically necessary for content management through a document editor interface. + +**Authentication:** Users must be authenticated to update documents. Proper session tokens must be included in the request to validate user identity and access rights. + +**Permissions:** Users need specific editing permissions for the document they attempt to modify. Without appropriate permissions, the request will be denied, safeguarding the document against unauthorized changes. + +Upon receiving the request, the endpoint invokes the \`saveDocument\` function from the \`Document\` core, which manages the document update process. The method receives the content updates along with a document identifier for accurate targeting within the database. It carries out a series of checks to confirm the user's rights to edit the document, then proceeds to update the document's entries in the database as specified in the request payload. Once the updates are successfully applied, the server responds with a confirmation of the changes, detailing the updated document's status and any relevant metadata associated with the modifications.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/assignDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/assignDocumentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/assignDocumentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/deleteDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/deleteDocumentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/deleteDocumentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/duplicateDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/duplicateDocumentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/duplicateDocumentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/getDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/getDocumentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/getDocumentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/saveDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/saveDocumentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/saveDocumentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/shareDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/shareDocumentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/request/shareDocumentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/assignDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/assignDocumentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/assignDocumentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/deleteDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/deleteDocumentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/deleteDocumentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/duplicateDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/duplicateDocumentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/duplicateDocumentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/getDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/getDocumentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/getDocumentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/saveDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/saveDocumentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/saveDocumentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/shareDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/shareDocumentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/schemas/response/shareDocumentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/shareDocumentRest.js b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/shareDocumentRest.js new file mode 100644 index 0000000000..737fdab66a --- /dev/null +++ b/plugins/leemons-plugin-content-creator/backend/services/rest/openapi/document/shareDocumentRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/shareDocumentRest'); +const { schema: xRequest } = require('./schemas/request/shareDocumentRest'); + +const openapi = { + summary: 'Share a document with specified users or groups', + description: `This endpoint enables a user to share a specific document with one or more users or groups within the platform. The sharing process involves specifying the document ID, the target users or groups, and the permissions that those entities will have on the shared document. + +**Authentication:** User authentication is required to ensure that only authorized users can share documents. Unauthorized attempts will be blocked and logged. + +**Permissions:** The user must have ownership or sharing permissions with edit rights on the document to share it with others. + +The process starts in the \`shareDocumentRest\` handler, which calls the \`shareDocument\` function from the core document module. This function takes input parameters such as document IDs, user or group IDs, and sharing permissions. It checks the user's rights over the document and then updates the database to reflect the new sharing settings. Internally, this may trigger notifications or logs to inform relevant users about the change in document access. The result of the operation is then formatted and returned as a standard JSON response, indicating the success or failure of the sharing request.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js index dfc50d9db9..65572eb4c9 100644 --- a/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/curriculum.rest.js @@ -22,9 +22,17 @@ const { } = require('../../core/curriculum'); // TODO [Importante]: Añadir autenticación y permisos +const getDataForKeysRest = require('./openapi/curriculum/getDataForKeysRest'); +const postCurriculumRest = require('./openapi/curriculum/postCurriculumRest'); +const listCurriculumRest = require('./openapi/curriculum/listCurriculumRest'); +const generateCurriculumRest = require('./openapi/curriculum/generateCurriculumRest'); +const publishCurriculumRest = require('./openapi/curriculum/publishCurriculumRest'); +const deleteCurriculumRest = require('./openapi/curriculum/deleteCurriculumRest'); +const getCurriculumRest = require('./openapi/curriculum/getCurriculumRest'); /** @type {ServiceSchema} */ module.exports = { getDataForKeysRest: { + openapi: getDataForKeysRest.openapi, rest: { method: 'POST', path: '/data-for-keys', @@ -36,6 +44,7 @@ module.exports = { }, }, postCurriculumRest: { + openapi: postCurriculumRest.openapi, rest: { method: 'POST', path: '/', @@ -47,6 +56,7 @@ module.exports = { }, }, listCurriculumRest: { + openapi: listCurriculumRest.openapi, rest: { method: 'GET', path: '/', @@ -82,20 +92,23 @@ module.exports = { }, }, generateCurriculumRest: { + openapi: generateCurriculumRest.openapi, rest: { method: 'POST', path: '/:id/generate', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const curriculum = await generateCurriculumNodesFromAcademicPortfolioByNodeLevels({ - curriculumId: ctx.params.id, - ctx, - }); + const curriculum = + await generateCurriculumNodesFromAcademicPortfolioByNodeLevels({ + curriculumId: ctx.params.id, + ctx, + }); return { status: 200, curriculum }; }, }, publishCurriculumRest: { + openapi: publishCurriculumRest.openapi, rest: { method: 'POST', path: '/:id/publish', @@ -110,6 +123,7 @@ module.exports = { }, }, deleteCurriculumRest: { + openapi: deleteCurriculumRest.openapi, rest: { method: 'DELETE', path: '/:id', @@ -124,6 +138,7 @@ module.exports = { }, }, getCurriculumRest: { + openapi: getCurriculumRest.openapi, rest: { method: 'POST', path: '/:id', diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/node.rest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/node.rest.js index 5d90a8ae45..f7fcc2dd3b 100644 --- a/plugins/leemons-plugin-curriculum/backend/services/rest/node.rest.js +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/node.rest.js @@ -15,9 +15,12 @@ const _ = require('lodash'); const { addNode, saveNode } = require('../../core/nodes'); // TODO [Importante]: Añadir autenticación y permisos +const postNodeRest = require('./openapi/node/postNodeRest'); +const saveNodeRest = require('./openapi/node/saveNodeRest'); /** @type {ServiceSchema} */ module.exports = { postNodeRest: { + openapi: postNodeRest.openapi, rest: { method: 'POST', path: '/', @@ -29,13 +32,18 @@ module.exports = { }, }, saveNodeRest: { + openapi: saveNodeRest.openapi, rest: { method: 'PUT', path: '/', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const node = await saveNode({ nodeId: ctx.params.id, ...ctx.params, ctx }); + const node = await saveNode({ + nodeId: ctx.params.id, + ...ctx.params, + ctx, + }); return { status: 200, node }; }, }, diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/nodeLevels.rest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/nodeLevels.rest.js index 20c4c2b00c..eff3431601 100644 --- a/plugins/leemons-plugin-curriculum/backend/services/rest/nodeLevels.rest.js +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/nodeLevels.rest.js @@ -15,9 +15,12 @@ const _ = require('lodash'); const { addNodeLevels, updateNodeLevel } = require('../../core/nodeLevels'); // TODO [Importante]: Añadir autenticación y permisos +const postNodeLevelsRest = require('./openapi/node-levels/postNodeLevelsRest'); +const putNodeLevelRest = require('./openapi/node-levels/putNodeLevelRest'); /** @type {ServiceSchema} */ module.exports = { postNodeLevelsRest: { + openapi: postNodeLevelsRest.openapi, rest: { method: 'POST', path: '/', @@ -29,6 +32,7 @@ module.exports = { }, }, putNodeLevelRest: { + openapi: putNodeLevelRest.openapi, rest: { method: 'PUT', path: '/', diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/deleteCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/deleteCurriculumRest.js new file mode 100644 index 0000000000..367105802a --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/deleteCurriculumRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteCurriculumRest'); +const { schema: xRequest } = require('./schemas/request/deleteCurriculumRest'); + +const openapi = { + summary: 'Delete a specified curriculum', + description: `This endpoint deletes a curriculum based on the provided curriculum ID. It is designed to handle deletion operations for curriculums in the Leemons platform, ensuring data associated with the curriculum is appropriately removed from the system. + +**Authentication:** Users need to be authenticated to perform deletion operations on curriculums. A valid authentication token must be presented to access this endpoint. + +**Permissions:** This endpoint requires the user to have administrative rights or specific deletion permissions related to curriculum management. Without the necessary permissions, the request will be denied. + +Upon receiving a delete request, the endpoint first validates the user's authentication and checks for the required permissions. If both checks are passed, it proceeds to invoke the \`deleteCurriculum\` method from the \`curriculum\` core. This method is responsible for all operations related to the removal of the curriculum from the database, including the deletion of any linked data that might disrupt the system's integrity if left behind. The operation's success or failure is then communicated back to the user through an appropriate HTTP response message, completing the curriculum deletion process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/generateCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/generateCurriculumRest.js new file mode 100644 index 0000000000..43d1ffc2b4 --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/generateCurriculumRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/generateCurriculumRest'); +const { + schema: xRequest, +} = require('./schemas/request/generateCurriculumRest'); + +const openapi = { + summary: 'Generate curriculum structure based on academic portfolio', + description: `This endpoint allows the creation or updating of curriculum structures derived from an academic portfolio. The curriculum is built by analyzing the node levels provided in the portfolio and organizing them into a curriculum framework suitable for educational planning and tracking. + +**Authentication:** User authentication is mandatory for accessing this endpoint. Unauthenticated access attempts will be rejected. + +**Permissions:** The user must have 'curriculum_modify' permission to execute this operation. This ensures that only authorized personnel can make changes to curriculum structures. + +The controller handler for this endpoint begins by invoking the \`generateCurriculumNodesFromAcademicPortfolioByNodeLevels\` function found within the curriculum core module. This function takes node levels from the user's academic portfolio as inputs and processes them to create a structured layout of curriculum nodes. Each node represents a specific academic or educational element that is part of a comprehensive curriculum. After generating these nodes, they are organized into a tree structure using the \`nodesTreeByCurriculum\` method, which aligns them according to their hierarchical relationships within the curriculum framework. The endpoint ultimately responds with a JSON structure representing the created or updated curriculum, detailing the arrangement of nodes and their respective levels.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/getCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/getCurriculumRest.js new file mode 100644 index 0000000000..59c12695c8 --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/getCurriculumRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getCurriculumRest'); +const { schema: xRequest } = require('./schemas/request/getCurriculumRest'); + +const openapi = { + summary: 'Manage and retrieve detailed curriculum data', + description: `This endpoint facilitates the retrieval and management of detailed curriculum data including its structural components and associated levels. It primarily handles requests related to specific curriculum items or sets of curriculum data, adjusting its responses based on the provided identifiers. + +**Authentication:** Users need to be authenticated to interact with the curriculum data endpoints. Any requests without proper authentication will be denied access to the curriculum data. + +**Permissions:** The user must have appropriate permissions related to educational content management or specific rights granted for accessing or managing curriculum data. + +The flow of this controller starts by validating the user's identity and permissions. It then proceeds to extract curriculum IDs from the request parameters and invokes the \`getCurriculumByIds\` method from the curriculum core service. This method retrieves data for each curriculum ID, including node levels and tree structures, by making subsequent calls to \`nodeLevelsByCurriculum\` and \`nodesTreeByCurriculum\`. The endpoint consolidates all this data to form a comprehensive view of the curriculum, which is then returned to the user in a structured JSON format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/getDataForKeysRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/getDataForKeysRest.js new file mode 100644 index 0000000000..94abd35f60 --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/getDataForKeysRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getDataForKeysRest'); +const { schema: xRequest } = require('./schemas/request/getDataForKeysRest'); + +const openapi = { + summary: 'Extracts specific curriculum data based on provided keys', + description: `This endpoint is designed to selectively retrieve detailed information from the curriculum based on a set of predefined keys. The data fetched may include details such as curriculum structure, content descriptions, learning outcomes, and any associated metadata that aids in educational planning and assessments. + +**Authentication:** User authentication is required to ensure secure access to the curriculum data. Users must provide valid credentials to interact with this endpoint. + +**Permissions:** This endpoint necessitates specific permissions tailored to access educational data. Users need to have the 'view_curriculum' permission granted to fetch curriculum-specific information effectively. + +Upon receiving a request, the \`getDataForKeys\` handler initiates by validating the provided keys against available data fields in the curriculum database. It employs the \`getDataForKeys\` method in the curriculum core to perform database queries that extract the relevant data based on these keys. This process includes error handling to manage scenarios where keys are invalid or data retrieval fails. The successful execution of this method results in compiling the requested curriculum data, which is then formatted into a JSON response and sent back to the requester, thus providing a clear and structured view of the curriculum based on specified criteria.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/listCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/listCurriculumRest.js new file mode 100644 index 0000000000..126eaf27e3 --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/listCurriculumRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listCurriculumRest'); +const { schema: xRequest } = require('./schemas/request/listCurriculumRest'); + +const openapi = { + summary: 'List all curriculums available in the system', + description: `This endpoint lists all curriculums configured within the Leemons platform. It provides a comprehensive overview of the curriculum structures that are available for educational institutions to manage and utilize in their educational offerings. + +**Authentication:** Users must be authenticated to access the list of curriculums. Access to this endpoint requires valid user credentials, which are verified through the platform's authentication system. An invalid or missing authentication token will lead to access denial. + +**Permissions:** Appropriate permissions are required to view the list of curriculums. The user must have curriculum management roles or specific permissions that allow them to visualize curriculum configurations. + +After authentication, the \`listCurriculums\` method in the \`curriculum\` core is called. This method is responsible for querying the database for all curriculums and their relevant details such as titles, scopes, and applicable educational standards. The flow involves retrieving these data entries and formatting them into a structured response that the front end can display. The actual data handling includes sorting and potentially filtering curriculums based on user permissions and roles, ensuring that users receive content appropriate to their access rights. The response is then delivered in JSON format listing the curriculums.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/postCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/postCurriculumRest.js new file mode 100644 index 0000000000..8cbc3c8826 --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/postCurriculumRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postCurriculumRest'); +const { schema: xRequest } = require('./schemas/request/postCurriculumRest'); + +const openapi = { + summary: 'Add a new curriculum', + description: `This endpoint is responsible for adding a new curriculum to the database. It handles the validation of input data to ensure adherence to required curriculum structures and saves the validated curriculum details in the database. + +**Authentication:** User authentication is required to access this endpoint. Without successful authentication, the endpoint will reject the request and inform the user of the need to log in. + +**Permissions:** The user must have the 'add_curriculum' permission to execute this action. Users without the appropriate permissions will receive an error indicating insufficient privileges. + +The flow of this endpoint begins by parsing and validating the incoming data against a pre-defined schema to ensure it meets all requirements for a curriculum entity. If the data is valid, it proceeds to invoke the \`addCurriculum\` method in the curriculum core service with the sanitized data. This method takes care of interacting with the database to store the new curriculum details. Upon successful insertion, the endpoint returns a success message and details of the added curriculum. If any part of the process fails, appropriate error messages are generated and returned to the user, providing clarity on what went wrong.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/publishCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/publishCurriculumRest.js new file mode 100644 index 0000000000..6141a3b527 --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/publishCurriculumRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/publishCurriculumRest'); +const { schema: xRequest } = require('./schemas/request/publishCurriculumRest'); + +const openapi = { + summary: 'Publish curriculum configurations for availability', + description: `This endpoint is responsible for making curriculum configurations available for use across the platform. It involves validating and setting up the necessary details to ensure the curriculum can be accessed and utilized by the intended parties. + +**Authentication:** Users must be authenticated to perform this operation. A check is done to ensure that the request is accompanied by a valid authentication token. + +**Permissions:** The user needs to have 'curriculum_publish' permission to execute this operation. Any attempt by users lacking this permission will result in an authorization error. + +The process begins by invoking the \`publishCurriculum\` method located in the \`curriculum/index.js\` file. The method receives parameters that define which curriculum is to be published and any specific settings associated with the publication process. It interacts with underlying databases and services to update curriculum states and propagate changes where necessary. This method ensures all configurable elements are correctly set and verifies the integrity of the data before marking the curriculum as published. Upon successful completion, the endpoint returns a response indicating the curriculum has been published.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/deleteCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/deleteCurriculumRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/deleteCurriculumRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/generateCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/generateCurriculumRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/generateCurriculumRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/getCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/getCurriculumRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/getCurriculumRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/getDataForKeysRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/getDataForKeysRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/getDataForKeysRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/listCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/listCurriculumRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/listCurriculumRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/postCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/postCurriculumRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/postCurriculumRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/publishCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/publishCurriculumRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/request/publishCurriculumRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/deleteCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/deleteCurriculumRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/deleteCurriculumRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/generateCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/generateCurriculumRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/generateCurriculumRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/getCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/getCurriculumRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/getCurriculumRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/getDataForKeysRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/getDataForKeysRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/getDataForKeysRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/listCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/listCurriculumRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/listCurriculumRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/postCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/postCurriculumRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/postCurriculumRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/publishCurriculumRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/publishCurriculumRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/curriculum/schemas/response/publishCurriculumRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/postNodeLevelsRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/postNodeLevelsRest.js new file mode 100644 index 0000000000..5d7c771f1a --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/postNodeLevelsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postNodeLevelsRest'); +const { schema: xRequest } = require('./schemas/request/postNodeLevelsRest'); + +const openapi = { + summary: 'Add new node levels to the curriculum', + description: `This endpoint allows for the addition of new node levels to a specified curriculum. It is designed to receive a structured set of node level data, validate it against predefined schemas, and subsequently integrate it into the curriculum's existing structure. + +**Authentication:** User authentication is mandatory to interact with this endpoint. Access is denied for non-authenticated or improperly authenticated requests. + +**Permissions:** The user must have 'curriculum_management' permission to add new node levels. Without this permission, the request will be rejected. + +Upon receiving the request, the endpoint calls the \`addNodeLevels\` function from the \`nodeLevels\` core module. This function processes the incoming data, ensuring all validations are met and that the data conforms to the required format and relations for inclusion in the curriculum. It involves complex logic to correctly place the node levels within the curriculum's structure and to handle any potential conflicts with existing nodes. If the operation is successful, a confirmation response is sent back to the client indicating that the new node levels have been added. If there are any errors during the process, the client receives an error message detailing the issue.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/putNodeLevelRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/putNodeLevelRest.js new file mode 100644 index 0000000000..088f414c37 --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/putNodeLevelRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putNodeLevelRest'); +const { schema: xRequest } = require('./schemas/request/putNodeLevelRest'); + +const openapi = { + summary: 'Update node level details', + description: `This endpoint allows updating of specific node level details within the Leemons platform curriculum management. The modifications can include changes to the hierarchy, labeling, or any associated attributes of a node level. + +**Authentication:** Users must be authenticated to modify node level details. Actions performed without valid authentication will result in access denial. + +**Permissions:** Users need to have \`edit_node_level\` permission to update details of a node level. Attempts to update without sufficient permissions will be blocked and logged for security audits. + +Upon receiving a request, the endpoint initiates the \`updateNodeLevel\` method from the \`nodeLevels\` core module. This method utilizes the passed data (typically in JSON format), which includes the specific changes to be made, along with the unique identifier of the node level. The procedure involves validation of the data against predefined schemas to ensure compliance with the platform's data standards. If validations pass, the method proceeds to apply the updates in the database. The success or failure of the operation, along with updated data if successful, is then conveyed back to the user through a standardized HTTP response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/schemas/request/postNodeLevelsRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/schemas/request/postNodeLevelsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/schemas/request/postNodeLevelsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/schemas/request/putNodeLevelRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/schemas/request/putNodeLevelRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/schemas/request/putNodeLevelRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/schemas/response/postNodeLevelsRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/schemas/response/postNodeLevelsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/schemas/response/postNodeLevelsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/schemas/response/putNodeLevelRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/schemas/response/putNodeLevelRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node-levels/schemas/response/putNodeLevelRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/postNodeRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/postNodeRest.js new file mode 100644 index 0000000000..c65da52967 --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/postNodeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postNodeRest'); +const { schema: xRequest } = require('./schemas/request/postNodeRest'); + +const openapi = { + summary: 'Add a new curriculum node', + description: `This endpoint allows for the addition of a new node within a specified curriculum structure. A node can represent a modular unit such as a chapter, section, or a specific educational content item that fits within the broader curriculum framework. + +**Authentication:** User must be logged in to create a new node. A valid authentication token is required to proceed, and failure to provide one will result in a denial of access to this endpoint. + +**Permissions:** The user needs to have 'create_node' permission in their profile to perform this action. Without sufficient permissions, the system will reject the request to add a new node. + +During the execution flow of this endpoint, the \`addNode\` method from the \`nodes\` core is first invoked. This method takes incoming data which typically includes the node’s title, description, the curriculum it belongs to, and any other relevant metadata. It validates the data against predefined schemas to ensure compliance with the system's requirements. Upon successful validation, the data is inserted into the curriculum structure in the database. Confirmation of this insertion is then returned to the user along with the new node's details, all sent back as a JSON object in the HTTP response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/saveNodeRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/saveNodeRest.js new file mode 100644 index 0000000000..c164d1a1d3 --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/saveNodeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveNodeRest'); +const { schema: xRequest } = require('./schemas/request/saveNodeRest'); + +const openapi = { + summary: 'Saves or updates curriculum node details', + description: `This endpoint is designed for the creation or updating of curriculum node details. It handles both the creation of new nodes and the updates to existing nodes, focusing on saving the data related to a specific curriculum structure, such as lectures, lessons, or topics within the educational platform. + +**Authentication:** User authentication is required to ensure that only logged-in users can alter curriculum nodes. Authenticated status is mandatory to proceed with any data modification. + +**Permissions:** Users need to have specific rights to create or edit curriculum nodes. The required permissions include role-based checks that ensure only authorized personnel such as educators or curriculum managers can modify the content. + +The process begins with the \`saveNodeRest\` action receiving the request and extracting necessary data such as node details from the request body. It then calls the \`saveNode\` method from the \`nodes\` core module, passing the extracted data. This method is responsible for checking the existence of the node by ID, performing validations, and then either updating the existing node or creating a new one if it does not exist. All database interactions necessary for storing or updating the node are handled within this method. On successful completion of these operations, the method returns an acknowledgment that the node details have been successfully saved or updated, which is then relayed back to the user through a standardized API response format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/schemas/request/postNodeRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/schemas/request/postNodeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/schemas/request/postNodeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/schemas/request/saveNodeRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/schemas/request/saveNodeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/schemas/request/saveNodeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/schemas/response/postNodeRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/schemas/response/postNodeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/schemas/response/postNodeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/schemas/response/saveNodeRest.js b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/schemas/response/saveNodeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-curriculum/backend/services/rest/openapi/node/schemas/response/saveNodeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dashboard/backend/services/rest/admin.rest.js b/plugins/leemons-plugin-dashboard/backend/services/rest/admin.rest.js index 0475a85e37..6e600c7e9d 100644 --- a/plugins/leemons-plugin-dashboard/backend/services/rest/admin.rest.js +++ b/plugins/leemons-plugin-dashboard/backend/services/rest/admin.rest.js @@ -2,7 +2,6 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsValidator } = require('@leemons/validator'); const { @@ -10,10 +9,16 @@ const { LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); const { getAdminDashboard } = require('../../core/dashboard/getAdminDashboard'); -const { getAdminDashboardRealtime } = require('../../core/dashboard/getAdminDashboardRealtime'); +const { + getAdminDashboardRealtime, +} = require('../../core/dashboard/getAdminDashboardRealtime'); +const adminRest = require('./openapi/admin/adminRest'); +const adminRealtimeRest = require('./openapi/admin/adminRealtimeRest'); +/** @type {ServiceSchema} */ module.exports = { adminRest: { + openapi: adminRest.openapi, rest: { method: 'GET', path: '/', @@ -38,6 +43,7 @@ module.exports = { }, }, adminRealtimeRest: { + openapi: adminRealtimeRest.openapi, rest: { method: 'GET', path: '/realtime', diff --git a/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/adminRealtimeRest.js b/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/adminRealtimeRest.js new file mode 100644 index 0000000000..c240082fe3 --- /dev/null +++ b/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/adminRealtimeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/adminRealtimeRest'); +const { schema: xRequest } = require('./schemas/request/adminRealtimeRest'); + +const openapi = { + summary: 'Provide real-time dashboard data for administrators', + description: `This endpoint provides a real-time view of the dashboard data specifically tailored for administrators. It facilitates the monitoring and management of various system metrics and activities from a centralized dashboard interface. + +**Authentication:** Access to this endpoint requires the user to be authenticated. Failure to provide valid authentication credentials will prevent access. + +**Permissions:** The user must have administrator-level permissions to access this endpoint. This ensures that only authorized personnel can view and interact with the sensitive real-time data presented. + +Upon receiving a request, the \`adminRealtimeRest\` handler firstly verifies the authentication and permissions of the requesting user to ensure they meet the required criteria. If authentication or permissions are inadequate, the request is denied. Once authenticated, it invokes the \`getAdminDashboardRealtime\` core method. This method consolidates data from various services and modules within the platform, processing them to generate real-time insights. The data is then returned to the admin user through this endpoint in a structured JSON format, which includes key performance metrics and system statuses crucial for administrative monitoring and decision-making.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/adminRest.js b/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/adminRest.js new file mode 100644 index 0000000000..f7a4a33fee --- /dev/null +++ b/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/adminRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/adminRest'); +const { schema: xRequest } = require('./schemas/request/adminRest'); + +const openapi = { + summary: 'Manage and display the admin dashboard configuration', + description: `This endpoint is responsible for handling requests related to the administration dashboard's configuration and display settings. It serves to aggregate and provide data necessary for the admin dashboard's functionality, tailored specifically to the administrative user's needs and preferences. + +**Authentication:** Access to this endpoint requires the user to be authenticated as an administrator. Proper credentials must be provided for authentication, and failure to authenticate will deny access to the endpoint functionalities. + +**Permissions:** This endpoint requires that the user have administrative privileges. Users must have particular roles or permissions designated within the system to interact with the admin dashboard functionalities. + +Upon receiving a request, the \`getAdminDashboard\` handler in the \`leemons-plugin-dashboard\` invokes related core methods designed to collect and assemble various pieces of information required for the dashboard. It processes these data points, such as system stats, user activities, and operational insights, to create a comprehensive view suitable for admin-level decision-making. Once the data is collated, it is returned in a structured format, allowing the admin dashboard to render an informed and detailed interface for the administrator.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/schemas/request/adminRealtimeRest.js b/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/schemas/request/adminRealtimeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/schemas/request/adminRealtimeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/schemas/request/adminRest.js b/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/schemas/request/adminRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/schemas/request/adminRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/schemas/response/adminRealtimeRest.js b/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/schemas/response/adminRealtimeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/schemas/response/adminRealtimeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/schemas/response/adminRest.js b/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/schemas/response/adminRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dashboard/backend/services/rest/openapi/admin/schemas/response/adminRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js b/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js index 53b7c98871..5021f13625 100644 --- a/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js +++ b/plugins/leemons-plugin-dataset/backend/services/rest/dataset.rest.js @@ -33,9 +33,16 @@ const schemaConfig = { required: ['schema', 'ui'], }; +const getSchemaRest = require('./openapi/dataset/getSchemaRest'); +const getSchemaLocaleRest = require('./openapi/dataset/getSchemaLocaleRest'); +const getSchemaFieldLocaleRest = require('./openapi/dataset/getSchemaFieldLocaleRest'); +const saveFieldRest = require('./openapi/dataset/saveFieldRest'); +const saveMultipleFieldsRest = require('./openapi/dataset/saveMultipleFieldsRest'); +const removeFieldRest = require('./openapi/dataset/removeFieldRest'); /** @type {ServiceSchema} */ module.exports = { getSchemaRest: { + openapi: getSchemaRest.openapi, rest: { method: 'POST', path: '/get-schema', @@ -68,6 +75,7 @@ module.exports = { }, }, getSchemaLocaleRest: { + openapi: getSchemaLocaleRest.openapi, rest: { method: 'POST', path: '/get-schema-locale', @@ -95,7 +103,8 @@ module.exports = { }); if (validator.validate(ctx.params)) { let { locale } = ctx.params; - if (!locale) locale = await ctx.tx.call('users.platform.getDefaultLocale'); + if (!locale) + locale = await ctx.tx.call('users.platform.getDefaultLocale'); // TODO Esto es "inseguro" ya que se le esta pasando el calledFrom const dataset = await getSchemaWithLocale({ ...ctx.params, @@ -108,6 +117,7 @@ module.exports = { }, }, getSchemaFieldLocaleRest: { + openapi: getSchemaFieldLocaleRest.openapi, rest: { method: 'POST', path: '/get-schema-field-locale', @@ -152,6 +162,7 @@ module.exports = { }, }, saveFieldRest: { + openapi: saveFieldRest.openapi, rest: { method: 'POST', path: '/save-field', @@ -187,7 +198,12 @@ module.exports = { additionalProperties: false, }, }, - required: ['locationName', 'pluginName', 'schemaConfig', 'schemaLocales'], + required: [ + 'locationName', + 'pluginName', + 'schemaConfig', + 'schemaLocales', + ], additionalProperties: false, }); if (validator.validate(ctx.params)) { @@ -206,6 +222,7 @@ module.exports = { }, }, saveMultipleFieldsRest: { + openapi: saveMultipleFieldsRest.openapi, rest: { method: 'POST', path: '/save-multiple-fields', @@ -260,6 +277,7 @@ module.exports = { }, }, removeFieldRest: { + openapi: removeFieldRest.openapi, rest: { method: 'POST', path: '/remove-field', diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/getSchemaFieldLocaleRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/getSchemaFieldLocaleRest.js new file mode 100644 index 0000000000..e6eb056142 --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/getSchemaFieldLocaleRest.js @@ -0,0 +1,32 @@ +const { schema } = require('./schemas/response/getSchemaFieldLocaleRest'); +const { + schema: xRequest, +} = require('./schemas/request/getSchemaFieldLocaleRest'); + +const openapi = { + summary: + 'Fetches localized schema details for a specific field in a dataset.', + description: `This endpoint is responsible for retrieving the localized details of a specific schema field within a dataset. The localized details indicate variations or specifics such as localized labels or descriptions, according to different set locales which can support applications in providing multi-lingual features. + +**Authentication:** User authentication is mandatory, ensuring that only authenticated users can access the localized schema information. Absence of proper authentication will restrict access to the endpoint. + +**Permissions:** Users need to have adequate permissions related to viewing or managing dataset schemas to access this endpoint. This might include roles such as admin, editor, or specific roles granted access to the dataset management module. + +The endpoint initiates by validating the user's authentication status and permissions. It then proceeds to call the \`getSchemaFieldLocale\` method from the dataset schema core services. This method accepts parameters such as \`fieldId\` and \`locale\`, and conducts a database query to fetch the corresponding localized data for the specified schema field. The result of this query is processed and returned as JSON, containing detailed localized information of the schema field, which supports front-end applications in rendering context-appropriate label or description based on user’s locale setting.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/getSchemaLocaleRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/getSchemaLocaleRest.js new file mode 100644 index 0000000000..11f51ad456 --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/getSchemaLocaleRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getSchemaLocaleRest'); +const { schema: xRequest } = require('./schemas/request/getSchemaLocaleRest'); + +const openapi = { + summary: 'Fetch localized schema information', + description: `This endpoint retrieves the schema definitions for datasets, localized to the currently set or specified locale. It primarily serves to provide clients such as frontend applications with the necessary configuration and definition to handle datasets correctly according to the localization settings. + +**Authentication:** Users must be authenticated to access localized schema information. Any requests without a valid session or authentication credentials will be denied access to this endpoint. + +**Permissions:** Users need specific permissions to fetch localized schema information; typically, this includes roles or rights that allow access to dataset management or administrative capabilities within the application. + +Upon receiving a request, the \`getSchemaLocaleRest\` handler executes a sequence of operations to fetch and return the requested schema information. It begins by validating the request parameters, ensuring the requested locale is supported. It then queries the underlying database using the \`DatasetSchemaLocale\` service to get the relevant localized schema data. The final response includes the schema configuration in a JSON format, tailored to the locale preferences of the requesting user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/getSchemaRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/getSchemaRest.js new file mode 100644 index 0000000000..46614f498e --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/getSchemaRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getSchemaRest'); +const { schema: xRequest } = require('./schemas/request/getSchemaRest'); + +const openapi = { + summary: 'Fetch dataset schema based on specifications', + description: `This endpoint retrieves the detailed schema for a specific dataset based on the given dataset identifier. It provides a comprehensive outline of the dataset's structure, including field types, mandatory rules, and other relevant metadata. + +**Authentication:** Access to this endpoint requires the user to be authenticated. A valid session or authentication token must be presented to ensure that the request is being made by a legitimate user. + +**Permissions:** Users must have the role or permission set that explicitly grants them access to view dataset schemas. Without these permissions, the request will be denied, ensuring data security and appropriate access control. + +After validating the user's authentication and permissions, the handler engages the \`getSchema\` function from the \`datasetSchema\` core module. This function is tasked with retrieving the schema details from the database using the dataset identifier provided in the request parameters. The entire operation is managed within the Moleculer service context, facilitating error handling and response formatting. The successful execution of this function results in a JSON object that describes the dataset schema, which is then relayed back to the user through the HTTP response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/removeFieldRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/removeFieldRest.js new file mode 100644 index 0000000000..dcac011829 --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/removeFieldRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeFieldRest'); +const { schema: xRequest } = require('./schemas/request/removeFieldRest'); + +const openapi = { + summary: 'Removes a specified field from a dataset schema', + description: `This endpoint allows the deletion of a specific field from an existing dataset schema. The action updates the schema configuration by removing field entries and any associated validations or dependencies linked to that field in the dataset. + +**Authentication:** Users need to be authenticated to perform this operation. Any requests made without proper authentication will be rejected and the user will not be able to access the endpoint. + +**Permissions:** Users must have editing permissions on the dataset schema to execute this action. The necessary permissions are checked against the user's role and access rights before proceeding with the deletion of the field. + +The process begins when the \`removeFieldRest\` action in \`dataset.rest.js\` receives a request specifying the field to be removed. It utilizes the \`removeField\` method from \`datasetSchema\` core module. The method performs a validation check using \`exists.js\` to ensure the dataset and the field exists before proceeding. Upon successful validation, it updates the schema by removing the field entry and updates any dependencies in the dataset. The updated dataset schema is saved and a success response is returned to the user, confirming that the field has been removed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/saveFieldRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/saveFieldRest.js new file mode 100644 index 0000000000..c9bec4f595 --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/saveFieldRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveFieldRest'); +const { schema: xRequest } = require('./schemas/request/saveFieldRest'); + +const openapi = { + summary: 'Save field details in a dataset schema', + description: `This endpoint is responsible for updating or adding field information to a specific dataset schema. It handles the addition or modification of data fields within an existing schema ensuring data integrity and compliance with the defined schema rules. + +**Authentication:** User authentication is required to ensure that only authorized personnel can make changes to dataset schemas. Unauthorized access is strictly monitored and prevented. + +**Permissions:** Users need the appropriate dataset management permissions. Without sufficient permissions, the operation will not be executed, and an error response will be returned. + +The process begins when the endpoint receives a request containing new or updated field details. It first validates the user's authentication and permission levels. Once validated, the endpoint uses the \`saveField\` method from the \`datasetSchema\` core module. This method checks the validity of the provided field data against the existing schema definitions. If the data is valid, it proceeds to either add a new field or update an existing one in the database. The operation's success or failure, along with relevant messages, are then encapsulated in the response sent back to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/saveMultipleFieldsRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/saveMultipleFieldsRest.js new file mode 100644 index 0000000000..94c20d0494 --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/saveMultipleFieldsRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/saveMultipleFieldsRest'); +const { + schema: xRequest, +} = require('./schemas/request/saveMultipleFieldsRest'); + +const openapi = { + summary: 'Saves multiple fields in a dataset schema', + description: `This endpoint is responsible for the creation or update of multiple fields within a specific dataset schema in the system. It handles complex operations where multiple field definitions need to be saved simultaneously, ensuring data integrity and compliance with the dataset's structure. + +**Authentication:** The user needs to be authenticated to perform this operation. The system will validate the user's credentials and session to authorize the request. + +**Permissions:** Users must have 'edit' permissions on the dataset schema to add or update fields. Permissions are checked against the user's role and privileges prior to processing the request. + +Upon receiving the request, the handler initially validates the provided field data against the existing dataset schema format. It then interacts with the \`saveMultipleFields\` method in the backend dataset schema core, which is designed to handle updates or additions of multiple fields efficiently. This method processes each field individually, applying validation rules, handling data conversion, and ensuring that no conflicts occur with existing field definitions. After successful execution, the system updates the dataset schema in the data store, reflecting the changes made. A response is then generated to indicate the success of the operation, or failure details in case of an error.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/getSchemaFieldLocaleRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/getSchemaFieldLocaleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/getSchemaFieldLocaleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/getSchemaLocaleRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/getSchemaLocaleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/getSchemaLocaleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/getSchemaRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/getSchemaRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/getSchemaRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/removeFieldRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/removeFieldRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/removeFieldRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/saveFieldRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/saveFieldRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/saveFieldRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/saveMultipleFieldsRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/saveMultipleFieldsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/request/saveMultipleFieldsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/getSchemaFieldLocaleRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/getSchemaFieldLocaleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/getSchemaFieldLocaleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/getSchemaLocaleRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/getSchemaLocaleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/getSchemaLocaleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/getSchemaRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/getSchemaRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/getSchemaRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/removeFieldRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/removeFieldRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/removeFieldRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/saveFieldRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/saveFieldRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/saveFieldRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/saveMultipleFieldsRest.js b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/saveMultipleFieldsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-dataset/backend/services/rest/openapi/dataset/schemas/response/saveMultipleFieldsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js index 481f6d6c4b..a3c4a52812 100644 --- a/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/deployment-manager.rest.js @@ -7,16 +7,33 @@ const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const { LeemonsValidator } = require('@leemons/validator'); const { validateInternalPrivateKey } = require('@leemons/deployment-manager'); -const { updateDeploymentConfig } = require('../../core/deployments/updateDeploymentConfig'); +const { + updateDeploymentConfig, +} = require('../../core/deployments/updateDeploymentConfig'); const { addDeployment } = require('../../core/deployments/addDeployment'); const { isDomainInUse } = require('../../core/deployments/isDomainInUse'); -const { reloadAllDeployments } = require('../../core/auto-init/reload-all-deployments'); -const { getDeploymentInfo } = require('../../core/deployments/getDeploymentInfo'); -const { getDeploymentConfig } = require('../../core/deployments/getDeploymentConfig'); +const { + reloadAllDeployments, +} = require('../../core/auto-init/reload-all-deployments'); +const { + getDeploymentInfo, +} = require('../../core/deployments/getDeploymentInfo'); +const { + getDeploymentConfig, +} = require('../../core/deployments/getDeploymentConfig'); +const getConfigRest = require('./openapi/deployment-manager/getConfigRest'); +const getDeploymentTypeRest = require('./openapi/deployment-manager/getDeploymentTypeRest'); +const infoRest = require('./openapi/deployment-manager/infoRest'); +const existDeploymentWithDomainRest = require('./openapi/deployment-manager/existDeploymentWithDomainRest'); +const changeDeploymentConfigRest = require('./openapi/deployment-manager/changeDeploymentConfigRest'); +const addManualDeploymentRest = require('./openapi/deployment-manager/addManualDeploymentRest'); +const reloadAllDeploymentsRest = require('./openapi/deployment-manager/reloadAllDeploymentsRest'); +const deploymentInfoRest = require('./openapi/deployment-manager/deploymentInfoRest'); /** @type {ServiceSchema} */ module.exports = { getConfigRest: { + openapi: getConfigRest.openapi, rest: { method: 'GET', path: '/config', @@ -29,19 +46,25 @@ module.exports = { }, }, getDeploymentTypeRest: { + openapi: getDeploymentTypeRest.openapi, rest: { method: 'GET', path: '/type', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const deployment = await ctx.db.Deployment.findOne({ id: ctx.meta.deploymentID }, undefined, { - disableAutoDeploy: true, - }).lean(); + const deployment = await ctx.db.Deployment.findOne( + { id: ctx.meta.deploymentID }, + undefined, + { + disableAutoDeploy: true, + } + ).lean(); return deployment.type; }, }, infoRest: { + openapi: infoRest.openapi, rest: { method: 'POST', path: '/info', @@ -58,14 +81,18 @@ module.exports = { }); if (validator.validate(ctx.params)) { const pluginName = ctx.params.name.replace('leemons-plugin-', ''); - const plugin = await ctx.db.DeploymentPlugins.findOne({ pluginName }).lean(); - if (plugin) return { name: plugin.pluginName, version: plugin.pluginVersion }; + const plugin = await ctx.db.DeploymentPlugins.findOne({ + pluginName, + }).lean(); + if (plugin) + return { name: plugin.pluginName, version: plugin.pluginVersion }; return null; } throw validator.error; }, }, existDeploymentWithDomainRest: { + openapi: existDeploymentWithDomainRest.openapi, dontCreateTransactionOnCallThisFunction: true, rest: { method: 'POST', @@ -88,6 +115,7 @@ module.exports = { }, }, changeDeploymentConfigRest: { + openapi: changeDeploymentConfigRest.openapi, dontCreateTransactionOnCallThisFunction: true, rest: { method: 'POST', @@ -112,6 +140,7 @@ module.exports = { }, }, addManualDeploymentRest: { + openapi: addManualDeploymentRest.openapi, dontCreateTransactionOnCallThisFunction: true, rest: { method: 'POST', @@ -138,6 +167,7 @@ module.exports = { }, }, reloadAllDeploymentsRest: { + openapi: reloadAllDeploymentsRest.openapi, dontCreateTransactionOnCallThisFunction: true, rest: { method: 'POST', @@ -146,11 +176,16 @@ module.exports = { async handler(ctx) { validateInternalPrivateKey({ ctx }); const { ids, reloadRelations } = ctx.params; - const count = await reloadAllDeployments({ broker: this.broker, ids, reloadRelations }); + const count = await reloadAllDeployments({ + broker: this.broker, + ids, + reloadRelations, + }); return { count }; }, }, deploymentInfoRest: { + openapi: deploymentInfoRest.openapi, dontCreateTransactionOnCallThisFunction: true, rest: { method: 'POST', diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/addManualDeploymentRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/addManualDeploymentRest.js new file mode 100644 index 0000000000..99b0d97b70 --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/addManualDeploymentRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/addManualDeploymentRest'); +const { + schema: xRequest, +} = require('./schemas/request/addManualDeploymentRest'); + +const openapi = { + summary: 'Initiate a new manual deployment process', + description: `This endpoint facilitates the initiation of a new manual deployment in the leemons platform. It primarily serves as the starting point for deploying new configurations or services manually by the user. + +**Authentication:** Users must be authenticated to initiate a deployment process. Unauthorized access will be blocked and the system will only process requests from valid, logged-in users. + +**Permissions:** The user must have specific roles or permissions, typically like 'deployment-manager' or 'admin', allowing them to perform deployment-related actions within the system. + +The process starts with the endpoint receiving a deployment configuration request. This request triggers the \`addDeployment\` method in the deployment manager's core logic. The method involves validating the provided deployment data against predefined schemas and ensuring all necessary components for the deployment are accounted for and correctly configured. Following the validation, the deployment data is saved to the system's database. Successful execution results in a response indicating the deployment has been initiated, along with details of the deployment record.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/changeDeploymentConfigRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/changeDeploymentConfigRest.js new file mode 100644 index 0000000000..2058dd0abe --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/changeDeploymentConfigRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/changeDeploymentConfigRest'); +const { + schema: xRequest, +} = require('./schemas/request/changeDeploymentConfigRest'); + +const openapi = { + summary: 'Updates deployment configuration for a specific project', + description: `This endpoint updates the deployment configuration for a given project within the system. It allows for modifications of settings and parameters that determine how deployments are handled for that project. + +**Authentication:** Users must be authenticated to modify deployment configurations. Authentication ensures that requests are made by legitimate users of the application. + +**Permissions:** Users need specific permissions related to deployment management. Typically, this includes administrative rights or specific role-based permissions that allow a user to modify deployment settings. + +The endpoint processes the incoming request by first validating the user's credentials and permissions. If authentication or permission checks fail, the request is denied. Upon successful validation, the endpoint invokes the \`updateDeploymentConfig\` method from the \`deployments\` core. This method is responsible for updating the deployment configuration based on the provided parameters in the request body. It handles various checks and balances to ensure that the new configuration does not conflict with existing deployment rules and standards. Once updated, the function confirms the changes and responds back with a status indicating the successful update of the deployment configuration.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/deploymentInfoRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/deploymentInfoRest.js new file mode 100644 index 0000000000..ebe2eee56f --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/deploymentInfoRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deploymentInfoRest'); +const { schema: xRequest } = require('./schemas/request/deploymentInfoRest'); + +const openapi = { + summary: 'Fetches detailed information about a specific deployment', + description: `This endpoint retrieves detailed information about a deployment specified by the user. The information includes all relevant details such as configuration, version, status, etc., focusing on providing a comprehensive view of the deployment's current state. + +**Authentication:** This endpoint requires users to be authenticated. Users attempting to access deployment details without a valid authentication token will be denied. + +**Permissions:** Users need to have the 'view_deployment' permission to access this endpoint. This ensures that only authorized personnel can view sensitive deployment information. + +The handler initiates by calling the \`getDeploymentInfo\` method from the deployment manager's core module. This method takes a deployment identifier from the request parameters and performs a query against the deployment database to retrieve all corresponding details. The process involves checking the user's permissions and the validity of the provided deployment ID. Once the data is fetched and verified, it culminates in the formation of a JSON object that includes the complete set of deployment details, which is then returned to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/existDeploymentWithDomainRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/existDeploymentWithDomainRest.js new file mode 100644 index 0000000000..a363605902 --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/existDeploymentWithDomainRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/existDeploymentWithDomainRest'); +const { + schema: xRequest, +} = require('./schemas/request/existDeploymentWithDomainRest'); + +const openapi = { + summary: 'Checks if a deployment domain is already in use', + description: `This endpoint checks whether a specified domain is already in use for another deployment within the system. The purpose is to ensure that no two deployments share the same domain, thereby avoiding conflicts and maintaining domain uniqueness across the platform. + +**Authentication:** Users must be authenticated to perform this domain check. Any access attempt without proper authentication will be denied, ensuring that the endpoint's operation is secure. + +**Permissions:** Users need to have the 'deployments.manage' permission to check domain usage. This requirement helps ensure that only authorized personnel can perform actions that could potentially affect deployment configurations. + +Upon receiving a request, this endpoint invokes the \`isDomainInUse\` function from the \`Deployments\` core. This function receives the domain name as a parameter and checks against existing deployment records in the database to determine if the domain is already assigned. If the domain is in use, the function returns a boolean \`true\`, otherwise, it returns \`false\`. This result is then sent back to the client in a simple JSON format indicating the domain usage status. This streamlined check helps maintain operational integrity by preventing domain conflicts in subsequent deployment processes.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/getConfigRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/getConfigRest.js new file mode 100644 index 0000000000..eebc380b1c --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/getConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getConfigRest'); +const { schema: xRequest } = require('./schemas/request/getConfigRest'); + +const openapi = { + summary: 'Fetch deployment configuration details', + description: `This endpoint retrieves the configuration details associated with a specific deployment. This encompasses fetching relevant configuration items such as environment settings, deployment scripts, and associated metadata that define how a deployment should be conducted within the system. + +**Authentication:** Users are required to be authenticated to ensure secure access to deployment configuration details. Authentication mechanisms must validate the user’s identity before allowing access to this endpoint. + +**Permissions:** Appropriate permissions must be verified before a user can retrieve deployment configuration details. Typically, users need to have 'deployment-manager' or 'administrator' roles to access this configuration information. + +Behind the scenes, this endpoint invokes the \`getDeploymentConfig\` action within the deployment-manager service. It initiates a process to load and return detailed configuration parameters specific to a given deployment. This involves parsing configuration files or accessing a database where these details are stored, ensuring that all returned data respects current operational and security policies. The final response includes a structured JSON object that encapsulates all necessary deployment settings.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/getDeploymentTypeRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/getDeploymentTypeRest.js new file mode 100644 index 0000000000..7673ea3c33 --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/getDeploymentTypeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getDeploymentTypeRest'); +const { schema: xRequest } = require('./schemas/request/getDeploymentTypeRest'); + +const openapi = { + summary: 'Manage deployment type details', + description: `This endpoint is responsible for handling the management of deployment type details within the deployment manager. It allows operations such as fetching, updating, or deleting deployment type information depending on the provided method and parameters. + +**Authentication:** User authentication is required to access this endpoint. Requests without valid authentication will be denied, ensuring that only authorized users can manage deployment types. + +**Permissions:** Users need to have specific permissions related to deployment management. Without the necessary permissions, the request will not be processed, and an access denial message will be returned. + +The handler begins by determining the method of the request (GET, POST, PATCH, DELETE) to appropriately handle the operation regarding deployment types. It then calls a specific internal service method based on the request method, such as \`findDeploymentType\`, \`updateDeploymentType\`, or \`deleteDeploymentType\`. These service methods interact with the database to perform the required operation and return the result to the handler. The final response to the client includes the outcome of the operation, which could be the details of a deployment type, confirmation of an update, or a status of deletion, formatted as a JSON response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/infoRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/infoRest.js new file mode 100644 index 0000000000..40840b09bb --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/infoRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/infoRest'); +const { schema: xRequest } = require('./schemas/request/infoRest'); + +const openapi = { + summary: 'Provide detailed deployment information', + description: `This endpoint fetches and provides detailed information regarding deployment processes managed by the Deployment Manager. This information helps users track the deployment state, access configuration details, and understand the overall progress and status of their deployment tasks. + +**Authentication:** User authentication is required to access deployment details. Access is denied if authentication credentials are invalid or absent. + +**Permissions:** To access this endpoint, users need specific permissions related to viewing deployment statuses. The exact permissions required are defined in the deployment manager's security configurations. + +Initially, the endpoint triggers the \`fetchDeploymentDetails\` method, which involves querying the database for detailed records pertaining to ongoing or completed deployments. This method processes the query result to format and structure the data accurately, ensuring it includes all necessary information about each deployment phase. This formatted data is then returned to the user via a well-defined JSON response structure, enabling the client's application to display or utilize the detailed deployment information effectively.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/reloadAllDeploymentsRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/reloadAllDeploymentsRest.js new file mode 100644 index 0000000000..91e2e64546 --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/reloadAllDeploymentsRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/reloadAllDeploymentsRest'); +const { + schema: xRequest, +} = require('./schemas/request/reloadAllDeploymentsRest'); + +const openapi = { + summary: 'Reload all deployment configurations', + description: `This endpoint reloads all the deployment configurations from the storage, ensuring that any updates or changes in the deployment settings are immediately reflected across the system. This is crucial for maintaining consistency and up-to-date operation parameters in dynamic environments. + +**Authentication:** Access to this endpoint requires the user to be authenticated. Without valid authentication, the system will deny access to this service. + +**Permissions:** Users must have administrative permissions specifically for deployment management. Access without sufficient permissions will result in a denial of service error. + +The handler initiates by fetching all deployment configurations using the \`getAllDeployments\` method. This method interacts with the underlying database or file system to retrieve updated configurations. Upon successful retrieval, the system iterates through each deployment configuration to apply necessary updates or reinitializations as needed. This comprehensive refresh ensures that any subsystem or service relying on these configurations is synchronized with the latest deployment settings. The response concludes with a confirmation message indicating successful reload or an error message detailing any issues encountered during the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/addManualDeploymentRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/addManualDeploymentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/addManualDeploymentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/changeDeploymentConfigRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/changeDeploymentConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/changeDeploymentConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/deploymentInfoRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/deploymentInfoRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/deploymentInfoRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/existDeploymentWithDomainRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/existDeploymentWithDomainRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/existDeploymentWithDomainRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/getConfigRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/getConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/getConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/getDeploymentTypeRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/getDeploymentTypeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/getDeploymentTypeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/infoRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/infoRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/infoRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/reloadAllDeploymentsRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/reloadAllDeploymentsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/request/reloadAllDeploymentsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/addManualDeploymentRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/addManualDeploymentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/addManualDeploymentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/changeDeploymentConfigRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/changeDeploymentConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/changeDeploymentConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/deploymentInfoRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/deploymentInfoRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/deploymentInfoRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/existDeploymentWithDomainRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/existDeploymentWithDomainRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/existDeploymentWithDomainRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/getConfigRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/getConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/getConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/getDeploymentTypeRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/getDeploymentTypeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/getDeploymentTypeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/infoRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/infoRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/infoRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/reloadAllDeploymentsRest.js b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/reloadAllDeploymentsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-deployment-manager/backend/services/rest/openapi/deployment-manager/schemas/response/reloadAllDeploymentsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/config.rest.js b/plugins/leemons-plugin-emails/backend/services/rest/config.rest.js index 321877b9bd..2aeba68222 100644 --- a/plugins/leemons-plugin-emails/backend/services/rest/config.rest.js +++ b/plugins/leemons-plugin-emails/backend/services/rest/config.rest.js @@ -2,14 +2,17 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const configService = require('../../core/config'); +const getConfigRest = require('./openapi/config/getConfigRest'); +const saveConfigRest = require('./openapi/config/saveConfigRest'); +/** @type {ServiceSchema} */ module.exports = { getConfigRest: { + openapi: getConfigRest.openapi, rest: { method: 'GET', path: '/', @@ -24,6 +27,7 @@ module.exports = { }, }, saveConfigRest: { + openapi: saveConfigRest.openapi, rest: { method: 'POST', path: '/', diff --git a/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js b/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js index 4dcc20f49b..181795e5c7 100644 --- a/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js +++ b/plugins/leemons-plugin-emails/backend/services/rest/email.rest.js @@ -2,7 +2,6 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsMiddlewareAuthenticated, @@ -34,8 +33,15 @@ const validateRemoveProviderConfigObj = { additionalProperties: false, }; +const providersRest = require('./openapi/email/providersRest'); +const sendTestRest = require('./openapi/email/sendTestRest'); +const sendCustomTestRest = require('./openapi/email/sendCustomTestRest'); +const saveProviderRest = require('./openapi/email/saveProviderRest'); +const removeProviderRest = require('./openapi/email/removeProviderRest'); +/** @type {ServiceSchema} */ module.exports = { providersRest: { + openapi: providersRest.openapi, rest: { method: 'GET', path: '/', @@ -56,6 +62,7 @@ module.exports = { }, }, sendTestRest: { + openapi: sendTestRest.openapi, rest: { method: 'POST', path: '/send-test', @@ -75,6 +82,7 @@ module.exports = { }, }, sendCustomTestRest: { + openapi: sendCustomTestRest.openapi, rest: { method: 'POST', path: '/send-custom-test', @@ -104,6 +112,7 @@ module.exports = { }, }, saveProviderRest: { + openapi: saveProviderRest.openapi, rest: { method: 'POST', path: '/save-provider', @@ -121,13 +130,17 @@ module.exports = { async handler(ctx) { const validator = new LeemonsValidator(validateProviderConfigObj); if (validator.validate(ctx.params)) { - const provider = await emailService.saveProvider({ ...ctx.params, ctx }); + const provider = await emailService.saveProvider({ + ...ctx.params, + ctx, + }); return { status: 200, provider }; } throw validator.error; }, }, removeProviderRest: { + openapi: removeProviderRest.openapi, rest: { method: 'POST', path: '/remove-provider', diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/getConfigRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/getConfigRest.js new file mode 100644 index 0000000000..e41993eb3d --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/getConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getConfigRest'); +const { schema: xRequest } = require('./schemas/request/getConfigRest'); + +const openapi = { + summary: 'Configure email settings', + description: `This endpoint allows the modification and retrieval of email-related settings within the plugin. It manages configurations such as SMTP details, default sender address, and email templates preferences, ensuring they are correctly stored and accessible for the email system to function efficiently. + +**Authentication:** Users need to be authenticated in order to update or access the email configuration settings. Authentication ensures that only authorized personnel can modify these important settings. + +**Permissions:** Appropriate permissions are required to either view or update the email settings. The user must have administrative rights or explicit permissions related to email configuration management. + +Upon receiving a request, the handler first verifies the user's authentication and authorization. If validation passes, it proceeds to invoke methods from the \`EmailsSettingService\`. Depending on the action type—\`get\` or \`set\`—it may call \`getConfig\` to retrieve settings or \`saveConfig\` to update them. The involved methods interact with the underlying database or configuration files to fetch or store the email settings respectively. The output is then formatted into a JSON response that reflects the new or existing configuration state.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/saveConfigRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/saveConfigRest.js new file mode 100644 index 0000000000..6605006cd3 --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/saveConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveConfigRest'); +const { schema: xRequest } = require('./schemas/request/saveConfigRest'); + +const openapi = { + summary: 'Saves updated configuration settings for the email plugin', + description: `This endpoint allows for the saving of updated configuration settings specific to the email functionalities within the platform. It handles requests to update various email-related configurations which might include server details, auth tokens, and preferences among others. + +**Authentication:** The user must be authenticated to modify email configuration settings. This endpoint ensures that only authenticated requests are processed for security purposes. + +**Permissions:** Users require administrative privileges to update email configurations. The system checks for 'manage_emails_config' permission or equivalent administrative rights before proceeding with the update. + +Upon receiving a request, the \`saveConfigRest\` handler first validates the authentication and permissions of the user using middleware functions. If validation is successful, it proceeds to call the \`saveConfig\` method from the \`Config\` core. This method is responsible for updating the configuration records in the database with the provided new settings. Detailed validation of the input data is performed to ensure compliance with expected formats and values. After the update operation, the method responds with either a success message or an error detailing why the operation failed, encapsulating this in a standard JSON response format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/schemas/request/getConfigRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/schemas/request/getConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/schemas/request/getConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/schemas/request/saveConfigRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/schemas/request/saveConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/schemas/request/saveConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/schemas/response/getConfigRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/schemas/response/getConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/schemas/response/getConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/schemas/response/saveConfigRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/schemas/response/saveConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/config/schemas/response/saveConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/providersRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/providersRest.js new file mode 100644 index 0000000000..c418ece9a0 --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/providersRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/providersRest'); +const { schema: xRequest } = require('./schemas/request/providersRest'); + +const openapi = { + summary: 'Manage email configurations and send emails', + description: `This endpoint is responsible for handling email-related operations, including configuring email settings and dispatching emails to specified recipients. The operations may vary from setting up email preferences to actual delivery of messages depending on the actions triggered. + +**Authentication:** Users need to be authenticated to interact with the email services. The system ensures that only logged-in users can configure settings or send emails, protecting against unauthorized access. + +**Permissions:** This endpoint requires the user to have ‘email_management’ permission to configure settings and ‘send_email’ permission to dispatch emails. The permissions ensure that only users with adequate rights can perform these sensitive operations. + +The flow begins when the email service receives a configuration or send request. It invokes the appropriate method in the ‘EmailService’ core, which might involve reading from or writing to the email configuration database, or calling an external email service API for dispatching emails. Throughout this process, various checks are performed to ensure that the user has the necessary authentication and permissions. Errors are handled gracefully, and success or failure responses are duly returned in a comprehensible format, keeping the client-side apprised of the operation status.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/removeProviderRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/removeProviderRest.js new file mode 100644 index 0000000000..82691e2bde --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/removeProviderRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeProviderRest'); +const { schema: xRequest } = require('./schemas/request/removeProviderRest'); + +const openapi = { + summary: 'Remove an email provider configuration', + description: `This endpoint handles the deletion of a specific email provider's configuration from the system. The removal process is handled securely and ensures that all related data is also cleaned up properly. + +**Authentication:** Users need to be authenticated to perform this operation. A valid session token must be provided as part of the request headers to authorize the deletion operation. + +**Permissions:** Administrative permissions are required to access this endpoint. Users must have the 'email.admin' role assigned to successfully execute this action. + +Upon receiving the request, the handler first verifies that the provided session token corresponds to a user with the necessary administrative permissions. It then invokes the \`removeProvider\` method from the \`EmailService\`. This method locates the specific email provider configuration based on an identifier provided in the request and proceeds with its deletion from the database. Throughout this process, appropriate error handling mechanisms are in place to manage issues like non-existent identifiers or database errors, ensuring the response accurately reflects the outcome of the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/saveProviderRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/saveProviderRest.js new file mode 100644 index 0000000000..f56a2aa8e3 --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/saveProviderRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveProviderRest'); +const { schema: xRequest } = require('./schemas/request/saveProviderRest'); + +const openapi = { + summary: 'Saves a new email service provider configuration', + description: `This endpoint allows the addition of a new email service provider configuration into the system. It handles the setup of email service credentials, server details, and other necessary configurations required to send emails through the specified provider. + +**Authentication:** Users must be authenticated to access this endpoint. Authentication ensures that only authorized users can add or modify email service provider configurations. + +**Permissions:** Users need to have 'admin' privileges to configure email service providers. This ensures that only users with sufficient permissions can make changes that affect email communications. + +The endpoint workflow begins with the validation of the provided input parameters to ensure they meet the system's requirements for an email service provider configuration. It then proceeds to call the \`addProvider\` method from the \`EmailService\` core, which is responsible for incorporating the new provider settings into the database. This process involves storing sensitive information such as API keys and SMTP server details securely. Upon successful addition, the service returns a confirmation of the new configuration's save operation, and relevant details are logged for audit purposes.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/providersRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/providersRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/providersRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/removeProviderRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/removeProviderRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/removeProviderRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/saveProviderRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/saveProviderRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/saveProviderRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/sendCustomTestRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/sendCustomTestRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/sendCustomTestRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/sendTestRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/sendTestRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/request/sendTestRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/providersRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/providersRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/providersRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/removeProviderRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/removeProviderRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/removeProviderRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/saveProviderRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/saveProviderRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/saveProviderRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/sendCustomTestRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/sendCustomTestRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/sendCustomTestRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/sendTestRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/sendTestRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/schemas/response/sendTestRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/sendCustomTestRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/sendCustomTestRest.js new file mode 100644 index 0000000000..8bd2a445f3 --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/sendCustomTestRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/sendCustomTestRest'); +const { schema: xRequest } = require('./schemas/request/sendCustomTestRest'); + +const openapi = { + summary: 'Send customized test email to specified recipient', + description: `This endpoint allows sending a customized test email based on predefined templates and user-input variables. The primary use is for testing and validating email setup within the application configuration. + +**Authentication:** User authentication is mandatory to ensure secure access to email sending capabilities. Only authenticated users can invoke this functionality. + +**Permissions:** The user needs to have 'email_send_test' permissions to execute this action, ensuring that only privileged users can perform testing of the email system. + +Upon receiving the request, the \`sendCustomTestRest\` handler extracts necessary details such as recipient address, email template, and variable data from the request payload. It uses the \`sendEmail\` method from the \`EmailService\`, taking care to replace placeholders in the template with actual values provided in the variables payload. The entire process is managed asynchronously to handle potential high load and to provide faster system response. The outcome of the email sending operation—either successful sending or an error message—is then prepared as a JSON response to the original HTTP request.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/sendTestRest.js b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/sendTestRest.js new file mode 100644 index 0000000000..02320d7263 --- /dev/null +++ b/plugins/leemons-plugin-emails/backend/services/rest/openapi/email/sendTestRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/sendTestRest'); +const { schema: xRequest } = require('./schemas/request/sendTestRest'); + +const openapi = { + summary: 'Send a test email to verify SMTP settings', + description: `This endpoint allows administrators to send a test email to verify the configuration and functionality of the SMTP settings in the system. This is critical for ensuring that the email communication services are operational and emails can be reliably sent from the platform. + +**Authentication:** User authentication is required to access this endpoint. Users must provide valid credentials to initiate the email sending process. + +**Permissions:** This endpoint requires administrator privileges. A user must have the 'admin' role or specific email management permissions in order to execute this test. + +The \`sendTestEmail\` method is invoked when a request reaches this endpoint. It utilizes configured SMTP settings to send an email to a predefined recipient address. The method initiates a connection to the SMTP server, constructs the email based on parameters (like sender, recipient, subject, and body) provided in the request or predefined defaults, and sends the email. If the email is successfully sent, the server returns a success message; otherwise, it handles errors by capturing them and providing appropriate feedback to the user. This complete process ensures that any issues with email delivery can be identified and corrected promptly.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/emergencyPhones.rest.js b/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/emergencyPhones.rest.js index d04d18de7a..539a2ec7ff 100644 --- a/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/emergencyPhones.rest.js +++ b/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/emergencyPhones.rest.js @@ -9,9 +9,11 @@ const { LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); +const getDatasetFormRest = require('./openapi/emergencyPhones/getDatasetFormRest'); /** @type {ServiceSchema} */ module.exports = { getDatasetFormRest: { + openapi: getDatasetFormRest.openapi, rest: { method: 'GET', path: '/dataset-form', @@ -35,7 +37,11 @@ module.exports = { locale: ctx.meta.userSession.locale, } ); - return { status: 200, jsonSchema: compileJsonSchema, jsonUI: compileJsonUI }; + return { + status: 200, + jsonSchema: compileJsonSchema, + jsonUI: compileJsonUI, + }; }, }, }; diff --git a/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/openapi/emergencyPhones/getDatasetFormRest.js b/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/openapi/emergencyPhones/getDatasetFormRest.js new file mode 100644 index 0000000000..1c218df61e --- /dev/null +++ b/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/openapi/emergencyPhones/getDatasetFormRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getDatasetFormRest'); +const { schema: xRequest } = require('./schemas/request/getDatasetFormRest'); + +const openapi = { + summary: 'Fetch emergency contact numbers for families', + description: `This endpoint provides a concise list of emergency phone numbers tailored for family use. It ensures that users can quickly access critical contact information in case of an emergency without navigating through multiple pages or systems. + +**Authentication:** User must be authenticated to retrieve emergency contact numbers. Access to this endpoint is denied if the user does not provide a valid authentication token. + +**Permissions:** This endpoint requires users to have the 'view_emergency_numbers' permission to access the list of emergency numbers. Users without this permission will receive an authorization error message. + +Upon receiving a request, the endpoint initially checks for user authentication and appropriate permissions. Once validated, it calls the \`getFamilyEmergencyContacts\` method from the \`EmergencyService\`. This method retrieves all relevant emergency contact numbers stored in the system database that are marked as important for families. The retrieved data is then formatted into a JSON response and sent back to the user, providing a streamlined and accessible list of emergency contacts for immediate reference.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/openapi/emergencyPhones/schemas/request/getDatasetFormRest.js b/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/openapi/emergencyPhones/schemas/request/getDatasetFormRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/openapi/emergencyPhones/schemas/request/getDatasetFormRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/openapi/emergencyPhones/schemas/response/getDatasetFormRest.js b/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/openapi/emergencyPhones/schemas/response/getDatasetFormRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families-emergency-numbers/backend/services/rest/openapi/emergencyPhones/schemas/response/getDatasetFormRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/families.rest.js b/plugins/leemons-plugin-families/backend/services/rest/families.rest.js index acd0e9dd87..b0759bd1a3 100644 --- a/plugins/leemons-plugin-families/backend/services/rest/families.rest.js +++ b/plugins/leemons-plugin-families/backend/services/rest/families.rest.js @@ -10,7 +10,14 @@ const { } = require('@leemons/middlewares'); const { LeemonsValidator } = require('@leemons/validator'); const { searchUsers } = require('../../core/users'); -const { add, update, detail, remove, list, listDetailPage } = require('../../core/families'); +const { + add, + update, + detail, + remove, + list, + listDetailPage, +} = require('../../core/families'); const memberValidation = { type: 'array', @@ -54,9 +61,18 @@ const addUpdateFamilySchema = { }, }; +const searchUsersRest = require('./openapi/families/searchUsersRest'); +const getDatasetFormRest = require('./openapi/families/getDatasetFormRest'); +const addRest = require('./openapi/families/addRest'); +const updateRest = require('./openapi/families/updateRest'); +const detailRest = require('./openapi/families/detailRest'); +const removeRest = require('./openapi/families/removeRest'); +const listRest = require('./openapi/families/listRest'); +const listDetailPageRest = require('./openapi/families/listDetailPageRest'); /** @type {ServiceSchema} */ module.exports = { searchUsersRest: { + openapi: searchUsersRest.openapi, rest: { method: 'POST', path: '/search-users', @@ -92,6 +108,7 @@ module.exports = { }, }, getDatasetFormRest: { + openapi: getDatasetFormRest.openapi, rest: { method: 'GET', path: '/dataset-form', @@ -115,10 +132,15 @@ module.exports = { locale: ctx.meta.userSession.locale, } ); - return { status: 200, jsonSchema: compileJsonSchema, jsonUI: compileJsonUI }; + return { + status: 200, + jsonSchema: compileJsonSchema, + jsonUI: compileJsonUI, + }; }, }, addRest: { + openapi: addRest.openapi, rest: { method: 'POST', path: '/add', @@ -148,6 +170,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { method: 'POST', path: '/update', @@ -171,6 +194,7 @@ module.exports = { }, }, detailRest: { + openapi: detailRest.openapi, rest: { method: 'GET', path: '/detail/:id', @@ -193,6 +217,7 @@ module.exports = { }, }, removeRest: { + openapi: removeRest.openapi, rest: { method: 'DELETE', path: '/remove/:id', @@ -224,6 +249,7 @@ module.exports = { }, }, listRest: { + openapi: listRest.openapi, rest: { method: 'POST', path: '/list', @@ -257,6 +283,7 @@ module.exports = { }, }, listDetailPageRest: { + openapi: listDetailPageRest.openapi, rest: { method: 'GET', path: '/list/detail/page/:user', diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/addRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/addRest.js new file mode 100644 index 0000000000..09f083177d --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/addRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addRest'); +const { schema: xRequest } = require('./schemas/request/addRest'); + +const openapi = { + summary: 'Add a new family record to the system', + description: `This endpoint is responsible for adding a new family record into the database. It typically involves receiving data pertaining to the family which may include unique identifiers, names, and related information used to create a new entry in the families table. + +**Authentication:** Users need to be authenticated to create a new family. The endpoint requires a valid user session token to proceed with the request. + +**Permissions:** Users need to have administrative rights or specific role-based permissions enabled to add a new family. These permissions ensure that only authorized personnel can make modifications to the family records. + +Upon receiving a request, the endpoint initially validates the provided data against predefined schemas to ensure compliance with the database structure. Following successful validation, the \`add\` method within the Families core service is called. This method involves constructing a database query to insert the new family data into the families table. After the database operation, the endpoint responds with the newly created family record or an appropriate error message if the operation fails.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/detailRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/detailRest.js new file mode 100644 index 0000000000..075fec8052 --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/detailRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/detailRest'); +const { schema: xRequest } = require('./schemas/request/detailRest'); + +const openapi = { + summary: 'Provides detailed information about a specific family entity', + description: `This endpoint is designed for retrieving detailed data regarding a specific family entity within the application. It encapsulates comprehensive information about the family including its members and associated profiles. + +**Authentication:** Authorized access is mandatory, requiring users to be authenticated in order to retrieve family details. Unauthenticated requests will be denied. + +**Permissions:** This endpoint requires the user to have explicit permissions to view family information. Observing privacy and security standards, only permitted users, such as family members or authorized administrative personnel, can access the details. + +Upon receiving a request, the \`detailRest\` handler calls the \`detail\` function from the 'families' module. The function uses the provided family ID to fetch all relevant data from the database including membership information and other relevant attributes of the family entity. It processes this data to construct a detailed view of the family, considering user permissions and authentication status to manage data visibility. The result is a structured JSON object representing the detailed family profile, which is then returned to the client as the response payload.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/getDatasetFormRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/getDatasetFormRest.js new file mode 100644 index 0000000000..a7b66807fc --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/getDatasetFormRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getDatasetFormRest'); +const { schema: xRequest } = require('./schemas/request/getDatasetFormRest'); + +const openapi = { + summary: 'Fetches dataset form associated with family structures', + description: `This endpoint is designed to fetch the dataset form configurations that are used in creating or editing family structures within the system. The form is a critical component for users to input accurate data relevant to the family constructs outlined by the application's logic. + +**Authentication:** Users must be authenticated to view or interact with the family dataset forms. Authentication ensures that the request is associated with a valid and active user session. + +**Permissions:** Access to the dataset form is governed by specific permissions that ensure only users with 'edit families' capability or similar rights can fetch the form data. This ensures that sensitive information or tools used in managing family data are strictly regulated. + +Upon receiving a request, the handler for the \`getDatasetFormRest\` method begins by validating the user's authentication and permissions. If these checks pass, it calls the \`getDatasetForm\` service from the \`familyFormService\`. This service is responsible for retrieving the form configuration details from a stored layout or predefined configuration. The method ensures that the retrieved form matches the current user's permissions and operational scope to interact with family data. Once the data is fetched and validated, it is formatted appropriately and sent back as a JSON response, encapsulating all necessary fields and configurations required for the user interface to render the family data form correctly.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/listDetailPageRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/listDetailPageRest.js new file mode 100644 index 0000000000..9258d68d27 --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/listDetailPageRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listDetailPageRest'); +const { schema: xRequest } = require('./schemas/request/listDetailPageRest'); + +const openapi = { + summary: 'Displays detailed list of family members associated with the user', + description: `This endpoint delivers a detailed list and relationships of all family members associated with the authenticated user. This list might include sensitive information such as member roles, relationship status, and personal identifiers. + +**Authentication:** Users need to be authenticated to fetch their family details. The endpoint verifies the user's credentials and session validity before proceeding. + +**Permissions:** Users must have the 'view_family_details' permission enabled in their profile. Without this permission, the endpoint restricts access and returns an unauthorized access error. + +Upon receiving the request, the endpoint first retrieves the user's identity and associated family IDs through the \`getUserFamilyIds\` method. It then uses the \`listDetailPage\` function to fetch a comprehensive list of all family members, along with pertinent details like age, relationship, and roles within the family structure. This process may involve several layers of data processing, including security checks for data sensitivity and user permissions. Finally, data is formatted appropriately and sent back to the user as a detailed, structured JSON response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/listRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/listRest.js new file mode 100644 index 0000000000..a81906514d --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'Lists all family entities accessible to the user', + description: `This endpoint provides a comprehensive list of family entities that the user can access within the application. It consolidates data from various sources and presents a unified view to simplify user interactions with family records. + +**Authentication:** User authentication is required to ensure secure access to the family data. Only authorized users can retrieve the list based on their credentials. + +**Permissions:** The user must possess the appropriate permissions to view family entities. These permissions help in enforcing data security and access rights specific to user roles within the application. + +Following authentication and permission checks, the \`listRest\` controller in the family plugin initializes by calling the \`list\` method located in \`families/index.js\`. This method further interacts with underlying service layers to fetch and organize data pertinent to the families. The retrieval process takes into consideration the user's role and permissions to filter and return only those family records that the user is authorized to view. The final output is formatted and sent back as JSON data, which includes details of each family entity accessible to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/removeRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/removeRest.js new file mode 100644 index 0000000000..106bc91440 --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/removeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeRest'); +const { schema: xRequest } = require('./schemas/request/removeRest'); + +const openapi = { + summary: 'Remove a specified family record', + description: `This endpoint removes a specific family entity from the database based on the provided family ID. It ensures that all associated data such as family members and any linked profiles are also updated or deleted appropriately to maintain database integrity. + +**Authentication:** Users need to be authenticated to perform deletion operations. The endpoint checks for a valid user session or token before proceeding with the removal process. + +**Permissions:** The user must have administrative rights or specific permissions set to delete family records. Without sufficient privileges, the request will be denied. + +The removal process initiates by first verifying the existence of the family through the \`exists\` validation method which checks for the family's presence in the database. Upon successful validation, the \`remove\` method from the \`families\` core is called with necessary parameters such as the family ID. This method handles the deletion of the family record and triggers supplementary actions like removing related dataset values through \`removeDatasetValues\` method and updating or deleting associated family members using \`removeMember\` method. Each step ensures the comprehensive cleanup of all data linked to the family entity, culminating in a structured response that confirms the removal outcome.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/addRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/addRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/addRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/detailRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/detailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/detailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/getDatasetFormRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/getDatasetFormRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/getDatasetFormRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/listDetailPageRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/listDetailPageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/listDetailPageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/listRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/removeRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/searchUsersRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/searchUsersRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/searchUsersRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/updateRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/addRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/addRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/addRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/detailRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/detailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/detailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/getDatasetFormRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/getDatasetFormRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/getDatasetFormRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/listDetailPageRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/listDetailPageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/listDetailPageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/listRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/removeRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/searchUsersRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/searchUsersRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/searchUsersRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/updateRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/searchUsersRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/searchUsersRest.js new file mode 100644 index 0000000000..8d1217858c --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/searchUsersRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/searchUsersRest'); +const { schema: xRequest } = require('./schemas/request/searchUsersRest'); + +const openapi = { + summary: 'Search for users within the family members module', + description: `This endpoint allows searching for user profiles that are part of the family members system within the Leemonade platform. It handles queries to filter and return user data based on specified criteria, facilitating the management and overview of family configurations. + +**Authentication:** Users must be authenticated to access and search for family member details. The access is granted only upon successful authentication, ensuring data privacy and security. + +**Permissions:** The user must have the 'view_users' permission within their role to perform searches on family member data. This permission check ensures that only authorized personnel can access sensitive user information. + +The process begins by invoking the 'searchUsers' method located in the 'families.rest.js', which interacts with the users' core system. The method utilizes the Moleculer query handling to fetch user data based on provided search parameters received from the client-side. After processing the query, the endpoint compiles the results into a structured format and returns this data to the requester in a JSON format, which includes details like user ID, names, and roles within family contexts.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-families/backend/services/rest/openapi/families/updateRest.js b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/updateRest.js new file mode 100644 index 0000000000..c40f71ad19 --- /dev/null +++ b/plugins/leemons-plugin-families/backend/services/rest/openapi/families/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Updates family data based on specified changes', + description: `This endpoint allows for the modification of existing family data within the system. The operation includes the ability to alter family-related details such as family name, address, and other relevant attributes that are part of the family profile. + +**Authentication:** Users need to be authenticated to update family data. The system will reject requests from unauthenticated sessions. + +**Permissions:** The user must have the 'edit_family' permission to modify family data. Without this permission, the request will be denied, ensuring that only authorized users can make changes to family information. + +The process begins by validating user authentication and checking for the necessary permissions. Upon successful validation, the \`updateFamily\` method from the \`families\` core is invoked with the updated data payload. This method handles the logic to update the family information in the database, ensuring data consistency and integrity. After the update operation, a confirmation of the update success is sent back in the response, along with the updated family details.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js b/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js index abc39bf6dc..549efc3bb7 100644 --- a/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js +++ b/plugins/leemons-plugin-feedback/backend/services/rest/feedback.rest.js @@ -26,9 +26,20 @@ const { getFeedbackResultsWithTime, } = require('../../core/feedback-responses'); +const saveFeedbackRest = require('./openapi/feedback/saveFeedbackRest'); +const getFeedbackRest = require('./openapi/feedback/getFeedbackRest'); +const deleteFeedbackRest = require('./openapi/feedback/deleteFeedbackRest'); +const duplicateFeedbackRest = require('./openapi/feedback/duplicateFeedbackRest'); +const assignFeedbackRest = require('./openapi/feedback/assignFeedbackRest'); +const setInstanceTimestampRest = require('./openapi/feedback/setInstanceTimestampRest'); +const setQuestionResponseRest = require('./openapi/feedback/setQuestionResponseRest'); +const getUserAssignableResponsesRest = require('./openapi/feedback/getUserAssignableResponsesRest'); +const getFeedbackResultsRest = require('./openapi/feedback/getFeedbackResultsRest'); +const getFeedbackResultsWithTimeRest = require('./openapi/feedback/getFeedbackResultsWithTimeRest'); /** @type {ServiceSchema} */ module.exports = { saveFeedbackRest: { + openapi: saveFeedbackRest.openapi, rest: { method: 'POST', path: '/', @@ -52,6 +63,7 @@ module.exports = { }, }, getFeedbackRest: { + openapi: getFeedbackRest.openapi, rest: { method: 'GET', path: '/:id', @@ -66,6 +78,7 @@ module.exports = { }, }, deleteFeedbackRest: { + openapi: deleteFeedbackRest.openapi, rest: { method: 'DELETE', path: '/:id', @@ -89,6 +102,7 @@ module.exports = { }, }, duplicateFeedbackRest: { + openapi: duplicateFeedbackRest.openapi, rest: { method: 'POST', path: '/duplicate', @@ -112,6 +126,7 @@ module.exports = { }, }, assignFeedbackRest: { + openapi: assignFeedbackRest.openapi, rest: { method: 'POST', path: '/assign', @@ -135,6 +150,7 @@ module.exports = { }, }, setInstanceTimestampRest: { + openapi: setInstanceTimestampRest.openapi, rest: { method: 'POST', path: '/instance/timestamp', @@ -151,6 +167,7 @@ module.exports = { }, }, setQuestionResponseRest: { + openapi: setQuestionResponseRest.openapi, rest: { method: 'POST', path: '/instance/question/response', @@ -165,6 +182,7 @@ module.exports = { }, }, getUserAssignableResponsesRest: { + openapi: getUserAssignableResponsesRest.openapi, rest: { method: 'GET', path: '/instance/responses/:id', @@ -179,6 +197,7 @@ module.exports = { }, }, getFeedbackResultsRest: { + openapi: getFeedbackResultsRest.openapi, rest: { method: 'GET', path: '/results/:id', @@ -193,6 +212,7 @@ module.exports = { }, }, getFeedbackResultsWithTimeRest: { + openapi: getFeedbackResultsWithTimeRest.openapi, rest: { method: 'GET', path: '/results/time/:id', diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/assignFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/assignFeedbackRest.js new file mode 100644 index 0000000000..43b7b7e946 --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/assignFeedbackRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/assignFeedbackRest'); +const { schema: xRequest } = require('./schemas/request/assignFeedbackRest'); + +const openapi = { + summary: 'Assign feedback to a specific target', + description: `This endpoint assigns user-generated feedback to a particular item or service within the platform. The functionality encapsulates user engagement by allowing feedback submissions to be directly attached to specific targets identified within the system. + +**Authentication:** Users need to be authenticated to submit feedback. The system checks for a valid session or token before processing the request. + +**Permissions:** The user must have the 'submit_feedback' permission to perform this action. Access without sufficient permissions will result in a denial of service error. + +The process initiates with the \`assignFeedback\` method in the feedback core service. This method receives information about the feedback such as the target ID and the feedback details. It performs validation checks to ensure data integrity and compliance with established standards. Subsequently, the method interacts with the database backend to record the submitted feedback against the specified target, ensuring that all referencing and data relationships are properly maintained. The completion of the operation results in a confirmation response that the feedback has been successfully assigned, including any relevant metadata related to the assignment.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/deleteFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/deleteFeedbackRest.js new file mode 100644 index 0000000000..ecff2b3ce1 --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/deleteFeedbackRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteFeedbackRest'); +const { schema: xRequest } = require('./schemas/request/deleteFeedbackRest'); + +const openapi = { + summary: 'Deletes specific feedback based on ID', + description: `This endpoint facilitates the deletion of a user's feedback from the database. It typically involves the identification and removal of feedback based on the specified ID provided in the request. + +**Authentication:** User authentication is necessary to identify and validate the user's permission to delete feedback. The system must ensure that the stateful session or token provided is valid and active. + +**Permissions:** Appropriate permissions must be checked to ensure that the user possesses the required rights to delete feedback. This generally includes permissions like 'feedback.delete' or 'admin' role requirements. + +Upon receiving the request, the endpoint first verifies the user's authentication status and permissions. If these checks pass, it proceeds to invoke the \`deleteFeedback\` function from the 'feedback' core. This function handles the actual deletion logic, such as locating the specific feedback record by ID in the database and removing it. The successful execution of this function leads to the removal of the feedback, and the endpoint returns a confirmation message, indicating that the operation was successful. Errors during the process, like invalid IDs or insufficient permissions, cause it to return an appropriate error message along with an error status code.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/duplicateFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/duplicateFeedbackRest.js new file mode 100644 index 0000000000..8d7fe16196 --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/duplicateFeedbackRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/duplicateFeedbackRest'); +const { schema: xRequest } = require('./schemas/request/duplicateFeedbackRest'); + +const openapi = { + summary: 'Duplicate specific feedback item', + description: `This endpoint duplicates a specific feedback item based on the provided feedback ID. It is typically used in scenarios where feedback mechanisms need to replicate existing entries whilst retaining the original data integrity. + +**Authentication:** Users need to be authenticated to perform this duplication operation. Failing to provide valid authentication credentials will result in rejection of the request. + +**Permissions:** Users must have the 'duplicate_feedback' permission granted to execute this operation. The permission checks ensure that only authorized users can make duplications, adhering to the system's security protocols. + +Upon receiving a request with a valid feedback ID, the \`duplicateFeedback\` method in the feedback core is triggered. This method is responsible for first verifying that the feedback ID exists and that the user has the appropriate permissions to duplicate it. It then proceeds to create a copy of the original feedback, ensuring all linked information, such as feedback questions and responses, are correctly replicated. The process involves several transactional database operations to maintain data consistency and integrity. Finally, the endpoint responds with the new feedback ID of the duplicated item, confirming the successful operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/getFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/getFeedbackRest.js new file mode 100644 index 0000000000..d6c07b3311 --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/getFeedbackRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getFeedbackRest'); +const { schema: xRequest } = require('./schemas/request/getFeedbackRest'); + +const openapi = { + summary: 'Collect and display user-specific feedback submissions', + description: `This endpoint handles the collection and retrieval of feedback submissions specific to a user within the application. It fetches feedback based on user-specific queries, ensuring tailored content delivery that is relevant to the individual's interactions or contributions within the platform. + +**Authentication:** User authentication is required to access this endpoint. Users must be logged in to view or submit their feedback, ensuring that feedback remains personal and secure. + +**Permissions:** Specific permissions regarding who can view or submit feedback are enforced. Users need appropriate permissions to perform these actions, typically dependent on their role within the application or specific administrative rights assigned to their profile. + +Upon receiving a request, the \`getFeedbackRest\` handler initiates by validating user authentication and permissions. The handler then proceeds to invoke the \`getFeedback\` method from the 'feedback' core. This method is responsible for accessing the database and retrieving feedback entries that match the criteria specific to the authenticated user. The process involves querying the database with parameters that include user identifiers and other relevant data filters. Once the data is fetched and compiled, it is returned to the user in a structured JSON format, providing a clear and concise overview of the feedback directly related to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/getFeedbackResultsRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/getFeedbackResultsRest.js new file mode 100644 index 0000000000..8eb41ceabd --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/getFeedbackResultsRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getFeedbackResultsRest'); +const { + schema: xRequest, +} = require('./schemas/request/getFeedbackResultsRest'); + +const openapi = { + summary: 'Collect feedback results aggregated by specified criteria', + description: `This endpoint aggregates and returns feedback results based on specific criteria such as survey ID, question type, or participant demographics. The aggregation helps in analyzing the feedback comprehensively. + +**Authentication:** Users must be authenticated to request feedback results. The endpoint validates the session or token provided for authentication before proceeding with the request. + +**Permissions:** Users need to have 'read_feedback' permission to access this data. Depending on the organization's settings, additional permissions related to data sensitivity might be enforced. + +The processing begins with the retrieval of parameters specifying which feedback items need to be aggregated. It uses the \`getFeedbackResults\` function from the \`feedback-responses\` module, which fetches and computes the results based on the given criteria. This function consults several data sources, processes the data, and finally, prepares an aggregated result set. The results are then formatted into a structured response and sent back to the client as JSON. This method ensures that all data retrieval and processing are secure and efficient, adhering to the required data privacy standards.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/getFeedbackResultsWithTimeRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/getFeedbackResultsWithTimeRest.js new file mode 100644 index 0000000000..421f1b6566 --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/getFeedbackResultsWithTimeRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getFeedbackResultsWithTimeRest'); +const { + schema: xRequest, +} = require('./schemas/request/getFeedbackResultsWithTimeRest'); + +const openapi = { + summary: 'Retrieve feedback results over time', + description: `This endpoint fetches a series of feedback results, aggregated over a specified time period. The data retrieved can be used to analyze trends and patterns in feedback over time, aiding in comprehensive assessments and strategic planning. + +**Authentication:** Users must be authenticated to access this endpoint. Access attempts with invalid or missing authentication credentials will be rejected. + +**Permissions:** This endpoint requires users to have specific permissions related to feedback analysis. Users without the necessary permissions will not be able to retrieve feedback result data. + +The processing of this request begins when the \`getFeedbackResultsWithTimeRest\` action is called in the service module. Initially, the request parameters specifying the time period are parsed. Following this, the \`getFeedbackResultsWithTime\` method from the 'feedback-responses' core module is invoked with these parameters. This method is responsible for querying the database to retrieve feedback data that fits the provided timeframe, processing it, and preparing it for a response. The result is then returned as a JSON object that encapsulates the feedback data, formatted to highlight key trends and statistics over the requested period.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/getUserAssignableResponsesRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/getUserAssignableResponsesRest.js new file mode 100644 index 0000000000..eb5b1eaabc --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/getUserAssignableResponsesRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getUserAssignableResponsesRest'); +const { + schema: xRequest, +} = require('./schemas/request/getUserAssignableResponsesRest'); + +const openapi = { + summary: 'Retrieve assignable feedback responses for a user', + description: `This endpoint fetches all feedback responses that a user can assign to others based on their role and permissions within the system. It focuses on identifying which feedback mechanisms and associated responses are available for delegation by a specific user. + +**Authentication:** User authentication is required to ensure that the request is made by a valid user and to ascertain the user’s role and permissions accurately. + +**Permissions:** The user must have permissions that allow assigning feedback to others. This typically includes administrative or supervisory roles that manage user interactions and feedback within the platform. + +Upon receiving a request, the \`getUserAssignableResponsesRest\` handler initiates by calling the \`getUserAssignableResponses\` function in the \`feedback-responses\` core module. This function performs a lookup to determine the feedback items that the user can assign based on the user's credentials, roles, and specific system-defined permissions. The function consults various data sources such as user roles, active permissions, and existing feedback assignment rules to compile a list of assignable feedback responses. Finally, a response with the list of assignable feedback items formatted as a JSON object is sent back to the caller.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/saveFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/saveFeedbackRest.js new file mode 100644 index 0000000000..2c7ea02927 --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/saveFeedbackRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveFeedbackRest'); +const { schema: xRequest } = require('./schemas/request/saveFeedbackRest'); + +const openapi = { + summary: 'Saves user feedback for a specific query or service', + description: `This endpoint allows users to submit feedback related to a specific part of the platform or service. The feedback data collected can include ratings, textual feedback, or other forms of user input related to their experience with the platform. + +**Authentication:** Users need to be authenticated to submit feedback. Only authenticated user sessions can post feedback, ensuring that feedback can be associated with a specific user account. + +**Permissions:** The user must have permission to access the specific service or platform component about which they are providing feedback. The required permissions depend on the organization's or platform's specific configuration and access control settings. + +The \`saveFeedbackRest\` handler begins by validating the incoming data against predefined schemas to ensure all required fields are present and correctly formatted. Then, it invokes the \`saveFeedback\` method from the \`Feedback\` core service. This method deals with the business logic for saving the feedback into the system's database, including any necessary processing or transformation of feedback data. The process involves logging the feedback entry along with the user's details and the context of the feedback (e.g., the specific part of the service the feedback addresses). Once the feedback is successfully saved, a confirmation is sent back to the user in the form of a JSON response indicating the successful storage of their feedback.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/assignFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/assignFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/assignFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/deleteFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/deleteFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/deleteFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/duplicateFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/duplicateFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/duplicateFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/getFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/getFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/getFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/getFeedbackResultsRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/getFeedbackResultsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/getFeedbackResultsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/getFeedbackResultsWithTimeRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/getFeedbackResultsWithTimeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/getFeedbackResultsWithTimeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/getUserAssignableResponsesRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/getUserAssignableResponsesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/getUserAssignableResponsesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/saveFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/saveFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/saveFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/setInstanceTimestampRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/setInstanceTimestampRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/setInstanceTimestampRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/setQuestionResponseRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/setQuestionResponseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/request/setQuestionResponseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/assignFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/assignFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/assignFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/deleteFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/deleteFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/deleteFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/duplicateFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/duplicateFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/duplicateFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/getFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/getFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/getFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/getFeedbackResultsRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/getFeedbackResultsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/getFeedbackResultsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/getFeedbackResultsWithTimeRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/getFeedbackResultsWithTimeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/getFeedbackResultsWithTimeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/getUserAssignableResponsesRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/getUserAssignableResponsesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/getUserAssignableResponsesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/saveFeedbackRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/saveFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/saveFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/setInstanceTimestampRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/setInstanceTimestampRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/setInstanceTimestampRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/setQuestionResponseRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/setQuestionResponseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/schemas/response/setQuestionResponseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/setInstanceTimestampRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/setInstanceTimestampRest.js new file mode 100644 index 0000000000..b250675e5c --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/setInstanceTimestampRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/setInstanceTimestampRest'); +const { + schema: xRequest, +} = require('./schemas/request/setInstanceTimestampRest'); + +const openapi = { + summary: 'Sets the timestamp for a specific feedback instance', + description: `This endpoint is responsible for updating the timestamp marking when certain feedback has been reviewed or modified within the system. It essentially marks a feedback entry with the current date and time to track its processing status. + +**Authentication:** Users need to be authenticated to perform this action. They must provide valid session credentials to authenticate their identity and grant them access to this endpoint. + +**Permissions:** The user must have the 'manage_feedback' permission to update timestamps on feedback entities. This ensures that only authorized personnel can make changes to feedback timing, maintaining the integrity and security of the data. + +The flow begins with the \`setInstanceTimestamp\` method within the \`feedback\` core module. This method accepts certain parameters, such as the instance ID of the feedback, and updates the \`timestamp\` field of the specified feedback instance in the database. This action is performed after validating that the user has the necessary permissions and is authenticated. The response to this operation is typically a confirmation of the update, including the new timestamp value.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/setQuestionResponseRest.js b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/setQuestionResponseRest.js new file mode 100644 index 0000000000..f0ea8a9b3d --- /dev/null +++ b/plugins/leemons-plugin-feedback/backend/services/rest/openapi/feedback/setQuestionResponseRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/setQuestionResponseRest'); +const { + schema: xRequest, +} = require('./schemas/request/setQuestionResponseRest'); + +const openapi = { + summary: "Records a user's response to feedback-related questions", + description: `This endpoint allows for the recording and updating of a user's responses to specific feedback questions presented within the platform. It provides a critical interaction within the user feedback loop, capturing valuable insights from users about various aspects of product or service usability, satisfaction, and overall experience. + +**Authentication:** Users need to be authenticated to submit their responses. The authentication verifies user identity and ensures that responses are correctly attributed to the user's account. + +**Permissions:** The user must have the 'feedback-response:create' permission to post new responses and 'feedback-response:edit' to update their existing responses. These permissions ensure that only authorized users can interact with feedback mechanisms accordingly. + +Upon receiving a request, the endpoint firstly checks the user's authentication status and permissions. If these checks are passed, the \`setQuestionResponse\` service method is invoked with parameters that identify the specific question and capture the user’s response. This method handles the intricate details of storing or updating the response data in the database. The process includes validation of the input data to comply with expected formats and constraints. Finally, an appropriate response is generated and sent back to the client, indicating the success or failure of the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/generateRest.js b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/generateRest.js new file mode 100644 index 0000000000..5645237425 --- /dev/null +++ b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/generateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/generateRest'); +const { schema: xRequest } = require('./schemas/request/generateRest'); + +const openapi = { + summary: 'Generate detailed report for Fundae requirements', + description: `This endpoint is responsible for generating a comprehensive report based on Fundae training activities, ensuring that the dataset conforms to specific regulatory and operational standards set by Fundae. The generated reports aim to assist in administrative, compliance, and educational analysis. + +**Authentication:** Users must be authenticated and hold valid session credentials to initiate report generation. The API requires authentication tokens that validate user identity and session legitimacy. + +**Permissions:** The endpoint demands high-level permissions, specifically administrative or managerial access. Users without sufficient permissions cannot trigger the generation process or access the resulting data. + +Upon request, the \`generateReport\` handler in \`report.rest.js\` initiates the generation process. It calls upon the \`ReportService\` from the core, which in turn utilizes \`generate.js\` to execute the data compilation and report structuring. The process involves querying multiple databases and aggregating data relevant to Fundae standards, followed by applying business logic to format and finalize the report. This is meticulously designed to ensure accuracy and compliance with Fundae's requirements. The response is a detailed JSON object representing the outcomes of the report generation, usually in a format suitable for immediate application use or further administrative processing.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/listRest.js b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/listRest.js new file mode 100644 index 0000000000..4d7daa1333 --- /dev/null +++ b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'List all reports accessible by the user', + description: `This endpoint lists all the reports generated by the system that the authenticated user has access to. The reports can vary from usage statistics to performance analytics, depending on the user's role and permissions in the system. + +**Authentication:** User authentication is required to ensure secure access to the reports. Only authenticated users can retrieve their available reports list. + +**Permissions:** The user needs to have 'view_reports' permission to access this endpoint. If the user does not have the necessary permissions, the endpoint will return an unauthorized access error. + +Upon receiving a request, the \`listReports\` handler in the \`ReportService\` first checks for user authentication and required permissions. If authentication or permissions checks fail, it returns an appropriate error response. If the checks pass, it invokes the \`listAllReports\` method from the \`Report\` core. This core method queries the database for reports accessible to the user, based on their roles and permissions, and returns a structured list of report data. This data is then formatted appropriately and sent back to the user as a JSON response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/retryRest.js b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/retryRest.js new file mode 100644 index 0000000000..69590ccd69 --- /dev/null +++ b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/retryRest.js @@ -0,0 +1,30 @@ +const { schema } = require('./schemas/response/retryRest'); +const { schema: xRequest } = require('./schemas/request/retryRest'); + +const openapi = { + summary: + 'Performs retry operations on previously failed report generation tasks', + description: `This endpoint initiates retry operations for previously failed report generation tasks. It processes the failed tasks queued in the system and attempts to regenerate the reports based on the newer parameters or fixed logic implemented after the initial failure. + +**Authentication:** User authentication is required to access this endpoint. Only authenticated users with valid session tokens can initiate retry operations for report generation. + +**Permissions:** Users need to have specific administrative permissions to execute retry tasks on report generation. These permissions ensure that only authorized personnel manage and execute retries for critical data processing tasks. + +Upon receiving the retry request, the endpoint invokes the \`retryReportGeneration\` method from the \`ReportService\`. This method scans the queued logs for any reports that failed to generate initially. It then processes these logs to determine the cause of failure and applies fixes or updates parameters as needed. Subsequently, it attempts to regenerate the reports. The entire flow from checking the queue to processing and regenerating reports is managed within a transactional block to ensure data integrity and consistency. The outcome of each retry attempt, whether successful or failure, is logged for auditing purposes and returned in the response to provide feedback on the retry operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/request/generateRest.js b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/request/generateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/request/generateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/request/listRest.js b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/request/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/request/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/request/retryRest.js b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/request/retryRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/request/retryRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/response/generateRest.js b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/response/generateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/response/generateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/response/listRest.js b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/response/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/response/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/response/retryRest.js b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/response/retryRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-fundae/backend/services/rest/openapi/report/schemas/response/retryRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-fundae/backend/services/rest/report.rest.js b/plugins/leemons-plugin-fundae/backend/services/rest/report.rest.js index e3e1a16c91..bc5e4f6adc 100644 --- a/plugins/leemons-plugin-fundae/backend/services/rest/report.rest.js +++ b/plugins/leemons-plugin-fundae/backend/services/rest/report.rest.js @@ -12,9 +12,13 @@ const { } = require('@leemons/middlewares'); const { generate, retry, listReports } = require('../../core/report'); +const generateRest = require('./openapi/report/generateRest'); +const retryRest = require('./openapi/report/retryRest'); +const listRest = require('./openapi/report/listRest'); /** @type {ServiceSchema} */ module.exports = { generateRest: { + openapi: generateRest.openapi, rest: { method: 'POST', path: '/add', @@ -40,6 +44,7 @@ module.exports = { }, }, retryRest: { + openapi: retryRest.openapi, rest: { method: 'POST', path: '/retry', @@ -63,6 +68,7 @@ module.exports = { }, }, listRest: { + openapi: listRest.openapi, rest: { method: 'POST', path: '/list', diff --git a/plugins/leemons-plugin-gateway/backend/package.json b/plugins/leemons-plugin-gateway/backend/package.json index 8abef90b56..419062a279 100644 --- a/plugins/leemons-plugin-gateway/backend/package.json +++ b/plugins/leemons-plugin-gateway/backend/package.json @@ -22,6 +22,7 @@ "dependencies": { "@leemons/deployment-manager": "0.0.71", "@leemons/mongodb": "0.0.71", + "@leemons/openapi": "0.0.40", "ioredis": "^5.3.2", "jaeger-client": "^3.19.0", "moleculer": "^0.14.26", diff --git a/plugins/leemons-plugin-gateway/backend/services/api.service.js b/plugins/leemons-plugin-gateway/backend/services/api.service.js index 77ebe80b25..2d9955c241 100644 --- a/plugins/leemons-plugin-gateway/backend/services/api.service.js +++ b/plugins/leemons-plugin-gateway/backend/services/api.service.js @@ -25,6 +25,10 @@ module.exports = { 'gateway.statusRest', 'v1.client-manager.protected.newDeployment', 'v1.client-manager.protected.isSubdomainInUse', + 'openapi.ui', + 'openapi.json', + 'openapi.generateDocs', + 'openapi.assets', ], }), ], @@ -164,6 +168,14 @@ module.exports = { // Enable/disable logging logging: true, }, + { + path: '/api/openapi', + aliases: { + 'GET /openapi.json': 'openapi.generateDocs', // swagger scheme + 'GET /ui': 'openapi.ui', // ui + 'GET /assets/:file': 'openapi.assets', // js/css files + }, + }, ], // Do not log client side errors (does not log an error response when the error.code is 400<=X<500) @@ -223,7 +235,7 @@ module.exports = { const { user } = ctx.meta; // It check the `auth` property in action schema. - if (req.$action.auth == 'required' && !user) { + if (req.$action.auth === 'required' && !user) { throw new ApiGateway.Errors.UnAuthorizedError('NO_RIGHTS'); } }, diff --git a/plugins/leemons-plugin-gateway/backend/services/openapi.service.js b/plugins/leemons-plugin-gateway/backend/services/openapi.service.js new file mode 100644 index 0000000000..0276d73d89 --- /dev/null +++ b/plugins/leemons-plugin-gateway/backend/services/openapi.service.js @@ -0,0 +1,15 @@ +const { LeemonsOpenApiMixin } = require('@leemons/openapi'); + +module.exports = { + name: 'openapi', + mixins: [LeemonsOpenApiMixin], + settings: { + openapi: { + info: { + description: '**The ultimate open source learning platform**', + title: 'Leemons', + }, + components: {}, + }, + }, +}; diff --git a/plugins/leemons-plugin-gateway/backend/services/rest/api.rest.js b/plugins/leemons-plugin-gateway/backend/services/rest/api.rest.js index a7ef0e9946..29d284e369 100644 --- a/plugins/leemons-plugin-gateway/backend/services/rest/api.rest.js +++ b/plugins/leemons-plugin-gateway/backend/services/rest/api.rest.js @@ -3,11 +3,14 @@ * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { mongoose } = require('@leemons/mongodb'); +const dropDBRest = require('./openapi/gateway/dropDBRest'); +const statusRest = require('./openapi/gateway/statusRest'); +/** @type {ServiceSchema} */ module.exports = { statusRest: { + openapi: statusRest.openapi, rest: { method: 'GET', path: '/status', @@ -18,9 +21,12 @@ module.exports = { }, // restore Database - ...(process.env.TESTING || process.env.NODE_ENV === 'test' || process.env.testing + ...(process.env.TESTING || + process.env.NODE_ENV === 'test' || + process.env.testing ? { dropDBRest: { + openapi: dropDBRest.openapi, dontCreateTransactionOnCallThisFunction: true, rest: { method: 'POST', diff --git a/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/dropDBRest.js b/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/dropDBRest.js new file mode 100644 index 0000000000..8471988544 --- /dev/null +++ b/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/dropDBRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/dropDBRest'); +const { schema: xRequest } = require('./schemas/request/dropDBRest'); + +const openapi = { + summary: "Deletes all data from the platform's database", + description: `This endpoint is responsible for purging all records stored within the platform's database. This is an irreversible action designed to be used in situations such as resetting the platform for a new installation or clearing all data during testing phases. + +**Authentication:** Due to the sensitive nature of this endpoint, a user must be authenticated with superadmin privileges to initiate the database drop. Any request lacking proper authentication will be denied to prevent unauthorized data destruction. + +**Permissions:** **Superadmin** permissions are required to execute this endpoint. This is to ensure that only users with the highest level of access rights can perform such a critical operation, as it affects all data and users on the platform. + +Upon invocation, the \`dropDBRest\` handler calls internal methods to perform a complete wipe of the database. This includes dropping tables or collections, and cleaning up any associated resources. It is typically followed by a series of checks to confirm that the database has been cleared successfully. The response to the client will reflect the result of the operation, with details on success or failure of the data deletion process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/schemas/request/dropDBRest.js b/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/schemas/request/dropDBRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/schemas/request/dropDBRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/schemas/request/statusRest.js b/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/schemas/request/statusRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/schemas/request/statusRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/schemas/response/dropDBRest.js b/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/schemas/response/dropDBRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/schemas/response/dropDBRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/schemas/response/statusRest.js b/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/schemas/response/statusRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/schemas/response/statusRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/statusRest.js b/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/statusRest.js new file mode 100644 index 0000000000..b979f91349 --- /dev/null +++ b/plugins/leemons-plugin-gateway/backend/services/rest/openapi/gateway/statusRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/statusRest'); +const { schema: xRequest } = require('./schemas/request/statusRest'); + +const openapi = { + summary: 'Check the operational status of the service', + description: `This endpoint checks and reports the current operational status of various service components. It provides a quick health check to ensure all parts of the system are functioning as expected, ideal for monitoring and preventative maintenance routines. + +**Authentication:** This endpoint does not require user authentication, enabling an unauthenticated status check. + +**Permissions:** No specific permissions are required to access this endpoint. It is available to any user or system checking the service status. + +The status check works by invoking multiple internal methods designed to test the health and responsiveness of each service component. The flow begins with gathering data on various key components such as the database connectivity, external API responsiveness, and internal service communication. Each component's status is evaluated separately, aggregated into a final comprehensive status report, and returned as a JSON object. This complete status includes whether each component is online, operational, and any issues detected, providing clear visibility into the system's current state.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js b/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js index fe8c7dd5aa..582aacd101 100644 --- a/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js +++ b/plugins/leemons-plugin-grades/backend/services/rest/dependency.rest.js @@ -11,12 +11,22 @@ const { LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); const { listGrades } = require('../../core/grades'); -const { listRules, addRule, updateRule, removeRule } = require('../../core/rules'); +const { + listRules, + addRule, + updateRule, + removeRule, +} = require('../../core/rules'); +const listDependenciesRest = require('./openapi/dependency/listDependenciesRest'); +const postDependencyRest = require('./openapi/dependency/postDependencyRest'); +const putDependencyRest = require('./openapi/dependency/putDependencyRest'); +const deleteDependencyRest = require('./openapi/dependency/deleteDependencyRest'); /** @type {ServiceSchema} */ module.exports = { // TODO Mirar si deberiamos de meter permisos a los endpoinds listDependenciesRest: { + openapi: listDependenciesRest.openapi, rest: { path: '/', method: 'GET', @@ -49,6 +59,7 @@ module.exports = { }, }, postDependencyRest: { + openapi: postDependencyRest.openapi, rest: { path: '/', method: 'POST', @@ -64,6 +75,7 @@ module.exports = { }, }, putDependencyRest: { + openapi: putDependencyRest.openapi, rest: { path: '/', method: 'PUT', @@ -79,6 +91,7 @@ module.exports = { }, }, deleteDependencyRest: { + openapi: deleteDependencyRest.openapi, rest: { path: '/:id', method: 'DELETE', diff --git a/plugins/leemons-plugin-grades/backend/services/rest/gradeScales.rest.js b/plugins/leemons-plugin-grades/backend/services/rest/gradeScales.rest.js index 0f94a107a4..5028b82c20 100644 --- a/plugins/leemons-plugin-grades/backend/services/rest/gradeScales.rest.js +++ b/plugins/leemons-plugin-grades/backend/services/rest/gradeScales.rest.js @@ -17,10 +17,15 @@ const { canRemoveGradeScale, } = require('../../core/grade-scales'); +const postGradeScaleRest = require('./openapi/gradeScales/postGradeScaleRest'); +const putGradeScaleRest = require('./openapi/gradeScales/putGradeScaleRest'); +const canRemoveGradeScaleRest = require('./openapi/gradeScales/canRemoveGradeScaleRest'); +const removeGradeScaleRest = require('./openapi/gradeScales/removeGradeScaleRest'); /** @type {ServiceSchema} */ module.exports = { // TODO Mirar si deberiamos de meter permisos a los endpoinds postGradeScaleRest: { + openapi: postGradeScaleRest.openapi, rest: { path: '/', method: 'POST', @@ -32,6 +37,7 @@ module.exports = { }, }, putGradeScaleRest: { + openapi: putGradeScaleRest.openapi, rest: { path: '/', method: 'PUT', @@ -43,6 +49,7 @@ module.exports = { }, }, canRemoveGradeScaleRest: { + openapi: canRemoveGradeScaleRest.openapi, rest: { path: '/can/:id', method: 'DELETE', @@ -54,6 +61,7 @@ module.exports = { }, }, removeGradeScaleRest: { + openapi: removeGradeScaleRest.openapi, rest: { path: '/:id', method: 'DELETE', diff --git a/plugins/leemons-plugin-grades/backend/services/rest/gradeTags.rest.js b/plugins/leemons-plugin-grades/backend/services/rest/gradeTags.rest.js index ed3e134de9..61fccc972d 100644 --- a/plugins/leemons-plugin-grades/backend/services/rest/gradeTags.rest.js +++ b/plugins/leemons-plugin-grades/backend/services/rest/gradeTags.rest.js @@ -11,12 +11,20 @@ const { LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); -const { addGradeTag, updateGradeTag, removeGradeTag } = require('../../core/grade-tags'); +const { + addGradeTag, + updateGradeTag, + removeGradeTag, +} = require('../../core/grade-tags'); +const postGradeTagRest = require('./openapi/gradeTags/postGradeTagRest'); +const putGradeTagRest = require('./openapi/gradeTags/putGradeTagRest'); +const removeGradeTagRest = require('./openapi/gradeTags/removeGradeTagRest'); /** @type {ServiceSchema} */ module.exports = { // TODO Mirar si deberiamos de meter permisos a los endpoinds postGradeTagRest: { + openapi: postGradeTagRest.openapi, rest: { path: '/', method: 'POST', @@ -28,6 +36,7 @@ module.exports = { }, }, putGradeTagRest: { + openapi: putGradeTagRest.openapi, rest: { path: '/', method: 'PUT', @@ -39,6 +48,7 @@ module.exports = { }, }, removeGradeTagRest: { + openapi: removeGradeTagRest.openapi, rest: { path: '/:id', method: 'DELETE', diff --git a/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js b/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js index 287e05671b..d4abd808b3 100644 --- a/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js +++ b/plugins/leemons-plugin-grades/backend/services/rest/grades.rest.js @@ -20,10 +20,17 @@ const { removeGrade, } = require('../../core/grades'); +const listGradesRest = require('./openapi/grades/listGradesRest'); +const postGradeRest = require('./openapi/grades/postGradeRest'); +const putGradeRest = require('./openapi/grades/putGradeRest'); +const haveGradesRest = require('./openapi/grades/haveGradesRest'); +const getGradeRest = require('./openapi/grades/getGradeRest'); +const removeGradeRest = require('./openapi/grades/removeGradeRest'); /** @type {ServiceSchema} */ module.exports = { // TODO Mirar si deberiamos de meter permisos a los endpoinds listGradesRest: { + openapi: listGradesRest.openapi, rest: { path: '/', method: 'GET', @@ -55,6 +62,7 @@ module.exports = { }, }, postGradeRest: { + openapi: postGradeRest.openapi, rest: { path: '/', method: 'POST', @@ -70,6 +78,7 @@ module.exports = { }, }, putGradeRest: { + openapi: putGradeRest.openapi, rest: { path: '/', method: 'PUT', @@ -84,6 +93,7 @@ module.exports = { }, }, haveGradesRest: { + openapi: haveGradesRest.openapi, rest: { path: '/have', method: 'GET', @@ -97,6 +107,7 @@ module.exports = { }, }, getGradeRest: { + openapi: getGradeRest.openapi, rest: { path: '/:id', method: 'GET', @@ -111,6 +122,7 @@ module.exports = { }, }, removeGradeRest: { + openapi: removeGradeRest.openapi, rest: { path: '/:id', method: 'DELETE', diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/deleteDependencyRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/deleteDependencyRest.js new file mode 100644 index 0000000000..9295b18a96 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/deleteDependencyRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteDependencyRest'); +const { schema: xRequest } = require('./schemas/request/deleteDependencyRest'); + +const openapi = { + summary: 'Removes specified dependencies and their related components', + description: `This endpoint facilitates the removal of dependencies along with their associated elements such as condition groups and conditions associated with any grading rule. Upon successful deletion, it ensures the integrity and cleanliness of the data by cascading the deletion process to related items. + +**Authentication:** Users need to be authenticated to perform this operation. Unauthorized access will be prevented, ensuring that only authenticated requests proceed to perform deletions. + +**Permissions:** Appropriate permissions are required to access this endpoint. The user must have administrative rights or specific permissions set to manipulate grade-related configurations to use this endpoint. + +The process begins by the controller handling the request to delete a specific dependency. It calls the \`removeDependency\` method, which first checks for the existence of the dependency. It then proceeds to invoke additional methods like \`removeConditionGroupsByRule\` and \`removeConditionsByRule\` from respective modules to ensure all associated data is comprehensively removed. This methodical deletion prevents any orphaned entries and maintains the consistency of the database integrity. The final response confirms the successful deletion of all entities related to the dependency.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/listDependenciesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/listDependenciesRest.js new file mode 100644 index 0000000000..fccf9b2f9d --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/listDependenciesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listDependenciesRest'); +const { schema: xRequest } = require('./schemas/request/listDependenciesRest'); + +const openapi = { + summary: 'List all grade-related dependencies', + description: `This endpoint lists all the dependencies associated with the grading system in the platform. It serves to provide a comprehensive overview of elements that impact or contribute to the construction of grades. + +**Authentication:** Users need to be authenticated to access the dependencies of the grading system. The request will be denied if the authentication credentials are not provided or are invalid. + +**Permissions:** Users must have the 'manage_grades' permission to view all the grading dependencies. Without sufficient permissions, access to this information will be restricted. + +Upon receiving a request, this endpoint calls the \`listDependencies\` method from the \`GradesService\`. This method performs a query to retrieve all dependency records related to the grades system from the database. The results are then compiled into a structured list that shows how different grading systems, conditions, and rules are interconnected. Finally, the endpoint returns this list in a structured JSON format, providing clients with clear insights into the dependencies shaping the grading processes.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/postDependencyRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/postDependencyRest.js new file mode 100644 index 0000000000..8854b5c114 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/postDependencyRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postDependencyRest'); +const { schema: xRequest } = require('./schemas/request/postDependencyRest'); + +const openapi = { + summary: 'Manage grade dependencies within a course structure', + description: `This endpoint is responsible for setting and managing the dependencies between different grades within the course structure. It ensures that certain prerequisites are set and met before a student can progress to subsequent modules or components. + +**Authentication:** User authentication is mandatory to ensure that only authorized personnel can modify grade dependencies. Access without proper authentication will prevent usage of this endpoint. + +**Permissions:** This endpoint requires the user to have administrative privileges related to grade management. Users must hold the appropriate permissions to alter grade dependencies within the course structure. + +Upon receiving a request, the \`postDependencyRest\` handler in the \`dependency.rest.js\` file first verifies user authentication and permissions, ensuring the user is authorized to perform actions related to grade dependencies. It then proceeds to parse the incoming request to extract and validate the necessary data regarding grade dependencies. This involves calling various methods and possibly interacting with other services to verify conditions and prerequisites are met. Finally, the validated data is processed to update or establish new dependencies in the data system, culminating in the response back to the user indicating the success or failure of the operations performed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/putDependencyRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/putDependencyRest.js new file mode 100644 index 0000000000..c55b5e5327 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/putDependencyRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putDependencyRest'); +const { schema: xRequest } = require('./schemas/request/putDependencyRest'); + +const openapi = { + summary: 'Update dependency relationships for a specific grading rule', + description: `This endpoint facilitates the updating of dependency relationships between different grading rules within the system. It is primarily used to adjust how various grading conditions impact one another, thereby modifying their execution sequence based on new or existing dependencies. + +**Authentication:** User authentication is mandatory for accessing this endpoint. Without proper authentication credentials, the request will be denied. + +**Permissions:** The user must possess adequate permissions related to grade management or rule adjustments. Specific permission checks are applied to ensure only authorized users can modify dependency rules. + +The \`putDependencyRest\` handler commences by verifying user authentication and permissions. Subsequently, it fetches and analyzes the input data which comprises identifiers of grading rules and their new dependencies. This operation involves retrieving existing rules from the database, removing old dependencies, and establishing the new specified dependencies, facilitated by corresponding methods in the backend logic. The process encompasses validations to prevent circular dependencies and to ensure data integrity. Upon successful update, the system confirms modifications and provides a response indicating the successful restructuring of the grading rules' dependencies.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/request/deleteDependencyRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/request/deleteDependencyRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/request/deleteDependencyRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/request/listDependenciesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/request/listDependenciesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/request/listDependenciesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/request/postDependencyRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/request/postDependencyRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/request/postDependencyRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/request/putDependencyRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/request/putDependencyRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/request/putDependencyRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/response/deleteDependencyRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/response/deleteDependencyRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/response/deleteDependencyRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/response/listDependenciesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/response/listDependenciesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/response/listDependenciesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/response/postDependencyRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/response/postDependencyRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/response/postDependencyRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/response/putDependencyRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/response/putDependencyRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/dependency/schemas/response/putDependencyRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/canRemoveGradeScaleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/canRemoveGradeScaleRest.js new file mode 100644 index 0000000000..eb50de126b --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/canRemoveGradeScaleRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/canRemoveGradeScaleRest'); +const { + schema: xRequest, +} = require('./schemas/request/canRemoveGradeScaleRest'); + +const openapi = { + summary: 'Determine if a grade scale can be safely removed', + description: `This endpoint checks if a specified grade scale can be removed from the system without disrupting any associated data. It evaluates dependencies such as conditions, tags, and grades linked to the grade scale to ensure no active references could lead to data integrity issues if the scale were deleted. + +**Authentication:** Users need to be authenticated to perform this check. Access without proper authentication will prevent the endpoint from executing. + +**Permissions:** Users must have administrative or specific grade management permissions to verify the removability of a grade scale. + +The handler begins by calling the \`canRemoveGradeScale\` method within the \`grade-scales\` core module. This method checks associated records in other tables like conditions, tags, and grades that might be using the grade scale. It consolidates this information to determine whether the scale is currently in use or if it can be freely removed. If no dependencies are found, the method returns a positive response, allowing for the safe deletion of the grade scale. This information is then formatted into a JSON response indicating whether removing the grade scale is feasible or not.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/postGradeScaleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/postGradeScaleRest.js new file mode 100644 index 0000000000..a00d24de6a --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/postGradeScaleRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postGradeScaleRest'); +const { schema: xRequest } = require('./schemas/request/postGradeScaleRest'); + +const openapi = { + summary: 'Add a new grade scale', + description: `This endpoint is responsible for adding a new grade scale to the system. It handles the creation of a scalable metric system that can be used for evaluating student performance within the platform. The function of this endpoint is to receive grade scale details and incorporate them into the system's existing educational framework. + +**Authentication:** Users must be authenticated to submit new grade scales. The system verifies the user's credentials and session tokens to ensure legitimacy before proceeding with the request. + +**Permissions:** Users need to have specific administrative rights typically reserved for educational staff or system administrators. The required permissions involve managing or altering grade scales, which is a critical aspect of the educational settings control. + +Upon receiving a request, the \`postGradeScaleRest\` handler first validates the incoming data using predefined validation schemas located in the \`forms.js\`. If validation passes, it proceeds to call the \`addGradeScale\` method from the \`grade-scales\` core module. This method takes the validated data and adds a new grade scale to the database, ensuring that all necessary attributes are duly processed and stored. The operation may involve transactional controls to guarantee data integrity before finally responding to the user with the outcome of the operation, either successful addition or error details.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/putGradeScaleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/putGradeScaleRest.js new file mode 100644 index 0000000000..5186be9455 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/putGradeScaleRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putGradeScaleRest'); +const { schema: xRequest } = require('./schemas/request/putGradeScaleRest'); + +const openapi = { + summary: 'Update an existing grade scale', + description: `This endpoint updates a specific grade scale's details based on the provided scale ID. It is designed to modify attributes like name, range, and descriptions of an existing grade item, reflecting changes across the platform where the grade scale is applied. + +**Authentication:** Users need to be authenticated to execute this update operation. Access without proper authentication will restrict the user from performing the update. + +**Permissions:** The user must have administrative rights or sufficient permissions related to grade management to update a grade scale. Lack of such permissions will prevent the grade scale modifications. + +Upon receiving the update request, the endpoint first verifies the user's authentication and authorization. It then proceeds to invoke the \`updateGradeScale\` method from the \`grade-scales\` service. This method handles the business logic to update the grade scale's details in the database, ensuring data integrity and consistency. If the update is successful, the endpoint responds with the updated grade scale details; otherwise, it handles errors by returning an appropriate error response indicating what went wrong during the update process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/removeGradeScaleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/removeGradeScaleRest.js new file mode 100644 index 0000000000..b72e139a56 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/removeGradeScaleRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeGradeScaleRest'); +const { schema: xRequest } = require('./schemas/request/removeGradeScaleRest'); + +const openapi = { + summary: 'Remove a specified grade scale', + description: `This endpoint allows for the deletion of a specific grade scale from the system, based on the provided grade scale identifier. It ensures that all related dependencies, such as conditions, tags, and actual grades associated with the grade scale, are appropriately handled before deletion to maintain data integrity. + +**Authentication:** Users must be authenticated to perform this operation. The system will deny access if the user's credentials are not verified. + +**Permissions:** Users need to have adequate permissions typically related to administrative rights on grade scale management to execute the removal of a grade scale. + +Upon receiving a request, the \`removeGradeScaleRest\` handler first invokes the \`canRemoveGradeScale\` method to check any related conditions, tags or grades that could be affected by removing the grade scale. If the necessary conditions are met, the \`removeGradeScale\` method from the \`GradeScales\` core module is triggered to delete the grade scale from the database. The process includes validating user permissions and ensuring all related entities that might be impacted are accounted for or notified about the removal. The response confirms the successful deletion or reports an error if the operation cannot be performed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/request/canRemoveGradeScaleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/request/canRemoveGradeScaleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/request/canRemoveGradeScaleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/request/postGradeScaleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/request/postGradeScaleRest.js new file mode 100644 index 0000000000..41ebecf32d --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/request/postGradeScaleRest.js @@ -0,0 +1,25 @@ +// automatic hash: 9f4177c2479b0ea17f76237b7da0a2b9806c990b07535271d96b48a16b585f05 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + description: { + type: 'string', + minLength: 1, + }, + number: { + type: 'number', + }, + order: { + type: 'number', + }, + grade: { + type: 'string', + minLength: 1, + }, + }, + required: ['description', 'number', 'order', 'grade'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/request/putGradeScaleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/request/putGradeScaleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/request/putGradeScaleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/request/removeGradeScaleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/request/removeGradeScaleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/request/removeGradeScaleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/response/canRemoveGradeScaleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/response/canRemoveGradeScaleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/response/canRemoveGradeScaleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/response/postGradeScaleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/response/postGradeScaleRest.js new file mode 100644 index 0000000000..25a89e5575 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/response/postGradeScaleRest.js @@ -0,0 +1,78 @@ +// automatic hash: 98ef5c5f87e2048b609236896cd01bf080b944a04c146b275d8f8129f6bef17f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + gradeScale: { + type: 'object', + properties: { + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + number: { + type: 'number', + }, + description: { + type: 'string', + minLength: 1, + }, + grade: { + type: 'string', + minLength: 1, + }, + order: { + type: 'number', + }, + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + 'id', + 'deploymentID', + 'number', + 'description', + 'grade', + 'order', + '_id', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + }, + required: ['status', 'gradeScale'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/response/putGradeScaleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/response/putGradeScaleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/response/putGradeScaleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/response/removeGradeScaleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/response/removeGradeScaleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeScales/schemas/response/removeGradeScaleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/postGradeTagRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/postGradeTagRest.js new file mode 100644 index 0000000000..01c3bedca9 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/postGradeTagRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postGradeTagRest'); +const { schema: xRequest } = require('./schemas/request/postGradeTagRest'); + +const openapi = { + summary: 'Add a new grade tag', + description: `This endpoint allows for the creation of a new grade tag within the system, enabling categorization or tagging of grades based on predefined criteria. + +**Authentication:** User must be authenticated to create a new grade tag. Any API call without a valid authentication token will be rejected. + +**Permissions:** Users need to have 'manage_grade_tags' permission to execute this action. Without sufficient permissions, the request will be denied. + +Upon receiving a POST request at this endpoint, the \`addGradeTag\` function within the 'grade-tags' core module is invoked. This function is responsible for processing input parameters which define the properties of the grade tag (e.g., tag name, description, associated curriculum). It performs validation to ensure all required fields are present and correctly formatted. Following successful validation, the function attempts to create a new tag in the database. If the creation is successful, a confirmation message or the newly created tag's details are sent back to the client in the response. If there is an error during the creation process (such as duplicate tag names or database issues), an appropriate error message is relayed back to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/putGradeTagRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/putGradeTagRest.js new file mode 100644 index 0000000000..84fa332395 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/putGradeTagRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putGradeTagRest'); +const { schema: xRequest } = require('./schemas/request/putGradeTagRest'); + +const openapi = { + summary: 'Update grade tag details', + description: `This endpoint updates the information for an existing grade tag based on the given identifier. It modifies existing data such as the tag name, associated color, and potentially other metadata specific to the grade system. + +**Authentication:** Users need to be authenticated to perform an update on grade tags. Without valid authentication credentials, the request will be rejected. + +**Permissions:** This function requires administrative privileges or specific permissions related to grade management. Users without adequate permissions will receive an access denied response. + +The function flow begins with the extraction of the grade tag ID and updates data from the request body. It then calls the \`updateGradeTag\` method from the \`grade-tags\` service with the extracted data. This method is responsible for validating the data against existing schemas and applying the updates to the database. Upon successful update, a confirmation is sent back to the client detailing the updated fields. In case of any errors during the update process, appropriate error messages are returned to the client, highlighting the issues encountered.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/removeGradeTagRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/removeGradeTagRest.js new file mode 100644 index 0000000000..0148d8389e --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/removeGradeTagRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeGradeTagRest'); +const { schema: xRequest } = require('./schemas/request/removeGradeTagRest'); + +const openapi = { + summary: 'Removes a specified grade tag', + description: `This endpoint allows for the deletion of a grade tag from the system, based on the provided tag identifier. The process ensures the removal is handled safely and records are adjusted accordingly to maintain data integrity. + +**Authentication:** Users need to be authenticated to perform this action. Actions performed by unauthenticated users will be rejected and they will be prompted to log in. + +**Permissions:** The user must have administrative rights or specific permissions related to grade management in order to delete a grade tag. Unauthorized access will result in a permission denial response. + +The \`removeGradeTag\` function is called within this endpoint, which initially validates the presence of the tag ID in the request. It then consults the \`GradeTags\` core to ensure the tag exists and is eligible for deletion. The core logic includes verifications to prevent the deletion if the tag is currently in use in any grade assessments or configurations, thereby preserving the integrity of related records. Once all conditions are met, the tag is removed from the records, and a success response is sent back to the user, confirming the deletion.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/request/postGradeTagRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/request/postGradeTagRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/request/postGradeTagRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/request/putGradeTagRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/request/putGradeTagRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/request/putGradeTagRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/request/removeGradeTagRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/request/removeGradeTagRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/request/removeGradeTagRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/response/postGradeTagRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/response/postGradeTagRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/response/postGradeTagRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/response/putGradeTagRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/response/putGradeTagRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/response/putGradeTagRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/response/removeGradeTagRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/response/removeGradeTagRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/gradeTags/schemas/response/removeGradeTagRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/getGradeRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/getGradeRest.js new file mode 100644 index 0000000000..8efb6cef20 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/getGradeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getGradeRest'); +const { schema: xRequest } = require('./schemas/request/getGradeRest'); + +const openapi = { + summary: 'Fetches detailed grade information for specified IDs', + description: `This endpoint is designed to retrieve comprehensive grade details based on the provided grade IDs. The retrieved information includes but is not limited to the grade score, associated tags, and grading scale details. + +**Authentication:** Access to this endpoint requires the user to be logged in. Authentication ensures that grade information is securely accessed and protects the integrity of the data. + +**Permissions:** This endpoint requires that the user has permission to view the specific grades. Typically, this means that the user must either be the instructor for the course associated with the grades, an administrator, or the student to whom the grades belong. + +The handler begins by receiving a list of grade IDs through the request parameters. It then calls the \`gradeByIds\` method in the \`grades\` core, which queries the database for the grade details corresponding to these IDs. Subsequently, it invokes the \`getGradeScalesByGrade\` and \`getGradeTagsByGrade\` from their respective modules to append additional contextual information about each grade. These operations amalgamate data from different sources to provide a thorough view of each grade's context and standing within an educational or training environment. The response then compiles and returns this data as a JSON object for the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/haveGradesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/haveGradesRest.js new file mode 100644 index 0000000000..306e5f36aa --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/haveGradesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/haveGradesRest'); +const { schema: xRequest } = require('./schemas/request/haveGradesRest'); + +const openapi = { + summary: 'Check grade availability for a user', + description: `This endpoint checks if grades are available for a specific user within the system. It determines the presence or absence of grades linked to the user’s profile, which can be useful for functions like displaying grade-related features or analytics on the user interface. + +**Authentication:** User authentication is essential for accessing this endpoint. The request must carry a valid authentication token, without which the request will be denied. + +**Permissions:** Specific permissions related to accessing or managing grades are required to consume this endpoint. Access without proper permissions will result in a denial of the request. + +Upon receiving a request, the \`haveGrades\` method in the backend core logic is invoked with pertinent user identifiers. This method interacts with the database to ascertain whether any grades are recorded against the user ID provided. The process involves querying the database and evaluating the existence of grade entries. If grades are present, the endpoint returns a positive acknowledgment, otherwise a negative one. The flow from request initiation to the response involves authenticating the user, verifying permissions, executing the query, and then formulating the appropriate response based on the query results.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/listGradesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/listGradesRest.js new file mode 100644 index 0000000000..e56545d69a --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/listGradesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listGradesRest'); +const { schema: xRequest } = require('./schemas/request/listGradesRest'); + +const openapi = { + summary: 'List all grades available in the system', + description: `This endpoint lists all grades currently available within the system. It allows the user to retrieve a comprehensive list of grade records, which include both active and archived grades. + +**Authentication:** Authentication is required to access this endpoint. Users need to provide a valid authentication token in their request headers to verify their identity. + +**Permissions:** Users need to have the 'view_grades' permission to access this endpoint. This ensures that only users with the appropriate role or permission settings can view the list of grades. + +Upon receiving a request, the \`listGradesRest\` handler calls the \`listGrades\` method from the Grades core module. This method queries the database to fetch all grade records, including details like grade name, associated tags, and scale. The response from the database is then formatted and returned as a JSON array, which includes all the pertinent details about each grade. The handler ensures that the response is structured properly and includes any necessary metadata before sending it back to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/postGradeRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/postGradeRest.js new file mode 100644 index 0000000000..e85e8ece5a --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/postGradeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postGradeRest'); +const { schema: xRequest } = require('./schemas/request/postGradeRest'); + +const openapi = { + summary: 'Add a new grade entry to the system', + description: `This endpoint allows for the creation of a new grade entry in the grading system. It is designed to receive grade details, validate them, and store them in the database accordingly. + +**Authentication:** User authentication is mandatory for accessing this endpoint. A valid user session or token is required to ensure that the request is authorized. + +**Permissions:** The user needs to have 'grade_add' permission to perform this action. Without the required permissions, the request will be rejected, and an error message will be returned. + +The process begins with the 'postGradeRest' action that first validates the incoming request data against predefined schemas to ensure that all required fields are present and correctly formatted. Upon successful validation, the action then calls the 'addGrade' method from the 'grades' core module. This method takes responsibility for integrating the new grade data into the database. During this operation, it checks for any duplicate entries or conflicting data to maintain data integrity. Once the grade is successfully added to the database, a confirmation message is sent back to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/putGradeRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/putGradeRest.js new file mode 100644 index 0000000000..21565694e8 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/putGradeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putGradeRest'); +const { schema: xRequest } = require('./schemas/request/putGradeRest'); + +const openapi = { + summary: 'Updates a specific grade based on provided details', + description: `This endpoint allows for the updating of specific grade details within the system. It updates a grade entry based on the provided identifiers and new data values. This function typically handles changes in grade values, status, or associated metadata. + +**Authentication:** Users must be authenticated to update grade information. An invalid or missing authentication token will result in denied access to this endpoint. + +**Permissions:** The endpoint requires that the user has the appropriate rights to modify grade data, generally restricted to administrative or educational staff roles who manage grade records. + +Upon receiving the request, the handler first verifies user authentication and permissions. Assuming these checks pass, it proceeds to invoke the \`updateGrade\` method from the \`grades\` core. This method accepts the unique grade ID and the new data for the grade as parameters, interacting with the database to update the relevant grade entry. The operation's success or failure is communicated back to the client through a standard HTTP response, encapsulating either the updated grade data or an error message detailing why the operation could not be completed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/removeGradeRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/removeGradeRest.js new file mode 100644 index 0000000000..defcb0ecd8 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/removeGradeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeGradeRest'); +const { schema: xRequest } = require('./schemas/request/removeGradeRest'); + +const openapi = { + summary: 'Remove a specific grade entry from the system', + description: `This endpoint is responsible for deleting a grade record by its unique identifier. The process ensures that all associated data, such as grade tags and grade scales, are also removed accordingly, ensuring data consistency across the platform. + +**Authentication:** Users must be authenticated to perform removal operations. This ensures that only authorized users can delete grade data. + +**Permissions:** The user must have the 'delete_grade' permission to execute this action. This permission check is crucial to prevent unauthorized data manipulation and maintain system security. + +Upon receiving a request to delete a grade, the endpoint first checks for the required permissions. If permissions are validated, it proceeds to invoke the \`removeGrade\` method from the \`grades\` core, which handles the deletion of the grade record from the database. Simultaneously, related data such as grade tags and scales are dealt with through respective removal methods: \`removeGradeTagsByGrade\` and \`removeGradeScaleByGrade\`. These methods ensure that all traces of the grade are completely eradicated from the database, maintaining the integrity and cleanliness of the data. The response to the client confirms the successful removal of the grade and associated data, marking the complete termination of the entry.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/getGradeRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/getGradeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/getGradeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/haveGradesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/haveGradesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/haveGradesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/listGradesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/listGradesRest.js new file mode 100644 index 0000000000..0e021d8739 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/listGradesRest.js @@ -0,0 +1,23 @@ +// automatic hash: 51a7960d20d1f09e987142cd6f308723ede62502ee81b26d05b430856cfe0ab7 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + page: { + type: 'string', + minLength: 1, + }, + size: { + type: 'string', + minLength: 1, + }, + center: { + type: 'string', + minLength: 1, + }, + }, + required: ['page', 'size', 'center'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/postGradeRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/postGradeRest.js new file mode 100644 index 0000000000..24c78e6740 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/postGradeRest.js @@ -0,0 +1,33 @@ +// automatic hash: 1de0b2bc013d0459919d7d178e51563bb177a8bc70c0546b8e91456e6980d0ef +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + center: { + type: 'string', + minLength: 1, + }, + scales: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + name: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + isPercentage: { + type: 'boolean', + }, + }, + required: ['center', 'scales', 'name', 'type', 'isPercentage'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/putGradeRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/putGradeRest.js new file mode 100644 index 0000000000..34febd0cb6 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/putGradeRest.js @@ -0,0 +1,23 @@ +// automatic hash: 80c7853d36da7596af6fc60916defa342bc522a5922768cbeedba62dea814262 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + id: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + minScaleToPromote: { + type: 'string', + minLength: 1, + }, + }, + required: ['id', 'name', 'minScaleToPromote'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/removeGradeRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/removeGradeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/request/removeGradeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/getGradeRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/getGradeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/getGradeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/haveGradesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/haveGradesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/haveGradesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/listGradesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/listGradesRest.js new file mode 100644 index 0000000000..6905d69286 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/listGradesRest.js @@ -0,0 +1,205 @@ +// automatic hash: e101fedb0754b1a1053b79b8f8afc083afb189889e02beb0036023c8bd65f7d9 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + data: { + type: 'object', + properties: { + items: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'type', + 'isPercentage', + 'center', + 'isDeleted', + '__v', + 'minScaleToPromote', + 'inUse', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + isPercentage: { + type: 'boolean', + }, + center: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + minScaleToPromote: { + type: 'string', + minLength: 1, + }, + scales: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'number', + 'description', + 'grade', + 'order', + 'isDeleted', + '__v', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + number: { + type: 'number', + }, + description: { + type: 'string', + minLength: 1, + }, + grade: { + type: 'string', + minLength: 1, + }, + order: { + type: 'number', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + }, + }, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + inUse: { + type: 'boolean', + }, + }, + }, + }, + count: { + type: 'number', + }, + totalCount: { + type: 'number', + }, + totalPages: { + type: 'number', + }, + page: { + type: 'number', + }, + size: { + type: 'number', + }, + nextPage: { + type: 'number', + }, + prevPage: { + type: 'number', + }, + canGoPrevPage: { + type: 'boolean', + }, + canGoNextPage: { + type: 'boolean', + }, + }, + required: [ + 'items', + 'count', + 'totalCount', + 'totalPages', + 'page', + 'size', + 'nextPage', + 'prevPage', + 'canGoPrevPage', + 'canGoNextPage', + ], + }, + }, + required: ['status', 'data'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/postGradeRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/postGradeRest.js new file mode 100644 index 0000000000..d60e0188a4 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/postGradeRest.js @@ -0,0 +1,95 @@ +// automatic hash: 49c04508933c176cb039dff5e7fefb42849049f419100e92d32f3298e9cee611 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + grade: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + isPercentage: { + type: 'boolean', + }, + center: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + scales: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'type', + 'isPercentage', + 'center', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'scales', + 'tags', + ], + }, + }, + required: ['status', 'grade'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/putGradeRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/putGradeRest.js new file mode 100644 index 0000000000..309bce8730 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/putGradeRest.js @@ -0,0 +1,158 @@ +// automatic hash: e42d7b3469ebf4ab5e9277ca6e017963191673766633ba18080469b41097d6ab +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + grade: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + isPercentage: { + type: 'boolean', + }, + center: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + minScaleToPromote: { + type: 'string', + minLength: 1, + }, + scales: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'number', + 'description', + 'grade', + 'order', + 'isDeleted', + '__v', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + number: { + type: 'number', + }, + description: { + type: 'string', + minLength: 1, + }, + grade: { + type: 'string', + minLength: 1, + }, + order: { + type: 'number', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + }, + }, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'type', + 'isPercentage', + 'center', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'minScaleToPromote', + 'scales', + 'tags', + ], + }, + }, + required: ['status', 'grade'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/removeGradeRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/removeGradeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/grades/schemas/response/removeGradeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/deleteRuleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/deleteRuleRest.js new file mode 100644 index 0000000000..29968824d4 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/deleteRuleRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteRuleRest'); +const { schema: xRequest } = require('./schemas/request/deleteRuleRest'); + +const openapi = { + summary: 'Delete a specific grading rule', + description: `This endpoint deletes a grading rule by its unique identifier. Once deleted, all associated condition groups and conditions tied to the rule are also removed from the system, ensuring that no orphan data remains. + +**Authentication:** The user must be authenticated to proceed with the deletion of a grading rule. Without proper authentication, the request will be rejected. + +**Permissions:** Users require administrative rights or specific permissions related to grading system management to delete grading rules. Insufficient permissions will result in access being denied. + +The delete operation begins by the \`deleteRuleRest\` method intercepting the request with a specific rule ID. The method then calls the \`removeRule\` function in the backend/core rules, which handles the main deletion logic. This function sequentially executes \`removeConditionGroupsByRule\` and \`removeConditionsByRule\` to ensure all related entries are purged effectively. Post deletion, the method finalizes by sending a success response back to the client, confirming the completion of the deletion process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/haveRulesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/haveRulesRest.js new file mode 100644 index 0000000000..99c35dab8d --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/haveRulesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/haveRulesRest'); +const { schema: xRequest } = require('./schemas/request/haveRulesRest'); + +const openapi = { + summary: 'Checks the applicability of grading rules for a specific context', + description: `This endpoint assesses the application of defined grading rules within a given educational or testing scenario. It verifies whether certain grading criteria are met and determines the applicability of rules based on the context provided in the request. + +**Authentication:** User authentication is required to ensure that only authorized personnel can check and apply grading rules. An attempt to access this endpoint without a valid authentication token will result in denial of access. + +**Permissions:** This endpoint requires the user to have permissions to manage or view grading settings within the platform. Users without sufficient permissions will not be able to execute or view the results of this rule check. + +Upon receiving a request, the endpoint first validates user authentication and permissions. If these checks pass, it then proceeds to invoke the \`haveRules\` method from the \`rules\` core. This method analyzes the context provided — such as academic level, department, or specific test details — and retrieves all applicable grading rules from the database. It evaluates these rules to determine if they are applicable to the provided scenario, using a set of predefined logic criteria. The result of this process is a decision on whether the rules can be applied, along with any necessary details explaining the reasoning. This response is then serialized into JSON format and sent back to the requester, providing clear information on rule applicability.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/listRulesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/listRulesRest.js new file mode 100644 index 0000000000..cdb6f5d733 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/listRulesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRulesRest'); +const { schema: xRequest } = require('./schemas/request/listRulesRest'); + +const openapi = { + summary: 'List all grading rules', + description: `This endpoint lists all grading rules defined in the system. It pulls data regarding different grading criteria that have been set up to evaluate learners' performance across various courses or assessments. + +**Authentication:** Users must be authenticated to access the list of grading rules. Unauthorized access attempts will be blocked at the API gateway level. + +**Permissions:** The user needs to have 'view_grading_rules' permission to query this endpoint. This ensures that only authorized personnel with the requisite permissions can view the grading configurations. + +Upon request, the handler initiates by invoking the \`listRules\` method from the Grades plugin's Rules core service. This method queries the database for all rule entries that define how grades should be calculated or awarded based on predefined conditions. Each rule might include specific conditions or criteria, which are also fetched by subsequent calls to \`getConditionsByRule\` or \`getConditionGroupsByRule\`, thus assembling a complete set of data pertaining to each rule. Finally, the fetched rules and their detailed specifications are compiled into a structured format and returned as a JSON response, ensuring the client receives comprehensive data on grading rules.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/postRuleProcessRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/postRuleProcessRest.js new file mode 100644 index 0000000000..7914d11836 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/postRuleProcessRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postRuleProcessRest'); +const { schema: xRequest } = require('./schemas/request/postRuleProcessRest'); + +const openapi = { + summary: 'Processes grading rules based on user actions', + description: `This endpoint processes specific grading rules applicable to a user based on their actions within the platform. Depending on the conditions set up for each rule, this might include calculating grades, sending notifications, or adjusting user status. + +**Authentication:** User authentication is required to ensure that the rule processing is applied to the correct user account. Actions conducted without proper authentication will not be processed. + +**Permissions:** Users need to have sufficient permissions typically related to educational or administrative roles, for this endpoint to process grading rules on their behalf. Lack of required permissions will result in denial of service for the requested action. + +Upon receiving a request, the endpoint initially validates the user’s authentication status and permissions. It then uses a series of service calls including \`processRulesForUserAgent\`, \`getRuleConditionsByRuleIds\`, \`getConditionsByRule\`, and \`getConditionGroupsByRule\` to fetch relevant rules and conditions. These functions collectively determine which rules are applicable based on the user's recent activities or input data. Once applicable rules are identified, the endpoint executes these rules, potentially updating grades, triggering notifications, or modifying user-related data based on the outcomes of the rule processes. Finally, the results of the rule processing are compiled and sent back as a response to the user in a structured format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/postRuleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/postRuleRest.js new file mode 100644 index 0000000000..d30170830b --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/postRuleRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/postRuleRest'); +const { schema: xRequest } = require('./schemas/request/postRuleRest'); + +const openapi = { + summary: 'Add a new grading rule', + description: `This endpoint allows for the addition of a new grading rule within the system. The endpoint facilitates the creation of complex grading rules which can be associated with particular grades, subjects, or other academic criteria. + +**Authentication:** User authentication is required to ensure only authorized personnel can add or modify grading rules. A valid user session is needed to proceed with this operation. + +**Permissions:** This operation requires the user to have the 'manage_grading_rules' permission assigned. Without the proper permissions, the request will be rejected. + +Upon receiving a request, the endpoint first processes the input parameters to validate the structure and data of the grading rule. It then calls the \`addRule\` function from the \`rules\` core backend service. This function handles the insertion of the new rule data into the database, ensuring all associated conditions and condition groups are correctly linked. Once the addition is successful, a response is generated and sent back to the requester, confirming the creation of the rule. If there are any issues during the process, appropriate error messages are returned, guiding the user to resolve such issues.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/putRuleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/putRuleRest.js new file mode 100644 index 0000000000..0c175a1162 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/putRuleRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/putRuleRest'); +const { schema: xRequest } = require('./schemas/request/putRuleRest'); + +const openapi = { + summary: 'Update a specified grading rule', + description: `This endpoint facilitates the update of a specific grading rule in the system. The rule details can be modified based on the provided inputs in the request, which include changes to conditions, condition groups, and other associated elements of the grading rule. + +**Authentication:** The user must be authenticated to update a grading rule. An invalid or absent authentication token will restrict access to this endpoint. + +**Permissions:** Appropriate permissions are required to update grading rules. The user must have administrative rights or specific permission flags set, such as 'update_grading_rule', to modify existing grading rules. + +Upon receiving a request, the \`updateRule\` action is called within the rules service. This action orchestrates a series of operations involving validation of input data against predefined schemas, removal of existing condition groups and conditions linked to the rule through \`removeConditionGroupsByRule\` and \`removeConditionsByRule\` respectively, and addition of new conditions and groups if provided, using the \`addCondition\` and \`addConditionGroup\` methods. Finally, the updated rule is fetched with its new configuration and conditions using \`ruleByIds\` to ensure the update was successful and the new setup is returned in the response in a consumable format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/deleteRuleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/deleteRuleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/deleteRuleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/haveRulesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/haveRulesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/haveRulesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/listRulesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/listRulesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/listRulesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/postRuleProcessRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/postRuleProcessRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/postRuleProcessRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/postRuleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/postRuleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/postRuleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/putRuleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/putRuleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/request/putRuleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/deleteRuleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/deleteRuleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/deleteRuleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/haveRulesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/haveRulesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/haveRulesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/listRulesRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/listRulesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/listRulesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/postRuleProcessRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/postRuleProcessRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/postRuleProcessRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/postRuleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/postRuleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/postRuleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/putRuleRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/putRuleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/rules/schemas/response/putRuleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/enableMenuItemRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/enableMenuItemRest.js new file mode 100644 index 0000000000..a3bce4d015 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/enableMenuItemRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/enableMenuItemRest'); +const { schema: xRequest } = require('./schemas/request/enableMenuItemRest'); + +const openapi = { + summary: 'Enables a specific menu item configuration for user roles', + description: `This endpoint enables a specific menu item within the application based on specified configurations linked to user roles. The endpoint focuses on adjusting the visibility and availability of menu items according to the roles that have access to them, enhancing the customization of the user interface per user role criteria. + +**Authentication:** Users need to be authenticated to alter the configuration of menu items. This ensures that only authorized personnel can make changes to the menu settings. + +**Permissions:** The user must have administrative or relevant configurational permissions to enable menu items. Failing to meet the permission requirements will result in a denial of access to the endpoint. + +Upon receiving a request, the 'enableMenuItemRest' handler triggers a method in the underlying settings service. This method is tasked with updating the menu configuration settings in the database. These settings dictate which roles can view or interact with specified menu items. The whole operation is transactional, thus any failure during the update reverts any partial changes. Upon successful modification, a confirmation response is sent back to the requester, indicating successful enablement of the menu item.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/findOneRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/findOneRest.js new file mode 100644 index 0000000000..9e2de427c9 --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/findOneRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/findOneRest'); +const { schema: xRequest } = require('./schemas/request/findOneRest'); + +const openapi = { + summary: 'Find specific grade setting information', + description: `This endpoint locates a single setting entity based on the ID provided in the request. The method specifically targets the grades-related settings within the leemons-plugin-grades, retrieving the details like scale, criteria, or any other configured grade parameters specific to the system's usage. + +**Authentication:** User authentication is required to ensure that only authorized users can query grade settings. The request will be denied if the authentication credentials are not valid or absent. + +**Permissions:** The user must have appropriate permissions related to grade management or settings view. Without sufficient permissions, the request to access grade settings will be declined, ensuring secure and restricted access to sensitive configuration data. + +The flow of the endpoint begins with the \`findOne.js\` core settings functionality, which is tasked with querying the backend database for the specific settings ID received through the request parameters. Using Moleculer's data access capabilities, this core function identifies and retrieves the detailed configuration associated with the provided ID. It interacts directly with the database layer, ensuring efficient retrieval of data. Once the data is fetched, it is sent back to the user through the REST endpoint as a JSON object, filling the response with the specific grade setting details.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/request/enableMenuItemRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/request/enableMenuItemRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/request/enableMenuItemRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/request/findOneRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/request/findOneRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/request/findOneRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/request/updateRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/response/enableMenuItemRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/response/enableMenuItemRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/response/enableMenuItemRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/response/findOneRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/response/findOneRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/response/findOneRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/response/updateRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/updateRest.js b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/updateRest.js new file mode 100644 index 0000000000..cb4652985d --- /dev/null +++ b/plugins/leemons-plugin-grades/backend/services/rest/openapi/settings/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Update grade settings', + description: `This endpoint updates the grade settings for a specific academic program or course within the leemons platform. It allows the modification of grading scales, assessment methods, and other relevant settings. + +**Authentication:** Users need to be authenticated to update grade settings. Access to the endpoint without proper authentication will be denied. + +**Permissions:** The user must possess 'manage_grades' permission to update grade settings. This ensures that only authorized personnel can make changes to critical educational parameters. + +Upon receiving a request, the endpoint calls the \`update\` method in the \`settings\` core module. This function retrieves the existing settings based on provided identifiers (like program or course ID), modifies them according to the passed parameters, and stores the new settings back into the database. If the update is successful, it sends a confirmation back to the user. In case of any errors during the process (e.g., missing required fields or unauthorized attempts), appropriate error messages are generated and sent back as responses.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js b/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js index fbcbf89242..1e9844a6d3 100644 --- a/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js +++ b/plugins/leemons-plugin-grades/backend/services/rest/rules.rest.js @@ -19,10 +19,17 @@ const { processRulesForUserAgent, } = require('../../core/rules'); +const listRulesRest = require('./openapi/rules/listRulesRest'); +const haveRulesRest = require('./openapi/rules/haveRulesRest'); +const postRuleRest = require('./openapi/rules/postRuleRest'); +const putRuleRest = require('./openapi/rules/putRuleRest'); +const deleteRuleRest = require('./openapi/rules/deleteRuleRest'); +const postRuleProcessRest = require('./openapi/rules/postRuleProcessRest'); /** @type {ServiceSchema} */ module.exports = { // TODO Mirar si deberiamos de meter permisos a los endpoinds listRulesRest: { + openapi: listRulesRest.openapi, rest: { path: '/', method: 'GET', @@ -56,6 +63,7 @@ module.exports = { }, }, haveRulesRest: { + openapi: haveRulesRest.openapi, rest: { path: '/have', method: 'GET', @@ -67,6 +75,7 @@ module.exports = { }, }, postRuleRest: { + openapi: postRuleRest.openapi, rest: { path: '/', method: 'POST', @@ -78,6 +87,7 @@ module.exports = { }, }, putRuleRest: { + openapi: putRuleRest.openapi, rest: { path: '/', method: 'PUT', @@ -89,6 +99,7 @@ module.exports = { }, }, deleteRuleRest: { + openapi: deleteRuleRest.openapi, rest: { path: '/:id', method: 'DELETE', @@ -100,6 +111,7 @@ module.exports = { }, }, postRuleProcessRest: { + openapi: postRuleProcessRest.openapi, rest: { path: '/process', method: 'POST', diff --git a/plugins/leemons-plugin-grades/backend/services/rest/settings.rest.js b/plugins/leemons-plugin-grades/backend/services/rest/settings.rest.js index 427b9f8d01..a64f9ccee8 100644 --- a/plugins/leemons-plugin-grades/backend/services/rest/settings.rest.js +++ b/plugins/leemons-plugin-grades/backend/services/rest/settings.rest.js @@ -11,13 +11,22 @@ const { LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); const { listGrades } = require('../../core/grades'); -const { listRules, addRule, updateRule, removeRule } = require('../../core/rules'); +const { + listRules, + addRule, + updateRule, + removeRule, +} = require('../../core/rules'); const { findOne, update } = require('../../core/settings'); +const findOneRest = require('./openapi/settings/findOneRest'); +const updateRest = require('./openapi/settings/updateRest'); +const enableMenuItemRest = require('./openapi/settings/enableMenuItemRest'); /** @type {ServiceSchema} */ module.exports = { // TODO Mirar si deberiamos de meter permisos a los endpoinds findOneRest: { + openapi: findOneRest.openapi, rest: { path: '/', method: 'GET', @@ -38,6 +47,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { path: '/', method: 'POST', @@ -77,6 +87,7 @@ module.exports = { }, }, enableMenuItemRest: { + openapi: enableMenuItemRest.openapi, rest: { path: '/enable-menu-item', method: 'POST', @@ -98,7 +109,9 @@ module.exports = { required: ['key'], }); if (validator.validate(ctx.params)) { - const config = await ctx.tx.call('deployment-manager.getConfigRest', { allConfig: true }); + const config = await ctx.tx.call('deployment-manager.getConfigRest', { + allConfig: true, + }); const disableMenuKeys = config[ctx.prefixPNV()]?.deny?.menu; let toRemove = false; if (disableMenuKeys?.indexOf(ctx.params.key) >= 0) { diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js index 9ccab84ea3..b65883a6e0 100644 --- a/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/modules.rest.js @@ -19,9 +19,16 @@ const { assignModule, } = require('../../core/modules'); +const createRest = require('./openapi/modules/createRest'); +const updateRest = require('./openapi/modules/updateRest'); +const duplicateRest = require('./openapi/modules/duplicateRest'); +const removeRest = require('./openapi/modules/removeRest'); +const publishRest = require('./openapi/modules/publishRest'); +const assignRest = require('./openapi/modules/assignRest'); /** @type {ServiceSchema} */ module.exports = { createRest: { + openapi: createRest.openapi, rest: { method: 'POST', path: '/', @@ -43,6 +50,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { method: 'PUT', path: '/:id', @@ -64,6 +72,7 @@ module.exports = { }, }, duplicateRest: { + openapi: duplicateRest.openapi, rest: { method: 'POST', path: '/:id/duplicate', @@ -89,6 +98,7 @@ module.exports = { }, }, removeRest: { + openapi: removeRest.openapi, rest: { method: 'DELETE', path: '/:id', @@ -113,6 +123,7 @@ module.exports = { }, }, publishRest: { + openapi: publishRest.openapi, rest: { method: 'POST', path: '/:id/publish', @@ -137,6 +148,7 @@ module.exports = { }, }, assignRest: { + openapi: assignRest.openapi, rest: { method: 'POST', path: '/:id/assign', diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/assignRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/assignRest.js new file mode 100644 index 0000000000..3c2fe3793f --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/assignRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/assignRest'); +const { schema: xRequest } = require('./schemas/request/assignRest'); + +const openapi = { + summary: 'Assign a learning module to a specific user or group', + description: `This endpoint is responsible for assigning a learning module from the learning paths system to a user or a group of users. It allows administrators or authorized personnel to dynamically allocate educational content to different learners based on requirements or learning paths. + +**Authentication:** User authentication is mandatory to access this endpoint. Users are required to provide a valid authentication token to prove their identity and access rights before making requests to this endpoint. + +**Permissions:** Users need to have 'manage_learning_paths' permission to assign modules. Without the necessary permissions, the request will be rejected, ensuring that only authorized users can assign learning modules. + +The controller starts by validating the user's authentication status and permissions. Upon successful validation, it invokes the \`assignModule\` function from the \`modules\` core logic. This function takes parameters such as module ID and user or group ID, and then interacts with the database to update the module assignments. The process involves checking the module's availability, the user's or group's eligibility, and then updating the assignment records in the database. The outcome of the operation is sent back to the user in the form of a success or error message, detailing the result of the assignment attempt.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/createRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/createRest.js new file mode 100644 index 0000000000..4fb04aab94 --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/createRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/createRest'); +const { schema: xRequest } = require('./schemas/request/createRest'); + +const openapi = { + summary: 'Create a new learning module', + description: `This endpoint facilitates the creation of a new learning module within the leemons platform. The implementation includes constructing module details such as title, description, and associated learning assets based on input data. + +**Authentication:** A user must be authenticated to perform this action. Authentication ensures that requests to this endpoint are made by valid users of the platform. + +**Permissions:** The user needs to have the 'create_module' permission to be able to execute this action. This ensures only authorized users can add new learning modules. + +Once the endpoint receives a request, it calls the \`createModule\` function from the \`modules\` core service. This function takes user-provided data such as module names, descriptions, and learning objective identifiers to assemble a new module instance. The process involves validating input data, ensuring correctness and completeness before creating the module in the database. Upon successful creation, the service returns details of the newly created module along with a status code indicating successful creation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/duplicateRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/duplicateRest.js new file mode 100644 index 0000000000..0fc831096d --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/duplicateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/duplicateRest'); +const { schema: xRequest } = require('./schemas/request/duplicateRest'); + +const openapi = { + summary: 'Duplicate a specific module', + description: `This endpoint handles the duplication of a module based on the provided module ID. The duplication process involves creating a complete copy of the existing module, including its configurations and associated data, under a new unique identifier. + +**Authentication:** Users need to be authenticated to initiate the duplication process. An access check ensures that only authenticated requests are processed. + +**Permissions:** The user must have the 'duplicate_module' permission. This permission check is critical to ensure that only authorized users can duplicate modules. + +Upon receiving the request, \`duplicateModule\` from the \`ModuleService\` is called with necessary parameters such as module ID and user context. This function orchestrates the cloning of the module's data, adjusting properties as needed to ensure integrity and uniqueness. Success or failure of the duplication is communicated back to the user through the HTTP response, which provides details of the newly created module or error messages if applicable.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/publishRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/publishRest.js new file mode 100644 index 0000000000..c0f33f9bfc --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/publishRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/publishRest'); +const { schema: xRequest } = require('./schemas/request/publishRest'); + +const openapi = { + summary: 'Publish learning module details', + description: `This endpoint publishes the details of a specific learning module. It updates the module's status to 'published', making it accessible to users based on the provided access configurations. + +**Authentication:** Users must be authenticated to perform this operation. The action checks for a valid session or token before proceeding with the publishing process. + +**Permissions:** The user must have 'module_publish' permission to execute this action. Any attempt without this permission will result in an access denied error. + +The process begins in the \`publishRest\` action where a specific module's ID is received as a parameter. The action then interacts with \`publishModule\` from the \`modules\` core, which checks if the module exists and verifies the user's permission to publish it. If all validations pass, the module's status in the database is updated to 'published'. This transition allows the module to become visible and accessible to users according to the learning platform's visibility settings. The response from the action confirms the successful publication or returns an error if any part of the process fails.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/removeRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/removeRest.js new file mode 100644 index 0000000000..36599c52a2 --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/removeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeRest'); +const { schema: xRequest } = require('./schemas/request/removeRest'); + +const openapi = { + summary: 'Remove a specific learning module', + description: `This endpoint facilitates the removal of a specified learning module by its unique identifier. The process deletes the module from the learning paths system, ensuring that it is no longer accessible or associated with any learning path. + +**Authentication:** This action requires the user to be authenticated. Only authenticated sessions can initiate the removal of a module. + +**Permissions:** The user must have administrative rights or specific deletion permissions for learning modules to execute this operation. + +The endpoint invokes the \`removeModule\` method in the \`Modules\` service. This action flow starts when the endpoint receives a DELETE request containing the module's unique identifier. It then checks for user authentication and verifies if the user has the necessary permissions to remove a learning module. If all checks are pass, the \`removeModule\` method from the \`modules\` core uses this identifier to locate and delete the module from the database. The operation concludes by sending a success or error message back to the client, depending on the outcome of the deletion process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/assignRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/assignRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/assignRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/createRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/createRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/createRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/duplicateRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/duplicateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/duplicateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/publishRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/publishRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/publishRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/removeRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/updateRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/assignRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/assignRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/assignRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/createRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/createRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/createRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/duplicateRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/duplicateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/duplicateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/publishRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/publishRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/publishRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/removeRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/updateRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/updateRest.js b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/updateRest.js new file mode 100644 index 0000000000..26b2140c69 --- /dev/null +++ b/plugins/leemons-plugin-learning-paths/backend/services/rest/openapi/modules/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Updates specific learning module details', + description: `This endpoint allows for the modification of existing module details within the Leemons platform's Learning Paths plugin. The primary function is to update module information based on provided data, which can include changes to names, descriptions, and associated metadata of the module. + +**Authentication:** User authentication is mandatory to ensure that only authorized users can update modules. A valid session or token must be provided to access this endpoint. + +**Permissions:** The user must have 'module.edit' permission to update module details. Without the appropriate permissions, the endpoint will reject the request and return an authorization error. + +Upon receiving the update request, the \`updateModule\` function within the \`modules\` core is triggered, which first validates the provided data against the module schema. Assuming validation passes without errors, it proceeds to update the module details in the database. The function interacts with the database using a transaction to ensure that all data is consistently updated without errors. Upon successful update, a confirmation is sent back to the client indicating the successful modification of the module, along with the updated module data.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/config.rest.js b/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/config.rest.js index 4977996887..2ac1c00376 100644 --- a/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/config.rest.js +++ b/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/config.rest.js @@ -2,13 +2,15 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const { getConfig } = require('../../core/provider'); +const getConfigRest = require('./openapi/config/getConfigRest'); +/** @type {ServiceSchema} */ module.exports = { getConfigRest: { + openapi: getConfigRest.openapi, rest: { method: 'GET', path: '/', diff --git a/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/openapi/config/getConfigRest.js b/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/openapi/config/getConfigRest.js new file mode 100644 index 0000000000..a074b1837b --- /dev/null +++ b/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/openapi/config/getConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getConfigRest'); +const { schema: xRequest } = require('./schemas/request/getConfigRest'); + +const openapi = { + summary: 'Fetch AWS S3 configuration settings', + description: `This endpoint retrieves the configuration settings for AWS S3 storage used by the leebrary plugin within the Leemons platform. It fetches details such as access keys, bucket names, and other essential configurations necessary for interacting with AWS S3 services. + +**Authentication:** User authentication is required to ensure that only authorized personnel access the AWS S3 configuration. A valid authentication token must be presented, or access is denied. + +**Permissions:** This endpoint requires administrative permissions. Only users with the 'admin' role or specific privileges aimed at system configuration management can access this endpoint. + +Upon receiving a request, this handler first verifies user authentication and permissions. If the validation is successful, it invokes the \`getConfig\` method within the 'provider' folder. This method internally uses the AWS SDK to fetch and return the current configuration settings from AWS S3. The received configuration details are then formatted appropriately and sent back to the client in a JSON response format, detailing key-value pairs of the configuration settings.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/openapi/config/schemas/request/getConfigRest.js b/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/openapi/config/schemas/request/getConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/openapi/config/schemas/request/getConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/openapi/config/schemas/response/getConfigRest.js b/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/openapi/config/schemas/response/getConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary-aws-s3/backend/services/rest/openapi/config/schemas/response/getConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js index 897cc7b885..d08af3530d 100644 --- a/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/assets.rest.js @@ -14,7 +14,9 @@ const { duplicate } = require('../../core/assets/duplicate'); const { remove } = require('../../core/assets/remove'); const { getByUser } = require('../../core/assets/getByUser'); const { getByIds } = require('../../core/assets/getByIds'); -const { getByAsset: getPermissions } = require('../../core/permissions/getByAsset'); +const { + getByAsset: getPermissions, +} = require('../../core/permissions/getByAsset'); const { getUsersByAsset } = require('../../core/permissions/getUsersByAsset'); const canAssignRole = require('../../core/permissions/helpers/canAssignRole'); const { getByCategory } = require('../../core/permissions/getByCategory'); @@ -25,9 +27,23 @@ const { getByUser: getPinsByUser } = require('../../core/pins/getByUser'); const { setAsset } = require('../../core/assets/set'); const { prepareAsset } = require('../../core/assets/prepareAsset'); +const addRest = require('./openapi/assets/addRest'); +const updateRest = require('./openapi/assets/updateRest'); +const removeRest = require('./openapi/assets/removeRest'); +const duplicateRest = require('./openapi/assets/duplicateRest'); +const myRest = require('./openapi/assets/myRest'); +const getRest = require('./openapi/assets/getRest'); +const listRest = require('./openapi/assets/listRest'); +const listByIdsRest = require('./openapi/assets/listByIdsRest'); +const urlMetadataRest = require('./openapi/assets/urlMetadataRest'); +const addPinRest = require('./openapi/assets/addPinRest'); +const removePinRest = require('./openapi/assets/removePinRest'); +const pinsRest = require('./openapi/assets/pinsRest'); +const hasPinsRest = require('./openapi/assets/hasPinsRest'); /** @type {ServiceSchema} */ module.exports = { addRest: { + openapi: addRest.openapi, rest: { path: '/', method: 'POST', @@ -39,6 +55,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { path: '/:id', method: 'PUT', @@ -50,6 +67,7 @@ module.exports = { }, }, removeRest: { + openapi: removeRest.openapi, rest: { path: '/:id', method: 'DELETE', @@ -62,13 +80,19 @@ module.exports = { }, }, duplicateRest: { + openapi: duplicateRest.openapi, rest: { path: '/:id', method: 'POST', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const { id: assetId, preserveName, indexable, public: isPublic } = ctx.params; + const { + id: assetId, + preserveName, + indexable, + public: isPublic, + } = ctx.params; const asset = await duplicate({ assetId, @@ -83,6 +107,7 @@ module.exports = { }, }, myRest: { + openapi: myRest.openapi, rest: { path: '/my', method: 'GET', @@ -94,6 +119,7 @@ module.exports = { }, }, getRest: { + openapi: getRest.openapi, rest: { path: '/:id', method: 'GET', @@ -112,10 +138,16 @@ module.exports = { }); if (!asset) { - throw new LeemonsError(ctx, { message: 'Asset not found', httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: 'Asset not found', + httpStatusCode: 400, + }); } - const { role: assignerRole, permissions } = await getPermissions({ assetId, ctx }); + const { role: assignerRole, permissions } = await getPermissions({ + assetId, + ctx, + }); if (!permissions?.view) { throw new LeemonsError(ctx, { @@ -146,6 +178,7 @@ module.exports = { }, }, listRest: { + openapi: listRest.openapi, rest: { path: '/list', method: 'GET', @@ -174,7 +207,9 @@ module.exports = { let assets; const publishedStatus = - published === 'all' ? published : [...trueValues, 'published'].includes(published); + published === 'all' + ? published + : [...trueValues, 'published'].includes(published); const displayPublic = trueValues.includes(showPublic); const searchProvider = trueValues.includes(searchInProvider); const preferCurrentValue = trueValues.includes(preferCurrent); @@ -241,6 +276,7 @@ module.exports = { }, }, listByIdsRest: { + openapi: listByIdsRest.openapi, rest: { path: '/list', method: 'POST', @@ -292,6 +328,7 @@ module.exports = { }, }, urlMetadataRest: { + openapi: urlMetadataRest.openapi, rest: { path: '/url-metadata', method: 'GET', @@ -300,7 +337,10 @@ module.exports = { async handler(ctx) { const { url } = ctx.params; if (_.isEmpty(url)) { - throw new LeemonsError(ctx, { message: 'Url is required', httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: 'Url is required', + httpStatusCode: 400, + }); } let metas = {}; try { @@ -309,13 +349,16 @@ module.exports = { metas = await metascraper({ html, url }); } catch (e) { ctx.logger.error(e); - throw new LeemonsError(ctx, { message: `Error getting URL metadata: ${url}` }); + throw new LeemonsError(ctx, { + message: `Error getting URL metadata: ${url}`, + }); } return { status: 200, metas }; }, }, addPinRest: { + openapi: addPinRest.openapi, rest: { path: '/pins', method: 'POST', @@ -324,13 +367,17 @@ module.exports = { async handler(ctx) { const { asset: assetId } = ctx.params; if (!assetId || _.isEmpty(assetId)) { - throw new LeemonsError(ctx, { message: 'Asset id is required', httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: 'Asset id is required', + httpStatusCode: 400, + }); } const pin = await addPin({ assetId, ctx }); return { status: 200, pin }; }, }, removePinRest: { + openapi: removePinRest.openapi, rest: { path: '/pins/:id', method: 'DELETE', @@ -343,6 +390,7 @@ module.exports = { }, }, pinsRest: { + openapi: pinsRest.openapi, rest: { path: '/pins', method: 'GET', @@ -361,9 +409,12 @@ module.exports = { } = ctx.params; const _providerQuery = JSON.parse(providerQuery || null); - const _category = category || categoryFilter === 'undefined' ? null : categoryFilter; + const _category = + category || categoryFilter === 'undefined' ? null : categoryFilter; const publishedStatus = - published === 'all' ? published : ['true', true, '1', 1, 'published'].includes(published); + published === 'all' + ? published + : ['true', true, '1', 1, 'published'].includes(published); const displayPublic = ['true', true, '1', 1].includes(showPublic); const _preferCurrent = ['true', true, '1', 1].includes(preferCurrent); @@ -387,6 +438,7 @@ module.exports = { }, }, hasPinsRest: { + openapi: hasPinsRest.openapi, rest: { path: '/has-pins', method: 'GET', diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js index c2549ae606..1f7608a202 100644 --- a/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/categories.rest.js @@ -15,9 +15,16 @@ const { exists } = require('../../core/categories/exists'); const { list } = require('../../core/categories/list'); const { remove } = require('../../core/categories/remove'); +const listWithMenuItemRest = require('./openapi/categories/listWithMenuItemRest'); +const assetTypesRest = require('./openapi/categories/assetTypesRest'); +const addRest = require('./openapi/categories/addRest'); +const existsRest = require('./openapi/categories/existsRest'); +const listRest = require('./openapi/categories/listRest'); +const removeRest = require('./openapi/categories/removeRest'); /** @type {ServiceSchema} */ module.exports = { listWithMenuItemRest: { + openapi: listWithMenuItemRest.openapi, rest: { path: '/menu-list', method: 'GET', @@ -30,6 +37,7 @@ module.exports = { }, }, assetTypesRest: { + openapi: assetTypesRest.openapi, rest: { path: '/:id/types', method: 'GET', @@ -37,12 +45,15 @@ module.exports = { middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { const { id } = ctx.params; - const assets = (await getByCategory({ categoryId: id, ctx })).map((item) => item.id); + const assets = (await getByCategory({ categoryId: id, ctx })).map( + (item) => item.id + ); const types = await getTypesByAssets({ assetIds: assets, ctx }); return { status: 200, types: uniq(types) }; }, }, addRest: { + openapi: addRest.openapi, rest: { method: 'POST', path: '', // No hay ruta en leemons-legacy @@ -54,6 +65,7 @@ module.exports = { }, }, existsRest: { + openapi: existsRest.openapi, rest: { method: 'GET', path: '', // No hay ruta en leemons-legacy @@ -65,6 +77,7 @@ module.exports = { }, }, listRest: { + openapi: listRest.openapi, rest: { method: 'GET', path: '', // No hay ruta en leemons-legacy @@ -76,6 +89,7 @@ module.exports = { }, }, removeRest: { + openapi: removeRest.openapi, rest: { method: 'DELETE', path: '', // No hay ruta en leemons-legacy diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js index b3a5c5d9bb..e761d77a05 100644 --- a/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/files.rest.js @@ -2,7 +2,6 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const { LeemonsError } = require('@leemons/error'); @@ -14,16 +13,23 @@ const { abortMultipart } = require('../../core/files/abortMultipart'); const { finishMultipart } = require('../../core/files/finishMultipart'); const { getByFile } = require('../../core/assets/files/getByFile'); const { dataForReturnFile } = require('../../core/files'); -const { uploadMultipartChunk } = require('../../core/files/uploadMultipartChunk'); +const { + uploadMultipartChunk, +} = require('../../core/files/uploadMultipartChunk'); const { createTemp } = require('../../core/files/upload/createTemp'); const { getByIds } = require('../../core/assets/getByIds'); -const { getUploadChunkUrls } = require('../../core/files/getUploadChunkUrls/getUploadChunkUrls'); +const { + getUploadChunkUrls, +} = require('../../core/files/getUploadChunkUrls/getUploadChunkUrls'); const getFileRest = async ({ ctx, payload }) => { const { id, download, onlyPublic } = payload; if (_.isEmpty(id)) { - throw new LeemonsError(ctx, { message: 'Id is required', httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: 'Id is required', + httpStatusCode: 400, + }); } let checkPermissions = !onlyPublic; @@ -85,9 +91,14 @@ const getFileRest = async ({ ctx, payload }) => { ctx.meta.$responseHeaders = { 'Content-Type': contentType, }; - if (download || (!['image', 'video', 'audio'].includes(mediaType) && !file.isFolder)) { + if ( + download || + (!['image', 'video', 'audio'].includes(mediaType) && !file.isFolder) + ) { ctx.meta.$responseHeaders = { - 'Content-Disposition': `attachment; filename=${encodeURIComponent(fileName)}`, + 'Content-Disposition': `attachment; filename=${encodeURIComponent( + fileName + )}`, }; } @@ -110,8 +121,19 @@ const getFileRest = async ({ ctx, payload }) => { return readStream; }; +const newMultipartRest = require('./openapi/file/newMultipartRest'); +const getUploadChunkUrlsRest = require('./openapi/file/getUploadChunkUrlsRest'); +const uploadMultipartChunkRest = require('./openapi/file/uploadMultipartChunkRest'); +const abortMultipartRest = require('./openapi/file/abortMultipartRest'); +const finishMultipartRest = require('./openapi/file/finishMultipartRest'); +const fileRest = require('./openapi/file/fileRest'); +const publicFileRest = require('./openapi/file/publicFileRest'); +const publicFolderRest = require('./openapi/file/publicFolderRest'); +const coverRest = require('./openapi/file/coverRest'); +/** @type {ServiceSchema} */ module.exports = { newMultipartRest: { + openapi: newMultipartRest.openapi, rest: { method: 'POST', path: '/multipart/new', @@ -124,6 +146,7 @@ module.exports = { }, }, getUploadChunkUrlsRest: { + openapi: getUploadChunkUrlsRest.openapi, rest: { method: 'POST', path: '/multipart/chunk/urls', @@ -136,6 +159,7 @@ module.exports = { }, }, uploadMultipartChunkRest: { + openapi: uploadMultipartChunkRest.openapi, rest: { method: 'POST', path: '/multipart/chunk', @@ -155,6 +179,7 @@ module.exports = { }, }, abortMultipartRest: { + openapi: abortMultipartRest.openapi, rest: { method: 'POST', path: '/multipart/abort', @@ -168,6 +193,7 @@ module.exports = { }, finishMultipartRest: { + openapi: finishMultipartRest.openapi, rest: { method: 'POST', path: '/multipart/finish', @@ -180,17 +206,23 @@ module.exports = { }, }, fileRest: { + openapi: fileRest.openapi, rest: { path: '/:id', method: 'GET', }, - middlewares: [LeemonsMiddlewareAuthenticated({ continueEvenThoughYouAreNotLoggedIn: true })], + middlewares: [ + LeemonsMiddlewareAuthenticated({ + continueEvenThoughYouAreNotLoggedIn: true, + }), + ], // eslint-disable-next-line sonarjs/cognitive-complexity async handler(ctx) { return getFileRest({ ctx, payload: ctx.params }); }, }, publicFileRest: { + openapi: publicFileRest.openapi, rest: { path: '/public/:id', method: 'GET', @@ -202,6 +234,7 @@ module.exports = { }, }, publicFolderRest: { + openapi: publicFolderRest.openapi, rest: { path: '/public/:id/(.*)', method: 'GET', @@ -214,16 +247,24 @@ module.exports = { }, }, coverRest: { + openapi: coverRest.openapi, rest: { path: '/img/:assetId', method: 'GET', }, - middlewares: [LeemonsMiddlewareAuthenticated({ continueEvenThoughYouAreNotLoggedIn: true })], + middlewares: [ + LeemonsMiddlewareAuthenticated({ + continueEvenThoughYouAreNotLoggedIn: true, + }), + ], async handler(ctx) { const { assetId } = ctx.params; if (_.isEmpty(assetId)) { - throw new LeemonsError(ctx, { message: 'Asset ID is required', httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: 'Asset ID is required', + httpStatusCode: 400, + }); } const assets = await getByIds({ @@ -237,7 +278,8 @@ module.exports = { if (!asset) { throw new LeemonsError(ctx, { - message: "You don't have permissions to view this Asset or the asset doens't exists", + message: + "You don't have permissions to view this Asset or the asset doens't exists", httpStatusCode: 403, }); } @@ -269,7 +311,9 @@ module.exports = { // To implement: handle content disposition for images, video and audio. Taking care of download param } else { ctx.meta.$responseHeaders = { - 'Content-disposition': `attachment; filename=${encodeURIComponent(fileName)}`, + 'Content-disposition': `attachment; filename=${encodeURIComponent( + fileName + )}`, }; } // eslint-disable-next-line consistent-return diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/addPinRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/addPinRest.js new file mode 100644 index 0000000000..7642fc085e --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/addPinRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addPinRest'); +const { schema: xRequest } = require('./schemas/request/addPinRest'); + +const openapi = { + summary: "Add a new pin to the user's collection", + description: `This endpoint allows the authenticated user to add a new pin to their personal collection within the platform. It is primarily designed to help users organize and save items of interest. + +**Authentication:** Users need to be logged in to utilize this feature. Access will be denied for any requests without a valid authentication session. + +**Permissions:** The user must have the 'add_pin' permission, which allows them to append new pins to their collection. This ensures that only users with the requisite rights can make modifications to their pin collection. + +Upon receiving a request, the endpoint first verifies the user's authentication status and permissions. It then proceeds to invoke the \`addPin\` function, passing user-specific data extracted from the request body. This function is responsible for creating a new pin and saving it to the database associated with the user's account. After successful insertion, the response confirms the creation of the new pin along with its details serialized in JSON format, indicating a successful operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/addRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/addRest.js new file mode 100644 index 0000000000..bba01b99c4 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/addRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addRest'); +const { schema: xRequest } = require('./schemas/request/addRest'); + +const openapi = { + summary: 'Add new digital asset to the library', + description: `This endpoint handles the addition of a new digital asset to the platform's library. It facilitates users to upload and categorize new content, such as books, media files, or other educational resources, making these assets available for access and use across the platform. + +**Authentication:** User authentication is mandatory to ensure secure upload and proper attribution of the uploaded assets to the respective user accounts. An unauthorized or unauthenticated request will be rejected. + +**Permissions:** The user must have the 'add_asset' permission within their role to upload new assets. This permission check ensures that only authorized users can add content to the library. + +Upon receiving a request, the endpoint first validates the user's authentication and permissions. Assuming all checks pass, the service then proceeds to handle the file upload, metadata assignment, and category association using dedicated services such as \`handleFileUpload\`, \`handleCategoryData\`, and \`createAssetInDb\`. These methods collectively ensure that the asset is appropriately stored, categorized, and recorded in the database. The entire process encapsulates data validation, permission checks, and structured data entry, culminating in a status response that indicates whether the asset has been successfully added.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/duplicateRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/duplicateRest.js new file mode 100644 index 0000000000..745a87414c --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/duplicateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/duplicateRest'); +const { schema: xRequest } = require('./schemas/request/duplicateRest'); + +const openapi = { + summary: 'Duplicates an asset based on a provided ID', + description: `This endpoint facilitates the duplication of a digital asset identified by its unique ID. The duplication process includes duplicating the asset's metadata, tags, associated files, and any specific permissions or categorizations linked to the original asset. + +**Authentication:** Users must be authenticated and possess the required session tokens to initiate a duplication request. Authentication verifies user identity and session validity before proceeding. + +**Permissions:** Users need specific 'duplicate' permissions on the asset they intend to duplicate. Without these permissions, the request will be denied, ensuring that only authorized users can duplicate assets. + +Upon receiving a duplication request, the endpoint initially verifies user authentication and checks if the user has the necessary duplication permissions for the specified asset. If authenticated and authorized, the endpoint calls multiple services: it retrieves the original asset's information, checks for existing duplicates, and then proceeds to duplicate the asset's metadata, files, and tags. Throughout this process, all related entities such as bookmarks or categories associated with the asset are also considered for duplication. The final output is the creation of a new asset entry in the database, echoing the properties of the original while ensuring data consistency and integrity.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/getRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/getRest.js new file mode 100644 index 0000000000..1d1072b98d --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Retrieve specific assets based on provided IDs', + description: `This endpoint is designed to fetch a detailed list of assets by their unique identifiers. It caters to retrieving comprehensive asset details which could include metadata, associated permissions, user roles, and more, depending on the asset's configuration and user's access rights. + +**Authentication:** Access to this endpoint requires user authentication. Users need to pass valid authentication tokens with their requests to prove their identity and session validity. + +**Permissions:** Users must have appropriate permissions to view the requested assets. The specific permissions required will depend on the assets being accessed and the level of detail required. Permissions checks are integral to ensure that users can only retrieve data for assets they are authorized to access. + +Upon receiving a request, the endpoint processes input IDs and invokes several internal methods to retrieve the assets. These methods include querying the database for asset details, checking user permissions, and potentially aggregating additional data related to each asset such as associated files, permissions, or related programs. The result encapsulates a comprehensive view of each asset, tailored to the authenticated user’s access rights. The response is then formatted as a JSON object containing all the necessary details about each asset.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/hasPinsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/hasPinsRest.js new file mode 100644 index 0000000000..f5a27b6132 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/hasPinsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/hasPinsRest'); +const { schema: xRequest } = require('./schemas/request/hasPinsRest'); + +const openapi = { + summary: 'Check for the existence of digital assets pins related to a user', + description: `This endpoint checks if any digital asset pins related to a specific user exist in the system, helping to quickly identify user interactions with assets such as likes, bookmarks, or any kind of flags. + +**Authentication:** Users need to be logged in to check for pins. If the authentication details are missing or invalid, the request is rejected. + +**Permissions:** The user must have the 'view_pins' permission to execute this operation. This ensures that only authorized users can check for their interactions with assets. + +Initially, the handler invokes the \`hasPins\` method of the \`Assets\` service, providing user and asset identifiers wrapped in the request context. This method queries the underlying database to verify the existence of any pins associated with the user's account. The operation does not return the pins themselves but rather a boolean indicating the presence or absence of such interactions. Depending on the outcome, the response is structured to inform the client if at least one pin related to the user exists, facilitating efficient frontend decision-making regarding the display of user-specific asset interactions.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/listByIdsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/listByIdsRest.js new file mode 100644 index 0000000000..aff3d9cdac --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/listByIdsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listByIdsRest'); +const { schema: xRequest } = require('./schemas/request/listByIdsRest'); + +const openapi = { + summary: 'Retrieve a list of assets by their identifiers', + description: `This endpoint retrieves a list of assets based on a provided array of asset identifiers. The primary function is to fetch detailed information about each asset, which may include metadata, linked files, tags, categories, and associated programs or subjects. + +**Authentication:** Users must be authenticated to access this endpoint. Access is denied if the user's session is not valid or the authentication token is missing. + +**Permissions:** Users need specific roles or permissions set to retrieve the detailed information of each asset. The required permissions vary based on the asset sensitivity and classification. + +The handler initiates by calling the \`getByIds\` method from the \`Assets\` core, which receives an array of asset IDs through the request parameters. It orchestrates several steps: validating user roles with \`getUserPermissionsByAsset\` to check access rights, fetching related asset data such as subjects, files, and tags using respective methods like \`getAssetsWithSubjects\` and \`getAssetsWithFiles\`. Each asset is then processed to append additional data such as category and program specifics with \`getAssetsCategoryData\` and \`getAssetsProgramsAggregatedById\`. Finally, \`processFinalAsset\` method formats the assets into a presentable structure before sending them back in the HTTP response as a JSON formatted list.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/listRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/listRest.js new file mode 100644 index 0000000000..ef35cf1ae5 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'List all assets based on user permissions', + description: `This endpoint lists all assets accessible to the currently authenticated user based on their permissions. The returned assets may include those owned by the user, shared directly with the user, or shared within teams or groups the user belongs to. + +**Authentication:** Users must be authenticated to view the list of accessible assets. Proper authentication ensures that the returned list reflects accurate asset access as per user credentials and roles. + +**Permissions:** Users need to have the 'view' permission for assets. The system conducts a permission check to ensure the user has rights to access each asset listed. Absence of adequate permissions will limit the visibility of certain assets in the response. + +Upon receiving a request, the handler initializes by validating the user’s authentication status. Once authenticated, it proceeds to fetch asset data by invoking related methods like \`filterAssetsByUserPermissions\` which determine the assets that the user is eligible to view. The methodology involves querying the database using criteria based on the user's roles and applicable permissions. Post query execution, the endpoint aggregates the data and formats it into a structured response. Finally, the service returns the list of assets in a JSON formatted payload, providing a clear view of all accessible resources to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/myRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/myRest.js new file mode 100644 index 0000000000..b53290129f --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/myRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/myRest'); +const { schema: xRequest } = require('./schemas/request/myRest'); + +const openapi = { + summary: 'Manage asset interactions for users', + description: `This endpoint facilitates various interactions for a user’s digital assets within the platform which includes fetching, updating, and deleting operations depending on the user's input and query parameters. + +**Authentication:** User authentication is mandatory to ensure the secure handling of assets. Access without proper authentication will be denied. + +**Permissions:** Users need appropriate permissions to interact with assets. Specific permissions like \`asset_modify\` or \`asset_delete\` might be required based on the action attempted. + +The flow within this endpoint begins by determining the type of request made by the user — get, update, or delete. This is managed by routing the request to the respective function within the asset management controller. Each function uses the \`ctx\` parameter to access user details and validate permissions. For 'get' operations, it calls a method to retrieve assets linked to the user. For 'update' or 'delete', additional verification checks if the user has rights to modify or remove the asset. Once the requested action is completed, the response, typically in JSON format, reflects the outcome of this operation (success or error details).`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/pinsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/pinsRest.js new file mode 100644 index 0000000000..13270bd201 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/pinsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/pinsRest'); +const { schema: xRequest } = require('./schemas/request/pinsRest'); + +const openapi = { + summary: 'Manages pin-related functionalities for assets', + description: `This endpoint is responsible for handling various operations related to pins, including adding, removing, updating, and retrieving pin information related to assets in the Leebrary system. + +**Authentication:** Users must be logged in to interact with pin functionalities. Access is denied if authentication credentials are absent or invalid. + +**Permissions:** User permissions need to align with actions like creating, updating, or deleting pins. Specific permission validation is performed based on the user role and the nature of the operation requested. + +Upon receiving a request, this controller first verifies the user's authentication and permissions. Depending on the operation - add, remove, update, or fetch - it delegates the task to respective methods within the \`PinsService\`. Each method utilizes the Moleculer service actions to interact with the database and manipulate or retrieve pin data associated with assets. The flow typically involves validating the input parameters, executing the logic required for each type of pin operation, and formatting the output to be suitable for client's consumption, finalizing with an HTTP response conveying the result or status of the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/removePinRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/removePinRest.js new file mode 100644 index 0000000000..5335973d18 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/removePinRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removePinRest'); +const { schema: xRequest } = require('./schemas/request/removePinRest'); + +const openapi = { + summary: "Remove a pinned asset from the user's collection", + description: `This endpoint allows a user to unpin or remove an asset previously marked as important or distinctive in their collection. The function alters the user's pinned asset list by removing a specified asset, thus updating the user's preferences and collection views. + +**Authentication:** User authentication is mandatory to ensure that the request to unpin an asset originates from a bona fide source. An invalid or expired authentication token will prevent access to this functionality. + +**Permissions:** This endpoint requires that users have proper rights to modify their own pinned assets. The specific permission \`unpin_asset\` should be validated to permit the operation which ensures the integrity and security of user data. + +Upon receiving a request, the \`removePinRest\` endpoint first verifies user authentication and permissions. It then proceeds to call the \`unpinAsset\` method within the service logic where the actual unpinning procedure is executed. This method checks the provided asset identifier against the user’s currently pinned assets, and if found, it is removed from the pinned list. The entire process is encapsulated within a transaction to ensure data consistency. Should the operation succeed, a success response is sent back to the user; in case of failure due to reasons such as non-existent asset ID or insufficient permissions, the appropriate error message is returned.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/removeRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/removeRest.js new file mode 100644 index 0000000000..2359d5f6d4 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/removeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeRest'); +const { schema: xRequest } = require('./schemas/request/removeRest'); + +const openapi = { + summary: 'Removes a specified asset from the library', + description: `This endpoint allows for the deletion of a specified asset from the library according to its unique identifier. The asset is permanently removed from the database and all associated metadata and permissions settings are also deleted. + +**Authentication:** Users must be authenticated to delete assets. The system validates the user's authentication token, and failure to provide a valid token results in denial of access to the endpoint. + +**Permissions:** The user must have administrative or specific deletion permissions for the asset they attempt to remove. If the user lacks the necessary permissions, the endpoint will deny access and return an error. + +Upon receiving a request, the handler in \`assets.rest.js\` invokes the \`remove\` action from the corresponding service. This action utilizes methods defined in \`remove.js\` and related files to check the user's permissions, validate the existence of the asset, and proceed with the deletion process from the database. Detailed error handling ensures feedback is provided for failures such as missing permissions, non-existent assets, or database errors. The flow ensures a secure operation protecting the integrity and access control of asset data within the system.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/addPinRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/addPinRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/addPinRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/addRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/addRest.js new file mode 100644 index 0000000000..7f2ed0d71f --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/addRest.js @@ -0,0 +1,36 @@ +// automatic hash: 13c432e1cdffab65579c66e98492d654e7e930e071a6949e82dbc40cc5f25f13 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + file: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'string', + minLength: 1, + }, + categoryKey: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + url: {}, + program: {}, + subjects: { + type: 'string', + minLength: 1, + }, + isCover: { + type: 'boolean', + }, + }, + required: ['file', 'cover', 'categoryKey', 'name', 'subjects', 'isCover'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/duplicateRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/duplicateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/duplicateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/getRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/hasPinsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/hasPinsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/hasPinsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/listByIdsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/listByIdsRest.js new file mode 100644 index 0000000000..2f5bbed3fc --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/listByIdsRest.js @@ -0,0 +1,23 @@ +// automatic hash: d605db14fa092b7ebf2e4a2e1dbb23b6c55fdd4a6f3f4da22c958d93c0a28ae9 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + assets: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + filters: { + type: 'object', + properties: {}, + required: [], + }, + }, + required: ['assets', 'filters'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/listRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/listRest.js new file mode 100644 index 0000000000..5b564c189a --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/listRest.js @@ -0,0 +1,30 @@ +// automatic hash: cbbce01e51253f7250aac5115d5bfa5a26ea9d0dbd3d7899d32e5ed9823863e7 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + type: { + type: 'string', + minLength: 1, + }, + category: { + type: 'string', + minLength: 1, + }, + criteria: { + type: 'string', + }, + published: { + type: 'string', + minLength: 1, + }, + showPublic: { + type: 'string', + minLength: 1, + }, + }, + required: ['type', 'category', 'criteria', 'published', 'showPublic'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/myRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/myRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/myRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/pinsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/pinsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/pinsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/removePinRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/removePinRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/removePinRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/removeRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/updateRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/urlMetadataRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/urlMetadataRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/request/urlMetadataRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/addPinRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/addPinRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/addPinRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/addRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/addRest.js new file mode 100644 index 0000000000..5ddb85aa0b --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/addRest.js @@ -0,0 +1,357 @@ +// automatic hash: 24c90ebc9741371b12c30d6c776c1bd7a8fe693b9c4e459d773270fe92fec62f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + asset: { + type: 'object', + properties: { + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'object', + properties: { + size: { + type: 'string', + minLength: 1, + }, + }, + required: ['size'], + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + program: {}, + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + subjects: {}, + file: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'object', + properties: { + size: { + type: 'string', + minLength: 1, + }, + }, + required: ['size'], + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + canAccess: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'name', + 'surnames', + 'email', + 'gender', + 'avatar', + 'editable', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + surnames: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + birthdate: { + type: 'object', + properties: {}, + required: [], + }, + gender: { + type: 'string', + minLength: 1, + }, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + avatar: { + type: 'string', + minLength: 1, + }, + userAgentIds: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + permissions: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editable: { + type: 'boolean', + }, + }, + }, + }, + }, + required: [ + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'category', + 'indexable', + 'isCover', + '_id', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'file', + 'tags', + 'canAccess', + ], + }, + }, + required: ['status', 'asset'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/duplicateRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/duplicateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/duplicateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/getRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/hasPinsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/hasPinsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/hasPinsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/listByIdsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/listByIdsRest.js new file mode 100644 index 0000000000..283c6b80b7 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/listByIdsRest.js @@ -0,0 +1,776 @@ +// automatic hash: fffb9f53e52fcacdcade041023df421f80da4fa106a077ff6caafce4e9dca6da +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + assets: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + '__v', + 'isPrivate', + 'duplicable', + 'assignable', + 'downloadable', + 'pinned', + 'editable', + 'deleteable', + 'shareable', + 'role', + 'prepared', + 'public', + 'pinneable', + 'fileExtension', + 'fileType', + 'url', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'string', + minLength: 1, + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + program: {}, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + isPrivate: { + type: 'boolean', + }, + classesCanAccess: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + canAccess: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'name', + 'surnames', + 'email', + 'gender', + 'avatar', + 'editable', + 'fullName', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + surnames: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + birthdate: { + type: 'object', + properties: {}, + required: [], + }, + gender: { + type: 'string', + minLength: 1, + }, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + avatar: { + type: 'string', + minLength: 1, + }, + userAgentIds: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + permissions: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editable: { + type: 'boolean', + }, + fullName: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + subjects: {}, + file: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor'], + }, + duplicable: { + type: 'boolean', + }, + assignable: { + type: 'boolean', + }, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + editable: { + type: 'boolean', + }, + deleteable: { + type: 'boolean', + }, + shareable: { + type: 'boolean', + }, + role: { + type: 'string', + minLength: 1, + }, + original: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + program: {}, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + isPrivate: { + type: 'boolean', + }, + classesCanAccess: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + canAccess: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'name', + 'surnames', + 'email', + 'gender', + 'avatar', + 'editable', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + surnames: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + birthdate: { + type: 'object', + properties: {}, + required: [], + }, + gender: { + type: 'string', + minLength: 1, + }, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + avatar: { + type: 'string', + minLength: 1, + }, + userAgentIds: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + permissions: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editable: { + type: 'boolean', + }, + }, + }, + }, + subjects: {}, + file: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor'], + }, + duplicable: { + type: 'boolean', + }, + assignable: { + type: 'boolean', + }, + downloadable: { + type: 'boolean', + }, + providerData: {}, + tags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pinned: { + type: 'boolean', + }, + editable: { + type: 'boolean', + }, + deleteable: { + type: 'boolean', + }, + shareable: { + type: 'boolean', + }, + role: { + type: 'string', + minLength: 1, + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'isPrivate', + 'classesCanAccess', + 'canAccess', + 'file', + 'permissions', + 'duplicable', + 'assignable', + 'downloadable', + 'tags', + 'pinned', + 'editable', + 'deleteable', + 'shareable', + 'role', + ], + }, + prepared: { + type: 'boolean', + }, + public: { + type: 'boolean', + }, + pinneable: { + type: 'boolean', + }, + fileExtension: { + type: 'string', + minLength: 1, + }, + fileType: { + type: 'string', + minLength: 1, + }, + url: { + type: 'string', + minLength: 1, + }, + metadata: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['value', 'label'], + properties: { + value: { + type: 'string', + minLength: 1, + }, + label: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + }, + }, + }, + }, + required: ['status', 'assets'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/listRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/listRest.js new file mode 100644 index 0000000000..3ca4bb9258 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/listRest.js @@ -0,0 +1,79 @@ +// automatic hash: 84e284c7fa7a6603d5285008fd18b2d6d3e89b4fb2e6426683026a34ed170c9e +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + assets: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['asset', 'role'], + properties: { + asset: { + type: 'string', + minLength: 1, + }, + role: { + type: 'string', + minLength: 1, + }, + permissions: { + type: 'object', + properties: { + view: { + type: 'boolean', + }, + assign: { + type: 'boolean', + }, + comment: { + type: 'boolean', + }, + edit: { + type: 'boolean', + }, + delete: { + type: 'boolean', + }, + duplicate: { + type: 'boolean', + }, + canAssign: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + canUnassign: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: [ + 'view', + 'assign', + 'comment', + 'edit', + 'delete', + 'duplicate', + 'canAssign', + 'canUnassign', + ], + }, + }, + }, + }, + }, + required: ['status', 'assets'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/myRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/myRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/myRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/pinsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/pinsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/pinsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/removePinRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/removePinRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/removePinRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/removeRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/updateRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/urlMetadataRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/urlMetadataRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/schemas/response/urlMetadataRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/updateRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/updateRest.js new file mode 100644 index 0000000000..4ef2371a0c --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Update asset details', + description: `This endpoint is responsible for updating the details of a specific asset in the repository. It accepts updates to various fields of an asset, including but not limited to, the asset’s name, description, and associated metadata. The endpoint processes these updates and ensures the asset's data integrity is maintained throughout the update procedure. + +**Authentication:** Users must be authenticated to modify asset data. The system will validate the user’s authentication token before proceeding with the update process. + +**Permissions:** Appropriate permissions are required to update asset details. Users must have edit or admin rights on the specific asset they are attempting to update. The system checks for these permissions before accepting the update request. + +Upon receiving the request, the \`updateRest\` handler invokes the \`updateAsset\` method from the \`Assets\` core service. This method meticulously validates the updated data against existing records for conflicts and compliance with business rules. After validation, it proceeds to update the database records. The method coordinates with various sub-services like permissions checking and data validation, ensuring a robust and secure update process. The response from this method will confirm whether the update has been successful, with appropriate error handling for any issues encountered during the update.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/urlMetadataRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/urlMetadataRest.js new file mode 100644 index 0000000000..85df49ca7d --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/assets/urlMetadataRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/urlMetadataRest'); +const { schema: xRequest } = require('./schemas/request/urlMetadataRest'); + +const openapi = { + summary: 'Extracts URL metadata for enhanced content previews', + description: `This endpoint is designed to fetch and parse metadata from URLs to enhance content previews such as title, description, and image. This functionality is crucial for applications that require rich link previews to provide better context and visual cues to users. + +**Authentication:** User authentication is mandatory to ensure that only authorized users can request metadata extraction for URLs. Without valid user credentials, the request will be denied. + +**Permissions:** The user must have appropriate permissions to extract metadata from specified URLs. This generally includes permissions to access the URLs or domains from which metadata is being extracted. + +Upon receiving a request, the endpoint utilizes the \`metascraper\` library, configured within the platform, to process the URL provided by the user. It initiates a network call to retrieve HTML content from the URL and then employs a series of scraping rules to extract metadata like the site title, main image, and description. This extracted metadata will then be formatted accordingly and sent back to the client as a structured JSON response, effectively enhancing the content display for any application's frontend.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/addRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/addRest.js new file mode 100644 index 0000000000..6f8fb46dd7 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/addRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addRest'); +const { schema: xRequest } = require('./schemas/request/addRest'); + +const openapi = { + summary: 'Add a new category to the library system', + description: `This endpoint is designed to facilitate the addition of new categories into the library system. It allows for the organization and classification of various resources within the library, enhancing the ease and efficiency of resource retrieval and management. + +**Authentication:** User authentication is necessary to ensure a secure interaction with the endpoint. Only authenticated users can initiate the addition of new categories. + +**Permissions:** The user must have the 'admin' role or equivalent permissions to add new categories. This ensures that only authorized personnel can make changes to the category structure. + +Upon receiving the request, the \`addRest\` handler first validates the provided category data against the defined schema. If validation passes, it proceeds to invoke the \`add\` method within the \`categories\` core module. This method checks for the existence of the category to avoid duplicates using the \`exists\` function from the same module. If the category does not exist, it is added to the database, and a confirmation is returned to the user. If the category already exists, the endpoint responds with an error message stating that the category cannot be duplicated.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/assetTypesRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/assetTypesRest.js new file mode 100644 index 0000000000..67a584f0a9 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/assetTypesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/assetTypesRest'); +const { schema: xRequest } = require('./schemas/request/assetTypesRest'); + +const openapi = { + summary: 'Manage category-related asset types', + description: `This endpoint handles the retrieval and management of asset types related to specific categories within the platform. It provides functionalities such as fetching existing asset types linked to a category, updating them, and adding new asset type connections to categories. + +**Authentication:** Users must be logged in to interact with asset types related to categories. Access to this endpoint requires valid user authentication credentials. + +**Permissions:** Users need specific permissions related to asset type management. Typically, this includes permissions like 'read_asset_types', 'create_asset_types', and 'edit_asset_types' to perform respective actions within the endpoint. + +Upon receiving a request, the endpoint first verifies the user's authentication and permissions. If the validation succeeds, it proceeds to call methods from the 'Categories' and 'AssetTypes' services. Actions such as querying the database for asset types linked to specific categories, adding new asset type connections, or updating existing connections are performed based on the request parameters. Each action involves interactions with database models and may include complex business logic to handle various edge cases and ensure data integrity. The response from these actions is formatted and returned to the user, providing detailed feedback on the outcome of the request.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/existsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/existsRest.js new file mode 100644 index 0000000000..233b2aca80 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/existsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/existsRest'); +const { schema: xRequest } = require('./schemas/request/existsRest'); + +const openapi = { + summary: 'Check category existence', + description: `This endpoint checks whether a specific category exists within the leemons-plugin-leebrary system. It is typically used to validate category inputs in various operations throughout the plugin's features. + +**Authentication:** The endpoint requires that users be authenticated. Failure to provide a valid authentication token will prevent access to the endpoint functionalities. + +**Permissions:** Users need specific permissions related to category management to access this endpoint. The necessary permissions ensure that only authorized users can check for the existence of categories, maintaining system integrity and security. + +The operation begins with the \`exists\` action within the \`categories.rest.js\` service file that calls the \`exists\` method from the \`/backend/core/categories/exists\` module. This method takes a category ID from the request parameters and checks the database for the presence of this category. The logic verifies the existence of the category using the unique identifiers provided. The final outcome of this operation is a Boolean value (true or false), which indicates whether the category is present in the database. This result is then sent back to the client as a simple JSON response indicating the existence status.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/listRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/listRest.js new file mode 100644 index 0000000000..e7f4c81a48 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'Lists all categories available in the Leebrary system', + description: `This endpoint retrieves a list of all categories that have been defined within the Leebrary system. The listed categories can include various types of media or content categorizations used within the platform. + +**Authentication:** Users need to be authenticated to request the list of categories. An absence of valid authentication details will prevent access to this endpoint. + +**Permissions:** The user must have the 'view_categories' permission to access this list. Without this permission, the request will result in an authorization error. + +The request handling begins by invoking the 'listCategories' method located in the categories service. This method queries the database to fetch all existing categories, sorting and filtering them according to any provided parameters in the request. The service layer handles all interaction with the data storage to encapsulate the business logic of category retrieval. Once fetched, these categories are returned to the client in a structured JSON format, typically involving the category names and their respective identifiers.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/listWithMenuItemRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/listWithMenuItemRest.js new file mode 100644 index 0000000000..525acbbad9 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/listWithMenuItemRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listWithMenuItemRest'); +const { schema: xRequest } = require('./schemas/request/listWithMenuItemRest'); + +const openapi = { + summary: 'Lists categories with associated menu items', + description: `This endpoint fetches all categories along with their associated menu items, tailored specifically for display in user interfaces. The data includes the category details and any menu items linked to each category, providing a comprehensive view suitable for navigation or content organization within the platform. + +**Authentication:** User authentication is required to access this endpoint. Only authenticated sessions will receive data; otherwise, a request will lead to an access denied response. + +**Permissions:** The user needs specific permissions to view categories and their related menu items. These permissions ensure users can only access data that is appropriate to their permission level. + +The handler for this endpoint initiates by calling the \`listWithMenuItem\` function from the \`categories\` core. This function constructs a query to the database to retrieve all categories and their corresponding menu items, based on the current user’s access privileges determined through their session credentials. The method aggregates the data and formats it for optimal client-side use, then returns this formatted list as a JSON object. This complete chain from request reception to response delivery ensures that users receive data that is both accurate and specific to their allowed access.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/removeRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/removeRest.js new file mode 100644 index 0000000000..4e696ce111 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/removeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeRest'); +const { schema: xRequest } = require('./schemas/request/removeRest'); + +const openapi = { + summary: 'Remove a specified category', + description: `This endpoint handles the removal of a category from the system. Once triggered, it ensures that the specified category and any related data are deleted permanently from the database. + +**Authentication:** User must be logged in to perform this operation. Authentication ensures that the action is performed by a verified user. + +**Permissions:** This endpoint requires administrator-level permissions. The user must have the right to modify or delete categories within the system. + +The \`removeRest\` action starts by validating the provided category ID against the database to ensure it exists. Upon successful validation, it invokes the \`remove\` method from the \`categories/remove\` core, which facilitates the actual deletion process. This method handles all relational deletions and integrity checks to avoid any orphan records. Detailed logs are generated through this process to monitor the steps taken and any potential errors. The final response will confirm the successful removal of the category or report any errors encountered during the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/addRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/addRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/addRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/assetTypesRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/assetTypesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/assetTypesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/existsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/existsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/existsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/listRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/listWithMenuItemRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/listWithMenuItemRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/listWithMenuItemRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/removeRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/request/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/addRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/addRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/addRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/assetTypesRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/assetTypesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/assetTypesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/existsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/existsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/existsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/listRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/listWithMenuItemRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/listWithMenuItemRest.js new file mode 100644 index 0000000000..1a024c8cc6 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/listWithMenuItemRest.js @@ -0,0 +1,204 @@ +// automatic hash: 83c132527d471659405997dbb9142dd5599895487e2ff3e1445487de4062ae25 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + categories: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'key', + 'pluginOwner', + 'creatable', + 'duplicable', + 'provider', + 'componentOwner', + 'canUse', + 'order', + 'type', + 'isDeleted', + '__v', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + key: { + type: 'string', + minLength: 1, + }, + pluginOwner: { + type: 'string', + minLength: 1, + }, + creatable: { + type: 'boolean', + }, + duplicable: { + type: 'boolean', + }, + provider: { + type: 'string', + minLength: 1, + }, + componentOwner: { + type: 'string', + minLength: 1, + }, + canUse: { + type: 'string', + minLength: 1, + }, + order: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + menuItem: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + menuKey: { + type: 'string', + minLength: 1, + }, + key: { + type: 'string', + minLength: 1, + }, + pluginName: { + type: 'string', + minLength: 1, + }, + fixed: { + type: 'boolean', + }, + iconSvg: { + type: 'string', + minLength: 1, + }, + activeIconSvg: { + type: 'string', + minLength: 1, + }, + window: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + label: { + type: 'string', + minLength: 1, + }, + children: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + customChildren: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'menuKey', + 'key', + 'pluginName', + 'fixed', + 'iconSvg', + 'activeIconSvg', + 'window', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'label', + 'children', + 'customChildren', + ], + }, + }, + }, + }, + }, + required: ['status', 'categories'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/removeRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/categories/schemas/response/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/abortMultipartRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/abortMultipartRest.js new file mode 100644 index 0000000000..da04217e27 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/abortMultipartRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/abortMultipartRest'); +const { schema: xRequest } = require('./schemas/request/abortMultipartRest'); + +const openapi = { + summary: 'Abort multipart upload process', + description: `This endpoint handles the cancellation of an ongoing multipart file upload session. It is designed to ensure that multipart upload operations can be safely terminated without leaving residual data fragments, thus helping in maintaining data consistency and storage optimization. + +**Authentication:** User authentication is required to execute this endpoint. An authenticated user context assures that only owners or authorized users abort the intended upload session. + +**Permissions:** This endpoint requires file-management permissions, specifically the right to modify or delete file upload sessions as delegated within the user's permission scope. + +Upon receiving a request to abort a multipart upload, the endpoint invokes the \`abortMultipart\` function from the corresponding service in the leebrary plugin. This function processes the session identifier provided in the request to locate and halt the active upload process. It then interacts with underlying storage mechanisms to ensure that all partial uploads are either discarded or flagged for cleanup, thereby freeing up resources and preventing partial data storage. The entire process is managed within the framework's structured error handling to ensure that any issues during the abort operation are captured and dealt with appropriately, and appropriate responses are relayed back to the client to reflect the success or failure of the abort operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/coverRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/coverRest.js new file mode 100644 index 0000000000..264c8933d6 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/coverRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/coverRest'); +const { schema: xRequest } = require('./schemas/request/coverRest'); + +const openapi = { + summary: 'Manage file cover updates and retrievals', + description: `This endpoint handles the retrieval and updating of cover images for files within the leemons platform. It allows users to upload new cover images for specific files or retrieve existing ones, enhancing the file metadata and visual identification within user interfaces. + +**Authentication:** Users need to be authenticated in order to update or retrieve file covers. The system checks for a valid user session or access token before processing the request. + +**Permissions:** Users must have the appropriate file management permissions or specific rights granted for the file involved. Without sufficient permissions, the request will be denied. + +Upon receiving a request, the endpoint first verifies the authentication status and permissions of the user. If the user is authorized, the \`coverRest\` handler then either fetches the current cover image or processes the upload of a new one, depending on the request method (GET for retrieval, POST for upload). The implementation involves calls to the file system storage backend, with careful error handling and response management to ensure that users receive appropriate feedback on the outcome of their request—either providing the image file stream/source or success confirmation of the upload.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/fileRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/fileRest.js new file mode 100644 index 0000000000..26fc4fcbff --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/fileRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/fileRest'); +const { schema: xRequest } = require('./schemas/request/fileRest'); + +const openapi = { + summary: 'Manages file operations within the Leebrary plugin', + description: `This endpoint handles various file operations such as uploading, retrieving, and managing files within the Leemons Leebrary plugin. It serves as an essential component for file management in the educational platform, enabling users to efficiently handle educational resources. + +**Authentication:** Users must be authenticated to perform any file operations. Authentication ensures that operations are secure and that files are accessed only by authorized users. + +**Permissions:** Users need specific permissions related to file management. These permissions determine what operations the user can perform, such as uploading new files, updating existing files, or deleting files. + +The handling process starts with the specific file operation request from the user. Depending on the operation (upload, retrieve, delete, etc.), the endpoint executes the corresponding action in the backend. This includes interacting with the file system to store or fetch files, updating file metadata in the database, and ensuring that all file interactions respect user permissions and authentication status. The result of these operations is then formatted appropriately and sent back to the user as a response in JSON format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/finishMultipartRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/finishMultipartRest.js new file mode 100644 index 0000000000..e85c9716f5 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/finishMultipartRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/finishMultipartRest'); +const { schema: xRequest } = require('./schemas/request/finishMultipartRest'); + +const openapi = { + summary: 'Completes the multipart file upload process', + description: `This endpoint finalizes the multipart upload sequence for a file that has been uploaded in chunks. It assimilates all parts of the file that have been uploaded separately, constructs the final complete file, and makes it available for use or download. + +**Authentication:** Users must be authenticated to finalize multipart uploads. A valid session or token is required to prove the user's identity and ensure that the action is securely controlled. + +**Permissions:** Specific permissions are necessary for a user to complete a multipart upload. Typically, the user needs write or upload permissions on the destination where the file is being saved. This ensures that the user has the right to complete uploads to the specified directory or system. + +Upon receiving a request to finalize a multipart upload, the \`finishMultipart\` method in the file service is called. This method checks for all parts of the file stored temporarily during the upload process, verifies their integrity, and concatenates them into a single file. This process may involve validation of each part's checksums to ensure no data corruption occurred during transmission. Once verified and combined, the file is then processed for any needed metadata extraction or further validation based on the file type and service configuration. On successful completion, the concatenated file is made permanently available at its destination, and appropriate metadata is updated to reflect the new file's attributes.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/getUploadChunkUrlsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/getUploadChunkUrlsRest.js new file mode 100644 index 0000000000..b7b3200abe --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/getUploadChunkUrlsRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getUploadChunkUrlsRest'); +const { + schema: xRequest, +} = require('./schemas/request/getUploadChunkUrlsRest'); + +const openapi = { + summary: 'Generate upload URLs for file chunks', + description: `This endpoint generates temporary URLs for uploading file chunks. These URLs are used to securely upload parts of a large file incrementally, which helps in handling large file uploads efficiently and reliably. + +**Authentication:** Users must be authenticated to generate upload chunk URLs. Access to this endpoint without valid authentication will result in a denial of service. + +**Permissions:** Users need specific permissions to generate upload chunk URLs, typically linked to rights to upload files or manage file uploads within the application. + +The process initiated by this endpoint involves invoking the \`getUploadChunkUrls\` method located in the \`files\` core. This method calculates the number of chunks required based on the file size submitted by the user and creates a series of secure, temporary URLs for each chunk. Each URL is specifically generated to allow a part of the file to be uploaded to a designated storage location. The completion of this operation results in a response containing a list of these URLs, which the client can use to sequentially upload chunks of the large file.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/newMultipartRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/newMultipartRest.js new file mode 100644 index 0000000000..69f19e289f --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/newMultipartRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/newMultipartRest'); +const { schema: xRequest } = require('./schemas/request/newMultipartRest'); + +const openapi = { + summary: 'Handle multipart file upload and initialization process', + description: `This endpoint is designed to handle the multipart file uploading and initialization process. It receives a file from the user and initiates a set of operations to securely store and register the file in the system's storage infrastructure. + +**Authentication:** All users must be authenticated to upload files. A secure session or valid authentication token is required to ensure that the request originates from a legitimate source. + +**Permissions:** Users need the 'upload_file' permission to perform file uploads. This ensures that only users with the appropriate rights can upload files, maintaining system integrity and security. + +The process begins in the \`newMultipartRest\` action, which calls the \`newMultipart\` method in the \`Files\` core. This method orchestrates various tasks such as validating file types, preparing file storage, and interacting with different file storage providers. It delegates specific responsibilities to sub-methods like \`handleCreateFile\`, \`handleFileProvider\`, and \`handleFileSystem\`. These sub-methods manage detailed aspects of file storage, such as creating file database entries, selecting appropriate storage providers based on the configuration, and physically storing the files on disk or cloud storage. The result of this orchestrated process is a JSON object response containing details about the newly uploaded file including its access paths, metadata, and status.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/publicFileRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/publicFileRest.js new file mode 100644 index 0000000000..e97a6b38a7 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/publicFileRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/publicFileRest'); +const { schema: xRequest } = require('./schemas/request/publicFileRest'); + +const openapi = { + summary: 'Provides public access to specific files', + description: `This endpoint allows public access to files specified by a file ID. It is primarily used for cases where files need to be shared with users who do not have authenticated sessions or specific permissions within the platform. + +**Authentication:** No user authentication is required to access the files through this endpoint. This allows for broader accessibility, making it suitable for public sharing scenarios. + +**Permissions:** There are no specific permissions required to use this endpoint. It is designed to be accessed without any user-based restriction, allowing both authenticated and unauthenticated users to retrieve files as long as they have the correct URL or file identifier. + +The handler’s flow begins with extracting the file ID from the incoming request parameters. It then queries the underlying storage system or database using this file ID to locate and retrieve the specified file. If the file is successfully found, it streams the file content back to the client, thereby facilitating the file download or viewing process directly through the client’s browser or download manager. This process bypasses the typical user session verification and permission checks, hence serving the file to any requester with the correct direct link.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/publicFolderRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/publicFolderRest.js new file mode 100644 index 0000000000..f84aee8948 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/publicFolderRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/publicFolderRest'); +const { schema: xRequest } = require('./schemas/request/publicFolderRest'); + +const openapi = { + summary: 'Access and manage public files', + description: `This endpoint enables users to access and manage files within a specified public folder. It allows the retrieval, addition, and updating of files in the public folder based on provided actions and parameters. + +**Authentication:** Users need to be authenticated to interact with public files. The authentication ensures that only authorized users can perform operations on files within the public folder. + +**Permissions:** This endpoint requires users to have specific permissions related to file management. The necessary permissions include reading, writing, and managing public files, depending on the action requested by the user. + +The controller handler starts with the validation of user credentials and permissions. Once authentication and authorization are confirmed, it processes the incoming request to determine the required action (e.g., retrieve, add, or update files). Depending on the action, it interacts with the filesystem or database to perform the respective file operation. The process involves creating, reading, or modifying files within the public folder. Finally, the result of the operation is structured into an appropriate response format and sent back to the user, detailing the outcome of their request.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/abortMultipartRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/abortMultipartRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/abortMultipartRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/coverRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/coverRest.js new file mode 100644 index 0000000000..2c64d62c3d --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/coverRest.js @@ -0,0 +1,19 @@ +// automatic hash: ae2a9e5eed56f435c9d391424ffa7a6133d4ff1d2c94222a19ce2519b0150f94 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + t: { + type: 'string', + minLength: 1, + }, + assetId: { + type: 'string', + minLength: 1, + }, + }, + required: ['t', 'assetId'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/fileRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/fileRest.js new file mode 100644 index 0000000000..0e63f94c9b --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/fileRest.js @@ -0,0 +1,19 @@ +// automatic hash: 23bccef8172cc202f28e3e2bc8f69986668007edeefa56fd00cb3cd5a58c2317 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + authorization: { + type: 'string', + minLength: 1, + }, + id: { + type: 'string', + minLength: 1, + }, + }, + required: ['authorization', 'id'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/finishMultipartRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/finishMultipartRest.js new file mode 100644 index 0000000000..555a08b91e --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/finishMultipartRest.js @@ -0,0 +1,26 @@ +// automatic hash: 72574a093a3235946c38dd3360a27956011f3fc7c27048fc9bdf0533961d425d +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + fileId: { + type: 'string', + minLength: 1, + }, + path: { + type: 'string', + minLength: 1, + }, + etags: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['fileId', 'path', 'etags'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/getUploadChunkUrlsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/getUploadChunkUrlsRest.js new file mode 100644 index 0000000000..6858f94cd5 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/getUploadChunkUrlsRest.js @@ -0,0 +1,22 @@ +// automatic hash: fd6f53523a20c9d52ecbd9901d56b7b8513fe9ab28e217cbf818e60d94617284 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + fileId: { + type: 'string', + minLength: 1, + }, + nChunks: { + type: 'number', + }, + path: { + type: 'string', + minLength: 1, + }, + }, + required: ['fileId', 'nChunks', 'path'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/newMultipartRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/newMultipartRest.js new file mode 100644 index 0000000000..c414441565 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/newMultipartRest.js @@ -0,0 +1,37 @@ +// automatic hash: 2b543ac0ca4d9d5a436af71f7b413425f72e54e93f53ea3d7ea459d12f20bad7 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + name: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + isFolder: { + type: 'boolean', + }, + filePaths: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + pathsInfo: { + type: 'object', + properties: {}, + required: [], + }, + }, + required: ['name', 'type', 'size', 'isFolder', 'filePaths', 'pathsInfo'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/publicFileRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/publicFileRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/publicFileRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/publicFolderRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/publicFolderRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/publicFolderRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/uploadMultipartChunkRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/uploadMultipartChunkRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/request/uploadMultipartChunkRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/abortMultipartRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/abortMultipartRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/abortMultipartRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/coverRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/coverRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/coverRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/fileRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/fileRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/fileRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/finishMultipartRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/finishMultipartRest.js new file mode 100644 index 0000000000..7034a8e6be --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/finishMultipartRest.js @@ -0,0 +1,14 @@ +// automatic hash: 19f574e7100dda5870204615f58e1a193f4ccd51cf6468e87c7b79ec4ba9aa5f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + }, + required: ['status'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/getUploadChunkUrlsRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/getUploadChunkUrlsRest.js new file mode 100644 index 0000000000..d7a366e37a --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/getUploadChunkUrlsRest.js @@ -0,0 +1,21 @@ +// automatic hash: e3385203b8170f68d4a46868181394b34eeac1554279324740c090a0d75c6fe3 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + urls: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['status', 'urls'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/newMultipartRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/newMultipartRest.js new file mode 100644 index 0000000000..2c974854c5 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/newMultipartRest.js @@ -0,0 +1,93 @@ +// automatic hash: d8be033bf9ff035787396589497d2690f74e61429a6bcb51831ee93fbb6e2a98 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + provider: { + type: 'string', + minLength: 1, + }, + type: { + type: 'string', + minLength: 1, + }, + extension: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + size: { + type: 'number', + }, + uri: { + type: 'string', + minLength: 1, + }, + isFolder: { + type: 'boolean', + }, + metadata: { + type: 'string', + minLength: 1, + }, + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + 'status', + 'id', + 'deploymentID', + 'provider', + 'type', + 'extension', + 'name', + 'size', + 'uri', + 'isFolder', + 'metadata', + '_id', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/publicFileRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/publicFileRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/publicFileRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/publicFolderRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/publicFolderRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/publicFolderRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/uploadMultipartChunkRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/uploadMultipartChunkRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/schemas/response/uploadMultipartChunkRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/uploadMultipartChunkRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/uploadMultipartChunkRest.js new file mode 100644 index 0000000000..064628067b --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/file/uploadMultipartChunkRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/uploadMultipartChunkRest'); +const { + schema: xRequest, +} = require('./schemas/request/uploadMultipartChunkRest'); + +const openapi = { + summary: 'Handle chunked file uploads for large files', + description: `This endpoint facilitates the upload of large files in multiple chunks. It is specifically designed to handle cases where a file needs to be uploaded in segments to manage the load and ensure efficient data transfer over the network. + +**Authentication:** Users must be authenticated to perform file uploads. The endpoint verifies the identity of the uploader and ensures that a valid session exists before processing any uploaded content. + +**Permissions:** Users need to have the 'upload_file_chunk' permission. This ensures that only authorized users can initiate and continue chunked uploads, maintaining the security and integrity of the file-handling process. + +Initially, the endpoint invokes the \`uploadMultipartChunk\` method from the \`Files\` service. This method manages the reception of each file chunk, validating its part number and merging it with previous chunks if needed. It uses the \`createTemp\` function to temporarily store incoming chunks, while the \`isReadableStream\` checks if the incoming data stream is readable and not corrupted. Once all chunks have been received and verified, the \`streamToBuffer\` function compiles the chunks into a single file. An acknowledgment of successful upload or an error response detailing any issues during the process is then sent back to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/permissions/schemas/request/setRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/permissions/schemas/request/setRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/permissions/schemas/request/setRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/permissions/schemas/response/setRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/permissions/schemas/response/setRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/permissions/schemas/response/setRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/permissions/setRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/permissions/setRest.js new file mode 100644 index 0000000000..fe4a42645d --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/permissions/setRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/setRest'); +const { schema: xRequest } = require('./schemas/request/setRest'); + +const openapi = { + summary: 'Set permissions for a specific asset or user', + description: `This endpoint handles the setting of permissions for specific assets or users within the system. It allows administrators or authorized users to define who can access or modify certain resources, thereby enhancing control and security over sensitive information or functionalities. + +**Authentication:** Users need to be authenticated to access this endpoint. The presence and validity of an authentication token are crucial for processing the request. + +**Permissions:** This endpoint requires administrative privileges or specific role-based permissions that allow a user to manage and assign permissions within the platform. + +Upon receiving a request, the \`setRest\` action starts by parsing incoming data to identify the target (either an asset or a user) and the desired permissions to be set. It then invokes the \`setPermissions\` method from the permissions core logic, which checks existing permission levels, validates the roles of the involved parties, and applies the new settings accordingly. This process may involve multiple validation layers to ensure only authorized modifications are made. If successful, the method returns a confirmation of the updated permissions, which is then forwarded to the user as the final response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/deleteConfigRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/deleteConfigRest.js new file mode 100644 index 0000000000..60936b2dab --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/deleteConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteConfigRest'); +const { schema: xRequest } = require('./schemas/request/deleteConfigRest'); + +const openapi = { + summary: 'Delete a specific configuration setting', + description: `This endpoint handles the deletion of a specific configuration setting in the system. Given an ID, it will permanently remove the associated configuration from the database. + +**Authentication:** User must be logged in to execute this action. Authentication ensures that only valid and authorized users can delete configuration settings. + +**Permissions:** Specific 'admin' permissions are required to delete configuration settings. Users without the requisite permissions will be denied access to this endpoint. + +Upon receiving a DELETE request, the \`deleteConfigRest\` method first verifies the user's authentication and permissions. After validation, it proceeds to call the internal \`deleteConfigById\` service method, passing the unique configuration ID from the request. This service method interacts with the database to delete the specified configuration setting. If the operation is successful, the endpoint returns a confirmation message stating that the setting has been deleted. In case of errors during processing, appropriate error messages are generated and returned to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/listRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/listRest.js new file mode 100644 index 0000000000..6f1eea8f1a --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'Lists all resources in the Leebrary system', + description: `This endpoint facilitates the retrieval of all available resources stored within the Leebrary system. It filters and presents data based on specific query parameters such as resource type, tags, and user permissions, making it an essential tool for efficient resource management. + +**Authentication:** User authentication is required to access this endpoint. Users must provide a valid token that will be verified to ensure legitimacy and authority over the requested resources. Unauthorized access attempts will be logged and denied. + +**Permissions:** Users need to have the 'read_resources' permission to access the list of resources. This permission checks that the user has the requisite rights to view the resources in their query scope. Lack of required permissions will result in denial of access to the resource data. + +The 'listRest' handler begins by validating the user's authentication status and permissions. Following successful validation, it utilizes the \`getAllResources\` method from the \`ResourceService\`. This method takes into account various filters such as resource type and user-specific tags. It interacts directly with the database to fetch all relevant resources, ensuring all security and privacy guidelines are adhered to. The fetched data is then compiled into a tuple or list and returned in a structured JSON format as the response to the client, effectively encapsulating all accessible resources as per user credentials and query parameters.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/request/deleteConfigRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/request/deleteConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/request/deleteConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/request/listRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/request/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/request/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/request/setConfigRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/request/setConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/request/setConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/response/deleteConfigRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/response/deleteConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/response/deleteConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/response/listRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/response/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/response/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/response/setConfigRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/response/setConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/schemas/response/setConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/setConfigRest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/setConfigRest.js new file mode 100644 index 0000000000..a66a264761 --- /dev/null +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/openapi/providers/setConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/setConfigRest'); +const { schema: xRequest } = require('./schemas/request/setConfigRest'); + +const openapi = { + summary: 'Configures provider settings for the application', + description: `This endpoint is responsible for updating or setting the configuration parameters for a specified provider within the application. It primarily handles the integration settings that are essential for the functionality of external services or APIs used by the application. + +**Authentication:** User authentication is mandatory to ensure that only authorized personnel can alter provider configurations. An absence of valid session or authentication tokens results in access denial. + +**Permissions:** Appropriate permissions must be verified before a user can execute this operation. Typically, administrative or high-level management permissions are required to access and modify provider settings. + +Upon receiving a request, the endpoint first validates the user's authentication and authorization levels. If validation is successful, it proceeds to fetch the necessary data from the request body. The \`setProviderConfig\` method from the \`Settings\` service is then called with this data, updating or establishing the configuration for the chosen provider. The flow concludes with the method either returning a success response indicating that the changes have been applied successfully or an error message detailing why the operation failed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/permissions.rest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/permissions.rest.js index d73153b0a3..ad5de59726 100644 --- a/plugins/leemons-plugin-leebrary/backend/services/rest/permissions.rest.js +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/permissions.rest.js @@ -7,9 +7,11 @@ const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const { set } = require('../../core/permissions/set'); +const setRest = require('./openapi/permissions/setRest'); /** @type {ServiceSchema} */ module.exports = { setRest: { + openapi: setRest.openapi, rest: { method: 'POST', path: '/asset/:asset', diff --git a/plugins/leemons-plugin-leebrary/backend/services/rest/provider.rest.js b/plugins/leemons-plugin-leebrary/backend/services/rest/provider.rest.js index 1be6f1ee0c..11b7ed56c0 100644 --- a/plugins/leemons-plugin-leebrary/backend/services/rest/provider.rest.js +++ b/plugins/leemons-plugin-leebrary/backend/services/rest/provider.rest.js @@ -8,11 +8,17 @@ const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const { list: listProviders } = require('../../core/providers/list'); const { setProviderConfig, setActiveProvider } = require('../../core/settings'); -const { getByName: getProviderByName } = require('../../core/providers/getByName'); +const { + getByName: getProviderByName, +} = require('../../core/providers/getByName'); +const listRest = require('./openapi/providers/listRest'); +const setConfigRest = require('./openapi/providers/setConfigRest'); +const deleteConfigRest = require('./openapi/providers/deleteConfigRest'); /** @type {ServiceSchema} */ module.exports = { listRest: { + openapi: listRest.openapi, rest: { path: '/', method: 'GET', @@ -24,6 +30,7 @@ module.exports = { }, }, setConfigRest: { + openapi: setConfigRest.openapi, rest: { method: 'POST', path: '/config', @@ -51,6 +58,7 @@ module.exports = { }, }, deleteConfigRest: { + openapi: deleteConfigRest.openapi, rest: { path: '/config/delete', method: 'POST', diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js index ceb64638a4..94d2e27e33 100644 --- a/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/menu.rest.js @@ -24,9 +24,17 @@ const { validateUpdateMenuItemFromUser, } = require('../../validations/menu-item'); +const getIfKnowHowToUseRest = require('./openapi/menu/getIfKnowHowToUseRest'); +const setKnowHowToUseRest = require('./openapi/menu/setKnowHowToUseRest'); +const getIfHasPermissionRest = require('./openapi/menu/getIfHasPermissionRest'); +const addCustomForUserRest = require('./openapi/menu/addCustomForUserRest'); +const reOrderCustomUserItemsRest = require('./openapi/menu/reOrderCustomUserItemsRest'); +const removeCustomForUserRest = require('./openapi/menu/removeCustomForUserRest'); +const updateCustomForUserRest = require('./openapi/menu/updateCustomForUserRest'); /** @type {ServiceSchema} */ module.exports = { getIfKnowHowToUseRest: { + openapi: getIfKnowHowToUseRest.openapi, rest: { method: 'GET', path: '/know-how-to-use', @@ -40,6 +48,7 @@ module.exports = { }, }, setKnowHowToUseRest: { + openapi: setKnowHowToUseRest.openapi, rest: { method: 'POST', path: '/know-how-to-use', @@ -53,6 +62,7 @@ module.exports = { }, }, getIfHasPermissionRest: { + openapi: getIfHasPermissionRest.openapi, rest: { method: 'GET', path: '/:menuKey', @@ -64,6 +74,7 @@ module.exports = { }, }, addCustomForUserRest: { + openapi: addCustomForUserRest.openapi, rest: { method: 'POST', path: '/:menuKey/add-item', @@ -78,6 +89,7 @@ module.exports = { }, }, reOrderCustomUserItemsRest: { + openapi: reOrderCustomUserItemsRest.openapi, rest: { method: 'POST', path: '/:menuKey/re-order', @@ -93,6 +105,7 @@ module.exports = { }, }, removeCustomForUserRest: { + openapi: removeCustomForUserRest.openapi, rest: { method: 'DELETE', path: '/:menuKey/:key', @@ -105,6 +118,7 @@ module.exports = { }, }, updateCustomForUserRest: { + openapi: updateCustomForUserRest.openapi, rest: { method: 'POST', path: '/:menuKey/:key', diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/addCustomForUserRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/addCustomForUserRest.js new file mode 100644 index 0000000000..243543d547 --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/addCustomForUserRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addCustomForUserRest'); +const { schema: xRequest } = require('./schemas/request/addCustomForUserRest'); + +const openapi = { + summary: 'Adds a custom menu item for a specific user', + description: `This endpoint allows for the addition of a custom menu item specifically tailored for a user. The process involves creating a unique menu item that does not typically appear in the standard menu configurations. + +**Authentication:** User authentication is mandatory for this endpoint. Users must provide valid credentials to perform this operation, ensuring that only authorized users can add custom menu items. + +**Permissions:** The user must have the 'manage_custom_menus' permission. This permission check ensures that only users with sufficient privileges can modify or add to the menu tailored to user-specific needs. + +The handler initiates by validating the incoming data against a pre-defined schema to ensure all required fields are present and valid. Post-validation, the \`addCustomMenuItemForUser\` method from the \`MenuService\` is invoked with parameters including the user's ID and detailed menu item data. This method handles the logic of integrating the new item into the user's existing menu structure, while also checking for any potential conflicts or duplication issues. Once successfully added, the service returns confirmation of the addition, which is then relayed back to the user through the endpoint's response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/getIfHasPermissionRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/getIfHasPermissionRest.js new file mode 100644 index 0000000000..9063aa888a --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/getIfHasPermissionRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getIfHasPermissionRest'); +const { + schema: xRequest, +} = require('./schemas/request/getIfHasPermissionRest'); + +const openapi = { + summary: 'Checks and retrieves menu details based on user permissions', + description: `This endpoint validates user permissions and retrieves specific menu information if the user has the required access rights. This ensures that menu data is securely distributed among users with valid permissions. + +**Authentication:** The user must be authenticated to access this endpoint. It ensures that only recognized users can perform actions or retrieve information. + +**Permissions:** The user needs specific permissions related to menu access. Without the necessary permissions, the request will be denied, maintaining strict access control. + +Upon receiving a request, the \`getIfHasPermissionRest\` handler in the menu builder plugin first authenticates the user, ensuring that they are logged in and their session is valid. It then checks if the user has the required permissions to view or manage the requested menu. This involves querying a permissions database to verify user rights. If the user has the appropriate permissions, the handler proceeds to retrieve the menu data from the core menu system, leveraging methods defined in '/backend/core/menu/index.js'. The flow involves conditional checks and database interactions to fetch and return the relevant menu information. The final output is formatted and returned as a JSON response containing the menu details, adhering to the requested data structure.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/getIfKnowHowToUseRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/getIfKnowHowToUseRest.js new file mode 100644 index 0000000000..eb54a22dc0 --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/getIfKnowHowToUseRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getIfKnowHowToUseRest'); +const { schema: xRequest } = require('./schemas/request/getIfKnowHowToUseRest'); + +const openapi = { + summary: "Validate user's understanding of REST fundamental concepts", + description: `This endpoint assesses whether the user has adequate knowledge of RESTful concepts and principles. It serves as a preliminary check to advance users to more complex interactions within the application. + +**Authentication:** Users need to authenticate before attempting this validation. Unauthenticated requests are automatically rejected. + +**Permissions:** This endpoint requires the user to have basic user access. Specific roles or privileges are not required beyond standard user access rights. + +Upon invocation, this handler initializes by checking the user's session state to validate successful authentication. It then retrieves the user's profile data to ascertain their role and current status within the application. The process involves verifying if the user has previously passed any basic REST knowledge checks. This is conducted via a query to the user database or a relevant cache. Subsequent to this validation, the endpoint responds with a success or failure message delineating the user's competency in REST principles. If successful, the user may be redirected or granted access to make more complex RESTful requests within the system.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/reOrderCustomUserItemsRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/reOrderCustomUserItemsRest.js new file mode 100644 index 0000000000..bed733bcf1 --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/reOrderCustomUserItemsRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/reOrderCustomUserItemsRest'); +const { + schema: xRequest, +} = require('./schemas/request/reOrderCustomUserItemsRest'); + +const openapi = { + summary: 'Reorders the menu items for a custom user', + description: `This endpoint facilitates the reordering of menu items specifically customized for a user, based on their unique preferences or permissions. The operation adjusts the order of menu items in a list format, ensuring the display order aligns with user- or administrator-defined preferences. + +**Authentication:** Users need to be authenticated to modify the order of menu items. Access to this endpoint requires a valid session or authentication token. + +**Permissions:** Users must have specific role permissions that allow them to rearrange menu items. Typically, this would include administrators or users with role-based access control rights specific to menu configuration. + +The endpoint initiates by processing the passed order configuration, which includes identifying menu items and their new positions as defined in the request. It invokes the \`updateOrder\` method from the \`MenuItemService\`, which handles the reordering logic, interfacing directly with the database to update menu item positions accordingly. This process ensures that the new order is accurately reflected in subsequent menu displays, offering a tailored user interface experience. The response confirms the successful reordering of the menu items.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/removeCustomForUserRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/removeCustomForUserRest.js new file mode 100644 index 0000000000..168c544f3b --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/removeCustomForUserRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/removeCustomForUserRest'); +const { + schema: xRequest, +} = require('./schemas/request/removeCustomForUserRest'); + +const openapi = { + summary: 'Remove custom menu settings for a specific user', + description: `This endpoint removes custom menu settings applied to a specific user, effectively resetting their menu experience to the default settings configured by the system. + +**Authentication:** The user needs to be logged-in to perform this operation. If the user's session is not active or the authentication token is missing, the request will be denied. + +**Permissions:** This operation requires administrative permissions related to menu configuration management. The user must have the 'menu.customize' permission to execute this action. + +The flow of this operation begins with the 'removeCustomForUserRest' method in the 'menu.rest.js' service file. Once invoked, this method first checks for user authentication and permissions. If these checks pass, the method then calls the underlying business logic in the 'menu-item' core module, specifically targeting the remove customization functionality. It manipulates data related to user-specific menu items in the database, ensuring any custom settings are removed. On successful operation, a response indicating successful removal is sent back to the user; otherwise, an error message is generated detailing the failure reason.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/addCustomForUserRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/addCustomForUserRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/addCustomForUserRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/getIfHasPermissionRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/getIfHasPermissionRest.js new file mode 100644 index 0000000000..74b326132e --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/getIfHasPermissionRest.js @@ -0,0 +1,15 @@ +// automatic hash: 0ebeb644df74b6d4fa10c5e7d64c2956c3f964acdcbcca870e6092bee1fb6616 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + menuKey: { + type: 'string', + minLength: 1, + }, + }, + required: ['menuKey'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/getIfKnowHowToUseRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/getIfKnowHowToUseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/getIfKnowHowToUseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/reOrderCustomUserItemsRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/reOrderCustomUserItemsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/reOrderCustomUserItemsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/removeCustomForUserRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/removeCustomForUserRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/removeCustomForUserRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/setKnowHowToUseRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/setKnowHowToUseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/setKnowHowToUseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/updateCustomForUserRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/updateCustomForUserRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/request/updateCustomForUserRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/addCustomForUserRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/addCustomForUserRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/addCustomForUserRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/getIfHasPermissionRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/getIfHasPermissionRest.js new file mode 100644 index 0000000000..f182d8e8e7 --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/getIfHasPermissionRest.js @@ -0,0 +1,21 @@ +// automatic hash: 5225b4a33d8f9806fa6ad6941c2ae01955cda4811ab9acefb592b92f00f33d75 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + menu: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['status', 'menu'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/getIfKnowHowToUseRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/getIfKnowHowToUseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/getIfKnowHowToUseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/reOrderCustomUserItemsRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/reOrderCustomUserItemsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/reOrderCustomUserItemsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/removeCustomForUserRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/removeCustomForUserRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/removeCustomForUserRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/setKnowHowToUseRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/setKnowHowToUseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/setKnowHowToUseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/updateCustomForUserRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/updateCustomForUserRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/schemas/response/updateCustomForUserRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/setKnowHowToUseRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/setKnowHowToUseRest.js new file mode 100644 index 0000000000..e66db2b06e --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/setKnowHowToUseRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/setKnowHowToUseRest'); +const { schema: xRequest } = require('./schemas/request/setKnowHowToUseRest'); + +const openapi = { + summary: "Set user's understanding on using REST APIs", + description: `This endpoint ensures that a specific user has authenticated and acknowledged an understanding of how to utilize REST APIs effectively within the system. It updates user settings or preferences related to API usage. + +**Authentication:** This action requires the user to be logged in. A verification process checks if the incoming request has a valid authentication token associated with an active user session. + +**Permissions:** The user must have the 'api_usage_write' permission to update their REST API usage preferences. Without this permission, the request will be denied, ensuring that only authorized users can make such changes. + +The handler initiates by verifying the user's authentication status using a security middleware that inspects the provided authentication token. Upon successful authentication, the handler then checks if the user possesses the necessary permissions. If all checks are positive, the method \`setKnowHowToUseRest\` from the 'MenuBuilderService' is called with user-specific parameters. This method updates the user's profile or settings indicating their proficiency or preferences in API usage. The response to this operation confirms the successful update of settings, providing a feedback mechanism to the frontend on the status of the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/updateCustomForUserRest.js b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/updateCustomForUserRest.js new file mode 100644 index 0000000000..dad0c7eab9 --- /dev/null +++ b/plugins/leemons-plugin-menu-builder/backend/services/rest/openapi/menu/updateCustomForUserRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/updateCustomForUserRest'); +const { + schema: xRequest, +} = require('./schemas/request/updateCustomForUserRest'); + +const openapi = { + summary: 'Update custom settings for a user menu', + description: `This endpoint allows the modification of custom menu configurations for a specific user, ensuring the user's menu reflects any personalized changes such as order or visibility of menu items. + +**Authentication:** Users need to be authenticated to modify their menu settings. Without proper authentication, the request will not be processed. + +**Permissions:** This action requires the user to have permissions to alter their own menu settings. Typically, this might involve checking if the user has 'manage_menus' or equivalent permission within the system. + +Upon receiving a request, the 'updateCustomForUserRest' handler first validates the incoming data against the schema defined in 'menu-item.js'. It ensures all provided menu item adjustments adhere to the expected formats and values. If validation passes, it proceeds by invoking the \`updateCustomForUser\` method from the 'menu-item' core module. This method is responsible for applying the changes to the database, reflecting the custom user preferences for menu structure. The completion of this database update results in the final response, informing the client about the success or failure of the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/getConfigRest.js b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/getConfigRest.js new file mode 100644 index 0000000000..b3a2e1bce8 --- /dev/null +++ b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/getConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getConfigRest'); +const { schema: xRequest } = require('./schemas/request/getConfigRest'); + +const openapi = { + summary: 'Fetch AWS IoT MQTT configuration settings', + description: `This endpoint retrieves the current configuration settings necessary for establishing a connection to the AWS IoT service via MQTT. These settings are essential for clients that need to communicate securely with IoT devices managed through AWS IoT. + +**Authentication:** Users must be authenticated to access the MQTT configuration settings. An invalid or missing authentication token will prevent access to this endpoint. + +**Permissions:** This endpoint requires users to have 'admin' permissions to access sensitive IoT configuration details. + +The process begins in the \`getConfigRest\` action handler which directly calls the \`getConfig\` method from the \`socket\` core module. This method is responsible for loading and returning the current AWS IoT MQTT configuration, which includes endpoint details, certificates, and keys necessary for secure MQTT communication. The configuration data is then formatted as a JSON object and sent back to the client within the HTTP response body, ensuring that only authorized and properly authenticated users can obtain this sensitive information.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/getCredentialsRest.js b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/getCredentialsRest.js new file mode 100644 index 0000000000..e25f0968fd --- /dev/null +++ b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/getCredentialsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getCredentialsRest'); +const { schema: xRequest } = require('./schemas/request/getCredentialsRest'); + +const openapi = { + summary: 'Generates and retrieves MQTT credentials for a user session', + description: `This endpoint generates and retrieves AWS IoT MQTT credentials for a user's session to securely communicate with MQTT topics. It facilitates secure messaging by integrating with AWS IoT Core for credential handling. + +**Authentication:** User authentication is required to access these MQTT credentials. If authentication fails, the endpoint will not provide any credentials. + +**Permissions:** The user must have permissions for MQTT communication setup in their user profile to access this endpoint. Without the necessary permissions, access to MQTT credentials will be denied. + +The core workflow of the handler begins with the \`createCredentialsForUserSession\` function in the service layer, which is responsible for creating and associating the necessary AWS IoT credentials with the user's current session. This function internally calls \`getEndpointData\` to retrieve data specific to the AWS IoT endpoint, followed by \`createCredentials\` that invokes AWS services to generate the actual credentials. Once credentials are generated, they are sent back to the user in the form of a JSON object, enabling secure MQTT communication for the session.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/request/getConfigRest.js b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/request/getConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/request/getConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/request/getCredentialsRest.js b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/request/getCredentialsRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/request/getCredentialsRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/request/setConfigRest.js b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/request/setConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/request/setConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/response/getConfigRest.js b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/response/getConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/response/getConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/response/getCredentialsRest.js b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/response/getCredentialsRest.js new file mode 100644 index 0000000000..0c0692fefe --- /dev/null +++ b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/response/getCredentialsRest.js @@ -0,0 +1,69 @@ +// automatic hash: 8b862df092cc0fdeb09c7494381480f92e771167efd7d4bab9cdfb71491a7ee7 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + credentials: { + type: 'object', + properties: { + sessionExpiration: { + type: 'object', + properties: {}, + required: [], + }, + connectionConfig: { + type: 'object', + properties: { + host: { + type: 'string', + minLength: 1, + }, + region: { + type: 'string', + minLength: 1, + }, + protocol: { + type: 'string', + minLength: 1, + }, + accessKeyId: { + type: 'string', + minLength: 1, + }, + secretKey: { + type: 'string', + minLength: 1, + }, + sessionToken: { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'host', + 'region', + 'protocol', + 'accessKeyId', + 'secretKey', + 'sessionToken', + ], + }, + topics: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['sessionExpiration', 'connectionConfig', 'topics'], + }, + }, + required: ['status', 'credentials'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/response/setConfigRest.js b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/response/setConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/schemas/response/setConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/setConfigRest.js b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/setConfigRest.js new file mode 100644 index 0000000000..afa63c824b --- /dev/null +++ b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/openapi/socket/setConfigRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/setConfigRest'); +const { schema: xRequest } = require('./schemas/request/setConfigRest'); + +const openapi = { + summary: 'Configure AWS IoT MQTT connection settings', + description: `This endpoint updates the MQTT connection settings for AWS IoT specific to the user's account. It accepts new configuration parameters and applies them to ensure that the MQTT client connects appropriately using the latest credentials and configurations supplied by the user. + +**Authentication:** Users must be authenticated to modify their MQTT connection settings. If the authentication details are incorrect or missing, the request will be rejected. + +**Permissions:** The user must have administrator privileges to update the MQTT connection settings. This ensures that only authorized personnel can make changes that could impact the messaging infrastructure. + +Upon receiving a request, this endpoint first verifies user authentication and checks for administrative permissions. It then calls the \`setConfig\` method in the \`awsClient\` core module, passing the new configuration settings. This method handles the integration with AWS IoT to update the connection parameters based on the inputs. Successful completion of the operation will result in the updated connection settings being applied and a confirmation message being returned to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/socket.rest.js b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/socket.rest.js index ca63077092..035cf50ab1 100644 --- a/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/socket.rest.js +++ b/plugins/leemons-plugin-mqtt-aws-iot/backend/services/rest/socket.rest.js @@ -11,11 +11,19 @@ const { LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); const { LeemonsError } = require('@leemons/error'); -const { createCredentialsForUserSession, setConfig, getConfig } = require('../../core/socket'); +const { + createCredentialsForUserSession, + setConfig, + getConfig, +} = require('../../core/socket'); +const getCredentialsRest = require('./openapi/socket/getCredentialsRest'); +const setConfigRest = require('./openapi/socket/setConfigRest'); +const getConfigRest = require('./openapi/socket/getConfigRest'); /** @type {ServiceSchema} */ module.exports = { getCredentialsRest: { + openapi: getCredentialsRest.openapi, rest: { method: 'GET', path: '/credentials', @@ -27,15 +35,20 @@ module.exports = { }, }, setConfigRest: { + openapi: setConfigRest.openapi, rest: { method: 'POST', path: '/config', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - if (process.env.DISABLE_AUTO_INIT === 'true' && process.env.ENVIRONMENT !== 'local') + if ( + process.env.DISABLE_AUTO_INIT === 'true' && + process.env.ENVIRONMENT !== 'local' + ) throw new LeemonsError(ctx, { - message: 'We are in leemons sass mode, this endpoint is disabled for protection', + message: + 'We are in leemons sass mode, this endpoint is disabled for protection', }); const isSuperAdmin = await ctx.tx.call('users.users.isSuperAdmin', { userId: ctx.meta.userSession.id, @@ -51,15 +64,20 @@ module.exports = { }, }, getConfigRest: { + openapi: getConfigRest.openapi, rest: { method: 'GET', path: '/config', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - if (process.env.DISABLE_AUTO_INIT === 'true' && process.env.ENVIRONMENT !== 'local') + if ( + process.env.DISABLE_AUTO_INIT === 'true' && + process.env.ENVIRONMENT !== 'local' + ) throw new LeemonsError(ctx, { - message: 'We are in leemons sass mode, this endpoint is disabled for protection', + message: + 'We are in leemons sass mode, this endpoint is disabled for protection', }); const isSuperAdmin = await ctx.tx.call('users.users.isSuperAdmin', { userId: ctx.meta.userSession.id, diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/common.rest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/common.rest.js index bc2c68b52c..5f0fb30add 100644 --- a/plugins/leemons-plugin-multilanguage/backend/services/rest/common.rest.js +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/common.rest.js @@ -4,13 +4,21 @@ const { getLocalizations, } = require('../../core/localization/global/getLocalizations/getLocalizations'); +const getLoggedRest = require('./openapi/common/getLoggedRest'); +const getRest = require('./openapi/common/getRest'); +/** @type {ServiceSchema} */ module.exports = { getLoggedRest: { + openapi: getLoggedRest.openapi, rest: { method: 'POST', path: '/logged', }, - middlewares: [LeemonsMiddlewareAuthenticated({ continueEvenThoughYouAreNotLoggedIn: true })], + middlewares: [ + LeemonsMiddlewareAuthenticated({ + continueEvenThoughYouAreNotLoggedIn: true, + }), + ], async handler(ctx) { const { keys, keysStartsWith } = ctx.params; const [locale] = await resolveLocales({ ctx }); @@ -19,6 +27,7 @@ module.exports = { }, }, getRest: { + openapi: getRest.openapi, rest: { method: 'POST', path: '/', diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/locales.rest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/locales.rest.js index e6e48372f6..0ce5826021 100644 --- a/plugins/leemons-plugin-multilanguage/backend/services/rest/locales.rest.js +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/locales.rest.js @@ -2,13 +2,16 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsError } = require('@leemons/error'); const { getAll, add } = require('../../core/locale'); +const addRest = require('./openapi/locales/addRest'); +const listRest = require('./openapi/locales/listRest'); +/** @type {ServiceSchema} */ module.exports = { addRest: { + openapi: addRest.openapi, rest: { method: 'POST', path: '/', @@ -19,11 +22,15 @@ module.exports = { if (locale) return { locale }; return { message: 'Locale already exists' }; } catch (e) { - throw new LeemonsError(ctx, { message: e.message, httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: e.message, + httpStatusCode: 400, + }); } }, }, listRest: { + openapi: listRest.openapi, rest: { method: 'GET', path: '/', @@ -33,7 +40,10 @@ module.exports = { const locales = await getAll({ ctx }); return { locales }; } catch (e) { - throw new LeemonsError(ctx, { message: e.message, httpStatusCode: 400 }); + throw new LeemonsError(ctx, { + message: e.message, + httpStatusCode: 400, + }); } }, }, diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/getLoggedRest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/getLoggedRest.js new file mode 100644 index 0000000000..9a25c54cc3 --- /dev/null +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/getLoggedRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getLoggedRest'); +const { schema: xRequest } = require('./schemas/request/getLoggedRest'); + +const openapi = { + summary: "Retrieve current user's locale settings", + description: `This endpoint provides the locale settings of the currently logged-in user. These settings include language preferences, formatting conventions, and other localization data relevant to the user interface. + +**Authentication:** Users must be authenticated to access their localization settings. Any request without a valid authentication credential will be rejected. + +**Permissions:** The endpoint requires 'view_locale_settings' permission, ensuring that only users with appropriate rights can retrieve their locale information. + +The process begins with the \`getLoggedRest\` method in the \`common.rest.js\` service file. The method first validates the existence of a session or token proving user authentication. Once authenticated, it checks for the required permissions using the Leemon's authorization services. If the checks are successful, the method interacts with the \`getLocaleSettings\` function from the \`users\` core, which extracts and compiles the user's current localization configurations from the database. This compiled data is then formatted and returned in a structured JSON format, echoing the user's locale preferences and settings.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/getRest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/getRest.js new file mode 100644 index 0000000000..f706cf601c --- /dev/null +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Provides multilingual support by managing localization data', + description: `This endpoint manages localization configurations and translations across different languages, ensuring that end-users experience a customizable interface based on their selected language preference. + +**Authentication:** User authentication is mandatory to access this endpoint. Unauthorized access is prevented, and only authenticated sessions will proceed with requests handling. + +**Permissions:** Appropriate permissions need to be granted for users to manipulate localization settings. Users must have the 'manage_localization' permission to update or fetch localization data. + +This endpoint initiates its process by gathering key-value pairs from localization files or databases, which contain translation strings mapped to particular language keys. It uses caching mechanisms to enhance performance by reducing load times during the retrieval of these localizations. Depending on the request details, the \`getLocalizations\`, \`getLocalizationsByKeys\`, or \`getLocalizationsByKeysStartsWith\` functions from the 'globalization' core module are invoked. These functions are responsible for accessing detailed localization data, filtering it based on the provided keys or patterns, and ensuring the data is up-to-date before it is sent back to the client. The final output is then structured in a JSON format, containing the relevant localization data that aligns with the requested language settings.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/schemas/request/getLoggedRest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/schemas/request/getLoggedRest.js new file mode 100644 index 0000000000..a2e842fab9 --- /dev/null +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/schemas/request/getLoggedRest.js @@ -0,0 +1,20 @@ +// automatic hash: 34316773ab751ecc66b0de55dff96a453b5ad5cfce105fe94bf3d189a7dd578a +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + keys: {}, + keysStartsWith: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + locale: {}, + }, + required: ['keysStartsWith'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/schemas/request/getRest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/schemas/request/getRest.js new file mode 100644 index 0000000000..a33a2a7569 --- /dev/null +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/schemas/request/getRest.js @@ -0,0 +1,23 @@ +// automatic hash: ebfa04d21c68df6f18ebce94a5db87559d5bfdc9b4d721232f46c90d70778ae8 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + keys: {}, + keysStartsWith: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + locale: { + type: 'string', + minLength: 1, + }, + }, + required: ['keysStartsWith', 'locale'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/schemas/response/getLoggedRest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/schemas/response/getLoggedRest.js new file mode 100644 index 0000000000..cb53190814 --- /dev/null +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/schemas/response/getLoggedRest.js @@ -0,0 +1,68 @@ +// automatic hash: 4cb5642ea5198cf90816a9430328cb7b63c1b9802b51d1522d12ebc357eae527 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + items: { + type: 'object', + properties: { + 'leebrary.pickerDrawer.header.title': { + type: 'string', + minLength: 1, + }, + 'leebrary.pickerDrawer.tabs.library': { + type: 'string', + minLength: 1, + }, + 'leebrary.pickerDrawer.tabs.new': { + type: 'string', + minLength: 1, + }, + 'leebrary.pickerDrawer.filters.search.label': { + type: 'string', + minLength: 1, + }, + 'leebrary.pickerDrawer.filters.search.placeholder': { + type: 'string', + minLength: 1, + }, + 'leebrary.pickerDrawer.filters.resources.label': { + type: 'string', + minLength: 1, + }, + 'leebrary.pickerDrawer.filters.resources.placeholder': { + type: 'string', + minLength: 1, + }, + 'leebrary.pickerDrawer.filters.mediaType.label': { + type: 'string', + minLength: 1, + }, + 'leebrary.pickerDrawer.filters.mediaType.placeholder': { + type: 'string', + minLength: 1, + }, + 'leebrary.pickerDrawer.filters.mediaType.allTypes': { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'leebrary.pickerDrawer.header.title', + 'leebrary.pickerDrawer.tabs.library', + 'leebrary.pickerDrawer.tabs.new', + 'leebrary.pickerDrawer.filters.search.label', + 'leebrary.pickerDrawer.filters.search.placeholder', + 'leebrary.pickerDrawer.filters.resources.label', + 'leebrary.pickerDrawer.filters.resources.placeholder', + 'leebrary.pickerDrawer.filters.mediaType.label', + 'leebrary.pickerDrawer.filters.mediaType.placeholder', + 'leebrary.pickerDrawer.filters.mediaType.allTypes', + ], + }, + }, + required: ['items'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/schemas/response/getRest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/schemas/response/getRest.js new file mode 100644 index 0000000000..ff704a6661 --- /dev/null +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/common/schemas/response/getRest.js @@ -0,0 +1,1324 @@ +// automatic hash: 56eb498331648a485b4bd12438401a0fec78523931db046139d154cebf64b179 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + items: { + type: 'object', + properties: { + 'client-manager.setup.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.titleAdmin': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.common.labels.selectLanguage': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.common.labels.saveAndNextButton': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.common.labels.saveButton': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.common.labels.nextButton': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.common.labels.backButton': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.common.labels.finishAndStart': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.common.messages.saved': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.common.messages.error': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.label': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.programData': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.nameRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.name': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.image': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.color': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.colorRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.qualificationRules': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.qualificationRulesRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.europeanSystem': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.angloSaxonSystem': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.academicCalendar': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.startOfTheProgram': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.startOfTheProgramRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.endOfTheProgram': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.endOfTheProgramRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.failure': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.pass': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.good': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.veryGood': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.outstanding': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.satisfactory': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.poorAchievements': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.academic-portfolio.fail': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.label': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.subjects': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.teachers': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.newSubject': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.newSubjectInfo': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.presentation': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.subjectName': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.subjectNameRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.numericIDOnly': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.numericID': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.numericIDRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.numericIDAlreadyUsed': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.color': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.colorRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.teacher': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.mainTeacher': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.teacherEmailTable': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.teacherNameTable': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.teacherEmail': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.teacherName': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.teacherSurname': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.teacherBirthday': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.associateTeachers': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.teacherGender': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.save': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.cancel': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.maxInternalIdLength': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.errorCreatingClass': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.schedule': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.scheduleLabel': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.classImage': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.classIcon': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.classSettings': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.virtualRoomUrl': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.invalidUrl': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.addSubject': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.editSubject': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.addTeacher': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.editTeacher': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.newTeacher': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.successSaveSubject': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.successSaveTeacher': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.maxTeachersReached': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.maxSubjectsReached': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.emptyState.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.emptyState.teacher': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.emptyState.teacherCTA': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.emptyState.subject': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.emptyState.subjectCTA': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.emptyState.help': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.classrooms.emptyState.helpCTA': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.label': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.upgradeMessage': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.enrollStudents': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.enrollAll': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.subjects': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.noSubjects': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.noStudentsFound': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.noStudents': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.allSubjects': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.emailAlreadyUsed': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.addStudent': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.editStudent': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.save': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.cancel': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.successSaveStudent': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.studentEmail': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.studentName': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.studentSurname': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.studentBirthday': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.studentEnrolledIn': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.emptyState.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.emptyState.student': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.emptyState.studentCTA': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.emptyState.help': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.enroll.emptyState.helpCTA': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.label': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.steps.organization.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.steps.organization.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.steps.center.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.steps.center.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.steps.program.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.steps.program.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.steps.classrooms.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.steps.classrooms.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.steps.enroll.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.steps.enroll.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.steps.finish.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome.steps.finish.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome_basic.label': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome_basic.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome_basic.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome_basic.steps.organization.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome_basic.steps.organization.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome_basic.steps.center.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome_basic.steps.center.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome_basic.steps.finish.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.welcome_basic.steps.finish.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.label': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.chooseProvider': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.noProviders': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.github': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.defaultOrganizationEmail': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.defaultOrganizationEmailDescription': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.defaultOrganizationEmailRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.error': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.organizationEmail': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.emailRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.mails.emailInvalid': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.languages.label': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.languages.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.languages.required': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.languages.add': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.languages.remove': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.languages.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.languages.intro': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.languages.collaborate': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.languages.defaultLang.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.languages.defaultLang.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.centers.label': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.centers.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.centers.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.centers.noCentersYet': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.centers.noCentersYetDescription': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.centers.noCentersYetButton': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.centers.edit': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.centers.remove': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.centers.actions': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.centers.centersData': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.admins.label': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.admins.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.admins.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.profiles.label': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.profiles.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.profiles.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.profiles.profileList': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.profiles.name': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.profiles.overview': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.profiles.actions': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.profiles.view': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.profiles.addProfile': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.label': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.organizationName': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.organizationNameRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.domainUrlForInstallation': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.domainUrlDescription': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.note': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.hostnameApi': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.hostname': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.hostnameRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.hostnameInvalid': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.lookAndFeel': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.lookAndFeelDescription': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.landscapeLogo': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.squareLogo': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.mainColor': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.superAdminCredentials': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.superAdminCredentialsDescription': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.email': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.emailRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.emailInvalid': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.password': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.phone': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.locale': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.localePlaceholder': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.localeRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.contactName': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.administrativeContactInfo': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.organizationData': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.subdomainRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.subdomainInvalid': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.contactNameRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.subdomainInUse': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.contactEmailRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.contactPhoneRequired': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.subdomain': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.subdomainPlaceholder': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.customization': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.administrativeContactInfoDescription': + { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.useDarkMode': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.menuMainColor': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.menuDrawerColor': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.organization.usePicturesEmptyStates': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.label': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.subscription': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.readyToGo': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.info': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.infoDescription': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.description': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.nextButton': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.organization': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.name': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.contact': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.locale': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.subDomain': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.center': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.timeZone': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.weekStartDay': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.fisicAddress': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.educationalProgram': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.invoiceInfo': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.activateSubscription': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.manageSubscription': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.subscriptionActive': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.subscriptionActiveUsers': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.subscriptionActiveUsersUpdate': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.subscriptionUsage': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.qualificationRules': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.subjects': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.teachers': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.teacher': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.students': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.alert.title': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.alert.step1': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.alert.step2': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.alert.step3': { + type: 'string', + minLength: 1, + }, + 'client-manager.setup.finish.alert.step4': { + type: 'string', + minLength: 1, + }, + }, + required: [ + 'client-manager.setup.title', + 'client-manager.setup.titleAdmin', + 'client-manager.setup.common.labels.selectLanguage', + 'client-manager.setup.common.labels.saveAndNextButton', + 'client-manager.setup.common.labels.saveButton', + 'client-manager.setup.common.labels.nextButton', + 'client-manager.setup.common.labels.backButton', + 'client-manager.setup.common.labels.finishAndStart', + 'client-manager.setup.common.messages.saved', + 'client-manager.setup.common.messages.error', + 'client-manager.setup.academic-portfolio.title', + 'client-manager.setup.academic-portfolio.label', + 'client-manager.setup.academic-portfolio.programData', + 'client-manager.setup.academic-portfolio.nameRequired', + 'client-manager.setup.academic-portfolio.name', + 'client-manager.setup.academic-portfolio.image', + 'client-manager.setup.academic-portfolio.color', + 'client-manager.setup.academic-portfolio.colorRequired', + 'client-manager.setup.academic-portfolio.qualificationRules', + 'client-manager.setup.academic-portfolio.qualificationRulesRequired', + 'client-manager.setup.academic-portfolio.europeanSystem', + 'client-manager.setup.academic-portfolio.angloSaxonSystem', + 'client-manager.setup.academic-portfolio.academicCalendar', + 'client-manager.setup.academic-portfolio.startOfTheProgram', + 'client-manager.setup.academic-portfolio.startOfTheProgramRequired', + 'client-manager.setup.academic-portfolio.endOfTheProgram', + 'client-manager.setup.academic-portfolio.endOfTheProgramRequired', + 'client-manager.setup.academic-portfolio.failure', + 'client-manager.setup.academic-portfolio.pass', + 'client-manager.setup.academic-portfolio.good', + 'client-manager.setup.academic-portfolio.veryGood', + 'client-manager.setup.academic-portfolio.outstanding', + 'client-manager.setup.academic-portfolio.satisfactory', + 'client-manager.setup.academic-portfolio.poorAchievements', + 'client-manager.setup.academic-portfolio.fail', + 'client-manager.setup.classrooms.title', + 'client-manager.setup.classrooms.label', + 'client-manager.setup.classrooms.subjects', + 'client-manager.setup.classrooms.teachers', + 'client-manager.setup.classrooms.newSubject', + 'client-manager.setup.classrooms.newSubjectInfo', + 'client-manager.setup.classrooms.presentation', + 'client-manager.setup.classrooms.subjectName', + 'client-manager.setup.classrooms.subjectNameRequired', + 'client-manager.setup.classrooms.numericIDOnly', + 'client-manager.setup.classrooms.numericID', + 'client-manager.setup.classrooms.numericIDRequired', + 'client-manager.setup.classrooms.numericIDAlreadyUsed', + 'client-manager.setup.classrooms.color', + 'client-manager.setup.classrooms.colorRequired', + 'client-manager.setup.classrooms.teacher', + 'client-manager.setup.classrooms.mainTeacher', + 'client-manager.setup.classrooms.teacherEmailTable', + 'client-manager.setup.classrooms.teacherNameTable', + 'client-manager.setup.classrooms.teacherEmail', + 'client-manager.setup.classrooms.teacherName', + 'client-manager.setup.classrooms.teacherSurname', + 'client-manager.setup.classrooms.teacherBirthday', + 'client-manager.setup.classrooms.associateTeachers', + 'client-manager.setup.classrooms.teacherGender', + 'client-manager.setup.classrooms.save', + 'client-manager.setup.classrooms.cancel', + 'client-manager.setup.classrooms.maxInternalIdLength', + 'client-manager.setup.classrooms.errorCreatingClass', + 'client-manager.setup.classrooms.schedule', + 'client-manager.setup.classrooms.scheduleLabel', + 'client-manager.setup.classrooms.classImage', + 'client-manager.setup.classrooms.classIcon', + 'client-manager.setup.classrooms.classSettings', + 'client-manager.setup.classrooms.virtualRoomUrl', + 'client-manager.setup.classrooms.invalidUrl', + 'client-manager.setup.classrooms.addSubject', + 'client-manager.setup.classrooms.editSubject', + 'client-manager.setup.classrooms.addTeacher', + 'client-manager.setup.classrooms.editTeacher', + 'client-manager.setup.classrooms.newTeacher', + 'client-manager.setup.classrooms.successSaveSubject', + 'client-manager.setup.classrooms.successSaveTeacher', + 'client-manager.setup.classrooms.maxTeachersReached', + 'client-manager.setup.classrooms.maxSubjectsReached', + 'client-manager.setup.classrooms.emptyState.title', + 'client-manager.setup.classrooms.emptyState.teacher', + 'client-manager.setup.classrooms.emptyState.teacherCTA', + 'client-manager.setup.classrooms.emptyState.subject', + 'client-manager.setup.classrooms.emptyState.subjectCTA', + 'client-manager.setup.classrooms.emptyState.help', + 'client-manager.setup.classrooms.emptyState.helpCTA', + 'client-manager.setup.enroll.label', + 'client-manager.setup.enroll.title', + 'client-manager.setup.enroll.upgradeMessage', + 'client-manager.setup.enroll.enrollStudents', + 'client-manager.setup.enroll.enrollAll', + 'client-manager.setup.enroll.subjects', + 'client-manager.setup.enroll.noSubjects', + 'client-manager.setup.enroll.noStudentsFound', + 'client-manager.setup.enroll.noStudents', + 'client-manager.setup.enroll.allSubjects', + 'client-manager.setup.enroll.emailAlreadyUsed', + 'client-manager.setup.enroll.addStudent', + 'client-manager.setup.enroll.editStudent', + 'client-manager.setup.enroll.save', + 'client-manager.setup.enroll.cancel', + 'client-manager.setup.enroll.successSaveStudent', + 'client-manager.setup.enroll.studentEmail', + 'client-manager.setup.enroll.studentName', + 'client-manager.setup.enroll.studentSurname', + 'client-manager.setup.enroll.studentBirthday', + 'client-manager.setup.enroll.studentEnrolledIn', + 'client-manager.setup.enroll.emptyState.title', + 'client-manager.setup.enroll.emptyState.student', + 'client-manager.setup.enroll.emptyState.studentCTA', + 'client-manager.setup.enroll.emptyState.help', + 'client-manager.setup.enroll.emptyState.helpCTA', + 'client-manager.setup.welcome.label', + 'client-manager.setup.welcome.title', + 'client-manager.setup.welcome.description', + 'client-manager.setup.welcome.steps.organization.title', + 'client-manager.setup.welcome.steps.organization.description', + 'client-manager.setup.welcome.steps.center.title', + 'client-manager.setup.welcome.steps.center.description', + 'client-manager.setup.welcome.steps.program.title', + 'client-manager.setup.welcome.steps.program.description', + 'client-manager.setup.welcome.steps.classrooms.title', + 'client-manager.setup.welcome.steps.classrooms.description', + 'client-manager.setup.welcome.steps.enroll.title', + 'client-manager.setup.welcome.steps.enroll.description', + 'client-manager.setup.welcome.steps.finish.title', + 'client-manager.setup.welcome.steps.finish.description', + 'client-manager.setup.welcome_basic.label', + 'client-manager.setup.welcome_basic.title', + 'client-manager.setup.welcome_basic.description', + 'client-manager.setup.welcome_basic.steps.organization.title', + 'client-manager.setup.welcome_basic.steps.organization.description', + 'client-manager.setup.welcome_basic.steps.center.title', + 'client-manager.setup.welcome_basic.steps.center.description', + 'client-manager.setup.welcome_basic.steps.finish.title', + 'client-manager.setup.welcome_basic.steps.finish.description', + 'client-manager.setup.mails.label', + 'client-manager.setup.mails.title', + 'client-manager.setup.mails.description', + 'client-manager.setup.mails.chooseProvider', + 'client-manager.setup.mails.noProviders', + 'client-manager.setup.mails.github', + 'client-manager.setup.mails.defaultOrganizationEmail', + 'client-manager.setup.mails.defaultOrganizationEmailDescription', + 'client-manager.setup.mails.defaultOrganizationEmailRequired', + 'client-manager.setup.mails.error', + 'client-manager.setup.mails.organizationEmail', + 'client-manager.setup.mails.emailRequired', + 'client-manager.setup.mails.emailInvalid', + 'client-manager.setup.languages.label', + 'client-manager.setup.languages.title', + 'client-manager.setup.languages.required', + 'client-manager.setup.languages.add', + 'client-manager.setup.languages.remove', + 'client-manager.setup.languages.description', + 'client-manager.setup.languages.intro', + 'client-manager.setup.languages.collaborate', + 'client-manager.setup.languages.defaultLang.title', + 'client-manager.setup.languages.defaultLang.description', + 'client-manager.setup.centers.label', + 'client-manager.setup.centers.title', + 'client-manager.setup.centers.description', + 'client-manager.setup.centers.noCentersYet', + 'client-manager.setup.centers.noCentersYetDescription', + 'client-manager.setup.centers.noCentersYetButton', + 'client-manager.setup.centers.edit', + 'client-manager.setup.centers.remove', + 'client-manager.setup.centers.actions', + 'client-manager.setup.centers.centersData', + 'client-manager.setup.admins.label', + 'client-manager.setup.admins.title', + 'client-manager.setup.admins.description', + 'client-manager.setup.profiles.label', + 'client-manager.setup.profiles.title', + 'client-manager.setup.profiles.description', + 'client-manager.setup.profiles.profileList', + 'client-manager.setup.profiles.name', + 'client-manager.setup.profiles.overview', + 'client-manager.setup.profiles.actions', + 'client-manager.setup.profiles.view', + 'client-manager.setup.profiles.addProfile', + 'client-manager.setup.organization.label', + 'client-manager.setup.organization.title', + 'client-manager.setup.organization.description', + 'client-manager.setup.organization.organizationName', + 'client-manager.setup.organization.organizationNameRequired', + 'client-manager.setup.organization.domainUrlForInstallation', + 'client-manager.setup.organization.domainUrlDescription', + 'client-manager.setup.organization.note', + 'client-manager.setup.organization.hostnameApi', + 'client-manager.setup.organization.hostname', + 'client-manager.setup.organization.hostnameRequired', + 'client-manager.setup.organization.hostnameInvalid', + 'client-manager.setup.organization.lookAndFeel', + 'client-manager.setup.organization.lookAndFeelDescription', + 'client-manager.setup.organization.landscapeLogo', + 'client-manager.setup.organization.squareLogo', + 'client-manager.setup.organization.mainColor', + 'client-manager.setup.organization.superAdminCredentials', + 'client-manager.setup.organization.superAdminCredentialsDescription', + 'client-manager.setup.organization.email', + 'client-manager.setup.organization.emailRequired', + 'client-manager.setup.organization.emailInvalid', + 'client-manager.setup.organization.password', + 'client-manager.setup.organization.phone', + 'client-manager.setup.organization.locale', + 'client-manager.setup.organization.localePlaceholder', + 'client-manager.setup.organization.localeRequired', + 'client-manager.setup.organization.contactName', + 'client-manager.setup.organization.administrativeContactInfo', + 'client-manager.setup.organization.organizationData', + 'client-manager.setup.organization.subdomainRequired', + 'client-manager.setup.organization.subdomainInvalid', + 'client-manager.setup.organization.contactNameRequired', + 'client-manager.setup.organization.subdomainInUse', + 'client-manager.setup.organization.contactEmailRequired', + 'client-manager.setup.organization.contactPhoneRequired', + 'client-manager.setup.organization.subdomain', + 'client-manager.setup.organization.subdomainPlaceholder', + 'client-manager.setup.organization.customization', + 'client-manager.setup.organization.administrativeContactInfoDescription', + 'client-manager.setup.organization.useDarkMode', + 'client-manager.setup.organization.menuMainColor', + 'client-manager.setup.organization.menuDrawerColor', + 'client-manager.setup.organization.usePicturesEmptyStates', + 'client-manager.setup.finish.label', + 'client-manager.setup.finish.title', + 'client-manager.setup.finish.subscription', + 'client-manager.setup.finish.readyToGo', + 'client-manager.setup.finish.info', + 'client-manager.setup.finish.infoDescription', + 'client-manager.setup.finish.description', + 'client-manager.setup.finish.nextButton', + 'client-manager.setup.finish.organization', + 'client-manager.setup.finish.name', + 'client-manager.setup.finish.contact', + 'client-manager.setup.finish.locale', + 'client-manager.setup.finish.subDomain', + 'client-manager.setup.finish.center', + 'client-manager.setup.finish.timeZone', + 'client-manager.setup.finish.weekStartDay', + 'client-manager.setup.finish.fisicAddress', + 'client-manager.setup.finish.educationalProgram', + 'client-manager.setup.finish.invoiceInfo', + 'client-manager.setup.finish.activateSubscription', + 'client-manager.setup.finish.manageSubscription', + 'client-manager.setup.finish.subscriptionActive', + 'client-manager.setup.finish.subscriptionActiveUsers', + 'client-manager.setup.finish.subscriptionActiveUsersUpdate', + 'client-manager.setup.finish.subscriptionUsage', + 'client-manager.setup.finish.qualificationRules', + 'client-manager.setup.finish.subjects', + 'client-manager.setup.finish.teachers', + 'client-manager.setup.finish.teacher', + 'client-manager.setup.finish.students', + 'client-manager.setup.finish.alert.title', + 'client-manager.setup.finish.alert.step1', + 'client-manager.setup.finish.alert.step2', + 'client-manager.setup.finish.alert.step3', + 'client-manager.setup.finish.alert.step4', + ], + }, + }, + required: ['items'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/addRest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/addRest.js new file mode 100644 index 0000000000..57cd316474 --- /dev/null +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/addRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addRest'); +const { schema: xRequest } = require('./schemas/request/addRest'); + +const openapi = { + summary: 'Manage multilingual locale settings', + description: `This endpoint is responsible for managing locale settings within a multilingual plugin environment. It handles the creation, reading, updating, and deletion of locale configurations, which are essential for supporting multiple languages across the plugin's functionalities. + +**Authentication:** Users need to be authenticated to interact with the locale settings. Depending on the platform configuration, this might require session tokens or other forms of identity verification to proceed. + +**Permissions:** Proper permissions are required to access or modify the locale settings. Typically, users need administrative privileges or must be part of a specific group that has rights to manage language settings and configurations. + +The controller handles requests by determining the needed action (create, read, update, delete) based on the API endpoint accessed and the request method. It utilizes specific methods from the 'locale' core module like \`create\`, \`read\`, \`update\`, and \`delete\`, each tailored to operate with language and regional settings in a database. The input validation is ensured by the 'locale.js' validations file, which checks correctness before processing any data. The endpoint flows involve error handling to manage and respond to any issues during operations, ensuring that feedback regarding the execution is clear and concise. When successful, the endpoint returns a JSON object representing the status and any data relevant to the performed action.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/listRest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/listRest.js new file mode 100644 index 0000000000..400f30aa4f --- /dev/null +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'Lists all available locales for multilingual content management', + description: `This endpoint provides a comprehensive list of all locales supported in the multilingual content management system. It enables clients to retrieve a full array of locale identifiers which are necessary for managing translations and localizations within the platform. + +**Authentication:** Users need to be authenticated to access this list. The endpoint ensures that only authorized users can access language settings, maintaining a secure environment for managing sensitive locale data. + +**Permissions:** Users must possess 'view_locales' permission to access this endpoint. This requirement ensures that only users with adequate privileges can view and manage locales, aligning with the system's security protocols for sensitive data access. + +Upon receiving a request, the \`listRest\` handler initiates the process by invoking the \`listLocales\` method in the core locale management module. This method queries the system's internal database to fetch all active locales. The retrieved data is then formatted appropriately before being sent back to the client. The response includes a structured list of locale identifiers, each associated with its specific language and regional details, formatted as a JSON array. The completion of this method concludes the request-response cycle for this specific endpoint.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/schemas/request/addRest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/schemas/request/addRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/schemas/request/addRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/schemas/request/listRest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/schemas/request/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/schemas/request/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/schemas/response/addRest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/schemas/response/addRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/schemas/response/addRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/schemas/response/listRest.js b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/schemas/response/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-multilanguage/backend/services/rest/openapi/locales/schemas/response/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/addRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/addRest.js new file mode 100644 index 0000000000..2f457b10a6 --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/addRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addRest'); +const { schema: xRequest } = require('./schemas/request/addRest'); + +const openapi = { + summary: 'Add a new academic period', + description: `This endpoint adds a new academic period to the system database. The new period information includes details such as its start and end dates, name, and unique identifier, strategically adding to the academic structure management. + +**Authentication:** User must be authenticated to add a new period. Failure to provide valid credentials will prevent access to this endpoint. + +**Permissions:** The user needs \`manage_periods\` permission to execute this action, ensuring only authorized personnel can modify academic periods. + +The process begins with the endpoint calling the \`addPeriod\` method from the \`periods\` core service. This method first validates the incoming data using the \`validatePeriod\` function to check for correctness and completeness of the period data. After validation, it proceeds to insert the new period data into the database. Upon successful addition, the method returns a success response indicating that the period has been successfully added. This flow ensures the integrity and reliability of the academic period management.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/listRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/listRest.js new file mode 100644 index 0000000000..9e5c4d05f3 --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'List all academic periods', + description: `This endpoint lists all academic periods available within the system, allowing users to view various educational time frames such as semesters, quarters, or other academic sessions. + +**Authentication:** Users need to be authenticated to retrieve the list of periods. Access to this endpoint is denied if authentication credentials are not provided or are invalid. + +**Permissions:** This endpoint requires users to have the 'view_periods' permission. Users without this permission will not be able to access the list of academic periods. + +The method responsible for handling the request starts by invoking the \`listPeriods\` function from the \`periods\` core. This function performs a query to the database to retrieve all the periods recorded in the system. Each period includes details such as the start date, end date, and type of the period. The server processes this data and returns it as a structured list in the response body, ensuring that clients can easily interpret and utilize the information on the academic periods.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/removeRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/removeRest.js new file mode 100644 index 0000000000..8da7c37fc0 --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/removeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeRest'); +const { schema: xRequest } = require('./schemas/request/removeRest'); + +const openapi = { + summary: 'Remove a specific educational period', + description: `This endpoint facilitates the deletion of an educational period from the system database. It is primarily used to manage lifecycle of periods ensuring that obsolete or mistaken entries can be cleaned up efficiently from the platform. + +**Authentication:** Users must be authenticated to perform this action. An invalid or missing authentication token will result in access being denied to this endpoint. + +**Permissions:** Adequate permissions are required to delete periods. Typically, this would necessitate administrative rights or specific role-based permissions that allow manipulation of period-related data. + +Upon receiving a request, this handler invokes the \`removePeriod\` method defined in the \`periods/removePeriod.js\` backend core file. The method uses the period's unique identifier, typically passed through the request parameters, to locate and remove the period from the database. The operation might involve validation checks such as confirming the existence of the period and ensuring that the requesting user has appropriate rights to delete it. Once the deletion is successful, confirmation of the action is sent back to the user, generally in the form of a simple success message or status code indicating that the period has been successfully removed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/request/addRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/request/addRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/request/addRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/request/listRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/request/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/request/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/request/removeRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/request/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/request/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/response/addRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/response/addRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/response/addRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/response/listRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/response/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/response/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/response/removeRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/response/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/periods/schemas/response/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/getRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/getRest.js new file mode 100644 index 0000000000..ae8f10c35a --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Fetch and calculate user scores', + description: `This endpoint is designed to calculate and return scores based on a user's activities within the application. The calculations are to reflect the user's performance and achievements across various metrics defined by the system architecture. + +**Authentication:** This endpoint requires users to be authenticated to ensure that scores are fetched for the rightful owner. Unauthorized access is strictly prohibited, and authentication mechanisms are in place to verify user credentials. + +**Permissions:** The user must have the appropriate permission to view scores. Typically, this includes roles such as student, teacher, or administrator, depending on the implementation specifics of the platform. + +From the initial request, the 'getRest' action utilizes the \`getScores\` method to retrieve all relevant scoring data associated with the user. It processes this information through a series of business logic layers implemented within the \`scores.rest.js\`. Each score component is derived and compiled based on user-specific activities and performance parameters. The data flow includes error handling to manage any inconsistencies or failures in data retrieval. Subsequently, the resolved data is formatted and sent back as a JSON response, providing a complete overview of the user's scores within the application.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/removeRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/removeRest.js new file mode 100644 index 0000000000..73c2a58ad0 --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/removeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeRest'); +const { schema: xRequest } = require('./schemas/request/removeRest'); + +const openapi = { + summary: 'Removes specified score records', + description: `This endpoint handles the deletion of score records from the system. Authorized users can request the removal of specific scores identified by their unique identifiers. The operation ensures that only permissible records are deleted based on user rights and provided identifiers. + +**Authentication:** Users need to be authenticated to issue deletion commands for score records. Unauthenticated requests will be rejected, ensuring that only valid users can perform deletions. + +**Permissions:** The user must have the 'delete_scores' permission assigned to their role. Without this permission, the attempt to delete scores will be denied, ensuring system-wide integrity and access control are maintained. + +Upon receiving a delete request, the 'removeScores' handler in the 'scores.rest.js' service invokes the 'remove' method from the 'ScoresService'. The method uses parameters passed in the request to identify and validate the scores that should be deleted. It checks for user permissions and the existence of the scores in the database. If the validations pass, it proceeds to remove the scores. The process involves database operations to securely delete the records and then confirm the success of the operation to the user through an appropriate HTTP response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/request/getRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/request/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/request/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/request/removeRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/request/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/request/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/request/setRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/request/setRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/request/setRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/response/getRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/response/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/response/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/response/removeRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/response/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/response/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/response/setRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/response/setRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/schemas/response/setRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/setRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/setRest.js new file mode 100644 index 0000000000..eb59437686 --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/scores/setRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/setRest'); +const { schema: xRequest } = require('./schemas/request/setRest'); + +const openapi = { + summary: 'Set academic scores for students', + description: `This endpoint is responsible for setting academic scores for students. It allows the bulk updating of scores across different subjects and terms as defined within the system's academic structures. + +**Authentication:** Users need to be authenticated in order to submit changes to students' scores. Missing or invalid authentication tokens will prevent access to this functionality. + +**Permissions:** This endpoint requires administrative rights or specific educator access to modify students' scores. Permissions are checked at the beginning of the request process to ensure the user possesses the necessary rights to update scores. + +The process of setting scores begins with the \`setScores\` method in the scores service. This method receives a request containing the details of the scores to be updated, including student identifiers, the academic subjects, and the respective scores. It then performs a validation to ensure that all provided data meets the system's requirements and that the user has the right to modify these scores. Upon successful validation, it updates the scores in the database, logging each transaction for audit purposes. Finally, a response is generated and sent back to the client, indicating the status of the update operation, whether it was successful or if there were any errors.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/getRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/getRest.js new file mode 100644 index 0000000000..1a543a5fe9 --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Calculate and retrieve weighted scores for assigned tasks', + description: `This endpoint calculates and retrieves weighted scores for various tasks assigned to users. It processes data according to configured weighting parameters to ensure precise calculation of task performance metrics. + +**Authentication:** Users must be authenticated to access this endpoint. Requests made without proper authentication will be rejected, ensuring that only authorized users can retrieve score data. + +**Permissions:** This endpoint requires users to have specific permissions related to viewing scores. Without sufficient permissions, the request will not be processed, and access will be denied. + +The endpoint begins by invoking the \`getWeights\` method from the \`Weights\` core module. It uses the passed context (ctx), which includes user details and authentication state, to verify permissions and user identity. The method aggregates score data from various sources, relying on predefined weights, which are applied to calculate the final score for each task. The results are then formatted into a response that provides detailed score information, adhering to the strict data protection and privacy guidelines outlined in the user's permissions.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/schemas/request/getRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/schemas/request/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/schemas/request/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/schemas/request/setRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/schemas/request/setRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/schemas/request/setRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/schemas/response/getRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/schemas/response/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/schemas/response/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/schemas/response/setRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/schemas/response/setRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/schemas/response/setRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/setRest.js b/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/setRest.js new file mode 100644 index 0000000000..e5bf5f77bd --- /dev/null +++ b/plugins/leemons-plugin-scores/backend/services/rest/openapi/weights/setRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/setRest'); +const { schema: xRequest } = require('./schemas/request/setRest'); + +const openapi = { + summary: 'Set weight configuration for student assessments', + description: `This endpoint sets or updates the weights associated with different components of student assessments within a given context. Weights determine how various elements contribute to the final calculation of a student's score. + +**Authentication:** User authentication is required to access this endpoint. Unauthenticated requests will be rejected, ensuring that only authorized users can manage weight configurations. + +**Permissions:** The user must have administrative privileges or specific permissions related to score management. Without the necessary permissions, the request will be denied, maintaining strict access control to sensitive operations. + +Upon receiving a request, this endpoint first validates the input data using the \`validateWeight.js\` validator to ensure all provided values are correct and adhere to required formats. If validation fails, the endpoint immediately returns an error response. If validation is successful, the \`setWeight.js\` method in the \`weights\` core is called with the passed data. This method handles the logic of adding or updating weight entries in the database, ensuring data integrity and applying any required business logic. On successful completion, the endpoint returns a success message, and in cases of failure, it provides a detailed error message to help diagnose the issue.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scores/backend/services/rest/periods.rest.js b/plugins/leemons-plugin-scores/backend/services/rest/periods.rest.js index cb5eb6c921..999954eb4b 100644 --- a/plugins/leemons-plugin-scores/backend/services/rest/periods.rest.js +++ b/plugins/leemons-plugin-scores/backend/services/rest/periods.rest.js @@ -8,8 +8,13 @@ const addPeriod = require('../../core/periods/addPeriod'); const listPeriods = require('../../core/periods/listPeriods'); const removePeriod = require('../../core/periods/removePeriod'); +const addRest = require('./openapi/periods/addRest'); +const listRest = require('./openapi/periods/listRest'); +const removeRest = require('./openapi/periods/removeRest'); +/** @type {ServiceSchema} */ module.exports = { addRest: { + openapi: addRest.openapi, rest: { method: 'POST', path: '/', @@ -30,6 +35,7 @@ module.exports = { }, }, listRest: { + openapi: listRest.openapi, rest: { method: 'GET', path: '/', @@ -58,7 +64,10 @@ module.exports = { ); // eslint-disable-next-line no-prototype-builtins if (q.hasOwnProperty('name_$contains')) { - q.name = { $regex: `.*${escapeRegExp(q.name_$contains)}.*`, $options: 'i' }; + q.name = { + $regex: `.*${escapeRegExp(q.name_$contains)}.*`, + $options: 'i', + }; delete q.name_$contains; } const periods = await listPeriods({ ...q, ctx }); @@ -66,6 +75,7 @@ module.exports = { }, }, removeRest: { + openapi: removeRest.openapi, rest: { method: 'DELETE', path: '/:id', @@ -81,7 +91,10 @@ module.exports = { }), ], async handler(ctx) { - const period = await removePeriod({ periodId: parseInt(ctx.params.id, 10), ctx }); + const period = await removePeriod({ + periodId: parseInt(ctx.params.id, 10), + ctx, + }); return { status: 200, period }; }, }, diff --git a/plugins/leemons-plugin-scores/backend/services/rest/scores.rest.js b/plugins/leemons-plugin-scores/backend/services/rest/scores.rest.js index 7bf7bfda28..7765ad8cfb 100644 --- a/plugins/leemons-plugin-scores/backend/services/rest/scores.rest.js +++ b/plugins/leemons-plugin-scores/backend/services/rest/scores.rest.js @@ -4,8 +4,13 @@ const getScores = require('../../core/scores/getScores'); const setScores = require('../../core/scores/setScores'); const removeScores = require('../../core/scores/removeScores'); +const getRest = require('./openapi/scores/getRest'); +const setRest = require('./openapi/scores/setRest'); +const removeRest = require('./openapi/scores/removeRest'); +/** @type {ServiceSchema} */ module.exports = { getRest: { + openapi: getRest.openapi, rest: { method: 'GET', path: '/', @@ -25,6 +30,7 @@ module.exports = { }, }, setRest: { + openapi: setRest.openapi, rest: { method: 'PATCH', path: '/', @@ -44,6 +50,7 @@ module.exports = { }, }, removeRest: { + openapi: removeRest.openapi, rest: { method: 'DELETE', path: '/', diff --git a/plugins/leemons-plugin-scores/backend/services/rest/weights.rest.js b/plugins/leemons-plugin-scores/backend/services/rest/weights.rest.js index 222690e66d..28649a334e 100644 --- a/plugins/leemons-plugin-scores/backend/services/rest/weights.rest.js +++ b/plugins/leemons-plugin-scores/backend/services/rest/weights.rest.js @@ -7,8 +7,12 @@ const getWeights = require('../../core/weights/getWeights'); const { setWeight } = require('../../core/weights'); const { permissionNames } = require('../../config/constants'); +const getRest = require('./openapi/weights/getRest'); +const setRest = require('./openapi/weights/setRest'); +/** @type {ServiceSchema} */ module.exports = { getRest: { + openapi: getRest.openapi, rest: { method: 'GET', path: '/', @@ -32,6 +36,7 @@ module.exports = { }, }, setRest: { + openapi: setRest.openapi, rest: { method: 'PUT', path: '/', @@ -49,7 +54,10 @@ module.exports = { async handler(ctx) { const { weight: weightData, class: classId } = ctx.params; - const weight = await setWeight({ weight: { ...weightData, class: classId }, ctx }); + const weight = await setWeight({ + weight: { ...weightData, class: classId }, + ctx, + }); return { status: 201, weight }; }, diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/assignPackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/assignPackageRest.js new file mode 100644 index 0000000000..ad178094cd --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/assignPackageRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/assignPackageRest'); +const { schema: xRequest } = require('./schemas/request/assignPackageRest'); + +const openapi = { + summary: 'Assign a SCORM package to a user or group', + description: `This endpoint assigns a specific SCORM package to either a user or a group based on the parameters provided. This function is crucial for tailoring learning experiences to different users or groups within the educational platform. + +**Authentication:** Users need to be authenticated to assign SCORM packages. The endpoint checks for a valid session or token before proceeding with the assignment. + +**Permissions:** The user must have 'assign-package' permission to execute this action. Without the appropriate permissions, the request will be rejected, ensuring that only authorized personnel can assign learning materials. + +After authentication and permission checks, the \`assignPackage\` method in \`package.core.js\` is invoked with necessary parameters like package ID and user or group ID. This method interacts with the database to update or create entries that link the SCORM package with the specified users or groups. The process involves several validation steps to ensure the package exists and the user/group IDs are valid. Upon successful assignment, the system logs the action for auditing purposes and returns a success response to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/deletePackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/deletePackageRest.js new file mode 100644 index 0000000000..7aa755371a --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/deletePackageRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deletePackageRest'); +const { schema: xRequest } = require('./schemas/request/deletePackageRest'); + +const openapi = { + summary: 'Delete a specific SCORM package', + description: `This endpoint allows for the deletion of a specific SCORM package from the system. The operation effectively removes the specified package and all related data, ensuring that it is no longer accessible within the platform. + +**Authentication:** Users need to be authenticated to initiate deletion of a SCORM package. Any attempt to access this endpoint without valid authentication credentials will result in access being denied. + +**Permissions:** This endpoint requires the user to have administrative rights or specific permissions to delete SCORM packages. Users without the necessary permissions will be prevented from performing this operation. + +Upon receiving a delete request, the endpoint first verifies the authentication and permission of the requesting user. It then proceeds to call the \`deletePackage\` method from the \`package\` core module. This method handles the business logic for finding and removing the SCORM package from the database. If the specified package is successfully located and deleted, a confirmation is sent back to the user. The process ensures that all traces of the SCORM package are removed securely and efficiently, confirming the successful deletion to the client via an HTTP response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/duplicatePackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/duplicatePackageRest.js new file mode 100644 index 0000000000..b15c2d4509 --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/duplicatePackageRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/duplicatePackageRest'); +const { schema: xRequest } = require('./schemas/request/duplicatePackageRest'); + +const openapi = { + summary: 'Duplicate a specific SCORM package', + description: `This endpoint duplicates a specified SCORM package within the Leemonade platform, making a complete copy of the package while preserving the original's content and settings. + +**Authentication:** Users must be authenticated to perform duplication operations on SCORM packages. Without proper authentication, the request will be denied. + +**Permissions:** Users need to have specific rights to duplicate SCORM packages. Typically, this would include permissions such as 'manage_package' or 'duplicate_package' within their role capabilities. + +The duplication process begins by calling the \`duplicatePackage\` function defined in the 'duplicatePackage.js' file. This function is responsible for taking the original package's data, copying its entire structure, and files, and then saving it as a new entity in the database. The process ensures that all linked assets and dependencies are thoroughly cloned. As the final action, this newly created package instance is returned in the response, concluding the duplication venture.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/getPackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/getPackageRest.js new file mode 100644 index 0000000000..e53fac41de --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/getPackageRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getPackageRest'); +const { schema: xRequest } = require('./schemas/request/getPackageRest'); + +const openapi = { + summary: 'Fetches a specific SCORM package details', + description: `This endpoint retrieves detailed information about a specific SCORM package stored within the system. It focuses on providing comprehensive package data such as metadata, content structure, and user progress if applicable. + +**Authentication:** User authentication is required to access this endpoint. Users need to provide valid credentials to ensure they are authorized to access the package information. + +**Permissions:** Users must have the 'view_package' permission to retrieve SCORM package details. Without this permission, the endpoint will deny access. + +The process begins with the handler in \`package.rest.js\` calling the \`getPackage\` action from the \`Package\` core. This action utilizes parameters sent through the request to identify and retrieve the specific SCORM package from the database. The method leverages several sub-methods to compile the necessary details about the package, ensuring that all relevant information such as version history, content files, and user-specific interactions (if any) are included. Finally, the compiled package data is returned to the user via a structured JSON response, encapsulating all aspects of the SCORM package.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/getSupportedVersionsRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/getSupportedVersionsRest.js new file mode 100644 index 0000000000..11c398bfe8 --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/getSupportedVersionsRest.js @@ -0,0 +1,34 @@ +const { schema } = require('./schemas/response/getSupportedVersionsRest'); +const { + schema: xRequest, +} = require('./schemas/request/getSupportedVersionsRest'); + +const openapi = { + // summary: "Summary", + description: `{ + "summary": "Lists supported SCORM versions", + "description": "This endpoint provides a list of SCORM versions supported by the system. It is primarily used to ensure compatibility between the content packaged in a SCORM format and the platform. + +**Authentication:** User authentication is required to access this endpoint. Access will be denied if the authentication credentials are not provided or are invalid. + +**Permissions:** The user must have 'view' permissions on SCORM content to use this endpoint. Without adequate permissions, the request will be rejected with an appropriate error message. + +The process begins when the \`getSupportedVersionsRest\` action is called, handling the request through the Moleculer framework. This action retrieves an array of supported SCORM versions from the service configuration or a similar data source. Each version in the list represents a SCORM version that is compatible with the platform. The array is then returned in the response, formatted in JSON, showing the versions that the client's content can be validated against." +}`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/savePackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/savePackageRest.js new file mode 100644 index 0000000000..db53122186 --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/savePackageRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/savePackageRest'); +const { schema: xRequest } = require('./schemas/request/savePackageRest'); + +const openapi = { + summary: 'Saves a SCORM package into the system', + description: `This endpoint allows for the uploading and saving of a SCORM package into the platform. It ensures that the package is valid and stores it accordingly, making it accessible for deployment in user courses. + +**Authentication:** Users must be authenticated to perform this operation. The endpoint requires a valid session or an authentication token to proceed with the request. + +**Permissions:** Appropriate permissions are necessary to manage SCORM packages. Users need to have the 'manage_scorm_packages' permission to execute this action. + +Upon receiving the request, the endpoint triggers the \`savePackage\` method in the SCORM package core module. This method takes charge of parsing the uploaded package data, validating its structure against the SCORM specifications, and saving it to the database. If the package meets all the necessary criteria, it is saved, and a success response is returned to the user. In cases where the validation fails, the endpoint responds with an error detailing the encountered issues. The entire process ensures data integrity and alignment with SCORM standards, centralized in a secure and systematic workflow.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/assignPackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/assignPackageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/assignPackageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/deletePackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/deletePackageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/deletePackageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/duplicatePackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/duplicatePackageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/duplicatePackageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/getPackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/getPackageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/getPackageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/getSupportedVersionsRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/getSupportedVersionsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/getSupportedVersionsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/savePackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/savePackageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/savePackageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/sharePackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/sharePackageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/request/sharePackageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/assignPackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/assignPackageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/assignPackageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/deletePackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/deletePackageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/deletePackageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/duplicatePackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/duplicatePackageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/duplicatePackageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/getPackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/getPackageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/getPackageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/getSupportedVersionsRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/getSupportedVersionsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/getSupportedVersionsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/savePackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/savePackageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/savePackageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/sharePackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/sharePackageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/schemas/response/sharePackageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/sharePackageRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/sharePackageRest.js new file mode 100644 index 0000000000..60c36f392f --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/package/sharePackageRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/sharePackageRest'); +const { schema: xRequest } = require('./schemas/request/sharePackageRest'); + +const openapi = { + summary: 'Share a SCORM package with specified users or groups', + description: `This endpoint allows sharing of a SCORM package within the leemonade platform to selected users or groups. The sharing action, facilitated by this controller, makes a specific package available to others for their use in learning or training contexts. + +**Authentication:** Users must be authenticated to share SCORM packages. The action checks for a valid session or authentication token to proceed. + +**Permissions:** Users need to have 'share_package' permission to execute this action. Without this permission, the request will be denied. + +The handler initiates its process by calling the \`sharePackage\` method from the \`package\` core with parameters for user IDs and/or group IDs. This method checks the existence of the package and validates the user's permission to share it. On successful validation, it updates the sharing settings in the database to reflect the new shared status with specified entities. It uses database transactions to ensure that all changes are accurate and consistent. After the sharing settings are successfully updated, it returns a success response indicating that the package has been shared.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/public/schemas/request/serveFileRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/public/schemas/request/serveFileRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/public/schemas/request/serveFileRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/public/schemas/response/serveFileRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/public/schemas/response/serveFileRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/public/schemas/response/serveFileRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/public/serveFileRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/public/serveFileRest.js new file mode 100644 index 0000000000..4cdb168cda --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/public/serveFileRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/serveFileRest'); +const { schema: xRequest } = require('./schemas/request/serveFileRest'); + +const openapi = { + summary: 'Serve SCORM content securely', + description: `This endpoint is responsible for securely delivering SCORM packages to authenticated users. The service ensures that only approved users can access the specific SCORM content, providing a vital layer in content security and compliance with eLearning standards. + +**Authentication:** User authentication is crucial for this endpoint. Users must provide valid credentials to access SCORM content. The service validates these credentials before serving any content, rejecting access attempts with invalid authentication tokens. + +**Permissions:** The access to SCORM content is tightly controlled. Users need specific permissions related to eLearning course access, which are verified during the request handling. Lack of adequate permissions results in access being denied. + +Upon receiving a request, the \`serveFileRest\` handler first checks the user's authentication status and permissions associated with the SCORM content being requested. It utilizes methods such as \`verifyUserAuth\` and \`checkPermissions\` to ensure that these criteria are met. If the user is authenticated and has the necessary permissions, the method then proceeds to fetch the requested SCORM file from the server's secure storage using the \`getSCORMFile\` method. This process involves accessing the filesystem securely to retrieve and serve the content to the user. The response includes the SCORM package data, delivered in a manner that adheres to HTTP and content security protocols.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/getScormAssignationRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/getScormAssignationRest.js new file mode 100644 index 0000000000..4da6ac16a1 --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/getScormAssignationRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getScormAssignationRest'); +const { + schema: xRequest, +} = require('./schemas/request/getScormAssignationRest'); + +const openapi = { + summary: 'Fetch SCORM assignation details for a user', + description: `This endpoint retrieves the SCORM assignation details assigned to a particular user within the leemons platform. Based on the user's unique identification, it finds the relevant SCORM content that has been allocated to them, generally for educational or training purposes. + +**Authentication:** Users need to be authenticated to access this endpoint. Unauthenticated requests are denied, ensuring that access is securely managed. + +**Permissions:** Users must have the 'view_scorm_assignations' permission to view SCORM assignation details. Without this permission, the API will restrict access to the requested resources. + +Upon receiving a request, this endpoint calls the \`getScormAssignation\` method in the backend core process. This method retrieves the SCORM assignment data linked to the user's ID supplied in the request context (\`ctx\`). It efficiently processes the information to ensure that the data concerning SCORM allocations is accurate, handling any exceptions or errors during the data retrieval. Finally, the results are formatted appropriately and sent back to the user, providing clear details of the SCORM assignation in question.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/schemas/request/getScormAssignationRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/schemas/request/getScormAssignationRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/schemas/request/getScormAssignationRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/schemas/request/updateStatusRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/schemas/request/updateStatusRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/schemas/request/updateStatusRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/schemas/response/getScormAssignationRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/schemas/response/getScormAssignationRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/schemas/response/getScormAssignationRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/schemas/response/updateStatusRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/schemas/response/updateStatusRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/schemas/response/updateStatusRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/updateStatusRest.js b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/updateStatusRest.js new file mode 100644 index 0000000000..4da9e5c466 --- /dev/null +++ b/plugins/leemons-plugin-scorm/backend/services/rest/openapi/status/updateStatusRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateStatusRest'); +const { schema: xRequest } = require('./schemas/request/updateStatusRest'); + +const openapi = { + summary: 'Update SCORM package status for a user', + description: `This endpoint enables updating the status of a SCORM package linked to a specific user within the Leemons platform. It changes the state of user progress and interaction with the SCORM content to reflect recent activities or completion status. + +**Authentication:** User authentication is required to access and modify SCORM package status. Users must be logged in with valid credentials to successfully call this endpoint. + +**Permissions:** This endpoint requires that the user has permissions to modify SCORM package statuses, typically granted to educators or administrators who manage e-learning content and tracking. + +Upon receiving a request, the \`updateStatusRest\` handler invokes the \`updateStatus\` method in the \`status\` core service. This method performs several operations: it first validates the user's identity and permissions to ensure they are authorized to update SCORM statuses. It then processes the input data to adjust the relevant user's SCORM status in the database. This process includes error handling to manage possible exceptions such as invalid input or database errors. Finally, the response is formulated to indicate the success or failure of the update operation, along with appropriate status codes.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js b/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js index 3ac3036e86..68cc3ec31c 100644 --- a/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js +++ b/plugins/leemons-plugin-scorm/backend/services/rest/package.rest.js @@ -18,9 +18,17 @@ const { } = require('../../core/package'); const { supportedVersions } = require('../../config/constants'); +const savePackageRest = require('./openapi/package/savePackageRest'); +const duplicatePackageRest = require('./openapi/package/duplicatePackageRest'); +const assignPackageRest = require('./openapi/package/assignPackageRest'); +const sharePackageRest = require('./openapi/package/sharePackageRest'); +const getSupportedVersionsRest = require('./openapi/package/getSupportedVersionsRest'); +const getPackageRest = require('./openapi/package/getPackageRest'); +const deletePackageRest = require('./openapi/package/deletePackageRest'); /** @type {ServiceSchema} */ module.exports = { savePackageRest: { + openapi: savePackageRest.openapi, rest: { method: 'POST', path: '/', @@ -47,6 +55,7 @@ module.exports = { }, }, duplicatePackageRest: { + openapi: duplicatePackageRest.openapi, rest: { method: 'POST', path: '/duplicate', @@ -73,6 +82,7 @@ module.exports = { }, }, assignPackageRest: { + openapi: assignPackageRest.openapi, rest: { method: 'POST', path: '/assign', @@ -99,6 +109,7 @@ module.exports = { }, }, sharePackageRest: { + openapi: sharePackageRest.openapi, rest: { method: 'POST', path: '/share', @@ -117,6 +128,7 @@ module.exports = { }, }, getSupportedVersionsRest: { + openapi: getSupportedVersionsRest.openapi, rest: { method: 'GET', path: '/supported-versions', @@ -129,6 +141,7 @@ module.exports = { }, }, getPackageRest: { + openapi: getPackageRest.openapi, rest: { method: 'GET', path: '/:id', @@ -146,6 +159,7 @@ module.exports = { }, }, deletePackageRest: { + openapi: deletePackageRest.openapi, rest: { method: 'DELETE', path: '/:id', diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/public.rest.js b/plugins/leemons-plugin-scorm/backend/services/rest/public.rest.js index 6cdd1589b7..51aabffe53 100644 --- a/plugins/leemons-plugin-scorm/backend/services/rest/public.rest.js +++ b/plugins/leemons-plugin-scorm/backend/services/rest/public.rest.js @@ -9,9 +9,11 @@ const mime = require('mime-types'); * @typedef {import('moleculer').Context} Context Moleculer's Context */ +const serveFileRest = require('./openapi/public/serveFileRest'); /** @type {ServiceSchema} */ module.exports = { serveFileRest: { + openapi: serveFileRest.openapi, rest: { method: 'GET', path: '/:filePath(.*)', @@ -22,10 +24,14 @@ module.exports = { const publicPath = path.resolve(__dirname, '../../public'); const absolutePath = path.resolve(publicPath, filePath); const relative = path.relative(publicPath, absolutePath); - const isInside = relative && !relative.startsWith('..') && !path.isAbsolute(relative); + const isInside = + relative && !relative.startsWith('..') && !path.isAbsolute(relative); if (!isInside) { - throw new LeemonsError(ctx, { message: 'File not found', httpStatusCode: 404 }); + throw new LeemonsError(ctx, { + message: 'File not found', + httpStatusCode: 404, + }); } else { const readStream = createReadStream(absolutePath); const contentType = mime.lookup(absolutePath); diff --git a/plugins/leemons-plugin-scorm/backend/services/rest/status.rest.js b/plugins/leemons-plugin-scorm/backend/services/rest/status.rest.js index 22466bbf5a..23fa539e18 100644 --- a/plugins/leemons-plugin-scorm/backend/services/rest/status.rest.js +++ b/plugins/leemons-plugin-scorm/backend/services/rest/status.rest.js @@ -16,9 +16,12 @@ const { const updateStatus = require('../../core/status/updateStatus'); const getScormAssignation = require('../../core/status/getScormAssignation'); +const updateStatusRest = require('./openapi/status/updateStatusRest'); +const getScormAssignationRest = require('./openapi/status/getScormAssignationRest'); /** @type {ServiceSchema} */ module.exports = { updateStatusRest: { + openapi: updateStatusRest.openapi, rest: { method: 'PUT', path: '/:instance/:user', @@ -36,6 +39,7 @@ module.exports = { }, }, getScormAssignationRest: { + openapi: getScormAssignationRest.openapi, rest: { method: 'GET', path: '/assignation/:instance/:user', diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/assignments.rest.js b/plugins/leemons-plugin-tasks/backend/services/rest/assignments.rest.js index 5db2ff04c1..c87c917139 100644 --- a/plugins/leemons-plugin-tasks/backend/services/rest/assignments.rest.js +++ b/plugins/leemons-plugin-tasks/backend/services/rest/assignments.rest.js @@ -9,9 +9,13 @@ const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const { LeemonsError } = require('@leemons/error'); const { updateStudent } = require('../../core/assignments/updateStudent'); +const instanceCreateRest = require('./openapi/assignments/instanceCreateRest'); +const instanceGetRest = require('./openapi/assignments/instanceGetRest'); +const studentUpdateRest = require('./openapi/assignments/studentUpdateRest'); /** @type {ServiceSchema} */ module.exports = { instanceCreateRest: { + openapi: instanceCreateRest.openapi, rest: { method: 'POST', path: '/:task/instance', @@ -44,6 +48,7 @@ module.exports = { }, }, instanceGetRest: { + openapi: instanceGetRest.openapi, rest: { method: 'PUT', path: '/instance/:instance', @@ -53,9 +58,12 @@ module.exports = { try { const { instance } = ctx.request.params; - const data = await ctx.tx.call('assignables.instances.getAssignableInstance', { - ids: instance, - }); + const data = await ctx.tx.call( + 'assignables.instances.getAssignableInstance', + { + ids: instance, + } + ); return { status: 200, @@ -70,6 +78,7 @@ module.exports = { }, }, studentUpdateRest: { + openapi: studentUpdateRest.openapi, rest: { method: 'PUT', path: '/instance/:instance/student/:student', @@ -79,7 +88,12 @@ module.exports = { try { const { instance, student, ...body } = ctx.params; - const updated = await updateStudent({ instance, student, ...body, ctx }); + const updated = await updateStudent({ + instance, + student, + ...body, + ctx, + }); return { status: 200, diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/instanceCreateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/instanceCreateRest.js new file mode 100644 index 0000000000..0e6736b639 --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/instanceCreateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/instanceCreateRest'); +const { schema: xRequest } = require('./schemas/request/instanceCreateRest'); + +const openapi = { + summary: 'Create a new assignment instance', + description: `This endpoint is responsible for creating a new assignment instance within a specific course or educational context. It handles the instantiation of assignments based on predefined templates or configurations and assigns them to the intended participants or groups. + +**Authentication:** Users need to be authenticated to create new assignment instances. Access is denied if the user's credentials are not verified. + +**Permissions:** The user must have 'create_assignment' permission within their role to execute this action. Access without sufficient permissions will result in an authorization error. + +Upon receiving a request, the \`instanceCreateRest\` handler first validates the provided input parameters to ensure they meet the necessary schema and logic requirements. It then interacts with the 'Assignments' module to initiate the creation process. The logic includes determining the target group or participants, applying any specific configurations (such as deadlines or unique instructions), and saving the new instance into the system's database. This process might also trigger notifications to inform participants about the new assignment. Once successfully created, the endpoint will respond with the details of the newly created assignment instance, encapsulated within a JSON object.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/instanceGetRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/instanceGetRest.js new file mode 100644 index 0000000000..97153ca270 --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/instanceGetRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/instanceGetRest'); +const { schema: xRequest } = require('./schemas/request/instanceGetRest'); + +const openapi = { + summary: 'Fetches specific task assignment details', + description: `This endpoint fetches details for a specific task assignment based on the provided assignment identifier. It retrieves comprehensive information including the task description, status, assigned users, and any associated deadlines or milestones. + +**Authentication:** Users must be authenticated to request the details of an assignment. Failure to provide a valid authentication token will result in denial of access to this endpoint. + +**Permissions:** Users need to have 'read' permission on the task assignments module to access this endpoint. Without the requisite permissions, the request will be denied, ensuring that only authorized personnel can view sensitive assignment details. + +Upon receiving the request, the endpoint initially verifies the authentication and permission levels of the user from the context provided. If authentication or permission checks fail, an error response is generated. If checks pass, the \`getAssignmentById\` method from the \`Assignments\` service is called with the assignment identifier to fetch the relevant details. This method interacts with the database to retrieve the full information pertaining to the requested assignment, which is then formatted and returned as a JSON object in the response. The entire processing ensures data integrity and security compliance by adhering to the defined access controls.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/request/instanceCreateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/request/instanceCreateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/request/instanceCreateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/request/instanceGetRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/request/instanceGetRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/request/instanceGetRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/request/studentUpdateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/request/studentUpdateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/request/studentUpdateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/response/instanceCreateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/response/instanceCreateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/response/instanceCreateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/response/instanceGetRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/response/instanceGetRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/response/instanceGetRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/response/studentUpdateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/response/studentUpdateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/schemas/response/studentUpdateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/studentUpdateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/studentUpdateRest.js new file mode 100644 index 0000000000..09a0273470 --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/assignments/studentUpdateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/studentUpdateRest'); +const { schema: xRequest } = require('./schemas/request/studentUpdateRest'); + +const openapi = { + summary: 'Updates assignment details for a student', + description: `This endpoint allows for the updating of specific assignment details for a student, typically involving changes in assignment status or submission details tailored to aid in educational management tasks. + +**Authentication:** Users need to be authenticated to update assignment details. This ensures that only registered users can make updates to the assignments. + +**Permissions:** Required permissions include edit or update access rights on assignments, which ensures that only authorized personnel or students themselves are able to modify assignment details. + +Upon receiving a request, this handler calls the \`updateStudent\` method located in 'leemons-plugin-tasks/backend/core/assignments/updateStudent.js'. The method takes in parameters such as the student ID, assignment details, and perhaps any new submission files or status updates. It then processes these updates in the system's database, ensuring all changes adhere to existing educational or organizational policies. The process involves validating the input data, updating the database records, and handling any exceptions or errors that occur during the update. The final output is a successful confirmation of the update or an error message detailing any issues encountered during the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/getRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/getRest.js new file mode 100644 index 0000000000..2c0f3373bc --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Fetch user profiles based on specific criteria', + description: `This endpoint retrieves user profiles according to specific criteria provided. It aims to simplify user management by allowing administrators to view detailed information about user profiles in a filtered manner. + +**Authentication:** Users must be authenticated to access this endpoint. Adequate authentication ensures secure access to the user profile data. + +**Permissions:** Access is restricted to users who have administrative rights or specific permissions to manage user profiles. The required permissions ensure that only authorized personnel can view or modify user profile data. + +The handler for this endpoint begins by calling the \`getProfiles\` method from the \`profiles\` core module. This method processes the request by extracting and validating criteria from the request parameters. After validation, it queries the database to fetch user profiles that match the given criteria. The database transaction is carefully handled to ensure data integrity and security. Upon successful retrieval, the profiles are formatted and returned to the user in JSON format, adhering to the specified data structure guidelines for client-side processing.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/request/getRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/request/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/request/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/request/setManyRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/request/setManyRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/request/setManyRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/request/setRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/request/setRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/request/setRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/response/getRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/response/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/response/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/response/setManyRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/response/setManyRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/response/setManyRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/response/setRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/response/setRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/schemas/response/setRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/setManyRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/setManyRest.js new file mode 100644 index 0000000000..5568800292 --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/setManyRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/setManyRest'); +const { schema: xRequest } = require('./schemas/request/setManyRest'); + +const openapi = { + summary: 'Sets multiple user profiles in a bulk operation', + description: `This endpoint allows for the bulk updating or creation of user profiles within the system. The operation can set multiple profiles simultaneously, handling each one according to the details provided in the request body. + +**Authentication:** User authentication is required to execute this endpoint. Users attempting to access this endpoint without valid authentication will receive an error response indicating that authentication credentials are invalid or not provided. + +**Permissions:** Users need to have appropriate permissions to create or update profiles. Typically, this includes administrative rights or specific profile management permissions granted by the system administrator. + +Initially, the \`setManyRest\` handler in the Moleculer service calls the \`SetMany\` method from the backend’s core profile module. This method parses and validates the incoming data for each profile to be set. It checks for required fields, data integrity, and conformity to the expected format. After validation, it either updates existing profiles or creates new ones in the database, depending on whether the profiles already exist. The operation is transactional, ensuring that all profiles are set successfully or none at all, to maintain data consistency. Each profile's result is tracked, and a detailed summary of the creation or update process for each profile is compiled and returned to the user in a JSON format, indicating success or detailing any errors encountered.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/setRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/setRest.js new file mode 100644 index 0000000000..0ee6d9438b --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/profiles/setRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/setRest'); +const { schema: xRequest } = require('./schemas/request/setRest'); + +const openapi = { + summary: 'Set user profile parameters', + description: `This endpoint allows for the update or creation of a user's profile settings in the system. This function ensures that user preferences and settings are accurately recorded and maintained across sessions. + +**Authentication:** User authentication is mandatory to access and modify profile settings. Without proper authentication, the system denies any operations on profile settings. + +**Permissions:** The user must have the 'edit_profile' permission to update profile settings. Without this permission, the attempt to update or set profile settings will be blocked, ensuring that only authorized users can make changes to their profiles. + +The endpoint works by invoking the \`set\` method in the \`Profiles\` core. This method handles both updating existing profile settings and creating new ones if they do not already exist. The process involves validating the input data against pre-defined schemas and then either updating the existing profile or inserting a new entry into the database. The entire operation is wrapped in transaction controls to ensure data integrity and consistency. After successful execution, the updated settings are returned in the response, providing instant confirmation to the user about the changes.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/enableMenuItemRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/enableMenuItemRest.js new file mode 100644 index 0000000000..2954d4352b --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/enableMenuItemRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/enableMenuItemRest'); +const { schema: xRequest } = require('./schemas/request/enableMenuItemRest'); + +const openapi = { + summary: 'Enables a specific menu item for user interaction', + description: `This endpoint allows the enabling of a specific menu item, making it available for user interaction within the application. The functionality is typically used in dynamic UI configurations where menu items can be conditionally available based on certain system states or user roles. + +**Authentication:** Users need to be authenticated to perform this action. The endpoint ensures that the request contains a valid authentication token, which is verified before proceeding with the menu item enable process. + +**Permissions:** This operation requires administrative permissions. A user must have the 'manage_menus' permission to enable or modify menu items, ensuring that only authorized personnel can make changes to the application’s UI structure. + +The process begins by capturing the menu item identifier from the request parameters. The \`enableMenuItem\` method of the 'MenuService' is then invoked, with necessary checks for user permissions and item existence. Once validated, the method updates the menu item's status to 'enabled' in the database. This change allows the item to be interactively accessible in the user interface, reflecting the updated state. The flow concludes with a confirmation response indicating the successful enabling of the menu item.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/findOneRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/findOneRest.js new file mode 100644 index 0000000000..868d6f1b6c --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/findOneRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/findOneRest'); +const { schema: xRequest } = require('./schemas/request/findOneRest'); + +const openapi = { + summary: 'Retrieves specific task settings based on query criteria', + description: `This endpoint is designed to fetch specific settings for tasks within the system based on provided query criteria. It primarily handles the retrieval of settings that match certain specified conditions, enabling dynamic configuration based on task requirements. + +**Authentication:** Users need to authenticate to access the settings for tasks. Proper authentication ensures that settings are served only to users with valid access rights. + +**Permissions:** The user must possess adequate permissions to view or manage task settings. This typically includes roles such as administrator or task manager, where viewing sensitive configuration details is permitted. + +The handler starts by calling the \`findOne\` method from the \`settings\` core. This method takes request parameters that define the criteria for what settings to retrieve. It executes a query against the database to locate the settings entry that matches the criteria. Once the appropriate settings are found, the method returns these settings to the handler. The handler then formats this data into a response body, converting the settings data into a structured JSON object, which is then sent back to the client. This process allows clients to receive precise configuration details based on their query parameters.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/request/enableMenuItemRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/request/enableMenuItemRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/request/enableMenuItemRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/request/findOneRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/request/findOneRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/request/findOneRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/request/updateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/response/enableMenuItemRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/response/enableMenuItemRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/response/enableMenuItemRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/response/findOneRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/response/findOneRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/response/findOneRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/response/updateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/updateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/updateRest.js new file mode 100644 index 0000000000..098d5b461d --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/settings/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Update task settings', + description: `This endpoint handles the updates to task-specific settings within the leemons platform. It allows modifications to settings related to tasks which could include preferences, configurations, and rules specific to how tasks are managed within the system. + +**Authentication:** Users need to be authenticated to perform updates on the settings. Proper auth tokens must be provided to access this endpoint, otherwise, the request will be rejected. + +**Permissions:** The user must have administrative or relevant task-specific permissions to update settings. Lack of required permissions will result in a denial of access to this endpoint. + +Upon receiving a request, this endpoint first verifies user authentication and permissions. If both checks are passed, it proceeds to invoke the \`updateSettings\` method drawn from the \`Settings\` core module. This method accepts parameters that include the new settings data and identifies which settings need to be updated based on the input provided by the user. The function efficiently updates the required settings in the database and returns confirmation of the updates. A response with success status and any relevant updated settings information is then sent back to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/createRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/createRest.js new file mode 100644 index 0000000000..5a717f9f8a --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/createRest.js @@ -0,0 +1,32 @@ +const { schema } = require('./schemas/response/createRest'); +const { schema: xRequest } = require('./schemas/request/createRest'); + +const openapi = { + // summary: "Summary", + description: `{ + "summary": "Create new task in the system", + "description": "This endpoint is designed for the creation of a new task within the system. It processes user's input to register a new task with specified attributes such as title, description, priority, and due date among others. + +**Authentication:** User authentication is required to access this endpoint. Users must provide valid credentials to be able to submit new tasks. + +**Permissions:** The user must have task creation permissions. Typically, this would be granted to users who are project managers or team leads with rights to manage tasks within their jurisdiction. + +The processing of the \`createRest\` handler involves several steps. Firstly, the handler receives the task data sent by the client, which includes all necessary task attributes. It then verifies the user's authorization and permissions to create a new task. After validation, the \`create\` method from \`tasks.core\` is called, passing the task data and user's details. This method primarily handles the business logic for task registration, which includes data validation, setting default values, and saving the new task to the database. Upon successful database entry, a success response is returned to the user, confirming the task creation along with the details of the newly created task." +}`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/duplicateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/duplicateRest.js new file mode 100644 index 0000000000..60cb6fee3a --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/duplicateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/duplicateRest'); +const { schema: xRequest } = require('./schemas/request/duplicateRest'); + +const openapi = { + summary: 'Duplicates a specific task', + description: `This endpoint is responsible for duplicating an existing task identified by its unique ID. It copies the task details and creates a new task with the same attributes but a new identifier. + +**Authentication:** Users must be logged in to duplicate a task. Requests without valid authentication will be rejected. + +**Permissions:** A user needs to have edit or create permissions on tasks to perform duplication. Without the necessary permissions, the endpoint will deny access to the task duplication functionality. + +The controller initiates the duplication process by calling the \`duplicate\` function from the \`task\` core module. It receives the task ID to be duplicated from the request parameters. The \`duplicate\` function internally handles the task of fetching the existing task data, cloning its details while generating a new task ID, and saving the new task entry in the database. It ensures that all linked items, such as subtasks and attachments, are also duplicated appropriately. Once the duplication is complete, the new task details are returned in the response, signalling successful operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/getRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/getRest.js new file mode 100644 index 0000000000..f6fdc54fa3 --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Retrieves task details based on the provided task identifier', + description: `This endpoint retrieves the specific details of a task identified by its unique identifier. It aims to provide comprehensive information about an individual task, including its status, assigned users, deadlines, and other relevant metadata which are crucial for managing tasks within a project. + +**Authentication:** User must be logged in to access this endpoint. Authentication ensures that the user's session is valid for security purposes. + +**Permissions:** Appropriate permissions are required to access this task's details. These permissions ensure that users are only able to retrieve tasks to which they have been granted explicit access rights. + +Upon receiving a request, this endpoint invokes the \`getTask\` method from the \`tasks\` service, which is responsible for querying the database with the task's unique identifier. The method processes the request by validating the user’s identity and permissions before retrieving the task data. The process involves multiple checks for authentication and authorization to ensure secure and compliant access to the task information. Once validated, the task data is fetched and formatted before being sent back to the user as a JSON object that contains the detailed information about the task.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/publishRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/publishRest.js new file mode 100644 index 0000000000..f9bcfe0cda --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/publishRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/publishRest'); +const { schema: xRequest } = require('./schemas/request/publishRest'); + +const openapi = { + summary: 'Publish a new task within the platform', + description: `This endpoint handles the publication of a new task in the leemons platform. It involves creating task entries in the backend data store and setting up necessary configurations to track and manage these tasks as part of the broader application environment. + +**Authentication:** Users need to be authenticated to utilize this endpoint. The absence of a valid authentication mechanism or session will prevent the user from performing any operations associated with task publication. + +**Permissions:** Proper permissions are required to publish tasks. Users attempting to access this endpoint must possess task creation or management rights as dictated by the leemons platform's security policies. + +Following authentication and permission checks, the \`publishRest\` action invokes the core method \`publishTask\` from the \`tasks\` module, which performs the task data validation, creation, and initial setup. This method ensures that all task data complies with the predefined schemas and handles state tracking from creation to publication. The result of this method is a new task instance that is recorded in the database and configured for tracking and management within the leemons ecosystem. The response back to the client indicates successful task creation and includes details of the newly created task.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/removeRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/removeRest.js new file mode 100644 index 0000000000..9120b71c29 --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/removeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeRest'); +const { schema: xRequest } = require('./schemas/request/removeRest'); + +const openapi = { + summary: 'Remove a specified task', + description: `This endpoint allows for the deletion of a specific task based on the task ID provided. The purpose is to permanently remove a task record from the system, ensuring that all its associated data is also cleared appropriately from the database. + +**Authentication:** Users need to be logged in to perform deletion operations. Authentication is required to ensure that a user can only delete tasks they are authorized to remove. + +**Permissions:** This endpoint requires the user to have task deletion permissions. If the user does not have the appropriate permissions, the request will be denied, ensuring system security and data integrity. + +Upon receiving a deletion request, the \`removeRest\` handler in the \`tasks.rest.js\` file calls the \`remove\` method from the \`task\` core (\`remove.js\`). The method takes the task ID from the request parameters and proceeds to check if the task exists and if the user has the necessary permissions to delete it. If these conditions are met, the task is removed using a database call that specifically targets this entry. Subsequent related data such as task logs or sub-tasks may also be cleared, depending on the system's configuration and relationships defined within the database. The process culminates in a response that confirms the deletion or provides an error message detailing why the task could not be deleted.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/createRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/createRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/createRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/duplicateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/duplicateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/duplicateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/getRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/publishRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/publishRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/publishRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/removeRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/searchRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/searchRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/searchRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/updateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/createRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/createRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/createRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/duplicateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/duplicateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/duplicateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/getRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/publishRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/publishRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/publishRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/removeRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/searchRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/searchRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/searchRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/updateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/searchRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/searchRest.js new file mode 100644 index 0000000000..c8df8dab5a --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/searchRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/searchRest'); +const { schema: xRequest } = require('./schemas/request/searchRest'); + +const openapi = { + summary: 'Searches and retrieves task details based on specified criteria', + description: `This endpoint enables the searching and retrieval of tasks based on multiple filter criteria such as tags, status, or deadlines. It facilitates the efficient management and overview of tasks within the leemons platform, allowing users to quickly locate specific tasks or sets of tasks that meet the queried conditions. + +**Authentication:** Users need to be authenticated to search tasks. Unauthorized access is strictly controlled and any unauthenticated request will be rejected. + +**Permissions:** This endpoint requires that the user has the 'task_view' permission. Users without sufficient permissions will not be able to access task details or carry out searches. + +Upon receiving a search request, the \`searchRest\` handler in \`tasks.rest.js\` interacts with the \`search\` function defined in \`search.js\` within the \`leemons-plugin-tasks\` backend. This function constructs a query based on the provided parameters and executes a database search through the Moleculer data service. The searching mechanism can handle various types of filters simultaneously and integrates complex querying capabilities to accommodate different user needs. Once the search is completed, the tasks that match the criteria are compiled and returned in a structured JSON format, providing a concise and detailed view of each task.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/updateRest.js b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/updateRest.js new file mode 100644 index 0000000000..80f7d52dbd --- /dev/null +++ b/plugins/leemons-plugin-tasks/backend/services/rest/openapi/tasks/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Update a specific task', + description: `This endpoint updates the details of an existing task based on the provided task ID and updates sent in the request body. Only fields specified in the request will be updated, ensuring minimal data manipulation and maintaining data integrity. + +**Authentication:** Users must be authenticated to modify task details. An invalid or missing authentication token will prevent access to this endpoint. + +**Permissions:** Users need to have 'edit_task' permissions to update a task. Without appropriate permissions, the request will be rejected, ensuring strict compliance with user roles and privileges. + +The endpoint begins by invoking the 'updateTask' method from the 'task' core module. This method takes 'ctx' (context) parameter, which includes user authentication information, and 'data' parameter containing fields to be updated. The method checks for user permissions and validates the fields against pre-set criteria to avoid undesirable data updates. Upon successful validation, it interacts with the database to update the specific fields of the task in question. The completion of the action sends a response back with the updated task details, indicating a successful operation or returning an error message in case of failure.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/profiles.rest.js b/plugins/leemons-plugin-tasks/backend/services/rest/profiles.rest.js index 53eaccfec3..c57e593072 100644 --- a/plugins/leemons-plugin-tasks/backend/services/rest/profiles.rest.js +++ b/plugins/leemons-plugin-tasks/backend/services/rest/profiles.rest.js @@ -9,9 +9,13 @@ const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const get = require('../../core/profiles/get'); const set = require('../../core/profiles/set'); +const getRest = require('./openapi/profiles/getRest'); +const setRest = require('./openapi/profiles/setRest'); +const setManyRest = require('./openapi/profiles/setManyRest'); /** @type {ServiceSchema} */ module.exports = { getRest: { + openapi: getRest.openapi, rest: { method: 'GET', path: '/:key', @@ -28,6 +32,7 @@ module.exports = { }, setRest: { + openapi: setRest.openapi, rest: { method: 'POST', path: '/:key', @@ -46,6 +51,7 @@ module.exports = { }, setManyRest: { + openapi: setManyRest.openapi, rest: { method: 'POST', path: '/', @@ -54,7 +60,9 @@ module.exports = { async handler(ctx) { const { profiles } = ctx.params; - await Promise.all(profiles.map(({ profile, key }) => set({ key, profile, ctx }))); + await Promise.all( + profiles.map(({ profile, key }) => set({ key, profile, ctx })) + ); return { status: 200, diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/settings.rest.js b/plugins/leemons-plugin-tasks/backend/services/rest/settings.rest.js index bc7f0eb6c6..42acdcbc44 100644 --- a/plugins/leemons-plugin-tasks/backend/services/rest/settings.rest.js +++ b/plugins/leemons-plugin-tasks/backend/services/rest/settings.rest.js @@ -21,7 +21,9 @@ const getPermissions = (permissionsArr, actions = null) => { (obj, [permission, _actions]) => ({ ...obj, [permission]: { - actions: _actions.includes('admin') ? _actions : ['admin', ..._actions], + actions: _actions.includes('admin') + ? _actions + : ['admin', ..._actions], }, }), {} @@ -34,9 +36,13 @@ const getPermissions = (permissionsArr, actions = null) => { }; }; +const findOneRest = require('./openapi/settings/findOneRest'); +const updateRest = require('./openapi/settings/updateRest'); +const enableMenuItemRest = require('./openapi/settings/enableMenuItemRest'); /** @type {ServiceSchema} */ module.exports = { findOneRest: { + openapi: findOneRest.openapi, rest: { path: '/', method: 'GET', @@ -53,6 +59,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { path: '/', method: 'POST', @@ -86,6 +93,7 @@ module.exports = { }, }, enableMenuItemRest: { + openapi: enableMenuItemRest.openapi, rest: { path: '/enable-menu-item', method: 'POST', diff --git a/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js b/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js index 83004af65e..ae39b99692 100644 --- a/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js +++ b/plugins/leemons-plugin-tasks/backend/services/rest/tasks.rest.js @@ -27,9 +27,17 @@ function parseTaskObject(ctx) { return task; } +const createRest = require('./openapi/tasks/createRest'); +const updateRest = require('./openapi/tasks/updateRest'); +const getRest = require('./openapi/tasks/getRest'); +const duplicateRest = require('./openapi/tasks/duplicateRest'); +const removeRest = require('./openapi/tasks/removeRest'); +const publishRest = require('./openapi/tasks/publishRest'); +const searchRest = require('./openapi/tasks/searchRest'); /** @type {ServiceSchema} */ module.exports = { createRest: { + openapi: createRest.openapi, rest: { method: 'POST', path: '/', @@ -54,6 +62,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { method: 'PUT', path: '/:id', @@ -77,6 +86,7 @@ module.exports = { }, }, getRest: { + openapi: getRest.openapi, rest: { method: 'GET', path: '/:id', @@ -113,6 +123,7 @@ module.exports = { }, }, duplicateRest: { + openapi: duplicateRest.openapi, rest: { method: 'POST', path: '/:id/duplicate', @@ -135,6 +146,7 @@ module.exports = { }, }, removeRest: { + openapi: removeRest.openapi, rest: { method: 'DELETE', path: '/:id', @@ -159,6 +171,7 @@ module.exports = { }, }, publishRest: { + openapi: publishRest.openapi, rest: { method: 'POST', path: '/:id/publish', @@ -183,6 +196,7 @@ module.exports = { }, }, searchRest: { + openapi: searchRest.openapi, rest: { method: 'GET', path: '/search', diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questions/getDetailsRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questions/getDetailsRest.js new file mode 100644 index 0000000000..d2a336c39b --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questions/getDetailsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getDetailsRest'); +const { schema: xRequest } = require('./schemas/request/getDetailsRest'); + +const openapi = { + summary: 'Fetches question details based on provided IDs', + description: `This endpoint retrieves detailed information about a set of questions identified by their unique IDs. The operation is meant to gather detailed data including text, options, and expected answers for these questions, which could be used for assessments or information display purposes. + +**Authentication:** Users need to be authenticated in order to access question details. Unauthenticated requests will be denied access to this endpoint. + +**Permissions:** The endpoint requires users to have the 'view_questions' permission to ensure that only authorized users can fetch question details. Additional checks may be done against each question ID to verify that the user has access to the specific information. + +The endpoint internally calls the \`getByIds\` method provided by the questions core API. This method takes an array of question IDs from the request and executes a query to retrieve their details from the database. Each question's data is then processed to include necessary information such as question text, choices, correct answers, and any additional metadata. The response from the API encapsulates this data in a structured format, responding back to the client with the requested question details in JSON.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questions/schemas/request/getDetailsRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questions/schemas/request/getDetailsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questions/schemas/request/getDetailsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questions/schemas/response/getDetailsRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questions/schemas/response/getDetailsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questions/schemas/response/getDetailsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/deleteQuestionBankRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/deleteQuestionBankRest.js new file mode 100644 index 0000000000..49cf8552c1 --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/deleteQuestionBankRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/deleteQuestionBankRest'); +const { + schema: xRequest, +} = require('./schemas/request/deleteQuestionBankRest'); + +const openapi = { + summary: 'Deletes a specified question bank', + description: `This endpoint allows for the deletion of a specific question bank identified by its unique ID. The action ensures that only authorized users can delete a question bank, preserving the integrity and security of the data. + +**Authentication:** User authentication is required to access this endpoint. Users must supply valid credentials to proceed with the deletion operation. + +**Permissions:** Appropriate permissions are required to delete a question bank. Typically, users need to have administrative rights or specific role-based permissions to perform deletions on question banks. + +The controller initiates the deletion process by verifying the user’s authentication and permissions. If the checks pass, it proceeds to call the \`deleteQuestionBank\` method, passing the unique ID of the question bank as an argument. This method interacts with the database to remove the corresponding entry. Upon successful deletion, the response confirms the removal of the question bank, providing feedback to the requester about the outcome of the operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/getQuestionBankDetailRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/getQuestionBankDetailRest.js new file mode 100644 index 0000000000..fbc021ab75 --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/getQuestionBankDetailRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getQuestionBankDetailRest'); +const { + schema: xRequest, +} = require('./schemas/request/getQuestionBankDetailRest'); + +const openapi = { + summary: 'Retrieve detailed information about a specific question bank', + description: `This endpoint fetches comprehensive details about a particular question bank identified by its unique ID. It provides a deep dive into the question bank's attributes, including associated categories, subjects, and individual questions contained within the bank. + +**Authentication:** Users must be authenticated to access the details of a question bank. Access attempts with invalid or missing authentication tokens will be denied. + +**Permissions:** The user must have the appropriate permissions to view the question bank details. Generally, this includes permissions like 'view_question_bank' or 'manage_question_bank', depending on the implementation specifics of the security policy in place. + +The detailed flow of this controller handler begins with the receipt of the request that includes the question bank ID. The handler invokes the \`getQuestionsBanksDetails\` method from the \`questions-banks\` core module. This method is responsible for querying the database to retrieve all relevant data about the question bank, including meta-data, categories, associated subjects, and questions. Depending on the design, it may also involve additional model handlers to fetch related data from different tables or services. The response is then prepared, encapsulating all the fetched information in a well-structured JSON format, which is returned to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/listQuestionBanksRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/listQuestionBanksRest.js new file mode 100644 index 0000000000..dff299cbdb --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/listQuestionBanksRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listQuestionBanksRest'); +const { schema: xRequest } = require('./schemas/request/listQuestionBanksRest'); + +const openapi = { + summary: 'Lists all question banks available to the user', + description: `This endpoint lists all the question banks that the user has access to, providing essential details for each question bank such as name, description, and related subjects. It is primarily used in educational platforms where question banks play a critical role in organizing quizzes and exams. + +**Authentication:** Users need to be authenticated to view the list of question banks. Unauthorized access requests will be rejected, requiring valid login credentials for access. + +**Permissions:** The user must have the 'view_question_banks' permission to access this endpoint. Additional permissions might be required to view detailed contents of each question bank, depending on the platform's configuration. + +This handler initiates by calling the \`listQuestionsBanks\` method from the \`questions-banks\` core module. This method performs a query to retrieve all question banks that the current user is authorized to view based on their roles and permissions. The logic involves checking user permissions, filtering question banks according to these permissions, and finally compiling the data into a structured format. The response is then formatted to JSON and includes a list of question banks along with relevant attributes like bank ID, name, and description.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/saveQuestionBanksRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/saveQuestionBanksRest.js new file mode 100644 index 0000000000..3e338bfee4 --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/saveQuestionBanksRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveQuestionBanksRest'); +const { schema: xRequest } = require('./schemas/request/saveQuestionBanksRest'); + +const openapi = { + summary: 'Store and manage question banks', + description: `This endpoint allows for the creation or updating of question banks in a centralized repository. It supports operations such as adding new questions, modifying existing questions, and organizing these questions into structured banks that can be used across various tests or assessments. + +**Authentication:** Users need to be authenticated to interact with the question banks. Only authenticated requests will be processed, and unauthorized access attempts will result in a denial of the service. + +**Permissions:** This endpoint requires administrative permissions related to question bank management. Users need specific roles or privileges to create or modify the content of question banks. + +Upon receiving a request, this handler validates the user's authentication and permissions to ensure they are eligible to modify or create question banks. It then proceeds to apply the provided changes to the database, either adding new entries or updating existing ones based on the supplied data. The operation might involve various method calls within the service to handle different aspects of the question bank management, such as validation of input data, enforcement of business rules, and the actual data persistence in the database. The response to the client will confirm the successful execution of the operation or provide error messages detailing any issues encountered during the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/request/deleteQuestionBankRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/request/deleteQuestionBankRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/request/deleteQuestionBankRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/request/getQuestionBankDetailRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/request/getQuestionBankDetailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/request/getQuestionBankDetailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/request/listQuestionBanksRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/request/listQuestionBanksRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/request/listQuestionBanksRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/request/saveQuestionBanksRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/request/saveQuestionBanksRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/request/saveQuestionBanksRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/response/deleteQuestionBankRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/response/deleteQuestionBankRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/response/deleteQuestionBankRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/response/getQuestionBankDetailRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/response/getQuestionBankDetailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/response/getQuestionBankDetailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/response/listQuestionBanksRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/response/listQuestionBanksRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/response/listQuestionBanksRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/response/saveQuestionBanksRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/response/saveQuestionBanksRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/questionsBanks/schemas/response/saveQuestionBanksRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/assignTestRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/assignTestRest.js new file mode 100644 index 0000000000..43da81b7a3 --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/assignTestRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/assignTestRest'); +const { schema: xRequest } = require('./schemas/request/assignTestRest'); + +const openapi = { + summary: 'Assign a specific test to a group or individual users', + description: `This endpoint assigns a specific test to either a group of users or individual users based on the criteria specified in the request. The assignment involves mapping a test instance to the specified users or groups, enabling them to access and complete the test within a set timeframe. + +**Authentication:** Users need to be authenticated to perform this operation. Proper authentication ensures that only authorized users can assign tests. + +**Permissions:** This endpoint requires the user to have administrative or teacher-level permissions, specifically the rights to manage and assign tests within the system. + +Upon receiving the request, the \`assignTestRest\` handler first validates the user's authentication status and permissions. If the user is authenticated and has the necessary permissions, the handler proceeds to parse the input parameters which include the test ID and the identifiers for users or groups. The logic then interacts with the \`assignTest\` method in the backend's core test module, which handles the assignment logic, including the verification of test existence and user/group eligibility. The method updates the database entries to reflect the new assignments and returns a success response if the assignments are made successfully, or an appropriate error message otherwise.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/deleteAssignConfigRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/deleteAssignConfigRest.js new file mode 100644 index 0000000000..5343bcb0a0 --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/deleteAssignConfigRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/deleteAssignConfigRest'); +const { + schema: xRequest, +} = require('./schemas/request/deleteAssignConfigRest'); + +const openapi = { + summary: 'Deletes assigned configuration data', + description: `This endpoint handles the removal of specific configuration data assigned to a user or a certain system function within the platform. It specifically looks for configurations that have been previously saved and are no longer required or valid, ensuring the system's data integrity and customization relevance are maintained. + +**Authentication:** Users need to be authenticated to perform deletion operations on configurations. Failure to provide valid authentication credentials will prevent access to this functionality. + +**Permissions:** The endpoint requires administrative rights or specific role-based permissions, designed to ensure that only authorized personnel can delete sensitive configuration data. + +Upon receiving a delete request, the \`deleteAssignConfigRest\` action within the \`tests.rest.js\` file initiates the process by verifying user credentials and permissions. It then calls the \`deleteAssignSavedConfig\` method from the backend's core logic, passing necessary parameters such as configuration identifiers. This method interacts with the backend database or configuration storage to effectively remove the designated entries. The process is logged for auditing purposes, and upon successful completion, a confirmation response is sent back to the user indicating the successful deletion of the configuration data.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/deleteTestRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/deleteTestRest.js new file mode 100644 index 0000000000..29738181da --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/deleteTestRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteTestRest'); +const { schema: xRequest } = require('./schemas/request/deleteTestRest'); + +const openapi = { + summary: 'Deletes a specific test', + description: `This endpoint allows for the deletion of a specific test identified by its unique ID. The deletion process permanently removes the test from the system, including all associated data. + +**Authentication:** User authentication is required to ensure that only authorized users can delete tests. A verification process checks whether the provided user credentials match with an existing user session. + +**Permissions:** The user must have 'delete_tests' permission to execute this action. If the user lacks this permission, the request is denied with an appropriate error message. + +Upon receiving the delete request, the \`deleteTest\` action in the \`tests.rest.js\` file gets triggered. This action starts by verifying the user's authentication status and permissions. If authentication or permissions checks fail, it immediately returns a response indicating the lack of authorization. If checks pass, the action calls the \`deleteTestById\` method from the \`tests\` core module. This method executes a database query to remove the test based on the provided ID. The completion of this operation models the final response where the success or failure of the deletion is communicated back to the client.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/duplicateRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/duplicateRest.js new file mode 100644 index 0000000000..5ac1587329 --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/duplicateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/duplicateRest'); +const { schema: xRequest } = require('./schemas/request/duplicateRest'); + +const openapi = { + summary: 'Duplicate a specific test configuration', + description: `This endpoint allows for the duplication of a specific test configuration within the system. Cloning the details and setups of the chosen test to create a new, identical entry under a new identifier. + +**Authentication:** User authentication is required to access this duplication feature. Users must be logged into their accounts to initiate the duplication process. + +**Permissions:** Adequate permissions must be granted for users to be able to duplicate test configurations. Typically, this includes permissions to read and create tests within the system. + +Upon receiving a request, the \`duplicateTest\` action in the \`Tests\` service is invoked with necessary parameters such as the test identifier. This action uses a method to fetch all data related to the original test from the database, then creates a new test entry by copying all fetched details. Post duplication, a new unique test ID is generated for the newly created test, ensuring no conflicts with existing entries. The flow completes with a response to the client including the details of the newly duplicated test, encapsulated within a standardized format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/getAssignConfigsRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/getAssignConfigsRest.js new file mode 100644 index 0000000000..56b2d6778a --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/getAssignConfigsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getAssignConfigsRest'); +const { schema: xRequest } = require('./schemas/request/getAssignConfigsRest'); + +const openapi = { + summary: 'Assigns saved configurations to a user or entity', + description: `This endpoint is responsible for associating saved configurations with a specific user or entity based on provided criteria. The functionality ensures that personalized settings or preferences are retained and applied as needed across different sessions or interactions. + +**Authentication:** User authentication is mandatory to ensure that the assignment of configurations is secure and specific to an authorized user. Unauthorized access or unauthenticated requests are systematically rejected. + +**Permissions:** The user must have the appropriate permissions to modify or assign configurations. This typically includes administrative rights or specific role-based permissions that allow for configuration management. + +The handler begins by extracting necessary parameters from the request, such as user or entity identifiers and the specific configuration details to be applied. It then invokes a method from the configuration management service to validate the existence and appropriateness of the configurations for assignment. Following validation, the configurations are applied to the intended user or entity. The process involves database transactions to ensure that the changes are persistently stored and retrievable in future sessions. Once successfully applied, the service constructs and sends a response back to the client, confirming the successful assignment of the configurations.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/getInstanceFeedbackRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/getInstanceFeedbackRest.js new file mode 100644 index 0000000000..28f68e2f39 --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/getInstanceFeedbackRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getInstanceFeedbackRest'); +const { + schema: xRequest, +} = require('./schemas/request/getInstanceFeedbackRest'); + +const openapi = { + summary: 'Retrieve user-specific feedback for an instance', + description: `This endpoint is designed to fetch feedback about a specific instance that pertains to the user. The feedback may include performance metrics, user's responses, and general comments about the instance's completion. + +**Authentication:** Users must be authenticated to access the feedback related to the instances they are involved with. The endpoint requires a valid session token to ensure that the feedback provided is specific to the requesting user's account. + +**Permissions:** The user needs to have 'view_feedback' permission to retrieve information on this endpoint. Without the appropriate permissions, the server will reject the request indicating insufficient permissions. + +Upon receiving a request, the handler first verifies the user's credentials and permissions using middleware components that check for a valid session and proper permission flags. It then proceeds to call a service method 'getInstanceFeedback' from the core logic layer, which queries the database for detailed feedback linked to the user and the specified instance. The data workflow involves gathering comprehensive feedback details, processing them as necessary, and returning them to the user, formatted suitably for easy interpretation. The final output is delivered as a JSON object containing structured feedback data.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/getTestRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/getTestRest.js new file mode 100644 index 0000000000..6437a021ca --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/getTestRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getTestRest'); +const { schema: xRequest } = require('./schemas/request/getTestRest'); + +const openapi = { + summary: 'Fetch detailed test information based on test ID', + description: `This endpoint retrieves detailed information about a specific test by its unique identifier. It is primarily used to obtain all relevant details required by the frontend to display or process a particular test. + +**Authentication:** Users need to be authenticated to request test details to ensure that the information is secure and only accessible to users within the permitted roles or access rights. + +**Permissions:** This endpoint requires the user to have 'view_tests' permission. Without this permission, the user's request to access test details will be denied, safeguarding sensitive test information. + +Upon receiving a request, the handler first verifies that the user is authenticated and has the necessary permissions. If these conditions are met, the handler calls a service method specifically designed to fetch test data from the database using the provided test ID. This method incorporates business logic to handle different scenarios such as test availability or access rights. Finally, the processed data, which includes complete test details such as questions, configurations, and metadata, is returned to the user formatted as a JSON object.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/getUserQuestionResponsesRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/getUserQuestionResponsesRest.js new file mode 100644 index 0000000000..31bcddc24b --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/getUserQuestionResponsesRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getUserQuestionResponsesRest'); +const { + schema: xRequest, +} = require('./schemas/request/getUserQuestionResponsesRest'); + +const openapi = { + summary: 'Fetches user-specific question responses', + description: `This endpoint fetches responses to questions that have been submitted by a specific user in the system. It aggregates responses across different assessments or tests where the user participated, providing a comprehensive view of the user's interactions and answers. + +**Authentication:** User authentication is strictly required to access this endpoint. Users must provide a valid authentication token which is verified for integrity and validity before processing the request. + +**Permissions:** This endpoint requires the user to have specific permissions related to viewing test responses. Typically, permissions such as \`view_tests\` or \`view_user_responses\` are checked to ensure authorized access. + +Upon receiving a request, the handler first validates the user's authentication status and permissions. If either check fails, an error response is returned. Otherwise, it proceeds to invoke the \`getUserQuestionResponses\` method from the tests core logic. This method compiles data related to the user's question responses by querying the database for entries that match the user's ID across various tests. The resulting data set, formatted as JSON, details the questions, their corresponding responses made by the user, and contextual details like the date of the test and the labels associated with each question. The response is then structured and sent back to the user, providing a clear and detailed overview of their test interactions.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/listTestsRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/listTestsRest.js new file mode 100644 index 0000000000..b650795d53 --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/listTestsRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listTestsRest'); +const { schema: xRequest } = require('./schemas/request/listTestsRest'); + +const openapi = { + summary: 'List all tests available to the user', + description: `This endpoint retrieves all test configurations available to the currently authenticated user. The retrieved information includes details such as the test name, description, and associated subjects. + +**Authentication:** Users need to be logged in to access this endpoint. An invalid or missing authentication token will result in access being denied. + +**Permissions:** Users need to have 'view tests' permission to retrieve the list of available tests. If the user does not have the required permissions, access to the test data is denied. + +The endpoint initializes by calling the \`listTests\` method from the \`Tests\` core service, which validates the user's credentials and permissions. If authentication and authorization are validated, the method queries the database for tests that the user is permitted to access based on the roles and permissions associated with their account. The data retrieved includes essential test details necessary for users to manage or partake in tests. Finally, the data is formatted and sent back to the user as a JSON response, containing an array of test objects.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/saveTestRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/saveTestRest.js new file mode 100644 index 0000000000..8e19110c49 --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/saveTestRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/saveTestRest'); +const { schema: xRequest } = require('./schemas/request/saveTestRest'); + +const openapi = { + summary: 'Saves a new test configuration', + description: `This endpoint is responsible for saving a test configuration to the database. It allows the client to store all necessary details about a test including its structure, associated questions, and metadata. + +**Authentication:** Users must be authenticated to save a test configuration. This action ensures that only authorized users can create or modify tests. + +**Permissions:** The endpoint requires administrative or specific module-related permissions to ensure that only users with the right to create or edit tests can perform this operation. + +Upon receiving the API call, the \`saveTestRest\` handler initially validates the input to ensure it contains valid and complete test details. It then utilizes the \`saveTest\` method from the core \`tests\` service. This method involves a series of processes including the validation of allowed fields, association of the test with the appropriate user context, and the insertion of the test into the database. If successful, the saved test details are returned in the response, along with a confirmation message. Error handling is implemented to catch and return any issues that might arise during the process, such as validation failures or database errors.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/assignTestRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/assignTestRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/assignTestRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/deleteAssignConfigRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/deleteAssignConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/deleteAssignConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/deleteTestRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/deleteTestRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/deleteTestRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/duplicateRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/duplicateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/duplicateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/getAssignConfigsRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/getAssignConfigsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/getAssignConfigsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/getInstanceFeedbackRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/getInstanceFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/getInstanceFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/getTestRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/getTestRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/getTestRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/getUserQuestionResponsesRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/getUserQuestionResponsesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/getUserQuestionResponsesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/listTestsRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/listTestsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/listTestsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/saveTestRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/saveTestRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/saveTestRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/setInstanceFeedbackRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/setInstanceFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/setInstanceFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/setInstanceTimestampRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/setInstanceTimestampRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/setInstanceTimestampRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/setQuestionResponseRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/setQuestionResponseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/setQuestionResponseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/updateAssignConfigRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/updateAssignConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/request/updateAssignConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/assignTestRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/assignTestRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/assignTestRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/deleteAssignConfigRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/deleteAssignConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/deleteAssignConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/deleteTestRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/deleteTestRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/deleteTestRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/duplicateRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/duplicateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/duplicateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/getAssignConfigsRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/getAssignConfigsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/getAssignConfigsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/getInstanceFeedbackRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/getInstanceFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/getInstanceFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/getTestRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/getTestRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/getTestRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/getUserQuestionResponsesRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/getUserQuestionResponsesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/getUserQuestionResponsesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/listTestsRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/listTestsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/listTestsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/saveTestRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/saveTestRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/saveTestRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/setInstanceFeedbackRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/setInstanceFeedbackRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/setInstanceFeedbackRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/setInstanceTimestampRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/setInstanceTimestampRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/setInstanceTimestampRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/setQuestionResponseRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/setQuestionResponseRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/setQuestionResponseRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/updateAssignConfigRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/updateAssignConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/schemas/response/updateAssignConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/setInstanceFeedbackRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/setInstanceFeedbackRest.js new file mode 100644 index 0000000000..05ab88c087 --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/setInstanceFeedbackRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/setInstanceFeedbackRest'); +const { + schema: xRequest, +} = require('./schemas/request/setInstanceFeedbackRest'); + +const openapi = { + summary: 'Set feedback for a test instance', + description: `This endpoint allows setting user-specific feedback for a particular test instance. The feedback can include comments, scores, or any formative feedback aimed to be shown to the user after completing the test. + +**Authentication:** Users must be authenticated to submit feedback. Lack of proper authentication will prevent access to this functionality. + +**Permissions:** The user needs to have 'edit-feedback' permission for the specific test instance to submit or update feedback. + +This operation begins by decoding and verifying the user's authentication token to ensure validity and current session activity. Upon successful authentication, the method checks if the authenticated user has the required permission 'edit-feedback' for the test instance in question. If the permission checks succeed, the feedback data provided in the request body is processed and saved into the database linked to the specific test instance. The feedback storage is handled by a dedicated service method within the Moleculer service, which ensures the data integrity and provides error handling in case of database issues. Once successfully stored, the API returns a success message to the client, indicating that the feedback has been set.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/setInstanceTimestampRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/setInstanceTimestampRest.js new file mode 100644 index 0000000000..5d440f72f3 --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/setInstanceTimestampRest.js @@ -0,0 +1,32 @@ +const { schema } = require('./schemas/response/setInstanceTimestampRest'); +const { + schema: xRequest, +} = require('./schemas/request/setInstanceTimestampRest'); + +const openapi = { + summary: + 'Sets the current instance timestamp for a specific test configuration', + description: `This endpoint updates the timestamp for a test instance in the test configuration database. This operation is crucial for tracking and logging purposes, specifically for identifying when certain test activities occurred. + +**Authentication:** Users must be authenticated to update a test instance timestamp. Authentication ensures that only authorized personnel can make such updates to maintain test integrity. + +**Permissions:** This endpoint requires administrative permissions related to test management. Users without the appropriate permissions will not be able to update timestamps. + +Upon receiving a request, the \`setInstanceTimestamp\` function is invoked from the \`Tests\` service. This function retrieves the test instance details based on the provided instance identifier and proceeds to update the timestamp field with the current server time. This operation involves a transaction-like mechanism, ensuring that the timestamp update is atomic and error-free. The method concludes by returning a success status if the update is completed without any issues, otherwise, it will return an appropriate error response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/setQuestionResponseRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/setQuestionResponseRest.js new file mode 100644 index 0000000000..972554b92e --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/setQuestionResponseRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/setQuestionResponseRest'); +const { + schema: xRequest, +} = require('./schemas/request/setQuestionResponseRest'); + +const openapi = { + summary: 'Stores a user’s response to a specific test question', + description: `This endpoint is responsible for recording a user's response to a given question in a test scenario. It ensures that the response is saved in the appropriate format and associated with the correct user and test instance. + +**Authentication:** User authentication is required to ensure that responses are recorded for the correct user. An absence of valid authentication will prevent the endpoint from processing the request. + +**Permissions:** Specific permissions related to test-taking capabilities are required for a user to submit their responses. The exact permissions should be defined based on the level of access the user has to the test and the type of questions they are allowed to answer. + +Upon receiving a request, this endpoint invokes the \`setQuestionResponse\` method within the \`Tests\` service. This method processes the input, which includes the user's ID, the test ID, the question ID, and the user's response. The method verifies the validity of the data and checks against user permissions. Once validated, the response is stored in a database with the necessary metadata such as timestamp and user details. The process is designed to ensure data integrity and security, providing a reliable way for users to submit their test responses.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/updateAssignConfigRest.js b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/updateAssignConfigRest.js new file mode 100644 index 0000000000..2a6eba377c --- /dev/null +++ b/plugins/leemons-plugin-tests/backend/services/rest/openapi/tests/updateAssignConfigRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/updateAssignConfigRest'); +const { + schema: xRequest, +} = require('./schemas/request/updateAssignConfigRest'); + +const openapi = { + summary: 'Update assignment configuration settings', + description: `This endpoint allows for updating the saved configuration settings related to assignments within the system. It handles the modifications of specific configurations and ensures that changes are applied and persisted appropriately across the platform. + +**Authentication:** Users need to be authenticated to perform an update on assignment configuration settings. A valid user session must be present, and an API key or access token may be required to authenticate the request. + +**Permissions:** The user must have the 'admin' role or specific update permissions for assignment configurations. Without the requisite permissions, the request will be rejected, and an access denied error will be returned. + +The endpoint involves several key operations from the moment a request is received. Initially, it validates the incoming data against pre-defined schemas to ensure that all provided information is correct and complete. If validation passes, the endpoint then proceeds to call upon the 'updateConfig' method within the configurations service, passing necessary parameters such as the new configuration details and context information. This method is responsible for checking existing configurations, applying updates, and saving these changes to a persistent storage system, such as a database. Once the update operation is successfully completed, a confirmation response is sent back to the client indicating that the configuration has been updated.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-tests/backend/services/rest/questions.rest.js b/plugins/leemons-plugin-tests/backend/services/rest/questions.rest.js index e9702c258c..4759cd1b40 100644 --- a/plugins/leemons-plugin-tests/backend/services/rest/questions.rest.js +++ b/plugins/leemons-plugin-tests/backend/services/rest/questions.rest.js @@ -12,9 +12,11 @@ const { } = require('@leemons/middlewares'); const { getByIds } = require('../../core/questions'); +const getDetailsRest = require('./openapi/questions/getDetailsRest'); /** @type {ServiceSchema} */ module.exports = { getDetailsRest: { + openapi: getDetailsRest.openapi, rest: { method: 'POST', path: '/details', diff --git a/plugins/leemons-plugin-tests/backend/services/rest/questionsBanks.rest.js b/plugins/leemons-plugin-tests/backend/services/rest/questionsBanks.rest.js index d2862ce1fd..7f586a58c1 100644 --- a/plugins/leemons-plugin-tests/backend/services/rest/questionsBanks.rest.js +++ b/plugins/leemons-plugin-tests/backend/services/rest/questionsBanks.rest.js @@ -10,11 +10,21 @@ const { LeemonsMiddlewareAuthenticated, LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); -const { list, details, delete: _delete, save } = require('../../core/questions-banks'); +const { + list, + details, + delete: _delete, + save, +} = require('../../core/questions-banks'); +const listQuestionBanksRest = require('./openapi/questionsBanks/listQuestionBanksRest'); +const getQuestionBankDetailRest = require('./openapi/questionsBanks/getQuestionBankDetailRest'); +const deleteQuestionBankRest = require('./openapi/questionsBanks/deleteQuestionBankRest'); +const saveQuestionBanksRest = require('./openapi/questionsBanks/saveQuestionBanksRest'); /** @type {ServiceSchema} */ module.exports = { listQuestionBanksRest: { + openapi: listQuestionBanksRest.openapi, rest: { method: 'POST', path: '/list', @@ -56,6 +66,7 @@ module.exports = { }, }, getQuestionBankDetailRest: { + openapi: getQuestionBankDetailRest.openapi, rest: { method: 'GET', path: '/:id', @@ -76,6 +87,7 @@ module.exports = { }, }, deleteQuestionBankRest: { + openapi: deleteQuestionBankRest.openapi, rest: { method: 'DELETE', path: '/:id', @@ -96,6 +108,7 @@ module.exports = { }, }, saveQuestionBanksRest: { + openapi: saveQuestionBanksRest.openapi, rest: { method: 'POST', path: '/', diff --git a/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js b/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js index 077a33d230..f46ebad9d4 100644 --- a/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js +++ b/plugins/leemons-plugin-tests/backend/services/rest/tests.rest.js @@ -28,9 +28,24 @@ const { getUserQuestionResponses, } = require('../../core/tests'); +const listTestsRest = require('./openapi/tests/listTestsRest'); +const getTestRest = require('./openapi/tests/getTestRest'); +const deleteTestRest = require('./openapi/tests/deleteTestRest'); +const saveTestRest = require('./openapi/tests/saveTestRest'); +const getAssignConfigsRest = require('./openapi/tests/getAssignConfigsRest'); +const updateAssignConfigRest = require('./openapi/tests/updateAssignConfigRest'); +const deleteAssignConfigRest = require('./openapi/tests/deleteAssignConfigRest'); +const assignTestRest = require('./openapi/tests/assignTestRest'); +const duplicateRest = require('./openapi/tests/duplicateRest'); +const getInstanceFeedbackRest = require('./openapi/tests/getInstanceFeedbackRest'); +const setInstanceFeedbackRest = require('./openapi/tests/setInstanceFeedbackRest'); +const setInstanceTimestampRest = require('./openapi/tests/setInstanceTimestampRest'); +const setQuestionResponseRest = require('./openapi/tests/setQuestionResponseRest'); +const getUserQuestionResponsesRest = require('./openapi/tests/getUserQuestionResponsesRest'); /** @type {ServiceSchema} */ module.exports = { listTestsRest: { + openapi: listTestsRest.openapi, rest: { method: 'GET', path: '/', @@ -75,6 +90,7 @@ module.exports = { }, }, getTestRest: { + openapi: getTestRest.openapi, rest: { method: 'GET', path: '/:id', @@ -101,6 +117,7 @@ module.exports = { }, }, deleteTestRest: { + openapi: deleteTestRest.openapi, rest: { method: 'DELETE', path: '/:id', @@ -124,6 +141,7 @@ module.exports = { }, }, saveTestRest: { + openapi: saveTestRest.openapi, rest: { method: 'POST', path: '/', @@ -150,6 +168,7 @@ module.exports = { }, }, getAssignConfigsRest: { + openapi: getAssignConfigsRest.openapi, rest: { method: 'GET', path: '/assign/configs', @@ -172,6 +191,7 @@ module.exports = { }, }, updateAssignConfigRest: { + openapi: updateAssignConfigRest.openapi, rest: { method: 'PUT', path: '/assign/configs/:id', @@ -200,6 +220,7 @@ module.exports = { }, }, deleteAssignConfigRest: { + openapi: deleteAssignConfigRest.openapi, rest: { method: 'DELETE', path: '/assign/configs/:id', @@ -226,6 +247,7 @@ module.exports = { }, }, assignTestRest: { + openapi: assignTestRest.openapi, rest: { method: 'POST', path: '/assign', @@ -249,6 +271,7 @@ module.exports = { }, }, duplicateRest: { + openapi: duplicateRest.openapi, rest: { method: 'POST', path: '/duplicate', @@ -274,6 +297,7 @@ module.exports = { }, }, getInstanceFeedbackRest: { + openapi: getInstanceFeedbackRest.openapi, rest: { method: 'GET', path: '/instance/:id/feedback/:user', @@ -289,6 +313,7 @@ module.exports = { }, }, setInstanceFeedbackRest: { + openapi: setInstanceFeedbackRest.openapi, rest: { method: 'POST', path: '/instance/feedback', @@ -305,6 +330,7 @@ module.exports = { }, }, setInstanceTimestampRest: { + openapi: setInstanceTimestampRest.openapi, rest: { method: 'POST', path: '/instance/timestamp', @@ -321,6 +347,7 @@ module.exports = { }, }, setQuestionResponseRest: { + openapi: setQuestionResponseRest.openapi, rest: { method: 'POST', path: '/instance/question/response', @@ -335,6 +362,7 @@ module.exports = { }, }, getUserQuestionResponsesRest: { + openapi: getUserQuestionResponsesRest.openapi, rest: { method: 'GET', path: '/instance/:id/question/response', diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/config.rest.js b/plugins/leemons-plugin-timetable/backend/services/rest/config.rest.js index 2175f47c1d..a1882877c5 100644 --- a/plugins/leemons-plugin-timetable/backend/services/rest/config.rest.js +++ b/plugins/leemons-plugin-timetable/backend/services/rest/config.rest.js @@ -15,9 +15,15 @@ const has = require('../../core/config/has'); const update = require('../../core/config/update'); const deleteOne = require('../../core/config/delete'); +const createRest = require('./openapi/config/createRest'); +const getRest = require('./openapi/config/getRest'); +const hasRest = require('./openapi/config/hasRest'); +const updateRest = require('./openapi/config/updateRest'); +const deleteRest = require('./openapi/config/deleteRest'); /** @type {ServiceSchema} */ module.exports = { createRest: { + openapi: createRest.openapi, rest: { method: 'POST', path: '/', @@ -41,6 +47,7 @@ module.exports = { }, }, getRest: { + openapi: getRest.openapi, rest: { method: 'GET', path: '/', @@ -69,6 +76,7 @@ module.exports = { }, }, hasRest: { + openapi: hasRest.openapi, rest: { method: 'GET', path: '/has', @@ -97,6 +105,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { method: 'PUT', path: '/', @@ -120,6 +129,7 @@ module.exports = { }, }, deleteRest: { + openapi: deleteRest.openapi, rest: { method: 'DELETE', path: '/', diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/createRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/createRest.js new file mode 100644 index 0000000000..3f836d45f1 --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/createRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/createRest'); +const { schema: xRequest } = require('./schemas/request/createRest'); + +const openapi = { + summary: 'Configure timetable settings', + description: `This endpoint is responsible for configuring and saving the timetable settings based on the provided details. It typically handles operations such as defining the time slots, setting up break times, and other related configurations for efficient timetable management within the system. + +**Authentication:** Users need to be authenticated to interact with the timetable settings. Access to this endpoint requires a valid user session or a specific authentication token to ensure security. + +**Permissions:** Users must have 'admin' or 'timetable_manager' roles to modify the timetable settings. The system checks these permissions to ensure that only authorized personnel can make changes to the configurations. + +Upon receiving a request, the handler first validates the user’s credentials and permissions. If the validation passes, it proceeds to parse the input data, ensuring all required fields are present and correctly formatted. The handler then interacts with various services such as the 'createConfig' in the 'config' module, where it manages the actual configuration logic such as creating or updating timetable settings. After successful configuration, a confirmation message or the updated settings object is sent back to the client as a response. This process involves detailed error handling to manage any exceptions or errors that might occur during the configuration process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/deleteRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/deleteRest.js new file mode 100644 index 0000000000..87c503e5e5 --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/deleteRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteRest'); +const { schema: xRequest } = require('./schemas/request/deleteRest'); + +const openapi = { + summary: 'Delete timetable configuration data', + description: `This endpoint allows for the deletion of specific timetable configuration data. It is typically used to remove obsolete or erroneous configuration entries that are no longer required in the system. + +**Authentication:** User authentication is mandatory to ensure that only authorized personnel can delete configuration data. An invalid or missing authentication token will result in access being denied. + +**Permissions:** The user must have administrative permissions specifically for timetable configurations management. Without sufficient permissions, the request will be rejected. + +The deletion process begins with the 'deleteRest' action which interfaces with the corresponding service method in the backend. This method performs a lookup to ensure that the configuration to be deleted exists and that the requesting user has the necessary permissions to proceed with the deletion. If these conditions are met, the configuration data is removed from the database. The flow involves error handling to manage any issues that might arise during the deletion process, such as missing data or database errors. On successful deletion, a confirmation response is sent back to the user, indicating that the data was successfully removed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/getRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/getRest.js new file mode 100644 index 0000000000..03b9001f08 --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Configures and retrieves timetable settings', + description: `This endpoint is responsible for fetching and setting configuration details related to the timetable within the Leemonade platform. It ensures that all the necessary settings for the timetable functionality are correctly managed and updated as per user actions or system requirements. + +**Authentication:** Users must be authenticated to interact with the timetable configurations. Access is denied if the user's credentials are not verified. + +**Permissions:** This endpoint requires administrator-level permissions. Only users with the 'Manage Timetable Configurations' permission can access or modify the timetable settings. + +The function initiates by first verifying user authentication and permissions. It then proceeds to invoke the \`getConfigSettings\` method from the 'Config' core module. This method checks if the current settings exist in the database and retrieves them. If settings need to be updated, it calls the \`updateConfigSettings\` method which handles modifications to the database records based on the input parameters from the request. Finally, the updated or existing configuration settings are returned to the user in a structured JSON format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/hasRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/hasRest.js new file mode 100644 index 0000000000..770b24c913 --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/hasRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/hasRest'); +const { schema: xRequest } = require('./schemas/request/hasRest'); + +const openapi = { + summary: 'Checks configuration availability for given properties', + description: `This endpoint verifies the presence and availability of specified configuration properties in the system. It primarily aids in validation checks before application-specific configurations are altered or used. + +**Authentication:** User authentication is required to access this endpoint. Only authenticated users can initiate configuration checks to ensure secure access to configuration data. + +**Permissions:** Appropriate permissions are needed to query configuration settings. Users must possess 'config.read' permissions or similar to execute this request, ensuring that only authorized personnel can review or modify configurations. + +Upon receiving a request, this handler engages the \`hasConfig\` method located within the configuration management core. This method accepts a list of configuration keys and checks their existence and accessibility in the current system configuration. It processes each key individually, utilizing caching mechanisms if available to enhance performance and reduce direct fetches from the primary storage. The response generated confirms whether each queried configuration key is present, aiding clients in decision-making regarding configuration management or adjustments in the application flow.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/createRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/createRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/createRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/deleteRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/deleteRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/deleteRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/getRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/hasRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/hasRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/hasRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/updateRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/createRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/createRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/createRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/deleteRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/deleteRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/deleteRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/getRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/hasRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/hasRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/hasRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/updateRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/updateRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/updateRest.js new file mode 100644 index 0000000000..ce7399a707 --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/config/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Updates the timetable configuration settings', + description: `This endpoint allows for the updating of timetable configuration settings within the system. It is specifically designed to handle adjustments in the configuration parameters that affect how timetables are managed and displayed. + +**Authentication:** User authentication is required to access this endpoint. Without proper authentication, the request will be rejected, ensuring that only authorized users can make changes to the timetable configurations. + +**Permissions:** This endpoint requires users to have 'admin' or 'timetable_manager' roles. Users with these permissions can update configuration settings, which includes modifying details like timetable intervals, break times, and other related settings. + +Upon receiving the request, the \`updateConfig\` method from the \`ConfigService\` is called with necessary payload containing new configuration values. This method validates the payload against predefined schema to ensure data integrity and then proceeds to update the configurations in the database. If the update is successful, a confirmation response is sent back to the client. If there is an error during the process, such as validation failure or database issues, appropriate error messages are returned to ensure the client can react accordingly.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/enableMenuItemRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/enableMenuItemRest.js new file mode 100644 index 0000000000..d5ecb2f807 --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/enableMenuItemRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/enableMenuItemRest'); +const { schema: xRequest } = require('./schemas/request/enableMenuItemRest'); + +const openapi = { + summary: 'Activates a specific menu item in the user interface', + description: `This endpoint enables a specific menu item in the system's user interface, making it visible and accessible to users. This action typically involves updating a configuration setting or database entry to reflect the new state of the menu item. + +**Authentication:** Users must be authenticated to modify the visibility of menu items. An invalid or missing authentication token will prevent access to this endpoint. + +**Permissions:** Users need specific administrative permissions related to UI configuration or menu management to enable a menu item. Without appropriate permissions, the request will be denied. + +Upon receiving a request, the \`enableMenuItemRest\` handler verifies the user's authentication and permission levels. If the validation passes, it proceeds to call the \`enableMenuItem\` method. This method updates the necessary configurations to set the menu item's status to active. The entire process involves validating the input, checking permissions, updating the setting via a database transaction, and finally, responding with the success status of the operation if all conditions are met.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/findOneRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/findOneRest.js new file mode 100644 index 0000000000..7602c28cfd --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/findOneRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/findOneRest'); +const { schema: xRequest } = require('./schemas/request/findOneRest'); + +const openapi = { + summary: 'Find a single setting by its specifications', + description: `This endpoint retrieves specific configuration settings based on several search criteria provided as input. It is designed to pinpoint and return granular details about a particular setting within the system's configuration pool. + +**Authentication:** Users need to be authenticated to perform this search. Access to this endpoint will be denied if authentication credentials are not valid or are missing. + +**Permissions:** Specific permissions related to settings management are required to access this endpoint. Users without sufficient permissions will not be able to retrieve setting details. + +The handler begins by accepting a request that includes identification criteria for the desired setting. These criteria are processed by the \`findOne\` method in the \`settings\` core. This method makes a query to the system's database, attempting to locate a setting that matches the provided criteria. The result of this query is then returned to the user as a JSON object if successful. This process ensures that only the requested, authorized setting information is retrieved and disclosed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/request/enableMenuItemRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/request/enableMenuItemRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/request/enableMenuItemRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/request/findOneRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/request/findOneRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/request/findOneRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/request/updateRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/response/enableMenuItemRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/response/enableMenuItemRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/response/enableMenuItemRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/response/findOneRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/response/findOneRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/response/findOneRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/response/updateRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/updateRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/updateRest.js new file mode 100644 index 0000000000..b32ccc38d1 --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/settings/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Updates timetable settings for a specific user', + description: `This endpoint is used for updating the timetable settings specific to a user. It allows the updating of settings such as preferences and configurations related to that user's timetable management. + +**Authentication:** User authentication is required to ensure that the request is made by a valid, logged-in user. The session or token must be verified prior to processing the request. + +**Permissions:** The user must have the 'timetable-settings-update' permission to update timetable settings. This ensures that only authorized users can make changes to their timetable configurations. + +Upon receiving the update request, the handler first authenticates the user and checks required permissions. If authentication or authorization fails, it returns an appropriate error response. If successful, it invokes the \`updateSettings\` method in the settings core, passing necessary parameters such as user ID and new settings data. This method performs the update operation in the database and returns a success response indicating that the settings have been updated. Throughout the process, error handling mechanisms are in place to catch and respond to any issues that might occur during the update operation.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/countRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/countRest.js new file mode 100644 index 0000000000..015653e2f3 --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/countRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/countRest'); +const { schema: xRequest } = require('./schemas/request/countRest'); + +const openapi = { + summary: 'Counts the number of timetables based on provided filters', + description: `This endpoint provides the count of timetables that match certain criteria specified through filters. It essentially serves to inform the client about the quantity of timetables, facilitating operations like pagination in the user interface. + +**Authentication:** User authentication is mandatory for accessing this endpoint. Without a valid user session, the request will be rejected. + +**Permissions:** This endpoint requires the user to have \`view_timetable\` permission to proceed with fetching the count of timetables. Users without sufficient permissions will receive an access denial response. + +Upon receiving a request, the endpoint triggers the \`countTimetables\` action from the \`TimetableService\`. This action utilizes the \`timeFiltersQuery\` function from the helpers to generate a query based on the input parameters, which are assumed to include date ranges and possibly other constraints pertaining to timetables. The query is then executed in the database through the \`count.js\` method in the core module, which efficiently counts the entries matching the criteria without retrieving the full data sets. The result, a numerical value indicating the count of timetables, is then returned to the client in a straightforward JSON format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/createRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/createRest.js new file mode 100644 index 0000000000..cfc86f460f --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/createRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/createRest'); +const { schema: xRequest } = require('./schemas/request/createRest'); + +const openapi = { + summary: 'Create a new timetable entry', + description: `This endpoint is responsible for creating a new timetable entry in the leemons plugin system, including all necessary scheduling details from the provided data. + +**Authentication:** User authentication is required to ensure only authorized users can create new timetable entries. An unauthorized access attempt will result in denial of the service. + +**Permissions:** The user must have 'timetable.create' permissions to be able to add new timetable entries. Lack of proper permissions will prevent the user from executing this action. + +The endpoint initiates the process by calling the \`create\` method in the timetable core module. This involves several steps: firstly, validating the input data against predefined schemas to ensure all required fields are present and correctly formatted. Next, it utilizes the \`timeToDayjs\` helper to convert time data into a suitable format for processing. Assuming validation passes, the \`create\` method proceeds to insert the new entry into the database with all the relevant details provided in the request. After successful insertion, a response is generated and returned to the user indicating the successful creation of the timetable entry.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/deleteRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/deleteRest.js new file mode 100644 index 0000000000..59a1105064 --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/deleteRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/deleteRest'); +const { schema: xRequest } = require('./schemas/request/deleteRest'); + +const openapi = { + summary: 'Delete a specific timetable', + description: `This endpoint handles the deletion of a specific timetable based on the provided identifier. It ensures that the data deletion is managed cleanly without leaving orphaned data or references. + +**Authentication:** Users must be authenticated to delete timetables. The system checks for a valid session or authentication token before processing the request. + +**Permissions:** This endpoint requires the user to have administrative rights or specific permissions tailored to modifying or deleting timetable data. Without the necessary permissions, the request will be denied. + +Upon receiving a request, the endpoint first validates the presence and correctness of the timetable ID. It then calls the \`deleteTimetable\` function from the timetables core logic. This function checks for the existence of the timetable in the database and proceeds with the deletion if it exists and the user has appropriate rights. The deletion process also involves any cleanup necessary to maintain data integrity, such as removing associated time slots or user assignments. After successful deletion, a confirmation message is sent back to the user, indicating the successful removal of the timetable.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/getRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/getRest.js new file mode 100644 index 0000000000..f6f42177d9 --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/getRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getRest'); +const { schema: xRequest } = require('./schemas/request/getRest'); + +const openapi = { + summary: 'Provides a timetable based on user-defined filters and rules', + description: `This endpoint retrieves a user-specific timetable based on predefined filters and rules. The timetable includes classes, timeslots, and potentially other relevant academic resources that are configured per user or group requirements. + +**Authentication:** User authentication is required to ensure secure access to the pertinent timetable data. An unauthorized or expired session will prevent access to this endpoint. + +**Permissions:** This endpoint requires the 'view_timetable' permission. Users without this permission will not be able to retrieve timetable information. + +Upon request, the endpoint initially invokes the 'get' method from \`timetables\` core, which uses the \`timeFiltersQuery\` helper to process input filters and query parameters. These parameters define user-specific needs such as class times, preferred days, and any other relevant filters. The 'get' method interacts with the database to fetch timetable data that matches the specified criteria. The processed data is then formatted suitably and returned as a JSON object, providing a structured response that includes all timetable entries relevant to the user.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/countRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/countRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/countRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/createRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/createRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/createRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/deleteRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/deleteRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/deleteRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/getRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/updateRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/countRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/countRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/countRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/createRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/createRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/createRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/deleteRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/deleteRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/deleteRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/getRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/getRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/getRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/updateRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/updateRest.js b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/updateRest.js new file mode 100644 index 0000000000..06bbe3f4b4 --- /dev/null +++ b/plugins/leemons-plugin-timetable/backend/services/rest/openapi/timetable/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Update timetable details', + description: `This endpoint updates specific details within a timetable. Depending on the request, it can modify aspects like event times, participants, or other related metadata of a timetable entry. + +**Authentication:** Users need to be authenticated to update a timetable. Access to this endpoint requires valid user credentials, which must be verified before any modification can proceed. + +**Permissions:** User must have edit permissions for the timetable they attempt to update. Unauthorized access attempts will result in an error and no changes will be made to the timetable. + +The process within the controller starts by validating the incoming data against predefined schemas to ensure all required fields are present and correctly formatted. Next, the \`updateTimetable\` method within the \`timetables\` core uses this validated data to update the specified timetable entry in the data repository. This involves complex transactions like date calculations and potential conflict resolutions with existing timetable entries. After successful data modification, a response is sent back confirming the updates, or in the case of errors, detailed error messages are returned.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/settings.rest.js b/plugins/leemons-plugin-timetable/backend/services/rest/settings.rest.js index 3cf99207ef..389374c81f 100644 --- a/plugins/leemons-plugin-timetable/backend/services/rest/settings.rest.js +++ b/plugins/leemons-plugin-timetable/backend/services/rest/settings.rest.js @@ -12,9 +12,13 @@ const { const { LeemonsValidator } = require('@leemons/validator'); const { findOne, update } = require('../../core/settings'); +const findOneRest = require('./openapi/settings/findOneRest'); +const updateRest = require('./openapi/settings/updateRest'); +const enableMenuItemRest = require('./openapi/settings/enableMenuItemRest'); /** @type {ServiceSchema} */ module.exports = { findOneRest: { + openapi: findOneRest.openapi, rest: { method: 'GET', path: '/', @@ -38,6 +42,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { method: 'POST', path: '/', @@ -82,6 +87,7 @@ module.exports = { }, }, enableMenuItemRest: { + openapi: enableMenuItemRest.openapi, rest: { method: 'POST', path: '/enable-menu-item', diff --git a/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js b/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js index 26062bd9de..578648fb09 100644 --- a/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js +++ b/plugins/leemons-plugin-timetable/backend/services/rest/timetable.rest.js @@ -15,9 +15,15 @@ const count = require('../../core/timetables/count'); const update = require('../../core/timetables/update'); const deleteOne = require('../../core/timetables/delete'); +const createRest = require('./openapi/timetable/createRest'); +const getRest = require('./openapi/timetable/getRest'); +const countRest = require('./openapi/timetable/countRest'); +const updateRest = require('./openapi/timetable/updateRest'); +const deleteRest = require('./openapi/timetable/deleteRest'); /** @type {ServiceSchema} */ module.exports = { createRest: { + openapi: createRest.openapi, rest: { method: 'POST', path: '/', @@ -41,6 +47,7 @@ module.exports = { }, }, getRest: { + openapi: getRest.openapi, rest: { method: 'GET', path: '/:id', @@ -76,6 +83,7 @@ module.exports = { }, }, countRest: { + openapi: countRest.openapi, rest: { method: 'GET', path: '/count/:id', @@ -114,6 +122,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { method: 'PUT', path: '/:id', @@ -147,6 +156,7 @@ module.exports = { }, }, deleteRest: { + openapi: deleteRest.openapi, rest: { method: 'DELETE', path: '/:id', diff --git a/plugins/leemons-plugin-users/backend/services/rest/actions.rest.js b/plugins/leemons-plugin-users/backend/services/rest/actions.rest.js index 8ddf06d716..f1fcf1336c 100644 --- a/plugins/leemons-plugin-users/backend/services/rest/actions.rest.js +++ b/plugins/leemons-plugin-users/backend/services/rest/actions.rest.js @@ -2,12 +2,14 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const { list } = require('../../core/actions'); +const listRest = require('./openapi/actions/listRest'); +/** @type {ServiceSchema} */ module.exports = { listRest: { + openapi: listRest.openapi, rest: { path: '/list', method: 'GET', diff --git a/plugins/leemons-plugin-users/backend/services/rest/centers.rest.js b/plugins/leemons-plugin-users/backend/services/rest/centers.rest.js index a7a08796f1..798260e45c 100644 --- a/plugins/leemons-plugin-users/backend/services/rest/centers.rest.js +++ b/plugins/leemons-plugin-users/backend/services/rest/centers.rest.js @@ -2,7 +2,6 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsMiddlewareAuthenticated, LeemonsMiddlewareNecessaryPermits, @@ -10,8 +9,13 @@ const { const { LeemonsValidator } = require('@leemons/validator'); const { list, add, remove } = require('../../core/centers'); +const listRest = require('./openapi/centers/listRest'); +const addRest = require('./openapi/centers/addRest'); +const removeRest = require('./openapi/centers/removeRest'); +/** @type {ServiceSchema} */ module.exports = { listRest: { + openapi: listRest.openapi, rest: { path: '/', method: 'POST', @@ -40,7 +44,9 @@ module.exports = { { type: 'boolean' }, { type: 'object', - properties: { columns: { type: 'array', items: { type: 'string' } } }, + properties: { + columns: { type: 'array', items: { type: 'string' } }, + }, }, ], }, @@ -58,6 +64,7 @@ module.exports = { }, }, addRest: { + openapi: addRest.openapi, rest: { path: '/add', method: 'POST', @@ -83,6 +90,7 @@ module.exports = { }, }, removeRest: { + openapi: removeRest.openapi, rest: { path: '/remove', method: 'POST', diff --git a/plugins/leemons-plugin-users/backend/services/rest/config.rest.js b/plugins/leemons-plugin-users/backend/services/rest/config.rest.js index 20b74a3aad..0989e5c6b4 100644 --- a/plugins/leemons-plugin-users/backend/services/rest/config.rest.js +++ b/plugins/leemons-plugin-users/backend/services/rest/config.rest.js @@ -2,15 +2,21 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsMiddlewareAuthenticated, LeemonsMiddlewareNecessaryPermits, } = require('@leemons/middlewares'); -const { getSystemDataFieldsConfig, saveSystemDataFieldsConfig } = require('../../core/config'); +const { + getSystemDataFieldsConfig, + saveSystemDataFieldsConfig, +} = require('../../core/config'); +const getSystemDataFieldsConfigRest = require('./openapi/config/getSystemDataFieldsConfigRest'); +const saveSystemDataFieldsConfigRest = require('./openapi/config/saveSystemDataFieldsConfigRest'); +/** @type {ServiceSchema} */ module.exports = { getSystemDataFieldsConfigRest: { + openapi: getSystemDataFieldsConfigRest.openapi, rest: { path: '/system-data-fields', method: 'GET', @@ -31,6 +37,7 @@ module.exports = { }, }, saveSystemDataFieldsConfigRest: { + openapi: saveSystemDataFieldsConfigRest.openapi, rest: { path: '/system-data-fields', method: 'POST', diff --git a/plugins/leemons-plugin-users/backend/services/rest/init.rest.js b/plugins/leemons-plugin-users/backend/services/rest/init.rest.js index 5b103b99e4..8097ca8cbd 100644 --- a/plugins/leemons-plugin-users/backend/services/rest/init.rest.js +++ b/plugins/leemons-plugin-users/backend/services/rest/init.rest.js @@ -2,11 +2,13 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const nodeFetch = require('node-fetch'); +const todayQuoteRest = require('./openapi/init/todayQuoteRest'); +/** @type {ServiceSchema} */ module.exports = { todayQuoteRest: { + openapi: todayQuoteRest.openapi, rest: { path: '/today-quote', method: 'GET', diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/actions/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/actions/listRest.js new file mode 100644 index 0000000000..5347641580 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/actions/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'Lists all users in the system', + description: `This endpoint lists all users registered within the system, providing a comprehensive overview of each user's basic information without going into sensitive details. + +**Authentication:** Users need to be authenticated to retrieve the list of users. Access to this endpoint is contingent upon possessing a valid authentication token. + +**Permissions:** Specific permissions are required to access this endpoint. Typically, higher-level administrative roles have the rights to invoke this service to ensure data privacy and adherence to organizational policies. + +The endpoint begins by accessing the \`listUsers\` method defined in the \`UserService\`. This method compiles a query which is then executed against the database to fetch all pertinent user data. The query is structured to respect privacy guidelines and only retrieve non-sensitive user attributes. After the database execution, the users' data is returned in a structured format, allowing the calling service to format the response appropriately before sending it back to the client. The response adheres to a JSON structure, providing a clean and understandable list of user data.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/actions/schemas/request/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/actions/schemas/request/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/actions/schemas/request/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/actions/schemas/response/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/actions/schemas/response/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/actions/schemas/response/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/addRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/addRest.js new file mode 100644 index 0000000000..ef8d7b802d --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/addRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addRest'); +const { schema: xRequest } = require('./schemas/request/addRest'); + +const openapi = { + summary: 'Add a new center to the platform', + description: `This endpoint allows the creation of a new educational or organizational center within the platform. It involves the addition of center details into the system's database, enabling centralized management and access to specific functionalities based on the center's characteristics. + +**Authentication:** User authentication is required to ensure secure access and operation within the endpoint. An authorized login is necessary to proceed with adding new centers. + +**Permissions:** Proper authorization is mandatory, and users need specific permissions related to center management. These permissions ensure that only authorized personnel can add new centers, maintaining operational integrity and security. + +Upon receiving the request, the endpoint initially validates the provided data against predefined schemas to ensure compliance with the expected format and completeness. If validation passes, it proceeds to invoke the \`add\` function from the \`centers\` core module. This function is responsible for inserting the new center's details into the database. Throughout this process, transactional integrity is maintained to prevent partial data entry and to ensure reliable operations. Finally, upon successful addition of the center, a confirmation response is generated and returned to the user, indicating successful execution of the request.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/listRest.js new file mode 100644 index 0000000000..027c4ad8ec --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'Lists all educational centers accessible to the user', + description: `This endpoint lists all educational centers that the current user has access to within the leemons platform, focusing on providing a comprehensive view of centers based on user roles and permissions. + +**Authentication:** Users must be authenticated to view the list of educational centers. Failure to provide valid authentication credentials will prevent access to the endpoint. + +**Permissions:** Users need specific permission to view educational centers. This permission typically depends on the user's role within the system, such as administrators or educational staff having broader access rights. + +Upon receiving a request, the endpoint initially verifies the user's authentication status and permissions. Once authentication and authorization are confirmed, it calls the \`listCenters\` method from the 'centers' module. This method fetches all centers from the database that the user is authorized to see, applying any relevant filters such as center type or location. The data is then formatted appropriately and returned as a JSON list, encapsulating details like center names, locations, and roles associated with each center. The flow concludes with the endpoint sending this data back to the user in a structured response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/removeRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/removeRest.js new file mode 100644 index 0000000000..1b31c85e57 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/removeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/removeRest'); +const { schema: xRequest } = require('./schemas/request/removeRest'); + +const openapi = { + summary: 'Removes a center from the system', + description: `This endpoint handles the deletion of a center within the system. It allows for the removal of specified center data if the prerequisites are met, ensuring data integrity and compliance with system rules. + +**Authentication:** User must be authenticated to access this endpoint. Without a valid session or authentication credentials, the request will be rejected. + +**Permissions:** The user must have admin-level permissions to remove a center. Specific rights to modify or delete center information are required to execute this operation. + +Upon receiving a request, this handler calls the \`remove\` method in the \`/Users/usuario/Sites/leemonade/leemons/plugins/leemons-plugin-users/backend/core/centers/remove.js\` core file. This method checks if the center exists and verifies the user has the necessary permissions. If all conditions are met, the center is removed from the database. The process involves several checks to ensure the integrity of the operation, handling errors gracefully and reverting changes if necessary to maintain system consistency. Finally, a success response is returned, indicating that the center has been successfully removed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/request/addRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/request/addRest.js new file mode 100644 index 0000000000..aa9be55936 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/request/addRest.js @@ -0,0 +1,89 @@ +// automatic hash: d8e27350dc8a218d85fe0c99241bb62e9bf2a96b3efb54ae36f043e01204b232 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + locale: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + timezone: { + type: 'string', + minLength: 1, + }, + firstDayOfWeek: { + type: 'string', + minLength: 1, + }, + country: { + type: 'string', + minLength: 1, + }, + city: { + type: 'string', + minLength: 1, + }, + postalCode: { + type: 'string', + minLength: 1, + }, + street: { + type: 'string', + minLength: 1, + }, + adminProfile: { + type: 'string', + minLength: 1, + }, + teacherProfile: { + type: 'string', + minLength: 1, + }, + studentProfile: { + type: 'string', + minLength: 1, + }, + limits: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['item', 'limit', 'type'], + properties: { + item: { + type: 'string', + minLength: 1, + }, + limit: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + }, + required: [ + 'locale', + 'name', + 'timezone', + 'firstDayOfWeek', + 'country', + 'city', + 'postalCode', + 'street', + 'adminProfile', + 'teacherProfile', + 'studentProfile', + 'limits', + ], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/request/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/request/listRest.js new file mode 100644 index 0000000000..337a213276 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/request/listRest.js @@ -0,0 +1,20 @@ +// automatic hash: 33c4e7e37cd10881f7132bf24bade118aa8128969b464ed86ac4a0861c7648be +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + page: { + type: 'number', + }, + size: { + type: 'number', + }, + withLimits: { + type: 'boolean', + }, + }, + required: ['page', 'size', 'withLimits'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/request/removeRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/request/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/request/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/response/addRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/response/addRest.js new file mode 100644 index 0000000000..93a22ed352 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/response/addRest.js @@ -0,0 +1,171 @@ +// automatic hash: fc68874b344e8e7ac3d78e37a2ce8106ddec342dd11c173e819c17e09d14e0f0 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + center: { + type: 'object', + properties: { + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + locale: { + type: 'string', + minLength: 1, + }, + uri: { + type: 'string', + minLength: 1, + }, + timezone: { + type: 'string', + minLength: 1, + }, + firstDayOfWeek: { + type: 'number', + }, + country: { + type: 'string', + minLength: 1, + }, + city: { + type: 'string', + minLength: 1, + }, + postalCode: { + type: 'string', + minLength: 1, + }, + street: { + type: 'string', + minLength: 1, + }, + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + limits: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'center', + 'deploymentID', + 'isDeleted', + 'item', + '__v', + 'id', + 'limit', + 'type', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + center: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + item: { + type: 'string', + minLength: 1, + }, + __v: { + type: 'number', + }, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + deletedAt: {}, + id: { + type: 'string', + minLength: 1, + }, + limit: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + }, + }, + }, + }, + required: [ + 'id', + 'deploymentID', + 'name', + 'locale', + 'uri', + 'timezone', + 'firstDayOfWeek', + 'country', + 'city', + 'postalCode', + 'street', + '_id', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'limits', + ], + }, + }, + required: ['status', 'center'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/response/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/response/listRest.js new file mode 100644 index 0000000000..4f82f50f6b --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/response/listRest.js @@ -0,0 +1,216 @@ +// automatic hash: 0e6f4a2c15295eab88974eb8aad414288a05834e88060d8edc629ebbd000695c +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + data: { + type: 'object', + properties: { + items: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'locale', + 'uri', + 'timezone', + 'firstDayOfWeek', + 'country', + 'city', + 'postalCode', + 'street', + 'isDeleted', + '__v', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + locale: { + type: 'string', + minLength: 1, + }, + uri: { + type: 'string', + minLength: 1, + }, + timezone: { + type: 'string', + minLength: 1, + }, + firstDayOfWeek: { + type: 'number', + }, + country: { + type: 'string', + minLength: 1, + }, + city: { + type: 'string', + minLength: 1, + }, + postalCode: { + type: 'string', + minLength: 1, + }, + street: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + limits: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'center', + 'deploymentID', + 'isDeleted', + 'item', + '__v', + 'id', + 'limit', + 'type', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + center: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + item: { + type: 'string', + minLength: 1, + }, + __v: { + type: 'number', + }, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + deletedAt: {}, + id: { + type: 'string', + minLength: 1, + }, + limit: { + type: 'number', + }, + type: { + type: 'string', + minLength: 1, + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + unlimited: {}, + }, + }, + }, + }, + }, + }, + count: { + type: 'number', + }, + totalCount: { + type: 'number', + }, + totalPages: { + type: 'number', + }, + page: { + type: 'number', + }, + size: { + type: 'number', + }, + nextPage: { + type: 'number', + }, + prevPage: { + type: 'number', + }, + canGoPrevPage: { + type: 'boolean', + }, + canGoNextPage: { + type: 'boolean', + }, + }, + required: [ + 'items', + 'count', + 'totalCount', + 'totalPages', + 'page', + 'size', + 'nextPage', + 'prevPage', + 'canGoPrevPage', + 'canGoNextPage', + ], + }, + }, + required: ['status', 'data'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/response/removeRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/response/removeRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/centers/schemas/response/removeRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/config/getSystemDataFieldsConfigRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/config/getSystemDataFieldsConfigRest.js new file mode 100644 index 0000000000..479a9d64d2 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/config/getSystemDataFieldsConfigRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/getSystemDataFieldsConfigRest'); +const { + schema: xRequest, +} = require('./schemas/request/getSystemDataFieldsConfigRest'); + +const openapi = { + summary: 'Fetches system configuration data fields', + description: `This endpoint retrieves the configuration data fields specifically related to the system's operation and setup. It primarily serves as a utility for the system administration by providing essential configuration details necessary for system configuration and audits. + +**Authentication:** Users need to be authenticated to access this endpoint. Access without proper authentication will be denied, ensuring that only verified users can retrieve system configuration information. + +**Permissions:** Users need specific administrative permissions to retrieve these system configuration data fields. The exact permissions are defined within the system's role management framework, which restricts access to sensitive information to authorized personnel only. + +The controller starts by executing the \`getSystemDataFieldsConfig\` method in the system's configuration module. This method compiles an array of configuration settings that are crucial for system setup and audits, focusing on aspects like security settings, data handling policies, and other operational parameters. The controller captures and formats these details, handing them over through a structured JSON response to the authenticated and authorized user, effectively supporting informed system management decisions.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/config/saveSystemDataFieldsConfigRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/config/saveSystemDataFieldsConfigRest.js new file mode 100644 index 0000000000..04065b45d0 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/config/saveSystemDataFieldsConfigRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/saveSystemDataFieldsConfigRest'); +const { + schema: xRequest, +} = require('./schemas/request/saveSystemDataFieldsConfigRest'); + +const openapi = { + summary: 'Save system data fields configuration', + description: `This endpoint handles the update or creation of system-wide configuration data fields. These configurations control various aspects of how data fields are managed and stored across the platform. + +**Authentication:** Users must be logged in to modify system data fields configuration. Authentication ensures that only authorized users can alter these settings. + +**Permissions:** This endpoint requires administrator-level permissions. A user must have the 'admin' role to access and modify the system data fields configuration. + +This method begins by validating the input received from the user against a predefined schema to ensure data integrity and security. Once validation is successful, the \`saveSystemDataFieldsConfig\` function from the backend's \`config\` core is called. This function takes the validated data and updates the existing system configuration if it exists, or creates a new configuration entry if it does not. The response from this operation will inform the user whether the update or creation was successful, including details of the record that was affected.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/config/schemas/request/getSystemDataFieldsConfigRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/config/schemas/request/getSystemDataFieldsConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/config/schemas/request/getSystemDataFieldsConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/config/schemas/request/saveSystemDataFieldsConfigRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/config/schemas/request/saveSystemDataFieldsConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/config/schemas/request/saveSystemDataFieldsConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/config/schemas/response/getSystemDataFieldsConfigRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/config/schemas/response/getSystemDataFieldsConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/config/schemas/response/getSystemDataFieldsConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/config/schemas/response/saveSystemDataFieldsConfigRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/config/schemas/response/saveSystemDataFieldsConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/config/schemas/response/saveSystemDataFieldsConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/init/schemas/request/todayQuoteRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/init/schemas/request/todayQuoteRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/init/schemas/request/todayQuoteRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/init/schemas/response/todayQuoteRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/init/schemas/response/todayQuoteRest.js new file mode 100644 index 0000000000..67c0c1f2d0 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/init/schemas/response/todayQuoteRest.js @@ -0,0 +1,36 @@ +// automatic hash: 8c3e2b30600b6b28e360654e721d9fba3f3bd0c868a62579d40c6642eab72617 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + data: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['q', 'a', 'h'], + properties: { + q: { + type: 'string', + minLength: 1, + }, + a: { + type: 'string', + minLength: 1, + }, + h: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + }, + required: ['status', 'data'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/init/todayQuoteRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/init/todayQuoteRest.js new file mode 100644 index 0000000000..c2c83d9754 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/init/todayQuoteRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/todayQuoteRest'); +const { schema: xRequest } = require('./schemas/request/todayQuoteRest'); + +const openapi = { + summary: 'Provides the quote of the day for the user', + description: `This endpoint serves the purpose of offering a motivational or inspirational 'Quote of the Day' to the user. These quotes may vary daily and can be specific to user's interests if set in the user's profile preferences. + +**Authentication:** User authentication is required to access this feature. Unauthorized access attempts will be blocked and logged for security reasons. + +**Permissions:** Users must have the 'read_quotes' permission enabled in their account settings to view the daily quote. Without this permission, access to the daily quote will not be granted. + +Upon receiving a request at this endpoint, the backend service first verifies the user's credentials and checks for the necessary permissions ('read_quotes'). If the authentication and permissions validation are successful, the service then proceeds to fetch the 'Quote of the Day' from a dedicated quotes management module integrated within the system. This module selects a quote based on the date and optionally the user's personal preferences stored in the user profile. The response, containing the quote, is then formulated in JSON format and sent back to the client, ensuring that each interaction is tailored and secure.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/getPermissionsWithActionsIfIHaveRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/getPermissionsWithActionsIfIHaveRest.js new file mode 100644 index 0000000000..704b941341 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/getPermissionsWithActionsIfIHaveRest.js @@ -0,0 +1,33 @@ +const { + schema, +} = require('./schemas/response/getPermissionsWithActionsIfIHaveRest'); +const { + schema: xRequest, +} = require('./schemas/request/getPermissionsWithActionsIfIHaveRest'); + +const openapi = { + summary: 'Check and retrieve permissions for user-controlled actions', + description: `This endpoint evaluates and provides all permissions related to actions that a user can perform within the system, based on their current authentication and authorization status. It specifically fetches any permissions that are associated with actionable items or functions that the user has potential access to. + +**Authentication:** Users need to be authenticated to request and receive information about their actionable permissions. Without proper authentication, the endpoint will not provide any permissions data. + +**Permissions:** The user must possess sufficient access rights to inquire about their permissions. Typically, this requires user-level or elevated permissions depending on the structure and sensitivity of the permissions being inquired. + +The handling of the request begins by utilizing the \`getUserAgentPermissions\` function from the \`user-agents\` core, which extracts the permissions based on the user's credentials. This function checks the database for all permissions linked to the user agent's ID. Subsequently, actions and their respective permissions are verified through a series of internal checks and balances to ensure that only relevant and permissible actions are returned to the user. The response is then compiled into a structured format, detailing each actionable permission and sent back through the endpoint in a JSON object format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/listRest.js new file mode 100644 index 0000000000..efd4326c77 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'List all permissions available in the system', + description: `This endpoint provides a comprehensive listing of all permissions that a user or system can be granted within the platform. It is primarily used to fetch a structured list of permissions, which helps in managing and assigning user roles and rights effectively. + +**Authentication:** User must be logged into the system to access this endpoint. Unauthorized access attempts will be rejected, ensuring that only authenticated users can retrieve permission information. + +**Permissions:** The user must have administrative rights or an equivalent level of permissions specifically allowing them to view all permissions. This is critical to ensure that only authorized personnel manage and view sensitive permission data. + +From the outset, the \`listRest\` handler function activates the core method from the \`permissions\` module, particularly targeting the \`list.js\` file. This method systematically gathers all permissions defined across the platform. It encapsulates both default and dynamically added permissions into a structured response. Each permission is associated with its respective module, allowing for easy identification and management. The endpoint processes this data, and the result is returned as a JSON object listing all permissions, which can then be utilized for further administrative tasks or audits.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/schemas/request/getPermissionsWithActionsIfIHaveRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/schemas/request/getPermissionsWithActionsIfIHaveRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/schemas/request/getPermissionsWithActionsIfIHaveRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/schemas/request/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/schemas/request/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/schemas/request/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/schemas/response/getPermissionsWithActionsIfIHaveRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/schemas/response/getPermissionsWithActionsIfIHaveRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/schemas/response/getPermissionsWithActionsIfIHaveRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/schemas/response/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/schemas/response/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/permissions/schemas/response/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/getDefaultLocaleRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/getDefaultLocaleRest.js new file mode 100644 index 0000000000..390e5307f6 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/getDefaultLocaleRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getDefaultLocaleRest'); +const { schema: xRequest } = require('./schemas/request/getDefaultLocaleRest'); + +const openapi = { + summary: "Fetches the platform's default locale setting", + description: `This endpoint retrieves the default locale configured for the platform. It identifies the primary language and regional settings that are used across various functionalities where localized content is required. + +**Authentication:** Users do not need to be logged in to access the default locale. It is publicly accessible to provide a consistent user experience in terms of language and region right from the start of interaction with the platform. + +**Permissions:** No specific permissions are required to access this endpoint. It serves general platform information which is intended to be freely accessible to all users, ensuring that localization preferences can be resolved and applied even before user authentication. + +Upon receiving a request, the \`getDefaultLocaleRest\` action invokes the \`getDefaultLocale\` method from the platform core services. This method directly reads the locale configuration from the system settings, generally maintained in a configuration file or a database. The output of this method is the default locale setting such as 'en-US' or 'fr-FR', which is then returned to the requester in JSON format, ensuring that the client application can adjust its language and regional settings accordingly.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/getLocalesRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/getLocalesRest.js new file mode 100644 index 0000000000..0731d6d555 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/getLocalesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getLocalesRest'); +const { schema: xRequest } = require('./schemas/request/getLocalesRest'); + +const openapi = { + summary: 'Provides localized content for the platform', + description: `This endpoint retrieves all available language locales supported by the platform. It enables applications to offer multilingual support by providing a list of locales that users can select from to view content in their preferred language. + +**Authentication:** Users are required to be authenticated to access the list of supported locales. Unauthenticated requests are rejected, ensuring that only valid users can access locale information. + +**Permissions:** Access to this endpoint requires administrative rights. Only users with the 'admin' role are permitted to retrieve the list of locales, ensuring that managing available locales is restricted to authorized personnel only. + +Upon receiving a request, the \`getLocales\` function within the platform's core is invoked. This function queries the system's configuration files or database to gather all supported locales. The process involves validating the user's authentication and permissions before proceeding with the data retrieval. Finally, the gathered data is returned in a JSON array format, listing each locale along with its relevant properties such as language code and description, facilitating easy integration and selection by users.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/getPlatformNameRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/getPlatformNameRest.js new file mode 100644 index 0000000000..a680c7f906 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/getPlatformNameRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getPlatformNameRest'); +const { schema: xRequest } = require('./schemas/request/getPlatformNameRest'); + +const openapi = { + summary: 'Fetch platform name configuration', + description: `This endpoint retrieves the platform name from the system configuration. This information is utilized to provide context or personalize user interactions with the system. + +**Authentication:** Users are not required to be authenticated to access this endpoint. It serves general information applicable to any user accessing the platform. + +**Permissions:** There are no specific permissions required to access this endpoint, since it provides non-sensitive, general information about the platform. + +Upon receiving a request, the handler triggers the \`getPlatformName\` function defined in the \`platform\` core module. This function is responsible for accessing the system’s configuration and extracting the name of the platform. The operation is straightforward, generally involving a read operation from a configuration file or a database query, depending on how the platform is set up. The result of this operation is then formatted properly and sent back to the requester in the response body as plain text or JSON, depending on the implementation specifics. The process ensures that any user or system interacting with the endpoint receives accurate and up-to-date information regarding the platform's name.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/getThemeRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/getThemeRest.js new file mode 100644 index 0000000000..d41fea3cb0 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/getThemeRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getThemeRest'); +const { schema: xRequest } = require('./schemas/request/getThemeRest'); + +const openapi = { + summary: 'Fetches the current platform theme settings', + description: `This endpoint retrieves the theme settings currently active for the platform. It provides the appearance configurations that dictate the visual aspects of the platform’s user interface. + +**Authentication:** The user must be authenticated to access the theme settings. An invalid or missing authentication token will result in endpoint access denial. + +**Permissions:** The user needs to have administrative permissions to access the theme settings. Without the required permissions, the endpoint will deny access to the theme configurations. + +Once invoked, the \`getTheme\` handler in the backend service begins by confirming user authentication and checks for administrative permissions. If these checks pass, it then calls the \`getTheme\` method from the \`Platform\` core. This method accesses the database to retrieve the current theme settings applied to the platform. The results are then formatted and sent back as a JSON object representing the theme settings, ensuring that the administrator can view or modify the visual configurations as needed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/request/getDefaultLocaleRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/request/getDefaultLocaleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/request/getDefaultLocaleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/request/getLocalesRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/request/getLocalesRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/request/getLocalesRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/request/getPlatformNameRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/request/getPlatformNameRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/request/getPlatformNameRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/request/getThemeRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/request/getThemeRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/request/getThemeRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/response/getDefaultLocaleRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/response/getDefaultLocaleRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/response/getDefaultLocaleRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/response/getLocalesRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/response/getLocalesRest.js new file mode 100644 index 0000000000..3bce3736a4 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/response/getLocalesRest.js @@ -0,0 +1,64 @@ +// automatic hash: 76fde815ce4d3d2b7bc5866dcec6dc4cd9b3d52f6b62fd5ddb49119729a9618a +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + locales: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['id', 'deploymentID', 'code', 'name', 'isDeleted', '__v'], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + code: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + }, + }, + }, + required: ['status', 'locales'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/response/getPlatformNameRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/response/getPlatformNameRest.js new file mode 100644 index 0000000000..a028713eb2 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/response/getPlatformNameRest.js @@ -0,0 +1,18 @@ +// automatic hash: 983899848656d9f7d9042f24324777f117eebbaab767766a1632b763d84acb12 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + name: { + type: 'string', + minLength: 1, + }, + }, + required: ['status', 'name'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/response/getThemeRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/response/getThemeRest.js new file mode 100644 index 0000000000..c42a59ca50 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/platform/schemas/response/getThemeRest.js @@ -0,0 +1,46 @@ +// automatic hash: d66edaa9831ebea8896b424e708d37c7b5af9dcb2dea6eece041b8f365649dd2 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + theme: { + type: 'object', + properties: { + logoUrl: {}, + squareLogoUrl: {}, + mainColor: { + type: 'string', + minLength: 1, + }, + useDarkMode: { + type: 'boolean', + }, + menuMainColor: { + type: 'string', + minLength: 1, + }, + menuDrawerColor: { + type: 'string', + minLength: 1, + }, + usePicturesEmptyStates: { + type: 'boolean', + }, + }, + required: [ + 'mainColor', + 'useDarkMode', + 'menuMainColor', + 'menuDrawerColor', + 'usePicturesEmptyStates', + ], + }, + }, + required: ['status', 'theme'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/addAllPermissionsToAllProfilesRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/addAllPermissionsToAllProfilesRest.js new file mode 100644 index 0000000000..f552f70cfc --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/addAllPermissionsToAllProfilesRest.js @@ -0,0 +1,33 @@ +const { + schema, +} = require('./schemas/response/addAllPermissionsToAllProfilesRest'); +const { + schema: xRequest, +} = require('./schemas/request/addAllPermissionsToAllProfilesRest'); + +const openapi = { + summary: 'Assign all available permissions to all user profiles', + description: `This endpoint globally updates all user profiles in the system by assigning all available permissions to them, ensuring every profile has access to every permission defined in the system. + +**Authentication:** User authentication is mandatory to execute this action. The service checks for valid session tokens before processing the request. + +**Permissions:** The user must have administrative permissions to update permissions across all profiles. + +Upon receiving a request, the handler invokes the \`addAllPermissionsToAllProfiles\` method from the \`profiles\` core module. This method iterates over all profiles stored in the database, and for each profile, it applies a set of predefined permissions. The permissions are retrieved from a central repository of permissions that define all possible actions users can perform within the system. This comprehensive application ensures that there are no discrepancies in permission assignments across different user profiles. Once all profiles are updated, a confirmation is sent back to the client indicating the successful update of permissions across all profiles.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/addRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/addRest.js new file mode 100644 index 0000000000..86b7ba6bec --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/addRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addRest'); +const { schema: xRequest } = require('./schemas/request/addRest'); + +const openapi = { + summary: 'Add a new profile to the system', + description: `This endpoint allows for the addition of a new user profile within the system. It is responsible for creating profile entries that can be linked to specific user roles and permissions, aiding in access management and personalization of user experiences. + +**Authentication:** Users need to be authenticated to perform this action. Only users with administrative privileges can add new profiles. + +**Permissions:** The required permission for this endpoint is 'profile_add'. Without this permission, users cannot execute profile creation operations. + +The process begins when the \`add\` method in the \`profiles\` core is called. This method involves several steps starting from validating the input data, checking for existing profiles with similar names using the \`existName\` method, and then proceeding to create a new profile if no duplicates are found. It integrates with \`createNecessaryRolesForProfilesAccordingToCenters\` to ensure necessary roles are assigned according to the user's center affiliations. The completion of the operation returns a confirmation of the profile creation or an error message detailing any issues encountered during the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/detailRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/detailRest.js new file mode 100644 index 0000000000..12be3f8fad --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/detailRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/detailRest'); +const { schema: xRequest } = require('./schemas/request/detailRest'); + +const openapi = { + summary: 'Provides detailed profile information by URI', + description: `This endpoint fetches detailed information of a user profile based on the provided URI. It aims to give a comprehensive view of a user's profile including personal details, roles, and any other related data defined within the scope of the endpoint. + +**Authentication:** Users need to be authenticated to access profile details. Access is denied if the authentication credentials are invalid or not provided. + +**Permissions:** This endpoint requires the user to have specific permissions to view detailed profile information. The required permission typically includes the ability to view user details or specific roles that involve administrative rights over user profiles. + +The flow begins by the endpoint receiving a URI parameter that identifies a specific user profile. It then calls the \`detailByUri\` method from the \`profiles\` core module. This method is responsible for querying the database to retrieve all pertinent details associated with the given URI. The data fetched encompasses all comprehensive attributes and associations relevant to the user profile. Once data is successfully retrieved and compiled, it is formatted into a JSON structure and sent as a response to the client, providing all the necessary details about the user profile as specified by the requester's permissions.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/getProfileSysNameRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/getProfileSysNameRest.js new file mode 100644 index 0000000000..731d14255b --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/getProfileSysNameRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/getProfileSysNameRest'); +const { schema: xRequest } = require('./schemas/request/getProfileSysNameRest'); + +const openapi = { + summary: 'Fetch system name of a user profile', + description: `This endpoint retrieves the system name associated with a specific user profile. The system name is a unique identifier typically used for internal processing and integrations. + +**Authentication:** User authentication is required to access this endpoint. Unauthenticated requests are denied and result in an error. + +**Permissions:** Users need to have 'read' access rights to the profile data to utilize this endpoint. Without the necessary permissions, the system restricts data retrieval to safeguard user information. + +Upon request, the \`getProfileSysNameRest\` action invokes the \`getProfileSysName\` function from the \`profiles\` core module. This function processes the incoming request to determine the appropriate profile based on the user's context and extracts the system name from the profile data. It then returns this system name as a string in the HTTP response. The entire operation ensures that the user's data is accessed securely and only reveals the system name to those with the appropriate permissions.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/listRest.js new file mode 100644 index 0000000000..bc18a32cf2 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'Lists user profiles available in the system', + description: `This endpoint fetches a comprehensive list of all user profiles available within the platform. It aims to provide a structured overview useful for administrative purposes or user management interfaces. + +**Authentication:** Access to this endpoint requires the user to be logged in to the system. Any unauthorized access attempts will be rejected. + +**Permissions:** This endpoint requires the user to have administrative privileges or specific rights that allow the viewing of user profiles across the platform. + +Upon receiving a request, the endpoint initially ensures that the user is authenticated and authorized to access the data. This verification involves checking the user's authentication token and confirming that they have the necessary permissions. If authentication or authorization fails, the request is immediately rejected. Once verified, the endpoint calls the \`listProfiles\` method from the \`Profiles\` core. This method interacts with the database to retrieve all the profiles stored within it. Each profile is collected and formatted suitably before being sent back to the requester. The final output is delivered as a JSON array of profiles, each containing relevant details such as user IDs, names, and associated roles or permissions.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/addAllPermissionsToAllProfilesRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/addAllPermissionsToAllProfilesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/addAllPermissionsToAllProfilesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/addRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/addRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/addRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/detailRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/detailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/detailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/getProfileSysNameRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/getProfileSysNameRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/getProfileSysNameRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/listRest.js new file mode 100644 index 0000000000..b5732512ef --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/listRest.js @@ -0,0 +1,17 @@ +// automatic hash: 3ba4783867b78e740013f76b22acc51e0b3f5881483026a6503e19f287153919 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + page: { + type: 'number', + }, + size: { + type: 'number', + }, + }, + required: ['page', 'size'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/updateRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/addAllPermissionsToAllProfilesRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/addAllPermissionsToAllProfilesRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/addAllPermissionsToAllProfilesRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/addRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/addRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/addRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/detailRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/detailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/detailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/getProfileSysNameRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/getProfileSysNameRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/getProfileSysNameRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/listRest.js new file mode 100644 index 0000000000..87b3f11fa7 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/listRest.js @@ -0,0 +1,134 @@ +// automatic hash: 062dd33508ab48deb59a6a477af61c3bf6be1626b86760d7624fe59d2339fc1b +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + data: { + type: 'object', + properties: { + items: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'description', + 'uri', + 'indexable', + 'sysName', + 'isDeleted', + '__v', + 'role', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + description: { + type: 'string', + minLength: 1, + }, + uri: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + sysName: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + role: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + count: { + type: 'number', + }, + totalCount: { + type: 'number', + }, + totalPages: { + type: 'number', + }, + page: { + type: 'number', + }, + size: { + type: 'number', + }, + nextPage: { + type: 'number', + }, + prevPage: { + type: 'number', + }, + canGoPrevPage: { + type: 'boolean', + }, + canGoNextPage: { + type: 'boolean', + }, + }, + required: [ + 'items', + 'count', + 'totalCount', + 'totalPages', + 'page', + 'size', + 'nextPage', + 'prevPage', + 'canGoPrevPage', + 'canGoNextPage', + ], + }, + }, + required: ['status', 'data'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/updateRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/updateRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/updateRest.js new file mode 100644 index 0000000000..08befc41b7 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/profiles/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Updates user profile details', + description: `This endpoint allows for the updating of user profile details based on the provided profile information. The update can include changes in name, roles, and other specific profile attributes that are supported by the system. + +**Authentication:** Users need to be authenticated to update a profile. The endpoint validates the provided session or authentication token to ensure the request is made by a registered and logged-in user. + +**Permissions:** The executing user must have admin privileges or specific permission to update user profiles. Any attempt to update a profile without the required permissions will lead to a permission denial error. + +Upon receiving the update request, the handler first verifies user authentication and checks if the logged-in user has the necessary permissions. It calls the \`existName\` method to check if the provided new profile name already exists, ensuring uniqueness of profile names in the system. The \`update\` function is then executed from 'profiles/index.js', with parameters gathered from the request body, to apply the updates in the user database. This process involves interaction with several services to correctly update all elements related to the user profile, including roles and permissions. The success or failure of the operation, along with the updated profile details, is then sent back to the user in the form of a JSON response.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/addRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/addRest.js new file mode 100644 index 0000000000..5eccec1b56 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/addRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/addRest'); +const { schema: xRequest } = require('./schemas/request/addRest'); + +const openapi = { + summary: 'Add role information into the system', + description: `This endpoint allows for the addition of new role data into the system. It specifically handles the creation of roles along with their respective permissions and associated details within the user management module of the platform. + +**Authentication:** Users must be logged in to create new roles. This endpoint requires a valid authentication token, which should be included in the request headers. + +**Permissions:** Users need to have 'create_role' permission to access this endpoint. Without this permission, the endpoint will deny the request, ensuring that only authorized users can add new roles. + +Upon receiving a request, the \`add\` action in the roles management service is called. The service first checks for the necessary permissions against the user's role. If validated, it processes the provided data to ensure it meets the format and validation standards set by the platform. Once the data is validated, it interacts with the underlying database to insert the new role record. A response is then generated based on the outcome of the database operation - success if the role is added correctly, or an error message detailing any issues encountered during the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/detailRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/detailRest.js new file mode 100644 index 0000000000..f3e02739d0 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/detailRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/detailRest'); +const { schema: xRequest } = require('./schemas/request/detailRest'); + +const openapi = { + summary: 'Provides detailed information about a specific role', + description: `This endpoint retrieves detailed information about a specified role within the system, including all related permissions, users associated with the role, and system-wide implications of the role. + +**Authentication:** This endpoint requires that the user must be logged in to access this information. Unauthenticated attempts to access this endpoint will be rejected. + +**Permissions:** The user needs to have 'admin' level permissions to view detailed role information. Attempting to access without sufficient permissions will result in access denial. + +The process initiated by this endpoint involves fetching role details primarily from the \`getRoleDetails\` function within the \`roles\` service. The function queries the database to gather comprehensive details about the role, including linked permissions and users. Subsequently, the method may involve additional validation checks to ensure that the user requesting the information has the necessary permissions to view these details. The final response to the request will provide a complete set of information about the role structured in a JSON format.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/listRest.js new file mode 100644 index 0000000000..0d35d4cd0e --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/listRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + summary: 'List roles available in the system', + description: `This endpoint lists all the roles available within the system, providing a comprehensive overview of what types of roles users can be assigned to. It is particularly useful for system administrators or software managing user permissions and role-based access controls within the application. + +**Authentication:** Users need to be authenticated to access this list. Access will be denied if the authentication credentials are not provided or are invalid. + +**Permissions:** This endpoint requires administrative rights. A user must have the proper administrative role or permission set to access the roles list, ensuring that only authorized personnel can view sensitive role information. + +Upon receiving a request, this endpoint initiates by invoking the \`listRoles\` method within the roles management service. This method interacts with the database to retrieve all records from the roles collection. The resulting data includes detailed role identifiers, names, and any associated permissions or constraints each role bears. The response from the service is structured and returned to the requester in JSON format, outlining all roles with their respective details.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/request/addRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/request/addRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/request/addRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/request/detailRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/request/detailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/request/detailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/request/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/request/listRest.js new file mode 100644 index 0000000000..b5732512ef --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/request/listRest.js @@ -0,0 +1,17 @@ +// automatic hash: 3ba4783867b78e740013f76b22acc51e0b3f5881483026a6503e19f287153919 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + page: { + type: 'number', + }, + size: { + type: 'number', + }, + }, + required: ['page', 'size'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/request/updateRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/request/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/request/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/response/addRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/response/addRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/response/addRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/response/detailRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/response/detailRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/response/detailRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/response/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/response/listRest.js new file mode 100644 index 0000000000..00bb3cca87 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/response/listRest.js @@ -0,0 +1,65 @@ +// automatic hash: 44d5bbd36866a7c445ad9916c5fe0f94b4f2b9442e436c043f1f278209200251 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + data: { + type: 'object', + properties: { + items: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + count: { + type: 'number', + }, + totalCount: { + type: 'number', + }, + totalPages: { + type: 'number', + }, + page: { + type: 'number', + }, + size: { + type: 'number', + }, + nextPage: { + type: 'number', + }, + prevPage: { + type: 'number', + }, + canGoPrevPage: { + type: 'boolean', + }, + canGoNextPage: { + type: 'boolean', + }, + }, + required: [ + 'items', + 'count', + 'totalCount', + 'totalPages', + 'page', + 'size', + 'nextPage', + 'prevPage', + 'canGoPrevPage', + 'canGoNextPage', + ], + }, + }, + required: ['status', 'data'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/response/updateRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/response/updateRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/schemas/response/updateRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/updateRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/updateRest.js new file mode 100644 index 0000000000..41866ae445 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/roles/updateRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/updateRest'); +const { schema: xRequest } = require('./schemas/request/updateRest'); + +const openapi = { + summary: 'Update user roles', + description: `This endpoint updates the roles assigned to a user based on input specifications. It typically involves modifying specific role attributes or replacing an existing role with a new set in the system database. + +**Authentication:** Users must be authenticated to modify roles. Lack of proper authentication will prohibit access to this endpoint. + +**Permissions:** The user requires administrator level permissions to update roles, ensuring that only authorized personnel can make changes to role configurations. + +Upon receiving a request, the endpoint initially validates the user's authentication and authorization levels. It then employs a series of method calls beginning with \`validateRoleUpdateParams\`, which ensures the request parameters meet the necessary criteria for a valid role update. After validation, the \`updateRole\` function from the roles service is invoked, where the actual updates to the role records are performed based on the provided parameters. This may include changing the role name, description, or associated permissions. The response back to the client confirms the successful update of the roles, supplemented by any relevant data changes made during the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/activateUserRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/activateUserRest.js new file mode 100644 index 0000000000..fcbbb49705 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/activateUserRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/activateUserRest'); +const { schema: xRequest } = require('./schemas/request/activateUserRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/activeUserAgentRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/activeUserAgentRest.js new file mode 100644 index 0000000000..cd66953fce --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/activeUserAgentRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/activeUserAgentRest'); +const { schema: xRequest } = require('./schemas/request/activeUserAgentRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/agentDetailForPageRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/agentDetailForPageRest.js new file mode 100644 index 0000000000..e5561772e9 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/agentDetailForPageRest.js @@ -0,0 +1,32 @@ +const { schema } = require('./schemas/response/agentDetailForPageRest'); +const { + schema: xRequest, +} = require('./schemas/request/agentDetailForPageRest'); + +const openapi = { + summary: + "Provides detailed information about a user agent's profile for a specific page", + description: `This endpoint is designed to fetch detailed information about a user agent's profile tailored for rendering on a particular page. The information typically includes detailed user agent data which is crucial for frontend displays such as user dashboards or profile pages. + +**Authentication:** Users need to be authenticated to request their agent detail for a page. Accessing this endpoint without valid authentication will result in a denial of the request. + +**Permissions:** The user must have the permission to view the specific user agent's details. The necessary permissions involve querying user agent-related data that might be sensitive. + +Upon receiving a request, the endpoint first validates the provided authentication tokens to ensure that the requestor has the rights to access the information. The method \`agentDetailForPage\` in the \`UserAgents\` service is then called with necessary parameters like user agent ID and context. This function queries the database to retrieve detailed information about the user agent. This includes personal details, assigned roles, permissions, and other relevant data necessary for the user interface. The response from this call is then formatted appropriately and returned as a JSON object representing the user agent's profile suitable for page-specific uses.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/canRegisterPasswordRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/canRegisterPasswordRest.js new file mode 100644 index 0000000000..fc0b8183c2 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/canRegisterPasswordRest.js @@ -0,0 +1,31 @@ +const { schema } = require('./schemas/response/canRegisterPasswordRest'); +const { + schema: xRequest, +} = require('./schemas/request/canRegisterPasswordRest'); + +const openapi = { + summary: 'Determine if a user can register a new password', + description: `This endpoint checks if a user is eligible to register a new password based on specific criteria defined by the system. The evaluation includes checks against user's current password state, security policies, and any other pre-defined system requirements. + +**Authentication:** Users must be logged in to perform this action. They need to provide valid authentication credentials before making the request to ensure secure access to the password registration facility. + +**Permissions:** The user needs to have specific permissions that allow them to update or change their password. Without these permissions, the request will be rejected and the action will not be performed. + +Upon receiving a request, the handler initiates a series of checks to assess the eligibility of the user for password registration. It starts by verifying user authentication and then consulting the system's policy to determine if the user's current conditions satisfy the requirements for registering a new password. This may involve checking for the time since the last password change, password complexity requirements, and any other related security measures. If the checks are passed, the endpoint indicates that the user can proceed with password registration, otherwise, it denies the request with appropriate feedback.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/canResetRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/canResetRest.js new file mode 100644 index 0000000000..8260e5fd27 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/canResetRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/canResetRest'); +const { schema: xRequest } = require('./schemas/request/canResetRest'); + +const openapi = { + summary: 'Determine if a user can reset their password', + description: `This endpoint checks if the requesting user has the ability to perform a password reset. It assesses various conditions such as the user's account status, any specific locks, or security settings that might prevent a password reset operation. + +**Authentication:** User authentication is required to access this endpoint. A valid session or security token needs to be presented to allow for the identity verification of the requester. + +**Permissions:** Users need to have the 'user.canResetPassword' permission explicitly set in their profile to initiate a password reset. Without this permission, the request will be denied, ensuring that only authorized users can attempt to reset their passwords. + +The flow of this controller involves initially receiving the request and extracting the user's credential details from it. This information is then used to check against existing records and configurations in a security module that enforces password policies and user account states. Dependent on these conditions, the function \`canUserResetPassword\` is executed, which evaluates if the user meets all the requirements for a password reset. It considers factors like account status (active, locked, etc.), security policies regarding password resets, and any recent activity that might influence security decisions. If all conditions are satisfied, the endpoint will confirm that the password reset can proceed.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/centerProfileTokenRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/centerProfileTokenRest.js new file mode 100644 index 0000000000..17f26b824e --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/centerProfileTokenRest.js @@ -0,0 +1,25 @@ +const { schema } = require('./schemas/response/centerProfileTokenRest'); +const { + schema: xRequest, +} = require('./schemas/request/centerProfileTokenRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/centersRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/centersRest.js new file mode 100644 index 0000000000..ad833932cc --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/centersRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/centersRest'); +const { schema: xRequest } = require('./schemas/request/centersRest'); + +const openapi = { + summary: 'Manages centers associated with user roles', + description: `This endpoint handles the management and association of centers with different user roles within the platform. It is designed to facilitate the administration of access permissions and functionalities across different organizational structures in a multi-centered organization setup. + +**Authentication:** Users need to be authenticated to manage centers tied to user roles. The system checks if the session contains a valid authentication token before proceeding with any operations. + +**Permissions:** Users must possess administrative privileges or specific role management permissions to alter or manage center-role associations. Lack of adequate permissions will lead to access denial. + +The flow begins with authentication verification to ensure active and legitimate session status. Post authentication, the system checks for specific permissions related to center and role management. If permissions are validated, the handler proceeds to invoke various core methods that manage the assignment or association of centers to different roles based on the rules defined in the business logic. These operations might include creating new associations, modifying existing ones, or listing centers based on role specifications. Each operation interacts with the database to retrieve or update information, ensuring that all changes are persistently reflected.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/contactsRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/contactsRest.js new file mode 100644 index 0000000000..ee07e5eb5e --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/contactsRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/contactsRest'); +const { schema: xRequest } = require('./schemas/request/contactsRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/createBulkRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/createBulkRest.js new file mode 100644 index 0000000000..916c40c170 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/createBulkRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/createBulkRest'); +const { schema: xRequest } = require('./schemas/request/createBulkRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/createSuperAdminRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/createSuperAdminRest.js new file mode 100644 index 0000000000..75aa3eb1fc --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/createSuperAdminRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/createSuperAdminRest'); +const { schema: xRequest } = require('./schemas/request/createSuperAdminRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/deleteUserAgentRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/deleteUserAgentRest.js new file mode 100644 index 0000000000..a69cf31628 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/deleteUserAgentRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/deleteUserAgentRest'); +const { schema: xRequest } = require('./schemas/request/deleteUserAgentRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/detailForPageRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/detailForPageRest.js new file mode 100644 index 0000000000..a3906835aa --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/detailForPageRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/detailForPageRest'); +const { schema: xRequest } = require('./schemas/request/detailForPageRest'); + +const openapi = { + summary: 'Provides detailed user information for a specific page', + description: `This endpoint is designed to fetch and display detailed information about a user that is pertinent to a specific page view. This involves collating user details that enhance the user experience by tailoring page content to individual user profiles. + +**Authentication:** The user must be logged in to access detailed information about themselves or others, depending on the permissions granted. Authentication ensures that requests are made by known users. + +**Permissions:** User must have the 'view_details' permission for accessing detailed information. This permission check ensures that only authorized users can access sensitive data. + +From the initial API call, the method \`detailForPage\` is triggered within the user's service context. This method performs various checks, starting with authentication verification followed by permission checks. Upon successful validation, it retrieves user-specific data tailored to enhance the content of the page where the user info is displayed. The data retrieval involves querying the database for user attributes and settings that are relevant to the page context. The response from this method is then formatted into JSON and sent back to the client, providing a rich, context-specific view of the user's data.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/detailRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/detailRest.js new file mode 100644 index 0000000000..70fdf12a5b --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/detailRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/detailRest'); +const { schema: xRequest } = require('./schemas/request/detailRest'); + +const openapi = { + summary: 'Provides detailed user profile information', + description: `This endpoint retrieves detailed information about a user's profile based on the provided user ID. The details include various attributes such as name, email, roles, and associated permissions within the system. + +**Authentication:** User authentication is required to access this endpoint. A valid session token must be provided in the request header to verify the user's identity and session validity. + +**Permissions:** The user needs to have the 'view_profile' permission to retrieve detailed user information. Access without sufficient permissions will lead to a denial of the request. + +Upon receiving the request, the server handler first checks for a valid session token and then proceeds to verify if the logged-in user has the necessary permissions to view user profiles. If these checks pass, the 'getUserDetails' method from the user management service is called with the user ID extracted from the request path. This method interacts with the database to fetch all relevant information about the user. The final response includes a comprehensive JSON object containing all the details of the user's profile.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/disableUserAgentRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/disableUserAgentRest.js new file mode 100644 index 0000000000..500a60d81b --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/disableUserAgentRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/disableUserAgentRest'); +const { schema: xRequest } = require('./schemas/request/disableUserAgentRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/getActiveUserAgentsCountByProfileSysNameRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/getActiveUserAgentsCountByProfileSysNameRest.js new file mode 100644 index 0000000000..5fe5b81f21 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/getActiveUserAgentsCountByProfileSysNameRest.js @@ -0,0 +1,27 @@ +const { + schema, +} = require('./schemas/response/getActiveUserAgentsCountByProfileSysNameRest'); +const { + schema: xRequest, +} = require('./schemas/request/getActiveUserAgentsCountByProfileSysNameRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/getDataForUserAgentDatasetsRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/getDataForUserAgentDatasetsRest.js new file mode 100644 index 0000000000..5a00928a9c --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/getDataForUserAgentDatasetsRest.js @@ -0,0 +1,27 @@ +const { + schema, +} = require('./schemas/response/getDataForUserAgentDatasetsRest'); +const { + schema: xRequest, +} = require('./schemas/request/getDataForUserAgentDatasetsRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/getRememberLoginRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/getRememberLoginRest.js new file mode 100644 index 0000000000..61751672be --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/getRememberLoginRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/getRememberLoginRest'); +const { schema: xRequest } = require('./schemas/request/getRememberLoginRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/getUserAgentsInfoRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/getUserAgentsInfoRest.js new file mode 100644 index 0000000000..b122b7c1f1 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/getUserAgentsInfoRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/getUserAgentsInfoRest'); +const { schema: xRequest } = require('./schemas/request/getUserAgentsInfoRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/listRest.js new file mode 100644 index 0000000000..c18c47a806 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/listRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/listRest'); +const { schema: xRequest } = require('./schemas/request/listRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/loginRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/loginRest.js new file mode 100644 index 0000000000..64322a29d5 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/loginRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/loginRest'); +const { schema: xRequest } = require('./schemas/request/loginRest'); + +const openapi = { + summary: 'Authenticate and generate session token for user', + description: `This endpoint handles user authentication processes including validating user credentials and generating a session token. The token can then be used for subsequent requests that require user authentication. + +**Authentication:** No prior authentication is needed for this endpoint since its primary function is to authenticate users. + +**Permissions:** This endpoint requires no explicit permissions since it is accessible to any user who needs to authenticate. + +Upon receiving the request, the endpoint first validates the provided user credentials against stored records using the \`comparePassword\` method. If the credentials are valid, the \`generateJWTToken\` method is invoked to create a new JWT token. This token encapsulates the user's identity and permissions, enabling authorized access to protected resources. The response, if successful, includes the JWT token and perhaps other user-related information essential for subsequent interactions with the API.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/profileTokenRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/profileTokenRest.js new file mode 100644 index 0000000000..ae4de6517c --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/profileTokenRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/profileTokenRest'); +const { schema: xRequest } = require('./schemas/request/profileTokenRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/profilesRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/profilesRest.js new file mode 100644 index 0000000000..ab34b86c17 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/profilesRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/profilesRest'); +const { schema: xRequest } = require('./schemas/request/profilesRest'); + +const openapi = { + summary: 'Manage user profiles and settings', + description: `This endpoint allows for the management and retrieval of user profiles, including settings related to user preferences and security configurations. It serves as a central point for user-related information handling within the system. + +**Authentication:** Users need to be authenticated in order to access and manipulate their profile data. Authentication verification is required to ensure secure access to personal information. + +**Permissions:** Adequate permissions are required to access or modify different levels of user profile information. Specific roles or privileges determine the extent of data that can be managed or viewed. Permissions checks are integral to secure and appropriate data access. + +The process begins with the \`profilesRest\` handler, which interacts with multiple backend services to fetch or update user details. Calls may include fetching user data from the database, updating security settings, and managing user preferences. Each action within the handler is secured and validated against user permissions and authentication status, ensuring that only authorized actions are performed. The response is systematically formatted to reflect the result of the requested operation, whether it's data retrieval or a confirmation of updates made.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/recoverRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/recoverRest.js new file mode 100644 index 0000000000..6fe8cc44df --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/recoverRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/recoverRest'); +const { schema: xRequest } = require('./schemas/request/recoverRest'); + +const openapi = { + summary: 'Initiates user password recovery', + description: `This endpoint facilitates the password recovery process for users who have forgotten their login credentials. It typically involves the user entering their email address, to which a password reset link is sent if the email is associated with an existing account. + +**Authentication:** No prior authentication is required to access this endpoint, making it accessible for users who cannot log in. + +**Permissions:** There are no specific permissions required to access this endpoint. However, security measures are in place to ensure that the password reset process is secure and accessible only to the rightful account owner. + +Upon receiving a password recovery request, the endpoint validates the provided email address against the users database. If the email is found, the system generates a secure token and sends a password reset email to the corresponding user's email address. This token is typically embedded within a URL provided in the email, allowing the user to reset their password in a secure manner. The process ensures that sensitive user information remains protected throughout, without compromising the ease of access to the recovery feature.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/registerPasswordRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/registerPasswordRest.js new file mode 100644 index 0000000000..8cb14958cc --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/registerPasswordRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/registerPasswordRest'); +const { schema: xRequest } = require('./schemas/request/registerPasswordRest'); + +const openapi = { + summary: 'Registers a new password for the user', + description: `This endpoint allows a user to register a new password as part of the user account setup or password reset process. The registration involves validating the password strength and ensuring it complies with the platform's security requirements. + +**Authentication:** User authentication is not required for this endpoint as it typically part of an initial setup or password reset flow. + +**Permissions:** No permissions are required to access this endpoint as it is designed for users who are in the process of setting up their account or resetting their password. + +Upon receiving a password registration request, the endpoint validates the provided password against defined security policies to ensure it meets the minimum security standards. If the password is valid, it proceeds to securely hash the password using bcrypt and updates the user's password in the database. This process ensures that the user's new password is securely stored and ready for use in subsequent authentications. The response to the client confirms whether the password was successfully registered or provides details about any errors encountered during the process.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/removeRememberLoginRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/removeRememberLoginRest.js new file mode 100644 index 0000000000..425ca0aac9 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/removeRememberLoginRest.js @@ -0,0 +1,25 @@ +const { schema } = require('./schemas/response/removeRememberLoginRest'); +const { + schema: xRequest, +} = require('./schemas/request/removeRememberLoginRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/resetRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/resetRest.js new file mode 100644 index 0000000000..4d80a1dd5a --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/resetRest.js @@ -0,0 +1,29 @@ +const { schema } = require('./schemas/response/resetRest'); +const { schema: xRequest } = require('./schemas/request/resetRest'); + +const openapi = { + summary: 'Reset user password', + description: `This endpoint allows a user to reset their password using a valid reset token received via email. It facilitates users in recovering access to their accounts when they have forgotten their current password. + +**Authentication:** No prior user authentication is required to access this endpoint as it is designed for users who are unable to log in due to forgotten passwords. + +**Permissions:** There are no specific permissions needed to initiate a password reset request; however, the process requires a valid reset token which serves as a temporary authorization proving the request's legitimacy. + +The reset process is initiated when the user submits a request to this endpoint with the required reset token and a new password. The \`reset\` action in the users service first validates the provided reset token to ensure it is active and legitimate. It then proceeds to encrypt the new password using secure hashing algorithms and updates the user's password in the database. Upon successful update, the token is marked as used, preventing reuse, thus enhancing security. The user receives confirmation of the reset either via a success response or an error message if any step fails.`, + AIGenerated: 'true', + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/saveDataForUserAgentDatasetsRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/saveDataForUserAgentDatasetsRest.js new file mode 100644 index 0000000000..4a69f032f9 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/saveDataForUserAgentDatasetsRest.js @@ -0,0 +1,27 @@ +const { + schema, +} = require('./schemas/response/saveDataForUserAgentDatasetsRest'); +const { + schema: xRequest, +} = require('./schemas/request/saveDataForUserAgentDatasetsRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/activateUserRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/activateUserRest.js new file mode 100644 index 0000000000..b85ad21755 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/activateUserRest.js @@ -0,0 +1,19 @@ +// automatic hash: c087c012b385690c77dfaa4af288e202edbd83e1bb04edc2a1016071c3fd55e3 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + id: { + type: 'string', + minLength: 1, + }, + password: { + type: 'string', + minLength: 1, + }, + }, + required: ['id', 'password'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/activeUserAgentRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/activeUserAgentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/activeUserAgentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/agentDetailForPageRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/agentDetailForPageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/agentDetailForPageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/canRegisterPasswordRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/canRegisterPasswordRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/canRegisterPasswordRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/canResetRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/canResetRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/canResetRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/centerProfileTokenRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/centerProfileTokenRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/centerProfileTokenRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/centersRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/centersRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/centersRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/contactsRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/contactsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/contactsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/createBulkRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/createBulkRest.js new file mode 100644 index 0000000000..026c825f06 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/createBulkRest.js @@ -0,0 +1,60 @@ +// automatic hash: 7213b183d7098258de35c1ea62cd1ee28b789658ca68ce3ae7eda38356385884 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + users: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'email', + 'name', + 'surnames', + 'secondSurname', + 'gender', + 'birthdate', + ], + properties: { + email: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + surnames: { + type: 'string', + minLength: 1, + }, + secondSurname: { + type: 'string', + minLength: 1, + }, + gender: { + type: 'string', + minLength: 1, + }, + birthdate: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + center: { + type: 'string', + minLength: 1, + }, + profile: { + type: 'string', + minLength: 1, + }, + }, + required: ['users', 'center', 'profile'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/createSuperAdminRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/createSuperAdminRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/createSuperAdminRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/deleteUserAgentRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/deleteUserAgentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/deleteUserAgentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/detailForPageRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/detailForPageRest.js new file mode 100644 index 0000000000..b8758b395b --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/detailForPageRest.js @@ -0,0 +1,15 @@ +// automatic hash: f6a53a2c17213c7960c1ebfda1f3af4fba0b76ebf2f97039eb41a0b2fa401957 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + id: { + type: 'string', + minLength: 1, + }, + }, + required: ['id'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/detailRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/detailRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/detailRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/disableUserAgentRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/disableUserAgentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/disableUserAgentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/getActiveUserAgentsCountByProfileSysNameRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/getActiveUserAgentsCountByProfileSysNameRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/getActiveUserAgentsCountByProfileSysNameRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/getDataForUserAgentDatasetsRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/getDataForUserAgentDatasetsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/getDataForUserAgentDatasetsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/getRememberLoginRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/getRememberLoginRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/getRememberLoginRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/getUserAgentsInfoRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/getUserAgentsInfoRest.js new file mode 100644 index 0000000000..b4142eb695 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/getUserAgentsInfoRest.js @@ -0,0 +1,30 @@ +// automatic hash: 99665fbb517db39b3b8e643687f557df3afc9d90689d194ee0de1d27eca1f656 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + ids: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + options: { + type: 'object', + properties: { + withCenter: { + type: 'boolean', + }, + withProfile: { + type: 'boolean', + }, + }, + required: ['withCenter', 'withProfile'], + }, + }, + required: ['ids', 'options'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/loginRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/loginRest.js new file mode 100644 index 0000000000..064bbe94b2 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/loginRest.js @@ -0,0 +1,19 @@ +// automatic hash: 300739bc98ab4a79853d3c5a67f24c3e0e3ffe03642fcc0d7278f16dfce5c8ce +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + email: { + type: 'string', + minLength: 1, + }, + password: { + type: 'string', + minLength: 1, + }, + }, + required: ['email', 'password'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/profileTokenRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/profileTokenRest.js new file mode 100644 index 0000000000..b8758b395b --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/profileTokenRest.js @@ -0,0 +1,15 @@ +// automatic hash: f6a53a2c17213c7960c1ebfda1f3af4fba0b76ebf2f97039eb41a0b2fa401957 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + id: { + type: 'string', + minLength: 1, + }, + }, + required: ['id'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/profilesRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/profilesRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/profilesRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/recoverRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/recoverRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/recoverRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/registerPasswordRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/registerPasswordRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/registerPasswordRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/removeRememberLoginRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/removeRememberLoginRest.js new file mode 100644 index 0000000000..20bffe2d62 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/removeRememberLoginRest.js @@ -0,0 +1,10 @@ +// automatic hash: ed521298ce514a32155572e51256556918675a7843df6045c258223bd8d4866f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: {}, + required: [], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/resetRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/resetRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/resetRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/saveDataForUserAgentDatasetsRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/saveDataForUserAgentDatasetsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/saveDataForUserAgentDatasetsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/searchUserAgentsRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/searchUserAgentsRest.js new file mode 100644 index 0000000000..ceec1a205d --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/searchUserAgentsRest.js @@ -0,0 +1,28 @@ +// automatic hash: ab1fe1b6454e2cae2bd3a71db3af44c9d539420f5b51ca9eaca910eec240ac5a +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + filters: { + type: 'object', + properties: { + queryWithContains: { + type: 'boolean', + }, + profile: { + type: 'string', + minLength: 1, + }, + center: { + type: 'string', + minLength: 1, + }, + }, + required: ['queryWithContains', 'profile', 'center'], + }, + }, + required: ['filters'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/sendWelcomeEmailToUserRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/sendWelcomeEmailToUserRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/sendWelcomeEmailToUserRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/setRememberLoginRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/setRememberLoginRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/setRememberLoginRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/updateSessionConfigRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/updateSessionConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/updateSessionConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/updateUserAgentRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/updateUserAgentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/updateUserAgentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/updateUserAvatarRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/updateUserAvatarRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/updateUserAvatarRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/updateUserRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/updateUserRest.js new file mode 100644 index 0000000000..3696859bad --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/request/updateUserRest.js @@ -0,0 +1,19 @@ +// automatic hash: 760d58792e43b4e7faf1f95a48d33efa56e835fca98998645f594164ed9ef8e0 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + id: { + type: 'string', + minLength: 1, + }, + locale: { + type: 'string', + minLength: 1, + }, + }, + required: ['id', 'locale'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/activateUserRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/activateUserRest.js new file mode 100644 index 0000000000..e7aca777f8 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/activateUserRest.js @@ -0,0 +1,120 @@ +// automatic hash: df08063be1d45dab4ffa3556dfa95c91d0ce31f01df1ad96186a2980f5c49113 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + user: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + surnames: { + type: 'string', + minLength: 1, + }, + secondSurname: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + birthdate: { + type: 'object', + properties: {}, + required: [], + }, + locale: { + type: 'string', + minLength: 1, + }, + active: { + type: 'boolean', + }, + status: { + type: 'string', + minLength: 1, + }, + gender: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + avatar: { + type: 'string', + minLength: 1, + }, + avatarAsset: { + type: 'string', + minLength: 1, + }, + password: { + type: 'string', + minLength: 1, + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'surnames', + 'secondSurname', + 'email', + 'birthdate', + 'locale', + 'active', + 'status', + 'gender', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'avatar', + 'avatarAsset', + 'password', + ], + }, + }, + required: ['status', 'user'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/activeUserAgentRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/activeUserAgentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/activeUserAgentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/agentDetailForPageRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/agentDetailForPageRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/agentDetailForPageRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/canRegisterPasswordRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/canRegisterPasswordRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/canRegisterPasswordRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/canResetRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/canResetRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/canResetRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/centerProfileTokenRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/centerProfileTokenRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/centerProfileTokenRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/centersRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/centersRest.js new file mode 100644 index 0000000000..8013023024 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/centersRest.js @@ -0,0 +1,181 @@ +// automatic hash: 20b9a2620ba2b7444bbe86456b8d67aeb1c14bc82bc8c1fd1ec68d0397cc6570 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + centers: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'locale', + 'uri', + 'timezone', + 'firstDayOfWeek', + 'country', + 'city', + 'postalCode', + 'street', + 'isDeleted', + '__v', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + locale: { + type: 'string', + minLength: 1, + }, + uri: { + type: 'string', + minLength: 1, + }, + timezone: { + type: 'string', + minLength: 1, + }, + firstDayOfWeek: { + type: 'number', + }, + country: { + type: 'string', + minLength: 1, + }, + city: { + type: 'string', + minLength: 1, + }, + postalCode: { + type: 'string', + minLength: 1, + }, + street: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + profiles: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'description', + 'uri', + 'indexable', + 'sysName', + 'isDeleted', + '__v', + 'role', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + description: { + type: 'string', + minLength: 1, + }, + uri: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + sysName: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + role: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + }, + }, + }, + }, + required: ['status', 'centers'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/contactsRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/contactsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/contactsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/createBulkRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/createBulkRest.js new file mode 100644 index 0000000000..6e807eb847 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/createBulkRest.js @@ -0,0 +1,105 @@ +// automatic hash: 91fc194c61f05903cfc6e7d0724fbcd37aaea37db8dda980f9c8b2db062cf60e +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + users: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'surnames', + 'secondSurname', + 'email', + 'locale', + 'active', + 'status', + 'gender', + 'isDeleted', + '__v', + ], + properties: { + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + surnames: { + type: 'string', + minLength: 1, + }, + secondSurname: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + birthdate: { + type: 'object', + properties: {}, + required: [], + }, + locale: { + type: 'string', + minLength: 1, + }, + active: { + type: 'boolean', + }, + status: { + type: 'string', + minLength: 1, + }, + gender: { + type: 'string', + minLength: 1, + }, + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + }, + }, + }, + required: ['status', 'users'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/createSuperAdminRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/createSuperAdminRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/createSuperAdminRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/deleteUserAgentRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/deleteUserAgentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/deleteUserAgentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/detailForPageRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/detailForPageRest.js new file mode 100644 index 0000000000..f0d308a1d1 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/detailForPageRest.js @@ -0,0 +1,420 @@ +// automatic hash: 8c1c947c4b2f97ca5ae1c027e25383d7236a77f40004262468da95b0cc5636bf +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + data: { + type: 'object', + properties: { + user: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + surnames: { + type: 'string', + minLength: 1, + }, + secondSurname: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + birthdate: { + type: 'object', + properties: {}, + required: [], + }, + locale: { + type: 'string', + minLength: 1, + }, + active: { + type: 'boolean', + }, + status: { + type: 'string', + minLength: 1, + }, + gender: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + avatar: { + type: 'string', + minLength: 1, + }, + avatarAsset: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + cover: { + type: 'string', + minLength: 1, + }, + fromUser: { + type: 'string', + minLength: 1, + }, + fromUserAgent: { + type: 'string', + minLength: 1, + }, + public: { + type: 'boolean', + }, + category: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + isCover: { + type: 'boolean', + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + permissions: { + type: 'object', + properties: { + viewer: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + editor: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['viewer', 'editor'], + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'cover', + 'fromUser', + 'fromUserAgent', + 'public', + 'category', + 'indexable', + 'isCover', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'permissions', + ], + }, + preferences: {}, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'surnames', + 'secondSurname', + 'email', + 'birthdate', + 'locale', + 'active', + 'status', + 'gender', + 'isDeleted', + 'createdAt', + 'updatedAt', + 'avatar', + 'avatarAsset', + ], + }, + userAgents: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['id', 'role', 'disabled'], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + role: { + type: 'string', + minLength: 1, + }, + disabled: { + type: 'boolean', + }, + profile: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + description: { + type: 'string', + minLength: 1, + }, + uri: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + sysName: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + role: { + type: 'string', + minLength: 1, + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'description', + 'uri', + 'indexable', + 'sysName', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'role', + ], + }, + center: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + locale: { + type: 'string', + minLength: 1, + }, + uri: { + type: 'string', + minLength: 1, + }, + timezone: { + type: 'string', + minLength: 1, + }, + firstDayOfWeek: { + type: 'number', + }, + country: { + type: 'string', + minLength: 1, + }, + city: { + type: 'string', + minLength: 1, + }, + postalCode: { + type: 'string', + minLength: 1, + }, + street: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'locale', + 'uri', + 'timezone', + 'firstDayOfWeek', + 'country', + 'city', + 'postalCode', + 'street', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + ], + }, + }, + }, + }, + dataset: { + type: 'object', + properties: { + jsonSchema: {}, + jsonUI: {}, + value: {}, + }, + required: [], + }, + }, + required: ['user', 'userAgents', 'dataset'], + }, + }, + required: ['status', 'data'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/detailRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/detailRest.js new file mode 100644 index 0000000000..e649d04db4 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/detailRest.js @@ -0,0 +1,109 @@ +// automatic hash: 3e204fe927a547cc319a77d7b43d9687541bf0e88e624e8d78548e080e96591b +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + user: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + surnames: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + birthdate: { + type: 'object', + properties: {}, + required: [], + }, + locale: { + type: 'string', + minLength: 1, + }, + active: { + type: 'boolean', + }, + gender: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + avatar: { + type: 'string', + minLength: 1, + }, + avatarAsset: { + type: 'string', + minLength: 1, + }, + isSuperAdmin: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'surnames', + 'email', + 'birthdate', + 'locale', + 'active', + 'gender', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'avatar', + 'avatarAsset', + 'isSuperAdmin', + ], + }, + }, + required: ['status', 'user'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/disableUserAgentRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/disableUserAgentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/disableUserAgentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/getActiveUserAgentsCountByProfileSysNameRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/getActiveUserAgentsCountByProfileSysNameRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/getActiveUserAgentsCountByProfileSysNameRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/getDataForUserAgentDatasetsRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/getDataForUserAgentDatasetsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/getDataForUserAgentDatasetsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/getRememberLoginRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/getRememberLoginRest.js new file mode 100644 index 0000000000..550dc1f33a --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/getRememberLoginRest.js @@ -0,0 +1,16 @@ +// automatic hash: 580da2328934d6cf833a0f09b60860574944a3360d6558c0784f7ee8e9271e30 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + profile: {}, + center: {}, + }, + required: ['status'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/getUserAgentsInfoRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/getUserAgentsInfoRest.js new file mode 100644 index 0000000000..23282e87a3 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/getUserAgentsInfoRest.js @@ -0,0 +1,21 @@ +// automatic hash: f36039dadf652d5c26bd72faf37b9af61c49794578284b96aacca036ab7fac80 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + userAgents: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + }, + required: ['status', 'userAgents'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/listRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/listRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/listRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/loginRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/loginRest.js new file mode 100644 index 0000000000..c596a52c8e --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/loginRest.js @@ -0,0 +1,113 @@ +// automatic hash: 50c57c6d7e858f6e387b3b4182db521df895c80eb7ec9f75112af2ab879ef504 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + user: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + surnames: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + birthdate: { + type: 'object', + properties: {}, + required: [], + }, + locale: { + type: 'string', + minLength: 1, + }, + active: { + type: 'boolean', + }, + gender: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + avatar: { + type: 'string', + minLength: 1, + }, + avatarAsset: { + type: 'string', + minLength: 1, + }, + isSuperAdmin: { + type: 'boolean', + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'surnames', + 'email', + 'birthdate', + 'locale', + 'active', + 'gender', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'avatar', + 'avatarAsset', + 'isSuperAdmin', + ], + }, + jwtToken: { + type: 'string', + minLength: 1, + }, + }, + required: ['status', 'user', 'jwtToken'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/profileTokenRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/profileTokenRest.js new file mode 100644 index 0000000000..adea5bb1cd --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/profileTokenRest.js @@ -0,0 +1,114 @@ +// automatic hash: ecbeb2672c9b82c15dbac8ef212e5cd432c1ed4de259dabb04d91622f6866f58 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + jwtToken: { + type: 'object', + properties: { + userToken: { + type: 'string', + minLength: 1, + }, + sessionConfig: { + type: 'object', + properties: {}, + required: [], + }, + centers: { + type: 'array', + items: { + required: [], + properties: {}, + }, + }, + profiles: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'description', + 'uri', + 'indexable', + 'sysName', + 'isDeleted', + '__v', + 'role', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + description: { + type: 'string', + minLength: 1, + }, + uri: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + sysName: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + role: { + type: 'string', + minLength: 1, + }, + token: {}, + userAgentId: {}, + }, + }, + }, + }, + required: ['userToken', 'sessionConfig', 'centers', 'profiles'], + }, + }, + required: ['status', 'jwtToken'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/profilesRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/profilesRest.js new file mode 100644 index 0000000000..ef2952fc8a --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/profilesRest.js @@ -0,0 +1,90 @@ +// automatic hash: c427965057fdc3016ac02662a023fda303d4e8f79ffb00bbc8272f7038d790c9 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + profiles: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: [ + 'id', + 'deploymentID', + 'name', + 'description', + 'uri', + 'indexable', + 'sysName', + 'isDeleted', + '__v', + 'role', + ], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + description: { + type: 'string', + minLength: 1, + }, + uri: { + type: 'string', + minLength: 1, + }, + indexable: { + type: 'boolean', + }, + sysName: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + role: { + type: 'string', + minLength: 1, + }, + }, + }, + }, + }, + required: ['status', 'profiles'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/recoverRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/recoverRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/recoverRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/registerPasswordRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/registerPasswordRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/registerPasswordRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/removeRememberLoginRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/removeRememberLoginRest.js new file mode 100644 index 0000000000..7034a8e6be --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/removeRememberLoginRest.js @@ -0,0 +1,14 @@ +// automatic hash: 19f574e7100dda5870204615f58e1a193f4ccd51cf6468e87c7b79ec4ba9aa5f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + }, + required: ['status'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/resetRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/resetRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/resetRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/saveDataForUserAgentDatasetsRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/saveDataForUserAgentDatasetsRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/saveDataForUserAgentDatasetsRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/searchUserAgentsRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/searchUserAgentsRest.js new file mode 100644 index 0000000000..6731124f6e --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/searchUserAgentsRest.js @@ -0,0 +1,104 @@ +// automatic hash: cb71aca793fc382832e58da4b3ff7c2b4d058bead1181ed584f2ddd60978258f +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + userAgents: { + type: 'array', + uniqueItems: true, + minItems: 1, + items: { + required: ['id', 'role', 'disabled'], + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + user: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + surnames: { + type: 'string', + minLength: 1, + }, + secondSurname: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + birthdate: { + type: 'object', + properties: {}, + required: [], + }, + gender: { + type: 'string', + minLength: 1, + }, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + avatar: { + type: 'string', + minLength: 1, + }, + }, + required: [ + '_id', + 'id', + 'name', + 'surnames', + 'secondSurname', + 'email', + 'birthdate', + 'gender', + 'createdAt', + 'avatar', + ], + }, + role: { + type: 'string', + minLength: 1, + }, + disabled: { + type: 'boolean', + }, + }, + }, + }, + }, + required: ['status', 'userAgents'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/sendWelcomeEmailToUserRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/sendWelcomeEmailToUserRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/sendWelcomeEmailToUserRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/setRememberLoginRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/setRememberLoginRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/setRememberLoginRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/updateSessionConfigRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/updateSessionConfigRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/updateSessionConfigRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/updateUserAgentRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/updateUserAgentRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/updateUserAgentRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/updateUserAvatarRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/updateUserAvatarRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/updateUserAvatarRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/updateUserRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/updateUserRest.js new file mode 100644 index 0000000000..a963b690d9 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/schemas/response/updateUserRest.js @@ -0,0 +1,105 @@ +// automatic hash: 6b0e306c32efa52f37afbcbb0975fa1c4b4f8ab1eb4d4161c6128bce2313fa75 +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + description: '', + type: 'object', + properties: { + status: { + type: 'number', + }, + data: { + type: 'object', + properties: { + _id: { + type: 'object', + properties: { + valueOf: {}, + }, + required: ['valueOf'], + }, + id: { + type: 'string', + minLength: 1, + }, + deploymentID: { + type: 'string', + minLength: 1, + }, + name: { + type: 'string', + minLength: 1, + }, + surnames: { + type: 'string', + minLength: 1, + }, + email: { + type: 'string', + minLength: 1, + }, + birthdate: { + type: 'object', + properties: {}, + required: [], + }, + locale: { + type: 'string', + minLength: 1, + }, + active: { + type: 'boolean', + }, + gender: { + type: 'string', + minLength: 1, + }, + isDeleted: { + type: 'boolean', + }, + deletedAt: {}, + createdAt: { + type: 'object', + properties: {}, + required: [], + }, + updatedAt: { + type: 'object', + properties: {}, + required: [], + }, + __v: { + type: 'number', + }, + avatar: { + type: 'string', + minLength: 1, + }, + avatarAsset: { + type: 'string', + minLength: 1, + }, + }, + required: [ + '_id', + 'id', + 'deploymentID', + 'name', + 'surnames', + 'email', + 'birthdate', + 'locale', + 'active', + 'gender', + 'isDeleted', + 'createdAt', + 'updatedAt', + '__v', + 'avatar', + 'avatarAsset', + ], + }, + }, + required: ['status', 'data'], +}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/searchUserAgentsRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/searchUserAgentsRest.js new file mode 100644 index 0000000000..53eb47a6e5 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/searchUserAgentsRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/searchUserAgentsRest'); +const { schema: xRequest } = require('./schemas/request/searchUserAgentsRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/sendWelcomeEmailToUserRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/sendWelcomeEmailToUserRest.js new file mode 100644 index 0000000000..b9f50a29d7 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/sendWelcomeEmailToUserRest.js @@ -0,0 +1,25 @@ +const { schema } = require('./schemas/response/sendWelcomeEmailToUserRest'); +const { + schema: xRequest, +} = require('./schemas/request/sendWelcomeEmailToUserRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/setRememberLoginRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/setRememberLoginRest.js new file mode 100644 index 0000000000..7ca6ab0f39 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/setRememberLoginRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/setRememberLoginRest'); +const { schema: xRequest } = require('./schemas/request/setRememberLoginRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/updateSessionConfigRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/updateSessionConfigRest.js new file mode 100644 index 0000000000..1d366d1f8c --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/updateSessionConfigRest.js @@ -0,0 +1,25 @@ +const { schema } = require('./schemas/response/updateSessionConfigRest'); +const { + schema: xRequest, +} = require('./schemas/request/updateSessionConfigRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/updateUserAgentRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/updateUserAgentRest.js new file mode 100644 index 0000000000..3c31fa3333 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/updateUserAgentRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/updateUserAgentRest'); +const { schema: xRequest } = require('./schemas/request/updateUserAgentRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/updateUserAvatarRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/updateUserAvatarRest.js new file mode 100644 index 0000000000..2251565db6 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/updateUserAvatarRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/updateUserAvatarRest'); +const { schema: xRequest } = require('./schemas/request/updateUserAvatarRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/openapi/users/updateUserRest.js b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/updateUserRest.js new file mode 100644 index 0000000000..98154b1040 --- /dev/null +++ b/plugins/leemons-plugin-users/backend/services/rest/openapi/users/updateUserRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/updateUserRest'); +const { schema: xRequest } = require('./schemas/request/updateUserRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-users/backend/services/rest/permissions.rest.js b/plugins/leemons-plugin-users/backend/services/rest/permissions.rest.js index dfde8712f1..16f20828ee 100644 --- a/plugins/leemons-plugin-users/backend/services/rest/permissions.rest.js +++ b/plugins/leemons-plugin-users/backend/services/rest/permissions.rest.js @@ -2,14 +2,17 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsValidator } = require('@leemons/validator'); const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const { list } = require('../../core/permissions/list'); const { getUserAgentPermissions } = require('../../core/permissions'); +const listRest = require('./openapi/permissions/listRest'); +const getPermissionsWithActionsIfIHaveRest = require('./openapi/permissions/getPermissionsWithActionsIfIHaveRest'); +/** @type {ServiceSchema} */ module.exports = { listRest: { + openapi: listRest.openapi, rest: { path: '/list', method: 'GET', @@ -21,6 +24,7 @@ module.exports = { }, }, getPermissionsWithActionsIfIHaveRest: { + openapi: getPermissionsWithActionsIfIHaveRest.openapi, rest: { path: '/get-if-have', // rename to exist ? method: 'POST', diff --git a/plugins/leemons-plugin-users/backend/services/rest/platform.rest.js b/plugins/leemons-plugin-users/backend/services/rest/platform.rest.js index 4b5074c4e3..23fc84a21e 100644 --- a/plugins/leemons-plugin-users/backend/services/rest/platform.rest.js +++ b/plugins/leemons-plugin-users/backend/services/rest/platform.rest.js @@ -2,12 +2,22 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ -const { getTheme, getLocales, getDefaultLocale, getName } = require('../../core/platform'); +const { + getTheme, + getLocales, + getDefaultLocale, + getName, +} = require('../../core/platform'); +const getPlatformNameRest = require('./openapi/platform/getPlatformNameRest'); +const getThemeRest = require('./openapi/platform/getThemeRest'); +const getLocalesRest = require('./openapi/platform/getLocalesRest'); +const getDefaultLocaleRest = require('./openapi/platform/getDefaultLocaleRest'); +/** @type {ServiceSchema} */ module.exports = { getPlatformNameRest: { + openapi: getPlatformNameRest.openapi, rest: { path: '/name', method: 'GET', @@ -18,6 +28,7 @@ module.exports = { }, }, getThemeRest: { + openapi: getThemeRest.openapi, rest: { path: '/theme', method: 'GET', @@ -28,6 +39,7 @@ module.exports = { }, }, getLocalesRest: { + openapi: getLocalesRest.openapi, rest: { path: '/locales', method: 'GET', @@ -38,6 +50,7 @@ module.exports = { }, }, getDefaultLocaleRest: { + openapi: getDefaultLocaleRest.openapi, rest: { path: '/default-locale', method: 'GET', diff --git a/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js b/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js index 4bc9b5801d..155f5baaec 100644 --- a/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js +++ b/plugins/leemons-plugin-users/backend/services/rest/profiles.rest.js @@ -2,7 +2,6 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsValidator } = require('@leemons/validator'); const { LeemonsMiddlewareAuthenticated, @@ -51,8 +50,16 @@ const translationsValidations = { }, }; +const listRest = require('./openapi/profiles/listRest'); +const addRest = require('./openapi/profiles/addRest'); +const detailRest = require('./openapi/profiles/detailRest'); +const updateRest = require('./openapi/profiles/updateRest'); +const getProfileSysNameRest = require('./openapi/profiles/getProfileSysNameRest'); +const addAllPermissionsToAllProfilesRest = require('./openapi/profiles/addAllPermissionsToAllProfilesRest'); +/** @type {ServiceSchema} */ module.exports = { listRest: { + openapi: listRest.openapi, rest: { path: '/list', method: 'POST', @@ -78,7 +85,9 @@ module.exports = { { type: 'boolean' }, { type: 'object', - properties: { columns: { type: 'array', items: { type: 'string' } } }, + properties: { + columns: { type: 'array', items: { type: 'string' } }, + }, }, ], }, @@ -96,6 +105,7 @@ module.exports = { }, }, addRest: { + openapi: addRest.openapi, rest: { path: '/add', method: 'POST', @@ -130,6 +140,7 @@ module.exports = { }, }, detailRest: { + openapi: detailRest.openapi, rest: { path: '/detail/:uri', method: 'GET', @@ -161,6 +172,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { path: '/update', method: 'POST', @@ -196,6 +208,7 @@ module.exports = { }, }, getProfileSysNameRest: { + openapi: getProfileSysNameRest.openapi, rest: { path: '/sysName', method: 'GET', @@ -207,6 +220,7 @@ module.exports = { }, }, addAllPermissionsToAllProfilesRest: { + openapi: addAllPermissionsToAllProfilesRest.openapi, rest: { path: '/add-all-permissions-to-all-profiles', method: 'POST', diff --git a/plugins/leemons-plugin-users/backend/services/rest/roles.rest.js b/plugins/leemons-plugin-users/backend/services/rest/roles.rest.js index 960aead8fc..a31a7d3db5 100644 --- a/plugins/leemons-plugin-users/backend/services/rest/roles.rest.js +++ b/plugins/leemons-plugin-users/backend/services/rest/roles.rest.js @@ -2,7 +2,6 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsMiddlewareAuthenticated, LeemonsMiddlewareNecessaryPermits, @@ -28,8 +27,14 @@ const permissionsValidation = { }, }; +const listRest = require('./openapi/roles/listRest'); +const detailRest = require('./openapi/roles/detailRest'); +const addRest = require('./openapi/roles/addRest'); +const updateRest = require('./openapi/roles/updateRest'); +/** @type {ServiceSchema} */ module.exports = { listRest: { + openapi: listRest.openapi, rest: { path: '/list', method: 'POST', @@ -63,6 +68,7 @@ module.exports = { }, }, detailRest: { + openapi: detailRest.openapi, rest: { path: '/detail/:uri', method: 'GET', @@ -87,13 +93,17 @@ module.exports = { additionalProperties: false, }); if (validator.validate(ctx.params)) { - const role = await groupsService.detailByUri({ uri: ctx.params.uri, ctx }); + const role = await groupsService.detailByUri({ + uri: ctx.params.uri, + ctx, + }); return { status: 200, role }; } throw validator.error; }, }, addRest: { + openapi: addRest.openapi, rest: { path: '/add', method: 'POST', @@ -127,6 +137,7 @@ module.exports = { }, }, updateRest: { + openapi: updateRest.openapi, rest: { path: '/update', method: 'POST', diff --git a/plugins/leemons-plugin-users/backend/services/rest/users.rest.js b/plugins/leemons-plugin-users/backend/services/rest/users.rest.js index 7c003d37fc..ec5780e752 100644 --- a/plugins/leemons-plugin-users/backend/services/rest/users.rest.js +++ b/plugins/leemons-plugin-users/backend/services/rest/users.rest.js @@ -2,7 +2,6 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const _ = require('lodash'); const { LeemonsValidator } = require('@leemons/validator'); @@ -27,8 +26,44 @@ const { } = require('../../core/user-agents'); const { getUserAgentContacts } = require('../../core/user-agents/contacts/getUserAgentContacts'); +const canResetRest = require('./openapi/users/canResetRest'); +const canRegisterPasswordRest = require('./openapi/users/canRegisterPasswordRest'); +const resetRest = require('./openapi/users/resetRest'); +const registerPasswordRest = require('./openapi/users/registerPasswordRest'); +const recoverRest = require('./openapi/users/recoverRest'); +const loginRest = require('./openapi/users/loginRest'); +const detailRest = require('./openapi/users/detailRest'); +const detailForPageRest = require('./openapi/users/detailForPageRest'); +const agentDetailForPageRest = require('./openapi/users/agentDetailForPageRest'); +const profilesRest = require('./openapi/users/profilesRest'); +const centersRest = require('./openapi/users/centersRest'); +const profileTokenRest = require('./openapi/users/profileTokenRest'); +const centerProfileTokenRest = require('./openapi/users/centerProfileTokenRest'); +const setRememberLoginRest = require('./openapi/users/setRememberLoginRest'); +const removeRememberLoginRest = require('./openapi/users/removeRememberLoginRest'); +const getRememberLoginRest = require('./openapi/users/getRememberLoginRest'); +const createBulkRest = require('./openapi/users/createBulkRest'); +const deleteUserAgentRest = require('./openapi/users/deleteUserAgentRest'); +const listRest = require('./openapi/users/listRest'); +const getUserAgentsInfoRest = require('./openapi/users/getUserAgentsInfoRest'); +const searchUserAgentsRest = require('./openapi/users/searchUserAgentsRest'); +const contactsRest = require('./openapi/users/contactsRest'); +const createSuperAdminRest = require('./openapi/users/createSuperAdminRest'); +const getDataForUserAgentDatasetsRest = require('./openapi/users/getDataForUserAgentDatasetsRest'); +const saveDataForUserAgentDatasetsRest = require('./openapi/users/saveDataForUserAgentDatasetsRest'); +const updateUserRest = require('./openapi/users/updateUserRest'); +const updateUserAvatarRest = require('./openapi/users/updateUserAvatarRest'); +const updateUserAgentRest = require('./openapi/users/updateUserAgentRest'); +const updateSessionConfigRest = require('./openapi/users/updateSessionConfigRest'); +const activateUserRest = require('./openapi/users/activateUserRest'); +const sendWelcomeEmailToUserRest = require('./openapi/users/sendWelcomeEmailToUserRest'); +const disableUserAgentRest = require('./openapi/users/disableUserAgentRest'); +const activeUserAgentRest = require('./openapi/users/activeUserAgentRest'); +const getActiveUserAgentsCountByProfileSysNameRest = require('./openapi/users/getActiveUserAgentsCountByProfileSysNameRest'); +/** @type {ServiceSchema} */ module.exports = { canResetRest: { + openapi: canResetRest.openapi, rest: { path: '/can/reset', method: 'POST', @@ -43,13 +78,17 @@ module.exports = { additionalProperties: false, }); if (validator.validate(ctx.params)) { - const can = await usersService.canReset({ token: ctx.params.token, ctx }); + const can = await usersService.canReset({ + token: ctx.params.token, + ctx, + }); return { status: 200, can }; } throw validator.error; }, }, canRegisterPasswordRest: { + openapi: canRegisterPasswordRest.openapi, rest: { path: '/can/register-password', method: 'POST', @@ -64,13 +103,17 @@ module.exports = { additionalProperties: false, }); if (validator.validate(ctx.params)) { - const can = await usersService.canRegisterPassword({ token: ctx.params.token, ctx }); + const can = await usersService.canRegisterPassword({ + token: ctx.params.token, + ctx, + }); return { status: 200, can }; } throw validator.error; }, }, resetRest: { + openapi: resetRest.openapi, rest: { path: '/reset', method: 'POST', @@ -99,6 +142,7 @@ module.exports = { }, }, registerPasswordRest: { + openapi: registerPasswordRest.openapi, rest: { path: '/register-password', method: 'POST', @@ -126,6 +170,7 @@ module.exports = { }, }, recoverRest: { + openapi: recoverRest.openapi, rest: { path: '/recover', method: 'POST', @@ -153,6 +198,7 @@ module.exports = { }, }, loginRest: { + openapi: loginRest.openapi, rest: { path: '/login', method: 'POST', @@ -181,17 +227,22 @@ module.exports = { }, }, detailRest: { + openapi: detailRest.openapi, rest: { method: 'GET', path: '/', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const user = await usersService.detail({ userId: ctx.meta.userSession.id, ctx }); + const user = await usersService.detail({ + userId: ctx.meta.userSession.id, + ctx, + }); return { status: 200, user }; }, }, detailForPageRest: { + openapi: detailForPageRest.openapi, rest: { path: '/:id/detail/page', method: 'GET', @@ -206,10 +257,16 @@ module.exports = { let hasPermission = ctx.params.id === ctx.meta.userSession.id; if (!hasPermission) { - hasPermission = await usersService.hasPermissionCTX({ allowedPermissions, ctx }); + hasPermission = await usersService.hasPermissionCTX({ + allowedPermissions, + ctx, + }); } - const user = await usersService.detailForPage({ userId: ctx.params.id, ctx }); + const user = await usersService.detailForPage({ + userId: ctx.params.id, + ctx, + }); const data = { ...(user ?? {}), user: _.omit(user?.user, ['password', 'token', '__v']), @@ -241,6 +298,7 @@ module.exports = { }, }, agentDetailForPageRest: { + openapi: agentDetailForPageRest.openapi, rest: { path: '/user-agent/:id/detail/page', method: 'GET', @@ -255,7 +313,10 @@ module.exports = { let hasPermission = ctx.params.id === ctx.meta.userSession.id; if (!hasPermission) { - hasPermission = await usersService.hasPermissionCTX({ allowedPermissions, ctx }); + hasPermission = await usersService.hasPermissionCTX({ + allowedPermissions, + ctx, + }); } // Comprobamos si se tienen como contactos @@ -268,7 +329,10 @@ module.exports = { } if (hasPermission) { - const data = await agentDetailForPage({ userAgentId: ctx.params.id, ctx }); + const data = await agentDetailForPage({ + userAgentId: ctx.params.id, + ctx, + }); return { status: 200, data }; } const rAllowedPermissions = []; @@ -284,28 +348,37 @@ module.exports = { }, }, profilesRest: { + openapi: profilesRest.openapi, rest: { path: '/profile', method: 'GET', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const profiles = await usersService.profiles({ user: ctx.meta.userSession.id, ctx }); + const profiles = await usersService.profiles({ + user: ctx.meta.userSession.id, + ctx, + }); return { status: 200, profiles }; }, }, centersRest: { + openapi: centersRest.openapi, rest: { path: '/centers', method: 'GET', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const centers = await usersService.centers({ user: ctx.meta.userSession.id, ctx }); + const centers = await usersService.centers({ + user: ctx.meta.userSession.id, + ctx, + }); return { status: 200, centers }; }, }, profileTokenRest: { + openapi: profileTokenRest.openapi, rest: { path: '/profile/:id/token', method: 'GET', @@ -321,6 +394,7 @@ module.exports = { }, }, centerProfileTokenRest: { + openapi: centerProfileTokenRest.openapi, rest: { path: '/center/:centerId/profile/:profileId/token', method: 'GET', @@ -337,16 +411,22 @@ module.exports = { }, }, setRememberLoginRest: { + openapi: setRememberLoginRest.openapi, rest: { path: '/remember/login', method: 'POST', }, middlewares: [LeemonsMiddlewareAuthenticated()], async handler(ctx) { - const centers = await usersService.centers({ user: ctx.meta.userSession.id, ctx }); + const centers = await usersService.centers({ + user: ctx.meta.userSession.id, + ctx, + }); const centerI = _.findIndex(centers, { id: ctx.params.center }); if (centerI >= 0) { - const profileI = _.findIndex(centers[centerI].profiles, { id: ctx.params.profile }); + const profileI = _.findIndex(centers[centerI].profiles, { + id: ctx.params.profile, + }); if (profileI >= 0) { await ctx.tx.db.UserRememberLogin.updateOne( { user: ctx.meta.userSession.id }, @@ -363,13 +443,18 @@ module.exports = { center: centers[centerI], }; } - throw new LeemonsError(ctx, { message: 'You do not have access to the specified profile' }); + throw new LeemonsError(ctx, { + message: 'You do not have access to the specified profile', + }); } else { - throw new LeemonsError(ctx, { message: 'You do not have access to the specified center' }); + throw new LeemonsError(ctx, { + message: 'You do not have access to the specified center', + }); } }, }, removeRememberLoginRest: { + openapi: removeRememberLoginRest.openapi, rest: { path: '/remember/login', method: 'DELETE', @@ -381,12 +466,15 @@ module.exports = { }).lean(); if (remember) { - await ctx.tx.db.UserRememberLogin.deleteOne({ user: ctx.meta.userSession.id }); + await ctx.tx.db.UserRememberLogin.deleteOne({ + user: ctx.meta.userSession.id, + }); } return { status: 200 }; }, }, getRememberLoginRest: { + openapi: getRememberLoginRest.openapi, rest: { path: '/remember/login', method: 'GET', @@ -397,10 +485,15 @@ module.exports = { user: ctx.meta.userSession.id, }).lean(); if (remember) { - const centers = await usersService.centers({ user: ctx.meta.userSession.id, ctx }); + const centers = await usersService.centers({ + user: ctx.meta.userSession.id, + ctx, + }); const centerI = _.findIndex(centers, { id: remember.center }); if (centerI >= 0) { - const profileI = _.findIndex(centers[centerI].profiles, { id: remember.profile }); + const profileI = _.findIndex(centers[centerI].profiles, { + id: remember.profile, + }); if (profileI >= 0) { return { status: 200, @@ -416,6 +509,7 @@ module.exports = { }, }, createBulkRest: { + openapi: createBulkRest.openapi, rest: { path: '/create/bulk', method: 'POST', @@ -439,6 +533,7 @@ module.exports = { }, }, deleteUserAgentRest: { + openapi: deleteUserAgentRest.openapi, rest: { path: '/user-agent/:id', method: 'DELETE', @@ -462,6 +557,7 @@ module.exports = { }, }, listRest: { + openapi: listRest.openapi, rest: { path: '/list', method: 'POST', @@ -500,6 +596,7 @@ module.exports = { }, }, getUserAgentsInfoRest: { + openapi: getUserAgentsInfoRest.openapi, rest: { path: '/user-agents/info', method: 'POST', @@ -524,6 +621,7 @@ module.exports = { }, }, searchUserAgentsRest: { + openapi: searchUserAgentsRest.openapi, rest: { path: '/user-agents/search', method: 'POST', @@ -548,6 +646,7 @@ module.exports = { }, }, contactsRest: { + openapi: contactsRest.openapi, rest: { path: '/contacts', method: 'POST', @@ -563,6 +662,7 @@ module.exports = { }, }, createSuperAdminRest: { + openapi: createSuperAdminRest.openapi, rest: { path: '/super-admin', method: 'POST', @@ -580,6 +680,7 @@ module.exports = { }, // TODO: Hacer un middleware de dataset que refleje: disableUserAgentDatasetCheck: true, getDataForUserAgentDatasetsRest: { + openapi: getDataForUserAgentDatasetsRest.openapi, rest: { path: '/get-data-for-user-agent-datasets', method: 'GET', @@ -592,6 +693,7 @@ module.exports = { }, saveDataForUserAgentDatasetsRest: { + openapi: saveDataForUserAgentDatasetsRest.openapi, rest: { path: '/save-data-for-user-agent-datasets', method: 'POST', @@ -606,6 +708,7 @@ module.exports = { }, }, updateUserRest: { + openapi: updateUserRest.openapi, rest: { path: '/:id/update', method: 'POST', @@ -620,11 +723,18 @@ module.exports = { let hasPermission = ctx.params.id === ctx.meta.userSession.id; if (!hasPermission) { - hasPermission = await usersService.hasPermissionCTX({ allowedPermissions, ctx }); + hasPermission = await usersService.hasPermissionCTX({ + allowedPermissions, + ctx, + }); } if (hasPermission) { - const data = await usersService.update({ userId: ctx.params.id, ...ctx.params, ctx }); + const data = await usersService.update({ + userId: ctx.params.id, + ...ctx.params, + ctx, + }); return { status: 200, data }; } const rAllowedPermissions = []; @@ -640,6 +750,7 @@ module.exports = { }, }, updateUserAvatarRest: { + openapi: updateUserAvatarRest.openapi, rest: { path: '/:id/update-avatar', method: 'POST', @@ -654,7 +765,10 @@ module.exports = { let hasPermission = ctx.params.id === ctx.meta.userSession.id; if (!hasPermission) { - hasPermission = await usersService.hasPermissionCTX({ allowedPermissions, ctx }); + hasPermission = await usersService.hasPermissionCTX({ + allowedPermissions, + ctx, + }); } if (hasPermission) { @@ -678,6 +792,7 @@ module.exports = { }, }, updateUserAgentRest: { + openapi: updateUserAgentRest.openapi, rest: { path: '/user-agent/:id/update', method: 'POST', @@ -692,7 +807,10 @@ module.exports = { let hasPermission = ctx.params.id === ctx.meta.userSession.id; if (!hasPermission) { - hasPermission = await usersService.hasPermissionCTX({ allowedPermissions, ctx }); + hasPermission = await usersService.hasPermissionCTX({ + allowedPermissions, + ctx, + }); } if (hasPermission) { @@ -716,6 +834,7 @@ module.exports = { }, }, updateSessionConfigRest: { + openapi: updateSessionConfigRest.openapi, rest: { path: '/session/config', method: 'POST', @@ -727,6 +846,7 @@ module.exports = { }, }, activateUserRest: { + openapi: activateUserRest.openapi, rest: { path: '/activate-user', method: 'POST', @@ -751,6 +871,7 @@ module.exports = { }, }, sendWelcomeEmailToUserRest: { + openapi: sendWelcomeEmailToUserRest.openapi, rest: { path: '/activation-mail', method: 'POST', @@ -778,6 +899,7 @@ module.exports = { }, }, disableUserAgentRest: { + openapi: disableUserAgentRest.openapi, rest: { path: '/user-agents/disable', method: 'POST', @@ -798,6 +920,7 @@ module.exports = { }, }, activeUserAgentRest: { + openapi: activeUserAgentRest.openapi, rest: { path: '/user-agents/active', method: 'POST', @@ -818,6 +941,7 @@ module.exports = { }, }, getActiveUserAgentsCountByProfileSysNameRest: { + openapi: getActiveUserAgentsCountByProfileSysNameRest.openapi, rest: { path: '/user-agents/active-count/:sysName', method: 'GET', diff --git a/plugins/leemons-plugin-widgets/backend/services/rest/openapi/widgets/getZoneRest.js b/plugins/leemons-plugin-widgets/backend/services/rest/openapi/widgets/getZoneRest.js new file mode 100644 index 0000000000..3b820d0521 --- /dev/null +++ b/plugins/leemons-plugin-widgets/backend/services/rest/openapi/widgets/getZoneRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/getZoneRest'); +const { schema: xRequest } = require('./schemas/request/getZoneRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-widgets/backend/services/rest/openapi/widgets/schemas/request/getZoneRest.js b/plugins/leemons-plugin-widgets/backend/services/rest/openapi/widgets/schemas/request/getZoneRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-widgets/backend/services/rest/openapi/widgets/schemas/request/getZoneRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-widgets/backend/services/rest/openapi/widgets/schemas/response/getZoneRest.js b/plugins/leemons-plugin-widgets/backend/services/rest/openapi/widgets/schemas/response/getZoneRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-widgets/backend/services/rest/openapi/widgets/schemas/response/getZoneRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-widgets/backend/services/rest/widgets.rest.js b/plugins/leemons-plugin-widgets/backend/services/rest/widgets.rest.js index 049464076b..a5241066bd 100644 --- a/plugins/leemons-plugin-widgets/backend/services/rest/widgets.rest.js +++ b/plugins/leemons-plugin-widgets/backend/services/rest/widgets.rest.js @@ -7,8 +7,11 @@ const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const { get } = require('../../core/widgetZone'); +const getZoneRest = require('./openapi/widgets/getZoneRest'); +/** @type {ServiceSchema} */ module.exports = { getZoneRest: { + openapi: getZoneRest.openapi, rest: { path: '/zone/:key', method: 'GET', diff --git a/plugins/leemons-plugin-xapi/backend/services/rest/openapi/xapi/addStatementRest.js b/plugins/leemons-plugin-xapi/backend/services/rest/openapi/xapi/addStatementRest.js new file mode 100644 index 0000000000..3639eeaae8 --- /dev/null +++ b/plugins/leemons-plugin-xapi/backend/services/rest/openapi/xapi/addStatementRest.js @@ -0,0 +1,23 @@ +const { schema } = require('./schemas/response/addStatementRest'); +const { schema: xRequest } = require('./schemas/request/addStatementRest'); + +const openapi = { + // summary: "Summary", + // description: "Description", + + 'x-request': xRequest, + responses: { + 200: { + description: 'Success', + content: { + 'application/json': { + schema, + }, + }, + }, + }, +}; + +module.exports = { + openapi, +}; diff --git a/plugins/leemons-plugin-xapi/backend/services/rest/openapi/xapi/schemas/request/addStatementRest.js b/plugins/leemons-plugin-xapi/backend/services/rest/openapi/xapi/schemas/request/addStatementRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-xapi/backend/services/rest/openapi/xapi/schemas/request/addStatementRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-xapi/backend/services/rest/openapi/xapi/schemas/response/addStatementRest.js b/plugins/leemons-plugin-xapi/backend/services/rest/openapi/xapi/schemas/response/addStatementRest.js new file mode 100644 index 0000000000..ff9976e0ea --- /dev/null +++ b/plugins/leemons-plugin-xapi/backend/services/rest/openapi/xapi/schemas/response/addStatementRest.js @@ -0,0 +1,4 @@ +// automatic hash: 49d228cbffb071ef63b85fc4064de9980d08d5449130cdbc3f3dc621522e2ff6 +const schema = {}; + +module.exports = { schema }; diff --git a/plugins/leemons-plugin-xapi/backend/services/rest/xapi.rest.js b/plugins/leemons-plugin-xapi/backend/services/rest/xapi.rest.js index 62510da509..ae5d7f5377 100644 --- a/plugins/leemons-plugin-xapi/backend/services/rest/xapi.rest.js +++ b/plugins/leemons-plugin-xapi/backend/services/rest/xapi.rest.js @@ -2,15 +2,17 @@ * @typedef {import('moleculer').ServiceSchema} ServiceSchema Moleculer's Service Schema * @typedef {import('moleculer').Context} Context Moleculer's Context */ -/** @type {ServiceSchema} */ const { LeemonsValidator } = require('@leemons/validator'); const { LeemonsMiddlewareAuthenticated } = require('@leemons/middlewares'); const { LeemonsError } = require('@leemons/error'); const _ = require('lodash'); const { add } = require('../../core/xapi/statement'); +const addStatementRest = require('./openapi/xapi/addStatementRest'); +/** @type {ServiceSchema} */ module.exports = { addStatementRest: { + openapi: addStatementRest.openapi, rest: { path: '/add/statement', method: 'POST', @@ -26,7 +28,9 @@ module.exports = { await add({ ...ctx.params, actor, ip: ctx.meta.clientIP, ctx }); return { status: 200 }; } - throw new LeemonsError(ctx, { message: 'Only type (learning | log) are available' }); + throw new LeemonsError(ctx, { + message: 'Only type (learning | log) are available', + }); }, }, }; diff --git a/yarn.lock b/yarn.lock index fa36a1e6b8..be95d75df8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25,6 +25,15 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" +"@apidevtools/json-schema-ref-parser@^11.1.0": + version "11.6.1" + resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.6.1.tgz#ce462f4fe6d1f952f3695f3c05eac955f177ac43" + integrity sha512-DxjgKBCoyReu4p5HMvpmgSOfRhhBcuf5V5soDDRgOTZMwsA4KSFzol1abFZgiCTE11L2kKGca5Md9GwDdXVBwQ== + dependencies: + "@jsdevtools/ono" "^7.1.3" + "@types/json-schema" "^7.0.15" + js-yaml "^4.1.0" + "@aw-web-design/x-default-browser@1.4.126": version "1.4.126" resolved "https://registry.yarnpkg.com/@aw-web-design/x-default-browser/-/x-default-browser-1.4.126.tgz#43e4bd8f0314ed907a8718d7e862a203af79bc16" @@ -2749,6 +2758,11 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jsdevtools/ono@^7.1.3": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" + integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== + "@juggle/resize-observer@^3.3.1": version "3.4.0" resolved "https://registry.yarnpkg.com/@juggle/resize-observer/-/resize-observer-3.4.0.tgz#08d6c5e20cf7e4cc02fd181c4b0c225cd31dbb60" @@ -2800,6 +2814,24 @@ prop-types "^15.7.2" react-is "^16.9.0" +"@leemons/error@0.0.40": + version "0.0.40" + resolved "https://registry.yarnpkg.com/@leemons/error/-/error-0.0.40.tgz#a8c386a47d851cdae34099d6b87346045ede613e" + integrity sha512-ABxhFPB4bonrBG578OQHofBbkO0t/PMutWd/DnkDJvj/9AQsk32qsuFWHVnrFIGMoY/gGzZz9rGBVmsMW8sKUw== + dependencies: + "@leemons/service-name-parser" "0.0.39" + lodash "^4.17.21" + +"@leemons/service-name-parser@0.0.39": + version "0.0.39" + resolved "https://registry.yarnpkg.com/@leemons/service-name-parser/-/service-name-parser-0.0.39.tgz#97c8e70ae1cd5a9473f56029a483921345dd464b" + integrity sha512-YTyddy7uLOVjjL4e6GVludXh6fOhNox7APbrVXZfqM2vCarRlQnSrsXj4Y4VM+I/bwl69V2ViLzqoR1VgtfmvQ== + +"@leemons/service-name-parser@0.0.40": + version "0.0.40" + resolved "https://registry.yarnpkg.com/@leemons/service-name-parser/-/service-name-parser-0.0.40.tgz#b4e4479190676c93658b143b274a7c5ef57b896b" + integrity sha512-cOEGN5j21vETcNUXlXuR2xJjOlD8Gkpz9Ocs6HDJ6gmrAXEgAsUDBtL7hHkYUDg4bCj/I+iv3lsCxMNNkvDbBg== + "@leichtgewicht/ip-codec@^2.0.1": version "2.0.5" resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz#4fc56c15c580b9adb7dc3c333a134e540b44bfb1" @@ -3271,6 +3303,16 @@ resolved "https://registry.yarnpkg.com/@one-ini/wasm/-/wasm-0.1.1.tgz#6013659736c9dbfccc96e8a9c2b3de317df39323" integrity sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw== +"@openapi-contrib/json-schema-to-openapi-schema@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@openapi-contrib/json-schema-to-openapi-schema/-/json-schema-to-openapi-schema-3.0.1.tgz#b1fba3e9a30e63139479bafb72061a45ed4ced61" + integrity sha512-zfWdzuewwNVSOJ2e/eM9453Zl5674Vk+GKp39x/p+1XHygkbGgHTvUQyqdc1aoavsRcKzSt4veDULu7kjkgB4Q== + dependencies: + "@apidevtools/json-schema-ref-parser" "^11.1.0" + json-schema-walker "^2.0.0" + openapi-types "^12.1.3" + yargs "^17.7.2" + "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" @@ -6451,7 +6493,7 @@ jest-matcher-utils "^28.0.0" pretty-format "^28.0.0" -"@types/json-schema@*", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": +"@types/json-schema@*", "@types/json-schema@^7.0.15", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== @@ -7104,7 +7146,7 @@ ajv-keywords@^5.1.0: dependencies: fast-deep-equal "^3.1.3" -ajv@6.12.6, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.7.0: +ajv@6.12.6, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.7.0: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -7454,6 +7496,18 @@ asn1.js@^4.10.1: inherits "^2.0.1" minimalistic-assert "^1.0.0" +asn1@~0.2.3: + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== + assert@^2.0.0, assert@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/assert/-/assert-2.1.0.tgz#6d92a238d05dc02e7427c881fb8be81c8448b2dd" @@ -7584,6 +7638,16 @@ aws-sdk@^2.1438.0, aws-sdk@^2.1463.0, aws-sdk@^2.1520.0: uuid "8.0.0" xml2js "0.6.2" +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== + +aws4@^1.8.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" + integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== + axe-core@^4.2.0: version "4.9.0" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.9.0.tgz#b18971494551ab39d4ff5f7d4c6411bd20cc7c2a" @@ -7829,6 +7893,13 @@ batch@0.6.1: resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" integrity sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw== +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== + dependencies: + tweetnacl "^0.14.3" + bcrypt@^5.0.1: version "5.1.1" resolved "https://registry.yarnpkg.com/bcrypt/-/bcrypt-5.1.1.tgz#0f732c6dcb4e12e5b70a25e326a72965879ba6e2" @@ -7893,7 +7964,7 @@ bl@^4.0.2, bl@^4.0.3, bl@^4.1.0: inherits "^2.0.4" readable-stream "^3.4.0" -bluebird@3.7.2, bluebird@^3.4.6: +bluebird@*, bluebird@3.7.2, bluebird@^3.4.6: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== @@ -8356,6 +8427,11 @@ case-sensitive-paths-webpack-plugin@^2.4.0: resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz#db64066c6422eed2e08cc14b986ca43796dbc6d4" integrity sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw== +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== + chainsaw@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/chainsaw/-/chainsaw-0.1.0.tgz#5eab50b28afe58074d0d58291388828b5e5fbc98" @@ -8615,7 +8691,7 @@ clone-response@^1.0.2: dependencies: mimic-response "^1.0.0" -clone@2.x: +clone@2.x, clone@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== @@ -8710,7 +8786,7 @@ colorette@^2.0.10: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== -combined-stream@^1.0.8: +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -8994,6 +9070,11 @@ core-js@^3.0.1: resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.36.1.tgz#c97a7160ebd00b2de19e62f4bbd3406ab720e578" integrity sha512-BTvUrwxVBezj5SZ3f10ImnX2oRByMxql3EimVqMysepbC9EeMUOpLwdy6Eoili2x6E4kf+ZUB5k/+Jv55alPfA== +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== + core-util-is@~1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" @@ -9378,6 +9459,13 @@ dargs@~7.0.0: resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== + dependencies: + assert-plus "^1.0.0" + data-uri-to-buffer@~5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-5.0.1.tgz#db89a9e279c2ffe74f50637a59a32fb23b3e4d7c" @@ -10079,6 +10167,14 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + ecdsa-sig-formatter@1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" @@ -11006,7 +11102,7 @@ extend-shallow@^2.0.1: dependencies: is-extendable "^0.1.0" -extend@^3.0.0: +extend@^3.0.0, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== @@ -11030,6 +11126,16 @@ extract-zip@^1.6.6: mkdirp "^0.5.4" yauzl "^2.10.0" +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== + +extsprintf@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" + integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== + fast-bind@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fast-bind/-/fast-bind-1.0.0.tgz#7fa9652cb3325f5cd1e252d6cb4f160de1a76e75" @@ -11355,6 +11461,11 @@ foreground-child@^3.1.0: cross-spawn "^7.0.0" signal-exit "^4.0.1" +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== + fork-ts-checker-webpack-plugin@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-8.0.0.tgz#dae45dfe7298aa5d553e2580096ced79b6179504" @@ -11391,6 +11502,15 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + format@^0.2.0: version "0.2.2" resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" @@ -11648,6 +11768,13 @@ get-symbol-description@^1.0.2: es-errors "^1.3.0" get-intrinsic "^1.2.4" +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== + dependencies: + assert-plus "^1.0.0" + gif-picker-react@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/gif-picker-react/-/gif-picker-react-1.3.2.tgz#453f18cbeec7f10e3ebb55b0823dec40d8051037" @@ -11907,6 +12034,19 @@ handlebars@^4.7.7: optionalDependencies: uglify-js "^3.1.4" +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== + +har-validator@~5.1.3: + version "5.1.5" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" + integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== + dependencies: + ajv "^6.12.3" + har-schema "^2.0.0" + hard-rejection@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" @@ -12281,6 +12421,15 @@ http-proxy@^1.18.1: follow-redirects "^1.0.0" requires-port "^1.0.0" +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + http2-wrapper@^1.0.0-beta.5.2: version "1.0.3" resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" @@ -12863,7 +13012,7 @@ is-typed-array@^1.1.13, is-typed-array@^1.1.3: dependencies: which-typed-array "^1.1.14" -is-typedarray@^1.0.0: +is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== @@ -12973,7 +13122,7 @@ isostring@0.0.1: resolved "https://registry.yarnpkg.com/isostring/-/isostring-0.0.1.tgz#ddb608efbfc89cda86db9cb16be090a788134c7f" integrity sha512-wRcdJtXCe2LGtXnD14fXMkduWVdbeGkzBIKg8WcKeEOi6SIc+hRjYYw76WNx3v5FebhUWZrBTWB0NOl3/sagdQ== -isstream@^0.1.2: +isstream@^0.1.2, isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== @@ -13932,6 +14081,11 @@ jsbn@1.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040" integrity sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A== +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== + jscodeshift@^0.15.1: version "0.15.2" resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.15.2.tgz#145563860360b4819a558c75c545f39683e5a0be" @@ -14043,6 +14197,13 @@ json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== +json-promise@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/json-promise/-/json-promise-1.1.8.tgz#7b74120422d16ddb449aa3170403fc69ad416402" + integrity sha512-rz31P/7VfYnjQFrF60zpPTT0egMPlc8ZvIQHWs4ZtNZNnAXRmXo6oS+6eyWr5sEMG03OVhklNrTXxiIRYzoUgQ== + dependencies: + bluebird "*" + json-rules-engine-simplified@^0.1.17: version "0.1.17" resolved "https://registry.yarnpkg.com/json-rules-engine-simplified/-/json-rules-engine-simplified-0.1.17.tgz#f66ec1eaff135eaf7bd19a726177c6f9dcdad674" @@ -14059,6 +14220,17 @@ json-schema-compare@^0.2.2: dependencies: lodash "^4.17.4" +json-schema-generator@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/json-schema-generator/-/json-schema-generator-2.0.6.tgz#f6f2bef5c52117f51137a9b7b1c32677239e17ca" + integrity sha512-WyWDTK3jnv/OBI43uWw7pTGoDQ62PfccySZCHTBsOfS6D9QhsQr+95Wcwq5lqjzkiDQkTNkWzXEqHOhswfufmw== + dependencies: + json-promise "^1.1.8" + mkdirp "^0.5.0" + optimist "^0.6.1" + pretty-data "^0.40.0" + request "^2.81.0" + json-schema-merge-allof@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/json-schema-merge-allof/-/json-schema-merge-allof-0.6.0.tgz#64d48820fec26b228db837475ce3338936bf59a5" @@ -14078,11 +14250,29 @@ json-schema-traverse@^1.0.0: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== +json-schema-walker@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/json-schema-walker/-/json-schema-walker-2.0.0.tgz#69da1b8613133c0892c92118d0ebfa5bcae019bd" + integrity sha512-nXN2cMky0Iw7Af28w061hmxaPDaML5/bQD9nwm1lOoIKEGjHcRGxqWe4MfrkYThYAPjSUhmsp4bJNoLAyVn9Xw== + dependencies: + "@apidevtools/json-schema-ref-parser" "^11.1.0" + clone "^2.1.2" + +json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== + json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== + json5@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" @@ -14125,6 +14315,16 @@ jsonwebtoken@^9.0.0, jsonwebtoken@^9.0.2: ms "^2.1.1" semver "^7.5.4" +jsprim@^1.2.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.4.0" + verror "1.10.0" + "jsx-ast-utils@^2.4.1 || ^3.0.0": version "3.3.5" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a" @@ -15055,7 +15255,7 @@ mime-types@2.1.18: dependencies: mime-db "~1.33.0" -mime-types@2.1.35, mime-types@^2.1.12, mime-types@^2.1.25, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@^2.1.35, mime-types@~2.1.17, mime-types@~2.1.24, mime-types@~2.1.34: +mime-types@2.1.35, mime-types@^2.1.12, mime-types@^2.1.25, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@^2.1.35, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -15194,6 +15394,11 @@ minimist@^1.1.0, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1. resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw== + minipass-collect@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-2.0.1.tgz#1621bc77e12258a12c60d34e2276ec5c20680863" @@ -15263,7 +15468,7 @@ mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== -"mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@^0.5.4: +"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.4: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== @@ -15919,6 +16124,11 @@ nypm@^0.3.8: pathe "^1.1.2" ufo "^1.4.0" +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -16077,6 +16287,11 @@ open@^8.0.4, open@^8.0.9, open@^8.4.0: is-docker "^2.1.1" is-wsl "^2.2.0" +openapi-types@^12.1.3: + version "12.1.3" + resolved "https://registry.yarnpkg.com/openapi-types/-/openapi-types-12.1.3.tgz#471995eb26c4b97b7bd356aacf7b91b73e777dd3" + integrity sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw== + opener@^1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" @@ -16087,6 +16302,14 @@ opentracing@^0.14.4: resolved "https://registry.yarnpkg.com/opentracing/-/opentracing-0.14.7.tgz#25d472bd0296dc0b64d7b94cbc995219031428f5" integrity sha512-vz9iS7MJ5+Bp1URw8Khvdyw1H/hGvzHWlKQ7eRrQojSCDL1/SrWfrY9QebLw97n2deyRtzHRC3MkQfVNUCo91Q== +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g== + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + optionator@^0.9.3: version "0.9.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" @@ -16767,6 +16990,11 @@ prettier@^2.5.1, prettier@^2.8.0, prettier@^2.8.8: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== +pretty-data@^0.40.0: + version "0.40.0" + resolved "https://registry.yarnpkg.com/pretty-data/-/pretty-data-0.40.0.tgz#572aa8ea23467467ab94b6b5266a6fd9c8fddd72" + integrity sha512-YFLnEdDEDnkt/GEhet5CYZHCvALw6+Elyb/tp8kQG03ZSIuzeaDWpZYndCXwgqu4NAjh1PI534dhDS1mHarRnQ== + pretty-error@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-4.0.0.tgz#90a703f46dd7234adb46d0f84823e9d1cb8f10d6" @@ -17099,7 +17327,7 @@ ps-tree@1.2.0: dependencies: event-stream "=3.3.4" -psl@^1.1.33: +psl@^1.1.28, psl@^1.1.33: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== @@ -17208,6 +17436,11 @@ qs@^6.10.0, qs@^6.11.0, qs@^6.11.2: dependencies: side-channel "^1.0.6" +qs@~6.5.2: + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== + querystring-es3@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" @@ -18158,6 +18391,32 @@ renderkid@^3.0.0: lodash "^4.17.21" strip-ansi "^6.0.1" +request@^2.81.0: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -18405,7 +18664,7 @@ safe-regex-test@^1.0.3: es-errors "^1.3.0" is-regex "^1.1.4" -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -19053,6 +19312,21 @@ squirrelly@^9.0.0: resolved "https://registry.yarnpkg.com/squirrelly/-/squirrelly-9.0.0.tgz#465bced289aa2772ba0b650e0fb99c5a180b52c6" integrity sha512-MutQSfwrpIxvdUOFJ8XOfRSioLy+9O10bmBVWLik4uzJkD5TbeNSTOCKqLjzZJVcgdJNyLc8JRFUN15qFlZx9Q== +sshpk@^1.7.0: + version "1.18.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.18.0.tgz#1663e55cddf4d688b86a46b77f0d5fe363aba028" + integrity sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + ssr-window@^4.0.0, ssr-window@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-4.0.2.tgz#dc6b3ee37be86ac0e3ddc60030f7b3bc9b8553be" @@ -19500,6 +19774,11 @@ svgo@^3.0.2: csso "^5.0.5" picocolors "^1.0.0" +swagger-ui-dist@^5.9.3: + version "5.17.2" + resolved "https://registry.yarnpkg.com/swagger-ui-dist/-/swagger-ui-dist-5.17.2.tgz#de31813b18ff34e9a428cd6b9ede521164621996" + integrity sha512-V/NqUw6QoTrjSpctp2oLQvxrl3vW29UsUtZyq7B1CF0v870KOFbYGDQw8rpKaKm0JxTwHpWnW1SN9YuKZdiCyw== + swc-loader@^0.2.3: version "0.2.6" resolved "https://registry.yarnpkg.com/swc-loader/-/swc-loader-0.2.6.tgz#bf0cba8eeff34bb19620ead81d1277fefaec6bc8" @@ -19889,6 +20168,14 @@ tough-cookie@^4.0.0, tough-cookie@^4.1.3: universalify "^0.2.0" url-parse "^1.5.3" +tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + tr46@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" @@ -20048,6 +20335,11 @@ tweetnacl@1.0.3: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -20194,7 +20486,7 @@ ufo@^1.4.0: resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.5.3.tgz#3325bd3c977b6c6cd3160bf4ff52989adc9d3344" integrity sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw== -uglify-js@^3.1.4: +uglify-js@^3.1.4, uglify-js@^3.17.4: version "3.17.4" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g== @@ -20507,6 +20799,11 @@ uuid@8.0.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.0.0.tgz#bc6ccf91b5ff0ac07bbcdbf1c7c4e150db4dbb6c" integrity sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw== +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + uuid@^8.3.0, uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" @@ -20583,6 +20880,15 @@ vary@^1, vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + video-extensions@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/video-extensions/-/video-extensions-1.2.0.tgz#62f449f403b853f02da40964cbf34143f7d96731" @@ -21018,6 +21324,11 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw== + "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"