Repository: thx/rap2-delos Branch: master Commit: 05e6bddb7125 Files: 122 Total size: 313.3 KB Directory structure: gitextract_mkcp7_61/ ├── .dockerignore ├── .github/ │ └── ISSUE_TEMPLATE/ │ ├── ---------.md │ └── bug--.md ├── .gitignore ├── .jshintrc ├── .prettierrc ├── .travis.yml ├── .vscode/ │ └── launch.json ├── APP-META/ │ └── docker-config/ │ └── environment/ │ └── cai/ │ └── conf/ │ └── nginx-proxy.conf ├── Dockerfile ├── LICENSE ├── README.md ├── database/ │ ├── history/ │ │ ├── patch-null-type.sql │ │ ├── v2.5_change.sql │ │ ├── v2.6_change_20180705.sql │ │ ├── v2.8.0_token.sql │ │ ├── v2018_07_27.sql │ │ ├── v2018_08_27_add_property_required.sql │ │ └── v2019_09_26_default_val_table.sql │ ├── recreate_db.sql │ ├── v2018_05_15.sql │ ├── v2020_07_06_history_log.sql │ ├── v2020_07_21_body_option_save.sql │ └── v2020_07_21_merge_PR.sql ├── docker-compose.yml ├── docs/ │ └── Schedule.md ├── package.json ├── public/ │ ├── 404.json │ ├── 500.json │ ├── error.html │ ├── index.html │ ├── libs/ │ │ ├── README.md │ │ ├── fetch.rap.js │ │ ├── jquery.rap.js │ │ └── mock.rap.js │ └── test/ │ ├── index.html │ ├── test.plugin.fetch.html │ ├── test.plugin.jquery.html │ ├── test.plugin.mock.html │ └── test.request.js ├── release/ │ └── v2.6_20180705.md ├── src/ │ ├── config/ │ │ ├── config.dev.ts │ │ ├── config.local.ts │ │ ├── config.prod.ts │ │ └── index.ts │ ├── dispatch.ts │ ├── helpers/ │ │ ├── dedent.ts │ │ └── pandoc.ts │ ├── models/ │ │ ├── bo/ │ │ │ ├── defaultVal.ts │ │ │ ├── historyLog.ts │ │ │ ├── interface.ts │ │ │ ├── logger.ts │ │ │ ├── module.ts │ │ │ ├── notification.ts │ │ │ ├── organization.ts │ │ │ ├── organizationsMembers.ts │ │ │ ├── property.ts │ │ │ ├── repositoriesCollaborators.ts │ │ │ ├── repositoriesMembers.ts │ │ │ ├── repository.ts │ │ │ └── user.ts │ │ ├── helper.ts │ │ ├── index.ts │ │ ├── sequelize.ts │ │ └── util/ │ │ ├── helper.ts │ │ └── queryInclude.ts │ ├── routes/ │ │ ├── account.ts │ │ ├── analytics.ts │ │ ├── base.ts │ │ ├── counter.ts │ │ ├── export.ts │ │ ├── index.ts │ │ ├── migration.ts │ │ ├── mock.ts │ │ ├── organization.ts │ │ ├── repository.ts │ │ ├── router.ts │ │ └── utils/ │ │ ├── access.ts │ │ ├── const.ts │ │ ├── helper.ts │ │ ├── pagination.ts │ │ ├── tree.ts │ │ └── url.ts │ ├── scripts/ │ │ ├── app.ts │ │ ├── dev.ts │ │ ├── init/ │ │ │ ├── bo.ts │ │ │ ├── delos.ts │ │ │ └── index.ts │ │ ├── initSchema.ts │ │ ├── openChrome.applescript │ │ ├── rap2_delos.sql │ │ ├── setToken.ts │ │ ├── updateSchema.ts │ │ └── worker.ts │ ├── service/ │ │ ├── export/ │ │ │ ├── docx.ts │ │ │ ├── markdown.ts │ │ │ ├── pdf.ts │ │ │ └── postman.ts │ │ ├── mail.ts │ │ ├── migrate.ts │ │ ├── mock.ts │ │ ├── organization.ts │ │ ├── redis.ts │ │ ├── repository.ts │ │ ├── task.ts │ │ └── utils.ts │ └── types/ │ ├── custom-typings.d.ts │ ├── index.d.ts │ └── postman.d.ts ├── test/ │ ├── helper.js │ ├── index.js │ ├── test.account.js │ ├── test.counter.js │ ├── test.interface.js │ ├── test.js │ ├── test.mock.js │ ├── test.module.js │ ├── test.organization.js │ ├── test.property.js │ └── test.repository.js ├── tsconfig.json └── tslint.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .dockerignore ================================================ # See https://help.github.com/ignore-files/ for more about ignoring files. # dependencies /node_modules # testing /coverage # misc .DS_Store .env npm-debug.log* yarn-debug.log* yarn-error.log* # css src/**/*.css build build.zip ================================================ FILE: .github/ISSUE_TEMPLATE/---------.md ================================================ --- name: 产品功能需求及建议 about: 为RAP2提供新功能的建议 --- **您提出的功能是否和您遇到的问题有关,请描述该问题** **您是否有建议的实现方案** **其它帮助我们理解您需求的描述、截图** ================================================ FILE: .github/ISSUE_TEMPLATE/bug--.md ================================================ --- name: Bug反馈 about: 为了更快速的定位您的问题,请提供详细的BUG描述。 --- **BUG描述** **复现步骤** **期望结果** **实际结果** **截图** **环境** * 是否是自建服务器?如果为自建,请提供操作系统版本 * 如果是前端错误,请提供浏览器版本 * 其它可能帮助我们排查问题的环境信息 **附加信息** ================================================ FILE: .gitignore ================================================ .nyc_output /dist /bin .DS_Store node_modules bower_components coverage npm-debug.log tmp package-lock.json dump.rdb /docker/mysql/volume .idea ================================================ FILE: .jshintrc ================================================ { // JSHint Default Configuration File (as on JSHint website) // See http://jshint.com/docs/ for more details "maxerr" : 50, // {int} Maximum error before stopping // Enforcing "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) "camelcase" : false, // true: Identifiers must be in camelCase "curly" : false, // true: Require {} for every new block or scope "eqeqeq" : true, // true: Require triple equals (===) for comparison "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() "freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. "immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` "latedef" : false, // true: Require variables/functions to be defined before being used "newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()` "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee` "noempty" : true, // true: Prohibit use of empty blocks "nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters. "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment) "plusplus" : false, // true: Prohibit use of `++` and `--` "quotmark" : false, // Quotation mark consistency: // false : do nothing (default) // true : ensure whatever is used is consistent // "single" : require single quotes // "double" : require double quotes "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) "unused" : true, // Unused variables: // true : all variables, last function parameter // "vars" : all variables only // "strict" : all variables, all function parameters "strict" : true, // true: Requires all functions run in ES5 Strict Mode "maxparams" : false, // {int} Max number of formal params allowed per function "maxdepth" : false, // {int} Max depth of nested blocks (within functions) "maxstatements" : false, // {int} Max number statements per function "maxcomplexity" : false, // {int} Max cyclomatic complexity per function "maxlen" : false, // {int} Max number of characters per line "varstmt" : false, // true: Disallow any var statements. Only `let` and `const` are allowed. // Relaxing "asi" : true, // true: Tolerate Automatic Semicolon Insertion (no semicolons) "boss" : false, // true: Tolerate assignments where comparisons would be expected "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. "eqnull" : false, // true: Tolerate use of `== null` "esversion" : 6, // {int} Specify the ECMAScript version to which the code must adhere. "moz" : true, // true: Allow Mozilla specific syntax (extends and overrides esnext features) "esnext" : true, // (ex: `for each`, multiple try/catch, function expression…) "evil" : false, // true: Tolerate use of `eval` and `new Function()` "expr" : true, // true: Tolerate `ExpressionStatement` as Programs "funcscope" : false, // true: Tolerate defining variables inside control statements "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') "iterator" : false, // true: Tolerate using the `__iterator__` property "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block "laxbreak" : false, // true: Tolerate possibly unsafe line breakings "laxcomma" : false, // true: Tolerate comma-first style coding "loopfunc" : false, // true: Tolerate functions being defined in loops "multistr" : false, // true: Tolerate multi-line strings "noyield" : false, // true: Tolerate generator functions with no yield statement in them. "notypeof" : false, // true: Tolerate invalid typeof operator values "proto" : false, // true: Tolerate using the `__proto__` property "scripturl" : false, // true: Tolerate script-targeted URLs "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` "validthis" : false, // true: Tolerate using this in a non-constructor function // Environments "devel" : true, // Development/debugging (alert, confirm, etc) "jquery" : true, // jQuery "node" : true, // Node.js "browser" : true, // Browser // Custom Globals "globals" : {} // additional predefined global variables } ================================================ FILE: .prettierrc ================================================ { "semi": false, "trailingComma": "all", "singleQuote": true, "printWidth": 100, "tabWidth": 2 } ================================================ FILE: .travis.yml ================================================ language: node_js services: - mysql - redis-server cache: directories: - node_modules - $HOME/.npm notifications: email: false node_js: - '10.1.0' before_install: - npm i -g npm@^5.5.1 - mysql -e 'CREATE DATABASE IF NOT EXISTS RAP2_DELOS_APP DEFAULT CHARSET utf8 COLLATE utf8_general_ci' script: - npm install - npm run build - npm run create-db - npm run test - npm run check after_success: ================================================ FILE: .vscode/launch.json ================================================ { // 使用 IntelliSense 以学习相关的 Node.js 调试属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "node", "request": "attach", "name": "Attach by Process ID", "processId": "${command:PickProcess}", "protocol": "inspector" } ] } ================================================ FILE: APP-META/docker-config/environment/cai/conf/nginx-proxy.conf ================================================ server { listen 80 default_server; server_name www.taobao.com; location / { proxy_pass http://127.0.0.1:6001; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } error_page 400 403 405 408 410 411 412 413 414 415 /error.html; error_page 501 502 503 506 /error.html; error_page 404 /404.json; error_page 500 /500.json; } server { listen 80; server_name status.taobao.com; tmd off; location = /nginx_status { stub_status on; } } ================================================ FILE: Dockerfile ================================================ # BUILDING FROM node:lts-alpine AS builder # base on work of llitfkitfk@gmail.com LABEL maintainer="chibing.fy@alibaba-inc.com" WORKDIR /app # cache dependencies COPY package.json ./ # 在国内打开下面一行加速 #RUN npm config set registry https://registry.npm.taobao.org/ # instal dependencies RUN npm install typescript -g && \ npm install # build COPY . ./ RUN npm run build # RUNNING FROM node:lts-alpine # base on work of llitfkitfk@gmail.com LABEL maintainer="chibing.fy@alibaba-inc.com" # use China mirror of: https://github.com/jgm/pandoc/releases/download/2.7.3/pandoc-2.7.3-linux.tar.gz RUN wget http://rap2-taobao-org.oss-cn-beijing.aliyuncs.com/pandoc-2.7.3-linux.tar.gz && \ tar -xf pandoc-2.7.3-linux.tar.gz && \ cp pandoc-2.7.3/bin/* /usr/bin/ && \ pandoc -v && \ rm -rf pandoc-2.7.3-linux.tar.gz pandoc-2.7.3 WORKDIR /app COPY --from=builder /app/public . COPY --from=builder /app/dist . COPY --from=builder /app/node_modules ./node_modules ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2018 THX Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # RAP2-DELOS 开源社区版本 (后端 API 服务器) **尊敬的用户:** 由于近期安全审查发现数据风险严重隐患,经慎重评估,我们决定对 rap2.taobao.org 官方体验系统进行下线处理。 > [!WARNING] > **下线时间:2025年11月30日 24:00** 请各位用户在此之前完成以下操作: - 导出所需的 Mock 数据和配置 - 私有化搭建 rap2 系统到自己的服务器 - 迁移相关数据到自己的系统 - 更新项目中的接口调用地址 **给您带来的不便,敬请谅解。** > 阿里妈妈 THX 团队新项目 GoGoCode:https://github.com/thx/gogocode 给批量修改项目代码减轻痛苦! RAP2 是在 RAP1 基础上重做的新项目,它能给你提供方便的接口文档管理、Mock、导出等功能,包含两个组件(对应两个 Github Repository)。 - rap2-delos: 后端数据 API 服务器,基于 Koa + MySQL[link](http://github.com/thx/rap2-delos) - rap2-dolores: 前端静态资源,基于 React [link](http://github.com/thx/rap2-dolores) **Rap 官方服务站点,无需安装直接体验: [rap2.taobao.org](http://rap2.taobao.org)** 注意:本工具为开发工具,相关API未做任何XSS等安全验证,请勿在生产环境依赖RAP的任何服务!!! **有急事来官方钉钉群,响应更迅速: 31626736 (二群,一群已满)** 2019-10-31:现已支持 Docker 一键部署,欢迎大家体验&反馈 2019-09-27:更新的用户请注意按照下面指引安装 pandoc 以启用文档导出功能 ## 推荐使用 Docker 快速部署 ### 安装 Docker 国内用户可参考 [https://get.daocloud.io/](https://get.daocloud.io/) 安装 Docker 以及 Docker Compose (Linux 用户需要单独安装),建议按照链接指引配置 Docker Hub 的国内镜像提高加载速度。 ### 配置项目 在任意地方建立目录 rap 把本仓库中的 [docker-compose.yml](https://raw.githubusercontent.com/thx/rap2-delos/master/docker-compose.yml) 放到 rap 目录中 Rap 前端服务的端口号默认为 3000,你可以在 docker-compose.yml 中按照注释自定义 在 rap 目录下执行下面的命令: ```sh # 拉取镜像并启动 docker-compose up -d # 启动后,第一次运行需要手动初始化mysql数据库 # ⚠️注意: 只有第一次该这样做 docker-compose exec delos node scripts/init # 部署成功后 访问 http://localhost:3000 # 前端(可自定义端口号) http://localhost:38080 # 后端 # 如果访问不了可能是数据库没有链接上,关闭 rap 服务 docker-compose down # 再重新运行 docker-compose up -d # 如果 Sequelize 报错可能是数据库表发生了变化,运行下面命令同步 docker-compose exec delos node scripts/updateSchema ``` **⚠️注意:第一次运行后 rap 目录下会被自动创建一个 docker 目录,里面存有 rap 的数据库数据,可千万不要删除。** ### 镜像升级 Rap 经常会进行 bugfix 和功能升级,用 Docker 可以很方便地跟随主项目升级 ```sh # 拉取一下最新的镜像 docker-compose pull # 暂停当前应用 docker-compose down # 重新构建并启动 docker-compose up -d --build # 有时表结构会发生变化,执行下面命令同步 docker-compose exec delos node scripts/updateSchema # 清空不被使用的虚悬镜像 docker image prune -f ``` ## 手动部署 ### 环境要求 - Node.js 8.9.4+ - MySQL 5.7+ - Redis 4.0+ - pandoc 2.73 (供文档生成使用) ### 开发模式 #### 安装 MySQL 和 Redis 服务器 请自行查找搭建方法,mysql/redis 配置在 config.\*.ts 文件中,在不修改任何配置的情况下, redis 会通过默认端口 + 本机即可正常访问,确保 redis-server 打开即可。 注意:修改 cofig 文件后需要重新 `npm run build` 才能生效 #### 安装 pandoc 我们使用 pandoc 来生成 Rap 的离线文档,安装 Pandoc 最通用的办法是在 pandoc 的 [release 页面](https://github.com/jgm/pandoc/releases/tag/2.7.3)下载对应平台的二进制文件安装即可。 其中 linux 版本最好放在`/usr/local/bin/pandoc` 让终端能直接找到,并执行 `chmod +x /usr/local/bin/pandoc` 给调用权限。 测试在命令行执行命令 `pandoc -h` 有响应即可。 #### 启动redis-server ```sh redis-server ``` 后台执行可以使用 nohup 或 pm2,这里推荐使用 pm2,下面命令会安装 pm2,并通过 pm2 来启动 redis 缓存服务 ```bash npm install -g pm2 npm run start:redis ``` #### 先创建创建数据库 ```bash mysql -e 'CREATE DATABASE IF NOT EXISTS RAP2_DELOS_APP DEFAULT CHARSET utf8 COLLATE utf8_general_ci' ``` #### 初始化 ```bash npm install ``` confirm configurations in /config/config.dev.js (used in development mode),确认/config/config.dev.js 中的配置(.dev.js 后缀表示用于开发模式)。 #### 安装 && TypeScript 编译 ```bash npm install -g typescript npm run build ``` #### 初始化数据库表 ```bash npm run create-db ``` #### 执行 mocha 测试用例和 js 代码规范检查 ```bash npm run check ``` #### 启动开发模式的服务器 监视并在发生代码变更时自动重启 ```bash npm run dev ``` ### 生产模式 ```sh # 1. 修改/config/config.prod.js中的服务器配置 # 2. 启动生产模式服务器 npm start ``` ## 社区贡献 - [rap2-javabean 自动从 Rap 接口生成 Java Bean](https://github.com/IndiraFinish/rap2-javabean) - [rap2-generator 把 Java Bean 生成到 Rap](https://github.com/kings1990/rap2-generator) - [yapix 一键生成接口文档, 上传到yapi, rap2, eolinker等](https://github.com/jetplugins/yapix) ## Author - 版权: 阿里妈妈前端团队 - 作者: - RAP2 2017/10 前版本作者为[墨智(@Nuysoft)](https://github.com/nuysoft/), [mockjs](mockjs.com)的作者。 - 2017/10 之后版本开发者 - [霍雍(Bosn)](http://github.com/bosn/),[RAP1](http://github.com/thx/RAP)作者,RAP 最早的创始人。 - [承虎(alvarto)](http://github.com/alvarto/) - [池冰(bigfengyu)](https://github.com/bigfengyu) ### Tech Arch - 前端架构(rap2-dolores) - React / Redux / Saga / Router - Mock.js - SASS / Bootstrap 4 beta - server: nginx - 后端架构(rap2-delos) - Koa - Sequelize - MySQL - Server - server: node ### 旧版本升级 -数据库数据迁移 RAP2 2.4迁移到2.8 由于数据库表有主外键,按以下顺序插入数据 1.Users 2.Organizations 3.Repositories 4.repositories_members(备注:将createdAt、updatedAt两个字段必填去除) 5.organizations_members 6.Modules 7.Interfaces 8.Loggers 9.Properties(备注:将数据scope字段的所有''值替换成'String') default_val和repositories_collaborators表无数据无需处理 ================================================ FILE: database/history/patch-null-type.sql ================================================ ALTER TABLE `Properties` MODIFY COLUMN `type` enum('String','Number','Boolean','Object','Array','Function','RegExp','Null') NOT NULL; ================================================ FILE: database/history/v2.5_change.sql ================================================ ALTER TABLE repositories_collaborators DROP COLUMN createdat ; ALTER TABLE repositories_collaborators DROP COLUMN updatedat ; ALTER TABLE repositories_members DROP COLUMN createdat ; ALTER TABLE repositories_members DROP COLUMN updatedat ; ================================================ FILE: database/history/v2.6_change_20180705.sql ================================================ ALTER TABLE `properties` ADD COLUMN `pos` INT(10) NULL DEFAULT 2; ALTER TABLE `interfaces` ADD COLUMN `status` INT(10) NULL DEFAULT 200; ================================================ FILE: database/history/v2.8.0_token.sql ================================================ # 给 Repositories 表添加 token 列 # 2019-11-11 ALTER TABLE Repositories ADD COLUMN token VARCHAR(32) NULL; ================================================ FILE: database/history/v2018_07_27.sql ================================================ ALTER TABLE Interfaces MODIFY COLUMN `method` VARCHAR(256) NOT NULL; ================================================ FILE: database/history/v2018_08_27_add_property_required.sql ================================================ ALTER TABLE `Properties` ADD COLUMN `required` TINYINT(1) NOT NULL DEFAULT 0; ================================================ FILE: database/history/v2019_09_26_default_val_table.sql ================================================ CREATE TABLE `default_val` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `createdat` datetime NOT NULL COMMENT '创建时间', `updatedat` datetime NOT NULL COMMENT '修改时间', `name` varchar(256) NOT NULL COMMENT '名字', `rule` varchar(512) NOT NULL COMMENT '规则', `value` text NOT NULL COMMENT '值', `repositoryid` bigint unsigned NOT NULL COMMENT 'FK', `deletedat` datetime NOT NULL COMMENT '删除时间', PRIMARY KEY (`id`) ) DEFAULT CHARACTER SET=utf8mb4 COMMENT='默认值'; ================================================ FILE: database/recreate_db.sql ================================================ DROP DATABASE RAP2_DELOS_APP; CREATE DATABASE IF NOT EXISTS RAP2_DELOS_APP DEFAULT CHARSET utf8 COLLATE utf8_general_ci; ================================================ FILE: database/v2018_05_15.sql ================================================ ALTER TABLE Interfaces MODIFY priority BIGINT(11) NOT NULL DEFAULT 1; ALTER TABLE Properties MODIFY priority BIGINT(11) NOT NULL DEFAULT 1; ALTER TABLE Modules MODIFY priority BIGINT(11) NOT NULL DEFAULT 1; ================================================ FILE: database/v2020_07_06_history_log.sql ================================================ CREATE TABLE `history_log` ( `id` int NOT NULL AUTO_INCREMENT, `entityType` int NOT NULL, `entityId` int NOT NULL, `changeLog` text COLLATE utf8mb4_unicode_ci NOT NULL, `relatedJSONData` text COLLATE utf8mb4_unicode_ci, `userId` bigint(11) unsigned NOT NULL, `createdAt` datetime NOT NULL, `updatedAt` datetime NOT NULL, `deletedAt` datetime DEFAULT NULL, CONSTRAINT `hisotry_log_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `Users` (`id`) ON UPDATE CASCADE, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ================================================ FILE: database/v2020_07_21_body_option_save.sql ================================================ ALTER TABLE `interfaces` ADD COLUMN `bodyOption` VARCHAR(255) NULL; ================================================ FILE: database/v2020_07_21_merge_PR.sql ================================================ ALTER TABLE `RAP2_DELOS_APP`.`Properties` MODIFY COLUMN `scope` enum('request','response','script') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'response' COMMENT 'property owner' AFTER `id`; ================================================ FILE: docker-compose.yml ================================================ # mail@dongguochao.com # llitfkitfk@gmail.com # chibing.fy@alibaba-inc.com version: "3" services: # frontend dolores: image: rapteam/rap2-dolores:latest ports: #冒号前可以自定义前端端口号,冒号后不要动 - 3000:38081 # backend delos: image: rapteam/rap2-delos:latest ports: # 这里的配置不要改哦 - 38080:38080 environment: - SERVE_PORT=38080 # if you have your own mysql, config it here, and disable the 'mysql' config blow - MYSQL_URL=mysql # links will maintain /etc/hosts, just use 'container_name' - MYSQL_PORT=3306 - MYSQL_USERNAME=root - MYSQL_PASSWD= - MYSQL_SCHEMA=rap2 # redis config - REDIS_URL=redis - REDIS_PORT=6379 # production / development - NODE_ENV=production ###### 'sleep 30 && node scripts/init' will drop the tables ###### RUN ONLY ONCE THEN REMOVE 'sleep 30 && node scripts/init' command: /bin/sh -c 'node dispatch.js' # init the databases # command: sleep 30 && node scripts/init && node dispatch.js # without init # command: node dispatch.js depends_on: - redis - mysql redis: image: redis:4 # disable this if you have your own mysql mysql: image: mysql:5.7 # expose 33306 to client (navicat) #ports: # - 33306:3306 volumes: # change './docker/mysql/volume' to your own path # WARNING: without this line, your data will be lost. - "./docker/mysql/volume:/var/lib/mysql" command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --init-connect='SET NAMES utf8mb4;' --innodb-flush-log-at-trx-commit=0 environment: MYSQL_ALLOW_EMPTY_PASSWORD: "true" MYSQL_DATABASE: "rap2" MYSQL_USER: "root" MYSQL_PASSWORD: "" ================================================ FILE: docs/Schedule.md ================================================ ## 2017.05.15~05.26 计划 1. RAP1 数据迁移测试 2. 发布线上服务,自测在项目中的体验 3. 编写公开 API 的文档(注释) 4. 其他参与的同学参照 v2.1 需求和约定 http://gitlab.alibaba-inc.com/thx/rap2-delos/blob/master/docs/Design.md,和仓库中的 TODO 任务注释 5. 陪产假期间在家办公,业务支持直接电话我 > TODO 消消乐 ## 2017.06.12~06.16 部署 **线上 RAP1 数据迁移基本完成,正在测试迁移数据。** ### 服务端 rap2-delos 1. 正式发布部署和迁移 ### 前端 rap2-dolores 1. 正式发布部署和测试 ## 2017.06.05~06.09 部署 **v2.1 开发完成,部署基本完成。** ### 服务端 rap2-delos 1. 正式发布部署 1. 接入 KeyCenter 2. 优化 分离拥有的仓库和加入的仓库 3. 优化 分离拥有的组织和加入的组织 4. 新增 fetch 拦截插件 ### 前端 rap2-dolores 1. 正式发布部署 1. 接入 线上统一登录 2. 接入 线上域名 2. 协同 服务端的『分离拥有的仓库和加入的仓库』 3. 协同 服务端的『分离拥有的组织和加入的组织』 4. 新增 支持查看其他用户的仓库 5. 其他零散代码、视觉、交互优化 1. 视觉 增加拥有者 icon 2. 交互 首页 新用户显示引导文案『新建仓库』 ## 2017.05.31~06.02 ### 服务端 rap2-delos **2.1 开发完成** 1. 修复 数字属性、布尔属性、数组属性的解析和初始化 2. 修复 当前端发送 JSONP 请求,并且响应内容是字符串时,字符串响应再次执行 JSON.stringify(),导致响应内容格式错误 3. 增加 JSONSchema 接口 /app/mock/schema/:interfaceId 4. 完善 RAP1 迁移脚本 1. 修正 类型 array => Array 2. 修正 模拟值 @mock=function(){} => Function 3. 修正 顺序值 $order => Array|+1: [] 5. 完善 仓库接口测试页面,支持动态仓库 id 6. 新增 支持虚拟属性 __root__ 7. 正式发布部署(未完) 1. 调整 Dockerfile 配置 2. 接入 VIPServer 3. 数据库上线 4. 接入 KeyCenter(未完) ### 前端 rap2-dolores 1. 增加 生成规则帮助链接 2. 增加 访问不存在仓库的编辑器时提示 404 3. 协同 后端的『修复 数字属性、布尔属性、数组属性的解析和初始化』 4. 增加 公开接口 5. 代码优化 1. 删除 遗留的无效注释 2. 删除 不再使用的 Fetching 组件 3. 增加 RModal 重定位截流 4. 完善 登陆时只使用 email 和 password,丢弃其他属性(非 BUS SSO 场景) 5. 删除 遗留的 corporation、product、grouping 代码 6. 完善 补全团队列表的 propTypes 7. 修复 不解析原始类型的初始值 8. 部署 暂时访问 daily 环境,上线后再恢复 6. 视觉优化 1. 增加 自动获得焦点:组织、仓库、模块、接口、属性、导入器、注册、登陆 2. 视觉 润色首页日志格式 3. 视觉 仓库列表和团队列表的最小高度为 10rem,增大没有找到匹配数据时的字号 4. 恢复 团队成员头像 5. 增加 协同仓库的帮助信息 6. 增加 组件 Popover 支持自定义 width 7. 视觉 组件 MembersInput 默认底部外边距 10px 8. 视觉 润色表单 input 的宽度 9. 视觉 移除 .rapfont,统一改用 react-icons 10. 视觉 润色接口编辑器 11. 新增 仓库编辑器初始加载时显示动画 7. 修复 属性类型 Number 并且初始值为 '' 时,被解析为随机字符串 8. 完善 删除团队、仓库、模块、接口时的确认提示 9. 新增 导入器支持格式化输入的 JSON 10. 修复 导入器重复调用 handleAddMemoryProperty() 丢失临时属性 ## 2017.05.22~05.26 ### 服务端 rap2-delos 1. 支持 迁移 RAP1 数据(开发和本地调试完成,待线上验证) 2. 完善 jQuery 插件、Mock 插件、插件文档 public/libs/README.md 3. 增加 检测和提示仓库中的重复接口 4. 修复 初始化新模块时创建了重复的示例接口 5. 支持 仓库协同(即 RAP1 的项目路由,用于指定与哪些项目共享 mock 数据) 6. 修复 creatorId 必须是当前登录用户,不需要前端传入 7. 修复 测试用例创建的临时仓库没有及时移除 8. 重构 IDB 结构设计 1. 清理 历史遗留表 user、repository、module、interface、property、organization、organization_members、logger、notification 2. 新建 仓库协同表 repositories_collaborators 3. 新建 账户通知表 notifications 4. 新增 字段 organizations.visibility,用于支持私有团队(待前端支持) 5. 新增 字段 repositories.visibility,用于支持私有仓库(待前端支持) 9. 调整 接口 /app/get 的位置,从 routes/mock.js 分散到 routes/account|organization|repository.js 10. 修复 当创建者或拥有者已经不存在时,仓库列表和组织列表的总记录数错误 11. 支持 转移团队 /organization/transfer(待前端支持) 12. 支持 转移仓库 /repository/transfer(待前端支持) 13. 优化 获取单个仓库完整数据的性能 14. 完善 示例接口初始化时填充更多的 Mock 规则示例 ### 前端 rap2-dolores 1. 修复 /app/plugin/:repositories 接收到无效 repositoryId 时报错 2. 调整 导航栏,我的仓库=>仓库,团队仓库=>组织 3. 增加 仓库/全部仓库 4. 增加 检测和提示仓库中的重复接口 5. 修复 『我创建和加入的团队』不应该有分页 6. 协同 后端的『仓库协同』 7. 视觉 润色仓库编辑器 8. 修复 仓库编辑权限的判断逻辑 ## 2017.05.15~05.19 ### 服务端 rap2-delos 1. 修复 团队测试用例的用户 id 不存在 2. 修复 接口 /repository/joined 不排除自己拥有的项目 3. 完善 模拟数据接口 /app/mock/:repository/:method/:url 1. 支持响应多个仓库的数据 2. 支持不同的 http method 3. 完善相应的测试用例 4. 支持过滤重复仓库 id 5. 完善注释内容,增加关于直接通过 interface id 获取模板和数据的说明 6. 增加请求属性和响应属性的 Mock 模板 4. 重构 IDB 结构设计,为迁移 RAP1 数据做准备 1. 清理历史遗留表 corporation、product、grouping、project、page、action 2. 清理历史遗留字段 property.template、property.page、property.project、module.project 3. 利用 Sequelize 重构所有表之间的关联关系(代码更精简) 4. 修改所有外键的命名,风格统一为 modelId(减少歧义) 5. 调整所有涉及的模型、路由、测试用例和初始数据 5. 清理 历史 API 示例 HTML(已经全部改为测试用例) 6. 新增 前端插件适配 jQuery、Mock(待测试) 7. 完善 SQL 日志格式 8. 完善 生成数据模板时的异常日志格式 9. 完善 测试用例:用户、组织、仓库 ### 前端 rap2-dolores 1. 新增 测试器 Tester(未完) 2. 引入 react-icons,因为 iconfont 的质量参差不齐,在 React 中使用不方便 3. 完善 仓库列表、组织列表的视觉:废弃 table 布局,类型文案改为