anl 1.3.18 → 1.3.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="3.0.0",t={"/api/test":{get:{operationId:"AppController_apiTest",parameters:[],responses:{200:{description:""}},tags:["Test Server"]}},"/api/lsp/compile":{post:{operationId:"LspController_compile",summary:"Get code completions based on given input",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/CompletionDto"}}}},responses:{200:{description:"Successfully fetched the completion list."},400:{description:"Failed to fetch the completion list."}},tags:["LSP"]}},"/api/manageGame/createGame":{post:{operationId:"ManageGameController_createGame",summary:"创建新的游戏",parameters:[],requestBody:{required:!0,description:"创建游戏报文",content:{"application/json":{schema:{$ref:"#/components/schemas/CreateGameDto"}}}},responses:{200:{description:"游戏创建成功"}},tags:["Manage Game"]}},"/api/manageGame/gameList":{get:{operationId:"ManageGameController_getGameList",summary:"游戏列表",parameters:[],responses:{200:{description:"返回游戏列表"}},tags:["Manage Game"]}},"/api/manageGame/getGameConfig/{gameName}":{get:{operationId:"ManageGameController_getGameConfig",summary:"获取游戏的配置信息",parameters:[{name:"gameName",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"返回游戏配置"},400:{description:"获取游戏配置失败"}},tags:["Manage Game"]}},"/api/manageGame/rename":{post:{operationId:"ManageGameController_rename",summary:"游戏名称重命名",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/RenameDto"}}}},responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["Manage Game"]}},"/api/manageGame/delete":{post:{operationId:"ManageGameController_deleteFileOrDir",summary:"删除游戏",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/DeleteGameDto"}}}},responses:{200:{description:"Successfully"},400:{description:"Failed."}},tags:["Manage Game"]}},"/api/manageGame/readGameAssets/{readDirPath}":{get:{operationId:"ManageGameController_readGameAssets",summary:"Read Game Assets",parameters:[{name:"readDirPath",required:!0,in:"path",description:"Path of the game directory to read assets from, including subdirectories.",schema:{type:"string"}}],responses:{200:{description:"Retrieve the assets of the specified game directory."}},tags:["Manage Game"]}},"/api/manageGame/readUserAssets/{readDirPath}":{get:{operationId:"ManageGameController_readUserAssets",summary:"读取用户资源",parameters:[{name:"readDirPath",required:!0,in:"path",description:"读取资产的用户目录路径,包括子目录.",schema:{type:"string"}}],responses:{200:{description:"检索指定用户目录下的资源."}},tags:["Manage Game"]}},"/api/manageGame/setGameConfig":{post:{operationId:"ManageGameController_setGameConfig",summary:"Set Game Configuration",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/GameConfigDto"}}}},responses:{200:{description:"Game configuration set successfully."},400:{description:"Failed to set the game configuration."}},tags:["Manage Game"]}},"/api/manageGame/resource/uploadFiles":{post:{operationId:"ManageGameController_uploadUserResource",summary:"上传用户资源文件",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/UploadResourceDto"}}}},responses:{200:{description:"Files uploaded successfully."},400:{description:"Failed to upload files."}},tags:["Manage Game"]}},"/api/manageGame/resource/rename":{post:{operationId:"ManageGameController_resourceRename",summary:"用户资源文件重命名",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/RenameDto"}}}},responses:{200:{description:"Successfully"},400:{description:"Failed"}},tags:["Manage Game"]}},"/api/manageGame/resource/delete":{post:{operationId:"ManageGameController_resourceDelete",summary:"删除用户资源文件",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/DeleteResourceDto"}}}},responses:{200:{description:"Successfully"},400:{description:"Failed"}},tags:["Manage Game"]}},"/api/manageGame/resource/mkdir":{post:{operationId:"ManageGameController_resourceMkDir",summary:"新建用户资源文件夹",parameters:[{name:"resource",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/MkDirDto"}}}},responses:{200:{description:"Directory created successfully."},400:{description:"Failed to create directory."}},tags:["Manage Game"]}},"/api/manageGame/openGameDict/{gameName}":{get:{operationId:"ManageGameController_openGameDict",summary:"Open Game Dictionary",parameters:[{name:"gameName",required:!0,in:"path",description:"Name of the game.",schema:{type:"string"}}],responses:{200:{description:"Opens the dictionary for a specified game."}},tags:["Manage Game"]}},"/api/manageGame/openGameAssetsDict/{gameName}":{get:{operationId:"ManageGameController_openGameAssetsDict",summary:"Open Game Assets Dictionary",parameters:[{name:"gameName",required:!0,in:"path",description:"Name of the game.",schema:{type:"string"}},{name:"subFolder",required:!0,in:"query",schema:{type:"string"}}],responses:{200:{description:"Opens the assets dictionary for a specified game."}},tags:["Manage Game"]}},"/api/manageGame/ejectGameAsWeb/{gameName}":{get:{operationId:"ManageGameController_ejectGameAsWeb",summary:"Eject Game As Web App",parameters:[{name:"gameName",required:!0,in:"path",description:"Name of the game to be exported as web app.",schema:{type:"string"}}],responses:{200:{description:"Exports the specified game as a web app."}},tags:["Manage Game"]}},"/api/manageGame/ejectGameAsExe/{gameName}":{get:{operationId:"ManageGameController_ejectGameAsExe",summary:"Eject Game As EXE",parameters:[{name:"gameName",required:!0,in:"path",description:"Name of the game to be exported as EXE.",schema:{type:"string"}}],responses:{200:{description:"Exports the specified game as an EXE (Windows Electron App)."}},tags:["Manage Game"]}},"/api/manageGame/ejectGameAsAndroid/{gameName}":{get:{operationId:"ManageGameController_ejectGameAsAndroid",summary:"Eject Game As Android App",parameters:[{name:"gameName",required:!0,in:"path",description:"Name of the game to be exported as an Android app.",schema:{type:"string"}}],responses:{200:{description:"Exports the specified game as an Android app."}},tags:["Manage Game"]}},"/api/manageGame/deleteFile":{post:{operationId:"ManageGameController_deleteFile",summary:"Delete File",parameters:[],requestBody:{required:!0,description:"File deletion data",content:{"application/json":{schema:{$ref:"#/components/schemas/DeleteFileDto"}}}},responses:{200:{description:"Successfully deleted the file."},400:{description:"Failed to delete the file."}},tags:["Manage Game"]}},"/api/manageGame/createNewScene":{post:{operationId:"ManageGameController_createNewScene",summary:"Create a New Scene",parameters:[],requestBody:{required:!0,description:"Scene creation data",content:{"application/json":{schema:{$ref:"#/components/schemas/CreateNewSceneDto"}}}},responses:{200:{description:"Successfully created the scene."},400:{description:"Failed to create the scene or scene already exists."}},tags:["Manage Game"]}},"/api/manageGame/editScene":{post:{operationId:"ManageGameController_editScene",summary:"Edit Scene",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/EditSceneDto"}}}},responses:{200:{description:"Scene edited successfully."},400:{description:"Failed to edit the scene."}},tags:["Manage Game"]}},"/api/manageGame/editTextFile":{post:{operationId:"ManageGameController_editTextFile",summary:"Edit TextFile",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/EditTextFileDto"}}}},responses:{200:{description:"File edited successfully."},400:{description:"Failed to edit the file."}},tags:["Manage Game"]}},"/api/manageGame/uploadFiles":{post:{operationId:"ManageGameController_uploadFiles",summary:"Upload Files",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/UploadFilesDto"}}}},responses:{200:{description:"Files uploaded successfully."},400:{description:"Failed to upload files."}},tags:["Manage Game"]}},"/api/manageGame/mkdir":{post:{operationId:"ManageGameController_mkDir",summary:"Create Directory",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/MkDirDto"}}}},responses:{200:{description:"Directory created successfully."},400:{description:"Failed to create directory."}},tags:["Manage Game"]}},"/api/manageGame/{gameName}/scene/{fileName}":{get:{operationId:"ManageGameController_laodSceneFile",summary:"read scene file",parameters:[{name:"gameName",required:!0,in:"path",description:"game name.",schema:{type:"string"}},{name:"fileName",required:!0,in:"path",description:"scene file name.",schema:{type:"string"}}],responses:{200:{description:"return zh and en scene file"}},tags:["Manage Game"]}},"/api/llm/txt/v2/cache":{post:{operationId:"LlmController_mCache",summary:"Kimi模型资源存储",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/Llm"}}}},responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["LLM"]}},"/api/llm/txt/v2/{tlmId}":{get:{operationId:"LlmController_txtV3",summary:"Maas文生文",parameters:[{name:"tlmId",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["LLM"]}},"/api/llm/recommend/{rid}/features":{get:{operationId:"LlmController_recommendFeatures",summary:"推荐角色人格",parameters:[{name:"rid",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["LLM"]}},"/api/llm/recommend/{bgid}/category":{get:{operationId:"LlmController_recommendCategory",summary:"推荐背景分类",parameters:[{name:"bgid",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["LLM"]}},"/api/llm/image/upload":{post:{operationId:"LlmController_imageUpload",summary:"大模型图片上传接口",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ImageUploadDto"}}}},responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["LLM"]}},"/api/llm/sseTest":{get:{operationId:"LlmController_sse",parameters:[],responses:{200:{description:""}},tags:["LLM"]}},"/api/llm/upload/text":{post:{operationId:"LlmController_uploadText",summary:"上传文本文件返回文本,最大可接收5000字符",parameters:[],responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["LLM"]}},"/api/llm/get/expression/list":{get:{operationId:"LlmController_getExpressionList",summary:"获取表情标签列表",parameters:[],responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["LLM"]}},"/api/llm/draw/{event}/{reqId}":{get:{operationId:"LlmController_draw",summary:"获取绘图结果",parameters:[{name:"event",required:!0,in:"path",schema:{type:"string"}},{name:"reqId",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["LLM"]}},"/api/llm/draw/task":{get:{operationId:"LlmController_drawing",summary:"获取该用户下正在绘图的Reqs",parameters:[],responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["LLM"]}},"/api/role/figure":{post:{operationId:"RoleController_createFigure",summary:"保存角色",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/AddRoleDto"}}}},responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["Role"]}},"/api/role/figure/img":{post:{operationId:"RoleController_uploadFigureImg",summary:"保存立绘/表情差分图图片",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/AddFigureDto"}}}},responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["Role"]}},"/api/role/list":{get:{operationId:"RoleController_listRole",summary:"获取该用户下角色列表",parameters:[],responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["Role"]}},"/api/role/{rid}":{put:{operationId:"RoleController_updateRole",summary:"更新角色",parameters:[{name:"rid",required:!0,in:"path",description:"角色ID",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateRoleDto"}}}},responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["Role"]},delete:{operationId:"RoleController_deletedRole",summary:"删除角色",parameters:[{name:"rid",required:!0,in:"path",description:"角色ID",schema:{type:"string"}}],responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["Role"]}},"/api/role/test1":{get:{operationId:"RoleController_test",parameters:[],responses:{200:{description:""}},tags:["Role"]}},"/api/resource":{post:{operationId:"ResourceController_create",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/CreateResourceDto"}}}},responses:{201:{description:""}},tags:["Resource"]}},"/api/resource/{id}":{get:{operationId:"ResourceController_findOne",parameters:[{name:"id",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},tags:["Resource"]},patch:{operationId:"ResourceController_update",parameters:[{name:"id",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateResourceDto"}}}},responses:{200:{description:""}},tags:["Resource"]},delete:{operationId:"ResourceController_remove",parameters:[{name:"id",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},tags:["Resource"]}},"/api/bg/add":{post:{operationId:"BgController_createBg",summary:"保存背景信息",parameters:[],requestBody:{required:!0,description:"保存背景信息",content:{"application/json":{schema:{$ref:"#/components/schemas/CreateBgDto"}}}},responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["Bg"]}},"/api/bg/list":{get:{operationId:"BgController_list",summary:"获取背景信息列表",parameters:[],responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["Bg"]}},"/api/bg/update/{bid}":{post:{operationId:"BgController_updateBg",summary:"更新背景信息",parameters:[{name:"bid",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,description:"更新背景信息",content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateBgDto"}}}},responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["Bg"]}},"/api/bg/uploadImage/{bid}":{post:{operationId:"BgController_uploadBgImg",summary:"保存背景图片",parameters:[{name:"bid",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/UploadImageDto"}}}},responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["Bg"]}},"/api/bg/remove/{bid}":{delete:{operationId:"BgController_remove",summary:"删除背景信息",parameters:[{name:"bid",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},tags:["Bg"]}},"/api/user/login":{post:{operationId:"UserController_login",summary:"用户登录",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/CreateUserDto"}}}},responses:{200:{description:"Successfully."}},tags:["User"]}},"/api/user":{post:{operationId:"UserController_create",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/CreateUserDto"}}}},responses:{201:{description:""}},tags:["User"]}},"/api/editor/addScenes":{post:{operationId:"EditorController_addScenes",summary:"创建章节/场景",parameters:[],requestBody:{required:!0,description:"请求体",content:{"application/json":{schema:{$ref:"#/components/schemas/AddSceneDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{type:"array",items:{type:"string"}}}}}},tags:["Editor"]}},"/api/editor/createNewScene":{post:{operationId:"EditorController_createNewScene",summary:"创建章节/场景",parameters:[],requestBody:{required:!0,description:"创建章节/场景",content:{"application/json":{schema:{$ref:"#/components/schemas/DialogueDto"}}}},responses:{200:{description:"Successfully created the scene."},400:{description:"Failed."}},tags:["Editor"]}},"/api/editor/deleteScene":{post:{operationId:"EditorController_deleteScene",summary:"删除章节/场景",parameters:[],requestBody:{required:!0,description:"删除章节/场景",content:{"application/json":{schema:{$ref:"#/components/schemas/SceneDto"}}}},responses:{200:{description:"Successfully delete the scene."},400:{description:"Failed."}},tags:["Editor"]}},"/api/editor/sceneDetail":{post:{operationId:"EditorController_getSceneDetail",summary:"查询场景详情内容",parameters:[],requestBody:{required:!0,description:"查询场景详情内容",content:{"application/json":{schema:{$ref:"#/components/schemas/SceneDetailDto"}}}},responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["Editor"]}},"/api/editor/editUiScene/upload":{post:{operationId:"EditorController_uploadUiSceneDialogue",summary:"上传文本更新UI对话资源",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/DialogueDto"}}}},responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["Editor"]}},"/api/editor/editUiScene/dialogue":{post:{operationId:"EditorController_editUiSceneDialogue",summary:"更新UI编辑器对话资源",parameters:[],requestBody:{required:!0,description:"更新UI编辑器对话资源",content:{"application/json":{schema:{$ref:"#/components/schemas/DialogueDto"}}}},responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["Editor"]}},"/api/editor/scene/command/{id}":{post:{operationId:"EditorController_commandLine",summary:"根据行ID获取指令行",parameters:[{name:"id",required:!0,in:"path",description:"id",schema:{type:"string"}}],requestBody:{required:!0,description:"场景信息",content:{"application/json":{schema:{$ref:"#/components/schemas/SceneDto"}}}},responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["Editor"]}},"/api/editor/scene/check":{post:{operationId:"EditorController_checkScene",summary:"校验场景信息",parameters:[],requestBody:{required:!0,description:"校验场景信息",content:{"application/json":{schema:{$ref:"#/components/schemas/SceneDto"}}}},responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["Editor"]}},"/api/editor/editUiScene/resource":{post:{operationId:"EditorController_editUiSceneResource",summary:"更新UI编辑器场景资源",parameters:[],requestBody:{required:!0,description:"更新UI编辑器场景资源",content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateUiResourceDto"}}}},responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["Editor"]}},"/api/editor/editTxtScene/upload":{post:{operationId:"EditorController_uploadTxtSceneDialogue",summary:"上传文本更新TXT对话资源",parameters:[],requestBody:{required:!0,description:"更新文本编辑器内容",content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateTxtSceneDto"}}}},responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["Editor"]}},"/api/editor/editTxtScene":{post:{operationId:"EditorController_editTxtScene",summary:"更新文本编辑器内容",parameters:[],requestBody:{required:!0,description:"更新文本编辑器内容",content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateTxtSceneDto"}}}},responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["Editor"]}},"/api/editor/rename":{post:{operationId:"EditorController_sceneFileRename",summary:"场景文件重命名",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/SceneReNameDto"}}}},responses:{200:{description:"Rename successfully."},400:{description:"Failed"}},tags:["Editor"]}},"/api/editor/getSectionSceneList/{gameName}":{post:{operationId:"EditorController_getSectionSceneList",summary:"获取章节场景列表数据",parameters:[{name:"gameName",required:!0,in:"path",description:"游戏名称",schema:{type:"string"}}],responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["Editor"]}},"/api/editor/launch/{gameName}":{get:{operationId:"EditorController_launchGame",summary:"发布游戏",parameters:[{name:"gameName",required:!0,in:"path",description:"游戏名称",schema:{type:"string"}}],responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["Editor"]}},"/api/variable/global/record":{post:{operationId:"VariableController_recordVariable",summary:"记录变量信息",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateVariableDto"}}}},responses:{default:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/ResultData"}}}}},tags:["Variable"]}},"/api/variable/global/{gameName}/list":{get:{operationId:"VariableController_varList",summary:"获取游戏变量信息列表",parameters:[{name:"gameName",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"Successfully."},500:{description:"Failed."}},tags:["Variable"]}},"/api/variable/{id}":{get:{operationId:"VariableController_findOne",parameters:[{name:"id",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},tags:["Variable"]}},"/api/variable/global/{id}/remove":{delete:{operationId:"VariableController_remove",summary:"删除变量信息",parameters:[{name:"id",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"Successfully."},500:{description:"Failed."}},tags:["Variable"]}},"/api/canvas/record":{post:{operationId:"CanvasController_record",summary:"记录画布数据",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/RecordCanvasDto"}}}},responses:{200:{description:""},500:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/ValidateCanvas"}}}}},tags:["Canvas"]}},"/api/canvas/{gameName}/view":{get:{operationId:"CanvasController_view",summary:"获取最新的画布节点数据",parameters:[{name:"gameName",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/CanvasBody"}}}}},tags:["Canvas"]}},"/api/canvas/{gameName}/revise/history":{get:{operationId:"CanvasController_history",summary:"获取历史修订列表",parameters:[{name:"gameName",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/CanvasHistory"}}}}}},tags:["Canvas"]}},"/api/canvas/{id}/revise/detail":{get:{operationId:"CanvasController_detail",summary:"获取指定修订详情",parameters:[{name:"id",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/CanvasBody"}}}}},tags:["Canvas"]}}},r={title:"UMPAY.NETA Terre API",description:"API Refrence of UMPAY.NETA Terre Editor",version:"1.0",contact:{}},s=[],a=[{url:"http://10.10.77.121/dev-api"}],i={schemas:{CompletionDto:{type:"object",properties:{editorValue:{type:"string",description:"Editor input value for which the completion is required"},sceneType:{type:"string",description:"scene file type en or zh"},params:{type:"object",description:"Parameters required for completion"}},required:["editorValue","sceneType","params"]},CreateGameDto:{type:"object",properties:{gameName:{type:"string",description:"The name of the game to be created"}},required:["gameName"]},RenameDto:{type:"object",properties:{source:{type:"string",description:"The source path of the file or directory to be renamed"},newName:{type:"string",description:"New name for renaming the file or directory"}},required:["source","newName"]},DeleteGameDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"}},required:["gameName"]},GameConfigDto:{type:"object",properties:{gameName:{type:"string",description:"The name of the game"},newConfig:{type:"string",description:"New game configuration"}},required:["gameName","newConfig"]},UploadResourceDto:{type:"object",properties:{folder:{type:"string",description:"资源所属文件夹"}},required:["folder"]},DeleteResourceDto:{type:"object",properties:{name:{type:"string",description:"资源名称"}},required:["name"]},MkDirDto:{type:"object",properties:{source:{type:"string",description:"已有的资源文件夹"},name:{type:"string",description:"Name for the new directory"}},required:["source","name"]},DeleteFileDto:{type:"object",properties:{path:{type:"string",description:"The path to the file to be deleted"}},required:["path"]},CreateNewSceneDto:{type:"object",properties:{gameName:{type:"string",description:"The name of the game"},sceneName:{type:"string",description:"The name of the scene"}},required:["gameName","sceneName"]},EditSceneDto:{type:"object",properties:{gameName:{type:"string",description:"The name of the game"},sceneName:{type:"string",description:"The name of the scene"},type:{type:"string",description:"Scene data type en or zh"},sceneData:{type:"string",description:"Scene data content",format:"{ value: string }"}},required:["gameName","sceneName","type","sceneData"]},EditTextFileDto:{type:"object",properties:{path:{type:"string",description:"The path of textfile"},textFile:{type:"string",description:"Text data content"}},required:["path","textFile"]},UploadFilesDto:{type:"object",properties:{targetDirectory:{type:"string",description:"Target directory for the uploaded files"}},required:["targetDirectory"]},Llm:{type:"object",properties:{}},ImageUploadDto:{type:"object",properties:{category:{type:"string",description:"图片类别"},original:{type:"string",description:"蒙版对应原始图片名称"}},required:["category","original"]},AddRoleDto:{type:"object",properties:{name:{type:"string",description:"角色名字"},gender:{type:"string",description:"性别",enum:["male","female"]},style:{type:"string",description:"立绘风格"},age:{type:"string",description:"年纪",enum:["child","adult","hoariness"]}},required:["name","gender","style","age"]},AddFigureDto:{type:"object",properties:{fileUrl:{type:"string",description:"需要保存的文件地址"},rid:{type:"string",description:"角色ID"},expression:{type:"string",description:"差分名"}},required:["fileUrl","rid","expression"]},UpdateRoleDto:{type:"object",properties:{fileUrl:{type:"string",description:"主立绘的图片地址"},fileLink:{type:"string",description:"主立绘图片链接"},seed:{type:"string",description:"主立绘随机种子"},tlmId:{type:"string",description:"角色对应的大模型信息ID"},feature:{type:"string",description:"人格"},referPic:{type:"string",description:"人格参考图"},expression:{type:"string",description:"差分名"},prompts:{type:"string",description:"提示词"},figures:{description:"表情差分图",type:"array",items:{type:"string"}}},required:["fileUrl","fileLink","seed","tlmId","feature","referPic","expression","prompts","figures"]},CreateResourceDto:{type:"object",properties:{name:{type:"string",description:"资源名称"},path:{type:"string",description:"资源路径"},type:{type:"string",description:"资源类型"},uid:{type:"string",description:"用户ID"},pid:{type:"string",description:"父级资源ID"},remark:{type:"string",description:"备注"}},required:["name","path","type","uid","pid","remark"]},UpdateResourceDto:{type:"object",properties:{}},CreateBgDto:{type:"object",properties:{name:{type:"string",description:"背景名称"},style:{type:"string",description:"背景风格"}},required:["name","style"]},UpdateBgDto:{type:"object",properties:{prompts:{type:"string",description:"提示词"},tlmId:{type:"string",description:"背景对应大模型输出ID"},bgPath:{type:"string",description:"背景图片的相对地址"},category:{type:"string",description:"背景分类"},referPic:{type:"string",description:"背景分类参考图"}},required:["prompts","tlmId","bgPath","category","referPic"]},UploadImageDto:{type:"object",properties:{imageName:{type:"string",description:"图片名称"},imageUrl:{type:"string",description:"图片地址"},imageRelevancy:{type:"string",description:"图片所属:用户"},imageCategory:{type:"string",description:"图片类别"}},required:["imageName","imageUrl","imageRelevancy","imageCategory"]},CreateUserDto:{type:"object",properties:{username:{type:"string",description:"用户名"},password:{type:"string",description:"密码"},nickname:{type:"string",description:"昵称(可选填)"}},required:["username","password","nickname"]},ResultData:{type:"object",properties:{code:{type:"number",default:200},msg:{type:"string",default:"ok"},data:{type:"any",default:null,nullable:!0}},required:["code","msg","data"]},AddSceneDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sceneName:{description:"场景列表",type:"array",items:{type:"string"}}},required:["gameName","sceneName"]},DialogueDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sectionName:{type:"string",description:"章节名称(文本编辑器忽略)"},sceneName:{type:"string",description:"场景名称"},editorType:{type:"string",description:"编辑器类型"},dialogue:{type:"string",description:"更新对话"}},required:["gameName","sectionName","sceneName","editorType","dialogue"]},SceneDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sectionName:{type:"string",description:"章节名称(文本编辑器忽略)"},sceneName:{type:"string",description:"场景名称"},editorType:{type:"string",description:"编辑器类型"}},required:["gameName","sectionName","sceneName","editorType"]},SceneDetailDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sectionName:{type:"string",description:"章节名称(文本编辑器忽略)"},sceneName:{type:"string",description:"场景名称"},editorType:{type:"string",description:"编辑器类型"},sceneType:{type:"string",description:"场景类型"}},required:["gameName","sectionName","sceneName","editorType","sceneType"]},UpdateUiResourceDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sectionName:{type:"string",description:"章节名称(文本编辑器忽略)"},sceneName:{type:"string",description:"场景名称"},editorType:{type:"string",description:"编辑器类型"},bg:{type:"string",description:"更新背景"},bgm:{type:"string",description:"更新音乐"}},required:["gameName","sectionName","sceneName","editorType","bg","bgm"]},UpdateTxtSceneDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sectionName:{type:"string",description:"章节名称(文本编辑器忽略)"},sceneName:{type:"string",description:"场景名称"},editorType:{type:"string",description:"编辑器类型"},text:{type:"string",description:"编辑文本"}},required:["gameName","sectionName","sceneName","editorType","text"]},SceneReNameDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sectionName:{type:"string",description:"章节名称(文本编辑器忽略)"},sceneName:{type:"string",description:"场景名称"},editorType:{type:"string",description:"编辑器类型"},newSectionName:{type:"string",description:"新章节名称"},newSceneName:{type:"string",description:"新场景名称"}},required:["gameName","sectionName","sceneName","editorType","newSectionName","newSceneName"]},UpdateVariableDto:{type:"object",properties:{id:{type:"string",description:"变量表ID"}},required:["id"]},Variable:{type:"object",properties:{id:{type:"string"},name:{type:"string"}},required:["id","name"]},ExpValue:{type:"object",properties:{value:{type:"number"},exp:{type:"string"}},required:["value","exp"]},ICondition:{type:"object",properties:{isEnabled:{type:"boolean",description:"是否启用"},variable:{description:"变量信息",allOf:[{$ref:"#/components/schemas/Variable"}]},lower:{description:"下限",allOf:[{$ref:"#/components/schemas/ExpValue"}]},upper:{description:"上限",allOf:[{$ref:"#/components/schemas/ExpValue"}]},condition:{type:"string",description:"条件"}},required:["isEnabled","variable","lower","upper","condition"]},IOptions:{type:"object",properties:{name:{type:"string",description:"选项名称"},nodeId:{type:"string",description:"关联的节点"},sound:{type:"string",description:"绑定音频"},varId:{type:"string",description:"选定的变量"},varValue:{type:"number",description:"设定的变量值"},advanced:{description:"高级选项",allOf:[{$ref:"#/components/schemas/ICondition"}]}},required:["name","nodeId","sound","varId","varValue","advanced"]},NodeData:{type:"object",properties:{label:{type:"string",description:"节点名称"},chapterId:{type:"string",description:"章节id"},background:{type:"string",description:"绑定背景"},options:{description:"选项",type:"array",items:{$ref:"#/components/schemas/IOptions"}}},required:["label","chapterId","background","options"]},Node:{type:"object",properties:{id:{type:"string",description:"id"},type:{type:"string",description:"类型"},data:{description:"节点数据",allOf:[{$ref:"#/components/schemas/NodeData"}]}},required:["id","type","data"]},EdgeData:{type:"object",properties:{isEnabled:{type:"boolean",description:"是否启用"},variable:{description:"变量信息",allOf:[{$ref:"#/components/schemas/Variable"}]},lower:{description:"下限",allOf:[{$ref:"#/components/schemas/ExpValue"}]},upper:{description:"上限",allOf:[{$ref:"#/components/schemas/ExpValue"}]},condition:{type:"string",description:"条件"}},required:["isEnabled","variable","lower","upper","condition"]},Edge:{type:"object",properties:{id:{type:"string",description:"id"},source:{type:"string"},target:{type:"string"},data:{$ref:"#/components/schemas/EdgeData"}},required:["id","source","target","data"]},CanvasBody:{type:"object",properties:{nodes:{description:"节点信息",allOf:[{$ref:"#/components/schemas/Node"}]},edges:{description:"边信息",allOf:[{$ref:"#/components/schemas/Edge"}]}},required:["nodes","edges"]},Valid:{type:"object",properties:{id:{type:"string"},msg:{type:"string"}},required:["id","msg"]},ValidateCanvas:{type:"object",properties:{only:{description:"节点重复集",allOf:[{$ref:"#/components/schemas/Valid"}]},scene:{description:"场景报错集",allOf:[{$ref:"#/components/schemas/Valid"}]},branch:{description:"节点报错集",allOf:[{$ref:"#/components/schemas/Valid"}]},edge:{description:"边报错集",allOf:[{$ref:"#/components/schemas/Valid"}]}},required:["only","scene","branch","edge"]},CanvasHistory:{type:"object",properties:{_id:{type:"string",description:"画布ID"},updatedAt:{type:"string",description:"更新时间"},createdAt:{type:"string",description:"创建时间"}},required:["_id","updatedAt","createdAt"]},RecordCanvasDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},nodes:{description:"画布节点信息",type:"array",items:{$ref:"#/components/schemas/Node"}},edges:{description:"画布边信息",type:"array",items:{$ref:"#/components/schemas/Edge"}}},required:["gameName","nodes","edges"]}}},o={openapi:e,paths:t,info:r,tags:s,servers:a,components:i};exports.components=i,exports.default=o,exports.info=r,exports.openapi=e,exports.paths=t,exports.servers=a,exports.tags=s;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="1.3.17",i="FE command line tool",s="bin/an-cli.js",t={dev:"rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript -w",build:"rimraf lib && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",pub:"bash publish.sh",ts:"tsc ./src/int.ts --noEmit --watch"},p={anl:"bin/an-cli.js"},l="Gleason <bianliuzhu@gmail.com>",r={"@commitlint/cli":"^17.4.3","@commitlint/config-conventional":"^17.4.3","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.3","@rollup/plugin-typescript":"^8.3.0","@types/inquirer":"^9.0.3","@types/shelljs":"^0.8.11","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0",eslint:"^8.7.0",husky:"^8.0.3","openapi-types":"^12.1.3",prettier:"^3.3.2",rimraf:"^5.0.7",rollup:"^2.64.0","rollup-plugin-cleandir":"^2.0.0","rollup-plugin-terser":"^7.0.2",typescript:"^4.5.4"},o={"app-root-path":"^3.1.0",cac:"^6.7.12",chalk:"4.*","clear-console":"^1.1.0",commander:"^10.0.0",figures:"^6.1.0",inquirer:"^10.1.8","log-symbols":"^5.1.0",ora:"5.*","progress-estimator":"^0.3.0",shelljs:"^0.8.5"},n=["typescript","cli","typescript 脚手架","ts 脚手架","ts-cli","脚手架"],c=["package.json","README.md","lib","template"],u={type:"git",url:"https://github.com/bianliuzhu/an-cli.git"},a="commonjs",g={name:"anl",version:e,description:i,main:s,scripts:t,bin:p,author:l,license:"ISC",devDependencies:r,dependencies:o,keywords:n,files:c,repository:u,type:a};exports.author=l,exports.bin=p,exports.default=g,exports.dependencies=o,exports.description=i,exports.devDependencies=r,exports.files=c,exports.keywords=n,exports.license="ISC",exports.main=s,exports.name="anl",exports.repository=u,exports.scripts=t,exports.type=a,exports.version=e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="1.3.19",i="FE command line tool",s="bin/an-cli.js",t={dev:"rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript -w",build:"rimraf lib && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",pub:"bash publish.sh",ts:"tsc ./src/int.ts --noEmit --watch"},p={anl:"bin/an-cli.js"},l="Gleason <bianliuzhu@gmail.com>",r={"@commitlint/cli":"^17.4.3","@commitlint/config-conventional":"^17.4.3","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.3","@rollup/plugin-typescript":"^8.3.0","@types/inquirer":"^9.0.3","@types/shelljs":"^0.8.11","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","cross-env":"^7.0.3",eslint:"^8.7.0",husky:"^8.0.3","openapi-types":"^12.1.3",prettier:"^3.3.2",rimraf:"^5.0.7",rollup:"^2.64.0","rollup-plugin-cleandir":"^2.0.0","rollup-plugin-terser":"^7.0.2",typescript:"^4.5.4"},o={"app-root-path":"^3.1.0",cac:"^6.7.12",chalk:"4.*","clear-console":"^1.1.0",commander:"^10.0.0",figures:"^6.1.0",inquirer:"^10.1.8","log-symbols":"^5.1.0",ora:"5.*","progress-estimator":"^0.3.0",shelljs:"^0.8.5"},n=["typescript","cli","typescript 脚手架","ts 脚手架","ts-cli","脚手架"],c=["package.json","README.md","lib","template"],u={type:"git",url:"https://github.com/bianliuzhu/an-cli.git"},a="commonjs",g={name:"anl",version:e,description:i,main:s,scripts:t,bin:p,author:l,license:"ISC",devDependencies:r,dependencies:o,keywords:n,files:c,repository:u,type:a};exports.author=l,exports.bin=p,exports.default=g,exports.dependencies=o,exports.description=i,exports.devDependencies=r,exports.files=c,exports.keywords=n,exports.license="ISC",exports.main=s,exports.name="anl",exports.repository=u,exports.scripts=t,exports.type=a,exports.version=e;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../utils/index.js");const r="\t";exports.default=class{defaultReturn={headerRef:"",renderStr:""};schemas={};schemasMap=new Map;config;constructor(e,r){this.schemas=e,this.config=r}typeNameToFileName(e){return e.replace(/_/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().replace(/-+/g,"-")}nameTheHumpCenterStroke(e){const r=e.replace("#/components/schemas/","");return{typeName:r,fileName:this.typeNameToFileName(r)}}parseRef(e){if(!e)return{headerRefStr:"",typeName:""};const{fileName:r,typeName:t}=this.nameTheHumpCenterStroke(e);return{headerRefStr:`import { ${t} } from './${r}';`,typeName:t}}parseObject(e,r){let t="",s="";if("object"===e.type){const a=e;if("object"==typeof a.additionalProperties){const e=this.parseArray(a.additionalProperties,r)??this.defaultReturn;t=e.headerRef,s=e.renderStr}}return{headerRef:t,renderStr:s}}parseArray(e,t){let s="",a="";const n=e;if(n.items?.$ref){const{headerRefStr:e,typeName:i}=this.parseRef(n.items.$ref);s=e,a=`${r}${t}?: Array<${i}>;`}else{const e=n.items;a=`${r}${t}?: Array<${"integer"===e.type?"number":e.type}>;`}return{headerRef:s,renderStr:a}}parseBoolean(e,t){return"boolean"===e.type?`${r}${t}?: boolean;`:""}parseEnum(e,t){if("integer"===e.type&&Array.isArray(e.enum)){return[`export enum ${t} {`,...e.enum.map((e=>`${r}NUMBER_${e} = ${e},`)),"}"].join("\n")}return""}parseInteger(e,t){return Array.isArray(e.enum)?this.parseEnum(e,t):`${r}${t}?: number;`}parseNumber(e,t){return"number"===e.type?`${r}${t}?: number;`:""}parseString(e,t){return"string"===e.type?{headerRef:"",renderStr:`${r}${t}?: string;`}:null}parseProperties(e,t){const s=[],a=[];for(const t in e){const n=e[t];if(n?.$ref){const{headerRefStr:e,typeName:i}=this.parseRef(n.$ref);a.includes(e)||a.push(e),s.push(`${r}${t}?: ${i};`)}else{if("allOf"in n){const e=n.allOf?.[0];if(e?.$ref){const{headerRefStr:n,typeName:i}=this.parseRef(e.$ref);a.includes(n)||a.push(n),s.push(`${r}${t}?: ${i};`);continue}}switch(n.type){case"array":{const e=this.parseArray(n,t)??this.defaultReturn;s.push(e.renderStr),a.includes(e.headerRef)||a.push(e.headerRef)}break;case"boolean":s.push(this.parseBoolean(n,t));break;case"integer":s.push(this.parseInteger(n,t));break;case"number":s.push(this.parseNumber(n,t));break;case"string":s.push(this.parseString(n,t)?.renderStr??"");break;case"object":{const{headerRef:e,renderStr:r}=this.parseObject(n,t)??this.defaultReturn;s.push(r),a.includes(e)||a.push(e)}}}}const n=`export interface ${t} {`;return[...a,"\n",n,...s,"}"].join("\n")}async parse(){for(const e in this.schemas){const r=this.schemas[e],t=r;if("$ref"in r){console.warn("ReferenceObject 未处理");continue}const s="type"in t?t:null,a=this.typeNameToFileName(e);if(s)if("items"in s)console.log("未处理---------------------------\x3e",s.items);else{let r="";switch(s.type){case"boolean":r=this.parseBoolean(s,e);break;case"integer":r=this.parseInteger(s,e);break;case"number":r=this.parseNumber(s,e);break;case"object":r=this.parseProperties(s.properties,e);break;case"string":r=this.parseString(s,e)?.renderStr??""}this.schemasMap.set(e,{fileName:a,content:r})}}}async writeFileHandler(){const r=[],t=[],s=`${this.config.saveTypeFolderPath}/models/`;for(const[,a]of this.schemasMap){const n=async({fileName:r,content:a})=>{t.push(`export * from './${r}';`),await e.writeFileRecursive(`${s}${r}.ts`,a)};r.push(n(a))}await Promise.all(r),await e.writeFileRecursive(`${s}/index.ts`,t.join("\n")),console.log("components done!")}async handle(){await this.parse(),await this.writeFileHandler()}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../utils/index.js");const r="\t";exports.default=class{defaultReturn={headerRef:"",renderStr:""};schemas={};schemasMap=new Map;config;constructor(e,r){this.schemas=e,this.config=r}typeNameToFileName(e){return e.replace(/_/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().replace(/-+/g,"-")}nameTheHumpCenterStroke(e){const r=e.replace("#/components/schemas/","");return{typeName:r,fileName:this.typeNameToFileName(r)}}parseRef(e){if(!e)return{headerRefStr:"",typeName:""};const{fileName:r,typeName:t}=this.nameTheHumpCenterStroke(e);return{headerRefStr:`import type { ${t} } from './${r}';`,typeName:t}}parseObject(e,r){let t="",s="";if("object"===e.type){const a=e;if("object"==typeof a.additionalProperties){const e=this.parseArray(a.additionalProperties,r)??this.defaultReturn;t=e.headerRef,s=e.renderStr}}return{headerRef:t,renderStr:s}}parseArray(e,t){let s="",a="";const n=e;if(n.items?.$ref){const{headerRefStr:e,typeName:i}=this.parseRef(n.items.$ref);s=e,a=`${r}${t}?: Array<${i}>;`}else{const e=n.items;a=`${r}${t}?: Array<${"integer"===e.type?"number":e.type}>;`}return{headerRef:s,renderStr:a}}parseBoolean(e,t){return"boolean"===e.type?`${r}${t}?: boolean;`:""}parseEnum(e,t){if("integer"===e.type&&Array.isArray(e.enum)){return[`export enum ${t} {`,...e.enum.map((e=>`${r}NUMBER_${e} = ${e},`)),"}"].join("\n")}return""}parseInteger(e,t){return Array.isArray(e.enum)?this.parseEnum(e,t):`${r}${t}?: number;`}parseNumber(e,t){return"number"===e.type?`${r}${t}?: number;`:""}parseString(e,t){return"string"===e.type?{headerRef:"",renderStr:`${r}${t}?: string;`}:null}parseProperties(e,t){const s=[],a=[];for(const t in e){const n=e[t];if(n?.$ref){const{headerRefStr:e,typeName:i}=this.parseRef(n.$ref);a.includes(e)||a.push(e),s.push(`${r}${t}?: ${i};`)}else{if("allOf"in n){const e=n.allOf?.[0];if(e?.$ref){const{headerRefStr:n,typeName:i}=this.parseRef(e.$ref);a.includes(n)||a.push(n),s.push(`${r}${t}?: ${i};`);continue}}switch(n.type){case"array":{const e=this.parseArray(n,t)??this.defaultReturn;s.push(e.renderStr),a.includes(e.headerRef)||a.push(e.headerRef)}break;case"boolean":s.push(this.parseBoolean(n,t));break;case"integer":s.push(this.parseInteger(n,t));break;case"number":s.push(this.parseNumber(n,t));break;case"string":s.push(this.parseString(n,t)?.renderStr??"");break;case"object":{const{headerRef:e,renderStr:r}=this.parseObject(n,t)??this.defaultReturn;s.push(r),a.includes(e)||a.push(e)}}}}const n=`export interface ${t} {`;return[...a,"\n",n,...s,"}"].join("\n")}async parse(){for(const e in this.schemas){const r=this.schemas[e],t=r;if("$ref"in r){console.warn("ReferenceObject 未处理");continue}const s="type"in t?t:null,a=this.typeNameToFileName(e);if(s)if("items"in s)console.log("未处理---------------------------\x3e",s.items);else{let r="";switch(s.type){case"boolean":r=this.parseBoolean(s,e);break;case"integer":r=this.parseInteger(s,e);break;case"number":r=this.parseNumber(s,e);break;case"object":r=this.parseProperties(s.properties,e);break;case"string":r=this.parseString(s,e)?.renderStr??""}this.schemasMap.set(e,{fileName:a,content:r})}}}async writeFileHandler(){const r=[],t=[],s=`${this.config.saveTypeFolderPath}/models/`;for(const[,a]of this.schemasMap){const n=async({fileName:r,content:a})=>{t.push(`export * from './${r}';`),await e.writeFileRecursive(`${s}${r}.ts`,a)};r.push(n(a))}await Promise.all(r),await e.writeFileRecursive(`${s}/index.ts`,t.join("\n")),console.log("components done!")}async handle(){await this.parse(),await this.writeFileHandler()}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("fs"),t=require("../utils/index.js"),s=require("./core/components.js"),r=require("./core/get-data.js"),a=require("./core/path.js"),o=require("shelljs");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(e);const l={saveTypeFolderPath:"apps/types",apiListFilePath:"apps/services",swaggerJsonUrl:"",requestMethodsImportPath:"./fetch",indent:"\t",headers:{}};exports.Main=class{schemas={};paths={};handle(e){return new Promise((t=>{if(!e.swaggerJsonUrl)return t({});r.getSwaggerJson(e).then((r=>{const o=r;this.schemas=o.components?.schemas,this.paths=o.paths;new s.default(this.schemas,e).handle();new a.PathParse(this.paths,e).handle(),t({})})).catch((()=>{t({})}))}))}initialize(){const e=process.cwd()+"/an.config.json";t.isFileExisted(e).then((()=>{i.default.readFile(e,"utf8",((e,s)=>{if(e)return void console.error(e);const r=JSON.parse(s);console.log("config ----\x3e",r),t.clearDir(r.saveTypeFolderPath).then((()=>{this.handle(r).then((e=>{console.log("format: ",`npx prettier --write "${r.saveTypeFolderPath}/**/*.{ts,d.ts}"`),o.exec(`npx prettier --write "${r.saveTypeFolderPath}/**/*.{ts,d.ts}"`)})).catch((e=>{console.log(e)}))}))}))})).catch((s=>{console.error("配置文件不存在,将自动创建配置文件!"),t.clearDir(l.saveTypeFolderPath).then((()=>{t.writeFileRecursive(e,JSON.stringify(l,null,2)).catch((e=>{console.log(e)})).finally((()=>{this.handle(l)}))}))}))}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("fs"),s=require("../../data/umf.json.js"),t=require("../utils/index.js"),r=require("./core/components.js"),a=require("./core/get-data.js"),n=require("./core/path.js"),o=require("shelljs");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=i(e);const l={saveTypeFolderPath:"apps/types",apiListFilePath:"apps/services",swaggerJsonUrl:"",requestMethodsImportPath:"./fetch",indent:"\t",headers:{}};class c{schemas={};paths={};handle(e){return"development"===process.env.NODE_ENV?new Promise(((t,a)=>{const o=s.default;this.schemas=o.components?.schemas,this.paths=o.paths;new r.default(this.schemas,e).handle();return new n.PathParse(this.paths,e).handle(),t(!0)})):new Promise((s=>{if(!e.swaggerJsonUrl)return s({});a.getSwaggerJson(e).then((t=>{const a=t;this.schemas=a.components?.schemas,this.paths=a.paths;new r.default(this.schemas,e).handle();new n.PathParse(this.paths,e).handle(),s({})})).catch((()=>{s({})}))}))}initialize(){const e=process.cwd()+"/an.config.json";t.isFileExisted(e).then((()=>{h.default.readFile(e,"utf8",((e,s)=>{if(e)return void console.error(e);const r=JSON.parse(s);console.log("config ----\x3e",r),t.clearDir(r.saveTypeFolderPath).then((()=>{this.handle(r).then((e=>{console.log("format: ",`npx prettier --write "${r.saveTypeFolderPath}/**/*.{ts,d.ts}"`),o.exec(`npx prettier --write "${r.saveTypeFolderPath}/**/*.{ts,d.ts}"`)})).catch((e=>{console.log(e)}))}))}))})).catch((s=>{console.error("配置文件不存在,将自动创建配置文件!"),t.clearDir(l.saveTypeFolderPath).then((()=>{t.writeFileRecursive(e,JSON.stringify(l,null,2)).catch((e=>{console.log(e)})).finally((()=>{this.handle(l)}))}))}))}}if("development"===process.env.NODE_ENV){(new c).initialize()}exports.Main=c;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anl",
3
- "version": "1.3.18",
3
+ "version": "1.3.20",
4
4
  "description": "FE command line tool",
5
5
  "main": "bin/an-cli.js",
6
6
  "scripts": {
@@ -25,6 +25,7 @@
25
25
  "@types/shelljs": "^0.8.11",
26
26
  "@typescript-eslint/eslint-plugin": "^5.52.0",
27
27
  "@typescript-eslint/parser": "^5.52.0",
28
+ "cross-env": "^7.0.3",
28
29
  "eslint": "^8.7.0",
29
30
  "husky": "^8.0.3",
30
31
  "openapi-types": "^12.1.3",