Enford hace 5 años
padre
commit
04424fb1de
Se han modificado 100 ficheros con 71368 adiciones y 0 borrados
  1. 242 0
      src/main/webapp/static/bos/bosupload.js
  2. 21 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/README.md
  3. 53363 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/dist/baidubce-sdk.bundle.js
  4. 24 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/dist/baidubce-sdk.bundle.min.js
  5. 45 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/index.js
  6. 69 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/package.json
  7. 51 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/publish/publish_to_bos.js
  8. 165 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/auth.js
  9. 220 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/bcc_client.js
  10. 132 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/bce_base_client.js
  11. 349 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/bcs_client.js
  12. 1060 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/bos_client.js
  13. 490 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/bts/models.js
  14. 262 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/bts_client.js
  15. 237 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/cfc_client.js
  16. 34 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/config.js
  17. 82 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/crypto.js
  18. 408 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/doc_client.js
  19. 223 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/face_client.js
  20. 64 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/headers.js
  21. 225 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/helper.js
  22. 437 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/http_client.js
  23. 111 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/iot_client.js
  24. 284 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/lss_client.js
  25. 469 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/mct_client.js
  26. 234 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/media_client.js
  27. 1012 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/mime.types.js
  28. 83 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/multipart.js
  29. 90 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/ocr_client.js
  30. 287 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/qns_client.js
  31. 176 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/ses_client.js
  32. 41 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/strings.js
  33. 70 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/sts.js
  34. 146 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/tsdb_admin_client.js
  35. 226 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/tsdb_data_client.js
  36. 283 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod/Media.js
  37. 98 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod/Notification.js
  38. 107 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod/Player.js
  39. 108 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod/PresetGroup.js
  40. 71 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod/Statistic.js
  41. 82 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod/StrategyGroup.js
  42. 133 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod_client.js
  43. 43 0
      src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/wm_stream.js
  44. 275 0
      src/main/webapp/static/bos/node_modules/async/CHANGELOG.md
  45. 19 0
      src/main/webapp/static/bos/node_modules/async/LICENSE
  46. 56 0
      src/main/webapp/static/bos/node_modules/async/README.md
  47. 50 0
      src/main/webapp/static/bos/node_modules/async/all.js
  48. 42 0
      src/main/webapp/static/bos/node_modules/async/allLimit.js
  49. 37 0
      src/main/webapp/static/bos/node_modules/async/allSeries.js
  50. 52 0
      src/main/webapp/static/bos/node_modules/async/any.js
  51. 43 0
      src/main/webapp/static/bos/node_modules/async/anyLimit.js
  52. 38 0
      src/main/webapp/static/bos/node_modules/async/anySeries.js
  53. 68 0
      src/main/webapp/static/bos/node_modules/async/apply.js
  54. 51 0
      src/main/webapp/static/bos/node_modules/async/applyEach.js
  55. 37 0
      src/main/webapp/static/bos/node_modules/async/applyEachSeries.js
  56. 110 0
      src/main/webapp/static/bos/node_modules/async/asyncify.js
  57. 289 0
      src/main/webapp/static/bos/node_modules/async/auto.js
  58. 170 0
      src/main/webapp/static/bos/node_modules/async/autoInject.js
  59. 17 0
      src/main/webapp/static/bos/node_modules/async/bower.json
  60. 94 0
      src/main/webapp/static/bos/node_modules/async/cargo.js
  61. 58 0
      src/main/webapp/static/bos/node_modules/async/compose.js
  62. 43 0
      src/main/webapp/static/bos/node_modules/async/concat.js
  63. 65 0
      src/main/webapp/static/bos/node_modules/async/concatLimit.js
  64. 36 0
      src/main/webapp/static/bos/node_modules/async/concatSeries.js
  65. 66 0
      src/main/webapp/static/bos/node_modules/async/constant.js
  66. 61 0
      src/main/webapp/static/bos/node_modules/async/detect.js
  67. 48 0
      src/main/webapp/static/bos/node_modules/async/detectLimit.js
  68. 38 0
      src/main/webapp/static/bos/node_modules/async/detectSeries.js
  69. 43 0
      src/main/webapp/static/bos/node_modules/async/dir.js
  70. 5609 0
      src/main/webapp/static/bos/node_modules/async/dist/async.js
  71. 2 0
      src/main/webapp/static/bos/node_modules/async/dist/async.min.js
  72. 1 0
      src/main/webapp/static/bos/node_modules/async/dist/async.min.map
  73. 66 0
      src/main/webapp/static/bos/node_modules/async/doDuring.js
  74. 39 0
      src/main/webapp/static/bos/node_modules/async/doUntil.js
  75. 59 0
      src/main/webapp/static/bos/node_modules/async/doWhilst.js
  76. 76 0
      src/main/webapp/static/bos/node_modules/async/during.js
  77. 82 0
      src/main/webapp/static/bos/node_modules/async/each.js
  78. 45 0
      src/main/webapp/static/bos/node_modules/async/eachLimit.js
  79. 111 0
      src/main/webapp/static/bos/node_modules/async/eachOf.js
  80. 41 0
      src/main/webapp/static/bos/node_modules/async/eachOfLimit.js
  81. 35 0
      src/main/webapp/static/bos/node_modules/async/eachOfSeries.js
  82. 37 0
      src/main/webapp/static/bos/node_modules/async/eachSeries.js
  83. 73 0
      src/main/webapp/static/bos/node_modules/async/ensureAsync.js
  84. 50 0
      src/main/webapp/static/bos/node_modules/async/every.js
  85. 42 0
      src/main/webapp/static/bos/node_modules/async/everyLimit.js
  86. 37 0
      src/main/webapp/static/bos/node_modules/async/everySeries.js
  87. 45 0
      src/main/webapp/static/bos/node_modules/async/filter.js
  88. 37 0
      src/main/webapp/static/bos/node_modules/async/filterLimit.js
  89. 35 0
      src/main/webapp/static/bos/node_modules/async/filterSeries.js
  90. 61 0
      src/main/webapp/static/bos/node_modules/async/find.js
  91. 48 0
      src/main/webapp/static/bos/node_modules/async/findLimit.js
  92. 38 0
      src/main/webapp/static/bos/node_modules/async/findSeries.js
  93. 78 0
      src/main/webapp/static/bos/node_modules/async/foldl.js
  94. 44 0
      src/main/webapp/static/bos/node_modules/async/foldr.js
  95. 82 0
      src/main/webapp/static/bos/node_modules/async/forEach.js
  96. 45 0
      src/main/webapp/static/bos/node_modules/async/forEachLimit.js
  97. 111 0
      src/main/webapp/static/bos/node_modules/async/forEachOf.js
  98. 41 0
      src/main/webapp/static/bos/node_modules/async/forEachOfLimit.js
  99. 35 0
      src/main/webapp/static/bos/node_modules/async/forEachOfSeries.js
  100. 0 0
      src/main/webapp/static/bos/node_modules/async/forEachSeries.js

+ 242 - 0
src/main/webapp/static/bos/bosupload.js

@@ -0,0 +1,242 @@
+
+stsAccessKeyId = ""
+stsAccessKeySecret = ""
+stsToken = ""
+var checkpoint_temp;
+var requestUrl;
+var returnUrl;
+var str;
+var buckName='newxgccpm'
+
+function multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size, cpt) {
+    console.log("-----------------------start");
+    // let BosClient = baidubce.sdk.BosClient
+    //     // let config = {
+    //     //     endpoint: 'http://su.bcebos.com',
+    //     //     credentials: {
+    //     //         ak: '9915286aab2949949b489e8ab3f70a09',           //您的AK
+    //     //         sk: '069036bdb93c4bc59c4995ccc543243e'       //您的SK
+    //     //     }
+    //     // }
+    //     // let client = new BosClient(config);
+        multitest(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size, cpt);
+};
+
+function multitest (storeAs, file,attachmentId,attachmentFlag,uploadPath,divId, size,cpt) {
+    // var buffer = new Buffer('123')
+    var formdata = new FormData();
+    formdata.append("storeAs",storeAs);
+    formdata.append("file",file);
+    var names =  storeAs.split("/");
+    var name = names[names.length-1];
+    $.ajax({
+        type:'post',
+        url:realPath+"/a/bos/upload",
+        data:formdata,
+        contentType: false,
+        processData: false,
+        // progress: function* (percent, cpt) {
+        //     console.log(cpt);
+        //     console.log('Progress: ' + percent);
+        //     var p = Math.floor(percent*100);
+        //     $("#jindutiao"+divId).attr("style","width: "+p+"%");
+        //     $("#jindutiao"+divId).attr("aria-valuenow",p+"%");
+        //     $("#baifenbi"+divId).html(p+"%");
+        //     $("#fileName"+divId).html(name);
+        // }
+        success:function (data1) {
+            if(data1.code==='1'){
+                returnUrl = realPath+"/a/sys/workattachment/saveAttachment";
+                var p = Math.floor(1*100);
+                $("#jindutiao"+divId).attr("style","width: "+p+"%");
+                $("#jindutiao"+divId).attr("aria-valuenow",p+"%");
+                $("#baifenbi"+divId).html(p+"%");
+                $("#fileName"+divId).html(name);
+                $.ajax({
+                    type:'post',
+                    url:returnUrl,
+                    data:{
+                        "attachmentName":file['name'],
+                        "attachmentId":attachmentId,
+                        "attachmentFlag":attachmentFlag,
+                        "url":data1.url
+                    },
+                    success:function(data){
+                        // console.log('ajax requst : ' + data.status);
+                        console.log('url : ' + data.url);
+                        if(data.status=="Success"){
+                            parent.layer.msg("上传成功!",{icon:1});
+                            var lenght =$(".trIdAdds").length;
+                            if (size != 0){
+                                lenght += size;
+                            }
+                            var addFile = "addFile"+divId;
+                            var str = '<tr class="trIdAdds">'+
+                                '<td class="text-center">' ;
+                            if (isContains("jpg,png,gif,bmp,jpeg",data.type)){
+                                str = str +'<img src="'+data1.url+'" width="50" height="50" onclick="openDialogView(\'预览\',\''+realPath+ '/a/sys/picturepreview/picturePreview?url=' +data1.url+ '\',\'90%\',\'90%\')" alt="'+data.attachmentName+'"/>';
+                            }else if(isContains("pdf",data.type)){
+                                str = str + '<a class="attention-info" href="javascript:void(0)" onclick="preview(\'预览\',\''+data1.url+'\',\'90%\',\'90%\',\'1\')">'+data.attachmentName+'</a>';
+                            }else {
+                                str = str + '<a class="attention-info" href="javascript:void(0)" onclick="preview(\'预览\',\''+data1.url+'\',\'90%\',\'90%\')">'+data.attachmentName+'</a>';
+                            }
+                            str = str +'</td>'+
+                                '<td >'+data.createByName+'</td>'+
+                                '<td >'+data.createDate+
+                                '<input name="workAttachments['+lenght+'].id" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value=""/>'+
+                                '<input name="workAttachments['+lenght+'].attachmentId" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.attachmentId+'"/>'+
+                                '<input name="workAttachments['+lenght+'].url" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data1.url+'"/>'+
+                                '<input name="workAttachments['+lenght+'].attachmentName" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.attachmentName+'"/>'+
+                                '<input name="workAttachments['+lenght+'].createBy.id" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.createBy+'"/>'+
+                                '<input name="workAttachments['+lenght+'].type" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.type+'"/>'+
+                                '<input name="workAttachments['+lenght+'].attachmentFlag" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.attachmentFlag+'"/>'+
+                                '</td>'+
+                                '<td class="op-td">'+
+                                '<div class="op-btn-box">' +
+                                // '<a href="javascript:location.href=\''+realPath+'/a/workfullmanage/workFullManage/downLoadAttach?file=\'+encodeURIComponent(\''+data.url+'\');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>'+
+                                '<a href="'+data1.url+'" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>'+
+                                '<a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,\''+realPath+'/a/sys/workattachment/deleteFileFromAliyun?url='+data.url+'&id='+data.id+'&type=2\',\''+addFile+'\',\''+divId+'\')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>'+
+                                '</div>' +
+                                '</td>'+
+                                '</tr>';
+                            console.log("file:"+divId);
+                            console.log("str="+str);
+                            $("#file"+divId).append(str);
+                            // $("img").not(".upload_ico").each(function () {
+                            //     var num = 1 ;
+                            //     $(this).live("click",function () {
+                            //         var flag = num%2;
+                            //         if(flag == 1){
+                            //             $(this).css("width","90%");
+                            //             $(this).css("height","90%");
+                            //             num++;
+                            //         }else if(flag ==0){
+                            //             $(this).css("width","50px");
+                            //             $(this).css("height","50px");
+                            //             num++;
+                            //         }
+                            //     })
+                            // });
+                        }else {
+                            parent.layer.msg("上传失败!",{icon:2});
+                        }
+                    }
+                })
+            }else {
+                parent.layer.msg("上传失败!",{icon:2});
+            }
+        }
+    })
+    // var names =  storeAs.split("/");
+    // var name = names[names.length-1];
+    // client.putObjectFromString(buckName,file, '/1/1'
+    // ).then(function (result) {
+    //     console.log("uploadPath:"+uploadPath);
+    //     console.log("rusult:"+result);
+    //     console.log("end-------result:");
+    //     returnUrl = realPath+"/a/sys/workattachment/saveAttachment";
+    //     $.ajax({
+    //         type:'post',
+    //         url:returnUrl,
+    //         data:{
+    //             "attachmentName":file['name'],
+    //             "attachmentId":attachmentId,
+    //             "attachmentFlag":attachmentFlag,
+    //             "url":uploadPath
+    //         },
+    //         success:function(data){
+    //             console.log('ajax requst : ' + data.status);
+    //             if(data.status=="Success"){
+    //                 parent.layer.msg("上传成功!",{icon:1});
+    //                 var lenght =$(".trIdAdds").length;
+    //                 if (size != 0){
+    //                     lenght += size;
+    //                 }
+    //                 var addFile = "addFile"+divId;
+    //                 var str = '<tr class="trIdAdds">'+
+    //                     '<td class="text-center">' ;
+    //                 if (isContains("jpg,png,gif,bmp,jpeg",data.type)){
+    //                     str = str +'<img src="'+data.url+'" width="50" height="50" onclick="openDialogView(\'预览\',\''+realPath+ '/a/sys/picturepreview/picturePreview?url=' +data.url+ '\',\'90%\',\'90%\')" alt="'+data.attachmentName+'"/>';
+    //                 }else if(isContains("pdf",data.type)){
+    //                     str = str + '<a class="attention-info" href="javascript:void(0)" onclick="preview(\'预览\',\''+data.url+'\',\'90%\',\'90%\',\'1\')">'+data.attachmentName+'</a>';
+    //                 }else {
+    //                     str = str + '<a class="attention-info" href="javascript:void(0)" onclick="preview(\'预览\',\''+data.url+'\',\'90%\',\'90%\')">'+data.attachmentName+'</a>';
+    //                 }
+    //                 str = str +'</td>'+
+    //                     '<td >'+data.createByName+'</td>'+
+    //                     '<td >'+data.createDate+
+    //                     '<input name="workAttachments['+lenght+'].id" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value=""/>'+
+    //                     '<input name="workAttachments['+lenght+'].attachmentId" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.attachmentId+'"/>'+
+    //                     '<input name="workAttachments['+lenght+'].url" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.url+'"/>'+
+    //                     '<input name="workAttachments['+lenght+'].attachmentName" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.attachmentName+'"/>'+
+    //                     '<input name="workAttachments['+lenght+'].createBy.id" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.createBy+'"/>'+
+    //                     '<input name="workAttachments['+lenght+'].type" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.type+'"/>'+
+    //                     '<input name="workAttachments['+lenght+'].attachmentFlag" type="hidden" readonly="readonly" maxlength="20" style="width:140px;" class="form-control" value="'+data.attachmentFlag+'"/>'+
+    //                     '</td>'+
+    //                     '<td class="op-td">'+
+    //                     '<div class="op-btn-box">' +
+    //                     '<a href="javascript:location.href=\''+realPath+'/a/workfullmanage/workFullManage/downLoadAttach?file=\'+encodeURIComponent(\''+data.url+'\');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>'+
+    //                     '<a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,\''+realPath+'/a/sys/workattachment/deleteFileFromAliyun?url='+encodeURIComponent(data.url)+'&id='+data.id+'&type=2\',\''+addFile+'\',\''+divId+'\')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>'+
+    //                     '</div>' +
+    //                     '</td>'+
+    //                     '</tr>';
+    //                 console.log("file:"+divId);
+    //                 console.log("str="+str);
+    //                 $("#file"+divId).append(str);
+    //                 // $("img").not(".upload_ico").each(function () {
+    //                 //     var num = 1 ;
+    //                 //     $(this).live("click",function () {
+    //                 //         var flag = num%2;
+    //                 //         if(flag == 1){
+    //                 //             $(this).css("width","90%");
+    //                 //             $(this).css("height","90%");
+    //                 //             num++;
+    //                 //         }else if(flag ==0){
+    //                 //             $(this).css("width","50px");
+    //                 //             $(this).css("height","50px");
+    //                 //             num++;
+    //                 //         }
+    //                 //     })
+    //                 // });
+    //             }else {
+    //                 parent.layer.msg("上传失败!",{icon:2});
+    //             }
+    //         }
+    //     })
+    // }).catch(function (err) {
+    //     console.log("err------ err:");
+    //     console.log(err);
+    //     multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath, size,checkpoint_temp);
+    // });
+};
+
+function isContains(str, substr) {
+    return str.indexOf(substr) >= 0;
+}
+
+function deleteFileFromAliyun(obj,deleteUrl,addFile,divId){
+    console.log("---------------------------------:");
+    console.log(divId);
+    console.log("---------------------------------");
+    if (divId==null || divId== undefined || divId == ''){
+        divId = "_attachment";
+    }
+    var fileDiv = divId.substr(1,divId.length)+"_file";
+    console.log("---------------------------------:");
+    console.log(fileDiv);
+    console.log("---------------------------------");
+    $("#"+fileDiv).val("");
+    $.ajax({
+        type:"post",
+        url:deleteUrl,
+        success:function(data){
+            if(data.str){
+                parent.layer.msg('删除成功',{icon:1});
+                $(obj).parent().parent().parent().remove();
+                $("#"+addFile).hide();
+            }else {
+                parent.layer.msg('删除失败',{icon:2});
+            }
+        }
+    });
+}

+ 21 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/README.md

@@ -0,0 +1,21 @@
+Baidu Cloud Engine JavaScript SDK
+====
+
+[![Build Status](https://travis-ci.org/baidubce/bce-sdk-js.svg?branch=master)](https://travis-ci.org/baidubce/bce-sdk-js)
+[![NPM version](https://img.shields.io/npm/v/@baiducloud/sdk.svg?style=flat)](https://www.npmjs.com/package/@baiducloud/sdk)
+[![Coverage Status](https://coveralls.io/repos/github/baidubce/bce-sdk-js/badge.svg?branch=master)](https://coveralls.io/github/baidubce/bce-sdk-js?branch=master)
+[![Dependencies](https://img.shields.io/david/baidubce/bce-sdk-js.svg?style=flat)](https://david-dm.org/baidubce/bce-sdk-js)
+[![DevDependencies](https://img.shields.io/david/dev/baidubce/bce-sdk-js.svg?style=flat)](https://david-dm.org/baidubce/bce-sdk-js)
+
+
+文档地址:<https://baidubce.github.io/bce-sdk-js/>
+
+## 通过NPM安装
+```shell
+    npm install @baiducloud/sdk
+```
+
+## 通过CDN引用
+```html
+    <script src="https://bce.bdstatic.com/lib/@baiducloud/sdk/1.0.0-rc.12/baidubce-sdk.bundle.min.js" ></script>
+```

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 53363 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/dist/baidubce-sdk.bundle.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 24 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/dist/baidubce-sdk.bundle.min.js


+ 45 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/index.js

@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file index.js
+ * @author leeight,mudio
+ */
+
+exports.Q = require('q');
+
+exports.version = require('./package.json').version;
+exports.crypto = require('./src/crypto');
+exports.strings = require('./src/strings');
+exports.STS = require('./src/sts');
+exports.Auth = require('./src/auth');
+exports.MimeType = require('./src/mime.types');
+
+exports.HttpClient = require('./src/http_client');
+exports.BceBaseClient  = require('./src/bce_base_client');
+
+exports.BosClient = require('./src/bos_client');
+exports.BcsClient = require('./src/bcs_client');
+exports.BccClient = require('./src/bcc_client');
+exports.SesClient = require('./src/ses_client');
+exports.QnsClient = require('./src/qns_client');
+exports.LssClient = require('./src/lss_client');
+exports.MctClient = require('./src/mct_client');
+exports.FaceClient = require('./src/face_client');
+exports.OCRClient = require('./src/ocr_client');
+exports.MediaClient = require('./src/media_client');
+exports.VodClient = require('./src/vod_client');
+exports.DocClient = require('./src/doc_client');
+exports.TsdbDataClient = require('./src/tsdb_data_client');
+exports.TsdbAdminClient = require('./src/tsdb_admin_client');
+exports.CfcClient = require('./src/cfc_client');
+exports.BtsClient = require('./src/bts_client');
+exports.IoTClient = require('./src/iot_client');

+ 69 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/package.json

@@ -0,0 +1,69 @@
+{
+  "_from": "@baiducloud/sdk",
+  "_id": "@baiducloud/sdk@1.0.0-rc.12",
+  "_inBundle": false,
+  "_integrity": "sha512-S1ncN5jbnSXKQSEu22qgvSHTJC0YYYiqGT8MCxhAaoV0VVKEtX99+IYs/NV4xUWTBkeRx9fFFq9gIsvV++2bhQ==",
+  "_location": "/@baiducloud/sdk",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "tag",
+    "registry": true,
+    "raw": "@baiducloud/sdk",
+    "name": "@baiducloud/sdk",
+    "escapedName": "@baiducloud%2fsdk",
+    "scope": "@baiducloud",
+    "rawSpec": "",
+    "saveSpec": null,
+    "fetchSpec": "latest"
+  },
+  "_requiredBy": [
+    "#USER",
+    "/"
+  ],
+  "_resolved": "https://registry.npmjs.org/@baiducloud/sdk/-/sdk-1.0.0-rc.12.tgz",
+  "_shasum": "a68563c09e87106eee2a4cc32d2fd9caf75ceb05",
+  "_spec": "@baiducloud/sdk",
+  "_where": "D:\\IDEA workspace\\total_process\\src\\main\\webapp\\static\\bos",
+  "authors": [
+    "leeight <leeight@gmail.com>",
+    "木休大人 <523317421@qq.com>"
+  ],
+  "bugs": {
+    "url": "https://github.com/baidubce/bce-sdk-js/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "async": "^2.6.1",
+    "debug": "^3.1.0",
+    "q": "^1.5.1",
+    "underscore": "^1.9.1",
+    "urlencode": "^1.1.0"
+  },
+  "deprecated": false,
+  "description": "Baidu Cloud Engine JavaScript SDK",
+  "devDependencies": {
+    "browserify": "10.2.6",
+    "coveralls": "^3.0.2",
+    "expect.js": "^0.3.1",
+    "fs-walk": "0.0.2",
+    "istanbul": "^0.4.5",
+    "mocha": "^5.2.0"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "homepage": "https://github.com/baidubce/bce-sdk-js#readme",
+  "license": "MIT",
+  "main": "index.js",
+  "name": "@baiducloud/sdk",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/baidubce/bce-sdk-js.git"
+  },
+  "scripts": {
+    "pack": "browserify -s baidubce.sdk index.js -o dist/baidubce-sdk.bundle.js && uglifyjs dist/baidubce-sdk.bundle.js --compress --mangle -o dist/baidubce-sdk.bundle.min.js",
+    "publish:bos": "node ./publish/publish_to_bos.js",
+    "test": "./test/run-all.sh"
+  },
+  "version": "1.0.0-rc.12"
+}

+ 51 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/publish/publish_to_bos.js

@@ -0,0 +1,51 @@
+/**
+ * client publisher: 发布程序到BOS上
+ *
+ * @file bosPubliser.js
+ * @author mudio(job.mudio@gmail.com)
+ */
+
+/* eslint-disable max-len, no-console */
+
+const path = require('path');
+const walk = require('fs-walk');
+const {BosClient} = require('../');
+
+const {version, name} = require('../package.json');
+
+const {BOS_AK, BOS_SK} = process.env;
+const client = new BosClient({
+    endpoint: 'https://bj.bcebos.com',
+    credentials: {ak: BOS_AK, sk: BOS_SK}
+});
+
+function uploadTo(bucketName, objectName, filePath) {
+    client.getObjectMetadata(bucketName, objectName).then(
+        () => console.log(`取消,已经存在 => ${objectName}`),
+        err => {
+            if (err.status_code === 404) {
+                client.putObjectFromFile(bucketName, objectName, filePath).then(
+                    () => console.log(`上传完毕 => ${objectName}`),
+                    ex => console.error(ex.message)
+                );
+            } else {
+                console.error(err.message);
+            }
+        }
+    );
+}
+
+function publish(distDir) {
+    walk.files(distDir, (basedir, filename) => {
+        const bucketName = 'bce-cdn';
+        const objectName = path.join('lib', name, version, filename);
+        uploadTo(bucketName, objectName, path.join(distDir, filename));
+    },
+    err => console.log(err.message));
+}
+
+if (BOS_AK && BOS_SK) {
+    publish(path.join(__dirname, '..', 'dist'));
+} else {
+    console.log('终止发布操作,请配置环境变量BOS_AK、BOS_SK。');
+}

+ 165 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/auth.js

@@ -0,0 +1,165 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/auth.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+
+var util = require('util');
+var u = require('underscore');
+
+var debug = require('debug')('bce-sdk:auth');
+
+var H = require('./headers');
+var strings = require('./strings');
+
+/**
+ * Auth
+ *
+ * @constructor
+ * @param {string} ak The access key.
+ * @param {string} sk The security key.
+ */
+function Auth(ak, sk) {
+    this.ak = ak;
+    this.sk = sk;
+}
+
+/**
+ * Generate the signature based on http://gollum.baidu.com/AuthenticationMechanism
+ *
+ * @param {string} method The http request method, such as GET, POST, DELETE, PUT, ...
+ * @param {string} resource The request path.
+ * @param {Object=} params The query strings.
+ * @param {Object=} headers The http request headers.
+ * @param {number=} timestamp Set the current timestamp.
+ * @param {number=} expirationInSeconds The signature validation time.
+ * @param {Array.<string>=} headersToSign The request headers list which will be used to calcualate the signature.
+ *
+ * @return {string} The signature.
+ */
+Auth.prototype.generateAuthorization = function (method, resource, params,
+                                                 headers, timestamp, expirationInSeconds, headersToSign) {
+
+    var now = timestamp ? new Date(timestamp * 1000) : new Date();
+    var rawSessionKey = util.format('bce-auth-v1/%s/%s/%d',
+        this.ak, now.toISOString().replace(/\.\d+Z$/, 'Z'), expirationInSeconds || 1800);
+    debug('rawSessionKey = %j', rawSessionKey);
+    var sessionKey = this.hash(rawSessionKey, this.sk);
+
+    var canonicalUri = this.uriCanonicalization(resource);
+    var canonicalQueryString = this.queryStringCanonicalization(params || {});
+
+    var rv = this.headersCanonicalization(headers || {}, headersToSign);
+    var canonicalHeaders = rv[0];
+    var signedHeaders = rv[1];
+    debug('canonicalUri = %j', canonicalUri);
+    debug('canonicalQueryString = %j', canonicalQueryString);
+    debug('canonicalHeaders = %j', canonicalHeaders);
+    debug('signedHeaders = %j', signedHeaders);
+
+    var rawSignature = util.format('%s\n%s\n%s\n%s',
+        method, canonicalUri, canonicalQueryString, canonicalHeaders);
+    debug('rawSignature = %j', rawSignature);
+    debug('sessionKey = %j', sessionKey);
+    var signature = this.hash(rawSignature, sessionKey);
+
+    if (signedHeaders.length) {
+        return util.format('%s/%s/%s', rawSessionKey, signedHeaders.join(';'), signature);
+    }
+
+    return util.format('%s//%s', rawSessionKey, signature);
+};
+
+Auth.prototype.uriCanonicalization = function (uri) {
+    return uri;
+};
+
+/**
+ * Canonical the query strings.
+ *
+ * @see http://gollum.baidu.com/AuthenticationMechanism#生成CanonicalQueryString
+ * @param {Object} params The query strings.
+ * @return {string}
+ */
+Auth.prototype.queryStringCanonicalization = function (params) {
+    var canonicalQueryString = [];
+    Object.keys(params).forEach(function (key) {
+        if (key.toLowerCase() === H.AUTHORIZATION.toLowerCase()) {
+            return;
+        }
+
+        var value = params[key] == null ? '' : params[key];
+        canonicalQueryString.push(key + '=' + strings.normalize(value));
+    });
+
+    canonicalQueryString.sort();
+
+    return canonicalQueryString.join('&');
+};
+
+/**
+ * Canonical the http request headers.
+ *
+ * @see http://gollum.baidu.com/AuthenticationMechanism#生成CanonicalHeaders
+ * @param {Object} headers The http request headers.
+ * @param {Array.<string>=} headersToSign The request headers list which will be used to calcualate the signature.
+ * @return {*} canonicalHeaders and signedHeaders
+ */
+Auth.prototype.headersCanonicalization = function (headers, headersToSign) {
+    if (!headersToSign || !headersToSign.length) {
+        headersToSign = [H.HOST, H.CONTENT_MD5, H.CONTENT_LENGTH, H.CONTENT_TYPE];
+    }
+    debug('headers = %j, headersToSign = %j', headers, headersToSign);
+
+    var headersMap = {};
+    headersToSign.forEach(function (item) {
+        headersMap[item.toLowerCase()] = true;
+    });
+
+    var canonicalHeaders = [];
+    Object.keys(headers).forEach(function (key) {
+        var value = headers[key];
+        value = u.isString(value) ? strings.trim(value) : value;
+        if (value == null || value === '') {
+            return;
+        }
+        key = key.toLowerCase();
+        if (/^x\-bce\-/.test(key) || headersMap[key] === true) {
+            canonicalHeaders.push(util.format('%s:%s',
+                // encodeURIComponent(key), encodeURIComponent(value)));
+                strings.normalize(key), strings.normalize(value)));
+        }
+    });
+
+    canonicalHeaders.sort();
+
+    var signedHeaders = [];
+    canonicalHeaders.forEach(function (item) {
+        signedHeaders.push(item.split(':')[0]);
+    });
+
+    return [canonicalHeaders.join('\n'), signedHeaders];
+};
+
+Auth.prototype.hash = function (data, key) {
+    var crypto = require('crypto');
+    var sha256Hmac = crypto.createHmac('sha256', key);
+    sha256Hmac.update(data);
+    return sha256Hmac.digest('hex');
+};
+
+module.exports = Auth;
+

+ 220 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/bcc_client.js

@@ -0,0 +1,220 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/bcc_client.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint fecs-camelcase:[2,{"ignore":["/opt_/"]}] */
+
+var util = require('util');
+
+var u = require('underscore');
+var debug = require('debug')('bce-sdk:BccClient');
+
+var BceBaseClient = require('./bce_base_client');
+
+
+/**
+ * BCC service api
+ *
+ * 内网API地址:http://api.bcc.bce-sandbox.baidu.com
+ * 沙盒API地址:http://bcc.bce-api.baidu.com
+ *
+ * @see http://gollum.baidu.com/BceDocumentation/BccOpenAPI#简介
+ *
+ * @constructor
+ * @param {Object} config The bcc client configuration.
+ * @extends {BceBaseClient}
+ */
+function BccClient(config) {
+    BceBaseClient.call(this, config, 'bcc', true);
+}
+util.inherits(BccClient, BceBaseClient);
+
+// --- BEGIN ---
+
+BccClient.prototype.listInstances = function (opt_options) {
+    var options = opt_options || {};
+    var params = u.extend(
+        {maxKeys: 1000},
+        u.pick(options, 'maxKeys', 'marker')
+    );
+
+    return this.sendRequest('GET', '/v1/instance', {
+        params: params,
+        config: options.config
+    });
+};
+
+function abstractMethod() {
+    throw new Error('unimplemented method');
+}
+
+// GET /instance/price
+BccClient.prototype.getPackages = function (opt_options) {
+    var options = opt_options || {};
+
+    return this.sendRequest('GET', '/v1/instance/price', {
+        config: options.config
+    });
+};
+
+// GET /image?marker={marker}&maxKeys={maxKeys}&imageType={imageType}
+BccClient.prototype.getImages = function (opt_options) {
+    var options = opt_options || {};
+
+    // imageType => All, System, Custom, Integration
+    var params = u.extend(
+        {maxKeys: 1000, imageType: 'All'},
+        u.pick(options, 'maxKeys', 'marker', 'imageType')
+    );
+
+    return this.sendRequest('GET', '/v1/image', {
+        config: options.config,
+        params: params
+    });
+};
+
+// POST /instance
+BccClient.prototype.createInstance = function (body, opt_options) {
+    var me = this;
+    return this.getClientToken().then(function (response) {
+        var options = opt_options || {};
+
+        var clientToken = response.body.token;
+        var params = {
+            clientToken: clientToken
+        };
+
+        /**
+        var body = {
+            // MICRO,SMALL,MEDIUM,LARGE,XLARGE,XXLARGE
+            instanceType: string,
+            imageId: string,
+            ?localDiskSizeInGB: int,
+            ?createCdsList: List<CreateCdsModel>,
+            ?networkCapacityInMbps: int,
+            ?purchaseCount: int,
+            ?name: string,
+            ?adminPass: string,
+            ?networkType: string,
+            ?noahNode: string
+        };
+        */
+
+        debug('createInstance, params = %j, body = %j', params, body);
+
+        return me.sendRequest('POST', '/v1/instance', {
+            config: options.config,
+            params: params,
+            body: JSON.stringify(body)
+        });
+    });
+};
+
+// GET /instance/{instanceId}
+BccClient.prototype.getInstance = function (id, opt_options) {
+    var options = opt_options || {};
+
+    return this.sendRequest('GET', '/v1/instance/' + id, {
+        config: options.config
+    });
+};
+
+// PUT /instance/{instanceId}?action=start
+BccClient.prototype.startInstance = function (id, opt_options) {
+    var options = opt_options || {};
+    var params = {
+        start: ''
+    };
+
+    return this.sendRequest('PUT', '/v1/instance/' + id, {
+        params: params,
+        config: options.config
+    });
+};
+
+// PUT /instance/{instanceId}?action=stop
+BccClient.prototype.stopInstance = function (id, opt_options) {
+    var options = opt_options || {};
+    var params = {
+        stop: ''
+    };
+
+    return this.sendRequest('PUT', '/v1/instance/' + id, {
+        params: params,
+        config: options.config
+    });
+};
+
+// PUT /instance/{instanceId}?action=reboot
+BccClient.prototype.restartInstance = function (id, opt_options) {
+    var options = opt_options || {};
+    var params = {
+        reboot: ''
+    };
+
+    return this.sendRequest('PUT', '/v1/instance/' + id, {
+        params: params,
+        config: options.config
+    });
+};
+
+// PUT /instance/{instanceId}?action=changePass
+BccClient.prototype.changeInstanceAdminPassword = abstractMethod;
+
+// PUT /instance/{instanceId}?action=rebuild
+BccClient.prototype.rebuildInstance = abstractMethod;
+
+// DELETE /instance/{instanceId}
+BccClient.prototype.deleteInstance = function (id, opt_options) {
+    var options = opt_options || {};
+
+    return this.sendRequest('DELETE', '/v1/instance/' + id, {
+        config: options.config
+    });
+};
+
+// PUT /instance/{instanceId}/securityGroup/{securityGroupId}?action=bind
+BccClient.prototype.joinSecurityGroup = abstractMethod;
+
+// PUT /instance/{instanceId}/securityGroup/{securityGroupId}?action=unbind
+BccClient.prototype.leaveSecurityGroup = abstractMethod;
+
+// GET /instance/{instanceId}/vnc
+BccClient.prototype.getVNCUrl = function (id, opt_options) {
+    var options = opt_options || {};
+
+    return this.sendRequest('GET', '/v1/instance/' + id + '/vnc', {
+        config: options.config
+    });
+};
+
+BccClient.prototype.getClientToken = function (opt_options) {
+    return this.sendRequest('POST', '/v1/token/create');
+};
+
+// --- E N D ---
+
+BccClient.prototype._generateClientToken = function () {
+    var clientToken = Date.now().toString(16) + (Number.MAX_VALUE * Math.random()).toString(16).substr(0, 8);
+    return 'ClientToken:' + clientToken;
+};
+
+
+
+module.exports = BccClient;
+
+

+ 132 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/bce_base_client.js

@@ -0,0 +1,132 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/bce_base_client.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+
+var util = require('util');
+var EventEmitter = require('events').EventEmitter;
+
+var Q = require('q');
+var u = require('underscore');
+
+var config = require('./config');
+var Auth = require('./auth');
+var HttpClient = require('./http_client');
+var H = require('./headers');
+
+/**
+ * BceBaseClient
+ *
+ * @constructor
+ * @param {Object} clientConfig The bce client configuration.
+ * @param {string} serviceId The service id.
+ * @param {boolean=} regionSupported The service supported region or not.
+ */
+function BceBaseClient(clientConfig, serviceId, regionSupported) {
+    EventEmitter.call(this);
+
+    this.config = u.extend({}, config.DEFAULT_CONFIG, clientConfig);
+    this.serviceId = serviceId;
+    this.regionSupported = !!regionSupported;
+
+    this.config.endpoint = this._computeEndpoint();
+
+    /**
+     * @type {HttpClient}
+     */
+    this._httpAgent = null;
+}
+util.inherits(BceBaseClient, EventEmitter);
+
+BceBaseClient.prototype._computeEndpoint = function () {
+    if (this.config.endpoint) {
+        return this.config.endpoint;
+    }
+
+    if (this.regionSupported) {
+        return util.format('%s://%s.%s.%s',
+            this.config.protocol,
+            this.serviceId,
+            this.config.region,
+            config.DEFAULT_SERVICE_DOMAIN);
+    }
+    return util.format('%s://%s.%s',
+        this.config.protocol,
+        this.serviceId,
+        config.DEFAULT_SERVICE_DOMAIN);
+};
+
+BceBaseClient.prototype.createSignature = function (credentials, httpMethod, path, params, headers) {
+    var revisionTimestamp = Date.now() + (this.timeOffset || 0);
+
+    headers[H.X_BCE_DATE] = new Date(revisionTimestamp).toISOString().replace(/\.\d+Z$/, 'Z');
+
+    return Q.fcall(function () {
+        var auth = new Auth(credentials.ak, credentials.sk);
+        return auth.generateAuthorization(httpMethod, path, params, headers, revisionTimestamp / 1000);
+    });
+};
+
+BceBaseClient.prototype.sendRequest = function (httpMethod, resource, varArgs) {
+    var defaultArgs = {
+        body: null,
+        headers: {},
+        params: {},
+        config: {},
+        outputStream: null
+    };
+    var args = u.extend(defaultArgs, varArgs);
+
+    var config = u.extend({}, this.config, args.config);
+    if (config.sessionToken) {
+        args.headers[H.SESSION_TOKEN] = config.sessionToken;
+    }
+
+    return this.sendHTTPRequest(httpMethod, resource, args, config);
+};
+
+BceBaseClient.prototype.sendHTTPRequest = function (httpMethod, resource, args, config) {
+    var client = this;
+
+    function doRequest() {
+        var agent = this._httpAgent = new HttpClient(config);
+        u.each(['progress', 'error', 'abort', 'timeout'], function (eventName) {
+            agent.on(eventName, function (evt) {
+                client.emit(eventName, evt);
+            });
+        });
+
+        return this._httpAgent.sendRequest(httpMethod, resource, args.body,
+            args.headers, args.params, u.bind(this.createSignature, this),
+            args.outputStream
+        );
+    }
+
+    return doRequest.call(client).catch(function(err) {
+        var serverTimestamp = new Date(err[H.X_BCE_DATE]).getTime();
+
+        BceBaseClient.prototype.timeOffset = serverTimestamp - Date.now();
+
+        if (err[H.X_STATUS_CODE] === 403 && err[H.X_CODE] === 'RequestTimeTooSkewed') {
+            return doRequest.call(client);
+        }
+
+        return Q.reject(err);
+    });
+};
+
+module.exports = BceBaseClient;
+

+ 349 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/bcs_client.js

@@ -0,0 +1,349 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/bcs_client.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+
+var crypto = require('crypto');
+var util = require('util');
+var path = require('path');
+var fs = require('fs');
+
+var u = require('underscore');
+
+var H = require('./headers');
+var HttpClient = require('./http_client');
+var BceBaseClient = require('./bce_base_client');
+var MimeType = require('./mime.types');
+
+var MAX_PUT_OBJECT_LENGTH = 5368709120; // 5G
+var MAX_USER_METADATA_SIZE = 2048; // 2 * 1024
+// var MIN_PART_NUMBER = 1;
+// var MAX_PART_NUMBER = 10000;
+
+
+/**
+ * BCS service api
+ *
+ * @see http://developer.baidu.com/wiki/index.php?title=docs/cplat/bcs/api
+ * @constructor
+ * @param {Object} config The bos client configuration.
+ * @extends {BceBaseClient}
+ */
+function BcsClient(config) {
+    BceBaseClient.call(this, config, 'bcs', true);
+}
+util.inherits(BcsClient, BceBaseClient);
+
+// --- BEGIN ---
+
+BcsClient.prototype.listBuckets = function (options) {
+    options = options || {};
+    return this.sendRequest('GET', {config: options.config});
+};
+
+BcsClient.prototype.createBucket = function (bucketName, options) {
+    options = options || {};
+
+    return this.sendRequest('PUT', {
+        bucketName: bucketName,
+        config: options.config
+    });
+};
+
+BcsClient.prototype.setBucketAcl = function (bucketName, acl, options) {
+    options = options || {};
+
+    var headers = {};
+    headers[H.CONTENT_TYPE] = 'application/json; charset=UTF-8';
+    return this.sendRequest('PUT', {
+        bucketName: bucketName,
+        body: JSON.stringify({accessControlList: acl}),
+        headers: headers,
+        params: {acl: ''},
+        config: options.config
+    });
+};
+
+BcsClient.prototype.setBucketCannedAcl = function (bucketName, cannedAcl, options) {
+    options = options || {};
+
+    var headers = {};
+    headers[H.X_BCE_ACL] = cannedAcl;
+    return this.sendRequest('PUT', {
+        bucketName: bucketName,
+        headers: headers,
+        params: {acl: ''},
+        config: options.config
+    });
+};
+
+BcsClient.prototype.getBucketAcl = function (bucketName, options) {
+    options = options || {};
+
+    return this.sendRequest('GET', {
+        bucketName: bucketName,
+        params: {acl: '1'},
+        config: options.config
+    });
+};
+
+BcsClient.prototype.deleteBucket = function (bucketName, options) {
+    options = options || {};
+
+    return this.sendRequest('DELETE', {
+        bucketName: bucketName,
+        config: options.config
+    });
+};
+
+BcsClient.prototype.deleteObject = function (bucketName, key, options) {
+    options = options || {};
+
+    return this.sendRequest('DELETE', {
+        bucketName: bucketName,
+        key: key,
+        config: options.config
+    });
+};
+
+BcsClient.prototype.listObjects = function (bucketName, options) {
+    options = options || {};
+
+    var params = u.extend({}, u.pick(options, 'start', 'limit'));
+
+    return this.sendRequest('GET', {
+        bucketName: bucketName,
+        params: params,
+        config: options.config
+    });
+};
+
+BcsClient.prototype.getObjectMetadata = function (bucketName, key, options) {
+    options = options || {};
+
+    return this.sendRequest('HEAD', {
+        bucketName: bucketName,
+        key: key,
+        config: options.config
+    });
+};
+
+BcsClient.prototype.putObject = function (bucketName, key, data, options) {
+    if (!key) {
+        throw new TypeError('key should not be empty.');
+    }
+
+    options = this._checkOptions(options || {});
+
+    return this.sendRequest('PUT', {
+        bucketName: bucketName,
+        key: key,
+        body: data,
+        headers: options.headers,
+        config: options.config
+    });
+};
+
+BcsClient.prototype.putObjectFromBlob = function (bucketName, key, blob, options) {
+    var headers = {};
+
+    // https://developer.mozilla.org/en-US/docs/Web/API/Blob/size
+    headers[H.CONTENT_LENGTH] = blob.size;
+    // 对于浏览器调用API的时候,默认不添加 H.CONTENT_MD5 字段,因为计算起来比较慢
+    // 而且根据 API 文档,这个字段不是必填的。
+    options = u.extend(headers, options);
+
+    return this.putObject(bucketName, key, blob, options);
+};
+
+
+BcsClient.prototype.putObjectFromString = function (bucketName, key, data, options) {
+    var headers = {};
+    headers[H.CONTENT_LENGTH] = Buffer.byteLength(data);
+    headers[H.CONTENT_MD5] = require('./crypto').md5sum(data, null, 'hex');
+    options = u.extend(headers, options);
+
+    return this.putObject(bucketName, key, data, options);
+};
+
+BcsClient.prototype.putObjectFromFile = function (bucketName, key, filename, options) {
+    options = options || {};
+
+    var headers = {};
+    headers[H.CONTENT_LENGTH] = fs.statSync(filename).size;
+
+    // 因为Firefox会在发起请求的时候自动给 Content-Type 添加 charset 属性
+    // 导致我们计算签名的时候使用的 Content-Type 值跟服务器收到的不一样,为了
+    // 解决这个问题,我们需要显式的声明Charset
+    headers[H.CONTENT_TYPE] = options[H.CONTENT_TYPE] || MimeType.guess(path.extname(filename));
+    options = u.extend(headers, options);
+
+    var fp = fs.createReadStream(filename);
+    if (!u.has(options, H.CONTENT_MD5)) {
+        var me = this;
+        return require('./crypto').md5file(filename, 'hex')
+            .then(function (md5sum) {
+                options[H.CONTENT_MD5] = md5sum;
+                return me.putObject(bucketName, key, fp, options);
+            });
+    }
+    return this.putObject(bucketName, key, fp, options);
+};
+
+/**
+ * 只返回MBO的签名(Method, Bucket Name, Object Name),对于上传的应用足够了.
+ *
+ * @see http://developer.baidu.com/wiki/index.php?title=docs/cplat/bcs/access/signed-url
+ * @param {Object} credentials ak和sk信息.
+ * @param {string} httpMethod The request method.
+ * @param {string} bucketName The bucket name.
+ * @param {string} objectName The object name.
+ *
+ * @return {string} The signature.
+ */
+BcsClient.prototype.createSignature = function (credentials, httpMethod, bucketName, objectName) {
+    var flag = 'MBO';
+    var body = [
+        'Method=' + httpMethod,
+        'Bucket=' + bucketName,
+        'Object=' + objectName
+    ].join('\n');
+
+    var content = flag + '\n' + body + '\n';
+
+    var hmac = crypto.createHmac('sha1', credentials.sk);
+    hmac.update(new Buffer(content, 'utf-8'));
+    var digest = encodeURIComponent(hmac.digest('base64')).replace(/%2F/g, '/');
+
+    return [flag, credentials.ak, digest].join(':');
+};
+
+// --- E N D ---
+
+BcsClient.prototype.sendRequest = function (httpMethod, varArgs) {
+    var defaultArgs = {
+        bucketName: null,
+        key: null,
+        body: null,
+        headers: {},
+        params: {},
+        config: {},
+        outputStream: null
+    };
+    var args = u.extend(defaultArgs, varArgs);
+
+    var config = u.extend({}, this.config, args.config);
+    var resource = '/';
+    if (args.bucketName) {
+        resource += args.bucketName;
+    }
+    if (args.key) {
+        resource += '/' + args.key;
+    }
+
+    var signature = this.createSignature(config.credentials,
+        httpMethod,
+        args.bucketName ? args.bucketName : '',
+        args.key ? ('/' + args.key) : '/');
+
+    var client = this;
+    var agent = this._httpAgent = new HttpClient(config);
+    u.each(['progress', 'error', 'abort', 'timeout'], function (eventName) {
+        agent.on(eventName, function (evt) {
+            client.emit(eventName, evt);
+        });
+    });
+
+    agent.buildQueryString = function (params) {
+        var qs = require('querystring').stringify(params);
+        if (qs) {
+            return 'sign=' + signature + '&' + qs;
+        }
+
+        // signature的值不应该被 encodeURIComponent
+        return 'sign=' + signature;
+    };
+
+    return agent.sendRequest(httpMethod, resource, args.body,
+        args.headers, args.params, null, args.outputStream);
+};
+
+
+BcsClient.prototype._checkOptions = function (options, allowedParams) {
+    var rv = {};
+
+    rv.config = options.config || {};
+    rv.headers = this._prepareObjectHeaders(options);
+    rv.params = u.pick(options, allowedParams || []);
+
+    return rv;
+};
+
+BcsClient.prototype._prepareObjectHeaders = function (options) {
+    var allowedHeaders = [
+        H.CONTENT_LENGTH,
+        H.CONTENT_ENCODING,
+        H.CONTENT_MD5,
+        H.CONTENT_TYPE,
+        H.CONTENT_DISPOSITION,
+        H.ETAG,
+        H.SESSION_TOKEN
+    ];
+    var metaSize = 0;
+    var headers = u.pick(options, function (value, key) {
+        if (allowedHeaders.indexOf(key) !== -1) {
+            return true;
+        }
+        else if (/^x\-bce\-meta\-/.test(key)) {
+            metaSize += Buffer.byteLength(key) + Buffer.byteLength('' + value);
+            return true;
+        }
+    });
+
+    if (metaSize > MAX_USER_METADATA_SIZE) {
+        throw new TypeError('Metadata size should not be greater than ' + MAX_USER_METADATA_SIZE + '.');
+    }
+
+    if (u.has(headers, H.CONTENT_LENGTH)) {
+        var contentLength = headers[H.CONTENT_LENGTH];
+        if (contentLength < 0) {
+            throw new TypeError('content_length should not be negative.');
+        }
+        else if (contentLength > MAX_PUT_OBJECT_LENGTH) { // 5G
+            throw new TypeError('Object length should be less than ' + MAX_PUT_OBJECT_LENGTH
+                + '. Use multi-part upload instead.');
+        }
+    }
+
+    if (u.has(headers, 'ETag')) {
+        var etag = headers.ETag;
+        if (!/^"/.test(etag)) {
+            headers.ETag = util.format('"%s"', etag);
+        }
+    }
+
+    if (!u.has(headers, H.CONTENT_TYPE)) {
+        headers[H.CONTENT_TYPE] = 'application/octet-stream';
+    }
+
+    return headers;
+};
+
+
+module.exports = BcsClient;
+
+

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1060 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/bos_client.js


+ 490 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/bts/models.js

@@ -0,0 +1,490 @@
+/*
+ * Copyright (c) 2019 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+var urlencode = require('urlencode');
+
+function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
+
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
+
+function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return !!right[Symbol.hasInstance](left); } else { return left instanceof right; } }
+
+function _classCallCheck(instance, Constructor) { if (!_instanceof(instance, Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+/**
+ * 列
+ * 
+ */
+var Cell = function Cell() {
+  _classCallCheck(this, Cell);
+
+  /**
+   * 列名,命名规则满足正则[a-zA-Z_][a-za-z0-9\_]{0,254}
+   * @type {string | null}
+   */
+  this.column = null;
+  /**
+   * 列值 rawurlencode后的string
+   * @type {string | null}
+   */
+
+  this.value = null;
+};
+
+
+/**
+ * 行
+ * 
+ */
+var Row =
+function () {
+  function Row() {
+    _classCallCheck(this, Row);
+
+    /**
+     * 行主键,需要urlencode
+     * @type{string | null}
+     */
+    this.rowkey = null;
+    /**
+     * cells 每个column, value对的列表
+     * @type{Array.Cell | null}
+     */
+
+    this.cells = null;
+  }
+
+  _createClass(Row, [{
+    key: "encode",
+    value: function encode(rowKey) {
+      return urlencode(rowKey);
+    }
+  }, {
+    key: "addCells",
+    value: function addCells(column) {
+      var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
+      this.cells = this.cells || [];
+      var newCell = new Cell();
+      newCell.column = column;
+
+      if (value !== null) {
+        newCell.value = urlencode(value);
+      }
+
+      this.cells.push(newCell);
+    }
+  }]);
+
+  return Row;
+}();
+
+
+/**
+ * CreateInstance请求参数结构体
+ * 
+ */
+var CreateInstanceRequest = function CreateInstanceRequest() {
+  _classCallCheck(this, CreateInstanceRequest);
+
+  /**
+   * 实例默认存储类型,仅支持HighPerformance和CommonPerformance
+   * @type {string | null}
+   */
+  this.storageType = null;
+};
+
+
+/**
+ * CreateTable请求参数结构体
+ * 
+ */
+var CreateTableRequest = function CreateTableRequest() {
+  _classCallCheck(this, CreateTableRequest);
+
+  /**
+   * 建表时固定传0,非0值代表更新表信息。如果不传body,默认为建表
+   * @type {number | null}
+   */
+  this.tableVersion = 0;
+  /**
+   * 数据压缩方式,可取以下值:"NONE"不压缩 "SNAPPY_ALL"使用snappy压缩 ,默认为NONE
+   * @type {string | null}
+   */
+
+  this.compressType = null;
+  /**
+   * 数据过期时间,为0时永不过期,单位秒。默认为0,即永不过期
+   * @type {number | null}
+   */
+
+  this.ttl = null;
+  /**
+   * 表存储类型,仅支持HighPerformance和CommonPerformance,若无此参数则默认使用Instance中定义的表存储类型
+   * @type {string | null}
+   */
+
+  this.storageType = null;
+  /**
+   * 最多保留版本数,取值范围[1, 50000]
+   * @type {number | null}
+   */
+
+  this.maxVersions = null;
+};
+
+
+/**
+ * UpdateTable请求参数结构体
+ * 
+ */
+var UpdateTableRequest = function UpdateTableRequest() {
+  _classCallCheck(this, UpdateTableRequest);
+
+  /**
+   * 必须先通过GET 获取表的版本信息后,再带入此次请求
+   * @type {number | null}
+   */
+  this.tableVersion = null;
+  /**
+   * 数据压缩方式,可取以下值:"NONE"不压缩 "SNAPPY_ALL"使用snappy压缩 ,默认为NONE
+   * @type {string | null}
+   */
+
+  this.compressType = null;
+  /**
+   * 数据过期时间,为0时永不过期,单位秒。默认为0,即永不过期
+   * @type {number | null}
+   */
+
+  this.ttl = null;
+  /**
+   * 最多保留版本数,取值范围[1, 50000]
+   * @type {number | null}
+   */
+
+  this.maxVersions = null;
+};
+
+
+/**
+ * PutRow请求参数结构体
+ * 
+ */
+var PutRowRequest =
+function () {
+  function PutRowRequest() {
+    _classCallCheck(this, PutRowRequest);
+
+    /**
+     * 行主键,需要rawurlencode
+     * @type {string | null}
+     */
+    this.rowkey = null;
+    /**
+     * 每个column,value对的列表
+     * @type {Array.<Cell> | null}
+     */
+
+    this.cells = null;
+  }
+
+  _createClass(PutRowRequest, [{
+    key: "addCells",
+    value: function addCells(column, value) {
+      this.cells = this.cells || [];
+      var newCell = new Cell();
+      newCell.column = column;
+      newCell.value = urlencode(value);
+      this.cells.push(newCell);
+    }
+  }, {
+    key: "encode",
+    value: function encode(rowKey) {
+      return urlencode(rowKey);
+    }
+  }]);
+
+  return PutRowRequest;
+}();
+
+
+/**
+ * BatchPutRowRequest 请求体
+ * 
+ */
+var BatchPutRowRequest =
+function () {
+  function BatchPutRowRequest() {
+    _classCallCheck(this, BatchPutRowRequest);
+
+    /**
+     * rows
+     * @type{Array.<Row> | null}
+     */
+    this.rows = null;
+  }
+
+  _createClass(BatchPutRowRequest, [{
+    key: "addRows",
+    value: function addRows(rowkey, column, value) {
+      this.rows = this.rows || [];
+      var newRow = new Row();
+      newRow.addCells(column, value);
+      newRow.rowkey = newRow.encode(rowkey);
+      this.rows.push(newRow);
+    }
+  }]);
+
+  return BatchPutRowRequest;
+}();
+
+
+/**
+ *  DeleteRowRequest 请求体
+ *  
+ */
+var DeleteRowRequest =
+function () {
+  function DeleteRowRequest() {
+    _classCallCheck(this, DeleteRowRequest);
+
+    /**
+     * 行主键,需要urlencode
+     * @type{string | null}
+     */
+    this.rowkey = null;
+    /**
+     * 待删除的column列表
+     * @type{Array.<Cell> | null}
+     */
+
+    this.cells = null;
+  }
+
+  _createClass(DeleteRowRequest, [{
+    key: "encode",
+    value: function encode(rowKey) {
+      return urlencode(rowKey);
+    }
+  }, {
+    key: "addCells",
+    value: function addCells() {
+      var column = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
+      this.cells = this.cells || [];
+
+      if (column != null) {
+        var newCell = new Cell();
+        newCell.column = urlencode(column);
+        this.cells.push(newCell);
+      }
+    }
+  }]);
+
+  return DeleteRowRequest;
+}();
+
+
+/**
+ * BatchDeleteRowRequest 请求体
+ * 
+ */
+var BatchDeleteRowRequest =
+function () {
+  function BatchDeleteRowRequest() {
+    _classCallCheck(this, BatchDeleteRowRequest);
+
+    /**
+     * rows
+     * @type{Array.<Row> | null}
+     */
+    this.rows = null;
+  }
+
+  _createClass(BatchDeleteRowRequest, [{
+    key: "addRows",
+    value: function addRows(rowkey, column) {
+      this.rows = this.rows || [];
+      var newRow = new Row();
+      newRow.addCells(column);
+      newRow.rowkey = newRow.encode(rowkey);
+      this.rows.push(newRow);
+    }
+  }]);
+
+  return BatchDeleteRowRequest;
+}();
+
+
+/**
+ *  GetRowRequest 请求体
+ *  
+ */
+var GetRowRequest =
+function () {
+  function GetRowRequest() {
+    _classCallCheck(this, GetRowRequest);
+
+    /**
+     * 行主键, 需要rawurlencode
+     * @type {string | null}
+     */
+    this.rowkey = null;
+    /**
+     * 待查询的column列表
+     * @type {Array.<Cell> | null}
+     */
+
+    this.cells = null;
+  }
+
+  _createClass(GetRowRequest, [{
+    key: "encode",
+    value: function encode(rowKey) {
+      return urlencode(rowKey);
+    }
+  }, {
+    key: "addCells",
+    value: function addCells() {
+      var column = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
+      this.cells = this.cells || [];
+
+      if (column != null) {
+        var newCell = new Cell();
+        newCell.column = column;
+        this.cells.push(newCell);
+      }
+    }
+  }]);
+
+  return GetRowRequest;
+}();
+
+
+/**
+ * BatchGetRowRequest 请求体
+ * 
+ */
+var BatchGetRowRequest =
+function () {
+  function BatchGetRowRequest() {
+    _classCallCheck(this, BatchGetRowRequest);
+
+    /**
+     * rows
+     * @type {Array.<Row> | null}
+     */
+    this.rows = null;
+  }
+
+  _createClass(BatchGetRowRequest, [{
+    key: "addRows",
+    value: function addRows(rowkey) {
+      var column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
+      this.rows = this.rows || [];
+      var newRow = new Row();
+
+      if (column !== null) {
+        newRow.addCells(column);
+      }
+
+      newRow.rowkey = newRow.encode(rowkey);
+      this.rows.push(newRow);
+    }
+  }]);
+
+  return BatchGetRowRequest;
+}();
+
+
+/**
+ * ScanRequest 请求体
+ * 
+ */
+var ScanRequest =
+function () {
+  function ScanRequest() {
+    _classCallCheck(this, ScanRequest);
+
+    /**
+     * scan的起始rowkey,需rawurlencode,不填时默认为表的第一个rowkey
+     * @type {string | null}
+     */
+    this.startRowkey = null;
+    /**
+     * 是否包含起始rowkey,默认包含
+     * @type {bool | null}
+     */
+
+    this.includeStart = true;
+    /**
+     * scan的终止rowkey,需rawurlencode,不填时默认为表的最后一个rowkey
+     * @type {string | null}
+     */
+
+    this.stopRowkey = null;
+    /**
+     * 是否包含终止rowkey,默认不包含
+     * @type {bool | null}
+     */
+
+    this.includeStop = false;
+    /**
+     * 待查询的column列表,不写默认返回全部列
+     * @type{Array<Cell> | null}
+     */
+
+    this.selector = null;
+    /**
+     * 限定查询行数,其值必须为整型,设为其他类型无效
+     * @type{int | null}
+     */
+
+    this.limit = null;
+  }
+
+  _createClass(ScanRequest, [{
+    key: "encode",
+    value: function encode(rowKey) {
+      return urlencode(rowKey);
+    }
+  }, {
+    key: "addCells",
+    value: function addCells() {
+      var column = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
+      this.selector = this.selector || [];
+
+      if (column != null) {
+        var newCell = new Cell();
+        newCell.column = column;
+        this.selector.push(newCell);
+      }
+    }
+  }]);
+
+  return ScanRequest;
+}();
+
+module.exports = {
+  Cell: Cell,
+  Row: Row,
+  CreateInstanceRequest: CreateInstanceRequest,
+  CreateTableRequest: CreateTableRequest,
+  UpdateTableRequest: UpdateTableRequest,
+  PutRowRequest: PutRowRequest,
+  BatchPutRowRequest: BatchPutRowRequest,
+  DeleteRowRequest: DeleteRowRequest,
+  BatchDeleteRowRequest: BatchDeleteRowRequest,
+  GetRowRequest: GetRowRequest,
+  BatchGetRowRequest: BatchGetRowRequest,
+  ScanRequest: ScanRequest
+};

+ 262 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/bts_client.js

@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2019 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+var util = require('util');
+
+var models = require('./bts/models');
+var BceBaseClient = require('./bce_base_client');
+
+var CreateInstanceRequest = models.CreateInstanceRequest;
+var CreateTableRequest = models.CreateTableRequest;
+var UpdateTableRequest = models.UpdateTableRequest;
+var PutRowRequest = models.PutRowRequest;
+var BatchPutRowRequest = models.BatchPutRowRequest;
+var DeleteRowRequest = models.DeleteRowRequest;
+var BatchDeleteRowRequest = models.BatchDeleteRowRequest;
+var GetRowRequest = models.GetRowRequest;
+var BatchGetRowRequest = models.BatchGetRowRequest;
+var ScanRequest = models.ScanRequest;
+
+/**
+ * Bts service api
+ *
+ *
+ * @see https://cloud.baidu.com/doc/BTS/s/Ljwvydqd9
+ *
+ * @constructor
+ * @param {Object} config The bts client configuration.
+ * @extends {BceBaseClient}
+ */
+
+function BtsClient(config) {
+    BceBaseClient.call(this, config, 'bts', true);
+}
+util.inherits(BtsClient, BceBaseClient);
+
+/**
+ * 列举实例 ListInstances
+ * @returns {*}
+ */
+BtsClient.prototype.listInstances = function () {
+    return this.sendRequest('GET', '/v1/instances', null);
+};
+
+/**
+ * 删除实例 DropInstance
+ * @param instanceName 实例名
+ * @returns {*}
+ */
+BtsClient.prototype.dropInstance = function (instanceName) {
+    return this.sendRequest('DELETE', '/v1/instance/' + instanceName, null);
+};
+
+/**
+ * 显示实例信息 ShowInstance
+ * @param instanceName 实例名
+ * @returns {*}
+ */
+BtsClient.prototype.showInstance = function (instanceName) {
+    return this.sendRequest('GET', '/v1/instance/' + instanceName, null);
+};
+
+/**
+ * 创建实例 CreateInstance
+ * @param instanceName 实例名
+ * @param createInstanceRequest CreateInstance请求体
+ * @returns {*}
+ */
+BtsClient.prototype.createInstance = function (instanceName, createInstanceRequest) {
+    return this.sendRequest('PUT', '/v1/instance/' + instanceName, {
+        body: JSON.stringify(createInstanceRequest)
+    });
+};
+
+/**
+ * 创建表 CreateTable
+ * @param instanceName 实例名
+ * @param tableName 表名
+ * @param createTableRequest CreateTable请求体
+ * @returns {*}
+ */
+BtsClient.prototype.createTable = function (instanceName, tableName, createTableRequest) {
+    return this.sendRequest('PUT', '/v1/instance/' + instanceName + '/table/' + tableName, {
+        body: JSON.stringify(createTableRequest)
+    });
+};
+
+/**
+ * 更新表 UpdateTable
+ * @param instanceName 实例名
+ * @param tableName 表名
+ * @param UpdateTableRequest UpdateTable请求体
+ * @returns {*}
+ */
+BtsClient.prototype.updateTable = function (instanceName, tableName, updateTableRequest) {
+    return this.sendRequest('PUT', '/v1/instance/' + instanceName + '/table/' + tableName, {
+        body: JSON.stringify(updateTableRequest)
+    });
+};
+
+/**
+ * 删除表 DropTable
+ * @param instanceName 实例名
+ * @param tableName 表名
+ * @returns {*}
+ */
+BtsClient.prototype.dropTable = function (instanceName, tableName) {
+    return this.sendRequest('DELETE', '/v1/instance/' + instanceName + '/table/' + tableName, null);
+};
+
+/**
+ * 显示表信息 ShowTable
+ * @param instanceName 实例名
+ * @param tableName 表名
+ * @param onlyState 设为true则响应只会返回tableState字段,主要用于建表成功后轮询状态使用
+ * @returns {*}
+ */
+BtsClient.prototype.showTable = function (instanceName, tableName, onlyState) {
+    var params = {
+        onlyState: ''
+    };
+    if (onlyState) {
+        return this.sendRequest('GET', '/v1/instance/' + instanceName + '/table/' + tableName, {
+            params: params
+        });
+    } else {
+        return this.sendRequest('GET', '/v1/instance/' + instanceName + '/table/' + tableName, null);
+    }
+};
+
+/**
+ * 列举所有表 ListTables
+ * @param instanceName 实例名
+ * @returns {*}
+ */
+BtsClient.prototype.listTables = function (instanceName) {
+    return this.sendRequest('GET', '/v1/instance/' + instanceName + '/tables', null);
+};
+
+/**
+ * 单条写入 PutRow
+ * @param instanceName 实例名
+ * @param tableName 表名
+ * @param putRowRequest PutRow请求体
+ * @returns {*}
+ */
+BtsClient.prototype.putRow = function (instanceName, tableName, putRowRequest) {
+    putRowRequest.rowkey = putRowRequest.encode(putRowRequest.rowkey);
+    return this.sendRequest('PUT', '/v1/instance/' + instanceName + '/table/' + tableName + '/row', {
+        body: JSON.stringify(putRowRequest)
+    });
+};
+
+/**
+ * 批量写入 BatchPutRow
+ * @param instanceName 实例名
+ * @param tableName 表名
+ * @param batchPutRowRequest batchPutRow 请求体
+ * @returns {*}
+ */
+BtsClient.prototype.batchPutRow = function (instanceName, tableName, batchPutRowRequest) {
+    return this.sendRequest('PUT', '/v1/instance/' + instanceName + '/table/' + tableName + '/rows', {
+        body: JSON.stringify(batchPutRowRequest)
+    });
+};
+
+/**
+ * 单条删除 DeleteRow
+ * @param instanceName 实例名
+ * @param tableName 表名
+ * @param deleteRowRequest deleteRow 请求体
+ * @returns {*}
+ */
+BtsClient.prototype.deleteRow = function (instanceName, tableName, deleteRowRequest) {
+    deleteRowRequest.rowkey = deleteRowRequest.encode(deleteRowRequest.rowkey);
+    return this.sendRequest('DELETE', '/v1/instance/' + instanceName + '/table/' + tableName + '/row', {
+        body: JSON.stringify(deleteRowRequest)
+    });
+};
+
+/**
+ * 批量删除 BatchDeleteRow
+ * @param instanceName 实例名
+ * @param tableName 表名
+ * @param batchDeleteRowRequest BatchDeleteRow 请求体
+ * @returns {*}
+ */
+BtsClient.prototype.batchDeleteRow = function (instanceName, tableName, batchDeleteRowRequest) {
+    return this.sendRequest('DELETE', '/v1/instance/' + instanceName + '/table/' + tableName + '/rows', {
+        body: JSON.stringify(batchDeleteRowRequest)
+    });
+};
+
+/**
+ * 单条随机读 GetRow
+ * @param instanceName 实例名
+ * @param tableName 表名
+ * @param getRowRequest GetRow 请求体
+ * @returns {*}
+ */
+BtsClient.prototype.getRow = function (instanceName, tableName, getRowRequest) {
+    getRowRequest.rowkey = getRowRequest.encode(getRowRequest.rowkey);
+    return this.sendRequest('GET', '/v1/instance/' + instanceName + '/table/' + tableName + '/row', {
+        body: JSON.stringify(getRowRequest)
+    });
+};
+
+/**
+ * 批量读 BatchGetRow
+ * @param instanceName 实例名
+ * @param tableName 表名
+ * @param batchGetRowRequest BatchGetRow 请求体
+ * @returns {*}
+ */
+BtsClient.prototype.batchGetRow = function (instanceName, tableName, batchGetRowRequest) {
+    return this.sendRequest('GET', '/v1/instance/' + instanceName + '/table/' + tableName + '/rows', {
+        body: JSON.stringify(batchGetRowRequest)
+    });
+};
+
+/**
+ * 区间读 Scan
+ * @param instanceName 实例名
+ * @param tableName 表名
+ * @param scanRowRequest Scan 请求体
+ * @returns {*}
+ */
+BtsClient.prototype.scan = function (instanceName, tableName, scanRowRequest) {
+    if (scanRowRequest.startRowkey !== null) {
+        scanRowRequest.startRowkey = scanRowRequest.encode(scanRowRequest.startRowkey);
+    }
+
+    if (scanRowRequest.stopRowkey !== null) {
+        scanRowRequest.stopRowkey = scanRowRequest.encode(scanRowRequest.stopRowkey);
+    }
+    return this.sendRequest('GET', '/v1/instance/' + instanceName + '/table/' + tableName + '/rows', {
+        body: JSON.stringify(scanRowRequest)
+    });
+};
+
+module.exports = {
+    BtsClient: BtsClient,
+    CreateInstanceRequest: CreateInstanceRequest,
+    CreateTableRequest: CreateTableRequest,
+    UpdateTableRequest: UpdateTableRequest,
+    PutRowRequest: PutRowRequest,
+    BatchPutRowRequest: BatchPutRowRequest,
+    DeleteRowRequest: DeleteRowRequest,
+    BatchDeleteRowRequest: BatchDeleteRowRequest,
+    GetRowRequest: GetRowRequest,
+    BatchGetRowRequest: BatchGetRowRequest,
+    ScanRequest: ScanRequest,
+};

+ 237 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/cfc_client.js

@@ -0,0 +1,237 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/cfc_client.js
+ * @author marspanda
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint fecs-camelcase:[2,{"ignore":["/opt_/"]}] */
+
+var util = require('util');
+var strings = require('./strings');
+
+var u = require('underscore');
+var debug = require('debug')('bce-sdk:CfcClient');
+
+var BceBaseClient = require('./bce_base_client');
+
+/**
+ * CFC service api
+ *
+ *
+ * @see https://cloud.baidu.com/doc/CFC/API.html 简介
+ *
+ * @constructor
+ * @param {Object} config The cfc client configuration.
+ * @extends {BceBaseClient}
+ */
+function CfcClient(config) {
+    BceBaseClient.call(this, config, 'cfc', true);
+}
+
+util.inherits(CfcClient, BceBaseClient);
+
+// --- BEGIN ---
+
+CfcClient.prototype.listFunctions = function (opt_options) {
+    var options = opt_options || {};
+    var params = u.extend(
+        u.pick(options, 'marker')
+    );
+    debug('params ', params);
+    return this.sendRequest('GET', '/v1/functions', {
+        params: params,
+        config: options.config
+    });
+};
+
+CfcClient.prototype.createFunction = function (body) {
+    /**
+     var body =
+     {
+       'Code': {
+         'ZipFile': 'string',
+         'Publish': false,
+         'DryRun': true
+       },
+       'Description': 'string',
+       'Timeout': 0,
+       'FunctionName': 'string',
+       'Handler': 'string',
+       'Runtime': 'string',
+       'MemorySize':128,
+       'Environment': {
+         'Variables': {
+           'additionalProp1': 'string',
+           'additionalProp2': 'string',
+           'additionalProp3': 'string'
+         }
+       }
+     };
+     */
+    debug('createFunction, body = %j', body);
+
+    return this.sendRequest('POST', '/v1/functions', {
+        params: {},
+        body: JSON.stringify(body)
+    });
+};
+
+CfcClient.prototype.getFunction = function (functionName, opt_options) {
+    var options = opt_options || {};
+    var params = u.extend(
+        u.pick(options, 'Qualifier')
+    );
+    return this.sendRequest('GET', '/v1/functions/' +  strings.normalize(functionName), {
+        params: params
+    });
+};
+
+CfcClient.prototype.deleteFunction = function (functionName, opt_options) {
+    var options = opt_options || {};
+    var params = u.extend(
+        u.pick(options, 'Qualifier')
+    );
+    return this.sendRequest('DELETE', '/v1/functions/' + functionName, {
+        params: params
+    });
+};
+
+CfcClient.prototype.invocations = function (functionName, body, opt_options) {
+    var options = opt_options || {};
+    var params = u.extend(
+        u.pick(options, 'Qualifier', 'invocationType', 'logType')
+    );
+    /**
+     var body =  {
+        'key3': 'value3',
+        'key2': 'value2',
+        'key1': 'value1'
+    }
+     */
+    return this.sendRequest('POST', '/v1/functions/' + strings.normalize(functionName) + '/invocations', {
+        params: params,
+        body: JSON.stringify(body)
+    });
+};
+
+CfcClient.prototype.invoke = CfcClient.prototype.invocations;
+
+CfcClient.prototype.updateFunctionCode = function (functionName, body) {
+    /**
+     var body =  {
+      'ZipFile': blob,
+      'Publish': false,
+      'DryRun': true
+    }
+     */
+    return this.sendRequest('PUT', '/v1/functions/' + functionName + '/code', {
+        body: JSON.stringify(body)
+    });
+};
+
+CfcClient.prototype.getFunctionConfiguration = function (functionName, opt_options) {
+    var options = opt_options || {};
+    var params = u.extend(
+        u.pick(options, 'Qualifier')
+    );
+    return this.sendRequest('GET', '/v1/functions/' + functionName + '/configuration', {
+        params: params
+    });
+};
+
+CfcClient.prototype.updateFunctionConfiguration = function (functionName, body) {
+    /**
+     var body = {
+          'Description': 'string',
+          'Timeout': 0,
+          'Handler': 'string',
+          'Runtime': 'string',
+          'Environment': {
+            'Variables': {
+              'additionalProp1': 'string',
+              'additionalProp2': 'string',
+              'additionalProp3': 'string'
+            }
+          }
+        }
+     */
+    return this.sendRequest('PUT', '/v1/functions/' + functionName + '/configuration', {
+        body: JSON.stringify(body)
+    });
+};
+
+CfcClient.prototype.listVersionsByFunction = function (functionName, opt_options) {
+    var options = opt_options || {};
+    var params = u.extend(
+        u.pick(options, 'Marker', 'MaxItems')
+    );
+    return this.sendRequest('GET', '/v1/functions/' + functionName + '/versions', {
+        params: params
+    });
+};
+CfcClient.prototype.publishVersion = function (functionName, description) {
+    var body = {};
+    if (description != null) {
+        body.Description = description;
+    }
+    return this.sendRequest('POST', '/v1/functions/' + functionName + '/versions', {
+        body: JSON.stringify(body)
+    });
+};
+CfcClient.prototype.createAlias = function (functionName, body) {
+    /**
+     var body = {
+            'FunctionVersion': 'string',
+            'Name': 'string',
+            'Description': 'string'
+        }
+     */
+    return this.sendRequest('POST', '/v1/functions/' + functionName + '/aliases', {
+        body: JSON.stringify(body)
+    });
+};
+CfcClient.prototype.getAlias = function (functionName, aliasName) {
+    return this.sendRequest('GET', '/v1/functions/' + functionName + '/aliases/' + aliasName, {});
+};
+
+CfcClient.prototype.updateAlias = function (functionName, aliasName, body) {
+    /**
+     var body = {
+            'FunctionVersion': 'string',
+            'Description': 'string'
+        }
+     */
+    return this.sendRequest('PUT', '/v1/functions/' + functionName + '/aliases/' + aliasName, {
+        body: JSON.stringify(body)
+    });
+};
+
+CfcClient.prototype.deleteAlias = function (functionName, aliasName) {
+    return this.sendRequest('DELETE', '/v1/functions/' + functionName + '/aliases/' + aliasName, {});
+};
+
+CfcClient.prototype.listAliases = function (functionName, opt_options) {
+    var options = opt_options || {};
+    var params = u.extend(
+        u.pick(options, 'FunctionVersion', 'Marker', 'MaxItems')
+    );
+    return this.sendRequest('GET', '/v1/functions/' + functionName + '/aliases/', {
+        params: params
+    });
+};
+
+module.exports = CfcClient;
+
+

+ 34 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/config.js

@@ -0,0 +1,34 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/config.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+
+exports.DEFAULT_SERVICE_DOMAIN = 'baidubce.com';
+
+exports.DEFAULT_CONFIG = {
+    protocol: 'http',
+    region: 'bj'
+};
+
+
+
+
+
+
+
+
+
+

+ 82 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/crypto.js

@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/crypto.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+
+var fs = require('fs');
+var crypto = require('crypto');
+
+var Q = require('q');
+
+exports.md5sum = function (data, enc, digest) {
+    if (!Buffer.isBuffer(data)) {
+        data = new Buffer(data, enc || 'UTF-8');
+    }
+
+    var md5 = crypto.createHash('md5');
+    md5.update(data);
+
+    return md5.digest(digest || 'base64');
+};
+
+exports.md5stream = function (stream, digest) {
+    var deferred = Q.defer();
+
+    var md5 = crypto.createHash('md5');
+    stream.on('data', function (chunk) {
+        md5.update(chunk);
+    });
+    stream.on('end', function () {
+        deferred.resolve(md5.digest(digest || 'base64'));
+    });
+    stream.on('error', function (error) {
+        deferred.reject(error);
+    });
+
+    return deferred.promise;
+};
+
+exports.md5file = function (filename, digest) {
+    return exports.md5stream(fs.createReadStream(filename), digest);
+};
+
+exports.md5blob = function (blob, digest) {
+    var deferred = Q.defer();
+
+    var reader = new FileReader();
+    reader.readAsArrayBuffer(blob);
+    reader.onerror = function (e) {
+        deferred.reject(reader.error);
+    };
+    reader.onloadend = function (e) {
+        if (e.target.readyState === FileReader.DONE) {
+            var content = e.target.result;
+            var md5 = exports.md5sum(content, null, digest);
+            deferred.resolve(md5);
+        }
+    };
+    return deferred.promise;
+};
+
+
+
+
+
+
+
+
+
+

+ 408 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/doc_client.js

@@ -0,0 +1,408 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/doc_client.js
+ * @author guofan
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint fecs-camelcase:[2,{"ignore":["/opt_/"]}] */
+
+var fs = require('fs');
+var path = require('path');
+var util = require('util');
+var builtinUrl = require('url');
+
+var Q = require('q');
+var u = require('underscore');
+var debug = require('debug')('bce-sdk:Document');
+
+var BosClient = require('./bos_client');
+var BceBaseClient = require('./bce_base_client');
+var UploadHelper = require('./helper');
+var crypto = require('./crypto');
+
+var DATA_TYPE_FILE     = 1;
+var DATA_TYPE_BUFFER   = 2;
+var DATA_TYPE_BLOB     = 4;
+
+/**
+ * 文档转码任务接口(Job/Transcoding API)
+ * http://bce.baidu.com/doc/DOC/API.html#.1D.1E.B0.1E.6C.74.0C.6D.C1.68.D2.57.6F.70.EA.F1
+ *
+ * @constructor
+ * @param {Object} config The doc client configuration.
+ * @extends {BceBaseClient}
+ */
+function Document(config) {
+    BceBaseClient.call(this, config, 'doc', false);
+
+    this._documentId = null;
+}
+util.inherits(Document, BceBaseClient);
+
+// --- B E G I N ---
+
+Document.prototype._buildUrl = function () {
+    var baseUrl = '/v2/document';
+    var extraPaths = u.toArray(arguments);
+
+    if (extraPaths.length) {
+        baseUrl += '/' + extraPaths.join('/');
+    }
+
+    return baseUrl;
+};
+
+Document.prototype.getId = function () {
+    return this._documentId;
+};
+
+Document.prototype.setId = function (documentId) {
+    this._documentId = documentId;
+    return this;
+};
+
+/**
+ * Create a document transfer job from local file, buffer, readable stream or blob.
+ *
+ * @param {Blob|Buffer|string} data The document data. If the data type
+ *   is string, which means the file path.
+ * @param {Object=} opt_options The extra options.
+ * @return {Promise}
+ */
+Document.prototype.create = function (data, opt_options) {
+    var options = u.extend({}, opt_options);
+    var dataType = -1;
+    var pattern = /^bos:\/\//;
+
+    if (u.isString(data)) {
+        if (pattern.test(data)) {
+            // createFromBos
+            try {
+                var parsed = builtinUrl.parse(data);
+                var bucket = parsed.host;
+                var object = parsed.pathname.substr(1);
+
+                options = u.extend(options, parsed.query);
+                var title = options.title || path.basename(object);
+                var format = options.format || path.extname(object).substr(1);
+                var notification = options.notification;
+                return this.createFromBos(bucket, object,
+                    title, format, notification);
+            }
+            catch (error) {
+                return Q.reject(error);
+            }
+        }
+
+        dataType = DATA_TYPE_FILE;
+        options.format = options.format || path.extname(data).substr(1);
+        options.title = options.title || path.basename(data, path.extname(data));
+    }
+    else if (Buffer.isBuffer(data)) {
+        if (options.format == null || options.title == null) {
+            return Q.reject(new Error('buffer type required options.format and options.title'));
+        }
+        dataType = DATA_TYPE_BUFFER;
+    }
+    else if (typeof Blob !== 'undefined' && data instanceof Blob) {
+        dataType = DATA_TYPE_BLOB;
+        options.format = options.format || path.extname(data.name).substr(1);
+        options.title = options.title || path.basename(data.name, path.extname(data.name));
+    }
+    else {
+        return Q.reject(new Error('Unsupported dataType.'));
+    }
+
+    if (!options.title || !options.format) {
+        return Q.reject(new Error('`title` and `format` are required.'));
+    }
+
+    if (options.meta.md5) {
+        return this._doCreate(data, options);
+    }
+
+    var self = this;
+    if (dataType === DATA_TYPE_FILE) {
+        return crypto.md5stream(fs.createReadStream(data), 'hex')
+            .then(function (md5) {
+                options.meta.md5 = md5;
+                return self._doCreate(data, options);
+            });
+    }
+    else if (dataType === DATA_TYPE_BLOB) {
+        return crypto.md5blob(data, 'hex')
+            .then(function (md5) {
+                options.meta.md5 = md5;
+                return self._doCreate(data, options);
+            });
+    }
+    return this._doCreate(data, options);
+};
+
+Document.prototype._doCreate = function (data, options) {
+    var documentId = null;
+    var bucket = null;
+    var object = null;
+    var bosEndpoint = null;
+
+    var self = this;
+
+    return self.register(options)
+        .then(function (response) {
+            debug('register[response = %j]', response);
+
+            documentId = response.body.documentId;
+            bucket = response.body.bucket;
+            object = response.body.object;
+            bosEndpoint = response.body.bosEndpoint;
+
+            var bosConfig = u.extend({}, self.config, {endpoint: bosEndpoint});
+            var bosClient = new BosClient(bosConfig);
+
+            return UploadHelper.upload(bosClient, bucket, object, data);
+        })
+        .then(function (response) {
+            debug('upload[response = %j]', response);
+            return self.publish();
+        })
+        .then(function (response) {
+            debug('publish[response = %j]', response);
+            response.body = {
+                documentId: documentId,
+                bucket: bucket,
+                object: object,
+                bosEndpoint: bosEndpoint
+            };
+            return response;
+        });
+};
+
+Document.prototype.register = function (options) {
+    debug('register[options = %j]', options);
+
+    var self = this;
+    var url = this._buildUrl();
+    return this.sendRequest('POST', url, {
+        params: {register: ''},
+        headers: {'Content-Type': 'application/json'},
+        body: JSON.stringify(options)
+    }).then(function (response) {
+        self.setId(response.body.documentId);
+        return response;
+    });
+};
+
+Document.prototype.publish = function (documentId) {
+    var url = this._buildUrl(documentId || this._documentId);
+    return this.sendRequest('PUT', url, {
+        params: {publish: ''}
+    });
+};
+
+Document.prototype.get = function (documentId) {
+    var url = this._buildUrl(documentId || this._documentId);
+    return this.sendRequest('GET', url);
+};
+
+/**
+ * Get docId and token to render the document in the browser.
+ *
+ * ```html
+ * <div id="reader"></div>
+ * <script src="http://bce.bdstatic.com/doc/doc_reader.js"></script>
+ * <script>
+ * var host = location.host;
+ * var option = {
+ *     docId: <docId>,
+ *     token: <token>,
+ *     host: <host>
+ * };
+ * new Document('reader', option);
+ * </script>
+ * ```
+ *
+ * @param {string} documentId The document Id.
+ * @return {Promise}
+ */
+Document.prototype.read = function (documentId) {
+    var url = this._buildUrl(documentId || this._documentId);
+    return this.sendRequest('GET', url, {
+        params: {read: ''}
+    });
+};
+
+/**
+ * 通过文档的唯一标识 documentId 获取指定文档的下载链接。仅对状态为PUBLISHED/FAILED的文档有效。
+ *
+ * @param {string=} documentId 需要下载的文档id
+ * @return {Promise.<{documentId: string, downloadUrl: string}, any>}
+ */
+Document.prototype.download = function (documentId) {
+    var url = this._buildUrl(documentId || this._documentId);
+    return this.sendRequest('GET', url, {
+        params: {download: ''}
+    });
+};
+
+/**
+ * Create document from bos object.
+ *
+ * 1. The BOS bucket must in bj-region.
+ * 2. The BOS bucket permission must be public-read.
+ *
+ * 用户需要将源文档所在BOS bucket权限设置为公共读,或者在自定义权限设置中为开放云文档转码服务账号
+ *(沙盒:798c20fa770840438a29efd66cdccf7f,线上:183db8cd3d5a4bf9a94459f89a7a3a91)添加READ权限。
+ *
+ * 文档转码服务依赖文档的md5,为提高转码性能,文档转码服务需要用户为源文档指定md5;
+ * 因此用户需要在上传文档至BOS时设置自定义meta header x-bce-meta-md5来记录源文档md5。
+ * 补充说明:实际上当用户没有为源文档设置x-bce-meta-md5 header时,文档转码服务还会
+ * 尝试根据BOS object ETag解析源文档md5,如果解析失败(ETag以'-'开头),才会真正报错。
+ *
+ * @param {string} bucket The bucket name in bj region.
+ * @param {string} object The object name.
+ * @param {string} title The document title.
+ * @param {string=} opt_format The document extension is possible.
+ * @param {string=} opt_notification The notification name.
+ * @return {Promise}
+ */
+Document.prototype.createFromBos = function (
+    bucket, object, title, opt_format, opt_notification) {
+    var url = this._buildUrl();
+
+    var body = {
+        bucket: bucket,
+        object: object,
+        title: title
+    };
+
+    var format = opt_format || path.extname(object).substr(1);
+    if (!format) {
+        throw new Error('Document format parameter required');
+    }
+
+    // doc, docx, ppt, pptx, xls, xlsx, vsd, pot, pps, rtf, wps, et, dps, pdf, txt, epub
+    // 默认值:BOS Object后缀名(当BOS Object有后缀时)
+    body.format = format;
+    if (opt_notification) {
+        body.notification = opt_notification;
+    }
+
+    debug('createFromBos:arguments = [%j], body = [%j]', arguments, body);
+    var self = this;
+    return this.sendRequest('POST', url, {
+        params: {source: 'bos'},
+        headers: {'Content-Type': 'application/json'},
+        body: JSON.stringify(body)
+    }).then(function (response) {
+        self.setId(response.body.documentId);
+        return response;
+    });
+};
+
+Document.prototype.removeAll = function () {
+    var self = this;
+    return self.list().then(function (response) {
+        var asyncTasks = (response.body.documents || []).map(function (item) {
+            return self.remove(item.documentId);
+        });
+        return Q.all(asyncTasks);
+    });
+};
+
+Document.prototype.remove = function (documentId) {
+    var url = this._buildUrl(documentId || this._documentId);
+    return this.sendRequest('DELETE', url);
+};
+
+Document.prototype.list = function (opt_status) {
+    var status = opt_status || '';
+
+    var url = this._buildUrl();
+    return this.sendRequest('GET', url, {
+        params: {status: status}
+    });
+};
+
+/**
+ * 文档转码通知接口(Notification API)
+ * http://gollum.baidu.com/MEDIA-DOC-API#通知接口(Notification-API)
+ *
+ * @constructor
+ * @param {Object} config The doc client configuration.
+ * @extends {BceBaseClient}
+ */
+function Notification(config) {
+    BceBaseClient.call(this, config, 'doc', false);
+
+    this._name = null;
+    this._endpoint = null;
+}
+util.inherits(Notification, BceBaseClient);
+
+Notification.prototype._buildUrl = function () {
+    var baseUrl = '/v1/notification';
+    var extraPaths = u.toArray(arguments);
+
+    if (extraPaths.length) {
+        baseUrl += '/' + extraPaths.join('/');
+    }
+
+    return baseUrl;
+};
+
+Notification.prototype.create = function (name, endpoint) {
+    var self = this;
+    var url = this._buildUrl();
+    return self.sendRequest('POST', url, {
+        headers: {'Content-Type': 'application/json'},
+        body: JSON.stringify({
+            name: name,
+            endpoint: endpoint
+        })
+    }).then(function (response) {
+        self._name = name;
+        self._endpoint = endpoint;
+        return response;
+    });
+};
+
+Notification.prototype.get = function (name) {
+    var url = this._buildUrl(name || this._name);
+    return this.sendRequest('GET', url);
+};
+
+Notification.prototype.list = function () {
+    return this.sendRequest('GET', this._buildUrl());
+};
+
+Notification.prototype.remove = function (name) {
+    var url = this._buildUrl(name || this._name);
+    return this.sendRequest('DELETE', url);
+};
+
+Notification.prototype.removeAll = function () {
+    var self = this;
+    return self.list().then(function (response) {
+        var asyncTasks = (response.body.notifications || []).map(function (item) {
+            return self.remove(item.name);
+        });
+        return Q.all(asyncTasks);
+    });
+};
+
+// --- E   N   D ---
+
+exports.Document = Document;
+exports.Notification = Notification;

+ 223 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/face_client.js

@@ -0,0 +1,223 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/face_client.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+
+var util = require('util');
+
+var u = require('underscore');
+var debug = require('debug')('bce-sdk:FaceClient');
+
+var BceBaseClient = require('./bce_base_client');
+
+
+/**
+ * 人脸识别API
+ *
+ * @see http://gollum.baidu.com/bcefaceapi
+ * @constructor
+ * @param {Object} config The face client configuration.
+ * @extends {BceBaseClient}
+ */
+function FaceClient(config) {
+    BceBaseClient.call(this, config, 'face', true);
+}
+util.inherits(FaceClient, BceBaseClient);
+
+// --- BEGIN ---
+
+FaceClient.prototype.createApp = function (options) {
+    options = options || {};
+
+    var url = '/v1/app';
+    return this.sendRequest('POST', url, {
+        config: options.config
+    });
+};
+
+FaceClient.prototype.listApps = function (options) {
+    options = options || {};
+
+    var url = '/v1/app';
+    return this.sendRequest('GET', url, {
+        config: options.config
+    });
+};
+
+FaceClient.prototype.createGroup = function (appId, groupName, options) {
+    options = options || {};
+
+    var url = '/v1/app/' + appId + '/group';
+    return this.sendRequest('POST', url, {
+        body: JSON.stringify({groupName: groupName}),
+        config: options.config
+    });
+};
+
+FaceClient.prototype.deleteGroup = function (appId, groupName, options) {
+    options = options || {};
+
+    var url = '/v1/app/' + appId + '/group/' + groupName;
+    return this.sendRequest('DELETE', url, {
+        config: options.config
+    });
+};
+
+FaceClient.prototype.getGroup = function (appId, groupName, options) {
+    options = options || {};
+
+    var url = '/v1/app/' + appId + '/group/' + groupName;
+    return this.sendRequest('GET', url, {
+        config: options.config
+    });
+};
+
+FaceClient.prototype.listGroups = function (appId, options) {
+    options = options || {};
+
+    var url = '/v1/app/' + appId + '/group';
+    return this.sendRequest('GET', url, {
+        config: options.config
+    });
+};
+
+FaceClient.prototype.createPerson = function (appId, groupName, personName, faces, options) {
+    options = options || {};
+
+    faces = faces.map(function (item) {
+        return {
+            bosPath: item
+        };
+    });
+
+    debug('Create Person Faces = %j', faces);
+
+    var url = '/v1/app/' + appId + '/person';
+    return this.sendRequest('POST', url, {
+        body: JSON.stringify({
+            personName: personName,
+            groupName: groupName,
+            faces: faces
+        }),
+        config: options.config
+    });
+};
+
+FaceClient.prototype.deletePerson = function (appId, personName, options) {
+    options = options || {};
+
+    var url = '/v1/app/' + appId + '/person/' + personName;
+    return this.sendRequest('DELETE', url, {
+        config: options.config
+    });
+};
+
+FaceClient.prototype.updatePerson = function (appId, personName, faces, options) {
+    options = options || {};
+
+    faces = faces.map(function (item) {
+        return {
+            bosPath: item
+        };
+    });
+
+    var url = '/v1/app/' + appId + '/person/' + personName;
+    return this.sendRequest('PUT', url, {
+        body: JSON.stringify({faces: faces}),
+        config: options.config
+    });
+};
+
+FaceClient.prototype.getPerson = function (appId, personName, options) {
+    options = options || {};
+
+    var url = '/v1/app/' + appId + '/person/' + personName;
+    return this.sendRequest('GET', url, {
+        config: options.config
+    });
+};
+
+FaceClient.prototype.listPersons = function (appId, options) {
+    options = options || {};
+
+    var url = '/v1/app/' + appId + '/person';
+    var params = u.pick(options, 'groupName');
+    return this.sendRequest('GET', url, {
+        params: params,
+        config: options.config
+    });
+};
+
+FaceClient.prototype.identify = function (appId, groupName, data, options) {
+    options = options || {};
+
+    var body = {};
+    if (Buffer.isBuffer(data)) {
+        body = {
+            base64: data.toString('base64')
+        };
+    }
+    else {
+        body = {
+            bosPath: data
+        };
+    }
+
+    var url = '/v1/app/' + appId + '/group/' + groupName;
+    return this.sendRequest('POST', url, {
+        params: {identify: ''},
+        body: JSON.stringify(body),
+        config: options.config
+    });
+
+};
+
+FaceClient.prototype.verify = function (appId, personName, data, options) {
+    options = options || {};
+
+    var body = {};
+    if (Buffer.isBuffer(data)) {
+        body = {
+            base64: data.toString('base64')
+        };
+    }
+    else {
+        body = {
+            bosPath: data
+        };
+    }
+
+    var url = '/v1/app/' + appId + '/person/' + personName;
+    return this.sendRequest('POST', url, {
+        params: {verify: ''},
+        body: JSON.stringify(body),
+        config: options.config
+    });
+};
+
+// --- E N D ---
+
+module.exports = FaceClient;
+
+
+
+
+
+
+
+
+

+ 64 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/headers.js

@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/headers.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+
+exports.CONTENT_TYPE = 'Content-Type';
+exports.CONTENT_LENGTH = 'Content-Length';
+exports.CONTENT_MD5 = 'Content-MD5';
+exports.CONTENT_ENCODING = 'Content-Encoding';
+exports.CONTENT_DISPOSITION = 'Content-Disposition';
+exports.ETAG = 'ETag';
+exports.CONNECTION = 'Connection';
+exports.HOST = 'Host';
+exports.USER_AGENT = 'User-Agent';
+exports.CACHE_CONTROL = 'Cache-Control';
+exports.EXPIRES = 'Expires';
+
+exports.AUTHORIZATION = 'Authorization';
+exports.X_BCE_DATE = 'x-bce-date';
+exports.X_BCE_ACL = 'x-bce-acl';
+exports.X_BCE_GRANT_READ = 'x-bce-grant-read';
+exports.X_BCE_GRANT_FULL_CONTROL = 'x-bce-grant-full-control';
+exports.X_BCE_REQUEST_ID = 'x-bce-request-id';
+exports.X_BCE_CONTENT_SHA256 = 'x-bce-content-sha256';
+exports.X_BCE_OBJECT_ACL = 'x-bce-object-acl';
+exports.X_BCE_OBJECT_GRANT_READ = 'x-bce-object-grant-read';
+
+exports.X_HTTP_HEADERS = 'http_headers';
+exports.X_BODY = 'body';
+exports.X_STATUS_CODE = 'status_code';
+exports.X_MESSAGE = 'message';
+exports.X_CODE = 'code';
+exports.X_REQUEST_ID = 'request_id';
+
+exports.SESSION_TOKEN = 'x-bce-security-token';
+
+exports.X_VOD_MEDIA_TITLE = 'x-vod-media-title';
+exports.X_VOD_MEDIA_DESCRIPTION = 'x-vod-media-description';
+exports.ACCEPT_ENCODING = 'accept-encoding';
+exports.ACCEPT = 'accept';
+
+
+
+
+
+
+
+
+
+
+

+ 225 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/helper.js

@@ -0,0 +1,225 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/helper.js
+ * @author leeight
+ */
+var fs = require('fs');
+var stream = require('stream');
+
+var async = require('async');
+var u = require('underscore');
+var Q = require('q');
+var debug = require('debug')('bce-sdk:helper');
+
+// 超过这个限制就开始分片上传
+var MIN_MULTIPART_SIZE = 5 * 1024 * 1024; // 5M
+
+// 分片上传的时候,每个分片的大小
+var PART_SIZE          = 1 * 1024 * 1024; // 1M
+
+var DATA_TYPE_FILE     = 1;
+var DATA_TYPE_BUFFER   = 2;
+var DATA_TYPE_STREAM   = 3;
+var DATA_TYPE_BLOB     = 4;
+
+exports.omitNull = function (value, key, object) {
+    return value != null;
+};
+
+/**
+ * 自适应的按需上传文件
+ *
+ * @param {BosClient} client The bos client instance.
+ * @param {string} bucket The bucket name.
+ * @param {string} object The object name.
+ * @param {Blob|Buffer|stream.Readable|string} data The data.
+ * @param {Object} options The request options.
+ * @return {Promise}
+ */
+exports.upload = function (client, bucket, object, data, options) {
+    var contentLength = 0;
+    var dataType = -1;
+    if (typeof data === 'string') {
+        // 文件路径
+        // TODO 如果不存在的话,会抛异常,导致程序退出?
+        contentLength = fs.lstatSync(data).size;
+        dataType = DATA_TYPE_FILE;
+    }
+    else if (Buffer.isBuffer(data)) {
+        // Buffer
+        contentLength = data.length;
+        dataType = DATA_TYPE_BUFFER;
+    }
+    else if (data instanceof stream.Readable) {
+        dataType = DATA_TYPE_STREAM;
+    }
+    else if (typeof Blob !== 'undefined' && data instanceof Blob) {
+        // 浏览器里面的对象
+        contentLength = data.size;
+        dataType = DATA_TYPE_BLOB;
+    }
+
+    if (dataType === -1) {
+        throw new Error('Unsupported `data` type.');
+    }
+
+    if (dataType === DATA_TYPE_STREAM) {
+        // XXX options['Content-Length'] 应该呗设置过了吧?
+        // 这种情况无法分片上传,只能直传了
+        return client.putObject(bucket, object, data, options);
+    }
+    else if (contentLength <= MIN_MULTIPART_SIZE) {
+        if (dataType === DATA_TYPE_FILE) {
+            return client.putObjectFromFile(bucket, object, data, options);
+        }
+        else if (dataType === DATA_TYPE_BUFFER) {
+            return client.putObject(bucket, object, data, options);
+        }
+        else if (dataType === DATA_TYPE_BLOB) {
+            return client.putObjectFromBlob(bucket, object, data, options);
+        }
+    }
+    else if (contentLength > MIN_MULTIPART_SIZE) {
+        // 开始分片上传
+        debug('%s > %s -> multi-part', contentLength, MIN_MULTIPART_SIZE);
+        return uploadViaMultipart(client, data, dataType,
+                                  bucket, object, contentLength, PART_SIZE, options);
+    }
+};
+
+/* eslint-disable */
+/**
+ * 自适应的按需上传文件
+ *
+ * @param {BosClient} client The bos client instance.
+ * @param {string|Buffer|Blob} data The uploaded content.
+ * @param {number} dataType The body data type.
+ * @param {string} bucket The bucket name.
+ * @param {string} object The object name.
+ * @param {number} size The body size.
+ * @param {number} partSize The multi-part size.
+ * @param {Object} options The request options.
+ * @return {Promise}
+ */
+function uploadViaMultipart(client, data, dataType, bucket, object, size, partSize, options) {
+    var uploadId;
+
+    return client.initiateMultipartUpload(bucket, object, options)
+        .then(function (response) {
+            uploadId = response.body.uploadId;
+            debug('initiateMultipartUpload = %j', response);
+
+            var deferred = Q.defer();
+            var tasks = getTasks(data, uploadId, bucket, object, size, partSize);
+            var state = {
+                lengthComputable: true,
+                loaded: 0,
+                total: tasks.length
+            };
+            async.mapLimit(tasks, 2, uploadPart(client, dataType, state), function (error, results) {
+                if (error) {
+                    deferred.reject(error);
+                }
+                else {
+                    deferred.resolve(results);
+                }
+            });
+            return deferred.promise;
+        })
+        .then(function (responses) {
+            var parts = u.map(responses, function (response, index) {
+                return {
+                    partNumber: index + 1,
+                    eTag: response.http_headers.etag
+                };
+            });
+            debug('parts = %j', parts);
+            return client.completeMultipartUpload(bucket, object, uploadId, parts);
+        });
+}
+/* eslint-enable */
+
+function uploadPart(client, dataType, state) {
+    return function (task, callback) {
+        var resolve = function (response) {
+            ++state.loaded;
+            client.emit('progress', state);
+            callback(null, response);
+        };
+        var reject = function (error) {
+            callback(error);
+        };
+
+        if (dataType === DATA_TYPE_FILE) {
+            debug('client.uploadPartFromFile(%j)', u.omit(task, 'data'));
+            return client.uploadPartFromFile(task.bucket, task.object,
+                task.uploadId, task.partNumber, task.partSize,
+                task.data, task.start).then(resolve, reject);
+        }
+        else if (dataType === DATA_TYPE_BUFFER) {
+            // 没有直接 uploadPartFromBuffer 的接口,借用 DataUrl
+            debug('client.uploadPartFromDataUrl(%j)', u.omit(task, 'data'));
+            var dataUrl = task.data.slice(task.start, task.stop + 1).toString('base64');
+            return client.uploadPartFromDataUrl(task.bucket, task.object,
+                task.uploadId, task.partNumber, task.partSize,
+                dataUrl).then(resolve, reject);
+        }
+        else if (dataType === DATA_TYPE_BLOB) {
+            debug('client.uploadPartFromBlob(%j)', u.omit(task, 'data'));
+            var blob = task.data.slice(task.start, task.stop + 1);
+            return client.uploadPartFromBlob(task.bucket, task.object,
+                task.uploadId, task.partNumber, task.partSize,
+                blob).then(resolve, reject);
+        }
+    };
+}
+
+function getTasks(data, uploadId, bucket, object, size, partSize) {
+    var leftSize = size;
+    var offset = 0;
+    var partNumber = 1;
+
+    var tasks = [];
+    while (leftSize > 0) {
+        /* eslint-disable */
+        var xPartSize = Math.min(leftSize, partSize);
+        /* eslint-enable */
+        tasks.push({
+            data: data, // Buffer or Blob
+            uploadId: uploadId,
+            bucket: bucket,
+            object: object,
+            partNumber: partNumber,
+            partSize: xPartSize,
+            start: offset,
+            stop: offset + xPartSize - 1
+        });
+
+        leftSize -= xPartSize;
+        offset += xPartSize;
+        partNumber += 1;
+    }
+
+    return tasks;
+}
+
+
+
+
+
+
+
+
+
+
+

+ 437 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/http_client.js

@@ -0,0 +1,437 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/http_client.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* globals ArrayBuffer */
+
+var http = require('http');
+var https = require('https');
+var util = require('util');
+var stream = require('stream');
+var EventEmitter = require('events').EventEmitter;
+
+var u = require('underscore');
+var Q = require('q');
+var debug = require('debug')('bce-sdk:HttpClient');
+
+var H = require('./headers');
+var Auth = require('./auth');
+
+/**
+ * The HttpClient
+ *
+ * @constructor
+ * @param {Object} config The http client configuration.
+ */
+function HttpClient(config) {
+    EventEmitter.call(this);
+
+    this.config = config;
+
+    /**
+     * http(s) request object
+     * @type {Object}
+     */
+    this._req = null;
+}
+util.inherits(HttpClient, EventEmitter);
+
+/**
+ * Send Http Request
+ *
+ * @param {string} httpMethod GET,POST,PUT,DELETE,HEAD
+ * @param {string} path The http request path.
+ * @param {(string|Buffer|stream.Readable)=} body The request body. If `body` is a
+ * stream, `Content-Length` must be set explicitly.
+ * @param {Object=} headers The http request headers.
+ * @param {Object=} params The querystrings in url.
+ * @param {function():string=} signFunction The `Authorization` signature function
+ * @param {stream.Writable=} outputStream The http response body.
+ * @param {number=} retry The maximum number of network connection attempts.
+ *
+ * @resolve {{http_headers:Object,body:Object}}
+ * @reject {Object}
+ *
+ * @return {Q.defer}
+ */
+HttpClient.prototype.sendRequest = function (httpMethod, path, body, headers, params,
+                                             signFunction, outputStream) {
+    httpMethod = httpMethod.toUpperCase();
+    var requestUrl = this._getRequestUrl(path, params);
+    var options = require('url').parse(requestUrl);
+    debug('httpMethod = %s, requestUrl = %s, options = %j',
+        httpMethod, requestUrl, options);
+
+    // Prepare the request headers.
+    var defaultHeaders = {};
+    if (typeof navigator === 'object') {
+        defaultHeaders[H.USER_AGENT] = navigator.userAgent;
+    }
+    else {
+        defaultHeaders[H.USER_AGENT] = util.format('bce-sdk-nodejs/%s/%s/%s', require('../package.json').version,
+            process.platform, process.version);
+    }
+    defaultHeaders[H.X_BCE_DATE] = new Date().toISOString().replace(/\.\d+Z$/, 'Z');
+    defaultHeaders[H.CONNECTION] = 'close';
+    defaultHeaders[H.CONTENT_TYPE] = 'application/json; charset=UTF-8';
+    defaultHeaders[H.HOST] = options.host;
+
+    headers = u.extend({}, defaultHeaders, headers);
+
+    // if (!headers.hasOwnProperty(H.X_BCE_REQUEST_ID)) {
+    //    headers[H.X_BCE_REQUEST_ID] = this._generateRequestId();
+    // }
+
+    // Check the content-length
+    if (!headers.hasOwnProperty(H.CONTENT_LENGTH)) {
+        var contentLength = this._guessContentLength(body);
+        if (!(contentLength === 0 && /GET|HEAD/i.test(httpMethod))) {
+            // 如果是 GET 或 HEAD 请求,并且 Content-Length 是 0,那么 Request Header 里面就不要出现 Content-Length
+            // 否则本地计算签名的时候会计算进去,但是浏览器发请求的时候不一定会有,此时导致 Signature Mismatch 的情况
+            headers[H.CONTENT_LENGTH] = contentLength;
+        }
+    }
+
+    var client = this;
+    options.method = httpMethod;
+    options.headers = headers;
+
+    // 通过browserify打包后,在Safari下并不能有效处理server的content-type
+    // 参考ISSUE:https://github.com/jhiesey/stream-http/issues/8
+    options.mode = 'prefer-fast';
+
+    // rejectUnauthorized: If true, the server certificate is verified against the list of supplied CAs.
+    // An 'error' event is emitted if verification fails.
+    // Verification happens at the connection level, before the HTTP request is sent.
+    options.rejectUnauthorized = false;
+
+    if (typeof signFunction === 'function') {
+        var promise = signFunction(this.config.credentials, httpMethod, path, params, headers);
+        if (isPromise(promise)) {
+            return promise.then(function (authorization, xbceDate) {
+                headers[H.AUTHORIZATION] = authorization;
+                if (xbceDate) {
+                    headers[H.X_BCE_DATE] = xbceDate;
+                }
+                debug('options = %j', options);
+                return client._doRequest(options, body, outputStream);
+            });
+        }
+        else if (typeof promise === 'string') {
+            headers[H.AUTHORIZATION] = promise;
+        }
+        else {
+            throw new Error('Invalid signature = (' + promise + ')');
+        }
+    }
+    else {
+        headers[H.AUTHORIZATION] = createSignature(this.config.credentials, httpMethod, path, params, headers);
+    }
+
+    debug('options = %j', options);
+    return client._doRequest(options, body, outputStream);
+};
+
+function createSignature(credentials, httpMethod, path, params, headers) {
+    var auth = new Auth(credentials.ak, credentials.sk);
+    return auth.generateAuthorization(httpMethod, path, params, headers);
+}
+
+function isPromise(obj) {
+    return obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
+}
+
+HttpClient.prototype._isValidStatus = function (statusCode) {
+    return statusCode >= 200 && statusCode < 300;
+};
+
+HttpClient.prototype._doRequest = function (options, body, outputStream) {
+    var deferred = Q.defer();
+    var api = options.protocol === 'https:' ? https : http;
+    var client = this;
+
+    var req = client._req = api.request(options, function (res) {
+        if (client._isValidStatus(res.statusCode) && outputStream
+            && outputStream instanceof stream.Writable) {
+            res.pipe(outputStream);
+            outputStream.on('finish', function () {
+                deferred.resolve(success(client._fixHeaders(res.headers), {}));
+            });
+            outputStream.on('error', function (error) {
+                deferred.reject(error);
+            });
+            return;
+        }
+        deferred.resolve(client._recvResponse(res));
+    });
+
+    // 设置超时10s
+    if (typeof req.setTimeout === 'function') {
+        req.setTimeout(10e3);
+
+        req.on('timeout', function() {
+            deferred.reject(new Error('socket Timeout!'));
+
+            req.destroy();
+        });
+    } else if (req.xhr) {
+        req.xhr.timeout = 10e3;
+    }
+
+    if (req.xhr && typeof req.xhr.upload === 'object') {
+        u.each(['progress', 'error', 'abort', 'timeout'], function (eventName) {
+            req.xhr.upload.addEventListener(eventName, function (evt) {
+                client.emit(eventName, evt);
+            }, false);
+        });
+    }
+
+    req.on('error', function (error) {
+        deferred.reject(error);
+    });
+
+    try {
+        client._sendRequest(req, body);
+    }
+    catch (ex) {
+        deferred.reject(ex);
+    }
+    return deferred.promise;
+};
+
+HttpClient.prototype._generateRequestId = function () {
+    function chunk() {
+        var v = (~~(Math.random() * 0xffff)).toString(16);
+        if (v.length < 4) {
+            v += new Array(4 - v.length + 1).join('0');
+        }
+        return v;
+    }
+
+    return util.format('%s%s-%s-%s-%s-%s%s%s',
+        chunk(), chunk(), chunk(), chunk(),
+        chunk(), chunk(), chunk(), chunk());
+};
+
+HttpClient.prototype._guessContentLength = function (data) {
+    if (data == null) {
+        return 0;
+    }
+    else if (typeof data === 'string') {
+        return Buffer.byteLength(data);
+    }
+    else if (typeof data === 'object') {
+        if (typeof Blob !== 'undefined' && data instanceof Blob) {
+            return data.size;
+        }
+        if (typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) {
+            return data.byteLength;
+        }
+        if (Buffer.isBuffer(data)) {
+            return data.length;
+        }
+        /**
+         if (typeof FormData !== 'undefined' && data instanceof FormData) {
+         }
+         */
+    }
+    else if (Buffer.isBuffer(data)) {
+        return data.length;
+    }
+
+    throw new Error('No Content-Length is specified.');
+};
+
+HttpClient.prototype._fixHeaders = function (headers) {
+    var fixedHeaders = {};
+
+    if (headers) {
+        Object.keys(headers).forEach(function (key) {
+            var value = headers[key].trim();
+            if (value) {
+                key = key.toLowerCase();
+                if (key === 'etag') {
+                    value = value.replace(/"/g, '');
+                }
+                fixedHeaders[key] = value;
+            }
+        });
+    }
+
+    return fixedHeaders;
+};
+
+HttpClient.prototype._recvResponse = function (res) {
+    var responseHeaders = this._fixHeaders(res.headers);
+    var statusCode = res.statusCode;
+
+    function parseHttpResponseBody(raw) {
+        var contentType = responseHeaders['content-type'];
+
+        if (!raw.length) {
+            return {};
+        }
+        else if (contentType
+            && /(application|text)\/json/.test(contentType)) {
+            return JSON.parse(raw.toString());
+        }
+        return raw;
+    }
+
+    var deferred = Q.defer();
+
+    var payload = [];
+    /* eslint-disable */
+    res.on('data', function (chunk) {
+        if (Buffer.isBuffer(chunk)) {
+            payload.push(chunk);
+        }
+        else {
+            // xhr2返回的内容是 string,不是 Buffer,导致 Buffer.concat 的时候报错了
+            payload.push(new Buffer(chunk));
+        }
+    });
+    res.on('error', function (e) {
+        deferred.reject(e);
+    });
+    /* eslint-enable */
+    res.on('end', function () {
+        var raw = Buffer.concat(payload);
+        var responseBody = null;
+
+        try {
+            debug('responseHeaders = %j', responseHeaders);
+            responseBody = parseHttpResponseBody(raw);
+        }
+        catch (e) {
+            debug('statusCode = %s, Parse response body error = %s', statusCode, e.message);
+            deferred.reject(failure(statusCode, e.message));
+            return;
+        }
+
+        if (statusCode >= 100 && statusCode < 200) {
+            deferred.reject(failure(statusCode, 'Can not handle 1xx http status code.'));
+        }
+        else if (statusCode < 100 || statusCode >= 300) {
+            if (responseBody.requestId) {
+                deferred.reject(failure(statusCode, responseBody.message,
+                    responseBody.code, responseBody.requestId, responseHeaders.date));
+            }
+            else {
+                deferred.reject(failure(statusCode, responseBody));
+            }
+        }
+
+        deferred.resolve(success(responseHeaders, responseBody));
+    });
+
+    return deferred.promise;
+};
+
+/* eslint-disable */
+function isXHR2Compatible(obj) {
+    if (typeof Blob !== 'undefined' && obj instanceof Blob) {
+        return true;
+    }
+    if (typeof ArrayBuffer !== 'undefined' && obj instanceof ArrayBuffer) {
+        return true;
+    }
+    if (typeof FormData !== 'undefined' && obj instanceof FormData) {
+        return true;
+    }
+}
+/* eslint-enable */
+
+HttpClient.prototype._sendRequest = function (req, data) {
+    /* eslint-disable */
+    if (!data) {
+        req.end();
+        return;
+    }
+    if (typeof data === 'string') {
+        data = new Buffer(data);
+    }
+    /* eslint-enable */
+
+    if (Buffer.isBuffer(data) || isXHR2Compatible(data)) {
+        req.write(data);
+        req.end();
+    }
+    else if (data instanceof stream.Readable) {
+        if (!data.readable) {
+            throw new Error('stream is not readable');
+        }
+
+        data.on('data', function (chunk) {
+            req.write(chunk);
+        });
+        data.on('end', function () {
+            req.end();
+        });
+    }
+    else {
+        throw new Error('Invalid body type = ' + typeof data);
+    }
+};
+
+HttpClient.prototype.buildQueryString = function (params) {
+    var urlEncodeStr = require('querystring').stringify(params);
+    // https://en.wikipedia.org/wiki/Percent-encoding
+    return urlEncodeStr.replace(/[()'!~.*\-_]/g, function (char) {
+        return '%' + char.charCodeAt().toString(16);
+    });
+};
+
+HttpClient.prototype._getRequestUrl = function (path, params) {
+    var uri = path;
+    var qs = this.buildQueryString(params);
+    if (qs) {
+        uri += '?' + qs;
+    }
+
+    return this.config.endpoint + uri;
+};
+
+function success(httpHeaders, body) {
+    var response = {};
+
+    response[H.X_HTTP_HEADERS] = httpHeaders;
+    response[H.X_BODY] = body;
+
+    return response;
+}
+
+function failure(statusCode, message, code, requestId, xBceDate) {
+    var response = {};
+
+    response[H.X_STATUS_CODE] = statusCode;
+    response[H.X_MESSAGE] = Buffer.isBuffer(message) ? String(message) : message;
+    if (code) {
+        response[H.X_CODE] = code;
+    }
+    if (requestId) {
+        response[H.X_REQUEST_ID] = requestId;
+    }
+    if (xBceDate) {
+        response[H.X_BCE_DATE] = xBceDate;
+    }
+
+    return response;
+}
+
+module.exports = HttpClient;
+

+ 111 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/iot_client.js

@@ -0,0 +1,111 @@
+/**
+ * Baidu Cloud IOT SDK
+ *
+ * @file src/iot_client.js
+ * @author fjx
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+
+var util = require('util');
+var path = require('path');
+var u = require('underscore');
+
+var strings = require('./strings');
+var BceBaseClient =  require('./bce_base_client');
+
+/**
+ * IOT Hub API
+ *
+ * @see https://cloud.baidu.com/doc/IOT/API.html
+ * @constructor
+ * @param {Object} config The iot client configuration.
+ * @extends {BceBaseClient}
+ */
+function IoTClient(config) {
+    BceBaseClient.call(this, config, 'iot', true);
+}
+util.inherits(IoTClient, BceBaseClient);
+
+// --- BEGIN ---
+
+// GET /v1/usage
+IoTClient.prototype.getUsage = function (options) {
+    options = options || {};
+
+    return this.sendRequest('GET', '/v1/usage', {
+        config: options.config
+    });
+};
+
+// GET /v1/endpoint/:endpointName/usage
+IoTClient.prototype.getEndpointUsage = function (endpointName, options) {
+    options = options || {};
+
+    return this.sendRequest('GET', '/v1/endpoint/' + endpointName + '/usage', {
+        config: options.config
+    });
+};
+
+// POST /v1/endpoint/:endpointName/usage-query?start=:startDate&end=:endDate
+IoTClient.prototype.getEndpointUsageRange = function (endpointName, startDate, endDate, options) {
+    options = options || {};
+
+    var resource = this._buildUrl(
+        '/v1/endpoint/',
+        strings.normalize(endpointName || ''),
+        '/usage-query'
+    );
+
+    return this.sendRequest('POST', resource, {
+        params: {
+            start: startDate,
+            end: endDate
+        },
+        config: options.config
+    });
+};
+
+// GET /v2/endpoint/{endpointName}/client/{clientId}/status/online
+IoTClient.prototype.getClientOnline = function (endpointName, clientId, options) {
+    options = options || {};
+
+    var resource = this._buildUrl(
+        '/v2/endpoint',
+        strings.normalize(endpointName || ''),
+        '/client',
+        strings.normalize(clientId || '', false),
+        '/status/online'
+    );
+
+    return this.sendRequest('GET', resource, {
+        config: options.config
+    });
+};
+
+// POST /v2/endpoint/{endpointName}/batch-client-query/status
+IoTClient.prototype.getClientOnlineBatch = function (endpointName, clientIds, options) {
+    options = options || {};
+
+    var resource = this._buildUrl(
+        '/v2/endpoint',
+        strings.normalize(endpointName || ''),
+        '/batch-client-query/status'
+    );
+
+    return this.sendRequest('POST', resource, {
+        body: JSON.stringify(clientIds || []),
+        config: options.config
+    });
+};
+
+IoTClient.prototype._buildUrl = function () {
+    var extraPaths = u.toArray(arguments);
+
+    return path.normalize(extraPaths.join('/')).replace(/\\/g, '/');
+};
+
+// --- E N D ---
+
+module.exports = IoTClient;

+ 284 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/lss_client.js

@@ -0,0 +1,284 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/lss_client.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint fecs-camelcase:[2,{"ignore":["/opt_/"]}] */
+
+var util = require('util');
+
+var Q = require('q');
+// var debug = require('debug')('bce-sdk:LssClient');
+
+var BceBaseClient = require('./bce_base_client');
+
+/**
+ * 直播模板
+ * http://bce.baidu.com/doc/LSS/API.html#.9E.2A.60.EA.11.C8.DD.82.F7.A6.B1.71.BC.C3.B7.68
+ *
+ * @constructor
+ * @param {Object} config The lss client configuration.
+ * @extends {BceBaseClient}
+ */
+function Preset(config) {
+    BceBaseClient.call(this, config, 'lss', true);
+
+    this._name = null;
+}
+util.inherits(Preset, BceBaseClient);
+
+// --- B E G I N ---
+
+Preset.prototype._buildUrl = function (name) {
+    var url = '/v3/live/preset';
+    return url + (name ? '/' + name : '');
+};
+
+Preset.prototype.setName = function (name) {
+    this._name = name;
+    return this;
+};
+
+Preset.prototype.create = function (options) {
+    var self = this;
+
+    var url = self._buildUrl(false);
+    return self.sendRequest('POST', url, {
+        body: JSON.stringify(options)
+    }).then(function (response) {
+        self.setName(options.presetName);
+        return response;
+    });
+};
+
+Preset.prototype.remove = function (name) {
+    var url = this._buildUrl(name || this._name);
+    return this.sendRequest('DELETE', url);
+};
+
+Preset.prototype.removeAll = function () {
+    var self = this;
+    return self.list().then(function (response) {
+        var asyncTasks = response.body.presets
+            .filter(function (item) {
+                // bce.~~ | lss.~~
+                return !/^(bce|lss)\./.test(item.presetName);
+            })
+            .map(function (item) {
+                return self.remove(item.presetName);
+            });
+        return Q.all(asyncTasks);
+    });
+};
+
+Preset.prototype.get = function (name) {
+    var url = this._buildUrl(name || this._name);
+    return this.sendRequest('GET', url);
+};
+
+Preset.prototype.list = function () {
+    var url = this._buildUrl();
+    return this.sendRequest('GET', url);
+};
+
+// --- E   N   D ---
+
+/**
+ * 直播会话接口(Live Session API)
+ * http://bce.baidu.com/doc/LSS/API.html#.23.14.D5.44.EE.00.30.BA.DB.38.4B.3D.1E.12.15.C3
+ *
+ * @constructor
+ * @param {Object} config The lss client configuration.
+ * @extends {BceBaseClient}
+ */
+function Session(config) {
+    BceBaseClient.call(this, config, 'lss', true);
+
+    /**
+     * The session id.
+     *
+     * @private
+     * @type {string}
+     */
+    this._sessionId = null;
+}
+util.inherits(Session, BceBaseClient);
+
+// --- B E G I N ---
+
+Session.prototype._buildUrl = function (sessionId) {
+    var url = '/v3/live/session';
+    return url + (sessionId ? '/' + sessionId : '');
+};
+
+/**
+ * 设置当前 Session 的 Id.
+ *
+ * @param {string} sessionId The session id.
+ * @return {Session}
+ */
+Session.prototype.setSessionId = function (sessionId) {
+    this._sessionId = sessionId;
+    return this;
+};
+
+Session.prototype.create = function (options) {
+    var self = this;
+
+    var url = self._buildUrl(false);
+    return self.sendRequest('POST', url, {
+        body: JSON.stringify(options)
+    }).then(function (response) {
+        var session = response.body;
+        self.setSessionId(session.sessionId);
+        return response;
+    });
+};
+
+Session.prototype.remove = function (sessionId) {
+    var url = this._buildUrl(sessionId || this._sessionId);
+    return this.sendRequest('DELETE', url);
+};
+
+Session.prototype.removeAll = function () {
+    var self = this;
+    return self.list().then(function (response) {
+        var asyncTasks = response.body.liveInfos.map(function (item) {
+            return self.remove(item.sessionId);
+        });
+        return Q.all(asyncTasks);
+    });
+};
+
+Session.prototype.get = function (sessionId) {
+    var url = this._buildUrl(sessionId || this._sessionId);
+    return this.sendRequest('GET', url);
+};
+
+Session.prototype.list = function () {
+    var url = this._buildUrl();
+    return this.sendRequest('GET', url);
+};
+
+Session.prototype.pause = function (sessionId) {
+    var url = this._buildUrl(sessionId || this._sessionId);
+    return this.sendRequest('PUT', url, {
+        params: {stop: ''}
+    });
+};
+
+Session.prototype.resume = function (sessionId) {
+    var url = this._buildUrl(sessionId || this._sessionId);
+    return this.sendRequest('PUT', url, {
+        params: {resume: ''}
+    });
+};
+
+Session.prototype.refresh = function (sessionId) {
+    var url = this._buildUrl(sessionId || this._sessionId);
+    return this.sendRequest('PUT', url, {
+        params: {refresh: ''}
+    });
+};
+
+// --- E   N   D ---
+
+/**
+ * 直播通知接口(Live Notification API)
+ * http://bce.baidu.com/doc/LSS/API.html#.72.90.9D.94.D6.1A.76.02.A5.A9.63.B2.32.A8.E7.2C
+ *
+ * @constructor
+ * @param {Object} config The lss client configuration.
+ * @extends {BceBaseClient}
+ */
+function Notification(config) {
+    BceBaseClient.call(this, config, 'lss', true);
+
+    this._name = null;
+    this._endpoint = null;
+}
+util.inherits(Notification, BceBaseClient);
+
+// --- B E G I N ---
+
+Notification.prototype._buildUrl = function (name) {
+    var url = '/v3/live/notification';
+    return url + (name ? '/' + name : '');
+};
+
+Notification.prototype.create = function (name, endpoint) {
+    var url = this._buildUrl();
+
+    var data = {
+        name: name,
+        endpoint: endpoint
+    };
+
+    var self = this;
+    return this.sendRequest('POST', url, {
+        body: JSON.stringify(data)
+    }).then(function (response) {
+        self._name = name;
+        self._endpoint = endpoint;
+        return response;
+    });
+};
+
+Notification.prototype.get = function (opt_name) {
+    var name = opt_name || this._name;
+    if (!name) {
+        throw new TypeError('name is required');
+    }
+
+    var url = this._buildUrl(name);
+    return this.sendRequest('GET', url);
+};
+
+Notification.prototype.remove = function (opt_name) {
+    var name = opt_name || this._name;
+    if (!name) {
+        throw new TypeError('name is required');
+    }
+
+    var url = this._buildUrl(name);
+    return this.sendRequest('DELETE', url);
+};
+
+Notification.prototype.removeAll = function () {
+    var self = this;
+    return self.list().then(function (response) {
+        var asyncTasks = (response.body.notifications || []).map(function (item) {
+            return self.remove(item.name);
+        });
+        return Q.all(asyncTasks);
+    });
+};
+
+Notification.prototype.list = function () {
+    var url = this._buildUrl();
+    return this.sendRequest('GET', url);
+};
+
+// --- E   N   D ---
+
+exports.Preset = Preset;
+exports.Session = Session;
+exports.Notification = Notification;
+
+
+
+
+

+ 469 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/mct_client.js

@@ -0,0 +1,469 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/mct_client.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint fecs-camelcase:[2,{"ignore":["/opt_/"]}] */
+
+var util = require('util');
+
+var Q = require('q');
+
+var BceBaseClient = require('./bce_base_client');
+
+/**
+ * 水印接口(Watermark API)
+ * http://bce.baidu.com/doc/MCT/API.html#.81.CC.4F.30.2C.F7.78.0E.AA.53.8E.85.5D.E2.77.BE
+ *
+ * @constructor
+ * @param {Object} config The mct client configuration.
+ * @extends {BceBaseClient}
+ */
+function Watermark(config) {
+    BceBaseClient.call(this, config, 'media', true);
+
+    this._id = null;
+}
+util.inherits(Watermark, BceBaseClient);
+
+// --- B E G I N ---
+
+Watermark.prototype._buildUrl = function (opt_id) {
+    var url = '/v3/watermark';
+    if (opt_id === false) {
+        return url;
+    }
+
+    var id = opt_id || this._id;
+    return url + (id ? '/' + id : '');
+};
+
+Watermark.prototype.setId = function (id) {
+    this._id = id;
+    return this;
+};
+
+Watermark.prototype.create = function (options) {
+    var self = this;
+
+    var url = self._buildUrl(false);
+    return self.sendRequest('POST', url, {
+        body: JSON.stringify(options)
+    }).then(function (response) {
+        self.setId(response.body.watermarkId);
+        return response;
+    });
+};
+
+Watermark.prototype.remove = function (id) {
+    var url = this._buildUrl(id);
+    return this.sendRequest('DELETE', url);
+};
+
+Watermark.prototype.removeAll = function () {
+    var self = this;
+    return self.list().then(function (response) {
+        var asyncTasks = response.body.watermarks
+            .map(function (item) {
+                return self.remove(item.watermarkId);
+            });
+        return Q.all(asyncTasks);
+    });
+};
+
+Watermark.prototype.get = function (id) {
+    var self = this;
+    var url = self._buildUrl(id);
+    return self.sendRequest('GET', url).then(function (response) {
+        self.setId(response.body.watermarkId);
+        return response;
+    });
+};
+
+Watermark.prototype.list = function () {
+    var url = this._buildUrl(false);
+    return this.sendRequest('GET', url);
+};
+
+// --- E   N   D ---
+
+/**
+ * 媒体信息接口(MediaInfo API)
+ * http://bce.baidu.com/doc/MCT/API.html#.D1.D4.44.23.BB.C5.88.34.9B.29.16.A6.4D.73.0A.96
+ *
+ * @constructor
+ * @param {Object} config The mct client configuration.
+ * @extends {BceBaseClient}
+ */
+function MediaInfo(config) {
+    BceBaseClient.call(this, config, 'media', true);
+}
+util.inherits(MediaInfo, BceBaseClient);
+
+// --- B E G I N ---
+
+MediaInfo.prototype.get = function (bucket, key) {
+    var url = '/v3/mediainfo';
+    return this.sendRequest('GET', url, {
+        params: {
+            bucket: bucket,
+            key: key
+        }
+    });
+};
+
+// --- E   N   D ---
+
+/**
+ * 队列接口(Pipeline API)
+ * http://bce.baidu.com/doc/MCT/API.html#.7B.58.EA.E5.54.22.16.F1.32.84.E4.C4.36.04.37.3A
+ *
+ * @constructor
+ * @param {Object} config The mct client configuration.
+ * @extends {BceBaseClient}
+ */
+function Pipeline(config) {
+    BceBaseClient.call(this, config, 'media', true);
+
+    this._name = null;
+}
+util.inherits(Pipeline, BceBaseClient);
+
+// --- B E G I N ---
+
+Pipeline.prototype.setName = function (name) {
+    this._name = name;
+    return this;
+};
+
+Pipeline.prototype._buildUrl = function (opt_name) {
+    var url = '/v3/pipeline';
+    if (opt_name === false) {
+        return url;
+    }
+
+    var key = opt_name || this._name;
+    return url + (key ? '/' + key : '');
+};
+
+Pipeline.prototype.create = function (options) {
+    var self = this;
+    var url = self._buildUrl(false);
+
+    return self.sendRequest('POST', url, {
+        body: JSON.stringify(options)
+    }).then(function (response) {
+        self.setName(options.pipelineName);
+        return response;
+    });
+};
+
+Pipeline.prototype.get = function (name) {
+    var self = this;
+    var url = self._buildUrl(name);
+    return self.sendRequest('GET', url).then(function (response) {
+        self.setName(response.body.pipelineName);
+        return response;
+    });
+};
+
+Pipeline.prototype.list = function () {
+    var url = this._buildUrl(false);
+    return this.sendRequest('GET', url);
+};
+
+Pipeline.prototype.remove = function (name) {
+    var url = this._buildUrl(name);
+    return this.sendRequest('DELETE', url);
+};
+
+Pipeline.prototype.removeAll = function () {
+    var self = this;
+    return self.list().then(function (response) {
+        var asyncTasks = response.body.pipelines
+            .filter(function (item) {
+                // 有 running/pending 在运行的 Pipeline 无法删除
+                var status = item.jobStatus;
+                return (status.running + status.pending) <= 0;
+            })
+            .map(function (item) {
+                return self.remove(item.pipelineName);
+            });
+        return Q.all(asyncTasks);
+    });
+};
+
+Pipeline.prototype.addTranscodingJob = function (options) {
+    var pipelineName = options.pipelineName || this._name;
+    if (!pipelineName) {
+        throw new Error('`pipelineName` is required.');
+    }
+
+    options.pipelineName = pipelineName;
+    var job = new Transcoding(this.config);
+    return job.create(options).then(function (response) {
+        return job;
+    });
+};
+
+Pipeline.prototype.addThumbnailJob = function (options) {
+    var pipelineName = options.pipelineName || this._name;
+    if (!pipelineName) {
+        throw new Error('`pipelineName` is required.');
+    }
+
+    options.pipelineName = pipelineName;
+    var job = new Thumbnail(this.config);
+    return job.create(options).then(function (response) {
+        return job;
+    });
+};
+
+Pipeline.prototype.getTranscodingJobs = function (opt_name) {
+    var name = opt_name || this._name;
+    if (!name) {
+        throw new Error('`pipelineName` is required.');
+    }
+
+    var transcoding = new Transcoding(this.config);
+    return transcoding.list(name);
+};
+
+Pipeline.prototype.getThumbnailJobs = function (opt_name) {
+    var name = opt_name || this._name;
+    if (!name) {
+        throw new Error('`pipelineName` is required');
+    }
+
+    var thumbnail = new Thumbnail(this.config);
+    return thumbnail.list(name);
+};
+
+// --- E   N   D ---
+
+/**
+ * 模板接口(Preset API)
+ * http://bce.baidu.com/doc/MCT/API.html#.AC.4A.44.2F.2C.0D.6D.25.0C.83.A0.AF.C6.32.E7.CA
+ *
+ * @constructor
+ * @param {Object} config The mct client configuration.
+ * @extends {BceBaseClient}
+ */
+function Preset(config) {
+    BceBaseClient.call(this, config, 'media', true);
+
+    /**
+     * The preset name
+     * @type {string}
+     * @private
+     */
+    this._name = null;
+}
+util.inherits(Preset, BceBaseClient);
+
+// --- B E G I N ---
+
+Preset.prototype._buildUrl = function (opt_name) {
+    var url = '/v3/preset';
+    if (opt_name === false) {
+        return url;
+    }
+
+    var name = opt_name || this._name;
+    return url + (name ? '/' + name : '');
+};
+
+Preset.prototype.setName = function (name) {
+    this._name = name;
+    return this;
+};
+
+Preset.prototype.create = function (options) {
+    var self = this;
+    var url = this._buildUrl(false);
+
+    return this.sendRequest('POST', url, {
+        body: JSON.stringify(options)
+    }).then(function (response) {
+        self.setName(options.presetName);
+        return response;
+    });
+};
+
+Preset.prototype.get = function (opt_name) {
+    var self = this;
+    var url = self._buildUrl(opt_name);
+    return self.sendRequest('GET', url).then(function (response) {
+        self.setName(response.body.presetName);
+        return response;
+    });
+};
+
+Preset.prototype.list = function () {
+    var url = this._buildUrl(false);
+    return this.sendRequest('GET', url);
+};
+
+Preset.prototype.remove = function (opt_name) {
+    var url = this._buildUrl(opt_name);
+    return this.sendRequest('DELETE', url);
+};
+
+Preset.prototype.removeAll = function () {
+    var self = this;
+    return self.list().then(function (response) {
+        var asyncTasks = response.body.presets
+            .filter(function (item) {
+                return !/^bce\./.test(item.presetName);
+            })
+            .map(function (item) {
+                return self.remove(item.presetName);
+            });
+        return Q.all(asyncTasks);
+    });
+};
+
+// --- E   N   D ---
+
+/**
+ * 缩略图任务接口(Job/Thumbnail API)
+ * http://bce.baidu.com/doc/MCT/API.html#.45.7A.76.DC.88.FD.32.92.D4.46.EA.48.3A.66.F0.12
+ *
+ * @constructor
+ * @param {Object} config The mct client configuration.
+ * @extends {BceBaseClient}
+ */
+function Thumbnail(config) {
+    BceBaseClient.call(this, config, 'media', true);
+
+    this._jobId = null;
+}
+util.inherits(Thumbnail, BceBaseClient);
+
+// --- B E G I N ---
+Thumbnail.prototype._buildUrl = function () {
+    var url = '/v3/job/thumbnail';
+    return url;
+};
+
+Thumbnail.prototype.create = function (options) {
+    var self = this;
+    var url = this._buildUrl();
+
+    return this.sendRequest('POST', url, {
+        body: JSON.stringify(options)
+    }).then(function (response) {
+        self._jobId = response.body.jobId;
+        return response;
+    });
+};
+
+Thumbnail.prototype.get = function (opt_jobId) {
+    var jobId = opt_jobId || this._jobId;
+    if (!jobId) {
+        throw new Error('`jobId` is required');
+    }
+
+    var self = this;
+    var url = this._buildUrl() + '/' + jobId;
+    return this.sendRequest('GET', url).then(function (response) {
+        self._jobId = jobId;
+        return response;
+    });
+};
+
+Thumbnail.prototype.list = function (name) {
+    var url = this._buildUrl();
+    return this.sendRequest('GET', url, {
+        params: {
+            pipelineName: name
+        }
+    });
+};
+
+// --- E   N   D ---
+
+/**
+ * 视频转码任务接口(Job/Transcoding API)
+ * http://bce.baidu.com/doc/MCT/API.html#.1D.1E.B0.1E.6C.74.0C.6D.C1.68.D2.57.6F.70.EA.F1
+ *
+ * @constructor
+ * @param {Object} config The mct client configuration.
+ * @extends {BceBaseClient}
+ */
+function Transcoding(config) {
+    BceBaseClient.call(this, config, 'media', true);
+
+    this._jobId = null;
+}
+util.inherits(Transcoding, BceBaseClient);
+
+// --- B E G I N ---
+
+Transcoding.prototype._buildUrl = function () {
+    var url = '/v3/job/transcoding';
+    return url;
+};
+
+Transcoding.prototype.create = function (options) {
+    var self = this;
+    var url = self._buildUrl();
+
+    return self.sendRequest('POST', url, {
+        body: JSON.stringify(options)
+    }).then(function (response) {
+        self._jobId = response.body.jobId;
+        return response;
+    });
+};
+
+Transcoding.prototype.get = function (opt_jobId) {
+    var jobId = opt_jobId || this._jobId;
+    if (!jobId) {
+        throw new Error('`jobId` is required');
+    }
+
+    var self = this;
+    var url = self._buildUrl() + '/' + jobId;
+    return self.sendRequest('GET', url).then(function (response) {
+        self._jobId = jobId;
+        return response;
+    });
+};
+
+Transcoding.prototype.list = function (name) {
+    var url = this._buildUrl();
+
+    return this.sendRequest('GET', url, {
+        params: {
+            pipelineName: name
+        }
+    });
+};
+
+// --- E   N   D ---
+
+exports.Watermark = Watermark;
+exports.MediaInfo = MediaInfo;
+exports.Transcoding = Transcoding;
+exports.Thumbnail = Thumbnail;
+exports.Pipeline = Pipeline;
+exports.Preset = Preset;
+
+
+
+
+

+ 234 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/media_client.js

@@ -0,0 +1,234 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/media_client.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint-disable fecs-camelcase */
+
+var util = require('util');
+
+var u = require('underscore');
+
+var Auth = require('./auth');
+var HttpClient = require('./http_client');
+var BceBaseClient = require('./bce_base_client');
+
+/**
+ * Media service api.
+ *
+ * @constructor
+ * @param {Object} config The media client configuration.
+ * @extends {BceBaseClient}
+ */
+function MediaClient(config) {
+    BceBaseClient.call(this, config, 'media', true);
+}
+util.inherits(MediaClient, BceBaseClient);
+
+
+// --- B E G I N ---
+MediaClient.prototype.createPipeline = function (pipelineName, sourceBucket, targetBucket,
+    opt_config, opt_description, opt_options) {
+
+    var url = '/v3/pipeline';
+    var options = opt_options || {};
+    var body = JSON.stringify({
+        pipelineName: pipelineName,
+        sourceBucket: sourceBucket,
+        targetBucket: targetBucket,
+        config: opt_config || {capacity: 5},
+        description: opt_description || ''
+    });
+
+    return this.sendRequest('POST', url, {
+        body: body,
+        config: options.config
+    });
+};
+
+MediaClient.prototype.getPipeline = function (pipelineName, opt_options) {
+    var url = '/v3/pipeline/' + pipelineName;
+    var options = opt_options || {};
+
+    return this.sendRequest('GET', url, {config: options.config});
+};
+
+MediaClient.prototype.deletePipeline = function (pipelineName, opt_options) {
+    var url = '/v3/pipeline/' + pipelineName;
+    var options = opt_options || {};
+
+    return this.sendRequest('DELETE', url, {config: options.config});
+};
+
+MediaClient.prototype.getAllPipelines = function (opt_options) {
+    var url = '/v3/pipeline';
+    var options = opt_options || {};
+
+    return this.sendRequest('GET', url, {config: options.config});
+};
+
+MediaClient.prototype.createJob = function (pipelineName, source, target, presetName, opt_options) {
+    var url = '/v3/job';
+    var options = opt_options || {};
+    var body = JSON.stringify({
+        pipelineName: pipelineName,
+        source: source,
+        target: target,
+        presetName: presetName
+    });
+
+    return this.sendRequest('POST', url, {
+        body: body,
+        config: options.config
+    });
+};
+
+MediaClient.prototype.getAllJobs = function (pipelineName, opt_options) {
+    var url = '/v3/job';
+    var options = opt_options || {};
+    var params = {pipelineName: pipelineName};
+
+    return this.sendRequest('GET', url, {
+        params: params,
+        config: options.config
+    });
+};
+
+MediaClient.prototype.getJob = function (jobId, opt_options) {
+    var url = '/v3/job/' + jobId;
+    var options = opt_options || {};
+
+    return this.sendRequest('GET', url, {config: options.config});
+};
+
+/**
+ * 创建模板, 不对外部用户开放,仅服务于Console.
+ *
+ * @param {string} presetName 转码模板名称.
+ * @param {string} container 音视频文件的容器.
+ * @param {Object=} clip 是否截取音视频片段.
+ * @param {Object=} audio 音频输出信息的集合,不填写表示只处理视频部分.
+ * @param {Object=} video 视频输出信息的集合,不填写表示只处理音频部分.
+ * @param {Object=} opt_encryption HLS加解密信息的集合.
+ * @param {boolean=} opt_transmux 是否仅执行容器格式转换.
+ * @param {string=} opt_description 转码模板描述.
+ * @param {Object=} opt_options Media Client 的配置.
+ * @return {Q.promise}
+ */
+MediaClient.prototype.createPreset = function (presetName, container, clip, audio, video,
+    opt_encryption, opt_transmux, opt_description, opt_options) {
+    // container: mp4, flv, hls, mp3, m4a
+    var url = '/v3/preset';
+    var options = opt_options || {};
+    var body = {
+        presetName: presetName,
+        container: container
+    };
+    clip && (body.clip = clip);
+    audio && (body.audio = audio);
+    video && (body.video = video);
+    opt_encryption && (body.encryption = opt_encryption);
+    opt_transmux != null && (body.transmux = opt_transmux);
+    opt_description && (body.description = opt_description);
+
+    return this.sendRequest('POST', url, {
+        body: JSON.stringify(body),
+        config: options.config
+    });
+};
+
+MediaClient.prototype.getPreset = function (presetName, opt_options) {
+    var url = '/v3/preset/' + presetName;
+    var options = opt_options || {};
+
+    return this.sendRequest('GET', url, {
+        config: options.config
+    });
+};
+
+MediaClient.prototype.deletePreset = function (presetName, opt_options) {
+    var url = '/v3/preset/' + presetName;
+    var options = opt_options || {};
+
+    return this.sendRequest('DELETE', url, {
+        config: options.config
+    });
+};
+
+MediaClient.prototype.getMediainfo = function (bucket, key, opt_options) {
+    var url = '/v3/mediainfo';
+    var options = opt_options || {};
+    var params = {
+        bucket: bucket,
+        key: key
+    };
+
+    return this.sendRequest('GET', url, {
+        params: params,
+        config: options.config
+    });
+};
+
+MediaClient.prototype.getProgress = function () {
+    var url = '/v3/statistic/job/realtime';
+    return this.sendRequest('GET', url);
+};
+
+MediaClient.prototype.createSignature = function (credentials, httpMethod, path, params, headers) {
+    var auth = new Auth(credentials.ak, credentials.sk);
+    // 不能对content-type,content-length,content-md5进行签名
+    // 不能对x-bce-request-id进行签名
+    var headersToSign = ['host'];
+    return auth.generateAuthorization(httpMethod, path, params, headers, 0, 0, headersToSign);
+};
+// --- E N D ---
+
+
+MediaClient.prototype.sendRequest = function (httpMethod, resource, varArgs) {
+    var defaultArgs = {
+        bucketName: null,
+        key: null,
+        body: null,
+        headers: {},
+        params: {},
+        config: {},
+        outputStream: null
+    };
+    var args = u.extend(defaultArgs, varArgs);
+
+    var config = u.extend({}, this.config, args.config);
+
+    var client = this;
+    var agent = this._httpAgent = new HttpClient(config);
+    u.each(['progress', 'error', 'abort', 'timeout'], function (eventName) {
+        agent.on(eventName, function (evt) {
+            client.emit(eventName, evt);
+        });
+    });
+    return this._httpAgent.sendRequest(httpMethod, resource, args.body,
+        args.headers, args.params, u.bind(this.createSignature, this),
+        args.outputStream
+    );
+};
+
+module.exports = MediaClient;
+
+
+
+
+
+
+

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1012 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/mime.types.js


+ 83 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/multipart.js

@@ -0,0 +1,83 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/multipart.js
+ * @author leeight
+ */
+
+var util = require('util');
+
+var u = require('underscore');
+
+/**
+ * Multipart Encoder
+ *
+ * @param {string} boundary The multipart boundary.
+ * @constructor
+ */
+function Multipart(boundary) {
+    this._boundary = boundary;
+
+    /**
+     * @type {Array.<Buffer>}
+     */
+    this._parts = [];
+}
+
+/**
+ * Add a part
+ *
+ * @param {string} name The part name.
+ * @param {string|Buffer} data The part data.
+ */
+Multipart.prototype.addPart = function (name, data) {
+    var part = [];
+
+    var header = util.format(
+        '--%s\r\nContent-Disposition: form-data; name="%s"%s\r\n\r\n',
+        this._boundary, name, '');
+    part.push(new Buffer(header));
+
+    if (Buffer.isBuffer(data)) {
+        part.push(data);
+        part.push(new Buffer('\r\n'));
+    }
+    else if (u.isString(data)) {
+        part.push(new Buffer(data + '\r\n'));
+    }
+    else {
+        throw new Error('Invalid data type.');
+    }
+
+    this._parts.push(Buffer.concat(part));
+};
+
+Multipart.prototype.encode = function () {
+    return Buffer.concat(
+        [
+            Buffer.concat(this._parts),
+            new Buffer(util.format('--%s--', this._boundary))
+        ]
+    );
+};
+
+module.exports = Multipart;
+
+
+
+
+
+
+
+
+
+

+ 90 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/ocr_client.js

@@ -0,0 +1,90 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/ocr_client.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+
+var util = require('util');
+
+var debug = require('debug')('bce-sdk:OCRClient');
+
+var BceBaseClient = require('./bce_base_client');
+
+/**
+ * OCR API
+ *
+ * @see http://gollum.baidu.com/bceocrapi
+ * @constructor
+ * @param {Object} config The face client configuration.
+ * @extends {BceBaseClient}
+ */
+function OCRClient(config) {
+    BceBaseClient.call(this, config, 'face', true);
+}
+util.inherits(OCRClient, BceBaseClient);
+
+// --- BEGIN ---
+
+OCRClient.prototype._apiCall = function (url, data, language, options) {
+    debug('url = %j, data = %j, language = %j, options = %j',
+        url, data, language, options);
+
+    options = options || {};
+
+    var body = {};
+    if (Buffer.isBuffer(data)) {
+        body = {
+            base64: data.toString('base64')
+        };
+    }
+    else {
+        body = {
+            bosPath: data
+        };
+    }
+
+    if (language) {
+        body.language = language;
+    }
+
+    return this.sendRequest('POST', url, {
+        body: JSON.stringify(body),
+        config: options.config
+    });
+};
+
+OCRClient.prototype.allText = function (data, language, options) {
+    return this._apiCall('/v1/recognize/text', data, language, options);
+};
+
+OCRClient.prototype.oneLine = function (data, language, options) {
+    return this._apiCall('/v1/recognize/line', data, language, options);
+};
+
+OCRClient.prototype.singleCharacter = function (data, language, options) {
+    return this._apiCall('/v1/recognize/character', data, language, options);
+};
+
+module.exports = OCRClient;
+
+
+
+
+
+
+
+
+

+ 287 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/qns_client.js

@@ -0,0 +1,287 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/qns_client.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+
+var util = require('util');
+
+var u = require('underscore');
+
+var BceBaseClient = require('./bce_base_client');
+
+/**
+ * QNS service api
+ *
+ * @constructor
+ * @param {Object} config The bos client configuration.
+ * @param {string} account The topic account.
+ * @param {string} name The topic name.
+ * @extends {BceBaseClient}
+ */
+function Topic(config, account, name) {
+    BceBaseClient.call(this, config, 'qns', true);
+
+    /**
+     * The topic accunt.
+     *
+     * @private
+     * @type {string}
+     */
+    this._account = account;
+
+    /**
+     * The topic name.
+     *
+     * @private
+     * @type {string}
+     */
+    this._name = name;
+}
+util.inherits(Topic, BceBaseClient);
+
+// --- B E G I N ---
+
+Topic.prototype._buildUrl = function () {
+    var url = '/v1/' + this._account + '/topic/' + this._name;
+    return url;
+};
+
+Topic.prototype.create = function (options) {
+    options = options || {};
+
+    var params = u.pick(options, 'delayInSeconds',
+        'maximumMessageSizeInBytes', 'messageRetentionPeriodInSeconds');
+
+    return this.sendRequest('PUT', this._buildUrl(), {
+        body: JSON.stringify(params)
+    });
+};
+
+Topic.prototype.remove = function () {
+    return this.sendRequest('DELETE', this._buildUrl());
+};
+
+Topic.prototype.get = function () {
+    return this.sendRequest('GET', this._buildUrl());
+};
+
+Topic.prototype.update = function (options) {
+    options = options || {};
+
+    var params = u.pick(options, 'delayInSeconds',
+        'maximumMessageSizeInBytes', 'messageRetentionPeriodInSeconds');
+
+    return this.sendRequest('PUT', this._buildUrl(), {
+        headers: {
+            'If-Match': '*'
+        },
+        body: JSON.stringify(params)
+    });
+};
+
+/**
+ * 发送消息到topic中去,单个请求不超过256KB。单次发送的消息个数不超过1000。
+ *
+ * @param {Array.<string|Object>} messages 需要发送的消息内容,可能是多个.
+ * @return {Q.Promise}
+ */
+Topic.prototype.sendMessages = function (messages) {
+    var url = this._buildUrl() + '/message';
+
+    messages = u.map(messages, function (item) {
+        if (u.isString(item)) {
+            return {
+                messageBody: item
+            };
+        }
+        // {
+        //   messageBody: string,
+        //   // 0 - 3600
+        //   delayInSeconds: number
+        // }
+        return item;
+    });
+
+    return this.sendRequest('POST', url, {
+        body: JSON.stringify({messages: messages})
+    });
+};
+
+Topic.prototype.list = function (options) {
+    options = options || {};
+
+    var params = u.pick(options, 'marker', 'maxRecords');
+
+    var url = '/v1/' + this._account + '/topic';
+    return this.sendRequest('GET', url, {
+        params: params
+    });
+};
+
+Topic.prototype.createSubscription = function (subscriptionName, options) {
+    options = options || {};
+
+    var s = new Subscription(this.config, this._account, subscriptionName);
+
+    if (options.topic == null) {
+        options.topic = this._name;
+    }
+
+    return s.create(options);
+};
+
+// --- E   N   D ---
+
+/**
+ * QNS service api
+ *
+ * @constructor
+ * @param {Object} config The bos client configuration.
+ * @param {string} account The subscription account.
+ * @param {string} name The subscription name.
+ * @extends {BceBaseClient}
+ */
+function Subscription(config, account, name) {
+    BceBaseClient.call(this, config, 'qns', true);
+
+    /**
+     * The topic accunt.
+     *
+     * @private
+     * @type {string}
+     */
+    this._account = account;
+
+    /**
+     * The topic name.
+     *
+     * @private
+     * @type {string}
+     */
+    this._name = name;
+
+}
+util.inherits(Subscription, BceBaseClient);
+
+// --- B E G I N ---
+
+Subscription.prototype._buildUrl = function () {
+    var url = '/v1/' + this._account + '/subscription/' + this._name;
+    return url;
+};
+
+Subscription.prototype.create = function (options) {
+    options = options || {};
+
+    var params = u.pick(options,
+        // 1 - 20 (0)
+        'receiveMessageWaitTimeInSeconds',
+        'topic',
+        // 1 - 43200 (30)
+        'visibilityTimeoutInSeconds',
+        'pushConfig'
+    );
+
+    return this.sendRequest('PUT', this._buildUrl(), {
+        body: JSON.stringify(params)
+    });
+};
+
+Subscription.prototype.remove = function () {
+    return this.sendRequest('DELETE', this._buildUrl());
+};
+
+Subscription.prototype.get = function () {
+    return this.sendRequest('GET', this._buildUrl());
+};
+
+Subscription.prototype.update = function (options) {
+    options = options || {};
+
+    var params = u.pick(options,
+        'receiveMessageWaitTimeInSeconds',
+        'visibilityTimeoutInSeconds'
+    );
+
+    return this.sendRequest('PUT', this._buildUrl(), {
+        headers: {
+            'If-Match': '*'
+        },
+        body: JSON.stringify(params)
+    });
+};
+
+Subscription.prototype.receiveMessages = function (options) {
+    options = options || {};
+
+    var params = u.pick(options,
+        'waitInSeconds',
+        'maxMessages',
+        'peek'
+    );
+
+    var url = this._buildUrl() + '/message';
+    // FIXME 居然 GET 请求需要带着 Request Body,这奇怪!!!
+    return this.sendRequest('GET', url, {
+        body: JSON.stringify(params)
+    });
+};
+
+Subscription.prototype.deleteMessage = function (handle) {
+    var url = this._buildUrl() + '/message';
+    return this.sendRequest('DELETE', url, {
+        params: {
+            receiptHandle: handle
+        }
+    });
+};
+
+Subscription.prototype.changeVisibility = function (handle, seconds) {
+    var url = this._buildUrl() + '/message';
+    return this.sendRequest('PUT', url, {
+        params: {
+            receiptHandle: handle,
+            visibilityTimeoutInSeconds: seconds
+        }
+    });
+};
+
+Subscription.prototype.list = function (options) {
+    options = options || {};
+
+    var params = u.pick(options, 'marker', 'maxRecords');
+
+    var url = '/v1/' + this._account + '/subscription';
+    return this.sendRequest('GET', url, {
+        params: params
+    });
+};
+
+// --- E   N   D ---
+
+exports.Topic = Topic;
+exports.Subscription = Subscription;
+
+
+
+
+
+
+
+
+
+

+ 176 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/ses_client.js

@@ -0,0 +1,176 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/ses_client.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+var fs = require('fs');
+var path = require('path');
+var util = require('util');
+
+var BceBaseClient = require('./bce_base_client');
+
+/**
+ * SES service api
+ *
+ * @constructor
+ * @param {Object} config The bos client configuration.
+ * @extends {BceBaseClient}
+ */
+function SesClient(config) {
+    BceBaseClient.call(this, config, 'ses', true);
+}
+util.inherits(SesClient, BceBaseClient);
+
+// --- B E G I N ---
+SesClient.prototype.addVerifiedEmail = function (email) {
+    var url = '/v1/verifiedEmail/' + encodeURIComponent(email);
+    return this.sendRequest('PUT', url);
+};
+
+SesClient.prototype.getAllVerifiedEmails = function () {
+    var url = '/v1/verifiedEmail';
+    return this.sendRequest('GET', url);
+};
+
+SesClient.prototype.getVerifiedEmail = function (email) {
+    var url = '/v1/verifiedEmail/' + encodeURIComponent(email);
+    return this.sendRequest('GET', url);
+};
+
+SesClient.prototype.deleteVerifiedEmail = function (email) {
+    var url = '/v1/verifiedEmail/' + encodeURIComponent(email);
+    return this.sendRequest('DELETE', url);
+};
+
+SesClient.prototype.getQuota = function () {
+    var url = '/v1/quota';
+    return this.sendRequest('GET', url);
+};
+
+SesClient.prototype.setQuota = function (quota) {
+    var url = '/v1/quota';
+    Object.keys(quota).forEach(function (key) {
+        var value = quota[key];
+        // 如果是 number,传递到后端会出错的
+        quota[key] = value.toString();
+    });
+
+    return this.sendRequest('PUT', url, {
+        body: JSON.stringify(quota)
+    });
+};
+
+SesClient.prototype.sendMail = function (mailOptions) {
+    var source = { from: '', name: '' };
+
+    if (typeof mailOptions.from === 'string') {
+      source.from = mailOptions.from;
+      source.name = mailOptions.from.indexOf('@') !== -1 ? mailOptions.from.split('@')[0] : '';
+    } else if (mailOptions.from && mailOptions.from.addr) {
+      source.from = mailOptions.from.addr;
+      source.name = mailOptions.from.name ?
+        mailOptions.from.name :
+        mailOptions.from.addr.indexOf('@') !== -1 ? mailOptions.from.addr.split('@')[0] : '';
+    }
+
+    var to = mailOptions.to || [];
+    if (typeof to === 'string') {
+        to = [to];
+    }
+
+    var cc = mailOptions.cc || [];
+    if (typeof cc === 'string') {
+        cc = [cc];
+    }
+
+    var bcc = mailOptions.bcc || [];
+    if (typeof bcc === 'string') {
+        bcc = [bcc];
+    }
+
+    var subject = mailOptions.subject;
+    var text = mailOptions.text || '';
+    var html = mailOptions.html || '';
+    var attachments = mailOptions.attachments || [];
+
+    attachments = attachments.map(function (item) {
+        if (typeof item === 'string') {
+            return {
+                /* eslint-disable */
+                file_name: path.basename(item),
+                file_data: {
+                    data: fs.readFileSync(item).toString('base64')
+                }
+                /* eslint-enable */
+            };
+        }
+
+        return item;
+    });
+
+    var url = '/v1/email';
+    var body = JSON.stringify({
+        mail: {
+            source: source,
+            destination: {
+                /* eslint-disable */
+                to_addr: to.map(function (item) {
+                    return {
+                        addr: item
+                    };
+                }),
+                cc_addr: cc.map(function (item) {
+                    return {
+                        addr: item
+                    };
+                }),
+                bcc_addr: bcc.map(function (item) {
+                    return {
+                        addr: item
+                    };
+                })
+                /* eslint-enable */
+            },
+            subject: {
+                charset: 1,
+                data: subject
+            },
+            priority: 1,
+            message: {
+                text: {
+                    charset: 1,
+                    data: text
+                },
+                html: {
+                    charset: 1,
+                    data: html
+                }
+            },
+            attachments: attachments
+        }
+    });
+
+    return this.sendRequest('POST', url, {body: body});
+};
+
+// --- E   N   D ---
+
+module.exports = SesClient;
+
+
+
+
+

+ 41 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/strings.js

@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file strings.js
+ * @author leeight
+ */
+
+var kEscapedMap = {
+    '!': '%21',
+    '\'': '%27',
+    '(': '%28',
+    ')': '%29',
+    '*': '%2A'
+};
+
+exports.normalize = function (string, encodingSlash) {
+    var result = encodeURIComponent(string);
+    result = result.replace(/[!'\(\)\*]/g, function ($1) {
+        return kEscapedMap[$1];
+    });
+
+    if (encodingSlash === false) {
+        result = result.replace(/%2F/gi, '/');
+    }
+
+    return result;
+};
+
+exports.trim = function (string) {
+    return (string || '').replace(/^\s+|\s+$/g, '');
+};
+

+ 70 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/sts.js

@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/sts.js
+ * @author zhouhua
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+
+var util = require('util');
+var u = require('underscore');
+
+var BceBaseClient = require('./bce_base_client');
+
+/**
+ * STS支持 - 将STS抽象成一种服务
+ *
+ * @see https://bce.baidu.com/doc/BOS/API.html#STS.20.E6.9C.8D.E5.8A.A1.E6.8E.A5.E5.8F.A3
+ * @constructor
+ * @param {Object} config The STS configuration.
+ * @extends {BceBaseClient}
+ */
+function STS(config) {
+    BceBaseClient.call(this, config, 'sts', true);
+}
+util.inherits(STS, BceBaseClient);
+
+// --- BEGIN ---
+
+STS.prototype.getSessionToken = function (durationSeconds, params, options) {
+    options = options || {};
+
+    var body = '';
+    if (params) {
+        params = u.pick(params, 'id', 'accessControlList');
+
+        if (params.accessControlList) {
+            params.accessControlList = u.map(params.accessControlList, function (acl) {
+                return u.pick(acl, 'eid', 'service', 'region', 'effect', 'resource', 'permission');
+            });
+        }
+
+        body = JSON.stringify(params);
+    }
+
+    var url = '/v1/sessionToken';
+
+    return this.sendRequest('POST', url, {
+        config: options.config,
+        params: {
+            durationSeconds: durationSeconds
+        },
+        body: body
+    });
+};
+
+// --- E N D ---
+
+module.exports = STS;
+

+ 146 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/tsdb_admin_client.js

@@ -0,0 +1,146 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/tsdb_admin_client.js
+ * @author lidandan
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+
+var util = require('util');
+var u = require('underscore');
+
+var HttpClient = require('./http_client');
+var BceBaseClient = require('./bce_base_client');
+
+/**
+ *TSDB_Admin service api
+ *
+ * @class
+ * @param {Object} config The tsdb_admin client configuration.
+ * @extends {BceBaseClient}
+ */
+function TsdbAdminClient(config) {
+    BceBaseClient.call(this, config, 'tsdb', true);
+
+    /**
+     * @type {HttpClient}
+     */
+    this._httpAgent = null;
+}
+util.inherits(TsdbAdminClient, BceBaseClient);
+
+// --- B E G I N ---
+
+TsdbAdminClient.prototype.createDatabase = function (clientToken, databaseName,
+    ingestDataPointsMonthly, purchaseLength, description, couponName, storeBytesQuota, options) {
+    options = options || {};
+    var url = '/v1/database';
+    var params = {
+        clientToken: clientToken
+    };
+
+    return this.sendRequest('POST', url, {
+        params: params,
+        body: JSON.stringify({
+            databaseName: databaseName,
+            ingestDataPointsMonthly: ingestDataPointsMonthly,
+            storeBytesQuota: storeBytesQuota,
+            purchaseLength: purchaseLength,
+            couponName: couponName,
+            description: description
+        }),
+        headers: options.headers,
+        config: options.config
+    });
+};
+
+TsdbAdminClient.prototype.deleteDatabase = function (databaseId, options) {
+    options = options || {};
+    var url = '/v1/database/' + databaseId;
+    var params = {
+        databaseId: databaseId,
+        query: ''
+    };
+
+    return this.sendRequest('DELETE', url, {
+        params: params,
+        headers: options.headers,
+        config: options.config
+    });
+};
+
+TsdbAdminClient.prototype.getDatabaseInfo = function (databaseId, options) {
+    options = options || {};
+    var url = '/v1/database/' + databaseId;
+    var params = {
+        databaseId: databaseId,
+        query: ''
+    };
+
+    return this.sendRequest('GET', url, {
+        params: params,
+        headers: options.headers,
+        config: options.config
+    });
+};
+
+TsdbAdminClient.prototype.listDatabase = function (options) {
+    options = options || {};
+    var url = '/v1/database';
+    var params = {
+        query: ''
+    };
+
+    return this.sendRequest('GET', url, {
+        params: params,
+        headers: options.headers,
+        config: options.config
+    });
+};
+
+// --- E N D ---
+
+TsdbAdminClient.prototype.sendRequest = function (httpMethod, resource, varArgs) {
+    var defaultArgs = {
+        metricName: null,
+        database: null,
+        key: null,
+        body: null,
+        headers: {},
+        params: {},
+        config: {},
+        outputStream: null
+    };
+    var args = u.extend(defaultArgs, varArgs);
+    var config = u.extend({}, this.config, args.config);
+    var client = this;
+    var agent = this._httpAgent = new HttpClient(config);
+    var httpContext = {
+        httpMethod: httpMethod,
+        resource: resource,
+        args: args,
+        config: config
+    };
+    u.each(['progress', 'error', 'abort', 'timeout'], function (eventName) {
+        agent.on(eventName, function (evt) {
+            client.emit(eventName, evt, httpContext);
+        });
+    });
+
+    return this._httpAgent.sendRequest(httpMethod, resource, args.body,
+        args.headers, args.params, u.bind(this.createSignature, this),
+        args.outputStream
+    );
+};
+module.exports = TsdbAdminClient;

+ 226 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/tsdb_data_client.js

@@ -0,0 +1,226 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/tsdb_data_client.js
+ * @author lidandan
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+
+var util = require('util');
+var u = require('underscore');
+var qs = require('querystring');
+var zlib = require('zlib');
+
+var H = require('./headers');
+var Auth = require('./auth.js');
+var HttpClient = require('./http_client');
+var BceBaseClient = require('./bce_base_client');
+
+/**
+ * TSDB_Data service api
+ *
+ * @class
+ * @param {Object} config The tsdb_data client configuration.
+ * @extends {BceBaseClient}
+ */
+function TsdbDataClient(config) {
+    BceBaseClient.call(this, config, 'tsdb', true);
+
+    /**
+     * @type {HttpClient}
+     */
+    this._httpAgent = null;
+}
+util.inherits(TsdbDataClient, BceBaseClient);
+
+// --- B E G I N ---
+
+TsdbDataClient.prototype.writeDatapoints = function (datapoints, useGzip, options) {
+    options = options || {};
+    var params = {
+        query: ''
+    };
+    var url = '/v1/datapoint';
+    var body = JSON.stringify({datapoints: datapoints});
+    if (useGzip != false) {
+        body = zlib.gzipSync(body);
+        options.headers = options.headers || {};
+        options.headers[H.CONTENT_ENCODING] = 'gzip';
+    }
+    return this.sendRequest('POST', url, {
+        body: body,
+        params: params,
+        headers: options.headers,
+        config: options.config
+    });
+};
+
+TsdbDataClient.prototype.getMetrics = function (options) {
+    options = options || {};
+    var params = {
+        query: ''
+    };
+
+    return this.sendRequest('GET', '/v1/metric', {
+        params: params,
+        headers: options.headers,
+        config: options.config
+    });
+};
+
+TsdbDataClient.prototype.getTags = function (metricName, options) {
+    options = options || {};
+    var url = '/v1/metric/' + metricName + '/tag';
+    var params = {
+        metricName: metricName,
+        query: ''
+    };
+
+    return this.sendRequest('GET', url, {
+        params: params,
+        headers: options.headers,
+        config: options.config
+    });
+};
+
+TsdbDataClient.prototype.getFields = function (metricName, options) {
+    options = options || {};
+    var url = '/v1/metric/' + metricName + '/field';
+    var params = {
+        metricName: metricName,
+        query: ''
+    };
+
+    return this.sendRequest('GET', url, {
+        params: params,
+        headers: options.headers,
+        config: options.config
+    });
+};
+
+TsdbDataClient.prototype.getDatapoints = function (queryList, options) {
+    options = options || {};
+    var url = '/v1/datapoint';
+    var params = u.extend({
+            query: '',
+            disablePresampling: false
+        },
+        u.pick(options, 'disablePresampling')
+    );
+    return this.sendRequest('PUT', url, {
+        body: JSON.stringify({queries: queryList}),
+        params: params,
+        headers: options.headers,
+        config: options.config
+    });
+};
+
+TsdbDataClient.prototype.getRowsWithSql = function (sql, options) {
+    options = options || {};
+    var url = '/v1/row';
+    var params = u.extend({
+            sql: sql
+    });
+    return this.sendRequest('GET', url, {
+        params: params,
+        headers: options.headers,
+        config: options.config
+    });
+};
+
+TsdbDataClient.prototype.generatePresignedUrl = function (queryList, timestamp,
+                                                     expirationInSeconds, headers, params, headersToSign, config) {
+    var resource = '/v1/datapoint';
+    config = u.extend({}, this.config, config);
+    params = u.extend({
+        query: JSON.stringify({queries: queryList}),
+        disablePresampling: false
+    }, u.pick(params, 'disablePresampling'));
+    headers = headers || {};
+    headers.Host = require('url').parse(config.endpoint).host;
+
+    var credentials = config.credentials;
+    var auth = new Auth(credentials.ak, credentials.sk);
+    var authorization = auth.generateAuthorization(
+        'GET', resource, params, headers, timestamp, expirationInSeconds,
+        headersToSign);
+    params.authorization = authorization;
+
+    return util.format('%s%s?%s', config.endpoint, resource, qs.encode(params));
+};
+
+TsdbDataClient.prototype.generatePresignedUrlWithSql = function (sql, timestamp,
+                                                     expirationInSeconds, headers, params, headersToSign, config) {
+    var resource = '/v1/row';
+    config = u.extend({}, this.config, config);
+    params = u.extend({
+        sql: sql
+    });
+    headers = headers || {};
+    headers.Host = require('url').parse(config.endpoint).host;
+
+    var credentials = config.credentials;
+    var auth = new Auth(credentials.ak, credentials.sk);
+    var authorization = auth.generateAuthorization(
+        'GET', resource, params, headers, timestamp, expirationInSeconds,
+        headersToSign);
+    params.authorization = authorization;
+
+    return util.format('%s%s?%s', config.endpoint, resource, qs.encode(params));
+};
+
+TsdbDataClient.prototype.createSignature = function (credentials, httpMethod, path, params, headers) {
+    var auth = new Auth(credentials.ak, credentials.sk);
+    // 不能对content-type,content-length,content-md5进行签名
+    // 不能对x-bce-request-id进行签名
+    var headersToSign = ['host'];
+
+    return auth.generateAuthorization(httpMethod, path, params, headers, 0, 0, headersToSign);
+};
+
+// --- E N D ---
+
+TsdbDataClient.prototype.sendRequest = function (httpMethod, resource, varArgs) {
+    var defaultArgs = {
+        metricName: null,
+        key: null,
+        body: null,
+        headers: {'Content-Type': 'application/json; charset=UTF-8'},
+        params: {},
+        config: {},
+        outputStream: null
+    };
+    var args = u.extend(defaultArgs, varArgs);
+    var config = u.extend({}, this.config, args.config);
+    var client = this;
+    var agent = this._httpAgent = new HttpClient(config);
+    var httpContext = {
+        httpMethod: httpMethod,
+        resource: resource,
+        args: args,
+        config: config
+    };
+    u.each(['progress', 'error', 'abort', 'timeout'], function (eventName) {
+        agent.on(eventName, function (evt) {
+            client.emit(eventName, evt, httpContext);
+        });
+    });
+
+    return this._httpAgent.sendRequest(httpMethod, resource, args.body,
+        args.headers, args.params, u.bind(this.createSignature, this),
+        args.outputStream
+    );
+};
+module.exports = TsdbDataClient;
+

+ 283 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod/Media.js

@@ -0,0 +1,283 @@
+/**
+ * @file src/vod/Media.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint-disable fecs-camelcase */
+
+var util = require('util');
+var u = require('underscore');
+var debug = require('debug')('bce-sdk:VodClient.Media');
+
+var BceBaseClient = require('../bce_base_client');
+// var BosClient = require('../bos_client');
+// var H = require('../headers');
+var helper = require('../helper');
+var Statistic = require('./Statistic');
+
+/**
+ * 音视频媒资接口
+ * https://cloud.baidu.com/doc/VOD/API.html#.E9.9F.B3.E8.A7.86.E9.A2.91.E5.AA.92.E8.B5.84.E6.8E.A5.E5.8F.A3
+ *
+ * @param {Object} config The VodClient.Media Config
+ *
+ * @constructor
+ */
+function Media(config) {
+    BceBaseClient.call(this, config, 'vod', false);
+
+    this._mediaId = null;
+    this._sourceBucket = null;
+    this._sourceKey = null;
+    this._host = null;
+}
+util.inherits(Media, BceBaseClient);
+
+Media.prototype.setMediaId = function (mediaId) {
+    this._mediaId = mediaId;
+    return this;
+};
+
+Media.prototype._buildUrl = function () {
+    var baseUrl = '/v1/media';
+    var extraPaths = u.toArray(arguments);
+
+    if (extraPaths.length) {
+        baseUrl += '/' + extraPaths.join('/');
+    }
+
+    return baseUrl;
+};
+
+// --- BEGIN ---
+
+/**
+ * 申请媒资
+ *
+ * @param {string} mode 提供"no_transcoding"说明要申请一个不转码的媒资;提供NULL/""/其他值说明申请一个普通的转码媒资
+ * @return {Promise.<Object>}
+ */
+Media.prototype.apply = function (mode) {
+    var url = this._buildUrl();
+    var options = {
+        params: {
+            apply: '',
+            mode: mode
+        }
+    };
+
+    var self = this;
+    return this.sendRequest('POST', url, options).then(function (response) {
+        self._mediaId = response.body.mediaId;
+        self._sourceBucket = response.body.sourceBucket;
+        self._sourceKey = response.body.sourceKey;
+        self._host = response.body.host;
+
+        return response;
+    });
+};
+
+/**
+ * 处理媒资
+ *
+ * @param {string} title The media title.
+ * @param {Object?} options The extra media attributes.
+ *
+ * @return {Promise.<Object>}
+ */
+Media.prototype.process = function (title, options) {
+    var url = this._buildUrl(this._mediaId);
+    var payload = u.extend({
+        title: title,
+        description: null,
+        sourceExtension: null,
+        transcodingPresetGroupName: null
+    }, options);
+    payload = u.pick(payload, helper.omitNull);
+
+    return this.sendRequest('POST', url, {
+        params: {
+            process: ''
+        },
+        body: JSON.stringify(payload)
+    });
+};
+
+/**
+ * 停用指定媒资,仅对 PUBLISHED 状态的媒资有效
+ *
+ * @param {string?} opt_mediaId 媒资Id.
+ * @return {Promise.<Object>}
+ */
+Media.prototype.disable = function (opt_mediaId) {
+    var url = this._buildUrl(opt_mediaId || this._mediaId);
+    return this.sendRequest('PUT', url, {
+        params: {
+            disable: ''
+        }
+    });
+};
+
+/**
+ * 恢复指定媒资,仅对 DISABLED 状态的媒资有效
+ *
+ * @param {string?} opt_mediaId 媒资Id.
+ * @return {Promise.<Object>}
+ */
+Media.prototype.resume = function (opt_mediaId) {
+    var url = this._buildUrl(opt_mediaId || this._mediaId);
+    return this.sendRequest('PUT', url, {
+        params: {
+            publish: ''
+        }
+    });
+};
+
+
+/**
+ * 删除指定媒资,对 RUNNING 状态的媒资无效
+ *
+ * @param {string?} opt_mediaId 媒资Id.
+ * @return {Promise.<Object>}
+ */
+Media.prototype.remove = function (opt_mediaId) {
+    var url = this._buildUrl(opt_mediaId || this._mediaId);
+    return this.sendRequest('DELETE', url);
+};
+
+/**
+ * 查询指定媒资
+ *
+ * @param {string?} opt_mediaId 媒资Id.
+ * @return {Promise.<Object>}
+ */
+Media.prototype.get = function (opt_mediaId) {
+    var url = this._buildUrl(opt_mediaId || this._mediaId);
+    debug('url = %j', url);
+    return this.sendRequest('GET', url);
+};
+
+/**
+ * 查询指定媒资的部分信息
+ *
+ * @param {string?} opt_mediaId 媒资Id.
+ * @param {string?} scope 查询范围,目前仅支持thumbnail
+ * @param {string?} taskId 不同scope下的某个任务标识,目前当scope=thumbnail时,taskId分别可取default、second、wonderful
+ * @return {Promise.<Object>}
+ */
+Media.prototype.getPartInfo = function (opt_mediaId, scope, taskId) {
+    var url = this._buildUrl(opt_mediaId || this._mediaId);
+    debug('url = %j', url);
+    return this.sendRequest('GET', url, {
+        params: {
+            scope: scope,
+            taskId: taskId
+        }
+    });
+};
+
+/**
+ * 获取音视频媒资的源文件下载地址
+ *
+ * @param {string?} opt_mediaId 媒资Id.
+ * @param {number?} opt_expiredInSeconds 过期时间,单位(s)
+ *
+ * @return {Promise.<Object>}
+ */
+Media.prototype.getDownloadUrl = function (opt_mediaId, opt_expiredInSeconds) {
+    var expiredInSeconds = opt_expiredInSeconds || 60 * 60 * 24; // 默认1天
+    var url = this._buildUrl(opt_mediaId || this._mediaId);
+    return this.sendRequest('GET', url, {
+        params: {
+            sourcedownload: '',
+            expiredInSeconds: expiredInSeconds
+        }
+    });
+};
+
+/**
+ * 更新指定媒资
+ *
+ * @param {string} title The media title.
+ * @param {string?} description The media description.
+ *
+ * @return {Promise.<Object>}
+ */
+Media.prototype.update = function (title, description) {
+    var url = this._buildUrl(this._mediaId);
+    var payload = u.pick({
+        title: title,
+        description: description
+    }, u.identity);
+
+    return this.sendRequest('PUT', url, {
+        params: {
+            attributes: ''
+        },
+        body: JSON.stringify(payload)
+    });
+};
+
+/**
+ * 查询媒资播放信息,例如:播放次数、最大并发播放次数及下行流量
+ *
+ * @param {Object?} options 过滤参数.
+ * @return {Promise.<Object>}
+ */
+Media.prototype.stat = function (options) {
+    var statClient = new Statistic(this.config);
+    return statClient.setMediaId(this._mediaId).stat(options);
+};
+
+/**
+ * 筛选媒资并分页展示
+ *
+ * 1. pageNo + pageSize
+ * 2. marker + maxSize
+ *
+ * @param {Object?} options The extra pagination and filter parameters.
+ *
+ * @return {Promise.<Object>}
+ */
+Media.prototype.list = function (options) {
+    var url = this._buildUrl();
+    var params = u.extend({
+        pageSize: 10,
+        pageNo: null,
+        marker: null,
+        maxSize: null,
+
+        status: null,
+        begin: null,
+        end: null,
+        title: null
+    }, options);
+    params = u.pick(params, helper.omitNull);
+
+    if (params.marker != null) {
+        delete params.pageNo;
+        delete params.pageSize;
+    }
+    else if (params.pageSize) {
+        delete params.marker;
+        delete params.maxSize;
+    }
+
+    debug('list params = %j', params);
+
+    return this.sendRequest('GET', url, {
+        params: params
+    });
+};
+// --- E N D ---
+
+
+module.exports = Media;
+
+
+
+
+
+

+ 98 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod/Notification.js

@@ -0,0 +1,98 @@
+/**
+ * @file src/vod/Notification.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint-disable fecs-camelcase */
+
+var util = require('util');
+var u = require('underscore');
+// var debug = require('debug')('bce-sdk:VodClient.Notification');
+
+var BceBaseClient = require('../bce_base_client');
+
+
+/**
+ * 音视频通知接口
+ * https://cloud.baidu.com/doc/VOD/API.html#.E9.80.9A.E7.9F.A5.E6.8E.A5.E5.8F.A3
+ *
+ * @param {Object} config The VodClient.Media Config
+ * @constructor
+ */
+function Notification(config) {
+    BceBaseClient.call(this, config, 'vod', false);
+}
+util.inherits(Notification, BceBaseClient);
+
+Notification.prototype._buildUrl = function () {
+    var baseUrl = '/v1/notification';
+    var extraPaths = u.toArray(arguments);
+
+    if (extraPaths.length) {
+        baseUrl += '/' + extraPaths.join('/');
+    }
+
+    return baseUrl;
+};
+
+// --- BEGIN ---
+
+/**
+ * 创建通知
+ *
+ * @param {string} name The notification name.
+ * @param {string} endpoint The notification endpoint.
+ * @return {Promise.<Object>}
+ */
+Notification.prototype.create = function (name, endpoint) {
+    var url = this._buildUrl();
+    var payload = {
+        name: name,
+        endpoint: endpoint
+    };
+
+    return this.sendRequest('POST', url, {
+        body: JSON.stringify(payload)
+    });
+};
+
+/**
+ * 查询通知
+ *
+ * @param {string} name The notification name.
+ * @return {Promise.<Object>}
+ */
+Notification.prototype.get = function (name) {
+    var url = this._buildUrl(name);
+
+    return this.sendRequest('GET', url);
+};
+
+/**
+ * 通知列表
+ *
+ * @return {Promise.<Object>}
+ */
+Notification.prototype.listAll = function () {
+    var url = this._buildUrl();
+
+    return this.sendRequest('GET', url);
+};
+
+/**
+ * 删除通知
+ *
+ * @param {string} name The notification name.
+ * @return {Promise.<Object>}
+ */
+Notification.prototype.remove = function (name) {
+    var url = this._buildUrl(name);
+
+    return this.sendRequest('DELETE', url);
+};
+
+// --- E N D ---
+
+module.exports = Notification;

+ 107 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod/Player.js

@@ -0,0 +1,107 @@
+/**
+ * @file src/vod/Player.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint-disable fecs-camelcase */
+
+var util = require('util');
+var u = require('underscore');
+// var debug = require('debug')('bce-sdk:VodClient.Player');
+
+var BceBaseClient = require('../bce_base_client');
+// var BosClient = require('../bos_client');
+// var H = require('../headers');
+var helper = require('../helper');
+
+
+/**
+ * 音视频播放器服务接口
+ * https://cloud.baidu.com/doc/VOD/API.html#.E6.92.AD.E6.94.BE.E5.99.A8.E6.9C.8D.E5.8A.A1.E6.8E.A5.E5.8F.A3
+ *
+ * @param {Object} config The VodClient.Media Config
+ *
+ * @constructor
+ */
+function Player(config) {
+    BceBaseClient.call(this, config, 'vod', false);
+
+    this._mediaId = null;
+}
+util.inherits(Player, BceBaseClient);
+
+Player.prototype.setMediaId = function (mediaId) {
+    this._mediaId = mediaId;
+    return this;
+};
+
+Player.prototype._buildUrl = function () {
+    var baseUrl = '/v1/media';
+    var extraPaths = u.toArray(arguments);
+
+    if (extraPaths.length) {
+        baseUrl += '/' + extraPaths.join('/');
+    }
+
+    return baseUrl;
+};
+
+// --- BEGIN ---
+
+/**
+ * 查询媒资分发信息
+ *
+ * @param {string?} transcodingPresetName 转码模版名称.
+ * @return {Promise.<Object>}
+ */
+Player.prototype.delivery = function (transcodingPresetName) {
+    var url = this._buildUrl(this._mediaId, 'delivery');
+    var params = u.pick({
+        transcodingPresetName: transcodingPresetName
+    }, u.identity);
+
+    return this.sendRequest('GET', url, {params: params}).then(function (response) {
+        if (response.body.success === true) {
+            response.body = response.body.result;
+        }
+        return response;
+    });
+};
+
+/**
+ * 查询媒资播放代码
+ *
+ * @param {Object} options 配置参数.
+ * @return {Promise.<Object>}
+ */
+Player.prototype.code = function (options) {
+    var url = this._buildUrl(this._mediaId, 'code');
+    var params = u.extend({
+        // required
+        width: 100,
+        height: 100,
+        autostart: true,
+        ak: null,
+
+        // optional
+        transcodingPresetName: null
+    }, options);
+    params = u.pick(params, helper.omitNull);
+
+    return this.sendRequest('GET', url, {params: params}).then(function (response) {
+        var codes = response.body.codes;
+        for (var i = 0; i < codes.length; i++) {
+            var item = codes[i];
+            if (item.codeType === 'html') {
+                item.sourceCode = new Buffer(item.sourceCode, 'base64').toString('utf-8');
+                break;
+            }
+        }
+        return response;
+    });
+};
+// --- E N D ---
+
+module.exports = Player;

+ 108 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod/PresetGroup.js

@@ -0,0 +1,108 @@
+/**
+ * @file src/vod/PresetGroup.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint-disable fecs-camelcase */
+
+var util = require('util');
+var u = require('underscore');
+// var debug = require('debug')('bce-sdk:VodClient.PresetGroup');
+
+var BceBaseClient = require('../bce_base_client');
+
+
+/**
+ * 转码模板组接口
+ * https://cloud.baidu.com/doc/VOD/API.html#.E8.BD.AC.E7.A0.81.E6.A8.A1.E6.9D.BF.E7.BB.84.E6.8E.A5.E5.8F.A3
+ *
+ * @param {Object} config The VodClient.Media Config
+ * @constructor
+ */
+function PresetGroup(config) {
+    BceBaseClient.call(this, config, 'vod', false);
+}
+util.inherits(PresetGroup, BceBaseClient);
+
+PresetGroup.prototype._buildUrl = function () {
+    var baseUrl = '/v1/presetgroup';
+    var extraPaths = u.toArray(arguments);
+
+    if (extraPaths.length) {
+        baseUrl += '/' + extraPaths.join('/');
+    }
+
+    return baseUrl;
+};
+
+// --- BEGIN ---
+
+/**
+ * 创建转码模板组
+ *
+ * @param {Object} config 转码模板组的配置.
+ * @return {Promise.<Object>}
+ */
+PresetGroup.prototype.create = function (config) {
+    var url = this._buildUrl();
+
+    return this.sendRequest('POST', url, {
+        body: JSON.stringify(config)
+    });
+};
+
+/**
+ * 查询指定转码模板组
+ *
+ * @param {string} presetGroupName 转码模版组的名称.
+ * @return {Promise.<Object>}
+ */
+PresetGroup.prototype.get = function (presetGroupName) {
+    var url = this._buildUrl(presetGroupName);
+
+    return this.sendRequest('GET', url);
+};
+
+/**
+ * 查询用户所有转码模板组
+ *
+ * @return {Promise.<Object>}
+ */
+PresetGroup.prototype.listAll = function () {
+    var url = this._buildUrl();
+
+    return this.sendRequest('GET', url);
+};
+
+/**
+ * 更新指定转码模板
+ *
+ * @param {string} presetGroupName 转码模版组的名称.
+ * @param {Object} config 转码模版组的配置.
+ * @return {Promise.<Object>}
+ */
+PresetGroup.prototype.update = function (presetGroupName, config) {
+    var url = this._buildUrl(presetGroupName);
+
+    return this.sendRequest('PUT', url, {
+        body: JSON.stringify(config)
+    });
+};
+
+/**
+ * 删除转码模板组
+ *
+ * @param {string} presetGroupName 转码模版组的名称.
+ * @return {Promise.<Object>}
+ */
+PresetGroup.prototype.remove = function (presetGroupName) {
+    var url = this._buildUrl(presetGroupName);
+
+    return this.sendRequest('DELETE', url);
+};
+
+// --- E N D ---
+
+module.exports = PresetGroup;

+ 71 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod/Statistic.js

@@ -0,0 +1,71 @@
+/**
+ * @file src/vod/Statistic.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint-disable fecs-camelcase */
+
+var util = require('util');
+var u = require('underscore');
+var debug = require('debug')('bce-sdk:VodClient.Statistic');
+
+var BceBaseClient = require('../bce_base_client');
+var helper = require('../helper');
+
+/**
+ * 音视频统计接口
+ * https://cloud.baidu.com/doc/VOD/API.html#.E7.BB.9F.E8.AE.A1.E6.8E.A5.E5.8F.A3
+ *
+ * @param {Object} config The VodClient.Statistic Config
+ *
+ * @constructor
+ */
+function Statistic(config) {
+    BceBaseClient.call(this, config, 'vod', false);
+
+    this._mediaId = null;
+}
+util.inherits(Statistic, BceBaseClient);
+
+Statistic.prototype.setMediaId = function (mediaId) {
+    this._mediaId = mediaId;
+    return this;
+};
+
+Statistic.prototype._buildUrl = function () {
+    var baseUrl = '/v1/statistic';
+    var extraPaths = u.toArray(arguments);
+
+    if (extraPaths.length) {
+        baseUrl += '/' + extraPaths.join('/');
+    }
+
+    return baseUrl;
+};
+
+// --- BEGIN ---
+
+/**
+ * 查询媒资播放信息
+ *
+ * @param {Object} options 过滤参数.
+ * @return {Promise.<Object>}
+ */
+Statistic.prototype.stat = function (options) {
+    var url = this._buildUrl('media', this._mediaId);
+    var params = u.pick(u.extend({
+        startTime: null,
+        endTime: null,
+        aggregate: true
+    }, options), helper.omitNull);
+
+    debug('stat.params = %j', params);
+
+    return this.sendRequest('GET', url, {params: params});
+};
+
+// --- E N D ---
+
+module.exports = Statistic;

+ 82 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod/StrategyGroup.js

@@ -0,0 +1,82 @@
+/**
+ * @file src/vod/StrategyGroup.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint-disable fecs-camelcase */
+
+var util = require('util');
+var u = require('underscore');
+// var debug = require('debug')('bce-sdk:VodClient.StrategyGroup');
+
+var BceBaseClient = require('../bce_base_client');
+
+
+/**
+ * 音视频策略组接口
+ * https://cloud.baidu.com/doc/VOD/API.html#.E7.AD.96.E7.95.A5.E7.BB.84.E6.8E.A5.E5.8F.A3
+ *
+ * @param {Object} config The VodClient.Media Config
+ * @constructor
+ */
+function StrategyGroup(config) {
+    BceBaseClient.call(this, config, 'vod', false);
+}
+util.inherits(StrategyGroup, BceBaseClient);
+
+StrategyGroup.prototype._buildUrl = function () {
+    var baseUrl = '/v1/strategygroup';
+    var extraPaths = u.toArray(arguments);
+
+    if (extraPaths.length) {
+        baseUrl += '/' + extraPaths.join('/');
+    }
+
+    return baseUrl;
+};
+
+// --- BEGIN ---
+
+/**
+ * 查询特定策略组
+ *
+ * @param {string} strategyGroupName 策略组名称.
+ * @return {Promise.<Object>}
+ */
+StrategyGroup.prototype.get = function (strategyGroupName) {
+    var url = this._buildUrl(strategyGroupName);
+
+    return this.sendRequest('GET', url);
+};
+
+/**
+ * 查询所有策略组
+ *
+ * @return {Promise.<Object>}
+ */
+StrategyGroup.prototype.listAll = function () {
+    var url = this._buildUrl();
+
+    return this.sendRequest('GET', url);
+};
+
+/**
+ * 更新特定策略组
+ *
+ * @param {string} strategyGroupName 策略组的名称.
+ * @param {Object} config 策略组的配置.
+ * @return {Promise.<Object>}
+ */
+StrategyGroup.prototype.update = function (strategyGroupName, config) {
+    var url = this._buildUrl(strategyGroupName);
+
+    return this.sendRequest('PUT', url, {
+        body: JSON.stringify(config)
+    });
+};
+
+// --- E N D ---
+
+module.exports = StrategyGroup;

+ 133 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/vod_client.js

@@ -0,0 +1,133 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/vod_client.js
+ * @author zhouhua
+ */
+
+/* eslint-env node */
+/* eslint max-params:[0,10] */
+/* eslint-disable fecs-camelcase */
+
+var util = require('util');
+var u = require('underscore');
+var url = require('url');
+
+var BceBaseClient = require('./bce_base_client');
+var BosClient = require('./bos_client');
+var helper = require('./helper');
+var Media = require('./vod/Media');
+var Notification = require('./vod/Notification');
+var Player = require('./vod/Player');
+var PresetGroup = require('./vod/PresetGroup');
+var Statistic = require('./vod/Statistic');
+var StrategyGroup = require('./vod/StrategyGroup');
+
+/**
+ * VOD音视频点播服务
+ *
+ * @see https://bce.baidu.com/doc/VOD/API.html#API.E6.8E.A5.E5.8F.A3
+ * @constructor
+ * @param {Object} config The VodClient configuration.
+ * @extends {BceBaseClient}
+ */
+function VodClient(config) {
+    BceBaseClient.call(this, config, 'vod', true);
+}
+util.inherits(VodClient, BceBaseClient);
+
+// --- BEGIN ---
+
+VodClient.prototype.createMediaResource = function (title, description, blob, options) {
+    var self = this;
+    var protocol = url.parse(this.config.endpoint).protocol || 'https:';
+    var mediaClient = new Media(this.config);
+    return mediaClient.apply().then(function (res) {
+        // bos endpoint 的协议跟随 this.config.endpoint
+        var bosClient = new BosClient({
+            endpoint: protocol + '//' + res.body.host,
+            credentials: self.config.credentials,
+            sessionToken: self.config.sessionToken
+        });
+        bosClient.on('progress', function (evt) {
+            self.emit('progress', evt);
+        });
+        return helper.upload(bosClient, res.body.sourceBucket, res.body.sourceKey, blob, options);
+    }).then(function () {
+        return mediaClient.process(title, u.extend({description: description}, options));
+    });
+};
+
+VodClient.prototype.getMediaResource = function (mediaId) {
+    return new Media(this.config).setMediaId(mediaId).get();
+};
+
+VodClient.prototype.listMediaResource = function (options) {
+    return new Media(this.config).list(options);
+};
+
+VodClient.prototype.listMediaResources = function (options) {
+    return this.listMediaResource(options);
+};
+
+VodClient.prototype.updateMediaResource = function (mediaId, title, description) {
+    return new Media(this.config).setMediaId(mediaId).update(title, description);
+};
+
+VodClient.prototype.stopMediaResource = function (mediaId, options) {
+    return new Media(this.config).setMediaId(mediaId).disable();
+};
+
+VodClient.prototype.publishMediaResource = function (mediaId, options) {
+    return new Media(this.config).setMediaId(mediaId).resume();
+};
+
+VodClient.prototype.deleteMediaResource = function (mediaId, options) {
+    return new Media(this.config).setMediaId(mediaId).remove();
+};
+
+VodClient.prototype.getPlayableUrl = function (mediaId, transcodingPresetName) {
+    return new Player(this.config).setMediaId(mediaId).delivery(transcodingPresetName);
+};
+
+VodClient.prototype.getDownloadUrl = function (mediaId, expiredInSeconds) {
+    return new Media(this.config).getDownloadUrl(mediaId, expiredInSeconds);
+};
+
+VodClient.prototype.getPlayerCode = function (mediaId, width, height, autoStart, options) {
+    return new Player(this.config).setMediaId(mediaId).code(u.extend({
+        ak: this.config.credentials.ak,
+        width: width,
+        height: height,
+        autostart: autoStart
+    }, options));
+};
+
+VodClient.prototype._generateMediaId = function () {
+    return new Media(this.config).apply();
+};
+
+VodClient.prototype._createMediaResource = function (mediaId, title, description, options) {
+    return new Media(this.config).setMediaId(mediaId).process(title, u.extend({
+        description: description
+    }, options));
+};
+// --- E N D ---
+
+VodClient.Media = Media;
+VodClient.Notification = Notification;
+VodClient.Player = Player;
+VodClient.PresetGroup = PresetGroup;
+VodClient.Statistic = Statistic;
+VodClient.StrategyGroup = StrategyGroup;
+
+module.exports = VodClient;

+ 43 - 0
src/main/webapp/static/bos/node_modules/@baiducloud/sdk/src/wm_stream.js

@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * @file src/wm_stream.js
+ * @author leeight
+ */
+
+/* eslint-env node */
+
+var stream = require('stream');
+var util = require('util');
+
+/**
+ * Writable memory stream, which can be
+ * used a http_client output stream.
+ *
+ * @constructor
+ */
+function WMStream() {
+    stream.Writable.call(this);
+
+    this.store = new Buffer('');
+}
+util.inherits(WMStream, stream.Writable);
+
+WMStream.prototype._write = function (chunk, enc, cb) {
+    var buffer = Buffer.isBuffer(chunk) ? chunk : new Buffer(chunk, enc);
+    this.store = Buffer.concat([this.store, buffer]);
+
+    cb();
+};
+
+module.exports = WMStream;
+

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 275 - 0
src/main/webapp/static/bos/node_modules/async/CHANGELOG.md


+ 19 - 0
src/main/webapp/static/bos/node_modules/async/LICENSE

@@ -0,0 +1,19 @@
+Copyright (c) 2010-2018 Caolan McMahon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

+ 56 - 0
src/main/webapp/static/bos/node_modules/async/README.md

@@ -0,0 +1,56 @@
+![Async Logo](https://raw.githubusercontent.com/caolan/async/master/logo/async-logo_readme.jpg)
+
+[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async)
+[![NPM version](https://img.shields.io/npm/v/async.svg)](https://www.npmjs.com/package/async)
+[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master)
+[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+[![libhive - Open source examples](https://www.libhive.com/providers/npm/packages/async/examples/badge.svg)](https://www.libhive.com/providers/npm/packages/async)
+[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/async/badge?style=rounded)](https://www.jsdelivr.com/package/npm/async)
+
+
+Async is a utility module which provides straight-forward, powerful functions for working with [asynchronous JavaScript](http://caolan.github.io/async/global.html). Although originally designed for use with [Node.js](https://nodejs.org/) and installable via `npm install --save async`, it can also be used directly in the browser.
+
+This version of the package is optimized for the Node.js environment. If you use Async with webpack, install [`async-es`](https://www.npmjs.com/package/async-es) instead.
+
+For Documentation, visit <https://caolan.github.io/async/>
+
+*For Async v1.5.x documentation, go [HERE](https://github.com/caolan/async/blob/v1.5.2/README.md)*
+
+
+```javascript
+// for use with Node-style callbacks...
+var async = require("async");
+
+var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+var configs = {};
+
+async.forEachOf(obj, (value, key, callback) => {
+    fs.readFile(__dirname + value, "utf8", (err, data) => {
+        if (err) return callback(err);
+        try {
+            configs[key] = JSON.parse(data);
+        } catch (e) {
+            return callback(e);
+        }
+        callback();
+    });
+}, err => {
+    if (err) console.error(err.message);
+    // configs is now a map of JSON data
+    doSomethingWith(configs);
+});
+```
+
+```javascript
+var async = require("async");
+
+// ...or ES2017 async functions
+async.mapLimit(urls, 5, async function(url) {
+    const response = await fetch(url)
+    return response.body
+}, (err, results) => {
+    if (err) throw err
+    // results is now an array of the response bodies
+    console.log(results)
+})
+```

+ 50 - 0
src/main/webapp/static/bos/node_modules/async/all.js

@@ -0,0 +1,50 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+var _notId = require('./internal/notId');
+
+var _notId2 = _interopRequireDefault(_notId);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns `true` if every element in `coll` satisfies an async test. If any
+ * iteratee call returns `false`, the main `callback` is immediately called.
+ *
+ * @name every
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias all
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in parallel.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ * @example
+ *
+ * async.every(['file1','file2','file3'], function(filePath, callback) {
+ *     fs.access(filePath, function(err) {
+ *         callback(null, !err)
+ *     });
+ * }, function(err, result) {
+ *     // if result is true then every file exists
+ * });
+ */
+exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));
+module.exports = exports['default'];

+ 42 - 0
src/main/webapp/static/bos/node_modules/async/allLimit.js

@@ -0,0 +1,42 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+var _notId = require('./internal/notId');
+
+var _notId2 = _interopRequireDefault(_notId);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name everyLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.every]{@link module:Collections.every}
+ * @alias allLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in parallel.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ */
+exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));
+module.exports = exports['default'];

+ 37 - 0
src/main/webapp/static/bos/node_modules/async/allSeries.js

@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _everyLimit = require('./everyLimit');
+
+var _everyLimit2 = _interopRequireDefault(_everyLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.
+ *
+ * @name everySeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.every]{@link module:Collections.every}
+ * @alias allSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in series.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ */
+exports.default = (0, _doLimit2.default)(_everyLimit2.default, 1);
+module.exports = exports['default'];

+ 52 - 0
src/main/webapp/static/bos/node_modules/async/any.js

@@ -0,0 +1,52 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns `true` if at least one element in the `coll` satisfies an async test.
+ * If any iteratee call returns `true`, the main `callback` is immediately
+ * called.
+ *
+ * @name some
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias any
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in parallel.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ * @example
+ *
+ * async.some(['file1','file2','file3'], function(filePath, callback) {
+ *     fs.access(filePath, function(err) {
+ *         callback(null, !err)
+ *     });
+ * }, function(err, result) {
+ *     // if result is true then at least one of the files exists
+ * });
+ */
+exports.default = (0, _doParallel2.default)((0, _createTester2.default)(Boolean, _identity2.default));
+module.exports = exports['default'];

+ 43 - 0
src/main/webapp/static/bos/node_modules/async/anyLimit.js

@@ -0,0 +1,43 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name someLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.some]{@link module:Collections.some}
+ * @alias anyLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in parallel.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ */
+exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(Boolean, _identity2.default));
+module.exports = exports['default'];

+ 38 - 0
src/main/webapp/static/bos/node_modules/async/anySeries.js

@@ -0,0 +1,38 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _someLimit = require('./someLimit');
+
+var _someLimit2 = _interopRequireDefault(_someLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.
+ *
+ * @name someSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.some]{@link module:Collections.some}
+ * @alias anySeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collections in series.
+ * The iteratee should complete with a boolean `result` value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the iteratee functions have finished.
+ * Result will be either `true` or `false` depending on the values of the async
+ * tests. Invoked with (err, result).
+ */
+exports.default = (0, _doLimit2.default)(_someLimit2.default, 1);
+module.exports = exports['default'];

+ 68 - 0
src/main/webapp/static/bos/node_modules/async/apply.js

@@ -0,0 +1,68 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+
+exports.default = function (fn /*, ...args*/) {
+    var args = (0, _slice2.default)(arguments, 1);
+    return function () /*callArgs*/{
+        var callArgs = (0, _slice2.default)(arguments);
+        return fn.apply(null, args.concat(callArgs));
+    };
+};
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+;
+
+/**
+ * Creates a continuation function with some arguments already applied.
+ *
+ * Useful as a shorthand when combined with other control flow functions. Any
+ * arguments passed to the returned function are added to the arguments
+ * originally passed to apply.
+ *
+ * @name apply
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {Function} fn - The function you want to eventually apply all
+ * arguments to. Invokes with (arguments...).
+ * @param {...*} arguments... - Any number of arguments to automatically apply
+ * when the continuation is called.
+ * @returns {Function} the partially-applied function
+ * @example
+ *
+ * // using apply
+ * async.parallel([
+ *     async.apply(fs.writeFile, 'testfile1', 'test1'),
+ *     async.apply(fs.writeFile, 'testfile2', 'test2')
+ * ]);
+ *
+ *
+ * // the same process without using apply
+ * async.parallel([
+ *     function(callback) {
+ *         fs.writeFile('testfile1', 'test1', callback);
+ *     },
+ *     function(callback) {
+ *         fs.writeFile('testfile2', 'test2', callback);
+ *     }
+ * ]);
+ *
+ * // It's possible to pass any number of additional arguments when calling the
+ * // continuation:
+ *
+ * node> var fn = async.apply(sys.puts, 'one');
+ * node> fn('two', 'three');
+ * one
+ * two
+ * three
+ */
+module.exports = exports['default'];

+ 51 - 0
src/main/webapp/static/bos/node_modules/async/applyEach.js

@@ -0,0 +1,51 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _applyEach = require('./internal/applyEach');
+
+var _applyEach2 = _interopRequireDefault(_applyEach);
+
+var _map = require('./map');
+
+var _map2 = _interopRequireDefault(_map);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Applies the provided arguments to each function in the array, calling
+ * `callback` after all functions have completed. If you only provide the first
+ * argument, `fns`, then it will return a function which lets you pass in the
+ * arguments as if it were a single function call. If more arguments are
+ * provided, `callback` is required while `args` is still optional.
+ *
+ * @name applyEach
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s
+ * to all call with the same arguments
+ * @param {...*} [args] - any number of separate arguments to pass to the
+ * function.
+ * @param {Function} [callback] - the final argument should be the callback,
+ * called when all functions have completed processing.
+ * @returns {Function} - If only the first argument, `fns`, is provided, it will
+ * return a function which lets you pass in the arguments as if it were a single
+ * function call. The signature is `(..args, callback)`. If invoked with any
+ * arguments, `callback` is required.
+ * @example
+ *
+ * async.applyEach([enableSearch, updateSchema], 'bucket', callback);
+ *
+ * // partial application example:
+ * async.each(
+ *     buckets,
+ *     async.applyEach([enableSearch, updateSchema]),
+ *     callback
+ * );
+ */
+exports.default = (0, _applyEach2.default)(_map2.default);
+module.exports = exports['default'];

+ 37 - 0
src/main/webapp/static/bos/node_modules/async/applyEachSeries.js

@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _applyEach = require('./internal/applyEach');
+
+var _applyEach2 = _interopRequireDefault(_applyEach);
+
+var _mapSeries = require('./mapSeries');
+
+var _mapSeries2 = _interopRequireDefault(_mapSeries);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.
+ *
+ * @name applyEachSeries
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.applyEach]{@link module:ControlFlow.applyEach}
+ * @category Control Flow
+ * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all
+ * call with the same arguments
+ * @param {...*} [args] - any number of separate arguments to pass to the
+ * function.
+ * @param {Function} [callback] - the final argument should be the callback,
+ * called when all functions have completed processing.
+ * @returns {Function} - If only the first argument is provided, it will return
+ * a function which lets you pass in the arguments as if it were a single
+ * function call.
+ */
+exports.default = (0, _applyEach2.default)(_mapSeries2.default);
+module.exports = exports['default'];

+ 110 - 0
src/main/webapp/static/bos/node_modules/async/asyncify.js

@@ -0,0 +1,110 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+exports.default = asyncify;
+
+var _isObject = require('lodash/isObject');
+
+var _isObject2 = _interopRequireDefault(_isObject);
+
+var _initialParams = require('./internal/initialParams');
+
+var _initialParams2 = _interopRequireDefault(_initialParams);
+
+var _setImmediate = require('./internal/setImmediate');
+
+var _setImmediate2 = _interopRequireDefault(_setImmediate);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Take a sync function and make it async, passing its return value to a
+ * callback. This is useful for plugging sync functions into a waterfall,
+ * series, or other async functions. Any arguments passed to the generated
+ * function will be passed to the wrapped function (except for the final
+ * callback argument). Errors thrown will be passed to the callback.
+ *
+ * If the function passed to `asyncify` returns a Promise, that promises's
+ * resolved/rejected state will be used to call the callback, rather than simply
+ * the synchronous return value.
+ *
+ * This also means you can asyncify ES2017 `async` functions.
+ *
+ * @name asyncify
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @alias wrapSync
+ * @category Util
+ * @param {Function} func - The synchronous function, or Promise-returning
+ * function to convert to an {@link AsyncFunction}.
+ * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be
+ * invoked with `(args..., callback)`.
+ * @example
+ *
+ * // passing a regular synchronous function
+ * async.waterfall([
+ *     async.apply(fs.readFile, filename, "utf8"),
+ *     async.asyncify(JSON.parse),
+ *     function (data, next) {
+ *         // data is the result of parsing the text.
+ *         // If there was a parsing error, it would have been caught.
+ *     }
+ * ], callback);
+ *
+ * // passing a function returning a promise
+ * async.waterfall([
+ *     async.apply(fs.readFile, filename, "utf8"),
+ *     async.asyncify(function (contents) {
+ *         return db.model.create(contents);
+ *     }),
+ *     function (model, next) {
+ *         // `model` is the instantiated model object.
+ *         // If there was an error, this function would be skipped.
+ *     }
+ * ], callback);
+ *
+ * // es2017 example, though `asyncify` is not needed if your JS environment
+ * // supports async functions out of the box
+ * var q = async.queue(async.asyncify(async function(file) {
+ *     var intermediateStep = await processFile(file);
+ *     return await somePromise(intermediateStep)
+ * }));
+ *
+ * q.push(files);
+ */
+function asyncify(func) {
+    return (0, _initialParams2.default)(function (args, callback) {
+        var result;
+        try {
+            result = func.apply(this, args);
+        } catch (e) {
+            return callback(e);
+        }
+        // if result is Promise object
+        if ((0, _isObject2.default)(result) && typeof result.then === 'function') {
+            result.then(function (value) {
+                invokeCallback(callback, null, value);
+            }, function (err) {
+                invokeCallback(callback, err.message ? err : new Error(err));
+            });
+        } else {
+            callback(null, result);
+        }
+    });
+}
+
+function invokeCallback(callback, error, value) {
+    try {
+        callback(error, value);
+    } catch (e) {
+        (0, _setImmediate2.default)(rethrow, e);
+    }
+}
+
+function rethrow(error) {
+    throw error;
+}
+module.exports = exports['default'];

+ 289 - 0
src/main/webapp/static/bos/node_modules/async/auto.js

@@ -0,0 +1,289 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+
+exports.default = function (tasks, concurrency, callback) {
+    if (typeof concurrency === 'function') {
+        // concurrency is optional, shift the args.
+        callback = concurrency;
+        concurrency = null;
+    }
+    callback = (0, _once2.default)(callback || _noop2.default);
+    var keys = (0, _keys2.default)(tasks);
+    var numTasks = keys.length;
+    if (!numTasks) {
+        return callback(null);
+    }
+    if (!concurrency) {
+        concurrency = numTasks;
+    }
+
+    var results = {};
+    var runningTasks = 0;
+    var hasError = false;
+
+    var listeners = Object.create(null);
+
+    var readyTasks = [];
+
+    // for cycle detection:
+    var readyToCheck = []; // tasks that have been identified as reachable
+    // without the possibility of returning to an ancestor task
+    var uncheckedDependencies = {};
+
+    (0, _baseForOwn2.default)(tasks, function (task, key) {
+        if (!(0, _isArray2.default)(task)) {
+            // no dependencies
+            enqueueTask(key, [task]);
+            readyToCheck.push(key);
+            return;
+        }
+
+        var dependencies = task.slice(0, task.length - 1);
+        var remainingDependencies = dependencies.length;
+        if (remainingDependencies === 0) {
+            enqueueTask(key, task);
+            readyToCheck.push(key);
+            return;
+        }
+        uncheckedDependencies[key] = remainingDependencies;
+
+        (0, _arrayEach2.default)(dependencies, function (dependencyName) {
+            if (!tasks[dependencyName]) {
+                throw new Error('async.auto task `' + key + '` has a non-existent dependency `' + dependencyName + '` in ' + dependencies.join(', '));
+            }
+            addListener(dependencyName, function () {
+                remainingDependencies--;
+                if (remainingDependencies === 0) {
+                    enqueueTask(key, task);
+                }
+            });
+        });
+    });
+
+    checkForDeadlocks();
+    processQueue();
+
+    function enqueueTask(key, task) {
+        readyTasks.push(function () {
+            runTask(key, task);
+        });
+    }
+
+    function processQueue() {
+        if (readyTasks.length === 0 && runningTasks === 0) {
+            return callback(null, results);
+        }
+        while (readyTasks.length && runningTasks < concurrency) {
+            var run = readyTasks.shift();
+            run();
+        }
+    }
+
+    function addListener(taskName, fn) {
+        var taskListeners = listeners[taskName];
+        if (!taskListeners) {
+            taskListeners = listeners[taskName] = [];
+        }
+
+        taskListeners.push(fn);
+    }
+
+    function taskComplete(taskName) {
+        var taskListeners = listeners[taskName] || [];
+        (0, _arrayEach2.default)(taskListeners, function (fn) {
+            fn();
+        });
+        processQueue();
+    }
+
+    function runTask(key, task) {
+        if (hasError) return;
+
+        var taskCallback = (0, _onlyOnce2.default)(function (err, result) {
+            runningTasks--;
+            if (arguments.length > 2) {
+                result = (0, _slice2.default)(arguments, 1);
+            }
+            if (err) {
+                var safeResults = {};
+                (0, _baseForOwn2.default)(results, function (val, rkey) {
+                    safeResults[rkey] = val;
+                });
+                safeResults[key] = result;
+                hasError = true;
+                listeners = Object.create(null);
+
+                callback(err, safeResults);
+            } else {
+                results[key] = result;
+                taskComplete(key);
+            }
+        });
+
+        runningTasks++;
+        var taskFn = (0, _wrapAsync2.default)(task[task.length - 1]);
+        if (task.length > 1) {
+            taskFn(results, taskCallback);
+        } else {
+            taskFn(taskCallback);
+        }
+    }
+
+    function checkForDeadlocks() {
+        // Kahn's algorithm
+        // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm
+        // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html
+        var currentTask;
+        var counter = 0;
+        while (readyToCheck.length) {
+            currentTask = readyToCheck.pop();
+            counter++;
+            (0, _arrayEach2.default)(getDependents(currentTask), function (dependent) {
+                if (--uncheckedDependencies[dependent] === 0) {
+                    readyToCheck.push(dependent);
+                }
+            });
+        }
+
+        if (counter !== numTasks) {
+            throw new Error('async.auto cannot execute tasks due to a recursive dependency');
+        }
+    }
+
+    function getDependents(taskName) {
+        var result = [];
+        (0, _baseForOwn2.default)(tasks, function (task, key) {
+            if ((0, _isArray2.default)(task) && (0, _baseIndexOf2.default)(task, taskName, 0) >= 0) {
+                result.push(key);
+            }
+        });
+        return result;
+    }
+};
+
+var _arrayEach = require('lodash/_arrayEach');
+
+var _arrayEach2 = _interopRequireDefault(_arrayEach);
+
+var _baseForOwn = require('lodash/_baseForOwn');
+
+var _baseForOwn2 = _interopRequireDefault(_baseForOwn);
+
+var _baseIndexOf = require('lodash/_baseIndexOf');
+
+var _baseIndexOf2 = _interopRequireDefault(_baseIndexOf);
+
+var _isArray = require('lodash/isArray');
+
+var _isArray2 = _interopRequireDefault(_isArray);
+
+var _keys = require('lodash/keys');
+
+var _keys2 = _interopRequireDefault(_keys);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _onlyOnce = require('./internal/onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+module.exports = exports['default'];
+
+/**
+ * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on
+ * their requirements. Each function can optionally depend on other functions
+ * being completed first, and each function is run as soon as its requirements
+ * are satisfied.
+ *
+ * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence
+ * will stop. Further tasks will not execute (so any other functions depending
+ * on it will not run), and the main `callback` is immediately called with the
+ * error.
+ *
+ * {@link AsyncFunction}s also receive an object containing the results of functions which
+ * have completed so far as the first argument, if they have dependencies. If a
+ * task function has no dependencies, it will only be passed a callback.
+ *
+ * @name auto
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {Object} tasks - An object. Each of its properties is either a
+ * function or an array of requirements, with the {@link AsyncFunction} itself the last item
+ * in the array. The object's key of a property serves as the name of the task
+ * defined by that property, i.e. can be used when specifying requirements for
+ * other tasks. The function receives one or two arguments:
+ * * a `results` object, containing the results of the previously executed
+ *   functions, only passed if the task has any dependencies,
+ * * a `callback(err, result)` function, which must be called when finished,
+ *   passing an `error` (which can be `null`) and the result of the function's
+ *   execution.
+ * @param {number} [concurrency=Infinity] - An optional `integer` for
+ * determining the maximum number of tasks that can be run in parallel. By
+ * default, as many as possible.
+ * @param {Function} [callback] - An optional callback which is called when all
+ * the tasks have been completed. It receives the `err` argument if any `tasks`
+ * pass an error to their callback. Results are always returned; however, if an
+ * error occurs, no further `tasks` will be performed, and the results object
+ * will only contain partial results. Invoked with (err, results).
+ * @returns undefined
+ * @example
+ *
+ * async.auto({
+ *     // this function will just be passed a callback
+ *     readData: async.apply(fs.readFile, 'data.txt', 'utf-8'),
+ *     showData: ['readData', function(results, cb) {
+ *         // results.readData is the file's contents
+ *         // ...
+ *     }]
+ * }, callback);
+ *
+ * async.auto({
+ *     get_data: function(callback) {
+ *         console.log('in get_data');
+ *         // async code to get some data
+ *         callback(null, 'data', 'converted to array');
+ *     },
+ *     make_folder: function(callback) {
+ *         console.log('in make_folder');
+ *         // async code to create a directory to store a file in
+ *         // this is run at the same time as getting the data
+ *         callback(null, 'folder');
+ *     },
+ *     write_file: ['get_data', 'make_folder', function(results, callback) {
+ *         console.log('in write_file', JSON.stringify(results));
+ *         // once there is some data and the directory exists,
+ *         // write the data to a file in the directory
+ *         callback(null, 'filename');
+ *     }],
+ *     email_link: ['write_file', function(results, callback) {
+ *         console.log('in email_link', JSON.stringify(results));
+ *         // once the file is written let's email a link to it...
+ *         // results.write_file contains the filename returned by write_file.
+ *         callback(null, {'file':results.write_file, 'email':'user@example.com'});
+ *     }]
+ * }, function(err, results) {
+ *     console.log('err = ', err);
+ *     console.log('results = ', results);
+ * });
+ */

+ 170 - 0
src/main/webapp/static/bos/node_modules/async/autoInject.js

@@ -0,0 +1,170 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+exports.default = autoInject;
+
+var _auto = require('./auto');
+
+var _auto2 = _interopRequireDefault(_auto);
+
+var _baseForOwn = require('lodash/_baseForOwn');
+
+var _baseForOwn2 = _interopRequireDefault(_baseForOwn);
+
+var _arrayMap = require('lodash/_arrayMap');
+
+var _arrayMap2 = _interopRequireDefault(_arrayMap);
+
+var _isArray = require('lodash/isArray');
+
+var _isArray2 = _interopRequireDefault(_isArray);
+
+var _trim = require('lodash/trim');
+
+var _trim2 = _interopRequireDefault(_trim);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m;
+var FN_ARG_SPLIT = /,/;
+var FN_ARG = /(=.+)?(\s*)$/;
+var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
+
+function parseParams(func) {
+    func = func.toString().replace(STRIP_COMMENTS, '');
+    func = func.match(FN_ARGS)[2].replace(' ', '');
+    func = func ? func.split(FN_ARG_SPLIT) : [];
+    func = func.map(function (arg) {
+        return (0, _trim2.default)(arg.replace(FN_ARG, ''));
+    });
+    return func;
+}
+
+/**
+ * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent
+ * tasks are specified as parameters to the function, after the usual callback
+ * parameter, with the parameter names matching the names of the tasks it
+ * depends on. This can provide even more readable task graphs which can be
+ * easier to maintain.
+ *
+ * If a final callback is specified, the task results are similarly injected,
+ * specified as named parameters after the initial error parameter.
+ *
+ * The autoInject function is purely syntactic sugar and its semantics are
+ * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.
+ *
+ * @name autoInject
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.auto]{@link module:ControlFlow.auto}
+ * @category Control Flow
+ * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of
+ * the form 'func([dependencies...], callback). The object's key of a property
+ * serves as the name of the task defined by that property, i.e. can be used
+ * when specifying requirements for other tasks.
+ * * The `callback` parameter is a `callback(err, result)` which must be called
+ *   when finished, passing an `error` (which can be `null`) and the result of
+ *   the function's execution. The remaining parameters name other tasks on
+ *   which the task is dependent, and the results from those tasks are the
+ *   arguments of those parameters.
+ * @param {Function} [callback] - An optional callback which is called when all
+ * the tasks have been completed. It receives the `err` argument if any `tasks`
+ * pass an error to their callback, and a `results` object with any completed
+ * task results, similar to `auto`.
+ * @example
+ *
+ * //  The example from `auto` can be rewritten as follows:
+ * async.autoInject({
+ *     get_data: function(callback) {
+ *         // async code to get some data
+ *         callback(null, 'data', 'converted to array');
+ *     },
+ *     make_folder: function(callback) {
+ *         // async code to create a directory to store a file in
+ *         // this is run at the same time as getting the data
+ *         callback(null, 'folder');
+ *     },
+ *     write_file: function(get_data, make_folder, callback) {
+ *         // once there is some data and the directory exists,
+ *         // write the data to a file in the directory
+ *         callback(null, 'filename');
+ *     },
+ *     email_link: function(write_file, callback) {
+ *         // once the file is written let's email a link to it...
+ *         // write_file contains the filename returned by write_file.
+ *         callback(null, {'file':write_file, 'email':'user@example.com'});
+ *     }
+ * }, function(err, results) {
+ *     console.log('err = ', err);
+ *     console.log('email_link = ', results.email_link);
+ * });
+ *
+ * // If you are using a JS minifier that mangles parameter names, `autoInject`
+ * // will not work with plain functions, since the parameter names will be
+ * // collapsed to a single letter identifier.  To work around this, you can
+ * // explicitly specify the names of the parameters your task function needs
+ * // in an array, similar to Angular.js dependency injection.
+ *
+ * // This still has an advantage over plain `auto`, since the results a task
+ * // depends on are still spread into arguments.
+ * async.autoInject({
+ *     //...
+ *     write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {
+ *         callback(null, 'filename');
+ *     }],
+ *     email_link: ['write_file', function(write_file, callback) {
+ *         callback(null, {'file':write_file, 'email':'user@example.com'});
+ *     }]
+ *     //...
+ * }, function(err, results) {
+ *     console.log('err = ', err);
+ *     console.log('email_link = ', results.email_link);
+ * });
+ */
+function autoInject(tasks, callback) {
+    var newTasks = {};
+
+    (0, _baseForOwn2.default)(tasks, function (taskFn, key) {
+        var params;
+        var fnIsAsync = (0, _wrapAsync.isAsync)(taskFn);
+        var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0;
+
+        if ((0, _isArray2.default)(taskFn)) {
+            params = taskFn.slice(0, -1);
+            taskFn = taskFn[taskFn.length - 1];
+
+            newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);
+        } else if (hasNoDeps) {
+            // no dependencies, use the function as-is
+            newTasks[key] = taskFn;
+        } else {
+            params = parseParams(taskFn);
+            if (taskFn.length === 0 && !fnIsAsync && params.length === 0) {
+                throw new Error("autoInject task functions require explicit parameters.");
+            }
+
+            // remove callback param
+            if (!fnIsAsync) params.pop();
+
+            newTasks[key] = params.concat(newTask);
+        }
+
+        function newTask(results, taskCb) {
+            var newArgs = (0, _arrayMap2.default)(params, function (name) {
+                return results[name];
+            });
+            newArgs.push(taskCb);
+            (0, _wrapAsync2.default)(taskFn).apply(null, newArgs);
+        }
+    });
+
+    (0, _auto2.default)(newTasks, callback);
+}
+module.exports = exports['default'];

+ 17 - 0
src/main/webapp/static/bos/node_modules/async/bower.json

@@ -0,0 +1,17 @@
+{
+  "name": "async",
+  "main": "dist/async.js",
+  "ignore": [
+    "bower_components",
+    "lib",
+    "mocha_test",
+    "node_modules",
+    "perf",
+    "support",
+    "**/.*",
+    "*.config.js",
+    "*.json",
+    "index.js",
+    "Makefile"
+  ]
+}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 94 - 0
src/main/webapp/static/bos/node_modules/async/cargo.js


+ 58 - 0
src/main/webapp/static/bos/node_modules/async/compose.js

@@ -0,0 +1,58 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+exports.default = function () /*...args*/{
+  return _seq2.default.apply(null, (0, _slice2.default)(arguments).reverse());
+};
+
+var _seq = require('./seq');
+
+var _seq2 = _interopRequireDefault(_seq);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+;
+
+/**
+ * Creates a function which is a composition of the passed asynchronous
+ * functions. Each function consumes the return value of the function that
+ * follows. Composing functions `f()`, `g()`, and `h()` would produce the result
+ * of `f(g(h()))`, only this version uses callbacks to obtain the return values.
+ *
+ * Each function is executed with the `this` binding of the composed function.
+ *
+ * @name compose
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @category Control Flow
+ * @param {...AsyncFunction} functions - the asynchronous functions to compose
+ * @returns {Function} an asynchronous function that is the composed
+ * asynchronous `functions`
+ * @example
+ *
+ * function add1(n, callback) {
+ *     setTimeout(function () {
+ *         callback(null, n + 1);
+ *     }, 10);
+ * }
+ *
+ * function mul3(n, callback) {
+ *     setTimeout(function () {
+ *         callback(null, n * 3);
+ *     }, 10);
+ * }
+ *
+ * var add1mul3 = async.compose(mul3, add1);
+ * add1mul3(4, function (err, result) {
+ *     // result now equals 15
+ * });
+ */
+module.exports = exports['default'];

+ 43 - 0
src/main/webapp/static/bos/node_modules/async/concat.js

@@ -0,0 +1,43 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+var _concatLimit = require('./concatLimit');
+
+var _concatLimit2 = _interopRequireDefault(_concatLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Applies `iteratee` to each item in `coll`, concatenating the results. Returns
+ * the concatenated list. The `iteratee`s are called in parallel, and the
+ * results are concatenated as they return. There is no guarantee that the
+ * results array will be returned in the original order of `coll` passed to the
+ * `iteratee` function.
+ *
+ * @name concat
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,
+ * which should use an array as its result. Invoked with (item, callback).
+ * @param {Function} [callback(err)] - A callback which is called after all the
+ * `iteratee` functions have finished, or an error occurs. Results is an array
+ * containing the concatenated results of the `iteratee` function. Invoked with
+ * (err, results).
+ * @example
+ *
+ * async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files) {
+ *     // files is now a list of filenames that exist in the 3 directories
+ * });
+ */
+exports.default = (0, _doLimit2.default)(_concatLimit2.default, Infinity);
+module.exports = exports['default'];

+ 65 - 0
src/main/webapp/static/bos/node_modules/async/concatLimit.js

@@ -0,0 +1,65 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+
+exports.default = function (coll, limit, iteratee, callback) {
+    callback = callback || _noop2.default;
+    var _iteratee = (0, _wrapAsync2.default)(iteratee);
+    (0, _mapLimit2.default)(coll, limit, function (val, callback) {
+        _iteratee(val, function (err /*, ...args*/) {
+            if (err) return callback(err);
+            return callback(null, (0, _slice2.default)(arguments, 1));
+        });
+    }, function (err, mapResults) {
+        var result = [];
+        for (var i = 0; i < mapResults.length; i++) {
+            if (mapResults[i]) {
+                result = _concat.apply(result, mapResults[i]);
+            }
+        }
+
+        return callback(err, result);
+    });
+};
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _mapLimit = require('./mapLimit');
+
+var _mapLimit2 = _interopRequireDefault(_mapLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var _concat = Array.prototype.concat;
+
+/**
+ * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name concatLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.concat]{@link module:Collections.concat}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,
+ * which should use an array as its result. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished, or an error occurs. Results is an array
+ * containing the concatenated results of the `iteratee` function. Invoked with
+ * (err, results).
+ */
+module.exports = exports['default'];

+ 36 - 0
src/main/webapp/static/bos/node_modules/async/concatSeries.js

@@ -0,0 +1,36 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+var _concatLimit = require('./concatLimit');
+
+var _concatLimit2 = _interopRequireDefault(_concatLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time.
+ *
+ * @name concatSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.concat]{@link module:Collections.concat}
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`.
+ * The iteratee should complete with an array an array of results.
+ * Invoked with (item, callback).
+ * @param {Function} [callback(err)] - A callback which is called after all the
+ * `iteratee` functions have finished, or an error occurs. Results is an array
+ * containing the concatenated results of the `iteratee` function. Invoked with
+ * (err, results).
+ */
+exports.default = (0, _doLimit2.default)(_concatLimit2.default, 1);
+module.exports = exports['default'];

+ 66 - 0
src/main/webapp/static/bos/node_modules/async/constant.js

@@ -0,0 +1,66 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+
+exports.default = function () /*...values*/{
+    var values = (0, _slice2.default)(arguments);
+    var args = [null].concat(values);
+    return function () /*...ignoredArgs, callback*/{
+        var callback = arguments[arguments.length - 1];
+        return callback.apply(this, args);
+    };
+};
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+;
+
+/**
+ * Returns a function that when called, calls-back with the values provided.
+ * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to
+ * [`auto`]{@link module:ControlFlow.auto}.
+ *
+ * @name constant
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {...*} arguments... - Any number of arguments to automatically invoke
+ * callback with.
+ * @returns {AsyncFunction} Returns a function that when invoked, automatically
+ * invokes the callback with the previous given arguments.
+ * @example
+ *
+ * async.waterfall([
+ *     async.constant(42),
+ *     function (value, next) {
+ *         // value === 42
+ *     },
+ *     //...
+ * ], callback);
+ *
+ * async.waterfall([
+ *     async.constant(filename, "utf8"),
+ *     fs.readFile,
+ *     function (fileData, next) {
+ *         //...
+ *     }
+ *     //...
+ * ], callback);
+ *
+ * async.auto({
+ *     hostname: async.constant("https://server.net/"),
+ *     port: findFreePort,
+ *     launchServer: ["hostname", "port", function (options, cb) {
+ *         startServer(options, cb);
+ *     }],
+ *     //...
+ * }, callback);
+ */
+module.exports = exports['default'];

+ 61 - 0
src/main/webapp/static/bos/node_modules/async/detect.js

@@ -0,0 +1,61 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+var _findGetResult = require('./internal/findGetResult');
+
+var _findGetResult2 = _interopRequireDefault(_findGetResult);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns the first value in `coll` that passes an async truth test. The
+ * `iteratee` is applied in parallel, meaning the first iteratee to return
+ * `true` will fire the detect `callback` with that result. That means the
+ * result might not be the first item in the original `coll` (in terms of order)
+ * that passes the test.
+
+ * If order within the original `coll` is important, then look at
+ * [`detectSeries`]{@link module:Collections.detectSeries}.
+ *
+ * @name detect
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias find
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ * @example
+ *
+ * async.detect(['file1','file2','file3'], function(filePath, callback) {
+ *     fs.access(filePath, function(err) {
+ *         callback(null, !err)
+ *     });
+ * }, function(err, result) {
+ *     // result now equals the first file in the list that exists
+ * });
+ */
+exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));
+module.exports = exports['default'];

+ 48 - 0
src/main/webapp/static/bos/node_modules/async/detectLimit.js

@@ -0,0 +1,48 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+var _findGetResult = require('./internal/findGetResult');
+
+var _findGetResult2 = _interopRequireDefault(_findGetResult);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name detectLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.detect]{@link module:Collections.detect}
+ * @alias findLimit
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ */
+exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));
+module.exports = exports['default'];

+ 38 - 0
src/main/webapp/static/bos/node_modules/async/detectSeries.js

@@ -0,0 +1,38 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _detectLimit = require('./detectLimit');
+
+var _detectLimit2 = _interopRequireDefault(_detectLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.
+ *
+ * @name detectSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.detect]{@link module:Collections.detect}
+ * @alias findSeries
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ */
+exports.default = (0, _doLimit2.default)(_detectLimit2.default, 1);
+module.exports = exports['default'];

+ 43 - 0
src/main/webapp/static/bos/node_modules/async/dir.js

@@ -0,0 +1,43 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _consoleFunc = require('./internal/consoleFunc');
+
+var _consoleFunc2 = _interopRequireDefault(_consoleFunc);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Logs the result of an [`async` function]{@link AsyncFunction} to the
+ * `console` using `console.dir` to display the properties of the resulting object.
+ * Only works in Node.js or in browsers that support `console.dir` and
+ * `console.error` (such as FF and Chrome).
+ * If multiple arguments are returned from the async function,
+ * `console.dir` is called on each argument in order.
+ *
+ * @name dir
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} function - The function you want to eventually apply
+ * all arguments to.
+ * @param {...*} arguments... - Any number of arguments to apply to the function.
+ * @example
+ *
+ * // in a module
+ * var hello = function(name, callback) {
+ *     setTimeout(function() {
+ *         callback(null, {hello: name});
+ *     }, 1000);
+ * };
+ *
+ * // in the node repl
+ * node> async.dir(hello, 'world');
+ * {hello: 'world'}
+ */
+exports.default = (0, _consoleFunc2.default)('dir');
+module.exports = exports['default'];

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 5609 - 0
src/main/webapp/static/bos/node_modules/async/dist/async.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 2 - 0
src/main/webapp/static/bos/node_modules/async/dist/async.min.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 0
src/main/webapp/static/bos/node_modules/async/dist/async.min.map


+ 66 - 0
src/main/webapp/static/bos/node_modules/async/doDuring.js

@@ -0,0 +1,66 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+exports.default = doDuring;
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _onlyOnce = require('./internal/onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The post-check version of [`during`]{@link module:ControlFlow.during}. To reflect the difference in
+ * the order of operations, the arguments `test` and `fn` are switched.
+ *
+ * Also a version of [`doWhilst`]{@link module:ControlFlow.doWhilst} with asynchronous `test` function.
+ * @name doDuring
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.during]{@link module:ControlFlow.during}
+ * @category Control Flow
+ * @param {AsyncFunction} fn - An async function which is called each time
+ * `test` passes. Invoked with (callback).
+ * @param {AsyncFunction} test - asynchronous truth test to perform before each
+ * execution of `fn`. Invoked with (...args, callback), where `...args` are the
+ * non-error args from the previous callback of `fn`.
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has failed and repeated execution of `fn` has stopped. `callback`
+ * will be passed an error if one occurred, otherwise `null`.
+ */
+function doDuring(fn, test, callback) {
+    callback = (0, _onlyOnce2.default)(callback || _noop2.default);
+    var _fn = (0, _wrapAsync2.default)(fn);
+    var _test = (0, _wrapAsync2.default)(test);
+
+    function next(err /*, ...args*/) {
+        if (err) return callback(err);
+        var args = (0, _slice2.default)(arguments, 1);
+        args.push(check);
+        _test.apply(this, args);
+    };
+
+    function check(err, truth) {
+        if (err) return callback(err);
+        if (!truth) return callback(null);
+        _fn(next);
+    }
+
+    check(null, true);
+}
+module.exports = exports['default'];

+ 39 - 0
src/main/webapp/static/bos/node_modules/async/doUntil.js

@@ -0,0 +1,39 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+exports.default = doUntil;
+
+var _doWhilst = require('./doWhilst');
+
+var _doWhilst2 = _interopRequireDefault(_doWhilst);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the
+ * argument ordering differs from `until`.
+ *
+ * @name doUntil
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.doWhilst]{@link module:ControlFlow.doWhilst}
+ * @category Control Flow
+ * @param {AsyncFunction} iteratee - An async function which is called each time
+ * `test` fails. Invoked with (callback).
+ * @param {Function} test - synchronous truth test to perform after each
+ * execution of `iteratee`. Invoked with any non-error callback results of
+ * `iteratee`.
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has passed and repeated execution of `iteratee` has stopped. `callback`
+ * will be passed an error and any arguments passed to the final `iteratee`'s
+ * callback. Invoked with (err, [results]);
+ */
+function doUntil(iteratee, test, callback) {
+    (0, _doWhilst2.default)(iteratee, function () {
+        return !test.apply(this, arguments);
+    }, callback);
+}
+module.exports = exports['default'];

+ 59 - 0
src/main/webapp/static/bos/node_modules/async/doWhilst.js

@@ -0,0 +1,59 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+exports.default = doWhilst;
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+var _onlyOnce = require('./internal/onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in
+ * the order of operations, the arguments `test` and `iteratee` are switched.
+ *
+ * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
+ *
+ * @name doWhilst
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.whilst]{@link module:ControlFlow.whilst}
+ * @category Control Flow
+ * @param {AsyncFunction} iteratee - A function which is called each time `test`
+ * passes. Invoked with (callback).
+ * @param {Function} test - synchronous truth test to perform after each
+ * execution of `iteratee`. Invoked with any non-error callback results of
+ * `iteratee`.
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has failed and repeated execution of `iteratee` has stopped.
+ * `callback` will be passed an error and any arguments passed to the final
+ * `iteratee`'s callback. Invoked with (err, [results]);
+ */
+function doWhilst(iteratee, test, callback) {
+    callback = (0, _onlyOnce2.default)(callback || _noop2.default);
+    var _iteratee = (0, _wrapAsync2.default)(iteratee);
+    var next = function (err /*, ...args*/) {
+        if (err) return callback(err);
+        var args = (0, _slice2.default)(arguments, 1);
+        if (test.apply(this, args)) return _iteratee(next);
+        callback.apply(null, [null].concat(args));
+    };
+    _iteratee(next);
+}
+module.exports = exports['default'];

+ 76 - 0
src/main/webapp/static/bos/node_modules/async/during.js

@@ -0,0 +1,76 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+exports.default = during;
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _onlyOnce = require('./internal/onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Like [`whilst`]{@link module:ControlFlow.whilst}, except the `test` is an asynchronous function that
+ * is passed a callback in the form of `function (err, truth)`. If error is
+ * passed to `test` or `fn`, the main callback is immediately called with the
+ * value of the error.
+ *
+ * @name during
+ * @static
+ * @memberOf module:ControlFlow
+ * @method
+ * @see [async.whilst]{@link module:ControlFlow.whilst}
+ * @category Control Flow
+ * @param {AsyncFunction} test - asynchronous truth test to perform before each
+ * execution of `fn`. Invoked with (callback).
+ * @param {AsyncFunction} fn - An async function which is called each time
+ * `test` passes. Invoked with (callback).
+ * @param {Function} [callback] - A callback which is called after the test
+ * function has failed and repeated execution of `fn` has stopped. `callback`
+ * will be passed an error, if one occurred, otherwise `null`.
+ * @example
+ *
+ * var count = 0;
+ *
+ * async.during(
+ *     function (callback) {
+ *         return callback(null, count < 5);
+ *     },
+ *     function (callback) {
+ *         count++;
+ *         setTimeout(callback, 1000);
+ *     },
+ *     function (err) {
+ *         // 5 seconds have passed
+ *     }
+ * );
+ */
+function during(test, fn, callback) {
+    callback = (0, _onlyOnce2.default)(callback || _noop2.default);
+    var _fn = (0, _wrapAsync2.default)(fn);
+    var _test = (0, _wrapAsync2.default)(test);
+
+    function next(err) {
+        if (err) return callback(err);
+        _test(check);
+    }
+
+    function check(err, truth) {
+        if (err) return callback(err);
+        if (!truth) return callback(null);
+        _fn(next);
+    }
+
+    _test(check);
+}
+module.exports = exports['default'];

+ 82 - 0
src/main/webapp/static/bos/node_modules/async/each.js

@@ -0,0 +1,82 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = eachLimit;
+
+var _eachOf = require('./eachOf');
+
+var _eachOf2 = _interopRequireDefault(_eachOf);
+
+var _withoutIndex = require('./internal/withoutIndex');
+
+var _withoutIndex2 = _interopRequireDefault(_withoutIndex);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Applies the function `iteratee` to each item in `coll`, in parallel.
+ * The `iteratee` is called with an item from the list, and a callback for when
+ * it has finished. If the `iteratee` passes an error to its `callback`, the
+ * main `callback` (for the `each` function) is immediately called with the
+ * error.
+ *
+ * Note, that since this function applies `iteratee` to each item in parallel,
+ * there is no guarantee that the iteratee functions will complete in order.
+ *
+ * @name each
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias forEach
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to
+ * each item in `coll`. Invoked with (item, callback).
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOf`.
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ * @example
+ *
+ * // assuming openFiles is an array of file names and saveFile is a function
+ * // to save the modified contents of that file:
+ *
+ * async.each(openFiles, saveFile, function(err){
+ *   // if any of the saves produced an error, err would equal that error
+ * });
+ *
+ * // assuming openFiles is an array of file names
+ * async.each(openFiles, function(file, callback) {
+ *
+ *     // Perform operation on file here.
+ *     console.log('Processing file ' + file);
+ *
+ *     if( file.length > 32 ) {
+ *       console.log('This file name is too long');
+ *       callback('File name too long');
+ *     } else {
+ *       // Do work to process file here
+ *       console.log('File processed');
+ *       callback();
+ *     }
+ * }, function(err) {
+ *     // if any of the file processing produced an error, err would equal that error
+ *     if( err ) {
+ *       // One of the iterations produced an error.
+ *       // All processing will now stop.
+ *       console.log('A file failed to process');
+ *     } else {
+ *       console.log('All files have been processed successfully');
+ *     }
+ * });
+ */
+function eachLimit(coll, iteratee, callback) {
+  (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);
+}
+module.exports = exports['default'];

+ 45 - 0
src/main/webapp/static/bos/node_modules/async/eachLimit.js

@@ -0,0 +1,45 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = eachLimit;
+
+var _eachOfLimit = require('./internal/eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _withoutIndex = require('./internal/withoutIndex');
+
+var _withoutIndex2 = _interopRequireDefault(_withoutIndex);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name eachLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.each]{@link module:Collections.each}
+ * @alias forEachLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOfLimit`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+function eachLimit(coll, limit, iteratee, callback) {
+  (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);
+}
+module.exports = exports['default'];

+ 111 - 0
src/main/webapp/static/bos/node_modules/async/eachOf.js

@@ -0,0 +1,111 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+
+exports.default = function (coll, iteratee, callback) {
+    var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric;
+    eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback);
+};
+
+var _isArrayLike = require('lodash/isArrayLike');
+
+var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
+
+var _breakLoop = require('./internal/breakLoop');
+
+var _breakLoop2 = _interopRequireDefault(_breakLoop);
+
+var _eachOfLimit = require('./eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _onlyOnce = require('./internal/onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+// eachOf implementation optimized for array-likes
+function eachOfArrayLike(coll, iteratee, callback) {
+    callback = (0, _once2.default)(callback || _noop2.default);
+    var index = 0,
+        completed = 0,
+        length = coll.length;
+    if (length === 0) {
+        callback(null);
+    }
+
+    function iteratorCallback(err, value) {
+        if (err) {
+            callback(err);
+        } else if (++completed === length || value === _breakLoop2.default) {
+            callback(null);
+        }
+    }
+
+    for (; index < length; index++) {
+        iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback));
+    }
+}
+
+// a generic version of eachOf which can handle array, object, and iterator cases.
+var eachOfGeneric = (0, _doLimit2.default)(_eachOfLimit2.default, Infinity);
+
+/**
+ * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument
+ * to the iteratee.
+ *
+ * @name eachOf
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias forEachOf
+ * @category Collection
+ * @see [async.each]{@link module:Collections.each}
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each
+ * item in `coll`.
+ * The `key` is the item's key, or index in the case of an array.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ * @example
+ *
+ * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+ * var configs = {};
+ *
+ * async.forEachOf(obj, function (value, key, callback) {
+ *     fs.readFile(__dirname + value, "utf8", function (err, data) {
+ *         if (err) return callback(err);
+ *         try {
+ *             configs[key] = JSON.parse(data);
+ *         } catch (e) {
+ *             return callback(e);
+ *         }
+ *         callback();
+ *     });
+ * }, function (err) {
+ *     if (err) console.error(err.message);
+ *     // configs is now a map of JSON data
+ *     doSomethingWith(configs);
+ * });
+ */
+module.exports = exports['default'];

+ 41 - 0
src/main/webapp/static/bos/node_modules/async/eachOfLimit.js

@@ -0,0 +1,41 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = eachOfLimit;
+
+var _eachOfLimit2 = require('./internal/eachOfLimit');
+
+var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name eachOfLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.eachOf]{@link module:Collections.eachOf}
+ * @alias forEachOfLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each
+ * item in `coll`. The `key` is the item's key, or index in the case of an
+ * array.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+function eachOfLimit(coll, limit, iteratee, callback) {
+  (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback);
+}
+module.exports = exports['default'];

+ 35 - 0
src/main/webapp/static/bos/node_modules/async/eachOfSeries.js

@@ -0,0 +1,35 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _eachOfLimit = require('./eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.
+ *
+ * @name eachOfSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.eachOf]{@link module:Collections.eachOf}
+ * @alias forEachOfSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Invoked with (err).
+ */
+exports.default = (0, _doLimit2.default)(_eachOfLimit2.default, 1);
+module.exports = exports['default'];

+ 37 - 0
src/main/webapp/static/bos/node_modules/async/eachSeries.js

@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _eachLimit = require('./eachLimit');
+
+var _eachLimit2 = _interopRequireDefault(_eachLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.
+ *
+ * @name eachSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.each]{@link module:Collections.each}
+ * @alias forEachSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each
+ * item in `coll`.
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOfSeries`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+exports.default = (0, _doLimit2.default)(_eachLimit2.default, 1);
+module.exports = exports['default'];

+ 73 - 0
src/main/webapp/static/bos/node_modules/async/ensureAsync.js

@@ -0,0 +1,73 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+exports.default = ensureAsync;
+
+var _setImmediate = require('./internal/setImmediate');
+
+var _setImmediate2 = _interopRequireDefault(_setImmediate);
+
+var _initialParams = require('./internal/initialParams');
+
+var _initialParams2 = _interopRequireDefault(_initialParams);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Wrap an async function and ensure it calls its callback on a later tick of
+ * the event loop.  If the function already calls its callback on a next tick,
+ * no extra deferral is added. This is useful for preventing stack overflows
+ * (`RangeError: Maximum call stack size exceeded`) and generally keeping
+ * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)
+ * contained. ES2017 `async` functions are returned as-is -- they are immune
+ * to Zalgo's corrupting influences, as they always resolve on a later tick.
+ *
+ * @name ensureAsync
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {AsyncFunction} fn - an async function, one that expects a node-style
+ * callback as its last argument.
+ * @returns {AsyncFunction} Returns a wrapped function with the exact same call
+ * signature as the function passed in.
+ * @example
+ *
+ * function sometimesAsync(arg, callback) {
+ *     if (cache[arg]) {
+ *         return callback(null, cache[arg]); // this would be synchronous!!
+ *     } else {
+ *         doSomeIO(arg, callback); // this IO would be asynchronous
+ *     }
+ * }
+ *
+ * // this has a risk of stack overflows if many results are cached in a row
+ * async.mapSeries(args, sometimesAsync, done);
+ *
+ * // this will defer sometimesAsync's callback if necessary,
+ * // preventing stack overflows
+ * async.mapSeries(args, async.ensureAsync(sometimesAsync), done);
+ */
+function ensureAsync(fn) {
+    if ((0, _wrapAsync.isAsync)(fn)) return fn;
+    return (0, _initialParams2.default)(function (args, callback) {
+        var sync = true;
+        args.push(function () {
+            var innerArgs = arguments;
+            if (sync) {
+                (0, _setImmediate2.default)(function () {
+                    callback.apply(null, innerArgs);
+                });
+            } else {
+                callback.apply(null, innerArgs);
+            }
+        });
+        fn.apply(this, args);
+        sync = false;
+    });
+}
+module.exports = exports['default'];

+ 50 - 0
src/main/webapp/static/bos/node_modules/async/every.js

@@ -0,0 +1,50 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+var _notId = require('./internal/notId');
+
+var _notId2 = _interopRequireDefault(_notId);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns `true` if every element in `coll` satisfies an async test. If any
+ * iteratee call returns `false`, the main `callback` is immediately called.
+ *
+ * @name every
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias all
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in parallel.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ * @example
+ *
+ * async.every(['file1','file2','file3'], function(filePath, callback) {
+ *     fs.access(filePath, function(err) {
+ *         callback(null, !err)
+ *     });
+ * }, function(err, result) {
+ *     // if result is true then every file exists
+ * });
+ */
+exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));
+module.exports = exports['default'];

+ 42 - 0
src/main/webapp/static/bos/node_modules/async/everyLimit.js

@@ -0,0 +1,42 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+var _notId = require('./internal/notId');
+
+var _notId2 = _interopRequireDefault(_notId);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name everyLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.every]{@link module:Collections.every}
+ * @alias allLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in parallel.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ */
+exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));
+module.exports = exports['default'];

+ 37 - 0
src/main/webapp/static/bos/node_modules/async/everySeries.js

@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _everyLimit = require('./everyLimit');
+
+var _everyLimit2 = _interopRequireDefault(_everyLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.
+ *
+ * @name everySeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.every]{@link module:Collections.every}
+ * @alias allSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async truth test to apply to each item
+ * in the collection in series.
+ * The iteratee must complete with a boolean result value.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result will be either `true` or `false`
+ * depending on the values of the async tests. Invoked with (err, result).
+ */
+exports.default = (0, _doLimit2.default)(_everyLimit2.default, 1);
+module.exports = exports['default'];

+ 45 - 0
src/main/webapp/static/bos/node_modules/async/filter.js

@@ -0,0 +1,45 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _filter = require('./internal/filter');
+
+var _filter2 = _interopRequireDefault(_filter);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns a new array of all the values in `coll` which pass an async truth
+ * test. This operation is performed in parallel, but the results array will be
+ * in the same order as the original.
+ *
+ * @name filter
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias select
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ * @example
+ *
+ * async.filter(['file1','file2','file3'], function(filePath, callback) {
+ *     fs.access(filePath, function(err) {
+ *         callback(null, !err)
+ *     });
+ * }, function(err, results) {
+ *     // results now equals an array of the existing files
+ * });
+ */
+exports.default = (0, _doParallel2.default)(_filter2.default);
+module.exports = exports['default'];

+ 37 - 0
src/main/webapp/static/bos/node_modules/async/filterLimit.js

@@ -0,0 +1,37 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _filter = require('./internal/filter');
+
+var _filter2 = _interopRequireDefault(_filter);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name filterLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @alias selectLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results).
+ */
+exports.default = (0, _doParallelLimit2.default)(_filter2.default);
+module.exports = exports['default'];

+ 35 - 0
src/main/webapp/static/bos/node_modules/async/filterSeries.js

@@ -0,0 +1,35 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _filterLimit = require('./filterLimit');
+
+var _filterLimit2 = _interopRequireDefault(_filterLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.
+ *
+ * @name filterSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.filter]{@link module:Collections.filter}
+ * @alias selectSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {Function} iteratee - A truth test to apply to each item in `coll`.
+ * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
+ * with a boolean argument once it has completed. Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Invoked with (err, results)
+ */
+exports.default = (0, _doLimit2.default)(_filterLimit2.default, 1);
+module.exports = exports['default'];

+ 61 - 0
src/main/webapp/static/bos/node_modules/async/find.js

@@ -0,0 +1,61 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallel = require('./internal/doParallel');
+
+var _doParallel2 = _interopRequireDefault(_doParallel);
+
+var _findGetResult = require('./internal/findGetResult');
+
+var _findGetResult2 = _interopRequireDefault(_findGetResult);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns the first value in `coll` that passes an async truth test. The
+ * `iteratee` is applied in parallel, meaning the first iteratee to return
+ * `true` will fire the detect `callback` with that result. That means the
+ * result might not be the first item in the original `coll` (in terms of order)
+ * that passes the test.
+
+ * If order within the original `coll` is important, then look at
+ * [`detectSeries`]{@link module:Collections.detectSeries}.
+ *
+ * @name detect
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias find
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ * @example
+ *
+ * async.detect(['file1','file2','file3'], function(filePath, callback) {
+ *     fs.access(filePath, function(err) {
+ *         callback(null, !err)
+ *     });
+ * }, function(err, result) {
+ *     // result now equals the first file in the list that exists
+ * });
+ */
+exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));
+module.exports = exports['default'];

+ 48 - 0
src/main/webapp/static/bos/node_modules/async/findLimit.js

@@ -0,0 +1,48 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _identity = require('lodash/identity');
+
+var _identity2 = _interopRequireDefault(_identity);
+
+var _createTester = require('./internal/createTester');
+
+var _createTester2 = _interopRequireDefault(_createTester);
+
+var _doParallelLimit = require('./internal/doParallelLimit');
+
+var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);
+
+var _findGetResult = require('./internal/findGetResult');
+
+var _findGetResult2 = _interopRequireDefault(_findGetResult);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name detectLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.detect]{@link module:Collections.detect}
+ * @alias findLimit
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ */
+exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));
+module.exports = exports['default'];

+ 38 - 0
src/main/webapp/static/bos/node_modules/async/findSeries.js

@@ -0,0 +1,38 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _detectLimit = require('./detectLimit');
+
+var _detectLimit2 = _interopRequireDefault(_detectLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.
+ *
+ * @name detectSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.detect]{@link module:Collections.detect}
+ * @alias findSeries
+ * @category Collections
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.
+ * The iteratee must complete with a boolean value as its result.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called as soon as any
+ * iteratee returns `true`, or after all the `iteratee` functions have finished.
+ * Result will be the first item in the array that passes the truth test
+ * (iteratee) or the value `undefined` if none passed. Invoked with
+ * (err, result).
+ */
+exports.default = (0, _doLimit2.default)(_detectLimit2.default, 1);
+module.exports = exports['default'];

+ 78 - 0
src/main/webapp/static/bos/node_modules/async/foldl.js

@@ -0,0 +1,78 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+exports.default = reduce;
+
+var _eachOfSeries = require('./eachOfSeries');
+
+var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Reduces `coll` into a single value using an async `iteratee` to return each
+ * successive step. `memo` is the initial state of the reduction. This function
+ * only operates in series.
+ *
+ * For performance reasons, it may make sense to split a call to this function
+ * into a parallel map, and then use the normal `Array.prototype.reduce` on the
+ * results. This function is for situations where each step in the reduction
+ * needs to be async; if you can get the data before reducing it, then it's
+ * probably a good idea to do so.
+ *
+ * @name reduce
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias inject
+ * @alias foldl
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {*} memo - The initial state of the reduction.
+ * @param {AsyncFunction} iteratee - A function applied to each item in the
+ * array to produce the next step in the reduction.
+ * The `iteratee` should complete with the next state of the reduction.
+ * If the iteratee complete with an error, the reduction is stopped and the
+ * main `callback` is immediately called with the error.
+ * Invoked with (memo, item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result is the reduced value. Invoked with
+ * (err, result).
+ * @example
+ *
+ * async.reduce([1,2,3], 0, function(memo, item, callback) {
+ *     // pointless async:
+ *     process.nextTick(function() {
+ *         callback(null, memo + item)
+ *     });
+ * }, function(err, result) {
+ *     // result is now equal to the last value of memo, which is 6
+ * });
+ */
+function reduce(coll, memo, iteratee, callback) {
+    callback = (0, _once2.default)(callback || _noop2.default);
+    var _iteratee = (0, _wrapAsync2.default)(iteratee);
+    (0, _eachOfSeries2.default)(coll, function (x, i, callback) {
+        _iteratee(memo, x, function (err, v) {
+            memo = v;
+            callback(err);
+        });
+    }, function (err) {
+        callback(err, memo);
+    });
+}
+module.exports = exports['default'];

+ 44 - 0
src/main/webapp/static/bos/node_modules/async/foldr.js

@@ -0,0 +1,44 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = reduceRight;
+
+var _reduce = require('./reduce');
+
+var _reduce2 = _interopRequireDefault(_reduce);
+
+var _slice = require('./internal/slice');
+
+var _slice2 = _interopRequireDefault(_slice);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.
+ *
+ * @name reduceRight
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.reduce]{@link module:Collections.reduce}
+ * @alias foldr
+ * @category Collection
+ * @param {Array} array - A collection to iterate over.
+ * @param {*} memo - The initial state of the reduction.
+ * @param {AsyncFunction} iteratee - A function applied to each item in the
+ * array to produce the next step in the reduction.
+ * The `iteratee` should complete with the next state of the reduction.
+ * If the iteratee complete with an error, the reduction is stopped and the
+ * main `callback` is immediately called with the error.
+ * Invoked with (memo, item, callback).
+ * @param {Function} [callback] - A callback which is called after all the
+ * `iteratee` functions have finished. Result is the reduced value. Invoked with
+ * (err, result).
+ */
+function reduceRight(array, memo, iteratee, callback) {
+  var reversed = (0, _slice2.default)(array).reverse();
+  (0, _reduce2.default)(reversed, memo, iteratee, callback);
+}
+module.exports = exports['default'];

+ 82 - 0
src/main/webapp/static/bos/node_modules/async/forEach.js

@@ -0,0 +1,82 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = eachLimit;
+
+var _eachOf = require('./eachOf');
+
+var _eachOf2 = _interopRequireDefault(_eachOf);
+
+var _withoutIndex = require('./internal/withoutIndex');
+
+var _withoutIndex2 = _interopRequireDefault(_withoutIndex);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Applies the function `iteratee` to each item in `coll`, in parallel.
+ * The `iteratee` is called with an item from the list, and a callback for when
+ * it has finished. If the `iteratee` passes an error to its `callback`, the
+ * main `callback` (for the `each` function) is immediately called with the
+ * error.
+ *
+ * Note, that since this function applies `iteratee` to each item in parallel,
+ * there is no guarantee that the iteratee functions will complete in order.
+ *
+ * @name each
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias forEach
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to
+ * each item in `coll`. Invoked with (item, callback).
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOf`.
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ * @example
+ *
+ * // assuming openFiles is an array of file names and saveFile is a function
+ * // to save the modified contents of that file:
+ *
+ * async.each(openFiles, saveFile, function(err){
+ *   // if any of the saves produced an error, err would equal that error
+ * });
+ *
+ * // assuming openFiles is an array of file names
+ * async.each(openFiles, function(file, callback) {
+ *
+ *     // Perform operation on file here.
+ *     console.log('Processing file ' + file);
+ *
+ *     if( file.length > 32 ) {
+ *       console.log('This file name is too long');
+ *       callback('File name too long');
+ *     } else {
+ *       // Do work to process file here
+ *       console.log('File processed');
+ *       callback();
+ *     }
+ * }, function(err) {
+ *     // if any of the file processing produced an error, err would equal that error
+ *     if( err ) {
+ *       // One of the iterations produced an error.
+ *       // All processing will now stop.
+ *       console.log('A file failed to process');
+ *     } else {
+ *       console.log('All files have been processed successfully');
+ *     }
+ * });
+ */
+function eachLimit(coll, iteratee, callback) {
+  (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);
+}
+module.exports = exports['default'];

+ 45 - 0
src/main/webapp/static/bos/node_modules/async/forEachLimit.js

@@ -0,0 +1,45 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = eachLimit;
+
+var _eachOfLimit = require('./internal/eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _withoutIndex = require('./internal/withoutIndex');
+
+var _withoutIndex2 = _interopRequireDefault(_withoutIndex);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.
+ *
+ * @name eachLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.each]{@link module:Collections.each}
+ * @alias forEachLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * The array index is not passed to the iteratee.
+ * If you need the index, use `eachOfLimit`.
+ * Invoked with (item, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+function eachLimit(coll, limit, iteratee, callback) {
+  (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);
+}
+module.exports = exports['default'];

+ 111 - 0
src/main/webapp/static/bos/node_modules/async/forEachOf.js

@@ -0,0 +1,111 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+    value: true
+});
+
+exports.default = function (coll, iteratee, callback) {
+    var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric;
+    eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback);
+};
+
+var _isArrayLike = require('lodash/isArrayLike');
+
+var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
+
+var _breakLoop = require('./internal/breakLoop');
+
+var _breakLoop2 = _interopRequireDefault(_breakLoop);
+
+var _eachOfLimit = require('./eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+var _noop = require('lodash/noop');
+
+var _noop2 = _interopRequireDefault(_noop);
+
+var _once = require('./internal/once');
+
+var _once2 = _interopRequireDefault(_once);
+
+var _onlyOnce = require('./internal/onlyOnce');
+
+var _onlyOnce2 = _interopRequireDefault(_onlyOnce);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+// eachOf implementation optimized for array-likes
+function eachOfArrayLike(coll, iteratee, callback) {
+    callback = (0, _once2.default)(callback || _noop2.default);
+    var index = 0,
+        completed = 0,
+        length = coll.length;
+    if (length === 0) {
+        callback(null);
+    }
+
+    function iteratorCallback(err, value) {
+        if (err) {
+            callback(err);
+        } else if (++completed === length || value === _breakLoop2.default) {
+            callback(null);
+        }
+    }
+
+    for (; index < length; index++) {
+        iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback));
+    }
+}
+
+// a generic version of eachOf which can handle array, object, and iterator cases.
+var eachOfGeneric = (0, _doLimit2.default)(_eachOfLimit2.default, Infinity);
+
+/**
+ * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument
+ * to the iteratee.
+ *
+ * @name eachOf
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @alias forEachOf
+ * @category Collection
+ * @see [async.each]{@link module:Collections.each}
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - A function to apply to each
+ * item in `coll`.
+ * The `key` is the item's key, or index in the case of an array.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ * @example
+ *
+ * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+ * var configs = {};
+ *
+ * async.forEachOf(obj, function (value, key, callback) {
+ *     fs.readFile(__dirname + value, "utf8", function (err, data) {
+ *         if (err) return callback(err);
+ *         try {
+ *             configs[key] = JSON.parse(data);
+ *         } catch (e) {
+ *             return callback(e);
+ *         }
+ *         callback();
+ *     });
+ * }, function (err) {
+ *     if (err) console.error(err.message);
+ *     // configs is now a map of JSON data
+ *     doSomethingWith(configs);
+ * });
+ */
+module.exports = exports['default'];

+ 41 - 0
src/main/webapp/static/bos/node_modules/async/forEachOfLimit.js

@@ -0,0 +1,41 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.default = eachOfLimit;
+
+var _eachOfLimit2 = require('./internal/eachOfLimit');
+
+var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2);
+
+var _wrapAsync = require('./internal/wrapAsync');
+
+var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a
+ * time.
+ *
+ * @name eachOfLimit
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.eachOf]{@link module:Collections.eachOf}
+ * @alias forEachOfLimit
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {number} limit - The maximum number of async operations at a time.
+ * @param {AsyncFunction} iteratee - An async function to apply to each
+ * item in `coll`. The `key` is the item's key, or index in the case of an
+ * array.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all
+ * `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ */
+function eachOfLimit(coll, limit, iteratee, callback) {
+  (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback);
+}
+module.exports = exports['default'];

+ 35 - 0
src/main/webapp/static/bos/node_modules/async/forEachOfSeries.js

@@ -0,0 +1,35 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+
+var _eachOfLimit = require('./eachOfLimit');
+
+var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
+
+var _doLimit = require('./internal/doLimit');
+
+var _doLimit2 = _interopRequireDefault(_doLimit);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.
+ *
+ * @name eachOfSeries
+ * @static
+ * @memberOf module:Collections
+ * @method
+ * @see [async.eachOf]{@link module:Collections.eachOf}
+ * @alias forEachOfSeries
+ * @category Collection
+ * @param {Array|Iterable|Object} coll - A collection to iterate over.
+ * @param {AsyncFunction} iteratee - An async function to apply to each item in
+ * `coll`.
+ * Invoked with (item, key, callback).
+ * @param {Function} [callback] - A callback which is called when all `iteratee`
+ * functions have finished, or an error occurs. Invoked with (err).
+ */
+exports.default = (0, _doLimit2.default)(_eachOfLimit2.default, 1);
+module.exports = exports['default'];

+ 0 - 0
src/main/webapp/static/bos/node_modules/async/forEachSeries.js


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio