Browse Source

直接方法已搜索完成

master
hejl 2 days ago
parent
commit
09e2c514a2
  1. 450
      gofaster/app/plugins/modules/trigger-analyzer.js
  2. 12
      gofaster/app/plugins/route-mapping-plugin.js
  3. 255
      gofaster/app/src/renderer/modules/route-sync/direct-route-mappings.js

450
gofaster/app/plugins/modules/trigger-analyzer.js

@ -1,5 +1,7 @@
const { readFileSync, existsSync, readdirSync } = require('fs') const { readFileSync, existsSync, readdirSync } = require('fs')
const { resolve } = require('path') const { resolve } = require('path')
const parser = require('@babel/parser')
const traverse = require('@babel/traverse').default
const AstAnalyzer = require('./ast-analyzer') const AstAnalyzer = require('./ast-analyzer')
/** /**
@ -12,7 +14,7 @@ class TriggerAnalyzer {
} }
/** /**
* 查找API方法的触发器源 * 查找API方法的触发器源 - 第一步第一层触发源分析
* @param {Array} apiMappings - API映射数组 * @param {Array} apiMappings - API映射数组
* @returns {Array} 增强的API映射数组 * @returns {Array} 增强的API映射数组
*/ */
@ -26,30 +28,72 @@ class TriggerAnalyzer {
} }
moduleMapping.apiMappings.forEach(apiMapping => { moduleMapping.apiMappings.forEach(apiMapping => {
const triggerSources = this.findTriggerSourcesForApiMethod( // 第一步:查找第一层触发源
apiMapping.serviceName, const triggerSources = this.findFirstLevelTriggerSources(
moduleMapping.serviceName, // 使用第一层的serviceName
apiMapping.apiMethodName, apiMapping.apiMethodName,
moduleMapping.module moduleMapping.module
) )
if (triggerSources.length > 0) { // 为所有API映射添加triggerSources字段(即使为空)
enhancedModuleMapping.apiMappings.push({ enhancedModuleMapping.apiMappings.push({
...apiMapping, ...apiMapping,
triggerSources: triggerSources triggerSources: triggerSources || []
}) })
}
}) })
if (enhancedModuleMapping.apiMappings.length > 0) { // 返回所有模块映射(包括没有触发源的)
enhancedApiMappings.push(enhancedModuleMapping) enhancedApiMappings.push(enhancedModuleMapping)
}
}) })
return enhancedApiMappings return enhancedApiMappings
} }
/** /**
* 查找API方法的触发器源 * 查找第一层触发源 - 使用Babel分析真正的调用关系
* @param {string} serviceName - 服务名称
* @param {string} apiMethodName - API方法名称
* @param {string} moduleName - 模块名称
* @returns {Array} 触发器源数组
*/
findFirstLevelTriggerSources(serviceName, apiMethodName, moduleName) {
const triggerSources = []
try {
// 1. 遍历模块中的所有Vue组件文件
const modulePath = resolve(__dirname, `../../src/renderer/modules/${moduleName}`)
if (existsSync(modulePath)) {
const files = readdirSync(modulePath, { recursive: true })
files.forEach(file => {
if (typeof file === 'string' && file.endsWith('.vue')) {
const filePath = resolve(modulePath, file)
const componentName = this.extractComponentNameFromPath(file)
// 2. 使用Babel分析Vue组件中的API调用
const componentTriggerSources = this.analyzeComponentForApiCalls(
filePath,
serviceName,
apiMethodName,
componentName
)
triggerSources.push(...componentTriggerSources)
}
})
}
} catch (error) {
console.warn(`分析模块 ${moduleName} 时出错:`, error.message)
}
// 去重
const uniqueTriggerSources = this.deduplicateTriggerSources(triggerSources)
return uniqueTriggerSources
}
/**
* 查找API方法的触发器源保留原方法用于后续扩展
* @param {string} serviceName - 服务名称 * @param {string} serviceName - 服务名称
* @param {string} apiMethodName - API方法名称 * @param {string} apiMethodName - API方法名称
* @param {string} moduleName - 模块名称 * @param {string} moduleName - 模块名称
@ -105,17 +149,23 @@ class TriggerAnalyzer {
if (existsSync(routeConfigPath)) { if (existsSync(routeConfigPath)) {
const routeContent = readFileSync(routeConfigPath, 'utf-8') const routeContent = readFileSync(routeConfigPath, 'utf-8')
// 简单的路由解析,查找模块相关的路由 // 根据模块名称映射到对应的组件名称
const routeMatches = routeContent.match(new RegExp(`component:\\s*['"]${moduleName}[^'"]*['"]`, 'g')) const moduleToComponentMap = {
if (routeMatches) { 'role-management': 'RoleManagement',
routeMatches.forEach(match => { 'user-management': 'UserManagement',
const componentMatch = match.match(/component:\s*['"]([^'"]+)['"]/) 'system-settings': 'Settings',
if (componentMatch) { 'user-profile': 'UserProfile'
routeComponents.push({ }
component: componentMatch[1]
}) const componentName = moduleToComponentMap[moduleName]
} if (componentName) {
}) // 查找包含该组件的路由
const routeMatches = routeContent.match(new RegExp(`component:\\s*${componentName}`, 'g'))
if (routeMatches) {
routeComponents.push({
component: componentName
})
}
} }
} }
} catch (error) { } catch (error) {
@ -402,6 +452,358 @@ class TriggerAnalyzer {
return true return true
}) })
} }
/**
* 从文件路径提取组件名称
* @param {string} filePath - 文件路径
* @returns {string} 组件名称
*/
extractComponentNameFromPath(filePath) {
const fileName = filePath.split('/').pop().split('\\').pop()
return fileName.replace('.vue', '')
}
/**
* 分析Vue组件中的API调用
* @param {string} filePath - 组件文件路径
* @param {string} serviceName - 服务名称
* @param {string} apiMethodName - API方法名称
* @param {string} componentName - 组件名称
* @returns {Array} 触发源数组
*/
analyzeComponentForApiCalls(filePath, serviceName, apiMethodName, componentName) {
const triggerSources = []
try {
const content = readFileSync(filePath, 'utf-8')
// 使用Babel解析Vue组件
const ast = this.parseVueComponent(content)
if (!ast) return triggerSources
// 查找API调用和函数调用关系
const apiCalls = this.findApiCallsWithContext(ast, serviceName, apiMethodName)
// 为每个API调用创建触发源
apiCalls.forEach(call => {
triggerSources.push({
component: componentName,
triggerName: call.triggerName || '',
triggerType: call.triggerType || 'function'
})
})
} catch (error) {
console.warn(`分析组件 ${filePath} 时出错:`, error.message)
}
return triggerSources
}
/**
* 解析Vue组件内容
* @param {string} content - 组件内容
* @returns {Object|null} AST对象
*/
parseVueComponent(content) {
try {
// 提取<script>部分
const scriptMatch = content.match(/<script[^>]*>([\s\S]*?)<\/script>/)
if (!scriptMatch) return null
const scriptContent = scriptMatch[1]
// 使用Babel解析JavaScript代码
const ast = parser.parse(scriptContent, {
sourceType: 'module',
plugins: ['jsx', 'decorators-legacy', 'classProperties', 'objectRestSpread']
})
return ast
} catch (error) {
console.warn('解析Vue组件脚本时出错:', error.message)
return null
}
}
/**
* 在AST中查找API调用和函数调用关系
* @param {Object} ast - AST对象
* @param {string} serviceName - 服务名称
* @param {string} apiMethodName - API方法名称
* @returns {Array} API调用信息数组
*/
findApiCallsWithContext(ast, serviceName, apiMethodName) {
const apiCalls = []
const self = this
const functionCallMap = new Map() // 存储函数调用关系
// 第一遍:收集所有函数定义和调用关系
traverse(ast, {
// 收集函数定义
FunctionDeclaration(path) {
if (path.node.id && path.node.id.name) {
functionCallMap.set(path.node.id.name, {
type: 'function',
path: path
})
}
},
// 收集箭头函数和const函数
VariableDeclarator(path) {
if (path.node.id && path.node.id.type === 'Identifier' &&
path.node.init && path.node.init.type === 'ArrowFunctionExpression') {
functionCallMap.set(path.node.id.name, {
type: 'arrowFunction',
path: path
})
}
},
// 收集函数调用关系
CallExpression(path) {
const { node } = path
// 记录函数调用
if (node.callee.type === 'Identifier') {
const functionName = node.callee.name
const parentFunction = self.findParentFunction(path)
if (parentFunction) {
if (!functionCallMap.has(functionName)) {
functionCallMap.set(functionName, { callers: [] })
}
const funcInfo = functionCallMap.get(functionName)
if (!funcInfo.callers) funcInfo.callers = []
funcInfo.callers.push(parentFunction)
}
}
}
})
// 第二遍:查找API调用并分析调用链
traverse(ast, {
CallExpression(path) {
const { node } = path
// 查找 serviceName.apiMethodName() 调用
if (node.callee.type === 'MemberExpression' &&
node.callee.object.name === serviceName &&
node.callee.property.name === apiMethodName) {
// 查找调用上下文
const context = self.findCallContextWithChain(path, functionCallMap)
apiCalls.push({
triggerName: context.triggerName,
triggerType: context.triggerType
})
}
}
})
return apiCalls
}
/**
* 查找父级函数
* @param {Object} path - Babel路径对象
* @returns {string|null} 父级函数名
*/
findParentFunction(path) {
let currentPath = path.parentPath
while (currentPath) {
const { node } = currentPath
if (node.type === 'FunctionDeclaration' && node.id) {
return node.id.name
}
if (node.type === 'VariableDeclarator' &&
node.id && node.id.type === 'Identifier' &&
node.init && node.init.type === 'ArrowFunctionExpression') {
return node.id.name
}
if (node.type === 'ObjectMethod' && node.key) {
return node.key.name
}
currentPath = currentPath.parentPath
}
return null
}
/**
* 查找API调用的上下文包含调用链分析
* @param {Object} path - Babel路径对象
* @param {Map} functionCallMap - 函数调用关系映射
* @returns {Object} 上下文信息
*/
findCallContextWithChain(path, functionCallMap) {
let currentPath = path
let triggerName = ''
let triggerType = 'function'
// 向上遍历AST,查找触发源
while (currentPath) {
const { node } = currentPath
// 检查是否在Vue 3 Composition API生命周期钩子中
if (node.type === 'CallExpression' &&
node.callee.type === 'Identifier' &&
['onMounted', 'onCreated', 'onBeforeMount', 'onBeforeCreate', 'onUpdated', 'onBeforeUpdate', 'onUnmounted', 'onBeforeUnmount'].includes(node.callee.name)) {
triggerName = node.callee.name
triggerType = 'lifecycle'
break
}
// 检查是否在Vue 3 Composition API的setup方法中
if (node.type === 'ObjectMethod' && node.key && node.key.name === 'setup') {
triggerName = 'setup'
triggerType = 'lifecycle' // setup是Vue 3的生命周期钩子
break
}
// 检查是否在方法定义中
if (node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression') {
if (node.id && node.id.name) {
triggerName = node.id.name
triggerType = 'function'
break
}
}
// 检查是否在对象方法中(非setup)
if (node.type === 'ObjectMethod') {
if (node.key && node.key.name && node.key.name !== 'setup') {
triggerName = node.key.name
triggerType = 'method'
break
}
}
// 检查是否在箭头函数中
if (node.type === 'ArrowFunctionExpression') {
// 查找父级的属性名
const parent = currentPath.parent
if (parent && parent.type === 'ObjectProperty' && parent.key) {
const methodName = parent.key.name || ''
if (methodName === 'setup') {
triggerName = 'setup'
triggerType = 'lifecycle'
} else {
triggerName = methodName
triggerType = 'method'
}
break
}
// 检查是否在const声明的箭头函数中
if (parent && parent.type === 'VariableDeclarator' && parent.id) {
const functionName = parent.id.name || ''
triggerName = functionName
triggerType = 'method'
break
}
}
// 检查是否在Vue 2生命周期钩子中
if (node.type === 'CallExpression' &&
node.callee.type === 'MemberExpression' &&
node.callee.object.name === 'this' &&
['mounted', 'created', 'beforeMount', 'beforeCreate'].includes(node.callee.property.name)) {
triggerName = node.callee.property.name
triggerType = 'lifecycle'
break
}
currentPath = currentPath.parentPath
}
return { triggerName, triggerType }
}
/**
* 查找API调用的上下文
* @param {Object} path - Babel路径对象
* @returns {Object} 上下文信息
*/
findCallContext(path) {
let currentPath = path
let triggerName = ''
let triggerType = 'function'
// 向上遍历AST,查找触发源
while (currentPath) {
const { node } = currentPath
// 检查是否在Vue 3 Composition API生命周期钩子中
if (node.type === 'CallExpression' &&
node.callee.type === 'Identifier' &&
['onMounted', 'onCreated', 'onBeforeMount', 'onBeforeCreate', 'onUpdated', 'onBeforeUpdate', 'onUnmounted', 'onBeforeUnmount'].includes(node.callee.name)) {
triggerName = node.callee.name
triggerType = 'lifecycle'
break
}
// 检查是否在Vue 3 Composition API的setup方法中
if (node.type === 'ObjectMethod' && node.key && node.key.name === 'setup') {
triggerName = 'setup'
triggerType = 'lifecycle' // setup是Vue 3的生命周期钩子
break
}
// 检查是否在方法定义中
if (node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression') {
if (node.id && node.id.name) {
triggerName = node.id.name
triggerType = 'function'
break
}
}
// 检查是否在对象方法中(非setup)
if (node.type === 'ObjectMethod') {
if (node.key && node.key.name && node.key.name !== 'setup') {
triggerName = node.key.name
triggerType = 'method'
break
}
}
// 检查是否在箭头函数中
if (node.type === 'ArrowFunctionExpression') {
// 查找父级的属性名
const parent = currentPath.parent
if (parent && parent.type === 'ObjectProperty' && parent.key) {
const methodName = parent.key.name || ''
if (methodName === 'setup') {
triggerName = 'setup'
triggerType = 'lifecycle'
} else {
triggerName = methodName
triggerType = 'method'
}
break
}
}
// 检查是否在Vue 2生命周期钩子中
if (node.type === 'CallExpression' &&
node.callee.type === 'MemberExpression' &&
node.callee.object.name === 'this' &&
['mounted', 'created', 'beforeMount', 'beforeCreate'].includes(node.callee.property.name)) {
triggerName = node.callee.property.name
triggerType = 'lifecycle'
break
}
currentPath = currentPath.parentPath
}
return { triggerName, triggerType }
}
} }
module.exports = TriggerAnalyzer module.exports = TriggerAnalyzer

12
gofaster/app/plugins/route-mapping-plugin.js

@ -130,7 +130,7 @@ function routeMappingPlugin() {
return return
} }
// 第三步第一小步:启用API收集功能 // 第三步第二小步:启用触发源关联功能
// 1. 分析路由配置 // 1. 分析路由配置
const routes = this._routeAnalyzer.analyzeRoutes() const routes = this._routeAnalyzer.analyzeRoutes()
@ -138,8 +138,11 @@ function routeMappingPlugin() {
const moduleDirs = this._routeAnalyzer.getModuleDirs() const moduleDirs = this._routeAnalyzer.getModuleDirs()
const apiMappings = this._apiCollector.collectApiMappings(moduleDirs) const apiMappings = this._apiCollector.collectApiMappings(moduleDirs)
// 生成包含路由和API信息的文件 // 3. 关联页面与API(第三层)
this._fileGenerator.generateRouteApiMappingFile(routes, apiMappings) const enhancedApiMappings = this._triggerAnalyzer.findTriggerSourcesForApiMappings(apiMappings)
// 生成包含路由和API关联信息的文件
this._fileGenerator.generateRouteApiMappingFile(routes, enhancedApiMappings)
// 重置生成中标志并更新时间戳 // 重置生成中标志并更新时间戳
this._generationInProgress = false this._generationInProgress = false
@ -152,9 +155,6 @@ function routeMappingPlugin() {
// TODO: 后续步骤将在优化过程中逐步添加 // TODO: 后续步骤将在优化过程中逐步添加
// 3. 关联页面与API(第三层)
// const enhancedApiMappings = this._triggerAnalyzer.findTriggerSourcesForApiMappings(apiMappings)
// 4. 优化API映射 // 4. 优化API映射
// const optimizedApiMappings = this._fileGenerator.optimizeApiMappings(enhancedApiMappings) // const optimizedApiMappings = this._fileGenerator.optimizeApiMappings(enhancedApiMappings)

255
gofaster/app/src/renderer/modules/route-sync/direct-route-mappings.js

@ -39,62 +39,171 @@ export default {
{ {
"apiMethodName": "getRoles", "apiMethodName": "getRoles",
"method": "GET", "method": "GET",
"path": "/api/auth/roles" "path": "/api/auth/roles",
"triggerSources": [
{
"component": "UserRoleAssignment",
"triggerName": "loadRoles",
"triggerType": "method"
},
{
"component": "RoleManagement",
"triggerName": "loadRoles",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "getRole", "apiMethodName": "getRole",
"method": "GET", "method": "GET",
"path": "/api/auth/roles/{id}" "path": "/api/auth/roles/{id}",
"triggerSources": [
{
"component": "PermissionManager",
"triggerName": "loadRolePermissions",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "createRole", "apiMethodName": "createRole",
"method": "POST", "method": "POST",
"path": "/api/auth/roles" "path": "/api/auth/roles",
"triggerSources": [
{
"component": "RoleManagement",
"triggerName": "saveRole",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "updateRole", "apiMethodName": "updateRole",
"method": "PUT", "method": "PUT",
"path": "/api/auth/roles/{id}" "path": "/api/auth/roles/{id}",
"triggerSources": [
{
"component": "PermissionManager",
"triggerName": "savePermissions",
"triggerType": "method"
},
{
"component": "RoleManagement",
"triggerName": "saveRole",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "deleteRole", "apiMethodName": "deleteRole",
"method": "DELETE", "method": "DELETE",
"path": "/api/auth/roles/{id}" "path": "/api/auth/roles/{id}",
"triggerSources": [
{
"component": "RoleManagement",
"triggerName": "deleteRole",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "getPermissions", "apiMethodName": "getPermissions",
"method": "GET", "method": "GET",
"path": "/api/auth/permissions" "path": "/api/auth/permissions",
"triggerSources": [
{
"component": "PermissionManager",
"triggerName": "loadPermissions",
"triggerType": "method"
},
{
"component": "RolePermissionAssignment",
"triggerName": "loadAllPermissions",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "assignRolesToUser", "apiMethodName": "assignRolesToUser",
"method": "POST", "method": "POST",
"path": "/api/auth/roles/users/{userId}/assign" "path": "/api/auth/roles/users/{userId}/assign",
"triggerSources": [
{
"component": "UserRoleAssignment",
"triggerName": "saveRoleAssignment",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "getUserRoles", "apiMethodName": "getUserRoles",
"method": "GET", "method": "GET",
"path": "/api/auth/roles/users/{userId}" "path": "/api/auth/roles/users/{userId}",
"triggerSources": [
{
"component": "UserRoleAssignment",
"triggerName": "loadUserRoles",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "removeRolesFromUser", "apiMethodName": "removeRolesFromUser",
"method": "DELETE", "method": "DELETE",
"path": "/api/auth/roles/users/{userId}/remove" "path": "/api/auth/roles/users/{userId}/remove",
"triggerSources": [
{
"component": "UserRoleAssignment",
"triggerName": "saveRoleAssignment",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "getRolePermissions", "apiMethodName": "getRolePermissions",
"method": "GET", "method": "GET",
"path": "/api/auth/permissions/roles/{roleId}" "path": "/api/auth/permissions/roles/{roleId}",
"triggerSources": [
{
"component": "RolePermissionAssignment",
"triggerName": "loadRolePermissions",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "assignPermissionsToRole", "apiMethodName": "assignPermissionsToRole",
"method": "POST", "method": "POST",
"path": "/api/auth/permissions/roles/{roleId}/assign" "path": "/api/auth/permissions/roles/{roleId}/assign",
"triggerSources": [
{
"component": "RolePermissionAssignment",
"triggerName": "assignPermission",
"triggerType": "method"
},
{
"component": "RolePermissionAssignment",
"triggerName": "assignSelectedPermissions",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "removePermissionsFromRole", "apiMethodName": "removePermissionsFromRole",
"method": "DELETE", "method": "DELETE",
"path": "/api/auth/permissions/roles/{roleId}/remove" "path": "/api/auth/permissions/roles/{roleId}/remove",
"triggerSources": [
{
"component": "RolePermissionAssignment",
"triggerName": "removePermission",
"triggerType": "method"
},
{
"component": "RolePermissionAssignment",
"triggerName": "removeSelectedPermissions",
"triggerType": "method"
}
]
} }
] ]
}, },
@ -105,87 +214,175 @@ export default {
{ {
"apiMethodName": "getUsers", "apiMethodName": "getUsers",
"method": "GET", "method": "GET",
"path": "/api/auth/admin/users" "path": "/api/auth/admin/users",
"triggerSources": [
{
"component": "UserManagement",
"triggerName": "loadUsers",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "getUser", "apiMethodName": "getUser",
"method": "GET", "method": "GET",
"path": "/api/auth/admin/users/{id}" "path": "/api/auth/admin/users/{id}",
"triggerSources": []
}, },
{ {
"apiMethodName": "createUser", "apiMethodName": "createUser",
"method": "POST", "method": "POST",
"path": "/api/auth/admin/users" "path": "/api/auth/admin/users",
"triggerSources": [
{
"component": "UserManagement",
"triggerName": "submitUser",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "updateUser", "apiMethodName": "updateUser",
"method": "PUT", "method": "PUT",
"path": "/api/auth/admin/users/{id}" "path": "/api/auth/admin/users/{id}",
"triggerSources": [
{
"component": "UserManagement",
"triggerName": "submitUser",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "deleteUser", "apiMethodName": "deleteUser",
"method": "DELETE", "method": "DELETE",
"path": "/api/auth/admin/users/{id}" "path": "/api/auth/admin/users/{id}",
"triggerSources": [
{
"component": "UserManagement",
"triggerName": "deleteUser",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "getRoles", "apiMethodName": "getRoles",
"method": "GET", "method": "GET",
"path": "/api/auth/admin/roles" "path": "/api/auth/admin/roles",
"triggerSources": []
}, },
{ {
"apiMethodName": "changePassword", "apiMethodName": "changePassword",
"method": "POST", "method": "POST",
"path": "/api/auth/change-password" "path": "/api/auth/change-password",
"triggerSources": [
{
"component": "PasswordChangeModal",
"triggerName": "handleSubmit",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "getPasswordPolicy", "apiMethodName": "getPasswordPolicy",
"method": "GET", "method": "GET",
"path": "/api/auth/password-policy" "path": "/api/auth/password-policy",
"triggerSources": [
{
"component": "PasswordChangeModal",
"triggerName": "loadPasswordPolicy",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "validatePassword", "apiMethodName": "validatePassword",
"method": "POST", "method": "POST",
"path": "/api/auth/validate-password" "path": "/api/auth/validate-password",
"triggerSources": [
{
"component": "PasswordChangeModal",
"triggerName": "validatePassword",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "checkPasswordStatus", "apiMethodName": "checkPasswordStatus",
"method": "GET", "method": "GET",
"path": "/api/auth/password-status" "path": "/api/auth/password-status",
"triggerSources": []
}, },
{ {
"apiMethodName": "getPermissions", "apiMethodName": "getPermissions",
"method": "GET", "method": "GET",
"path": "/api/permissions" "path": "/api/permissions",
"triggerSources": []
}, },
{ {
"apiMethodName": "getCaptcha", "apiMethodName": "getCaptcha",
"method": "GET", "method": "GET",
"path": "/api/auth/captcha" "path": "/api/auth/captcha",
"triggerSources": [
{
"component": "LoginModal",
"triggerName": "refreshCaptcha",
"triggerType": "method"
},
{
"component": "LoginModal",
"triggerName": "refreshCaptchaWithoutClearError",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "login", "apiMethodName": "login",
"method": "POST", "method": "POST",
"path": "/api/auth/login" "path": "/api/auth/login",
"triggerSources": [
{
"component": "LoginModal",
"triggerName": "handleLogin",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "logout", "apiMethodName": "logout",
"method": "POST", "method": "POST",
"path": "/api/auth/logout" "path": "/api/auth/logout",
"triggerSources": []
}, },
{ {
"apiMethodName": "getCurrentUser", "apiMethodName": "getCurrentUser",
"method": "GET", "method": "GET",
"path": "/api/auth/me" "path": "/api/auth/me",
"triggerSources": [
{
"component": "UserProfile",
"triggerName": "loadUserProfile",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "changePassword", "apiMethodName": "changePassword",
"method": "POST", "method": "POST",
"path": "/api/auth/change-password" "path": "/api/auth/change-password",
"triggerSources": [
{
"component": "PasswordChangeModal",
"triggerName": "handleSubmit",
"triggerType": "method"
}
]
}, },
{ {
"apiMethodName": "resetPassword", "apiMethodName": "resetPassword",
"method": "POST", "method": "POST",
"path": "/api/auth/reset-password" "path": "/api/auth/reset-password",
"triggerSources": []
} }
] ]
} }

Loading…
Cancel
Save