anl 1.4.7 → 1.4.9
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/manageGame/createGame":{post:{operationId:"ManageGameController_createGame",summary:"创建新的游戏",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/CreateGameDTO"}}}},responses:{200:{description:"返回游戏列表",content:{"application/json":{schema:{$ref:"#/components/schemas/CreateGame"}}}}},tags:["Manage Game"]}},"/api/manageGame/gameList":{get:{operationId:"ManageGameController_getGameList",summary:"游戏列表",parameters:[],responses:{200:{description:"返回游戏列表"}},tags:["Manage Game"]}},"/api/manageGame/{gameName}/getGameConfig":{get:{operationId:"ManageGameController_getGameConfig",summary:"获取游戏的配置信息",parameters:[{name:"gameName",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"返回游戏配置",content:{"application/json":{schema:{$ref:"#/components/schemas/Config"}}}}},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/{gameName}/relation":{get:{operationId:"ManageGameController_gameRelation",summary:"游戏与资源的关联",parameters:[{name:"gameName",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"Successfully.",content:{"application/json":{schema:{$ref:"#/components/schemas/GameRelationVo"}}}}},tags:["Manage Game"]}},"/api/llm/{schema}/{type}/{id}/txt/v2":{get:{operationId:"LlmController_txtV2",summary:"Maas文生文",parameters:[{name:"schema",required:!0,in:"path",schema:{type:"string"}},{name:"type",required:!0,in:"path",schema:{type:"string"}},{name:"id",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"Successfully."},400:{description:"Failed."}},tags:["LLM"]}},"/api/llm/recommend/{schema}/{rid}/features":{get:{operationId:"LlmController_recommendFeatures",summary:"推荐角色人格",parameters:[{name:"schema",required:!0,in:"path",schema:{type:"string"}},{name:"rid",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"",content:{"application/json":{schema:{type:"array",items:{type:"string"}}}}}},tags:["LLM"]}},"/api/llm/recommend/{schema}/{rid}/role/union":{get:{operationId:"LlmController_recommends",summary:"推荐角色信息",parameters:[{name:"schema",required:!0,in:"path",schema:{type:"string"}},{name:"rid",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/RecommendRoleDTO"}}}}},tags:["LLM"]}},"/api/llm/recommend/{schema}/{bgid}/category":{get:{operationId:"LlmController_recommendCategory",summary:"推荐背景分类",parameters:[{name:"schema",required:!0,in:"path",schema:{type:"string"}},{name:"bgid",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"",content:{"application/json":{schema:{type:"array",items:{type:"string"}}}}}},tags:["LLM"]}},"/api/llm/recommend/{schema}/{rid}/timbre":{get:{operationId:"LlmController_recommendTimbre",summary:"推荐音色",parameters:[{name:"schema",required:!0,in:"path",schema:{type:"string"}},{name:"rid",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"",content:{"application/json":{schema:{type:"array",items:{type:"string"}}}}}},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/upload/text":{post:{operationId:"LlmController_uploadText",summary:"上传文本文件返回文本信息",parameters:[],responses:{201:{description:""}},tags:["LLM"]}},"/api/llm/extract/file":{post:{operationId:"LlmController_extractFile",summary:"提取文件内容",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/ExtractFileDto"}}}},responses:{default:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/BatchExtraction"}}}}},tags:["LLM"]}},"/api/llm/extract/task":{get:{operationId:"LlmController_extractTask",summary:"获取AI提取任务",parameters:[],responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/BatchExtraction"}}}}},tags:["LLM"]}},"/api/llm/extract/{id}/destroy":{delete:{operationId:"LlmController_extractDestroy",summary:"删除AI提取任务",parameters:[{name:"id",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},tags:["LLM"]}},"/api/llm/extract/{batchId}/role/add":{post:{operationId:"LlmController_extractAddRole",summary:"添加角色",parameters:[{name:"batchId",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateRoleDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/IDRspDto"}}}}},tags:["LLM"]}},"/api/llm/extract/{batchId}/role/update":{put:{operationId:"LlmController_extractUpdateRole",summary:"更新角色",parameters:[{name:"batchId",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateRoleDto"}}}},responses:{200:{description:""}},tags:["LLM"]}},"/api/llm/extract/{batchId}/role/{id}/del":{delete:{operationId:"LlmController_extractDelRole",summary:"删除角色",parameters:[{name:"id",required:!0,in:"path",schema:{type:"string"}},{name:"batchId",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},tags:["LLM"]}},"/api/llm/extract/{batchId}/bg/add":{post:{operationId:"LlmController_extractAddBg",summary:"添加背景",parameters:[{name:"batchId",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateBgDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/IDRspDto"}}}}},tags:["LLM"]}},"/api/llm/extract/{batchId}/bg/update":{put:{operationId:"LlmController_extractUpdateBg",summary:"更新背景",parameters:[{name:"batchId",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateBgDto"}}}},responses:{200:{description:""}},tags:["LLM"]}},"/api/llm/extract/{batchId}/bg/{id}/del":{delete:{operationId:"LlmController_extractDelBg",summary:"删除背景",parameters:[{name:"id",required:!0,in:"path",schema:{type:"string"}},{name:"batchId",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},tags:["LLM"]}},"/api/llm/extract/{batchId}/batchUpdate":{put:{operationId:"LlmController_extractBatchUpdate",summary:"批量更新角色和背景",parameters:[{name:"batchId",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/BatchBgRoleReqDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/BatchUpdateRspDto"}}}}},tags:["LLM"]}},"/api/llm/extract/{batchId}/batchConfirm":{post:{operationId:"LlmController_extractBatchConfirm",summary:"批量确认保存",parameters:[{name:"batchId",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/BatchBgRoleReqDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/BatchConfirmRspDto"}}}}},tags:["LLM"]}},"/api/role/role":{post:{operationId:"RoleController_createRole",summary:"保存角色",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateRoleDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/IDRspDto"}}}}},tags:["Role"]}},"/api/role/list":{post:{operationId:"RoleController_listRole",summary:"获取该用户下角色列表",parameters:[],requestBody:{required:!0,description:"获取该用户下角色列表",content:{"application/json":{schema:{$ref:"#/components/schemas/FindRoleDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/UpdateRoleDto"}}}}}},tags:["Role"]}},"/api/role/update":{put:{operationId:"RoleController_updateRole",summary:"更新角色",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateRoleDto"}}}},responses:{200:{description:"Successfully."}},tags:["Role"]}},"/api/role/batchUpdate":{put:{operationId:"RoleController_batchUpdateRole",summary:"批量更新角色",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/UpdateRoleDto"}}}}},responses:{200:{description:"Successfully.",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/UpdateRoleDto"}}}}}},tags:["Role"]}},"/api/role/{rid}":{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/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/UpdateBgDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/IDRspDto"}}}}},tags:["Bg"]}},"/api/bg/list":{post:{operationId:"BgController_list",summary:"获取背景信息列表",parameters:[],requestBody:{required:!0,description:"获取背景信息列表",content:{"application/json":{schema:{$ref:"#/components/schemas/FindBgDto"}}}},responses:{200:{description:"Successfully."}},tags:["Bg"]}},"/api/bg/update":{put:{operationId:"BgController_updateBg",summary:"更新背景信息",parameters:[],requestBody:{required:!0,description:"更新背景信息",content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateBgDto"}}}},responses:{200:{description:"Successfully."}},tags:["Bg"]}},"/api/bg/batchUpdate":{put:{operationId:"BgController_batchUpdateBg",summary:"批量更新背景信息",parameters:[],requestBody:{required:!0,description:"批量更新背景信息",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/UpdateBgDto"}}}}},responses:{200:{description:"Successfully.",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/UpdateBgDto"}}}}}},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/bgm/{category}/table":{get:{operationId:"BgmController_table",summary:"获取音乐库数据",parameters:[{name:"category",required:!0,in:"path",schema:{type:"string"}}],responses:{default:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/BgmTableDto"}}}}},tags:["Bgm"]}},"/api/bgm/all":{get:{operationId:"BgmController_all",summary:"获取音乐搜索列表",parameters:[],responses:{default:{description:"",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/BgmListDto"}}}}}},tags:["Bgm"]}},"/api/bgm/link/scene":{post:{operationId:"BgmController_linkScene",summary:"音乐裁剪",parameters:[],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/AudioCutDto"}}}},responses:{200:{description:"Successfully."},501:{description:"Failed."}},tags:["Bgm"]}},"/api/bgm/excelConvertDb":{post:{operationId:"BgmController_excelConvertDb",parameters:[],responses:{201:{description:""}},tags:["Bgm"]}},"/api/bgm/clearBgm":{post:{operationId:"BgmController_clearBgm",parameters:[],responses:{201:{description:""}},tags:["Bgm"]}},"/api/dict/{type}/{name}":{get:{operationId:"DictController_create",summary:"添加字典数据",parameters:[{name:"type",required:!0,in:"path",schema:{type:"string"}},{name:"name",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},tags:["Dict"]}},"/api/dict/list":{get:{operationId:"DictController_findAll",summary:"字典列表",parameters:[],responses:{200:{description:""}},tags:["Dict"]}},"/api/editor/scene/add":{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/scene":{post:{operationId:"EditorController_getSceneDetail",summary:"查询场景详情内容",parameters:[],requestBody:{required:!0,description:"查询场景详情内容",content:{"application/json":{schema:{$ref:"#/components/schemas/SceneDetailDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/SceneDetailRsp"}}}}},tags:["Editor"]}},"/api/editor/scene/dialogue":{put:{operationId:"EditorController_editSceneDialogue",summary:"更新编辑器对话资源",parameters:[],requestBody:{required:!0,description:"更新编辑器对话资源",content:{"application/json":{schema:{$ref:"#/components/schemas/SceneReq"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/SceneDetailRsp"}}}}},tags:["Editor"]}},"/api/editor/uiScene/resource":{put:{operationId:"EditorController_editUiSceneResource",summary:"更新UI编辑器场景资源",parameters:[],requestBody:{required:!0,description:"更新UI编辑器场景资源",content:{"application/json":{schema:{$ref:"#/components/schemas/UpdateUiResourceDto"}}}},responses:{200:{description:"Successfully."}},tags:["Editor"]}},"/api/editor/scene/upload":{post:{operationId:"EditorController_uploadSceneDialogue",summary:"上传文本更新对话资源",parameters:[],requestBody:{required:!0,content:{"multipart/form-data":{schema:{$ref:"#/components/schemas/SceneDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/SceneDetailRsp"}}}}},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/vocal/binding":{post:{operationId:"VocalController_binding",summary:"配音绑定",parameters:[],requestBody:{required:!0,description:"配音绑定",content:{"application/json":{schema:{$ref:"#/components/schemas/VocalBindingDto"}}}},responses:{201:{description:""}},tags:["Vocal"]}},"/api/vocal/record/{event}/{reqId}":{get:{operationId:"VocalController_record",summary:"获取配音结果",parameters:[{name:"event",required:!0,in:"path",schema:{type:"string"}},{name:"reqId",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},tags:["Vocal"]}},"/api/vocal/ready/{gameName}/{sceneid}":{get:{operationId:"VocalController_getReadyVocalList",summary:"获取准备配音的列表",parameters:[{name:"gameName",required:!0,in:"path",schema:{type:"string"}},{name:"sceneid",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/VocalReadyDTO"}}}}}},tags:["Vocal"]}},"/api/vocal/start/{sceneid}":{post:{operationId:"VocalController_startVocalList",summary:"开始批量配音任务",parameters:[{name:"sceneid",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,description:"需要配音的数据",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/VocalReadyDTO"}}}}},responses:{201:{description:""}},tags:["Vocal"]}},"/api/vocal/batch/{sceneid}":{get:{operationId:"VocalController_getBatchVocal",summary:"获取正在配音列表",parameters:[{name:"sceneid",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:"",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/BatchGenerateVocal"}}}}}},tags:["Vocal"]},post:{operationId:"VocalController_saveBatchVocal",summary:"保存配音",parameters:[{name:"sceneid",required:!0,in:"path",schema:{type:"string"}}],responses:{201:{description:""}},tags:["Vocal"]}},"/api/vocal/retry/{sceneid}":{put:{operationId:"VocalController_retryBatchVocal",summary:"重试单条配音",parameters:[{name:"sceneid",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,description:"需要重试的配音",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/VocalBaseLineDTO"}}}}},responses:{200:{description:""}},tags:["Vocal"]}},"/api/vocal/batch/{sceneid}/{lineId}":{delete:{operationId:"VocalController_deleteLineVocalForBatchVocal",summary:"删除单条配音",parameters:[{name:"sceneid",required:!0,in:"path",schema:{type:"string"}},{name:"lineId",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},tags:["Vocal"]}},"/api/vocal/cancel/{sceneid}":{post:{operationId:"VocalController_cancelBatchVocal",summary:"取消配音",parameters:[{name:"sceneid",required:!0,in:"path",schema:{type:"string"}}],responses:{201:{description:""}},tags:["Vocal"]}},"/api/prop/add":{post:{operationId:"PropController_createProp",summary:"保存道具信息",parameters:[],requestBody:{required:!0,description:"保存道具信息",content:{"application/json":{schema:{$ref:"#/components/schemas/PropDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/IDRspDto"}}}}},tags:["Prop"]}},"/api/prop/list":{post:{operationId:"PropController_list",summary:"获取道具信息列表",parameters:[],requestBody:{required:!0,description:"获取道具信息列表",content:{"application/json":{schema:{$ref:"#/components/schemas/FindPropDto"}}}},responses:{200:{description:"Successfully."}},tags:["Prop"]}},"/api/prop/update":{put:{operationId:"PropController_updateProp",summary:"更新道具信息",parameters:[],requestBody:{required:!0,description:"更新道具信息",content:{"application/json":{schema:{$ref:"#/components/schemas/PropDto"}}}},responses:{200:{description:"Successfully."}},tags:["Prop"]}},"/api/prop/batchUpdate":{put:{operationId:"PropController_batchUpdateProp",summary:"批量更新道具信息",parameters:[],requestBody:{required:!0,description:"批量更新道具信息",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/PropDto"}}}}},responses:{200:{description:"Successfully.",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/PropDto"}}}}}},tags:["Prop"]}},"/api/prop/remove/{id}":{delete:{operationId:"PropController_remove",summary:"删除道具信息",parameters:[{name:"id",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},tags:["Prop"]}},"/api/cg/add":{post:{operationId:"CgController_createCg",summary:"保存Cg信息",parameters:[],requestBody:{required:!0,description:"保存Cg信息",content:{"application/json":{schema:{$ref:"#/components/schemas/CgDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/IDRspDto"}}}}},tags:["Cg"]}},"/api/cg/list":{post:{operationId:"CgController_list",summary:"获取Cg信息列表",parameters:[],requestBody:{required:!0,description:"获取Cg信息列表",content:{"application/json":{schema:{$ref:"#/components/schemas/FindCgDto"}}}},responses:{200:{description:"",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/CgDto"}}}}}},tags:["Cg"]}},"/api/cg/update":{put:{operationId:"CgController_updateCg",summary:"更新Cg信息",parameters:[],requestBody:{required:!0,description:"更新Cg信息",content:{"application/json":{schema:{$ref:"#/components/schemas/CgDto"}}}},responses:{200:{description:"Successfully."}},tags:["Cg"]}},"/api/cg/batchUpdate":{put:{operationId:"CgController_batchUpdateCg",summary:"批量更新Cg信息",parameters:[],requestBody:{required:!0,description:"批量更新Cg信息",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/CgDto"}}}}},responses:{200:{description:"Successfully.",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/CgDto"}}}}}},tags:["Cg"]}},"/api/cg/remove/{id}":{delete:{operationId:"CgController_remove",summary:"删除Cg信息",parameters:[{name:"id",required:!0,in:"path",schema:{type:"string"}}],responses:{200:{description:""}},tags:["Cg"]}},"/api/effect/list":{get:{operationId:"EffectController_list",summary:"获取音效列表",parameters:[{name:"style",required:!1,in:"query",description:"游戏风格",schema:{type:"string"}}],responses:{default:{description:"",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/EffectListDto"}}}}}},tags:["音效"]}},"/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/CanvasView"}}}}},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"]}},"/api/canvas/{gameName}/node/preview":{post:{operationId:"CanvasController_nodePreview",summary:"节点预览",parameters:[{name:"gameName",required:!0,in:"path",schema:{type:"string"}}],requestBody:{required:!0,content:{"application/json":{schema:{$ref:"#/components/schemas/Node"}}}},responses:{200:{description:""}},tags:["Canvas"]}},"/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/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/auth/captcha":{get:{operationId:"AuthController_getCaptcha",summary:"获取图形验证码",parameters:[],responses:{default:{description:"",content:{"application/json":{schema:{$ref:"#/components/schemas/CaptchaRsp"}}}}},tags:["身份鉴权"]}}},r={title:"UMPAY.NETA Terre API",description:"API Refrence of UMPAY.NETA Terre Editor",version:"1.0",contact:{}},s=[],o=[],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"]},GameTypeEnum:{type:"string",description:"游戏类型",enum:["solvePuzzles","otome"]},EditorTypeEnum:{type:"string",description:"编辑器类型",enum:["ui","txt"]},CreateGameDTO:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},gameType:{example:'{"SolvePuzzles":"solvePuzzles","Otome":"otome"}',$ref:"#/components/schemas/GameTypeEnum"},editorType:{example:'{"UI":"ui","TXT":"txt"}',$ref:"#/components/schemas/EditorTypeEnum"}},required:["gameName","gameType","editorType"]},Config:{type:"object",properties:{Game_name:{type:"string",description:"游戏名称"},Game_key:{type:"string",description:"游戏标识"},Package_name:{type:"string",description:"所属包名"},Description:{type:"string",description:"游戏描述"},Title_img:{type:"string",description:"标题背景"},Title_bgm:{type:"string",description:"标题背景音乐"},Game_Logo:{type:"string",description:"游戏LOGO"},Debug:{type:"string",description:""},GameNum:{type:"string",description:""},GameNum_Double:{type:"string",description:""},Render_mode:{example:'{"UI":"ui","TXT":"txt"}',$ref:"#/components/schemas/EditorTypeEnum"},Game_type:{example:'{"SolvePuzzles":"solvePuzzles","Otome":"otome"}',$ref:"#/components/schemas/GameTypeEnum"},Start_node:{type:"string",description:"开始节点"}},required:["Game_name","Game_key","Package_name","Description","Title_img","Title_bgm","Game_Logo","Debug","GameNum","GameNum_Double","Render_mode","Game_type","Start_node"]},GameInfo:{type:"object",properties:{name:{type:"string",description:"游戏名称"},path:{type:"string",description:"游戏路径"},config:{description:"游戏配置",allOf:[{$ref:"#/components/schemas/Config"}]}},required:["name","path","config"]},ProgressStatusEnum:{type:"string",description:"进度状态",enum:["0","1","2","3"]},Progress:{type:"object",properties:{current:{type:"number",description:"进度"},status:{example:'{"INIT":"0","ING":"1","DONE":"2","ERR":"3"}',$ref:"#/components/schemas/ProgressStatusEnum"},msg:{type:"string",description:"生成信息"}},required:["current","status","msg"]},ImageStyleEnum:{type:"string",description:"道具风格",enum:["anime","romantic"]},Picture:{type:"object",properties:{url:{type:"string",description:"图片地址"},check:{type:"boolean",description:"是否选中"}},required:["url","check"]},BgGenerateStageEnum:{type:"string",description:"生成阶段",enum:["prompts","bg"]},UpdateBgDto:{type:"object",properties:{id:{type:"string",description:"背景ID"},uid:{type:"string",description:"用户ID"},name:{type:"string",description:"背景名称"},style:{example:'{"Anime":"anime","Romantic":"romantic"}',$ref:"#/components/schemas/ImageStyleEnum"},original:{type:"string",description:"原文(背景描述)"},prompts:{type:"string",description:"提示词"},url:{type:"string",description:"背景图片"},list:{description:"背景图片列表",type:"array",items:{$ref:"#/components/schemas/Picture"}},word:{type:"string",description:"背景正向提示词"},tlmId:{type:"string",description:"背景对应大模型输出ID"},category:{description:"背景分类",example:["生活","娱乐场所","都市酒吧"],type:"array",items:{type:"string"}},stage:{example:'{"PROMPTS":"prompts","BG":"bg"}',$ref:"#/components/schemas/BgGenerateStageEnum"},progress:{description:"进度",allOf:[{$ref:"#/components/schemas/Progress"}]}},required:["id","uid","name","style","original","prompts","url","list","word","tlmId","category","stage","progress"]},BatchBg:{type:"object",properties:{progress:{description:"进度",allOf:[{$ref:"#/components/schemas/Progress"}]},list:{description:"背景数据列表",type:"array",items:{$ref:"#/components/schemas/UpdateBgDto"}}},required:["progress","list"]},Frame:{type:"object",properties:{eyesHalfOpen:{type:"string",description:"半闭眼"},eyesClose:{type:"string",description:"闭眼"},mouthHalfOpen:{type:"string",description:"半张嘴"},mouthOpen:{type:"string",description:"张嘴"}},required:["eyesHalfOpen","eyesClose","mouthHalfOpen","mouthOpen"]},Category:{type:"object",properties:{categoryValue:{type:"string",description:"表情差分类别值(一级)"},categoryLabel:{type:"string",description:"表情差分类别标签(一级)"},value:{type:"string",description:"表情差分值(二级)"},label:{type:"string",description:"表情差分标签(二级)"}},required:["categoryValue","categoryLabel","value","label"]},Expression:{type:"object",properties:{url:{type:"string",description:"差分图片"},list:{description:"表情变体图",type:"array",items:{$ref:"#/components/schemas/Picture"}},frame:{description:"差分帧图",allOf:[{$ref:"#/components/schemas/Frame"}]},category:{description:"差分类别",allOf:[{$ref:"#/components/schemas/Category"}]},applyGame:{description:"序列帧应用游戏列表",type:"array",items:{type:"string"}}},required:["url","list","frame","category","applyGame"]},GenderEnum:{type:"string",description:"角色性别",enum:["male","female"]},AgeEnum:{type:"string",description:"年纪",enum:["child","adult","youth","elder"]},RoleGenerateStageEnum:{type:"string",description:"生成阶段",enum:["prompts","figure","expression","frame"]},UpdateRoleDto:{type:"object",properties:{uid:{type:"string",description:"用户ID"},id:{type:"string",description:"角色ID"},name:{type:"string",description:"角色名字"},timbre:{type:"string",description:"音色"},original:{type:"string",description:"原文(角色描述)"},url:{type:"string",description:"主立绘图片"},list:{description:"备选角色变体",type:"array",items:{$ref:"#/components/schemas/Picture"}},tlmId:{type:"string",description:"角色对应的大模型信息ID"},feature:{type:"string",description:"人格"},word:{type:"string",description:"角色正向提示词"},prompts:{type:"string",description:"提示词(修饰词)"},expressions:{description:"表情差分图",type:"array",items:{$ref:"#/components/schemas/Expression"}},progress:{description:"进度",allOf:[{$ref:"#/components/schemas/Progress"}]},gender:{example:'{"MALE":"male","FEMALE":"female"}',$ref:"#/components/schemas/GenderEnum"},style:{example:'{"Anime":"anime","Romantic":"romantic"}',$ref:"#/components/schemas/ImageStyleEnum"},age:{example:'{"CHILD":"child","ADULT":"adult","YOUNG":"youth","ELDER":"elder"}',$ref:"#/components/schemas/AgeEnum"},stage:{example:'{"PROMPTS":"prompts","FIGURE":"figure","EXPRESSION":"expression","FRAME":"frame"}',$ref:"#/components/schemas/RoleGenerateStageEnum"}},required:["uid","id","name","timbre","original","url","list","tlmId","feature","word","prompts","expressions","progress","gender","style","age","stage"]},BatchRole:{type:"object",properties:{list:{description:"角色数据列表",type:"array",items:{$ref:"#/components/schemas/UpdateRoleDto"}},progress:{description:"进度",allOf:[{$ref:"#/components/schemas/Progress"}]}},required:["list","progress"]},Title:{type:"object",properties:{column:{type:"string",description:"列标签"},name:{type:"string",description:"列名称"}},required:["column","name"]},BatchBgm:{type:"object",properties:{progress:{description:"进度",allOf:[{$ref:"#/components/schemas/Progress"}]},title:{description:"音乐表头",type:"array",items:{$ref:"#/components/schemas/Title"}},stock:{type:"object",description:"音乐数据"},more:{type:"object",description:"More"}},required:["progress","title","stock","more"]},ExtractTypeEnum:{type:"string",description:"批处理类型",enum:["extract","picture"]},BatchExtraction:{type:"object",properties:{bg:{description:"背景数据",allOf:[{$ref:"#/components/schemas/BatchBg"}]},role:{description:"角色数据",allOf:[{$ref:"#/components/schemas/BatchRole"}]},bgm:{description:"BGM",allOf:[{$ref:"#/components/schemas/BatchBgm"}]},progress:{description:"总进度",allOf:[{$ref:"#/components/schemas/Progress"}]},id:{type:"string",description:"批量提取ID"},uid:{type:"string",description:"用户ID"},gameName:{type:"string",description:"游戏名称"},type:{example:'{"EXTRACT":"extract","PICTURE":"picture"}',$ref:"#/components/schemas/ExtractTypeEnum"}},required:["bg","role","bgm","progress","id","uid","gameName","type"]},CreateGame:{type:"object",properties:{gameList:{description:"游戏信息",type:"array",items:{$ref:"#/components/schemas/GameInfo"}},batch:{description:"批量提取任务",allOf:[{$ref:"#/components/schemas/BatchExtraction"}]}},required:["gameList","batch"]},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"]},RoleRelation:{type:"object",properties:{id:{type:"string",description:"id"},name:{type:"string",description:"角色名字"},url:{type:"string",description:"地址"}},required:["id","name","url"]},GameRelationVo:{type:"object",properties:{role:{description:"角色关联信息",type:"array",items:{$ref:"#/components/schemas/RoleRelation"}}},required:["role"]},RecommendRoleDTO:{type:"object",properties:{features:{description:"推荐人格",type:"array",items:{type:"string"}},timbre:{type:"string",description:"推荐音色"}},required:["features","timbre"]},ImageUploadDto:{type:"object",properties:{category:{type:"string",description:"图片类别"},original:{type:"string",description:"蒙版对应原始图片名称"}},required:["category","original"]},ExtractFileDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名"}},required:["gameName"]},IDRspDto:{type:"object",properties:{id:{type:"string",description:"ID"}},required:["id"]},BgmConfirm:{type:"object",properties:{column:{type:"string",description:"列名"},locationId:{description:"位置ID",type:"array",items:{type:"string"}}},required:["column","locationId"]},BatchBgRoleReqDto:{type:"object",properties:{bg:{description:"背景数据",type:"array",items:{$ref:"#/components/schemas/UpdateBgDto"}},role:{description:"角色数据",type:"array",items:{$ref:"#/components/schemas/UpdateRoleDto"}},bgm:{description:"确认BGM",type:"array",items:{$ref:"#/components/schemas/BgmConfirm"}}},required:["bg","role","bgm"]},BatchUpdateRspDto:{type:"object",properties:{bg:{description:"背景数据",type:"array",items:{$ref:"#/components/schemas/UpdateBgDto"}},role:{description:"角色数据",type:"array",items:{$ref:"#/components/schemas/UpdateRoleDto"}},bgm:{description:"确认BGM",allOf:[{$ref:"#/components/schemas/BatchBgm"}]}},required:["bg","role","bgm"]},IdNameDto:{type:"object",properties:{id:{type:"string",description:"ID"},name:{type:"string",description:"名称"}},required:["id","name"]},BatchConfirmRspDto:{type:"object",properties:{success:{description:"成功数据",type:"array",items:{$ref:"#/components/schemas/IdNameDto"}},fail:{description:"失败数据",type:"array",items:{$ref:"#/components/schemas/IdNameDto"}}},required:["success","fail"]},FindRoleDto:{type:"object",properties:{name:{type:"string",description:"角色名称"}},required:["name"]},ResourceTypeEnum:{type:"string",description:"资源类型",enum:["figure","background","bgm"]},Remark:{type:"object",properties:{applyFrame:{description:"应用差分帧图",type:"array",items:{type:"string"}}},required:["applyFrame"]},CreateResourceDto:{type:"object",properties:{name:{type:"string",description:"资源名称"},path:{type:"string",description:"资源路径"},list:{description:"备选图",type:"array",items:{type:"string"}},frame:{description:"差分帧图",allOf:[{$ref:"#/components/schemas/Frame"}]},type:{example:'{"FIGURE":"figure","BACKGROUND":"background","BGM":"bgm"}',$ref:"#/components/schemas/ResourceTypeEnum"},uid:{type:"string",description:"用户ID"},pid:{type:"string",description:"父级资源ID"},category:{description:"分类",allOf:[{$ref:"#/components/schemas/Category"}]},remark:{description:"备注",allOf:[{$ref:"#/components/schemas/Remark"}]}},required:["name","path","list","frame","type","uid","pid","category","remark"]},UpdateResourceDto:{type:"object",properties:{}},FindBgDto:{type:"object",properties:{name:{type:"string",description:"背景名称"}},required:["name"]},StockColumnData:{type:"object",properties:{id:{type:"string",description:"音乐ID"},name:{type:"string",description:"音乐名称"},url:{type:"string",description:"音乐相对地址"},locationId:{type:"string",description:"位置ID"},checked:{type:"boolean",description:"勾选"}},required:["id","name","url","locationId","checked"]},StockColumn:{type:"object",properties:{column:{type:"string",description:"列值"},data:{description:"行标签对应列数据",type:"array",items:{$ref:"#/components/schemas/StockColumnData"}}},required:["column","data"]},Stock:{type:"object",properties:{name:{type:"string",description:"行标签名称"},columns:{description:"行标签对应列数据",type:"array",items:{$ref:"#/components/schemas/StockColumn"}}},required:["name","columns"]},BgmTableDto:{type:"object",properties:{title:{description:"音乐库表头",type:"array",items:{$ref:"#/components/schemas/Title"}},stock:{description:"音乐库数据",type:"array",items:{$ref:"#/components/schemas/Stock"}}},required:["title","stock"]},BgmListDto:{type:"object",properties:{locationId:{type:"string",description:"位置ID"},id:{type:"string",description:"音乐ID"},name:{type:"string",description:"音乐名称"},url:{type:"string",description:"音乐地址"},category:{type:"string",description:"音乐类型"}},required:["locationId","id","name","url","category"]},AudioCutDto:{type:"object",properties:{uid:{type:"string",description:"用户ID"},gameName:{type:"string",description:"游戏名"},sceneName:{type:"string",description:"场景名称"},audio:{type:"string",description:"音乐名"},url:{type:"string",description:"音乐库地址"},loop:{type:"string",description:"是否循环"},volume:{type:"number",description:"音量0-100"},rate:{type:"number",description:"播放速度"}},required:["uid","gameName","sceneName","audio","url","loop","volume","rate"]},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:"游戏名称"},sectionName:{type:"string",description:"章节名称"},sceneName:{description:"场景列表",type:"array",items:{type:"string"}}},required:["gameName","sectionName","sceneName"]},SceneDetailDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sceneName:{type:"string",description:"场景名称"},sceneType:{type:"string",description:"场景类型"}},required:["gameName","sceneName","sceneType"]},EditorCommandEnum:{type:"string",description:"命令",enum:["narr","clp","bst","bgi","bgm","cg","cp"]},Role:{type:"object",properties:{id:{type:"string",description:"角色ID"},emotion:{type:"string",description:"表情"},name:{type:"string",description:"角色名称"},gender:{example:'{"MALE":"male","FEMALE":"female"}',$ref:"#/components/schemas/GenderEnum"},style:{example:'{"Anime":"anime","Romantic":"romantic"}',$ref:"#/components/schemas/ImageStyleEnum"},timbre:{type:"string",description:"音色"}},required:["id","emotion","name","gender","style","timbre"]},Vocal:{type:"object",properties:{hash:{type:"string",description:"hash"},timbre:{type:"string",description:"音色"},vocal:{type:"string",description:"配音文件(不包含路径)"},url:{type:"string",description:"配音地址"}},required:["hash","timbre","vocal","url"]},Prop:{type:"object",properties:{id:{type:"string",description:"道具ID"},name:{type:"string",description:"道具名称"}},required:["id","name"]},EffectTypeEnum:{type:"string",description:"音效类型",enum:["flow","scene"]},SoundEffect:{type:"object",properties:{ids:{description:"音效对应ID层级",type:"array",items:{type:"string"}},type:{example:'{"FLOW":"flow","SCENE":"scene"}',$ref:"#/components/schemas/EffectTypeEnum"},label:{type:"string",description:"音效标签"},loop:{type:"boolean",description:"是否循环",default:!1},volume:{type:"number",description:"音量0-100",default:50,minimum:0,maximum:100}},required:["ids","type","label","loop","volume"]},LineDto:{type:"object",properties:{id:{type:"string",description:"行ID"},content:{type:"string",description:"内容"},command:{type:"array",example:'{"Narrator":"narr","ClearPorp":"clp","BlackScreenText":"bst","BackgroundImage":"bgi","BackgroundMusic":"bgm","ComputerGraphics":"cg","CharacterPortrait":"cp"}',items:{$ref:"#/components/schemas/EditorCommandEnum"}},role:{description:"角色",allOf:[{$ref:"#/components/schemas/Role"}]},vocal:{description:"配音",allOf:[{$ref:"#/components/schemas/Vocal"}]},prop:{description:"道具",allOf:[{$ref:"#/components/schemas/Prop"}]},soundEffects:{description:"音效",type:"array",items:{$ref:"#/components/schemas/SoundEffect"}}},required:["id","content","command","role","vocal","prop","soundEffects"]},Figure:{type:"object",properties:{name:{type:"string",description:"立绘名称"},path:{type:"string",description:"图片路径"}},required:["name","path"]},BgmVO:{type:"object",properties:{audio:{type:"string",description:"音乐"},url:{type:"string",description:"URL"},loop:{type:"boolean",description:"是否循环",default:!0},volume:{type:"number",description:"音量0-100",default:100},rate:{type:"number",description:"播放速度",default:1}},required:["audio","url","loop","volume","rate"]},SceneDetailRsp:{type:"object",properties:{scene:{type:"string",description:"场景文件名"},dialogues:{description:"对话框内容",type:"array",items:{$ref:"#/components/schemas/LineDto"}},figures:{description:"立绘信息(拥有资源的角色)",type:"array",items:{$ref:"#/components/schemas/Figure"}},bg:{type:"string",description:"背景"},cg:{type:"string",description:"CG"},bgm:{description:"音乐",allOf:[{$ref:"#/components/schemas/BgmVO"}]},isBatchVocal:{type:"boolean",description:"批量配音"},recommendBgm:{description:"推荐音乐",type:"array",items:{$ref:"#/components/schemas/BgmListDto"}}},required:["scene","dialogues","figures","bg","cg","bgm","isBatchVocal","recommendBgm"]},SceneReq:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sceneName:{type:"string",description:"场景名称"},dialogues:{description:"对话框内容",type:"array",items:{$ref:"#/components/schemas/LineDto"}}},required:["gameName","sceneName","dialogues"]},UpdateUiResourceDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sceneName:{type:"string",description:"场景名称"},bg:{type:"string",description:"更新背景"},cg:{type:"string",description:"更新CG"},clearBg:{type:"boolean",description:"清除背景"},clearCg:{type:"boolean",description:"清除CG"}},required:["gameName","sceneName","bg","cg","clearBg","clearCg"]},SceneDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sceneName:{type:"string",description:"场景名称"}},required:["gameName","sceneName"]},VocalBindingDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sceneName:{type:"string",description:"场景名称"},id:{type:"string",description:"行标识"},timbre:{type:"string",description:"音色"},url:{type:"string",description:"配音相对地址"}},required:["gameName","sceneName","id","timbre","url"]},VocalUntieDto:{type:"object",properties:{gameName:{type:"string",description:"游戏名称"},sceneName:{type:"string",description:"场景名称"},id:{type:"string",description:"行标识"},url:{type:"string",description:"解绑配音相对地址"}},required:["gameName","sceneName","id","url"]},VocalBaseLineDTO:{type:"object",properties:{lineId:{type:"string",description:"行标识"},content:{type:"string",description:"行内容"},category:{type:"string",description:"表情大类英文"},categoryLabel:{type:"string",description:"表情大类中文"},emotion:{type:"string",description:"表情小类中文"},timbre:{type:"string",description:"音色"}},required:["lineId","content","category","categoryLabel","emotion","timbre"]},VocalReadyDTO:{type:"object",properties:{subject:{type:"string",description:"角色名/旁白"},subjectId:{type:"string",description:"角色名ID/narr"},timbre:{type:"string",description:"音色ID"},style:{type:"string",description:"风格"},vocals:{description:"剧本语句",type:"array",items:{$ref:"#/components/schemas/VocalBaseLineDTO"}}},required:["subject","subjectId","timbre","style","vocals"]},LineVocal:{type:"object",properties:{lineId:{type:"string",description:"行ID"},content:{type:"string",description:"行内容"},hash:{type:"string",description:"hash"},style:{type:"string",description:"角色风格"},timbre:{type:"string",description:"音色"},category:{type:"string",description:"表情大类英文"},categoryLabel:{type:"string",description:"表情大类中文"},emotion:{type:"string",description:"表情小类中文"},vocal:{type:"string",description:"配音文件(不包含路径)"},url:{type:"string",description:"配音地址"},progress:{description:"总进度",allOf:[{$ref:"#/components/schemas/Progress"}]}},required:["lineId","content","hash","style","timbre","category","categoryLabel","emotion","vocal","url","progress"]},BatchVocal:{type:"object",properties:{vocals:{description:"配音列表",type:"array",items:{$ref:"#/components/schemas/LineVocal"}},subject:{type:"string",description:"主题"}},required:["vocals","subject"]},BatchGenerateVocal:{type:"object",properties:{batchs:{description:"配音列表",type:"array",items:{$ref:"#/components/schemas/BatchVocal"}},progress:{description:"总进度",allOf:[{$ref:"#/components/schemas/Progress"}]}},required:["batchs","progress"]},PropSizeEnum:{type:"string",description:"道具大小",enum:["small","middle","big"]},PropGenerateStage:{type:"string",description:"生成阶段",enum:["prompts","prop"]},PropDto:{type:"object",properties:{id:{type:"string",description:"道具ID"},uid:{type:"string",description:"用户ID"},name:{type:"string",description:"道具名称"},style:{example:'{"Anime":"anime","Romantic":"romantic"}',$ref:"#/components/schemas/ImageStyleEnum"},original:{type:"string",description:"原文(道具描述)"},prompts:{type:"string",description:"提示词"},url:{type:"string",description:"道具图片"},list:{description:"道具图片列表",type:"array",items:{$ref:"#/components/schemas/Picture"}},tlmId:{type:"string",description:"道具对应大模型输出ID"},category:{description:"道具分类",example:["生活","娱乐场所","都市酒吧"],type:"array",items:{type:"string"}},size:{example:'{"SMALL":"small","MIDDLE":"middle","BIG":"big"}',$ref:"#/components/schemas/PropSizeEnum"},stage:{example:'{"PROMPTS":"prompts","PROP":"prop"}',$ref:"#/components/schemas/PropGenerateStage"},progress:{description:"进度",allOf:[{$ref:"#/components/schemas/Progress"}]}},required:["id","uid","name","style","original","prompts","url","list","tlmId","category","size","stage","progress"]},FindPropDto:{type:"object",properties:{name:{type:"string",description:"道具名称"}},required:["name"]},CgGenerateStage:{type:"string",description:"生成阶段",enum:["prompts","cg"]},CgDto:{type:"object",properties:{id:{type:"string",description:"Cg ID"},uid:{type:"string",description:"用户ID"},name:{type:"string",description:"Cg名称"},style:{type:"string",description:"Cg风格"},original:{type:"string",description:"原文(Cg描述)"},prompts:{type:"string",description:"提示词"},tlmId:{type:"string",description:"Cg对应大模型输出ID"},mood:{description:"角色情绪",type:"array",items:{type:"string"}},role:{type:"string",description:"关联角色ID"},factor:{description:"影响因子",type:"array",items:{type:"string"}},atmosphere:{type:"string",description:"画面氛围"},url:{type:"string",description:"Cg图片"},list:{description:"Cg图片列表",type:"array",items:{$ref:"#/components/schemas/Picture"}},stage:{example:'{"PROMPTS":"prompts","CG":"cg"}',$ref:"#/components/schemas/CgGenerateStage"},progress:{description:"进度",allOf:[{$ref:"#/components/schemas/Progress"}]}},required:["id","uid","name","style","original","prompts","tlmId","mood","role","factor","atmosphere","url","list","stage","progress"]},FindCgDto:{type:"object",properties:{name:{type:"string",description:"Cg名称"}},required:["name"]},EffectListDto:{type:"object",properties:{value:{type:"string",description:"音效ID"},label:{type:"string",description:"音效名"},style:{type:"string",description:"风格",nullable:!0},tags:{description:"音效标签",nullable:!0,type:"array",items:{type:"string"}},url:{type:"string",description:"资源文件路径",nullable:!0},children:{description:"下级分类",nullable:!0,type:"array",items:{$ref:"#/components/schemas/EffectListDto"}}},required:["value","label","style","tags","url","children"]},Variable:{type:"object",properties:{id:{type:"string"},alias:{type:"string"},name:{type:"string"}},required:["id","alias","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:"选定的变量ID"},alias:{type:"string",description:"选定的变量"},varValue:{type:"number",description:"设定的变量值"},advanced:{description:"高级选项",allOf:[{$ref:"#/components/schemas/ICondition"}]}},required:["name","nodeId","sound","varId","alias","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:"节点信息",type:"array",items:{$ref:"#/components/schemas/Node"}},edges:{description:"边信息",type:"array",items:{$ref:"#/components/schemas/Edge"}}},required:["nodes","edges"]},Valid:{type:"object",properties:{id:{type:"string"},msg:{type:"string"},type:{type:"string"}},required:["id","msg","type"]},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:{editorType:{example:'{"UI":"ui","TXT":"txt"}',$ref:"#/components/schemas/EditorTypeEnum"},gameName:{type:"string",description:"游戏名称"},nodes:{description:"画布节点信息",type:"array",items:{$ref:"#/components/schemas/Node"}},edges:{description:"画布边信息",type:"array",items:{$ref:"#/components/schemas/Edge"}}},required:["editorType","gameName","nodes","edges"]},CanvasView:{type:"object",properties:{canvas:{description:"节点信息",allOf:[{$ref:"#/components/schemas/CanvasBody"}]},valid:{description:"校验信息",allOf:[{$ref:"#/components/schemas/ValidateCanvas"}]}},required:["canvas","valid"]},UpdateVariableDto:{type:"object",properties:{id:{type:"string",description:"变量表ID"}},required:["id"]},CreateUserDto:{type:"object",properties:{_id:{type:"string",description:"ID"},username:{type:"string",description:"用户名"},password:{type:"string",description:"密码"},nickname:{type:"string",description:"昵称(可选填)"},caId:{type:"string",description:"验证码ID"},captcha:{type:"string",description:"用户输入验证码"},secret:{type:"string",description:""}},required:["_id","username","password","nickname","caId","captcha","secret"]},CaptchaRsp:{type:"object",properties:{id:{type:"string",description:"id"},data:{type:"string",description:"svg image"}},required:["id","data"]}}},a={openapi:e,paths:t,info:r,tags:s,servers:o,components:i};exports.components=i,exports.default=a,exports.info=r,exports.openapi=e,exports.paths=t,exports.servers=o,exports.tags=s;
|
package/lib/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="1.4.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="1.4.9",i="FE command line tool",s="bin/an-cli.js",l={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",blink:"npm run build && npm link"},p={anl:"bin/an-cli.js"},t="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-copy":"^3.5.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",m={name:"anl",version:e,description:i,main:s,scripts:l,bin:p,author:t,license:"ISC",devDependencies:r,dependencies:o,keywords:n,files:c,repository:u,type:a};exports.author=t,exports.bin=p,exports.default=m,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=l,exports.type=a,exports.version=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../utils/index.js");const t="\t";var r;!function(e){e.GET="get",e.PUT="put",e.POST="post",e.DELETE="delete",e.OPTIONS="options",e.HEAD="head",e.PATCH="patch",e.TRACE="trace"}(r||(r={}));const n={typeMapping:new Map([["integer","number"],["string","string"],["boolean","boolean"],["binary","File"]]),errorHandling:{throwOnError:!1,logErrors:!0}};class s{pathsObject={};nonArrayType=["boolean","object","number","string","integer"];pathKey="";contentBody={payload:{path:[],query:[],body:[]},response:"",_response:"",fileName:"",method:"",requestPath:"",summary:"",apiName:"",typeName:""};Map=new Map;config;errors=[];schemaCache=new Map;referenceCache=new Map;templates={exportConst:e=>`export const ${e}`,typeDefinition:(e,t)=>`type ${e} = ${t}`,interfaceDefinition:e=>`interface ${e}`};constructor(e,t){this.pathsObject=e,this.config={...n,...t,typeMapping:new Map([...n.typeMapping||[],...t.typeMapping||[]])}}handleError(t){if(this.errors.push(t),this.config.errorHandling?.logErrors&&e.log.error(`${t.type}: ${t.message}${t.path?` at ${t.path}`:""}`),this.config.errorHandling?.throwOnError)throw new Error(`${t.type}: ${t.message}`)}getIndentation(){return this.config.formatting?.indentation||t}formatCode(e){const t=this.getIndentation(),r=this.config.formatting?.lineEnding||"\n";return e.split("\n").map((e=>`${t}${e}`)).join(r)}typeNameToFileName(e){return e=(e=(e=e.replace(/_/g,"-")).replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()).replace(/-+/g,"-")}handleComplexType(e){try{return e.oneOf?e.oneOf.map((e=>this.schemaParse(e))).join(" | "):e.allOf?e.allOf.map((e=>this.schemaParse(e))).join(" & "):e.anyOf?e.anyOf.map((e=>this.schemaParse(e))).join(" | "):e.enum?"number"===e.type||"integer"===e.type?e.enum.join(" | "):e.enum.map((e=>`'${e}'`)).join(" | "):"unknown"}catch(e){return this.handleError({type:"SCHEMA",message:"Failed to handle complex type",details:e}),"unknown"}}propertiesParse(e){const r=[];for(const n in e){const s=e[n],a=this.schemaParse(s);let o="";o=Array.isArray(a)?`${t}${t}${n}:{${a.join("\n")}};`:`${t}${t}${n}:${a};`,r.push(o)}return r}nonArraySchemaObjectParse(e){if(!e)return"unknown";if("binary"===e.format||"string"===e.type&&"binary"===e.format)return"File";switch(e.type){case"boolean":return"boolean";case"integer":case"number":return"number";case"object":return this.propertiesParse(e.properties);case"string":return"binary"===e.format?"File":"string";default:return"unknown"}}arraySchemaObjectParse(e){if("array"!==e.type)return"";const{items:t}=e,r="$ref"in t?t:null,n=t;if(r){return`Array<${this.referenceObjectParse(r)}>`}if(n){const e=this.schemaParse(t);return Array.isArray(e)?`Array<{${e.join("\n")}}>`:`Array<${e}>`}return""}referenceObjectParse(e){try{const t=e.$ref,r=this.referenceCache.get(t);if(r)return r;let n=t;t.startsWith("#/components/schemas/")?n=t.replace("#/components/schemas/",""):t.startsWith("#/definitions/")&&(n=t.replace("#/definitions/",""));const s=this.typeNameToFileName(n),a=/enum/gi.test(n)?`import('${this.config.importEnumPath}/${s}').${n}`:`import('../models/${s}').${n}`;return this.referenceCache.set(t,a),a}catch(e){return this.handleError({type:"REFERENCE",message:"Failed to parse reference object",details:e}),"unknown"}}schemaParse(e){try{if(!e)return"unknown";if("oneOf"in e||"allOf"in e||"anyOf"in e||"enum"in e)return this.handleComplexType(e);if("$ref"in e)return this.referenceObjectParse(e);const t=e,r=t.type,n=!0===t.nullable?" | null":"";if(e.format&&this.config.typeMapping?.has(e.format))return this.config.typeMapping.get(e.format)+n;if(r&&this.config.typeMapping?.has(r))return this.config.typeMapping.get(r)+n;if("array"===r&&t.items){return`Array<${this.schemaParse(t.items)}>`+n}if("object"===r){if(t.properties){const e=this.propertiesParse(t.properties);return e.length?e:["unknown"]}if(!0===t.additionalProperties)return"Record<string, unknown>"+n;if("object"==typeof t.additionalProperties){return`Record<string, ${this.schemaParse(t.additionalProperties)}>`+n}}return"unknown"}catch(e){return this.handleError({type:"SCHEMA",message:"Failed to parse schema",details:e}),"unknown"}}responseObjectParse(e){try{const t=e.content;if(!t)return"";const r=["application/json","text/json","text/plain","*/*"];let n;for(const e of r)if(t[e]?.schema){n=t[e].schema;break}return n?this.schemaParse(n):""}catch(e){return this.handleError({type:"RESPONSE",message:"Failed to parse response object",details:e}),""}}responseHandle(e){const t=e[200];if(!t)return;const r="content"in t?t:null,n="$ref"in t?t:null;if(null===r&&null===n&&(this.contentBody.response="type Response = unknown",this.contentBody._response="unknown"),n){const e=this.referenceObjectParse(n);this.contentBody.response=`type Response = ${e}`,this.contentBody._response=e}if(r){const e=this.responseObjectParse(r);Array.isArray(e)?(this.contentBody.response=`interface Response {${e.join("\n")}} `,this.contentBody._response=`${e.join("\n")}`):(this.contentBody.response=`type Response = ${e}`,this.contentBody._response=`${e}`)}}requestBodyObjectParse(e){const r=Object.values(e.content),{schema:n}=r[0]||{schema:null};if(n){const e=n?.type,r="$ref"in n?n:null,s="array"===e?n:null,a=e&&this.nonArrayType.includes(e)?n:null;if(r){const e=this.referenceObjectParse(r);return`${t}type Body = ${e}`}if(s){const e=this.arraySchemaObjectParse(s);return`${t}type Body = ${e}`}if(a){const e=this.nonArraySchemaObjectParse(a);return Array.isArray(e)?0===e.length?[`${t}type Body = unknown`]:[`${t}interface Body {`,...e.map((e=>e.replace(/: string;/,": File;"))),"}"]:[`${t}type Body = ${e}`]}}}requestBodyParse(e){if(!e)return"{}";const r="$ref"in e?e:null,n="content"in e?e:null;if(r){const e=this.referenceObjectParse(r);return`${t}type Body = ${e}`}return n&&"[object Object]"===String(e)&&0!==Reflect.ownKeys(e).length?this.requestBodyObjectParse(n):"{}"}requestParametersParse(r){const n=[],s=[];r?.map((r=>{const a="$ref"in r?r:null,o="name"in r?r:null;if(a){const t=this.referenceObjectParse(a);return e.log.warning(`${this.pathKey} ${t} item 是 ReferenceObject 类型 ----未处理---`),t}if(o){if("path"===o.in){const e=this.schemaParse(o.schema);n.push(`${t}${t}type ${o.name} = ${e};`),this.contentBody.payload._path?"string"==typeof e?this.contentBody.payload._path[o.name]=e:console.log("Unexpected v2value type:",e):"string"==typeof e?this.contentBody.payload._path={[o.name]:e}:console.log("Unexpected v2value type:",e)}if("query"===o.in){const e=this.schemaParse(o.schema);s.push(`${t}${t}${o.name}: ${e};`),this.contentBody.payload._query?"string"==typeof e?this.contentBody.payload._query[o.name]=e:console.log("Unexpected v2value type:",e):"string"==typeof e?this.contentBody.payload._query={[o.name]:e}:console.log("Unexpected v2value type:",e)}}})),0!==n.length&&(n.unshift(`${t}namespace Path {`),n.push(`${t}}`)),0!==s.length&&(s.unshift(`${t}interface Query {`),s.push(`${t}}`)),this.contentBody.payload.path=n,this.contentBody.payload.query=s}requestHandle(e){if(e.parameters&&this.requestParametersParse(e.parameters),e.requestBody){const t=this.requestBodyParse(e.requestBody);if(Array.isArray(t))this.contentBody.payload.body=t;else if(t){const e=t?.split("\n")||[];this.contentBody.payload.body=e}}}apiRequestItemHandle(e){const{payload:t,requestPath:r,_response:n,method:s,typeName:a,apiName:o}=e,{_path:i,_query:p,body:c}=t,h=c.some((e=>e.includes("File:")||e.includes(": File"))),l=e=>{const t=[];for(const r in e)t.push(`${r}: ${a}.Path.${r}`);return t.length>1?t.join(","):t.join("")},y=i?l(i):"",u=p?`params: ${a}.Query`:"",d=c.length>0?`params: ${a}.Body`:"",m={};y&&(m.apiParamsPath=y),u&&(m.apiParamsQuery=u),d&&(m.apiParamsBody=d);const f=Object.keys(m).length>=2,g=h?`,${this.config.dataLevel}`:"",$=h?", { headers: { 'Content-Type': 'multipart/form-data' } }":"";return[`export const ${o} = `,"(",i?l(i):"",""+(f?",":""),p?`params: ${a}.Query`:"",c.length>0?`params: ${a}.Body`:"",")"," => ",`${s}${n?`<${a}.Response>`:""}`,"(`"+r+"`"+(u||d?", params":"")+g+$+");"].join("")}parsePathItemObject(e,t){if(e)for(const r in e){const n=e[r];if(n){const e=r.toUpperCase(),s=t+"|"+e,{apiName:a,typeName:o,fileName:i,path:p}=this.convertEndpointString(s);this.contentBody={payload:{path:[],query:[],body:[]},response:"",_response:"",fileName:i,method:e,typeName:o,requestPath:p,apiName:a,summary:n.summary},this.requestHandle(n),this.responseHandle(n.responses),this.Map.has(s)||this.Map.set(s,JSON.parse(JSON.stringify(this.contentBody)))}}}convertEndpointString(e){let t=e;e.startsWith("/")||(t="/"+e);const[r,n]=t.split("|"),s=`${r.replace("/api/","").split("/").map((e=>e.includes("{")?`$${e.slice(1,-1)}`:e.charAt(0).toUpperCase()+e.slice(1))).join("")}_${n}`;return{apiName:s.charAt(0).toLowerCase()+s.slice(1),fileName:(r.slice(1).replace(/\//g,"-").replace("api-","")+"-"+n).toLowerCase(),typeName:s.charAt(0).toUpperCase()+s.slice(1),path:r.replace(/(\/api)|(api)/g,"").replace(/\{\w+\}/g,(e=>`$${e}`))}}parseData(){return new Promise(((e,t)=>{try{for(const e in this.pathsObject){const t=this.pathsObject[e];t&&this.parsePathItemObject(t,e)}e(this.Map)}catch(e){this.handleError({type:"SCHEMA",message:"Failed to parse schema",details:e}),t(e)}}))}async writeFile(){const r=[],n=[],s=this.config.saveTypeFolderPath,a=[],o=(r,o)=>new Promise(((i,p)=>{try{const{payload:c,response:h,fileName:l,summary:y,typeName:u}=o,[,d]=r.split("|");!a.includes(d)&&a.push(d);const m=[`declare namespace ${u} {`,...c.path,...c.query,...c.body,`${t}${h}`,"}"];y&&n.push(["/**","\n",` * ${y}`,"\n"," */"].join(""));const f=this.apiRequestItemHandle(o);n.push(f,"\n"),e.writeFileRecursive(`${s}/connectors/${l}.d.ts`,m.join("\n")).then((()=>i(1))).catch((e=>{this.handleError({type:"FILE_WRITE",message:"Failed to write type definition file",path:l,details:e}),p(e)}))}catch(e){this.handleError({type:"PATH",message:"Failed to process path item",path:r,details:e}),p(e)}}));for(const[e,t]of this.Map)r.push(o(e,t));try{await Promise.all(r),n.unshift(`import { ${a.join(", ")} } from '${this.config.requestMethodsImportPath||"./api"}';`,"\n"),await e.clearDir(this.config.saveApiListFolderPath+"/index.ts"),await e.writeFileRecursive(this.config.saveApiListFolderPath+"/index.ts",n.join("\n")),this.Map=new Map,this.errors.length>0&&e.log.warning(`Completed with ${this.errors.length} errors`)}catch(e){throw this.handleError({type:"FILE_WRITE",message:"Failed to write API list file",details:e}),e}}async handle(){try{await this.parseData(),await this.writeFile(),e.log.success("Path parse & write done!")}catch(e){if(this.handleError({type:"SCHEMA",message:"Failed to handle schema",details:e}),this.config.errorHandling?.throwOnError)throw e}}}exports.PathParse=s,exports.default=s;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../utils/index.js");const t="\t";var n;!function(e){e.GET="get",e.PUT="put",e.POST="post",e.DELETE="delete",e.OPTIONS="options",e.HEAD="head",e.PATCH="patch",e.TRACE="trace"}(n||(n={}));const r={typeMapping:new Map([["integer","number"],["string","string"],["boolean","boolean"],["binary","File"]]),errorHandling:{throwOnError:!1,logErrors:!0}};class s{pathsObject={};nonArrayType=["boolean","object","number","string","integer"];pathKey="";contentBody={payload:{path:[],query:[],body:[]},response:"",_response:"",fileName:"",method:"",requestPath:"",summary:"",apiName:"",typeName:""};Map=new Map;config;errors=[];schemaCache=new Map;referenceCache=new Map;templates={exportConst:e=>`export const ${e}`,typeDefinition:(e,t)=>`type ${e} = ${t}`,interfaceDefinition:e=>`interface ${e}`};constructor(e,t){this.pathsObject=e,this.config={...r,...t,typeMapping:new Map([...r.typeMapping||[],...t.typeMapping||[]])}}handleError(t){if(this.errors.push(t),this.config.errorHandling?.logErrors&&e.log.error(`${t.type}: ${t.message}${t.path?` at ${t.path}`:""}`),this.config.errorHandling?.throwOnError)throw new Error(`${t.type}: ${t.message}`)}getIndentation(){return this.config.formatting?.indentation||t}formatCode(e){const t=this.getIndentation(),n=this.config.formatting?.lineEnding||"\n";return e.split("\n").map((e=>`${t}${e}`)).join(n)}typeNameToFileName(e){return e=(e=(e=e.replace(/_/g,"-")).replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()).replace(/-+/g,"-")}handleComplexType(e){try{return e.oneOf?e.oneOf.map((e=>this.schemaParse(e))).join(" | "):e.allOf?e.allOf.map((e=>this.schemaParse(e))).join(" & "):e.anyOf?e.anyOf.map((e=>this.schemaParse(e))).join(" | "):e.enum?"number"===e.type||"integer"===e.type?e.enum.join(" | "):e.enum.map((e=>`'${e}'`)).join(" | "):"unknown"}catch(e){return this.handleError({type:"SCHEMA",message:"Failed to handle complex type",details:e}),"unknown"}}propertiesParse(e){if(!e)return[];const n=[];for(const r in e){const s=e[r],a=this.schemaParse(s);let i="";i=Array.isArray(a)?`${t}${t}${r}: {${a.join("\n")}};`:`${t}${t}${r}: ${a};`,n.push(i)}return n}nonArraySchemaObjectParse(e){if(!e)return"unknown";if("binary"===e.format||"string"===e.type&&"binary"===e.format)return"File";switch(e.type){case"boolean":return"boolean";case"integer":case"number":return"number";case"object":return this.propertiesParse(e.properties);case"string":return"binary"===e.format?"File":"string";default:return"unknown"}}arraySchemaObjectParse(e){if("array"!==e.type)return"";const{items:t}=e,n="$ref"in t?t:null,r=t;if(n){return`Array<${this.referenceObjectParse(n)}>`}if(r){const e=this.schemaParse(t);return Array.isArray(e)?`Array<{${e.join("\n")}}>`:`Array<${e}>`}return""}referenceObjectParse(e){try{const t=e.$ref,n=this.referenceCache.get(t);if(n)return n;let r=t;t.startsWith("#/components/schemas/")?r=t.replace("#/components/schemas/",""):t.startsWith("#/definitions/")&&(r=t.replace("#/definitions/",""));const s=this.typeNameToFileName(r),a=/enum/gi.test(r)?`import('${this.config.importEnumPath}/${s}').${r}`:`import('../models/${s}').${r}`;return this.referenceCache.set(t,a),a}catch(e){return this.handleError({type:"REFERENCE",message:"Failed to parse reference object",details:e}),"unknown"}}schemaParse(e){try{if(!e)return"unknown";if("oneOf"in e||"allOf"in e||"anyOf"in e||"enum"in e)return this.handleComplexType(e);if("$ref"in e)return this.referenceObjectParse(e);const t=e,n=t.type,r=!0===t.nullable?" | null":"";if(e.format&&this.config.typeMapping?.has(e.format))return this.config.typeMapping.get(e.format)+r;if(n&&this.config.typeMapping?.has(n))return this.config.typeMapping.get(n)+r;if("array"===n&&t.items){const e=this.schemaParse(t.items);if(Array.isArray(e)){const t=this.config.formatting?.lineEnding,n=this.config.formatting?.indentation;return`Array<{${t}${e.join("\n")}${t}${n}${n}}>`}return`Array<${e}>`}if("object"===n){if(t.properties){const e=this.propertiesParse(t.properties);return e.length?e:["unknown"]}if(!0===t.additionalProperties)return"Record<string, unknown>"+r;if("object"==typeof t.additionalProperties){return`Record<string, ${this.schemaParse(t.additionalProperties)}>`+r}}return"unknown"}catch(e){return this.handleError({type:"SCHEMA",message:"Failed to parse schema",details:e}),"unknown"}}responseObjectParse(e){try{const t=e.content;if(!t)return"";const n=["application/json","text/json","text/plain","*/*"];let r;for(const e of n)if(t[e]?.schema){r=t[e].schema;break}return r?this.schemaParse(r):""}catch(e){return this.handleError({type:"RESPONSE",message:"Failed to parse response object",details:e}),""}}responseHandle(e){const t=e[200];if(!t)return;const n="content"in t?t:null,r="$ref"in t?t:null;if(null===n&&null===r&&(this.contentBody.response="type Response = unknown",this.contentBody._response="unknown"),r){const e=this.referenceObjectParse(r);this.contentBody.response=`type Response = ${e}`,this.contentBody._response=e}if(n){const e=this.responseObjectParse(n);if(Array.isArray(e)){if(1===e.length&&"unknown"===e[0])this.contentBody.response=`type Response = ${e.join("\n")};`;else{const t=this.config.formatting?.lineEnding,n=this.config.formatting?.indentation;this.contentBody.response=`interface Response {${t}${e.join("\n")}${t}${n}};`}this.contentBody._response=`${e.join("\n")}`}else this.contentBody.response=`type Response = ${e}`,this.contentBody._response=`${e}`}}requestBodyObjectParse(e){const n=Object.values(e.content),{schema:r}=n[0]||{schema:null};if(r){const e=r?.type,n="$ref"in r?r:null,s="array"===e?r:null,a=e&&this.nonArrayType.includes(e)?r:null;if(n){const e=this.referenceObjectParse(n);return`${t}type Body = ${e}`}if(s){const e=this.arraySchemaObjectParse(s);return`${t}type Body = ${e}`}if(a){const e=this.nonArraySchemaObjectParse(a);return Array.isArray(e)?0===e.length?[`${t}type Body = ${a.type};`]:[`${t}interface Body {`,...e.map((e=>e.replace(/: string;/,": File;"))),"}"]:[`${t}type Body = ${e}`]}}}requestBodyParse(e){if(!e)return"{}";const n="$ref"in e?e:null,r="content"in e?e:null;if(n){const e=this.referenceObjectParse(n);return`${t}type Body = ${e}`}return r&&"[object Object]"===String(e)&&0!==Reflect.ownKeys(e).length?this.requestBodyObjectParse(r):"{}"}requestParametersParse(n){const r=[],s=[];n?.map((n=>{const a="$ref"in n?n:null,i="name"in n?n:null;if(a){const t=this.referenceObjectParse(a);return e.log.warning(`${this.pathKey} ${t} item 是 ReferenceObject 类型 ----未处理---`),t}if(i){if("path"===i.in){const e=this.schemaParse(i.schema);r.push(`${t}${t}type ${i.name} = ${e};`),this.contentBody.payload._path?"string"==typeof e?this.contentBody.payload._path[i.name]=e:console.log("Unexpected v2value type:",e):"string"==typeof e?this.contentBody.payload._path={[i.name]:e}:console.log("Unexpected v2value type:",e)}if("query"===i.in){const e=this.schemaParse(i.schema);s.push(`${t}${t}${i.name}: ${e};`),this.contentBody.payload._query?"string"==typeof e?this.contentBody.payload._query[i.name]=e:console.log("Unexpected v2value type:",e):"string"==typeof e?this.contentBody.payload._query={[i.name]:e}:console.log("Unexpected v2value type:",e)}}})),0!==r.length&&(r.unshift(`${t}namespace Path {`),r.push(`${t}}`)),0!==s.length&&(s.unshift(`${t}interface Query {`),s.push(`${t}}`)),this.contentBody.payload.path=r,this.contentBody.payload.query=s}requestHandle(e){if(e.parameters&&this.requestParametersParse(e.parameters),e.requestBody){const t=this.requestBodyParse(e.requestBody);if(Array.isArray(t))this.contentBody.payload.body=t;else if(t){const e=t?.split("\n")||[];this.contentBody.payload.body=e}}}apiRequestItemHandle(e){const{payload:t,requestPath:n,_response:r,method:s,typeName:a,apiName:i}=e,{_path:o,_query:p,body:c}=t,h=c.some((e=>e.includes("File:")||e.includes(": File"))),l=e=>{const t=[];for(const n in e)t.push(`${n}: ${a}.Path.${n}`);return t.length>1?t.join(","):t.join("")},y=o?l(o):"",u=p?`params: ${a}.Query`:"",d=c.length>0?`params: ${a}.Body`:"",m={};y&&(m.apiParamsPath=y),u&&(m.apiParamsQuery=u),d&&(m.apiParamsBody=d);const f=Object.keys(m).length>=2,g=h?`,${this.config.dataLevel}`:"",$=h?", { headers: { 'Content-Type': 'multipart/form-data' } }":"";return[`export const ${i} = `,"(",o?l(o):"",""+(f?",":""),p?`params: ${a}.Query`:"",c.length>0?`params: ${a}.Body`:"",")"," => ",`${s}${r?`<${a}.Response>`:""}`,"(`"+n+"`"+(u||d?", params":"")+g+$+");"].join("")}parsePathItemObject(e,t){if(e)for(const n in e){const r=e[n];if(r){const e=n.toUpperCase(),s=t+"|"+e,{apiName:a,typeName:i,fileName:o,path:p}=this.convertEndpointString(s);this.contentBody={payload:{path:[],query:[],body:[]},response:"",_response:"",fileName:o,method:e,typeName:i,requestPath:p,apiName:a,summary:r.summary},this.requestHandle(r),this.responseHandle(r.responses),this.Map.has(s)||this.Map.set(s,JSON.parse(JSON.stringify(this.contentBody)))}}}convertEndpointString(e){let t=e;e.startsWith("/")||(t="/"+e);const[n,r]=t.split("|"),s=`${n.replace("/api/","").split("/").map((e=>e.includes("{")?`$${e.slice(1,-1)}`:e.charAt(0).toUpperCase()+e.slice(1))).join("")}_${r}`;return{apiName:s.charAt(0).toLowerCase()+s.slice(1),fileName:(n.slice(1).replace(/\//g,"-").replace("api-","")+"-"+r).toLowerCase(),typeName:s.charAt(0).toUpperCase()+s.slice(1),path:n.replace(/(\/api)|(api)/g,"").replace(/\{\w+\}/g,(e=>`$${e}`))}}parseData(){return new Promise(((e,t)=>{try{for(const e in this.pathsObject){const t=this.pathsObject[e];t&&this.parsePathItemObject(t,e)}e(this.Map)}catch(e){this.handleError({type:"SCHEMA",message:"Failed to parse schema",details:e}),t(e)}}))}async writeFile(){const n=[],r=[],s=this.config.saveTypeFolderPath,a=[],i=(n,i)=>new Promise(((o,p)=>{try{const{payload:c,response:h,fileName:l,summary:y,typeName:u}=i,[,d]=n.split("|");!a.includes(d)&&a.push(d);const m=[`declare namespace ${u} {`,...c.path,...c.query,...c.body,`${t}${h}`,"}"];y&&r.push(["/**","\n",` * ${y}`,"\n"," */"].join(""));const f=this.apiRequestItemHandle(i);r.push(f,"\n"),e.writeFileRecursive(`${s}/connectors/${l}.d.ts`,m.join("\n")).then((()=>o(1))).catch((e=>{this.handleError({type:"FILE_WRITE",message:"Failed to write type definition file",path:l,details:e}),p(e)}))}catch(e){this.handleError({type:"PATH",message:"Failed to process path item",path:n,details:e}),p(e)}}));for(const[e,t]of this.Map)n.push(i(e,t));try{await Promise.all(n),r.unshift(`import { ${a.join(", ")} } from '${this.config.requestMethodsImportPath||"./api"}';`,"\n"),await e.clearDir(this.config.saveApiListFolderPath+"/index.ts"),await e.writeFileRecursive(this.config.saveApiListFolderPath+"/index.ts",r.join("\n")),this.Map=new Map,this.errors.length>0&&e.log.warning(`Completed with ${this.errors.length} errors`)}catch(e){throw this.handleError({type:"FILE_WRITE",message:"Failed to write API list file",details:e}),e}}async handle(){try{await this.parseData(),await this.writeFile(),e.log.success("Path parse & write done!")}catch(e){if(this.handleError({type:"SCHEMA",message:"Failed to handle schema",details:e}),this.config.errorHandling?.throwOnError)throw e}}}exports.PathParse=s,exports.default=s;
|
|
@@ -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"),i=require("chalk"),n=require("path");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(e),p=c(i),
|
|
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"),i=require("chalk"),n=require("path");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(e),p=c(i),u=c(n);let d;const h={saveTypeFolderPath:"development"===process.env.NODE_ENV?"apps/types":"src/api/types",saveApiListFolderPath:"development"===process.env.NODE_ENV?"apps/types":"src/api",saveEnumFolderPath:"development"===process.env.NODE_ENV?"apps/types/enums":"src/enums",importEnumPath:"../../../enums",requestMethodsImportPath:"./fetch",dataLevel:"serve",swaggerJsonUrl:"www.example.swagger.json.url",headers:{},formatting:{indentation:"\t",lineEnding:"\n"}};class f{schemas={};paths={};async handle(e){try{let t;if(t="development"===process.env.NODE_ENV?(await Promise.resolve().then((function(){return require("../../data/umf.json.js")}))).default:await r.getSwaggerJson(e),!t)throw new Error("无法获取 Swagger 数据");this.schemas=t.components?.schemas||{},this.paths=t.paths||{};const o=new s.default(this.schemas,e),i=new a.PathParse(this.paths,e);return await Promise.all([o.handle(),i.handle()]),!0}catch(e){if(e instanceof Error)throw new Error(`处理 Swagger 数据失败: ${e.message}`);throw new Error("处理 Swagger 数据失败: 未知错误")}}async formatGeneratedFiles(e){const s=`npx prettier --write "${e.saveTypeFolderPath}/**/*.{ts,d.ts}"`;try{await l.default.promises.access(e.saveTypeFolderPath);const{stderr:r}=await new Promise(((e,t)=>{o.exec(s,((s,r,a)=>{s?t(s):e({stdout:r,stderr:a})}))}));if(r)throw new Error(r);t.log.success("文件格式化成功")}catch(e){console.log(""),t.log.error("格式化失败,请手动执行以下命令:"),console.log("$",p.default.yellow(s)),console.log("")}}async copyAjaxConfigFiles(e){try{const s=["config.ts","error-message.ts","fetch.ts"],r=u.default.join(__dirname,"..","..","ajax-config"),a=e;for(const e of s){const s=u.default.join(r,e),o=u.default.join(a,e);try{await l.default.promises.access(s);try{await l.default.promises.access(o),t.log.info(`${e} 已存在,跳过生成.`)}catch{await l.default.promises.copyFile(s,o),t.log.success(`${e} create done.`)}}catch(e){t.log.error(`源文件 ${s} 不存在`);continue}}}catch(e){return e}}async initialize(){const e=process.cwd()+"/an.config.json";try{const s=await this.getConfig(e);if(!d)return;await l.default.promises.mkdir(s.saveApiListFolderPath,{recursive:!0}),await this.copyAjaxConfigFiles(s.saveApiListFolderPath),await t.clearDir(s.saveTypeFolderPath),await t.clearDir(s.saveEnumFolderPath),await this.handle(s),await this.formatGeneratedFiles(s)}catch(e){const s=e instanceof Error?e.message:"未知错误";t.log.error(`初始化失败: ${s}`)}}async getConfig(e){try{const t=await l.default.promises.readFile(e,"utf8");return d=!0,JSON.parse(t)}catch(s){return d=!1,t.log.warning("配置文件不存在,将自动创建配置文件。"),await t.writeFileRecursive(e,JSON.stringify(h,null,2)),t.log.success("请查看项目根目录下的 an.config.json 文件"),h}}}if("development"===process.env.NODE_ENV){(new f).initialize()}exports.Main=f;
|
package/package.json
CHANGED
package/lib/data/openapi.json.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="3.0.3",t={title:"Swagger Petstore - OpenAPI 3.0",description:"This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\n_If you're looking for the Swagger 2.0/OAS 2.0 version of Petstore, then click [here](https://editor.swagger.io/?url=https://petstore.swagger.io/v2/swagger.yaml). Alternatively, you can load via the `Edit > Load Petstore OAS 2.0` menu option!_\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)",termsOfService:"http://swagger.io/terms/",contact:{email:"apiteam@swagger.io"},license:{name:"Apache 2.0",url:"http://www.apache.org/licenses/LICENSE-2.0.html"},version:"1.0.11"},s={description:"Find out more about Swagger",url:"http://swagger.io"},r=[{url:"https://petstore3.swagger.io/api/v3"}],a=[{name:"pet",description:"Everything about your Pets",externalDocs:{description:"Find out more",url:"http://swagger.io"}},{name:"store",description:"Access to Petstore orders",externalDocs:{description:"Find out more about our store",url:"http://swagger.io"}},{name:"user",description:"Operations about user"}],o={"/pet":{put:{tags:["pet"],summary:"Update an existing pet",description:"Update an existing pet by Id",operationId:"updatePet",requestBody:{description:"Update an existent pet in the store",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}},"application/x-www-form-urlencoded":{schema:{$ref:"#/components/schemas/Pet"}}},required:!0},responses:{200:{description:"Successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}}}},400:{description:"Invalid ID supplied"},404:{description:"Pet not found"},422:{description:"Validation exception"}},security:[{petstore_auth:["write:pets","read:pets"]}]},post:{tags:["pet"],summary:"Add a new pet to the store",description:"Add a new pet to the store",operationId:"addPet",requestBody:{description:"Create a new pet in the store",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}},"application/x-www-form-urlencoded":{schema:{$ref:"#/components/schemas/Pet"}}},required:!0},responses:{200:{description:"Successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}}}},400:{description:"Invalid input"},422:{description:"Validation exception"}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/pet/findByStatus":{get:{tags:["pet"],summary:"Finds Pets by status",description:"Multiple status values can be provided with comma separated strings",operationId:"findPetsByStatus",parameters:[{name:"status",in:"query",description:"Status values that need to be considered for filter",required:!1,explode:!0,schema:{type:"string",default:"available",enum:["available","pending","sold"]}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/Pet"}}},"application/xml":{schema:{type:"array",items:{$ref:"#/components/schemas/Pet"}}}}},400:{description:"Invalid status value"}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/pet/findByTags":{get:{tags:["pet"],summary:"Finds Pets by tags",description:"Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",operationId:"findPetsByTags",parameters:[{name:"tags",in:"query",description:"Tags to filter by",required:!1,explode:!0,schema:{type:"array",items:{type:"string"}}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/Pet"}}},"application/xml":{schema:{type:"array",items:{$ref:"#/components/schemas/Pet"}}}}},400:{description:"Invalid tag value"}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/pet/{petId}":{get:{tags:["pet"],summary:"Find pet by ID",description:"Returns a single pet",operationId:"getPetById",parameters:[{name:"petId",in:"path",description:"ID of pet to return",required:!0,schema:{type:"integer",format:"int64"}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}}}},400:{description:"Invalid ID supplied"},404:{description:"Pet not found"}},security:[{api_key:[]},{petstore_auth:["write:pets","read:pets"]}]},post:{tags:["pet"],summary:"Updates a pet in the store with form data",description:"",operationId:"updatePetWithForm",parameters:[{name:"petId",in:"path",description:"ID of pet that needs to be updated",required:!0,schema:{type:"integer",format:"int64"}},{name:"name",in:"query",description:"Name of pet that needs to be updated",schema:{type:"string"}},{name:"status",in:"query",description:"Status of pet that needs to be updated",schema:{type:"string"}}],responses:{400:{description:"Invalid input"}},security:[{petstore_auth:["write:pets","read:pets"]}]},delete:{tags:["pet"],summary:"Deletes a pet",description:"delete a pet",operationId:"deletePet",parameters:[{name:"api_key",in:"header",description:"",required:!1,schema:{type:"string"}},{name:"petId",in:"path",description:"Pet id to delete",required:!0,schema:{type:"integer",format:"int64"}}],responses:{400:{description:"Invalid pet value"}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/pet/{petId}/uploadImage":{post:{tags:["pet"],summary:"uploads an image",description:"",operationId:"uploadFile",parameters:[{name:"petId",in:"path",description:"ID of pet to update",required:!0,schema:{type:"integer",format:"int64"}},{name:"additionalMetadata",in:"query",description:"Additional Metadata",required:!1,schema:{type:"string"}}],requestBody:{content:{"application/octet-stream":{schema:{type:"string",format:"binary"}}}},responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/ApiResponse"}}}}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/store/inventory":{get:{tags:["store"],summary:"Returns pet inventories by status",description:"Returns a map of status codes to quantities",operationId:"getInventory",responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"object",additionalProperties:{type:"integer",format:"int32"}}}}}},security:[{api_key:[]}]}},"/store/order":{post:{tags:["store"],summary:"Place an order for a pet",description:"Place a new order in the store",operationId:"placeOrder",requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/Order"}},"application/xml":{schema:{$ref:"#/components/schemas/Order"}},"application/x-www-form-urlencoded":{schema:{$ref:"#/components/schemas/Order"}}}},responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Order"}}}},400:{description:"Invalid input"},422:{description:"Validation exception"}}}},"/store/order/{orderId}":{get:{tags:["store"],summary:"Find purchase order by ID",description:"For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.",operationId:"getOrderById",parameters:[{name:"orderId",in:"path",description:"ID of order that needs to be fetched",required:!0,schema:{type:"integer",format:"int64"}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Order"}},"application/xml":{schema:{$ref:"#/components/schemas/Order"}}}},400:{description:"Invalid ID supplied"},404:{description:"Order not found"}}},delete:{tags:["store"],summary:"Delete purchase order by ID",description:"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",operationId:"deleteOrder",parameters:[{name:"orderId",in:"path",description:"ID of the order that needs to be deleted",required:!0,schema:{type:"integer",format:"int64"}}],responses:{400:{description:"Invalid ID supplied"},404:{description:"Order not found"}}}},"/user":{post:{tags:["user"],summary:"Create user",description:"This can only be done by the logged in user.",operationId:"createUser",requestBody:{description:"Created user object",content:{"application/json":{schema:{$ref:"#/components/schemas/User"}},"application/xml":{schema:{$ref:"#/components/schemas/User"}},"application/x-www-form-urlencoded":{schema:{$ref:"#/components/schemas/User"}}}},responses:{default:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/User"}},"application/xml":{schema:{$ref:"#/components/schemas/User"}}}}}}},"/user/createWithList":{post:{tags:["user"],summary:"Creates list of users with given input array",description:"Creates list of users with given input array",operationId:"createUsersWithListInput",requestBody:{content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/User"}}}}},responses:{200:{description:"Successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/User"}},"application/xml":{schema:{$ref:"#/components/schemas/User"}}}},default:{description:"successful operation"}}}},"/user/login":{get:{tags:["user"],summary:"Logs user into the system",description:"",operationId:"loginUser",parameters:[{name:"username",in:"query",description:"The user name for login",required:!1,schema:{type:"string"}},{name:"password",in:"query",description:"The password for login in clear text",required:!1,schema:{type:"string"}}],responses:{200:{description:"successful operation",headers:{"X-Rate-Limit":{description:"calls per hour allowed by the user",schema:{type:"integer",format:"int32"}},"X-Expires-After":{description:"date in UTC when token expires",schema:{type:"string",format:"date-time"}}},content:{"application/xml":{schema:{type:"string"}},"application/json":{schema:{type:"string"}}}},400:{description:"Invalid username/password supplied"}}}},"/user/logout":{get:{tags:["user"],summary:"Logs out current logged in user session",description:"",operationId:"logoutUser",parameters:[],responses:{default:{description:"successful operation"}}}},"/user/{username}":{get:{tags:["user"],summary:"Get user by user name",description:"",operationId:"getUserByName",parameters:[{name:"username",in:"path",description:"The name that needs to be fetched. Use user1 for testing. ",required:!0,schema:{type:"string"}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/User"}},"application/xml":{schema:{$ref:"#/components/schemas/User"}}}},400:{description:"Invalid username supplied"},404:{description:"User not found"}}},put:{tags:["user"],summary:"Update user",description:"This can only be done by the logged in user.",operationId:"updateUser",parameters:[{name:"username",in:"path",description:"name that need to be deleted",required:!0,schema:{type:"string"}}],requestBody:{description:"Update an existent user in the store",content:{"application/json":{schema:{$ref:"#/components/schemas/User"}},"application/xml":{schema:{$ref:"#/components/schemas/User"}},"application/x-www-form-urlencoded":{schema:{$ref:"#/components/schemas/User"}}}},responses:{default:{description:"successful operation"}}},delete:{tags:["user"],summary:"Delete user",description:"This can only be done by the logged in user.",operationId:"deleteUser",parameters:[{name:"username",in:"path",description:"The name that needs to be deleted",required:!0,schema:{type:"string"}}],responses:{400:{description:"Invalid username supplied"},404:{description:"User not found"}}}}},n={schemas:{Order:{type:"object",properties:{id:{type:"integer",format:"int64",example:10},petId:{type:"integer",format:"int64",example:198772},quantity:{type:"integer",format:"int32",example:7},shipDate:{type:"string",format:"date-time"},status:{type:"string",description:"Order Status",example:"approved",enum:["placed","approved","delivered"]},complete:{type:"boolean"}},xml:{name:"order"}},Customer:{type:"object",properties:{id:{type:"integer",format:"int64",example:1e5},username:{type:"string",example:"fehguy"},address:{type:"array",xml:{name:"addresses",wrapped:!0},items:{$ref:"#/components/schemas/Address"}}},xml:{name:"customer"}},Address:{type:"object",properties:{street:{type:"string",example:"437 Lytton"},city:{type:"string",example:"Palo Alto"},state:{type:"string",example:"CA"},zip:{type:"string",example:"94301"}},xml:{name:"address"}},Category:{type:"object",properties:{id:{type:"integer",format:"int64",example:1},name:{type:"string",example:"Dogs"}},xml:{name:"category"}},User:{type:"object",properties:{id:{type:"integer",format:"int64",example:10},username:{type:"string",example:"theUser"},firstName:{type:"string",example:"John"},lastName:{type:"string",example:"James"},email:{type:"string",example:"john@email.com"},password:{type:"string",example:"12345"},phone:{type:"string",example:"12345"},userStatus:{type:"integer",description:"User Status",format:"int32",example:1}},xml:{name:"user"}},Tag:{type:"object",properties:{id:{type:"integer",format:"int64"},name:{type:"string"}},xml:{name:"tag"}},Pet:{required:["name","photoUrls"],type:"object",properties:{id:{type:"integer",format:"int64",example:10},name:{type:"string",example:"doggie"},category:{$ref:"#/components/schemas/Category"},photoUrls:{type:"array",xml:{wrapped:!0},items:{type:"string",xml:{name:"photoUrl"}}},tags:{type:"array",xml:{wrapped:!0},items:{$ref:"#/components/schemas/Tag"}},status:{type:"string",description:"pet status in the store",enum:["available","pending","sold"]}},xml:{name:"pet"}},ApiResponse:{type:"object",properties:{code:{type:"integer",format:"int32"},type:{type:"string"},message:{type:"string"}},xml:{name:"##default"}}},requestBodies:{Pet:{description:"Pet object that needs to be added to the store",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}}}},UserArray:{description:"List of user object",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/User"}}}}}},securitySchemes:{petstore_auth:{type:"oauth2",flows:{implicit:{authorizationUrl:"https://petstore3.swagger.io/oauth/authorize",scopes:{"write:pets":"modify pets in your account","read:pets":"read your pets"}}}},api_key:{type:"apiKey",name:"api_key",in:"header"}}},i={openapi:e,info:t,externalDocs:s,servers:r,tags:a,paths:o,components:n};exports.components=n,exports.default=i,exports.externalDocs=s,exports.info=t,exports.openapi=e,exports.paths=o,exports.servers=r,exports.tags=a;
|