├── .gitignore ├── LICENSE ├── MIT-License ├── Makefile ├── README.md ├── doc ├── api.html ├── assets │ ├── base.css │ ├── bootstrap │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap.css │ │ │ └── bootstrap.min.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ └── glyphicons-halflings-regular.woff │ │ └── js │ │ │ ├── bootstrap.js │ │ │ └── bootstrap.min.js │ ├── bs-docs-masthead-pattern.png │ ├── jquery-1.8.2.min.js │ └── prettify.js └── index.html ├── index.js ├── lib ├── api_chatroom.js ├── api_common.js ├── api_group.js ├── api_history.js ├── api_message.js ├── api_user.js ├── api_wordfilter.js └── util.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | 29 | *.sublime* 30 | 31 | doc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Nick Ma 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /MIT-License: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Jackson Tian 2 | http://weibo.com/shyvo 3 | 4 | The MIT License 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | TESTS = test/*.js 2 | REPORTER = spec 3 | TIMEOUT = 20000 4 | ISTANBUL = ./node_modules/.bin/istanbul 5 | MOCHA = ./node_modules/mocha/bin/_mocha 6 | COVERALLS = ./node_modules/coveralls/bin/coveralls.js 7 | 8 | test: 9 | @NODE_ENV=test $(MOCHA) -R $(REPORTER) -t $(TIMEOUT) \ 10 | $(MOCHA_OPTS) \ 11 | $(TESTS) 12 | 13 | test-cov: 14 | @$(ISTANBUL) cover --report html $(MOCHA) -- -t $(TIMEOUT) -R spec $(TESTS) 15 | 16 | test-coveralls: 17 | @$(ISTANBUL) cover --report lcovonly $(MOCHA) -- -t $(TIMEOUT) -R spec $(TESTS) 18 | @echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID) 19 | @cat ./coverage/lcov.info | $(COVERALLS) && rm -rf ./coverage 20 | 21 | test-all: test test-coveralls 22 | 23 | dox: 24 | @doxmate build 25 | 26 | .PHONY: test 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | RongCloud Server API(ES6版) 2 | =========================== 3 | 融云服务器端API。 4 | 5 | 6 | ## 功能列表 7 | - 用户服务 8 | - 群组服务 9 | - 敏感词服务 10 | - 聊天室服务 11 | - 历史消息服务 12 | - 发送消息(文本、图片、语音、视频、音乐、图文) 13 | 14 | ## 更新历史 15 | - 1.1.0 增加“加入聊天室”接口,更改API域名地址。 16 | - 1.0.1 修复若干BUG。 17 | - 1.0.0 第一版发布。 18 | 19 | 详细参见[API文档](http://www.rongcloud.cn/docs/server.html) 20 | 21 | ## Installation 22 | 23 | ```sh 24 | $ npm install co-rongcloud-api 25 | ``` 26 | 27 | ## Usage 28 | 29 | ```js 30 | var RongAPI = require('co-rongcloud-api'); 31 | 32 | var api = new RongAPI(appid, appsecret); 33 | var token = yield* api.getToken('nick-ma'); 34 | ``` 35 | 36 | ## Make Document 37 | 38 | ```sh 39 | npm install doxmate -g 40 | make dox 41 | ``` 42 | 43 | 文档在 ./doc/index.html 处。 44 | 45 | ## License 46 | The MIT license. 47 | 48 | -------------------------------------------------------------------------------- /doc/api.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | co-rongcloud-api Documentation 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 39 |
40 |
41 |

co-rongcloud-api Version: 1.0.1 By @[object Object]

42 |

43 | 融云服务端Node库API,ES6版本 44 |

45 |
46 |
47 | 48 |
49 |
50 |
51 | 330 | 331 |
332 |
333 | 334 |
335 |

api_chatroom: API索引

336 | 359 |
360 | 361 | 362 |

363 | chatroomCreate 364 |

365 | 366 | 367 |

创建聊天室
http://www.rongcloud.cn/docs/server.html#创建聊天室_方法
举例:

// 创建聊天室
 368 | var chatroomData = {
 369 |     'chatroom[0001]': '1号聊天室',
 370 |     'chatroom[0002]': '2号聊天室',
 371 |     'chatroom[0003]': '3号聊天室',
 372 |     'chatroom[0004]': '4号聊天室',
 373 | }
 374 | var flag = yield api.chatroomCreate(chatroomData);
 375 | if (flag){
 376 |   // 操作成功
 377 | } else {
 378 |   // 操作失败
 379 | }
 380 | 
381 | 382 |

方法签名

383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 |
方法exports.chatroomCreate()
参数chatroomData(Array)

要创建或者加入的聊天室的数据结构(必填)

400 | 401 | 402 |

403 | chatroomJoin 404 |

405 | 406 | 407 |

加入聊天室
http://www.rongcloud.cn/docs/server.html#加入聊天室_方法
举例:
var chatroomData = {
userId: ['1','2','3','4'], // 最多不超过 50 个 (必传)
chatroomId: '0001' // 要加入的聊天室 Id。(必传)
}
var flag = yield api.chatroomJoin(chatroomData);
if (flag) {
// 操作成功
} else {
// 操作失败
}

408 | 409 |

方法签名

410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 |
方法exports.chatroomJoin()
参数chatroomData(Object)

要加入的聊天室的数据结构(必填)

427 | 428 | 429 |

430 | chatroomDestroy 431 |

432 | 433 | 434 |

销毁聊天室
http://www.rongcloud.cn/docs/server.html#销毁聊天室_方法
举例:

// 销毁聊天室
 435 | var chatroomId=['0001','0002','0003','0004'];
 436 | var flag = yield api.chatroomDestroy(chatroomId);
 437 | if (flag){
 438 |   // 操作成功
 439 | } else {
 440 |   // 操作失败
 441 | }
 442 | 
443 | 444 |

方法签名

445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 |
方法exports.chatroomDestroy()
参数chatroomId(Array)

要销毁的聊天室的数据结构(必填)

462 | 463 | 464 |

465 | chatroomQuery 466 |

467 | 468 | 469 |

查询聊天室信息
http://www.rongcloud.cn/docs/server.html#查询聊天室信息_方法
举例:

// 查询聊天室信息
 470 | var chatroomId=['0001','0002'];
 471 | var chatRooms = yield api.chatroomQuery(chatroomId);
 472 | if (chatRooms){
 473 |   // 操作成功
 474 | } else {
 475 |   // 操作失败
 476 | }
 477 | 
478 | 479 |

方法签名

480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 |
方法exports.chatroomQuery()
参数chatroomId(Array)

要查询的聊天室(必填)

497 | 498 | 499 |

500 | chatroomUserQuery 501 |

502 | 503 | 504 |

查询聊天室内用户
http://www.rongcloud.cn/docs/server.html#查询聊天室内用户_方法
举例:

// 查询聊天室内用户
 505 | var chatroomId='0001';
 506 | var users = yield api.chatroomUserQuery(chatroomId);
 507 | if (users){
 508 |   // 操作成功
 509 | } else {
 510 |   // 操作失败
 511 | }
 512 | 
513 | 514 |

方法签名

515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 |
方法exports.chatroomUserQuery()
参数chatroomId(String)

要查询的聊天室(必填)

532 | 533 |
534 | 535 | 536 |
537 |

api_common: API索引

538 | 561 |
562 | 563 | 564 |

565 | API 566 |

567 | 568 | 569 |

API构造函数
Examples:

// 创建api实例
 570 | var api = new API("appkey", "appsecret");
 571 | 
572 | 573 |

方法签名

574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 |
函数API()
参数appKey(String)

融信应用的app key

参数appSecret(String)

融信应用的app secret

598 | 599 | 600 |

601 | getSignature 602 |

603 | 604 | 605 |

计算签名。单独使用可以用于验证各种回调接口的签名。
Examples:

// 计算签名
 606 | var shasum = api.getSignature("nonce", "timestamp");
 607 | 
608 | 609 |

方法签名

610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 |
方法API.prototype.getSignature()
参数nonce(String)
参数timestamp(String)
634 | 635 | 636 |

637 | setOpts 638 |

639 | 640 | 641 |

设置HTTP请求的参数
Examples:

// 设定超时为15秒
 642 | var token = api.setOpts({
 643 |    timeout: 15000
 644 | });
 645 | 
646 | 647 |

方法签名

648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 |
方法API.prototype.setOpts()
参数obj(Object)

请求的配置参数

665 | 666 | 667 |

668 | getToken 669 |

670 | 671 | 672 |

换取用户的token
Examples:

// 获取用户的token
 673 | var token = yield api.getToken(userid, <name>, <portrait_url>);
 674 | 
675 | 676 |

方法签名

677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 |
方法API.prototype.getToken()
参数userid(String)

用户的userid(必填)

参数name(String)

姓名(选填)

参数portrait_url(String)

头像url(选填)

708 | 709 | 710 |

711 | mixin 712 |

713 | 714 | 715 |

用于支持对象合并。将对象合并到API.prototype上,使得能够支持扩展
Examples:

// 加入用户管理模块
 716 | API.mixin(require('./lib/api_user'));
 717 | 
718 | 719 |

方法签名

720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 |
方法API.mixin()
参数obj(Object)

要合并的对象

737 | 738 |
739 | 740 | 741 |
742 |

api_group: API索引

743 |
    744 | 745 |
  • 746 | extend 747 |
  • 748 | 749 |
750 |
751 | 752 | 753 |

754 | extend 755 |

756 | 757 | 758 | 759 | 760 |

方法签名

761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 |
声明extend
771 | 772 |
773 | 774 | 775 |
776 |

api_history: API索引

777 | 788 |
789 | 790 | 791 |

792 | historyFetch 793 |

794 | 795 | 796 |

消息历史记录下载地址获取
http://www.rongcloud.cn/docs/server.html#消息历史记录下载地址获取_方法
举例:

// 消息历史记录下载地址获取
 797 | var date='2014010101';
 798 | var chat_data = yield api.historyFetch(date);
 799 | if (chat_data){
 800 |   // 操作成功
 801 |   chat_data.url
 802 | } else {
 803 |   // 操作失败
 804 | }
 805 | 
806 | 807 |

方法签名

808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 |
方法exports.historyFetch()
参数date(String)

指定北京时间某天某小时,格式为2014010101,表示:2014年1月1日凌晨1点。(必填)

825 | 826 | 827 |

828 | historyDelete 829 |

830 | 831 | 832 |

消息历史记录删除
http://www.rongcloud.cn/docs/server.html#消息历史记录删除_方法
举例:

// 消息历史记录删除
 833 | var date='2014010101';
 834 | var flag = yield api.historyDelete(date);
 835 | if (flag){
 836 |   // 操作成功
 837 | } else {
 838 |   // 操作失败
 839 | }
 840 | 
841 | 842 |

方法签名

843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 |
方法exports.historyDelete()
参数date(String)

指定北京时间某天某小时,格式为2014010101,表示:2014年1月1日凌晨1点。(必填)

860 | 861 |
862 | 863 | 864 |
865 |

api_message: API索引

866 |
    867 | 868 |
  • 869 | extend 870 |
  • 871 | 872 |
873 |
874 | 875 | 876 |

877 | extend 878 |

879 | 880 | 881 | 882 | 883 |

方法签名

884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 |
声明extend
894 | 895 |
896 | 897 | 898 |
899 |

api_user: API索引

900 | 935 |
936 | 937 | 938 |

939 | refresh 940 |

941 | 942 | 943 |

刷新用户信息
http://www.rongcloud.cn/docs/server.html#刷新用户信息_方法
举例:

// 刷新用户信息
 944 | var flag = yield api.refresh(userid, <name>, <portrait_url>);
 945 | if (flag){
 946 |   // 操作成功
 947 | } else {
 948 |   // 操作失败
 949 | }
 950 | 
951 | 952 |

方法签名

953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 |
方法exports.refresh()
参数userid(String)

用户的userid(必填)

参数name(String)

姓名(选填)

参数portrait_url(String)

头像url(选填)

984 | 985 | 986 |

987 | checkOnline 988 |

989 | 990 | 991 |

检测用户是否在线
http://www.rongcloud.cn/docs/server.html#检查用户在线状态_方法
举例:

// 检测用户是否在线
 992 | var flag = yield api.checkOnline(userid);
 993 | if (flag){
 994 |   // 在线
 995 | } else {
 996 |   // 不在线
 997 | }
 998 | 
999 | 1000 |

方法签名

1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 |
方法exports.checkOnline()
参数userid(String)

用户的userid(必填)

1018 | 1019 | 1020 |

1021 | userBlock 1022 |

1023 | 1024 | 1025 |

封禁用户
http://www.rongcloud.cn/docs/server.html#封禁用户_方法
举例:

// 封禁用户
1026 | var flag = yield api.userBlock(userid, minute);
1027 | if (flag){
1028 |   // 操作成功
1029 | } else {
1030 |   // 操作失败
1031 | }
1032 | 
1033 | 1034 |

方法签名

1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | 1055 | 1056 | 1057 | 1058 |
方法exports.userBlock()
参数userid(String)

用户的userid(必填)

参数minute(String)

封禁时长,单位为分钟,最大值为43200分钟。(必填)

1059 | 1060 | 1061 |

1062 | userUnblock 1063 |

1064 | 1065 | 1066 |

解除封禁用户
http://www.rongcloud.cn/docs/server.html#解除封禁用户_方法
举例:

// 解除封禁用户
1067 | var flag = yield api.userUnblock(userid);
1068 | if (flag){
1069 |   // 操作成功
1070 | } else {
1071 |   // 操作失败
1072 | }
1073 | 
1074 | 1075 |

方法签名

1076 | 1077 | 1078 | 1079 | 1080 | 1081 | 1082 | 1083 | 1084 | 1085 | 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1092 |
方法exports.userUnblock()
参数userid(String)

用户的userid(必填)

1093 | 1094 | 1095 |

1096 | userBlockQuery 1097 |

1098 | 1099 | 1100 |

获取被封禁用户
http://www.rongcloud.cn/docs/server.html#获取被封禁用户_方法
举例:

// 获取被封禁用户
1101 | var users = yield api.userBlockQuery(userid);
1102 | if (users){
1103 |   // 操作成功,返回被封禁的用户清单
1104 | } else {
1105 |   // 操作失败
1106 | }
1107 | 
1108 | 1109 |

方法签名

1110 | 1111 | 1112 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | 1125 | 1126 |
方法exports.userBlockQuery()
参数userid(String)

用户的userid(必填)

1127 | 1128 | 1129 |

1130 | userBlacklistAdd 1131 |

1132 | 1133 | 1134 |

添加用户到黑名单
http://www.rongcloud.cn/docs/server.html#添加用户到黑名单_方法
举例:

// 添加用户到黑名单
1135 | var flag = yield api.userBlacklistAdd(userid, blackUserId);
1136 | if (flag){
1137 |   // 操作成功
1138 | } else {
1139 |   // 操作失败
1140 | }
1141 | 
1142 | 1143 |

方法签名

1144 | 1145 | 1146 | 1147 | 1148 | 1149 | 1150 | 1151 | 1152 | 1153 | 1154 | 1155 | 1156 | 1157 | 1158 | 1159 | 1160 | 1161 | 1162 | 1163 | 1164 | 1165 | 1166 | 1167 |
方法exports.userBlacklistAdd()
参数userid(String)

用户的userid(必填)

参数blackUserId(String)

被加黑的用户Id。(必填)

1168 | 1169 | 1170 |

1171 | userBlacklistRemove 1172 |

1173 | 1174 | 1175 |

从黑名单中移除用户
http://www.rongcloud.cn/docs/server.html#从黑名单中移除用户_方法
举例:

// 从黑名单中移除用户
1176 | var flag = yield api.userBlacklistRemove(userid, blackUserId);
1177 | if (flag){
1178 |   // 操作成功
1179 | } else {
1180 |   // 操作失败
1181 | }
1182 | 
1183 | 1184 |

方法签名

1185 | 1186 | 1187 | 1188 | 1189 | 1190 | 1191 | 1192 | 1193 | 1194 | 1195 | 1196 | 1197 | 1198 | 1199 | 1200 | 1201 | 1202 | 1203 | 1204 | 1205 | 1206 | 1207 | 1208 |
方法exports.userBlacklistRemove()
参数userid(String)

用户的userid(必填)

参数blackUserId(String)

被移除的用户Id。(必填)

1209 | 1210 | 1211 |

1212 | userBlacklistQuery 1213 |

1214 | 1215 | 1216 |

获取某用户的黑名单列表
http://www.rongcloud.cn/docs/server.html#获取某用户的黑名单列表_方法
举例:

// 获取某用户的黑名单列表
1217 | var users = yield api.userBlacklistQuery(userid);
1218 | if (users){
1219 |   // 操作成功,返回黑名单列表的用户清单
1220 | } else {
1221 |   // 操作失败
1222 | }
1223 | 
1224 | 1225 |

方法签名

1226 | 1227 | 1228 | 1229 | 1230 | 1231 | 1232 | 1233 | 1234 | 1235 | 1236 | 1237 | 1238 | 1239 | 1240 | 1241 | 1242 |
方法exports.userBlacklistQuery()
参数userid(String)

用户的userid(必填)

1243 | 1244 |
1245 | 1246 | 1247 |
1248 |

api_wordfilter: API索引

1249 | 1264 |
1265 | 1266 | 1267 |

1268 | wordfilterAdd 1269 |

1270 | 1271 | 1272 |

添加敏感词
http://www.rongcloud.cn/docs/server.html#添加敏感词_方法
举例:

// 添加敏感词
1273 | var flag = yield api.wordfilterAdd(word);
1274 | if (flag){
1275 |   // 操作成功
1276 | } else {
1277 |   // 操作失败
1278 | }
1279 | 
1280 | 1281 |

方法签名

1282 | 1283 | 1284 | 1285 | 1286 | 1287 | 1288 | 1289 | 1290 | 1291 | 1292 | 1293 | 1294 | 1295 | 1296 | 1297 | 1298 |
方法exports.wordfilterAdd()
参数word(String)

敏感词,最长不超过 32 个字符。(必填)

1299 | 1300 | 1301 |

1302 | wordfilterDelete 1303 |

1304 | 1305 | 1306 |

移除敏感词
http://www.rongcloud.cn/docs/server.html#移除敏感词_方法
举例:

// 移除敏感词
1307 | var flag = yield api.wordfilterDelete(word);
1308 | if (flag){
1309 |   // 操作成功
1310 | } else {
1311 |   // 操作失败
1312 | }
1313 | 
1314 | 1315 |

方法签名

1316 | 1317 | 1318 | 1319 | 1320 | 1321 | 1322 | 1323 | 1324 | 1325 | 1326 | 1327 | 1328 | 1329 | 1330 | 1331 | 1332 |
方法exports.wordfilterDelete()
参数word(String)

敏感词,最长不超过 32 个字符。(必填)

1333 | 1334 | 1335 |

1336 | wordfilterList 1337 |

1338 | 1339 | 1340 |

查询敏感词列表
http://www.rongcloud.cn/docs/server.html#查询敏感词列表_方法
举例:

// 查询敏感词列表
1341 | var words = yield api.wordfilterList();
1342 | if (words){
1343 |   // 操作成功,敏感词列表
1344 | } else {
1345 |   // 操作失败
1346 | }
1347 | 
1348 | 1349 |

方法签名

1350 | 1351 | 1352 | 1353 | 1354 | 1355 | 1356 | 1357 | 1358 | 1359 |
方法exports.wordfilterList()
1360 | 1361 |
1362 | 1363 | 1364 |
1365 |

util: API索引

1366 |
    1367 | 1368 |
1369 |
1370 | 1371 |
1372 | 1373 | 1374 |
1375 |
1376 |
1377 | 1391 | 1422 | 1423 | 1424 | 1425 | 1426 | -------------------------------------------------------------------------------- /doc/assets/base.css: -------------------------------------------------------------------------------- 1 | /* Add additional stylesheets below 2 | -------------------------------------------------- */ 3 | /* 4 | Bootstrap's documentation styles 5 | Special styles for presenting Bootstrap's documentation and examples 6 | */ 7 | 8 | /* Code in headings */ 9 | h3 code { 10 | font-size: 14px; 11 | font-weight: normal; 12 | } 13 | 14 | /* Tweak navbar brand link to be super sleek 15 | -------------------------------------------------- */ 16 | 17 | /* Change the docs' brand */ 18 | .navbar-inverse .navbar-brand { 19 | font-weight: bold; 20 | color: #000; 21 | text-shadow: 0 1px 0 rgba(255,255,255,.3), 0 0 30px rgba(255,255,255,.725); 22 | -webkit-transition: all .2s linear; 23 | -moz-transition: all .2s linear; 24 | transition: all .2s linear; 25 | } 26 | .navbar-inverse .navbar-brand:hover { 27 | color: #fff; 28 | text-decoration: none; 29 | text-shadow: 0 1px 0 rgba(255,255,255,.6), 0 0 30px rgba(255,255,255,.9); 30 | } 31 | .navbar-inverse .navbar-brand:first-letter { 32 | text-transform: uppercase; 33 | } 34 | .navbar .nav > li a:first-letter { 35 | text-transform: uppercase; 36 | } 37 | table { 38 | table-layout: fixed; 39 | } 40 | 41 | /* padding for in-page bookmarks and fixed navbar */ 42 | section > .page-header, 43 | section > .lead { 44 | color: #5a5a5a; 45 | } 46 | section > ul li { 47 | margin-bottom: 5px; 48 | } 49 | 50 | /* Separators (hr) */ 51 | .bs-docs-separator { 52 | margin: 40px 0 39px; 53 | } 54 | 55 | /* Faded out hr */ 56 | hr.soften { 57 | height: 1px; 58 | margin: 70px 0; 59 | background-image: -webkit-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,.1), rgba(0,0,0,0)); 60 | background-image: -moz-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,.1), rgba(0,0,0,0)); 61 | background-image: -ms-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,.1), rgba(0,0,0,0)); 62 | background-image: -o-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,.1), rgba(0,0,0,0)); 63 | border: 0; 64 | } 65 | 66 | 67 | 68 | /* Jumbotrons 69 | -------------------------------------------------- */ 70 | 71 | /* Base class 72 | ------------------------- */ 73 | .jumbotron { 74 | position: relative; 75 | padding: 40px 0; 76 | color: #fff; 77 | text-align: center; 78 | text-shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 30px rgba(0,0,0,.075); 79 | background: #020031; /* Old browsers */ 80 | background: -moz-linear-gradient(45deg, #020031 0%, #6d3353 100%); /* FF3.6+ */ 81 | background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,#020031), color-stop(100%,#6d3353)); /* Chrome,Safari4+ */ 82 | background: -webkit-linear-gradient(45deg, #020031 0%,#6d3353 100%); /* Chrome10+,Safari5.1+ */ 83 | background: -o-linear-gradient(45deg, #020031 0%,#6d3353 100%); /* Opera 11.10+ */ 84 | background: -ms-linear-gradient(45deg, #020031 0%,#6d3353 100%); /* IE10+ */ 85 | background: linear-gradient(45deg, #020031 0%,#6d3353 100%); /* W3C */ 86 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#020031', endColorstr='#6d3353',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */ 87 | -webkit-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2); 88 | -moz-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2); 89 | box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2); 90 | } 91 | .jumbotron h1 { 92 | font-size: 80px; 93 | font-weight: bold; 94 | letter-spacing: -1px; 95 | line-height: 1; 96 | } 97 | .jumbotron p { 98 | font-size: 24px; 99 | font-weight: 300; 100 | line-height: 30px; 101 | margin-bottom: 30px; 102 | } 103 | 104 | /* Link styles (used on .masthead-links as well) */ 105 | .jumbotron a { 106 | color: #fff; 107 | color: rgba(255,255,255,.5); 108 | -webkit-transition: all .2s ease-in-out; 109 | -moz-transition: all .2s ease-in-out; 110 | transition: all .2s ease-in-out; 111 | } 112 | .jumbotron a:hover { 113 | color: #fff; 114 | text-shadow: 0 0 10px rgba(255,255,255,.25); 115 | } 116 | 117 | /* Download button */ 118 | .masthead .btn { 119 | padding: 14px 24px; 120 | font-size: 24px; 121 | font-weight: 200; 122 | color: #fff; /* redeclare to override the `.jumbotron a` */ 123 | border: 0; 124 | -webkit-border-radius: 6px; 125 | -moz-border-radius: 6px; 126 | border-radius: 6px; 127 | -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); 128 | -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); 129 | box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); 130 | -webkit-transition: none; 131 | -moz-transition: none; 132 | transition: none; 133 | } 134 | .masthead .btn:hover { 135 | -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); 136 | -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); 137 | box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); 138 | } 139 | .masthead .btn:active { 140 | -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.1); 141 | -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.1); 142 | box-shadow: inset 0 2px 4px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.1); 143 | } 144 | 145 | 146 | /* Pattern overlay 147 | ------------------------- */ 148 | .jumbotron .container { 149 | position: relative; 150 | z-index: 2; 151 | } 152 | .jumbotron:after { 153 | content: ''; 154 | display: block; 155 | position: absolute; 156 | top: 0; 157 | right: 0; 158 | bottom: 0; 159 | left: 0; 160 | background: url(./bs-docs-masthead-pattern.png) repeat center center; 161 | opacity: .4; 162 | } 163 | 164 | /* Social proof buttons from GitHub & Twitter */ 165 | .bs-docs-social { 166 | padding: 15px 0; 167 | text-align: center; 168 | background-color: #f5f5f5; 169 | border-top: 1px solid #fff; 170 | border-bottom: 1px solid #ddd; 171 | } 172 | 173 | /* Subhead (other pages) 174 | ------------------------- */ 175 | .subhead { 176 | text-align: left; 177 | border-bottom: 1px solid #ddd; 178 | } 179 | .subhead h1 { 180 | font-size: 60px; 181 | } 182 | .subhead p { 183 | margin-bottom: 20px; 184 | } 185 | 186 | /* Footer 187 | -------------------------------------------------- */ 188 | 189 | .footer { 190 | padding: 70px 0; 191 | margin-top: 70px; 192 | border-top: 1px solid #e5e5e5; 193 | background-color: #f5f5f5; 194 | } 195 | .footer p { 196 | margin-bottom: 0; 197 | color: #777; 198 | } 199 | .footer-links { 200 | margin: 10px 0; 201 | } 202 | .footer-links li { 203 | display: inline; 204 | margin-right: 10px; 205 | } 206 | 207 | /* Misc 208 | -------------------------------------------------- */ 209 | 210 | /* Make tables spaced out a bit more */ 211 | h2 + table, 212 | h3 + table, 213 | h4 + table, 214 | h2 + .row { 215 | margin-top: 5px; 216 | } 217 | 218 | /* Example page 219 | ------------------------- */ 220 | .bootstrap-examples p { 221 | font-size: 13px; 222 | line-height: 18px; 223 | } 224 | .bootstrap-examples .thumbnail { 225 | margin-bottom: 9px; 226 | background-color: #fff; 227 | } 228 | 229 | /* Bootstrap code examples 230 | -------------------------------------------------- */ 231 | 232 | /* Base class */ 233 | .bs-docs-example { 234 | position: relative; 235 | margin: 15px 0; 236 | padding: 39px 19px 14px; 237 | *padding-top: 19px; 238 | background-color: #fff; 239 | border: 1px solid #ddd; 240 | -webkit-border-radius: 4px; 241 | -moz-border-radius: 4px; 242 | border-radius: 4px; 243 | } 244 | 245 | /* Echo out a label for the example */ 246 | .bs-docs-example:after { 247 | content: "Example"; 248 | position: absolute; 249 | top: -1px; 250 | left: -1px; 251 | padding: 3px 7px; 252 | font-size: 12px; 253 | font-weight: bold; 254 | background-color: #f5f5f5; 255 | border: 1px solid #ddd; 256 | color: #9da0a4; 257 | -webkit-border-radius: 4px 0 4px 0; 258 | -moz-border-radius: 4px 0 4px 0; 259 | border-radius: 4px 0 4px 0; 260 | } 261 | 262 | /* Remove spacing between an example and it's code */ 263 | .bs-docs-example + .prettyprint { 264 | margin-top: -20px; 265 | padding-top: 15px; 266 | } 267 | 268 | 269 | /* Sidenav for Docs 270 | -------------------------------------------------- */ 271 | 272 | .bs-docs-sidenav { 273 | width: 228px; 274 | margin: 30px 0 0; 275 | padding: 0; 276 | background-color: #fff; 277 | border-radius: 6px; 278 | box-shadow: 0 1px 4px rgba(0,0,0,.065); 279 | } 280 | .bs-docs-sidenav > li > a { 281 | display: block; 282 | *width: 190px; 283 | margin: 0 0 -1px; 284 | padding: 8px 14px; 285 | border-bottom: 1px solid #e5e5e5; 286 | border-left: 1px solid #e5e5e5; 287 | border-right: 1px solid #e5e5e5; 288 | } 289 | .bs-docs-sidenav > li:first-child > a { 290 | border-top-right-radius: 6px; 291 | border-top-left-radius: 6px; 292 | border-top: 1px solid #e5e5e5; 293 | } 294 | .bs-docs-sidenav > li:last-child > a { 295 | border-bottom-right-radius: 6px; 296 | border-bottom-left-radius: 6px; 297 | } 298 | .bs-docs-sidenav .level_1 a { 299 | text-indent: 0; 300 | } 301 | .bs-docs-sidenav .level_2 a { 302 | text-indent: 0.5em; 303 | } 304 | .bs-docs-sidenav .level_3 a { 305 | text-indent: 1em; 306 | } 307 | .bs-docs-sidenav .level_4 a { 308 | text-indent: 1.5em; 309 | } 310 | .bs-docs-sidenav .level_5 a { 311 | text-indent: 2em; 312 | } 313 | .bs-docs-sidenav .level_6 a { 314 | text-indent: 2.5em; 315 | } 316 | .bs-docs-sidenav > .active > a { 317 | position: relative; 318 | z-index: 2; 319 | padding: 9px 15px; 320 | border: 0; 321 | text-shadow: 0 1px 0 rgba(0,0,0,.15); 322 | -webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1); 323 | -moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1); 324 | box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1); 325 | } 326 | 327 | .accordion { 328 | display: block; 329 | *width: 190px; 330 | margin: 0 0 -1px; 331 | padding: 8px 14px; 332 | border-bottom: 1px solid #e5e5e5; 333 | border-left: 1px solid #e5e5e5; 334 | border-right: 1px solid #e5e5e5; 335 | } 336 | .bs-docs-sidenav > li:first-child > div { 337 | border-top-right-radius: 6px; 338 | border-top-left-radius: 6px; 339 | border-top: 1px solid #e5e5e5; 340 | } 341 | .bs-docs-sidenav > li:last-child > div { 342 | border-bottom-right-radius: 6px; 343 | border-bottom-left-radius: 6px; 344 | } 345 | .bs-docs-sidenav .level_1 a { 346 | text-indent: 0; 347 | } 348 | .bs-docs-sidenav .level_2 a { 349 | text-indent: 0.5em; 350 | } 351 | .bs-docs-sidenav .level_3 a { 352 | text-indent: 1em; 353 | } 354 | .bs-docs-sidenav .level_4 a { 355 | text-indent: 1.5em; 356 | } 357 | .bs-docs-sidenav .level_5 a { 358 | text-indent: 2em; 359 | } 360 | .bs-docs-sidenav .level_6 a { 361 | text-indent: 2.5em; 362 | } 363 | .bs-docs-sidenav > .active > a { 364 | position: relative; 365 | z-index: 2; 366 | padding: 9px 15px; 367 | border: 0; 368 | text-shadow: 0 1px 0 rgba(0,0,0,.15); 369 | -webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1); 370 | -moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1); 371 | box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1); 372 | } 373 | 374 | /* collapse related */ 375 | .api_side_link { 376 | display: inline-block; 377 | width: 190px; 378 | } 379 | 380 | .accordion-heading { 381 | display: inline-block; 382 | } 383 | 384 | .accordion-marker { 385 | display: inline-block; 386 | float: right; 387 | } 388 | 389 | 390 | .accordion-toggle, .glyphicon { 391 | display: inline-block; 392 | float: right; 393 | border: 0; 394 | text-decoration: none; 395 | color: #93a1a1; 396 | } 397 | 398 | /* Chevrons */ 399 | .bs-docs-sidenav .icon-chevron-right, .glyphicon-chevron-right, .glyphicon-chevron-down { 400 | float: right; 401 | margin-top: 2px; 402 | margin-right: -6px; 403 | opacity: .25; 404 | } 405 | .bs-docs-sidenav > li > a:hover { 406 | background-color: #f5f5f5; 407 | } 408 | 409 | .bs-docs-sidenav > li > div > div > div > a:hover { 410 | background-color: #f5f5f5; 411 | text-decoration: none; 412 | } 413 | 414 | .bs-docs-sidenav a:hover .icon-chevron-right, .glyphicon-chevron-right, .glyphicon-chevron-down { 415 | opacity: .5; 416 | } 417 | .bs-docs-sidenav .active .icon-chevron-right, .glyphicon-chevron-right, .glyphicon-chevron-down, 418 | .bs-docs-sidenav .active a:hover .icon-chevron-right, .glyphicon-chevron-right, .glyphicon-chevron-down { 419 | /*background-image: url(../img/glyphicons-halflings-white.png);*/ 420 | opacity: 1; 421 | } 422 | .bs-docs-sidenav.affix { 423 | top: 0; 424 | } 425 | .bs-docs-sidenav.affix-bottom { 426 | position: absolute; 427 | top: auto; 428 | bottom: 270px; 429 | } 430 | 431 | .top-navbar { 432 | margin-bottom: 0; 433 | } 434 | 435 | .navbar .nav > li > .dropdown-menu::after { 436 | top: -5px; 437 | } 438 | 439 | /* Google prettify style */ 440 | .com { color: #93a1a1; } 441 | .lit { color: #195f91; } 442 | .pun, .opn, .clo { color: #93a1a1; } 443 | .fun { color: #dc322f; } 444 | .str, .atv { color: #D14; } 445 | .kwd, .prettyprint .tag { color: #1e347b; } 446 | .typ, .atn, .dec, .var { color: teal; } 447 | .pln { color: #48484c; } 448 | 449 | .prettyprint { 450 | padding: 8px; 451 | background-color: #f7f7f9; 452 | border: 1px solid #e1e1e8; 453 | } 454 | .prettyprint.linenums { 455 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 456 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 457 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 458 | } 459 | 460 | /* Specify class=linenums on a pre to get line numbering */ 461 | ol.linenums { 462 | margin: 0 0 0 33px; /* IE indents via margin-left */ 463 | } 464 | ol.linenums li { 465 | padding-left: 12px; 466 | color: #bebec5; 467 | line-height: 20px; 468 | text-shadow: 0 1px 0 #fff; 469 | } 470 | 471 | .table p { 472 | margin: 0; 473 | } 474 | -------------------------------------------------------------------------------- /doc/assets/bootstrap/css/bootstrap-theme.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.0.3 (http://getbootstrap.com) 3 | * Copyright 2013 Twitter, Inc. 4 | * Licensed under http://www.apache.org/licenses/LICENSE-2.0 5 | */ 6 | 7 | .btn-default, 8 | .btn-primary, 9 | .btn-success, 10 | .btn-info, 11 | .btn-warning, 12 | .btn-danger { 13 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); 14 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075); 15 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075); 16 | } 17 | 18 | .btn-default:active, 19 | .btn-primary:active, 20 | .btn-success:active, 21 | .btn-info:active, 22 | .btn-warning:active, 23 | .btn-danger:active, 24 | .btn-default.active, 25 | .btn-primary.active, 26 | .btn-success.active, 27 | .btn-info.active, 28 | .btn-warning.active, 29 | .btn-danger.active { 30 | -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); 31 | box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); 32 | } 33 | 34 | .btn:active, 35 | .btn.active { 36 | background-image: none; 37 | } 38 | 39 | .btn-default { 40 | text-shadow: 0 1px 0 #fff; 41 | background-image: -webkit-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); 42 | background-image: linear-gradient(to bottom, #ffffff 0%, #e0e0e0 100%); 43 | background-repeat: repeat-x; 44 | border-color: #dbdbdb; 45 | border-color: #ccc; 46 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0); 47 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 48 | } 49 | 50 | .btn-default:hover, 51 | .btn-default:focus { 52 | background-color: #e0e0e0; 53 | background-position: 0 -15px; 54 | } 55 | 56 | .btn-default:active, 57 | .btn-default.active { 58 | background-color: #e0e0e0; 59 | border-color: #dbdbdb; 60 | } 61 | 62 | .btn-primary { 63 | background-image: -webkit-linear-gradient(top, #428bca 0%, #2d6ca2 100%); 64 | background-image: linear-gradient(to bottom, #428bca 0%, #2d6ca2 100%); 65 | background-repeat: repeat-x; 66 | border-color: #2b669a; 67 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0); 68 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 69 | } 70 | 71 | .btn-primary:hover, 72 | .btn-primary:focus { 73 | background-color: #2d6ca2; 74 | background-position: 0 -15px; 75 | } 76 | 77 | .btn-primary:active, 78 | .btn-primary.active { 79 | background-color: #2d6ca2; 80 | border-color: #2b669a; 81 | } 82 | 83 | .btn-success { 84 | background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%); 85 | background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%); 86 | background-repeat: repeat-x; 87 | border-color: #3e8f3e; 88 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0); 89 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 90 | } 91 | 92 | .btn-success:hover, 93 | .btn-success:focus { 94 | background-color: #419641; 95 | background-position: 0 -15px; 96 | } 97 | 98 | .btn-success:active, 99 | .btn-success.active { 100 | background-color: #419641; 101 | border-color: #3e8f3e; 102 | } 103 | 104 | .btn-warning { 105 | background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); 106 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%); 107 | background-repeat: repeat-x; 108 | border-color: #e38d13; 109 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0); 110 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 111 | } 112 | 113 | .btn-warning:hover, 114 | .btn-warning:focus { 115 | background-color: #eb9316; 116 | background-position: 0 -15px; 117 | } 118 | 119 | .btn-warning:active, 120 | .btn-warning.active { 121 | background-color: #eb9316; 122 | border-color: #e38d13; 123 | } 124 | 125 | .btn-danger { 126 | background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%); 127 | background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%); 128 | background-repeat: repeat-x; 129 | border-color: #b92c28; 130 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0); 131 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 132 | } 133 | 134 | .btn-danger:hover, 135 | .btn-danger:focus { 136 | background-color: #c12e2a; 137 | background-position: 0 -15px; 138 | } 139 | 140 | .btn-danger:active, 141 | .btn-danger.active { 142 | background-color: #c12e2a; 143 | border-color: #b92c28; 144 | } 145 | 146 | .btn-info { 147 | background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); 148 | background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%); 149 | background-repeat: repeat-x; 150 | border-color: #28a4c9; 151 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0); 152 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 153 | } 154 | 155 | .btn-info:hover, 156 | .btn-info:focus { 157 | background-color: #2aabd2; 158 | background-position: 0 -15px; 159 | } 160 | 161 | .btn-info:active, 162 | .btn-info.active { 163 | background-color: #2aabd2; 164 | border-color: #28a4c9; 165 | } 166 | 167 | .thumbnail, 168 | .img-thumbnail { 169 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); 170 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); 171 | } 172 | 173 | .dropdown-menu > li > a:hover, 174 | .dropdown-menu > li > a:focus { 175 | background-color: #e8e8e8; 176 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 177 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); 178 | background-repeat: repeat-x; 179 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); 180 | } 181 | 182 | .dropdown-menu > .active > a, 183 | .dropdown-menu > .active > a:hover, 184 | .dropdown-menu > .active > a:focus { 185 | background-color: #357ebd; 186 | background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); 187 | background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); 188 | background-repeat: repeat-x; 189 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); 190 | } 191 | 192 | .navbar-default { 193 | background-image: -webkit-linear-gradient(top, #ffffff 0%, #f8f8f8 100%); 194 | background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%); 195 | background-repeat: repeat-x; 196 | border-radius: 4px; 197 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); 198 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 199 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); 200 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); 201 | } 202 | 203 | .navbar-default .navbar-nav > .active > a { 204 | background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f3f3f3 100%); 205 | background-image: linear-gradient(to bottom, #ebebeb 0%, #f3f3f3 100%); 206 | background-repeat: repeat-x; 207 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0); 208 | -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075); 209 | box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075); 210 | } 211 | 212 | .navbar-brand, 213 | .navbar-nav > li > a { 214 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25); 215 | } 216 | 217 | .navbar-inverse { 218 | background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222222 100%); 219 | background-image: linear-gradient(to bottom, #3c3c3c 0%, #222222 100%); 220 | background-repeat: repeat-x; 221 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); 222 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 223 | } 224 | 225 | .navbar-inverse .navbar-nav > .active > a { 226 | background-image: -webkit-linear-gradient(top, #222222 0%, #282828 100%); 227 | background-image: linear-gradient(to bottom, #222222 0%, #282828 100%); 228 | background-repeat: repeat-x; 229 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0); 230 | -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25); 231 | box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25); 232 | } 233 | 234 | .navbar-inverse .navbar-brand, 235 | .navbar-inverse .navbar-nav > li > a { 236 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 237 | } 238 | 239 | .navbar-static-top, 240 | .navbar-fixed-top, 241 | .navbar-fixed-bottom { 242 | border-radius: 0; 243 | } 244 | 245 | .alert { 246 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2); 247 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); 248 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); 249 | } 250 | 251 | .alert-success { 252 | background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); 253 | background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%); 254 | background-repeat: repeat-x; 255 | border-color: #b2dba1; 256 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); 257 | } 258 | 259 | .alert-info { 260 | background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%); 261 | background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%); 262 | background-repeat: repeat-x; 263 | border-color: #9acfea; 264 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); 265 | } 266 | 267 | .alert-warning { 268 | background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); 269 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%); 270 | background-repeat: repeat-x; 271 | border-color: #f5e79e; 272 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); 273 | } 274 | 275 | .alert-danger { 276 | background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); 277 | background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%); 278 | background-repeat: repeat-x; 279 | border-color: #dca7a7; 280 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); 281 | } 282 | 283 | .progress { 284 | background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); 285 | background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%); 286 | background-repeat: repeat-x; 287 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0); 288 | } 289 | 290 | .progress-bar { 291 | background-image: -webkit-linear-gradient(top, #428bca 0%, #3071a9 100%); 292 | background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%); 293 | background-repeat: repeat-x; 294 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0); 295 | } 296 | 297 | .progress-bar-success { 298 | background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%); 299 | background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%); 300 | background-repeat: repeat-x; 301 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0); 302 | } 303 | 304 | .progress-bar-info { 305 | background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); 306 | background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%); 307 | background-repeat: repeat-x; 308 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0); 309 | } 310 | 311 | .progress-bar-warning { 312 | background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); 313 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%); 314 | background-repeat: repeat-x; 315 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0); 316 | } 317 | 318 | .progress-bar-danger { 319 | background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%); 320 | background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%); 321 | background-repeat: repeat-x; 322 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0); 323 | } 324 | 325 | .list-group { 326 | border-radius: 4px; 327 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); 328 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); 329 | } 330 | 331 | .list-group-item.active, 332 | .list-group-item.active:hover, 333 | .list-group-item.active:focus { 334 | text-shadow: 0 -1px 0 #3071a9; 335 | background-image: -webkit-linear-gradient(top, #428bca 0%, #3278b3 100%); 336 | background-image: linear-gradient(to bottom, #428bca 0%, #3278b3 100%); 337 | background-repeat: repeat-x; 338 | border-color: #3278b3; 339 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0); 340 | } 341 | 342 | .panel { 343 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); 344 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); 345 | } 346 | 347 | .panel-default > .panel-heading { 348 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 349 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); 350 | background-repeat: repeat-x; 351 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); 352 | } 353 | 354 | .panel-primary > .panel-heading { 355 | background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); 356 | background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); 357 | background-repeat: repeat-x; 358 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); 359 | } 360 | 361 | .panel-success > .panel-heading { 362 | background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); 363 | background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%); 364 | background-repeat: repeat-x; 365 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0); 366 | } 367 | 368 | .panel-info > .panel-heading { 369 | background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); 370 | background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%); 371 | background-repeat: repeat-x; 372 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0); 373 | } 374 | 375 | .panel-warning > .panel-heading { 376 | background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); 377 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%); 378 | background-repeat: repeat-x; 379 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0); 380 | } 381 | 382 | .panel-danger > .panel-heading { 383 | background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%); 384 | background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%); 385 | background-repeat: repeat-x; 386 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0); 387 | } 388 | 389 | .well { 390 | background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); 391 | background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%); 392 | background-repeat: repeat-x; 393 | border-color: #dcdcdc; 394 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); 395 | -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1); 396 | box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1); 397 | } -------------------------------------------------------------------------------- /doc/assets/bootstrap/css/bootstrap-theme.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.0.3 (http://getbootstrap.com) 3 | * Copyright 2013 Twitter, Inc. 4 | * Licensed under http://www.apache.org/licenses/LICENSE-2.0 5 | */ 6 | 7 | .btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn:active,.btn.active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe0e0e0',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-primary{background-image:-webkit-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:linear-gradient(to bottom,#428bca 0,#2d6ca2 100%);background-repeat:repeat-x;border-color:#2b669a;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff2d6ca2',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:focus{background-color:#2d6ca2;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#2d6ca2;border-color:#2b669a}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);background-repeat:repeat-x;border-color:#3e8f3e;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c',endColorstr='#ff419641',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);background-repeat:repeat-x;border-color:#e38d13;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e',endColorstr='#ffeb9316',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);background-repeat:repeat-x;border-color:#b92c28;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f',endColorstr='#ffc12e2a',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);background-repeat:repeat-x;border-color:#28a4c9;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2aabd2',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#ffe8e8e8',GradientType=0)}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-color:#357ebd;background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff357ebd',GradientType=0)}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);background-repeat:repeat-x;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff8f8f8',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),0 1px 5px rgba(0,0,0,0.075)}.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f3f3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb',endColorstr='#fff3f3f3',GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.075);box-shadow:inset 0 3px 9px rgba(0,0,0,0.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,0.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#222 0,#282828 100%);background-image:linear-gradient(to bottom,#222 0,#282828 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff282828',GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,0.25);box-shadow:inset 0 3px 9px rgba(0,0,0,0.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}.alert{text-shadow:0 1px 0 rgba(255,255,255,0.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.25),0 1px 2px rgba(0,0,0,0.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);background-repeat:repeat-x;border-color:#b2dba1;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8',endColorstr='#ffc8e5bc',GradientType=0)}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);background-repeat:repeat-x;border-color:#9acfea;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7',endColorstr='#ffb9def0',GradientType=0)}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);background-repeat:repeat-x;border-color:#f5e79e;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3',endColorstr='#fff8efc0',GradientType=0)}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);background-repeat:repeat-x;border-color:#dca7a7;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede',endColorstr='#ffe7c3c3',GradientType=0)}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb',endColorstr='#fff5f5f5',GradientType=0)}.progress-bar{background-image:-webkit-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:linear-gradient(to bottom,#428bca 0,#3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff3071a9',GradientType=0)}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c',endColorstr='#ff449d44',GradientType=0)}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff31b0d5',GradientType=0)}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e',endColorstr='#ffec971f',GradientType=0)}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f',endColorstr='#ffc9302c',GradientType=0)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.075);box-shadow:0 1px 2px rgba(0,0,0,0.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:linear-gradient(to bottom,#428bca 0,#3278b3 100%);background-repeat:repeat-x;border-color:#3278b3;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff3278b3',GradientType=0)}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#ffe8e8e8',GradientType=0)}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff357ebd',GradientType=0)}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8',endColorstr='#ffd0e9c6',GradientType=0)}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7',endColorstr='#ffc4e3f3',GradientType=0)}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3',endColorstr='#fffaf2cc',GradientType=0)}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede',endColorstr='#ffebcccc',GradientType=0)}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);background-repeat:repeat-x;border-color:#dcdcdc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8',endColorstr='#fff5f5f5',GradientType=0);-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 3px rgba(0,0,0,0.05),0 1px 0 rgba(255,255,255,0.1)} -------------------------------------------------------------------------------- /doc/assets/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nick-ma/co-rongcloud-api/40958f79b7a5be5d624ab41eb7d04b9088c2eb52/doc/assets/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /doc/assets/bootstrap/fonts/glyphicons-halflings-regular.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | -------------------------------------------------------------------------------- /doc/assets/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nick-ma/co-rongcloud-api/40958f79b7a5be5d624ab41eb7d04b9088c2eb52/doc/assets/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /doc/assets/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nick-ma/co-rongcloud-api/40958f79b7a5be5d624ab41eb7d04b9088c2eb52/doc/assets/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /doc/assets/bootstrap/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.0.3 (http://getbootstrap.com) 3 | * Copyright 2013 Twitter, Inc. 4 | * Licensed under http://www.apache.org/licenses/LICENSE-2.0 5 | */ 6 | 7 | if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]'),b=!0;if(a.length){var c=this.$element.find("input");"radio"===c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?b=!1:a.find(".active").removeClass("active")),b&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}b&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); -------------------------------------------------------------------------------- /doc/assets/bs-docs-masthead-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nick-ma/co-rongcloud-api/40958f79b7a5be5d624ab41eb7d04b9088c2eb52/doc/assets/bs-docs-masthead-pattern.png -------------------------------------------------------------------------------- /doc/assets/prettify.js: -------------------------------------------------------------------------------- 1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= 3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), 9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, 11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, 12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), 13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} 14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ 21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), 22 | ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", 23 | /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), 24 | ["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", 25 | hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= 26 | !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p 2 | 3 | 4 | 5 | co-rongcloud-api Documentation 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 39 |
40 |
41 |

co-rongcloud-api Version: 1.0.1 By @[object Object]

42 |

43 | 融云服务端Node库API,ES6版本 44 |

45 |
46 |
47 | 48 |
49 |
50 |
51 | 78 | 79 |
80 |
81 |
82 |

RongCloud Server API(ES6版)

83 |

融云服务器端API。

84 |

功能列表

85 |
    86 |
  • 用户服务
  • 87 |
  • 群组服务
  • 88 |
  • 敏感词服务
  • 89 |
  • 聊天室服务
  • 90 |
  • 历史消息服务
  • 91 |
  • 发送消息(文本、图片、语音、视频、音乐、图文)
  • 92 |
93 |

详细参见API文档

94 |

Installation

95 |
$ npm install co-rongcloud-api
 96 | 
97 |

Usage

98 |
var RongAPI = require('co-rongcloud-api');
 99 | 
100 | var api = new RongAPI(appid, appsecret);
101 | var token = yield* api.getToken('nick-ma');
102 | 
103 |

License

104 |

The MIT license.

105 | 106 |
107 | 108 |
109 |
110 |
111 | 125 | 156 | 157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var API = require('./lib/api_common'); 2 | // 用户信息 3 | API.mixin(require('./lib/api_user')); 4 | // 消息服务 5 | API.mixin(require('./lib/api_message')); 6 | // 敏感词服务 7 | API.mixin(require('./lib/api_wordfilter')); 8 | // 群组服务 9 | API.mixin(require('./lib/api_group')); 10 | // 聊天室服务 11 | API.mixin(require('./lib/api_chatroom')); 12 | // 消息历史记录服务 13 | API.mixin(require('./lib/api_history')); 14 | 15 | module.exports = API; 16 | -------------------------------------------------------------------------------- /lib/api_chatroom.js: -------------------------------------------------------------------------------- 1 | var extend = require('util')._extend; 2 | // 聊天室服务 3 | // 名称 类型 说明 4 | // chatroom[id]=name String id:要创建的聊天室的id;name:要创建的聊天室的name。(必传) 5 | // chatroomData = { 6 | // 'chatroom[0001]': '1号聊天室', 7 | // 'chatroom[0002]': '2号聊天室', 8 | // 'chatroom[0003]': '3号聊天室', 9 | // 'chatroom[0004]': '4号聊天室', 10 | // } 11 | /** 12 | * 创建聊天室 13 | * http://www.rongcloud.cn/docs/server.html#创建聊天室_方法 14 | * 举例: 15 | * ``` 16 | * // 创建聊天室 17 | * var chatroomData = { 18 | * 'chatroom[0001]': '1号聊天室', 19 | * 'chatroom[0002]': '2号聊天室', 20 | * 'chatroom[0003]': '3号聊天室', 21 | * 'chatroom[0004]': '4号聊天室', 22 | * } 23 | * var flag = yield api.chatroomCreate(chatroomData); 24 | * if (flag){ 25 | * // 操作成功 26 | * } else { 27 | * // 操作失败 28 | * } 29 | * ``` 30 | * @param {Array} chatroomData 要创建或者加入的聊天室的数据结构(必填) 31 | * 32 | */ 33 | exports.chatroomCreate = function* (chatroomData) { 34 | var url = this.genURL('/chatroom/create'); 35 | var post_data = chatroomData; 36 | var opts = this.genPostData(post_data); 37 | var ret_data = yield * this.request(url, opts); 38 | if (ret_data.code == 200) { 39 | return true; 40 | } else { 41 | return false; 42 | }; 43 | }; 44 | 45 | // 加入聊天室 46 | // 将用户加入指定聊天室,用户将可以收到该聊天室的消息。 47 | /** 48 | * 加入聊天室 49 | * http://www.rongcloud.cn/docs/server.html#加入聊天室_方法 50 | * 举例: 51 | * var chatroomData = { 52 | * userId: ['1','2','3','4'], // 最多不超过 50 个 (必传) 53 | * chatroomId: '0001' // 要加入的聊天室 Id。(必传) 54 | * } 55 | * var flag = yield api.chatroomJoin(chatroomData); 56 | * if (flag) { 57 | * // 操作成功 58 | * } else { 59 | * // 操作失败 60 | * } 61 | * 62 | * @param {Object} chatroomData 要加入的聊天室的数据结构(必填) 63 | */ 64 | exports.chatroomJoin = function* (chatroomData) { 65 | var url = this.genURL('/chatroom/join'); 66 | var post_data = chatroomData; 67 | var opts = this.genPostData(post_data); 68 | var ret_data = yield * this.request(url, opts); 69 | if (ret_data.code == 200) { 70 | return true; 71 | } else { 72 | return false; 73 | }; 74 | }; 75 | 76 | // 销毁聊天室 77 | // 同时销毁多个聊天室: chatroomId=['0001','0002','0003','0004'] 78 | /** 79 | * 销毁聊天室 80 | * http://www.rongcloud.cn/docs/server.html#销毁聊天室_方法 81 | * 举例: 82 | * ``` 83 | * // 销毁聊天室 84 | * var chatroomId=['0001','0002','0003','0004']; 85 | * var flag = yield api.chatroomDestroy(chatroomId); 86 | * if (flag){ 87 | * // 操作成功 88 | * } else { 89 | * // 操作失败 90 | * } 91 | * ``` 92 | * @param {Array} chatroomId 要销毁的聊天室的数据结构(必填) 93 | * 94 | */ 95 | exports.chatroomDestroy = function* (chatroomId) { 96 | var url = this.genURL('/chatroom/destroy'); 97 | var post_data = { 98 | chatroomId: chatroomId 99 | }; 100 | var opts = this.genPostData(post_data); 101 | var ret_data = yield * this.request(url, opts); 102 | if (ret_data.code == 200) { 103 | return true; 104 | } else { 105 | return false; 106 | }; 107 | }; 108 | 109 | // 查询聊天室信息 110 | /** 111 | * 查询聊天室信息 112 | * http://www.rongcloud.cn/docs/server.html#查询聊天室信息_方法 113 | * 举例: 114 | * ``` 115 | * // 查询聊天室信息 116 | * var chatroomId=['0001','0002']; 117 | * var chatRooms = yield api.chatroomQuery(chatroomId); 118 | * if (chatRooms){ 119 | * // 操作成功 120 | * } else { 121 | * // 操作失败 122 | * } 123 | * ``` 124 | * @param {Array} chatroomId 要查询的聊天室(必填) 125 | * 126 | */ 127 | exports.chatroomQuery = function* (chatroomId) { 128 | var url = this.genURL('/chatroom/query'); 129 | var post_data = { 130 | chatroomId: chatroomId 131 | }; 132 | var opts = this.genPostData(post_data); 133 | var ret_data = yield * this.request(url, opts); 134 | if (ret_data.code == 200) { 135 | return ret_data.chatRooms; 136 | } else { 137 | return false; 138 | }; 139 | }; 140 | 141 | /** 142 | * 查询聊天室内用户 143 | * http://www.rongcloud.cn/docs/server.html#查询聊天室内用户_方法 144 | * 举例: 145 | * ``` 146 | * // 查询聊天室内用户 147 | * var chatroomId='0001'; 148 | * var users = yield api.chatroomUserQuery(chatroomId); 149 | * if (users){ 150 | * // 操作成功 151 | * } else { 152 | * // 操作失败 153 | * } 154 | * ``` 155 | * @param {String} chatroomId 要查询的聊天室(必填) 156 | * 157 | */ 158 | exports.chatroomUserQuery = function* (chatroomId) { 159 | var url = this.genURL('/chatroom/user/query'); 160 | var post_data = { 161 | chatroomId: chatroomId 162 | }; 163 | var opts = this.genPostData(post_data); 164 | var ret_data = yield * this.request(url, opts); 165 | if (ret_data.code == 200) { 166 | return ret_data.users; 167 | } else { 168 | return false; 169 | }; 170 | }; 171 | -------------------------------------------------------------------------------- /lib/api_common.js: -------------------------------------------------------------------------------- 1 | // 本文件用于wechat API,基础文件,主要用于Token的处理和mixin机制 2 | var httpx = require('httpx'); 3 | var streamx = require('streamx'); 4 | var crypto = require('crypto'); 5 | var extend = require('util')._extend; 6 | var querystring = require('querystring'); 7 | 8 | 9 | /** 10 | * API构造函数 11 | * Examples: 12 | * ``` 13 | * // 创建api实例 14 | * var api = new API("appkey", "appsecret"); 15 | * ``` 16 | * @param {String} appKey 融信应用的app key 17 | * @param {String} appSecret 融信应用的app secret 18 | */ 19 | var API = function (appKey, appSecret) { 20 | this.__baseurl__ = 'https://api.cn.ronghub.com'; 21 | this.__format__ = 'json'; 22 | this.__appkey__ = appKey; 23 | this.__appsecert__ = appSecret; 24 | this.__headers__ = { 25 | 'Content-Type': 'application/x-www-form-urlencoded', 26 | 'App-Key': this.__appkey__, 27 | }; 28 | this.defaults = {}; 29 | 30 | }; 31 | 32 | /** 33 | * 计算签名。单独使用可以用于验证各种回调接口的签名。 34 | * Examples: 35 | * ``` 36 | * // 计算签名 37 | * var shasum = api.getSignature("nonce", "timestamp"); 38 | * ``` 39 | * @param {String} nonce 40 | * @param {String} timestamp 41 | */ 42 | API.prototype.getSignature = function (nonce, timestamp) { 43 | var shasum = crypto.createHash('sha1'); 44 | shasum.update(this.__appsecert__ + nonce + timestamp); 45 | return shasum.digest('hex'); 46 | }; 47 | 48 | API.prototype.updateHeader = function () { 49 | var nonce = parseInt(Math.random() * 0xffffff); 50 | var timestamp = Date.parse(new Date()) / 1000; 51 | var signature = this.getSignature(nonce, timestamp); 52 | return extend(this.__headers__, { 53 | 'Nonce': nonce, 54 | 'Timestamp': timestamp, 55 | 'Signature': signature 56 | }); 57 | }; 58 | 59 | /** 60 | * 设置HTTP请求的参数 61 | * Examples: 62 | * ``` 63 | * // 设定超时为15秒 64 | * var token = api.setOpts({ 65 | * timeout: 15000 66 | * }); 67 | * ``` 68 | * @param {Object} obj 请求的配置参数 69 | */ 70 | API.prototype.setOpts = function (opts) { 71 | this.defaults = opts; 72 | }; 73 | 74 | API.prototype.request = function* (url, opts) { 75 | var options = {}; 76 | extend(options, this.defaults); 77 | opts || (opts = {}); 78 | for (var key in opts) { 79 | if (key !== 'headers') { 80 | options[key] = opts[key]; 81 | } else { 82 | if (opts.headers) { 83 | options.headers = options.headers || {}; 84 | extend(options.headers, opts.headers); 85 | } 86 | } 87 | } 88 | 89 | var res = yield httpx.request(url, options); 90 | if (res.statusCode < 200 || res.statusCode > 204) { 91 | var err = new Error("url: " + url + ", status code: " + res.statusCode); 92 | err.name = "RongCloudAPIError"; 93 | throw err; 94 | } 95 | 96 | var buffer = yield streamx.read(res); 97 | var contentType = res.headers['content-type'] || ''; 98 | if (contentType.indexOf('application/json') !== -1) { 99 | var data; 100 | try { 101 | data = JSON.parse(buffer); 102 | } catch (ex) { 103 | var err = new Error('JSON.parse error. buffer is ' + buffer.toString()); 104 | err.name = "RongCloudAPIError"; 105 | throw err; 106 | } 107 | if (data && data.errcode) { 108 | var err = new Error(data.errmsg); 109 | err.name = 'RongCloudAPIError'; 110 | err.code = data.errcode; 111 | throw err; 112 | } 113 | 114 | return data; 115 | } 116 | 117 | return buffer; 118 | }; 119 | 120 | API.prototype.genURL = function (path) { 121 | return [this.__baseurl__, path, '.', this.__format__].join(''); 122 | }; 123 | 124 | API.prototype.genPostData = function (post_data) { 125 | return { 126 | headers: this.updateHeader(), 127 | method: 'POST', 128 | data: querystring.stringify(post_data) 129 | }; 130 | }; 131 | 132 | API.prototype.genPostJsonData = function (post_data) { 133 | var data = { 134 | headers: this.updateHeader(), 135 | method: 'POST', 136 | data: post_data 137 | }; 138 | data.headers['Content-Type'] = 'Application/json'; 139 | return data; 140 | }; 141 | 142 | /** 143 | * 换取用户的token 144 | * Examples: 145 | * ``` 146 | * // 获取用户的token 147 | * var token = yield api.getToken(userid, , ); 148 | * ``` 149 | * @param {String} userid 用户的userid(必填) 150 | * @param {String} name 姓名(选填) 151 | * @param {String} portrait_url 头像url(选填) 152 | */ 153 | API.prototype.getToken = function* (userid, name, portrait_url) { 154 | var url = this.genURL('/user/getToken'); 155 | var post_data = { 156 | userId: userid 157 | }; 158 | if (name) { 159 | post_data['name'] = name; 160 | }; 161 | if (portrait_url) { 162 | post_data['portraitUri'] = portrait_url; 163 | }; 164 | var opts = { 165 | headers: this.updateHeader(), 166 | method: 'POST', 167 | data: querystring.stringify(post_data) 168 | }; 169 | var ret_data = yield * this.request(url, opts); 170 | if (ret_data.code == 200) { 171 | return ret_data.token; 172 | } else { 173 | return null; 174 | }; 175 | }; 176 | 177 | /** 178 | * 用于支持对象合并。将对象合并到API.prototype上,使得能够支持扩展 179 | * Examples: 180 | * ``` 181 | * // 加入用户管理模块 182 | * API.mixin(require('./lib/api_user')); 183 | * ``` 184 | * @param {Object} obj 要合并的对象 185 | */ 186 | API.mixin = function (obj) { 187 | for (var key in obj) { 188 | if (API.prototype.hasOwnProperty(key)) { 189 | throw new Error('Don\'t allow override existed prototype method. method: ' + key); 190 | } 191 | API.prototype[key] = obj[key]; 192 | } 193 | }; 194 | 195 | module.exports = API; 196 | -------------------------------------------------------------------------------- /lib/api_group.js: -------------------------------------------------------------------------------- 1 | var extend = require('util')._extend; 2 | 3 | // 群组服务 4 | 5 | // 同步用户所属群组 方法 6 | // 当第一次连接融云服务器时,需要向融云服务器提交 userId 对应的用户当前所加入的所有群组,此接口主要为防止应用中用户群信息同融云已知的用户所属群信息不同步。 7 | // 方法名:/group/sync 8 | // 调用频率:每秒钟限 100 次 9 | // 签名方法:请参考 通用 API 接口签名规则 10 | // URL:https://api.cn.ronghub.com/group/sync.[format] 11 | // [format] 表示返回格式,可以为 json 或 xml,注意不要带 [ ]。 12 | // HTTP 方法:POST 13 | 14 | // 名称 类型 说明 15 | // userId String 被同步群信息的用户Id。(必传) 16 | // group[id]=name String 该用户的群信息。 17 | 18 | // 当不提交group[id]=name参数时,表示删除userId对应的群信息;此参数可传多个 19 | 20 | exports.groupSync = function* (userId, groupData) { 21 | var url = this.genURL('/group/sync'); 22 | var post_data = { 23 | userId: userId 24 | }; 25 | if (groupData) { 26 | post_data = extend(post_data, groupData); 27 | }; 28 | var opts = this.genPostData(post_data); 29 | var ret_data = yield * this.request(url, opts); 30 | if (ret_data.code == 200) { 31 | return true; 32 | } else { 33 | return false; 34 | }; 35 | }; 36 | 37 | // 当提交多个userId参数时,表示创建群组,并将多个用户加入该群组,用户将可以收到该群的消息 38 | // userId=[1,2,3,4,5] 39 | exports.groupCreate = exports.groupJoin = function* (userId, groupId, groupName) { 40 | var url = this.genURL('/group/join'); 41 | var post_data = { 42 | userId: userId, 43 | groupId: groupId 44 | }; 45 | if (groupName) { 46 | post_data.groupName = groupName; 47 | }; 48 | var opts = this.genPostData(post_data); 49 | var ret_data = yield * this.request(url, opts); 50 | if (ret_data.code == 200) { 51 | return true; 52 | } else { 53 | return false; 54 | }; 55 | }; 56 | 57 | // 退出群组 58 | exports.groupQuit = function* (userId, groupId) { 59 | var url = this.genURL('/group/quit'); 60 | var post_data = { 61 | userId: userId, 62 | groupId: groupId 63 | }; 64 | var opts = this.genPostData(post_data); 65 | var ret_data = yield * this.request(url, opts); 66 | if (ret_data.code == 200) { 67 | return true; 68 | } else { 69 | return false; 70 | }; 71 | }; 72 | 73 | // 解散群组 74 | exports.groupDismiss = function* (userId, groupId) { 75 | var url = this.genURL('/group/dismiss'); 76 | var post_data = { 77 | userId: userId, 78 | groupId: groupId 79 | }; 80 | var opts = this.genPostData(post_data); 81 | var ret_data = yield * this.request(url, opts); 82 | if (ret_data.code == 200) { 83 | return true; 84 | } else { 85 | return false; 86 | }; 87 | }; 88 | 89 | // 刷新群组信息 90 | exports.groupRefresh = function* (groupId, groupName) { 91 | var url = this.genURL('/group/refresh'); 92 | var post_data = { 93 | groupId: groupId, 94 | groupName: groupName 95 | }; 96 | var opts = this.genPostData(post_data); 97 | var ret_data = yield * this.request(url, opts); 98 | if (ret_data.code == 200) { 99 | return true; 100 | } else { 101 | return false; 102 | }; 103 | }; 104 | 105 | // 查询群成员 106 | exports.groupUserQuery = function* (groupId) { 107 | var url = this.genURL('/group/user/query'); 108 | var post_data = { 109 | groupId: groupId 110 | }; 111 | var opts = this.genPostData(post_data); 112 | var ret_data = yield * this.request(url, opts); 113 | if (ret_data.code == 200) { 114 | return ret_data.users; 115 | } else { 116 | return false; 117 | }; 118 | }; 119 | 120 | // 群组成员禁言服务 121 | 122 | exports.groupUserGagAdd = function* (userId, groupId, minute) { 123 | var url = this.genURL('/group/user/gag/add'); 124 | var post_data = { 125 | userId: userId, 126 | groupId: groupId, 127 | minute: minute 128 | }; 129 | var opts = this.genPostData(post_data); 130 | var ret_data = yield * this.request(url, opts); 131 | if (ret_data.code == 200) { 132 | return true; 133 | } else { 134 | return false; 135 | }; 136 | }; 137 | 138 | // 移除禁言群成员 139 | exports.groupUserGagRollback = function* (userId, groupId) { 140 | var url = this.genURL('/group/user/gag/rollback'); 141 | var post_data = { 142 | userId: userId, 143 | groupId: groupId 144 | }; 145 | var opts = this.genPostData(post_data); 146 | var ret_data = yield * this.request(url, opts); 147 | if (ret_data.code == 200) { 148 | return true; 149 | } else { 150 | return false; 151 | }; 152 | }; 153 | 154 | // 查询被禁言群成员 155 | exports.groupUserGagList = function* (groupId) { 156 | var url = this.genURL('/group/user/gag/list'); 157 | var post_data = { 158 | groupId: groupId 159 | }; 160 | var opts = this.genPostData(post_data); 161 | var ret_data = yield * this.request(url, opts); 162 | if (ret_data.code == 200) { 163 | return ret_data.users; 164 | } else { 165 | return false; 166 | }; 167 | }; 168 | -------------------------------------------------------------------------------- /lib/api_history.js: -------------------------------------------------------------------------------- 1 | var extend = require('util')._extend; 2 | // 消息历史记录服务 3 | 4 | // 消息历史记录下载地址获取 方法 5 | // 说明:获取 APP 内指定某天某小时内的所有会话消息记录的下载地址(目前支持二人会话、讨论组、群组、聊天室、客服、系统通知消息历史记录下载) 6 | // 方法名:/message/history 7 | // 签名方法:请参考 通用 API 接口签名规则 8 | // URL:https://api.cn.ronghub.com/message/history.[format] 9 | // [format] 表示返回格式,可以为 json 或 xml,注意不要带 [ ]。 10 | // HTTP 方法:POST 11 | 12 | // 名称 类型 说明 13 | // date String 指定北京时间某天某小时,格式为2014010101,表示:2014年1月1日凌晨1点。(必传) 14 | /** 15 | * 消息历史记录下载地址获取 16 | * http://www.rongcloud.cn/docs/server.html#消息历史记录下载地址获取_方法 17 | * 举例: 18 | * ``` 19 | * // 消息历史记录下载地址获取 20 | * var date='2014010101'; 21 | * var chat_data = yield api.historyFetch(date); 22 | * if (chat_data){ 23 | * // 操作成功 24 | * chat_data.url 25 | * } else { 26 | * // 操作失败 27 | * } 28 | * ``` 29 | * @param {String} date 指定北京时间某天某小时,格式为2014010101,表示:2014年1月1日凌晨1点。(必填) 30 | * 31 | */ 32 | exports.historyFetch = function* (date) { 33 | var url = this.genURL('/message/history'); 34 | var post_data = { 35 | date: date 36 | }; 37 | var opts = this.genPostData(post_data); 38 | var ret_data = yield * this.request(url, opts); 39 | if (ret_data.code == 200) { 40 | return { 41 | url: ret_data.url, 42 | date: ret_data.date, 43 | }; 44 | } else { 45 | return false; 46 | }; 47 | }; 48 | 49 | // 消息历史记录删除。 参数同上。 50 | /** 51 | * 消息历史记录删除 52 | * http://www.rongcloud.cn/docs/server.html#消息历史记录删除_方法 53 | * 举例: 54 | * ``` 55 | * // 消息历史记录删除 56 | * var date='2014010101'; 57 | * var flag = yield api.historyDelete(date); 58 | * if (flag){ 59 | * // 操作成功 60 | * } else { 61 | * // 操作失败 62 | * } 63 | * ``` 64 | * @param {String} date 指定北京时间某天某小时,格式为2014010101,表示:2014年1月1日凌晨1点。(必填) 65 | * 66 | */ 67 | exports.historyDelete = function* (date) { 68 | var url = this.genURL('/message/history/delete'); 69 | var post_data = { 70 | date: date 71 | }; 72 | var opts = this.genPostData(post_data); 73 | var ret_data = yield * this.request(url, opts); 74 | if (ret_data.code == 200) { 75 | return true; 76 | } else { 77 | return false; 78 | }; 79 | }; 80 | 81 | -------------------------------------------------------------------------------- /lib/api_message.js: -------------------------------------------------------------------------------- 1 | var extend = require('util')._extend; 2 | 3 | // 发送单聊消息 4 | // 同时向多人发送消息时,toUserId传入数组。 toUserId=['user01','user02','user03'] 5 | exports.messagePrivatePublish = function* (fromUserId, toUserId, objectName, content, optional) { 6 | var url = this.genURL('/message/private/publish'); 7 | var post_data = { 8 | fromUserId: fromUserId, 9 | toUserId: toUserId, 10 | objectName: objectName, 11 | content: content, 12 | }; 13 | if (optional && typeof optional === 'object') { 14 | post_data = extend(post_data, optoinal); 15 | }; 16 | var opts = this.genPostData(post_data); 17 | var ret_data = yield * this.request(url, opts); 18 | if (ret_data.code == 200) { 19 | return true; 20 | } else { 21 | return false; 22 | }; 23 | }; 24 | 25 | // 发送单聊模板消息 26 | exports.messagePrivatePublishTemplate = function* (fromUserId, toUserId, objectName, content, values, pushContent, pushData) { 27 | var url = this.genURL('/message/private/publish_template'); 28 | var post_data = { 29 | fromUserId: fromUserId, 30 | toUserId: toUserId, 31 | objectName: objectName, 32 | content: content, 33 | values: values, 34 | pushContent: pushContent, 35 | pushData: pushData, 36 | }; 37 | var opts = this.genPostJsonData(post_data); 38 | var ret_data = yield * this.request(url, opts); 39 | if (ret_data.code == 200) { 40 | return true; 41 | } else { 42 | return false; 43 | }; 44 | }; 45 | 46 | // 发送系统消息 47 | // 同时向多人发送消息时,toUserId传入数组。 toUserId=['user01','user02','user03'] 48 | exports.messageSystemPublish = function* (fromUserId, toUserId, objectName, content, optional) { 49 | var url = this.genURL('/message/system/publish'); 50 | var post_data = { 51 | fromUserId: fromUserId, 52 | toUserId: toUserId, 53 | objectName: objectName, 54 | content: content, 55 | }; 56 | if (optional && typeof optional === 'object') { 57 | post_data = extend(post_data, optoinal); 58 | }; 59 | var opts = this.genPostData(post_data); 60 | var ret_data = yield * this.request(url, opts); 61 | if (ret_data.code == 200) { 62 | return true; 63 | } else { 64 | return false; 65 | }; 66 | }; 67 | 68 | // 发送系统模板消息 69 | exports.messageSystemPublishTemplate = function* (fromUserId, toUserId, objectName, content, values, pushContent, pushData) { 70 | var url = this.genURL('/message/system/publish_template'); 71 | var post_data = { 72 | fromUserId: fromUserId, 73 | toUserId: toUserId, 74 | objectName: objectName, 75 | content: content, 76 | values: values, 77 | pushContent: pushContent, 78 | pushData: pushData, 79 | }; 80 | var opts = this.genPostJsonData(post_data); 81 | var ret_data = yield * this.request(url, opts); 82 | if (ret_data.code == 200) { 83 | return true; 84 | } else { 85 | return false; 86 | }; 87 | }; 88 | 89 | // 发送群组消息 90 | exports.messageGroupPublish = function* (fromUserId, toGroupId, objectName, content, optional) { 91 | var url = this.genURL('/message/group/publish'); 92 | var post_data = { 93 | fromUserId: fromUserId, 94 | toGroupId: toGroupId, 95 | objectName: objectName, 96 | content: content, 97 | }; 98 | if (optional && typeof optional === 'object') { 99 | post_data = extend(post_data, optoinal); 100 | }; 101 | var opts = this.genPostData(post_data); 102 | var ret_data = yield * this.request(url, opts); 103 | if (ret_data.code == 200) { 104 | return true; 105 | } else { 106 | return false; 107 | }; 108 | }; 109 | 110 | // 发送聊天室消息 111 | // 说明:一个用户向聊天室发送消息 112 | // 方法名:/message/chatroom/publish 113 | // 调用频率:每秒钟限 100 次 114 | // 签名方法:请参考 通用 API 接口签名规则 115 | // URL:https://api.cn.ronghub.com/message/chatroom/publish.[format] 116 | // [format] 表示返回格式,可以为 json 或 xml,注意不要带 [ ]。 117 | // HTTP 方法:POST 118 | // ---------------表单参数------------- 119 | // 名称 类型 说明 120 | // fromUserId String 发送人用户 Id。(必传) 121 | // toChatroomId String 接收聊天室Id,提供多个本参数可以实现向多个聊天室发送消息。(必传) 122 | // objectName String 消息类型,参考融云消息类型表.消息标志;可自定义消息类型。(必传) 123 | // content String 发送消息内容,参考融云消息类型表.示例说明;如果 objectName 为自定义消息类型,该参数可自定义格式。(必传) 124 | 125 | exports.messageChatroomPublish = function* (fromUserId, toChatroomId, objectName, content) { 126 | var url = this.genURL('/message/chatroom/publish'); 127 | var post_data = { 128 | fromUserId: fromUserId, 129 | toChatroomId: toChatroomId, 130 | objectName: objectName, 131 | content: content, 132 | }; 133 | var opts = this.genPostData(post_data); 134 | var ret_data = yield * this.request(url, opts); 135 | if (ret_data.code == 200) { 136 | return true; 137 | } else { 138 | return false; 139 | }; 140 | }; 141 | 142 | // 发送广播消息 143 | // 说明:发送消息给一个应用下的所有注册用户,如用户未在线会对满足条件(绑定手机终端)的用户发送 Push 信息,会话类型为 SYSTEM。 144 | // 方法名:/message/broadcast 145 | // 调用频率:每小时只能发送 1 次,每天最多发送 3 次。 146 | // 签名方法:请参考 通用 API 接口签名规则 147 | // URL:https://api.cn.ronghub.com/message/broadcast.[format] 148 | // [format] 表示返回格式,可以为 json 或 xml,注意不要带 [ ]。 149 | // HTTP 方法:POST 150 | // ---------------表单参数------------- 151 | // 名称 类型 说明 152 | // fromUserId String 发送人用户 Id。(必传) 153 | // objectName String 消息类型,参考融云消息类型表.消息标志;可自定义消息类型。(必传) 154 | // content String 发送消息内容,参考融云消息类型表.示例说明;如果 objectName 为自定义消息类型,该参数可自定义格式。(必传) 155 | // pushContent String 定义显示的 Push 内容,如果 objectName 为融云内置消息类型时,则发送后用户一定会收到 Push 信息。 如果为自定义消息,则 pushContent 为自定义消息显示的 Push 内容,如果不传则用户不会收到 Push 通知。(可选) 156 | // pushData String Push 通知附加的 payload 字段,字段名为 appData。(可选) 157 | // os String 针对操作系统发送 Push,值为 iOS 表示对 iOS 手机用户发送 Push ,为 Android 时表示对 Android 手机用户发送 Push ,如对所有用户发送 Push 信息,则不需要传 os 参数。(可选) 158 | 159 | exports.messageBroadcast = function* (fromUserId, objectName, content, optional) { 160 | var url = this.genURL('/message/broadcast'); 161 | var post_data = { 162 | fromUserId: fromUserId, 163 | objectName: objectName, 164 | content: content, 165 | }; 166 | if (optional && typeof optional === 'object') { 167 | post_data = extend(post_data, optoinal); 168 | }; 169 | var opts = this.genPostData(post_data); 170 | var ret_data = yield * this.request(url, opts); 171 | if (ret_data.code == 200) { 172 | return true; 173 | } else { 174 | return false; 175 | }; 176 | }; -------------------------------------------------------------------------------- /lib/api_user.js: -------------------------------------------------------------------------------- 1 | var extend = require('util')._extend; 2 | 3 | /** 4 | * 刷新用户信息 5 | * http://www.rongcloud.cn/docs/server.html#刷新用户信息_方法 6 | * 举例: 7 | * ``` 8 | * // 刷新用户信息 9 | * var flag = yield api.refresh(userid, , ); 10 | * if (flag){ 11 | * // 操作成功 12 | * } else { 13 | * // 操作失败 14 | * } 15 | * ``` 16 | * @param {String} userid 用户的userid(必填) 17 | * @param {String} name 姓名(选填) 18 | * @param {String} portrait_url 头像url(选填) 19 | * 20 | */ 21 | exports.refresh = function* (userId, name, portrait_url) { 22 | var url = this.genURL('/user/refresh'); 23 | var post_data = { 24 | userId: userId 25 | }; 26 | if (name) { 27 | post_data['name'] = name; 28 | }; 29 | if (portrait_url) { 30 | post_data['portraitUri'] = portrait_url; 31 | }; 32 | var opts = this.genPostData(post_data); 33 | var ret_data = yield * this.request(url, opts); 34 | if (ret_data.code == 200) { 35 | return true; 36 | } else { 37 | return false; 38 | }; 39 | }; 40 | 41 | /** 42 | * 检测用户是否在线 43 | * http://www.rongcloud.cn/docs/server.html#检查用户在线状态_方法 44 | * 举例: 45 | * ``` 46 | * // 检测用户是否在线 47 | * var flag = yield api.checkOnline(userid); 48 | * if (flag){ 49 | * // 在线 50 | * } else { 51 | * // 不在线 52 | * } 53 | * ``` 54 | * @param {String} userid 用户的userid(必填) 55 | */ 56 | exports.checkOnline = function* (userId) { 57 | var url = this.genURL('/user/checkOnline'); 58 | var post_data = { 59 | userId: userId 60 | }; 61 | var opts = this.genPostData(post_data); 62 | var ret_data = yield * this.request(url, opts); 63 | if (ret_data.code == 200) { 64 | if (ret_data.status == '0') { 65 | return false; 66 | } else if (ret_data.status == '1') { 67 | return true; 68 | } else { 69 | return false; 70 | }; 71 | } else { 72 | return false; 73 | }; 74 | }; 75 | 76 | /** 77 | * 封禁用户 78 | * http://www.rongcloud.cn/docs/server.html#封禁用户_方法 79 | * 举例: 80 | * ``` 81 | * // 封禁用户 82 | * var flag = yield api.userBlock(userid, minute); 83 | * if (flag){ 84 | * // 操作成功 85 | * } else { 86 | * // 操作失败 87 | * } 88 | * ``` 89 | * @param {String} userid 用户的userid(必填) 90 | * @param {String} minute 封禁时长,单位为分钟,最大值为43200分钟。(必填) 91 | * 92 | */ 93 | exports.userBlock = function* (userId, minute) { 94 | var url = this.genURL('/user/block'); 95 | var post_data = { 96 | userId: userId, 97 | minute: minute 98 | }; 99 | var opts = this.genPostData(post_data); 100 | var ret_data = yield * this.request(url, opts); 101 | if (ret_data.code == 200) { 102 | return true; 103 | } else { 104 | return false; 105 | }; 106 | }; 107 | 108 | // 解除封禁用户 109 | /** 110 | * 解除封禁用户 111 | * http://www.rongcloud.cn/docs/server.html#解除封禁用户_方法 112 | * 举例: 113 | * ``` 114 | * // 解除封禁用户 115 | * var flag = yield api.userUnblock(userid); 116 | * if (flag){ 117 | * // 操作成功 118 | * } else { 119 | * // 操作失败 120 | * } 121 | * ``` 122 | * @param {String} userid 用户的userid(必填) 123 | * 124 | */ 125 | exports.userUnblock = function* (userId) { 126 | var url = this.genURL('/user/unblock'); 127 | var post_data = { 128 | userId: userId 129 | }; 130 | var opts = this.genPostData(post_data); 131 | var ret_data = yield * this.request(url, opts); 132 | if (ret_data.code == 200) { 133 | return true; 134 | } else { 135 | return false; 136 | }; 137 | }; 138 | 139 | /** 140 | * 获取被封禁用户 141 | * http://www.rongcloud.cn/docs/server.html#获取被封禁用户_方法 142 | * 举例: 143 | * ``` 144 | * // 获取被封禁用户 145 | * var users = yield api.userBlockQuery(userid); 146 | * if (users){ 147 | * // 操作成功,返回被封禁的用户清单 148 | * } else { 149 | * // 操作失败 150 | * } 151 | * ``` 152 | * @param {String} userid 用户的userid(必填) 153 | * 154 | */ 155 | exports.userBlockQuery = function* (userId) { 156 | var url = this.genURL('/user/block/query'); 157 | var post_data = { 158 | userId: userId 159 | }; 160 | var opts = this.genPostData(post_data); 161 | var ret_data = yield * this.request(url, opts); 162 | if (ret_data.code == 200) { 163 | return ret_data.users; 164 | } else { 165 | return null; 166 | }; 167 | }; 168 | 169 | /** 170 | * 添加用户到黑名单 171 | * http://www.rongcloud.cn/docs/server.html#添加用户到黑名单_方法 172 | * 举例: 173 | * ``` 174 | * // 添加用户到黑名单 175 | * var flag = yield api.userBlacklistAdd(userid, blackUserId); 176 | * if (flag){ 177 | * // 操作成功 178 | * } else { 179 | * // 操作失败 180 | * } 181 | * ``` 182 | * @param {String} userid 用户的userid(必填) 183 | * @param {String} blackUserId 被加黑的用户Id。(必填) 184 | * 185 | */ 186 | exports.userBlacklistAdd = function* (userId, blackUserId) { 187 | var url = this.genURL('/user/blacklist/add'); 188 | var post_data = { 189 | userId: userId, 190 | blackUserId: blackUserId 191 | }; 192 | var opts = this.genPostData(post_data); 193 | var ret_data = yield * this.request(url, opts); 194 | if (ret_data.code == 200) { 195 | return true; 196 | } else { 197 | return false; 198 | }; 199 | }; 200 | 201 | /** 202 | * 从黑名单中移除用户 203 | * http://www.rongcloud.cn/docs/server.html#从黑名单中移除用户_方法 204 | * 举例: 205 | * ``` 206 | * // 从黑名单中移除用户 207 | * var flag = yield api.userBlacklistRemove(userid, blackUserId); 208 | * if (flag){ 209 | * // 操作成功 210 | * } else { 211 | * // 操作失败 212 | * } 213 | * ``` 214 | * @param {String} userid 用户的userid(必填) 215 | * @param {String} blackUserId 被移除的用户Id。(必填) 216 | * 217 | */ 218 | exports.userBlacklistRemove = function* (userId, blackUserId) { 219 | var url = this.genURL('/user/blacklist/remove'); 220 | var post_data = { 221 | userId: userId, 222 | blackUserId: blackUserId 223 | }; 224 | var opts = this.genPostData(post_data); 225 | var ret_data = yield * this.request(url, opts); 226 | if (ret_data.code == 200) { 227 | return true; 228 | } else { 229 | return false; 230 | }; 231 | }; 232 | 233 | /** 234 | * 获取某用户的黑名单列表 235 | * http://www.rongcloud.cn/docs/server.html#获取某用户的黑名单列表_方法 236 | * 举例: 237 | * ``` 238 | * // 获取某用户的黑名单列表 239 | * var users = yield api.userBlacklistQuery(userid); 240 | * if (users){ 241 | * // 操作成功,返回黑名单列表的用户清单 242 | * } else { 243 | * // 操作失败 244 | * } 245 | * ``` 246 | * @param {String} userid 用户的userid(必填) 247 | * 248 | */ 249 | exports.userBlacklistQuery = function* (userId) { 250 | var url = this.genURL('/user/blacklist/query'); 251 | var post_data = { 252 | userId: userId 253 | }; 254 | var opts = this.genPostData(post_data); 255 | var ret_data = yield * this.request(url, opts); 256 | if (ret_data.code == 200) { 257 | return ret_data.users; 258 | } else { 259 | return null; 260 | }; 261 | }; -------------------------------------------------------------------------------- /lib/api_wordfilter.js: -------------------------------------------------------------------------------- 1 | var extend = require('util')._extend; 2 | 3 | // 敏感词服务 4 | // 设置敏感词后,App 中用户不会收到含有敏感词的消息内容。 5 | 6 | // 添加敏感词 7 | // 方法名:/wordfilter/add 8 | // 签名方法:请参考 通用 API 接口签名规则 9 | // URL:https://api.cn.ronghub.com/wordfilter/add.[format] 10 | // [format] 表示返回格式,可以为 json 或 xml,注意不要带 [ ]。 11 | // HTTP 方法:POST 12 | // ---------------表单参数------------- 13 | // 名称 类型 说明 14 | // word String 敏感词,最长不超过 32 个字符。(必传) 15 | /** 16 | * 添加敏感词 17 | * http://www.rongcloud.cn/docs/server.html#添加敏感词_方法 18 | * 举例: 19 | * ``` 20 | * // 添加敏感词 21 | * var flag = yield api.wordfilterAdd(word); 22 | * if (flag){ 23 | * // 操作成功 24 | * } else { 25 | * // 操作失败 26 | * } 27 | * ``` 28 | * @param {String} word 敏感词,最长不超过 32 个字符。(必填) 29 | * 30 | */ 31 | exports.wordfilterAdd = function* (word) { 32 | var url = this.genURL('/wordfilter/add'); 33 | var post_data = { 34 | word: word 35 | }; 36 | var opts = this.genPostData(post_data); 37 | var ret_data = yield * this.request(url, opts); 38 | if (ret_data.code == 200) { 39 | return true; 40 | } else { 41 | return false; 42 | }; 43 | }; 44 | 45 | // 移除敏感词 46 | // 说明:从敏感词列表中,移除某一敏感词。 47 | // 方法名:/wordfilter/delete 48 | // 签名方法:请参考 通用 API 接口签名规则 49 | // URL:https://api.cn.ronghub.com/wordfilter/delete.[format] 50 | // [format] 表示返回格式,可以为 json 或 xml,注意不要带 [ ]。 51 | // HTTP 方法:POST 52 | // ---------------表单参数------------- 53 | // 名称 类型 说明 54 | // word String 敏感词,最长不超过 32 个字符。(必传) 55 | /** 56 | * 移除敏感词 57 | * http://www.rongcloud.cn/docs/server.html#移除敏感词_方法 58 | * 举例: 59 | * ``` 60 | * // 移除敏感词 61 | * var flag = yield api.wordfilterDelete(word); 62 | * if (flag){ 63 | * // 操作成功 64 | * } else { 65 | * // 操作失败 66 | * } 67 | * ``` 68 | * @param {String} word 敏感词,最长不超过 32 个字符。(必填) 69 | * 70 | */ 71 | exports.wordfilterDelete = function* (word) { 72 | var url = this.genURL('/wordfilter/delete'); 73 | var post_data = { 74 | word: word 75 | }; 76 | var opts = this.genPostData(post_data); 77 | var ret_data = yield * this.request(url, opts); 78 | if (ret_data.code == 200) { 79 | return true; 80 | } else { 81 | return false; 82 | }; 83 | }; 84 | 85 | // 查询敏感词列表 86 | // 方法名:/wordfilter/list 87 | // 签名方法:请参考 通用 API 接口签名规则 88 | // URL:https://api.cn.ronghub.com/wordfilter/list.[format] 89 | // [format] 表示返回格式,可以为 json 或 xml,注意不要带 [ ]。 90 | // HTTP 方法:POST 91 | /** 92 | * 查询敏感词列表 93 | * http://www.rongcloud.cn/docs/server.html#查询敏感词列表_方法 94 | * 举例: 95 | * ``` 96 | * // 查询敏感词列表 97 | * var words = yield api.wordfilterList(); 98 | * if (words){ 99 | * // 操作成功,敏感词列表 100 | * } else { 101 | * // 操作失败 102 | * } 103 | * ``` 104 | * 105 | */ 106 | exports.wordfilterList = function* () { 107 | var url = this.genURL('/wordfilter/list'); 108 | var post_data = {}; 109 | var opts = this.genPostData(post_data); 110 | var ret_data = yield * this.request(url, opts); 111 | if (ret_data.code == 200) { 112 | return ret_data.words; 113 | } else { 114 | return null; 115 | }; 116 | }; 117 | -------------------------------------------------------------------------------- /lib/util.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * 对提交参数一层封装,当POST JSON,并且结果也为JSON时使用 */ 3 | exports.postJSON = function (data) { 4 | return { 5 | dataType: 'json', 6 | method: 'POST', 7 | data: JSON.stringify(data), 8 | headers: { 9 | 'Content-Type': 'application/json' 10 | } 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "co-rongcloud-api", 3 | "version": "1.1.1", 4 | "description": "融云服务端Node库API,ES6版本", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "make test-all" 8 | }, 9 | "config": { 10 | "travis-cov": { 11 | "threshold": 98 12 | } 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git://github.com/nick-ma/co-rongcloud-api.git" 17 | }, 18 | "keywords": [ 19 | "rongcloud", 20 | "rongyun" 21 | ], 22 | "dependencies": { 23 | "co-fs": "^1.2.0", 24 | "formstream": ">=0.0.8", 25 | "httpx": "^1.0.0", 26 | "streamx": "^1.0.0", 27 | "crypto": "*" 28 | }, 29 | "devDependencies": { 30 | "mocha": "*", 31 | "co-mocha": "1.0.3", 32 | "expect.js": "*", 33 | "travis-cov": "*", 34 | "coveralls": "*", 35 | "mocha-lcov-reporter": "*", 36 | "muk": "*", 37 | "rewire": "*", 38 | "istanbul-harmony": "*" 39 | }, 40 | "author": { 41 | "name": "Nick Ma" 42 | }, 43 | "license": "MIT", 44 | "readmeFilename": "README.md", 45 | "directories": { 46 | "test": "test" 47 | } 48 | } 49 | --------------------------------------------------------------------------------