anvero-api 0.0.0-stage → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/config.default.d.ts +47 -0
- package/dist/config/config.default.js +1 -0
- package/dist/config/config.local.d.ts +6 -0
- package/dist/config/config.local.js +1 -0
- package/dist/config/config.production.d.ts +5 -0
- package/dist/config/config.production.js +1 -0
- package/dist/configuration.d.ts +17 -0
- package/dist/configuration.js +1 -0
- package/dist/decorator/Action.d.ts +14 -0
- package/dist/decorator/Action.js +1 -0
- package/dist/decorator/ActionApitest.d.ts +2 -0
- package/dist/decorator/ActionApitest.js +1 -0
- package/dist/decorator/Intercept.d.ts +5 -0
- package/dist/decorator/Intercept.js +1 -0
- package/dist/exception/ApiError.d.ts +8 -0
- package/dist/exception/ApiError.js +1 -0
- package/dist/helper/getAppsConfig.d.ts +1 -0
- package/dist/helper/getAppsConfig.js +1 -0
- package/dist/helper/getRoutes.d.ts +13 -0
- package/dist/helper/getRoutes.js +1 -0
- package/dist/helper/getSwaggerJson.d.ts +40 -0
- package/dist/helper/getSwaggerJson.js +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +1 -0
- package/dist/service/ApiService.d.ts +12 -0
- package/dist/service/ApiService.js +1 -0
- package/dist/service/ApitestService.d.ts +19 -0
- package/dist/service/ApitestService.js +1 -0
- package/dist/service/ExcelService.d.ts +46 -0
- package/dist/service/ExcelService.js +1 -0
- package/dist/service/ExcelStream.d.ts +52 -0
- package/dist/service/ExcelStream.js +1 -0
- package/dist/types/action.d.ts +47 -0
- package/dist/types/action.js +1 -0
- package/dist/types/common.d.ts +13 -0
- package/dist/types/common.js +1 -0
- package/dist/types/intercept.d.ts +3 -0
- package/dist/types/intercept.js +1 -0
- package/index.d.ts +50 -0
- package/package.json +40 -3
- package/public/apitest.js +946 -0
- package/public/config.js +95 -0
- package/public/index.html +110 -0
- package/public/style/apitest.css +128 -0
- package/public/style/bootstrap/bootstrap.css +6799 -0
- package/public/style/bootstrap/bootstrap.js +2363 -0
- package/public/style/bootstrap.css +6799 -0
- package/public/style/bootstrap.css.map +1 -0
- package/public/style/jquery/jquery.min.js +6 -0
- package/public/style/md5/md5.js +1 -0
- package/public/style/pinyin.js +45 -0
- package/public/style/pretty-json/backbone-min.js +2 -0
- package/public/style/pretty-json/pretty-json-min.js +334 -0
- package/public/style/pretty-json/pretty-json.css +48 -0
- package/public/style/pretty-json/underscore-min.js +6 -0
- package/public/style/pretty-json.css +48 -0
- package/README.md +0 -3
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as exceljs from 'exceljs';
|
|
2
|
+
import { IMidwayApplication } from '@midwayjs/core';
|
|
3
|
+
import { ExcelStream } from './ExcelStream';
|
|
4
|
+
interface ExcelColumn {
|
|
5
|
+
key: string;
|
|
6
|
+
header: string;
|
|
7
|
+
}
|
|
8
|
+
interface ExcelColumnParse extends ExcelColumn {
|
|
9
|
+
onRead?: (row: any, rowCell?: exceljs.CellModel) => any | Promise<any>;
|
|
10
|
+
handler?: (row: any, rowCell?: exceljs.CellModel) => any | Promise<any>;
|
|
11
|
+
}
|
|
12
|
+
interface ExcelColumnExport extends ExcelColumn {
|
|
13
|
+
onWrite?: (row: any, options?: {
|
|
14
|
+
row: exceljs.Row;
|
|
15
|
+
col: exceljs.Column;
|
|
16
|
+
cell: exceljs.Cell;
|
|
17
|
+
sheet: exceljs.Worksheet;
|
|
18
|
+
}) => any | Promise<any>;
|
|
19
|
+
handler?: (row: any, options?: {
|
|
20
|
+
row: exceljs.Row;
|
|
21
|
+
col: exceljs.Column;
|
|
22
|
+
cell: exceljs.Cell;
|
|
23
|
+
sheet: exceljs.Worksheet;
|
|
24
|
+
}) => any | Promise<any>;
|
|
25
|
+
}
|
|
26
|
+
export declare class ExcelService {
|
|
27
|
+
protected app: IMidwayApplication;
|
|
28
|
+
parse(filepath: string, column: ExcelColumnParse[], sheets?: Array<number | string>): Promise<Array<{
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}>>;
|
|
31
|
+
export(filename: string, column: Array<ExcelColumnExport>, tmpEntitys: Array<{
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}>, savepath?: string, beforSave?: (options: {
|
|
34
|
+
workbook: exceljs.Workbook;
|
|
35
|
+
worksheet: exceljs.Worksheet;
|
|
36
|
+
}) => Promise<void>): Promise<{
|
|
37
|
+
filename: string;
|
|
38
|
+
filepath: string;
|
|
39
|
+
}>;
|
|
40
|
+
stream(file: string, option?: {
|
|
41
|
+
rootpath?: string;
|
|
42
|
+
suffix?: string[];
|
|
43
|
+
}): Promise<ExcelStream>;
|
|
44
|
+
download(ctx: any, filepath: string): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a14_0x364e29=a14_0x3ca0;(function(_0x266221,_0x2df132){const _0x22de66=a14_0x3ca0,_0x40711a=_0x266221();while(!![]){try{const _0x36173c=parseInt(_0x22de66(0x1a3))/0x1+parseInt(_0x22de66(0x1d6))/0x2+parseInt(_0x22de66(0x1a2))/0x3+-parseInt(_0x22de66(0x19c))/0x4*(parseInt(_0x22de66(0x1a0))/0x5)+-parseInt(_0x22de66(0x1c6))/0x6+parseInt(_0x22de66(0x1ca))/0x7+-parseInt(_0x22de66(0x198))/0x8;if(_0x36173c===_0x2df132)break;else _0x40711a['push'](_0x40711a['shift']());}catch(_0x33f4ab){_0x40711a['push'](_0x40711a['shift']());}}}(a14_0xcca6,0xbaac5));const a14_0x59f5e4=(function(){let _0x505a5f=!![];return function(_0x5d91c5,_0x49c086){const _0x37e3ec=_0x505a5f?function(){const _0x1f4363=a14_0x3ca0;if(_0x49c086){const _0x3ac67b=_0x49c086[_0x1f4363(0x1ce)](_0x5d91c5,arguments);return _0x49c086=null,_0x3ac67b;}}:function(){};return _0x505a5f=![],_0x37e3ec;};}()),a14_0x3c50fe=a14_0x59f5e4(this,function(){const _0xa5b159=a14_0x3ca0;return a14_0x3c50fe[_0xa5b159(0x1c4)]()[_0xa5b159(0x1b7)]('(((.+)+)+)+$')[_0xa5b159(0x1c4)]()['constructor'](a14_0x3c50fe)[_0xa5b159(0x1b7)](_0xa5b159(0x1b1));});function a14_0x3ca0(_0x2c0e26,_0x327485){_0x2c0e26=_0x2c0e26-0x195;const _0x59fa0c=a14_0xcca6();let _0x3c50fe=_0x59fa0c[_0x2c0e26];return _0x3c50fe;}a14_0x3c50fe();'use strict';var __decorate=this&&this['__decorate']||function(_0x306613,_0x4817b8,_0x328a5d,_0x4399a9){const _0x26a479=a14_0x3ca0;var _0x598ab9=arguments[_0x26a479(0x1a4)],_0x593d9c=_0x598ab9<0x3?_0x4817b8:_0x4399a9===null?_0x4399a9=Object[_0x26a479(0x1ae)](_0x4817b8,_0x328a5d):_0x4399a9,_0x25a7d7;if(typeof Reflect===_0x26a479(0x1c5)&&typeof Reflect[_0x26a479(0x1a7)]==='function')_0x593d9c=Reflect[_0x26a479(0x1a7)](_0x306613,_0x4817b8,_0x328a5d,_0x4399a9);else{for(var _0x5df552=_0x306613[_0x26a479(0x1a4)]-0x1;_0x5df552>=0x0;_0x5df552--)if(_0x25a7d7=_0x306613[_0x5df552])_0x593d9c=(_0x598ab9<0x3?_0x25a7d7(_0x593d9c):_0x598ab9>0x3?_0x25a7d7(_0x4817b8,_0x328a5d,_0x593d9c):_0x25a7d7(_0x4817b8,_0x328a5d))||_0x593d9c;}return _0x598ab9>0x3&&_0x593d9c&&Object[_0x26a479(0x195)](_0x4817b8,_0x328a5d,_0x593d9c),_0x593d9c;},__metadata=this&&this[a14_0x364e29(0x1ad)]||function(_0x4e85c2,_0x2aa0b7){const _0x8c219d=a14_0x364e29;if(typeof Reflect===_0x8c219d(0x1c5)&&typeof Reflect[_0x8c219d(0x1b8)]===_0x8c219d(0x1b2))return Reflect[_0x8c219d(0x1b8)](_0x4e85c2,_0x2aa0b7);};Object[a14_0x364e29(0x195)](exports,a14_0x364e29(0x1b3),{'value':!![]}),exports[a14_0x364e29(0x1cf)]=void 0x0;function a14_0xcca6(){const _0x481373=['findRows','cellCount','stream','search','metadata','value','koa-send','@midwayjs/core','.xlsx','onWrite','YYYY/MM/DD','getAppDir','frozen','get','addRow','\x20is\x20read\x20fail','toString','object','3809394YuiSdx','rowCount','header','Sheet\x201','4186812Vdjpsn','col','Workbook','replace','apply','ExcelService','/public/xlsx/','getColumn','ExcelStream','app','Scope','getCell','3041324LRdeot','key','handler','Api\x20Excel\x20Error:\x20','getWorksheet','endsWith','ScopeEnum','filter','values','defineProperty','exceljs','onRead','8231056BYMrXq','set','Singleton','getRow','10740oDdDeM','parse','model','substring','2185kpPBLz','design:type','3399615QIoolL','349756Tizzby','length','./ExcelStream','format','decorate','worksheets','startsWith','addWorksheet','push','xlsx','__metadata','getOwnPropertyDescriptor','mkdirSync','log','(((.+)+)+)+$','function','__esModule'];a14_0xcca6=function(){return _0x481373;};return a14_0xcca6();}const fs=require('fs'),exceljs=require(a14_0x364e29(0x196)),koasend=require(a14_0x364e29(0x1ba)),core_1=require(a14_0x364e29(0x1bb)),ExcelStream_1=require(a14_0x364e29(0x1a5));let ExcelService=class ExcelService{async[a14_0x364e29(0x19d)](_0x277799,_0x204dc6,_0x2e76d4=[0x0]){const _0x5232aa=a14_0x364e29;var _0x123ac7,_0x479fe0;const _0x46832e=new exceljs['Workbook'](),_0x21c75b=[];let _0x51b6db=_0x277799[_0x5232aa(0x1cd)](/(\\|\/)/g,'/')['replace'](/\/{2,}/g,'/');!(_0x51b6db===null||_0x51b6db===void 0x0?void 0x0:_0x51b6db[_0x5232aa(0x1a9)]('/'))&&(_0x51b6db=this[_0x5232aa(0x1d3)][_0x5232aa(0x1bf)]()+'/'+_0x51b6db);try{await _0x46832e[_0x5232aa(0x1ac)]['readFile'](_0x51b6db);}catch(_0x327516){return console[_0x5232aa(0x1b0)](_0x5232aa(0x1d9)+_0x51b6db+_0x5232aa(0x1c3)),_0x21c75b;}for(const _0x48c567 of _0x2e76d4){const _0x394d0c=lodash['isNumber'](_0x48c567)?((_0x123ac7=_0x46832e[_0x5232aa(0x1a8)])===null||_0x123ac7===void 0x0?void 0x0:_0x123ac7[_0x48c567])||undefined:_0x46832e[_0x5232aa(0x1da)](_0x48c567);if(_0x394d0c){var _0x4f1094=0x1;const _0x16b832=_0x394d0c[_0x5232aa(0x19b)](0x1),_0x32e65f=await new Promise(_0x1efccd=>{const _0x573022={};_0x16b832['eachCell']((_0xb00b54,_0x27e218)=>{const _0x2f8eaa=a14_0x3ca0;for(const _0x3a793d of _0x204dc6){if(_0xb00b54[_0x2f8eaa(0x1b9)]==_0x3a793d[_0x2f8eaa(0x1c8)])_0x4f1094=0x2,_0x573022[_0x3a793d[_0x2f8eaa(0x1d7)]]={'header':_0xb00b54['col'],'handler':(_0x3a793d===null||_0x3a793d===void 0x0?void 0x0:_0x3a793d[_0x2f8eaa(0x197)])||(_0x3a793d===null||_0x3a793d===void 0x0?void 0x0:_0x3a793d[_0x2f8eaa(0x1d8)])};else{if(!_0x573022[_0x3a793d[_0x2f8eaa(0x1d7)]])try{const _0x56ecbb=_0x16b832&&_0x16b832[_0x2f8eaa(0x1d5)](_0x3a793d[_0x2f8eaa(0x1c8)]);_0x56ecbb&&(_0x573022[_0x3a793d[_0x2f8eaa(0x1d7)]]={'header':_0x56ecbb[_0x2f8eaa(0x1cb)],'handler':(_0x3a793d===null||_0x3a793d===void 0x0?void 0x0:_0x3a793d[_0x2f8eaa(0x197)])||(_0x3a793d===null||_0x3a793d===void 0x0?void 0x0:_0x3a793d[_0x2f8eaa(0x1d8)])});}catch{}}}_0x16b832[_0x2f8eaa(0x1b5)]==_0x27e218&&_0x1efccd(_0x573022);});});_0x581585:for(const _0x234f10 of _0x394d0c[_0x5232aa(0x1b4)](_0x4f1094,_0x394d0c[_0x5232aa(0x1c7)])){if(typeof(_0x234f10===null||_0x234f10===void 0x0?void 0x0:_0x234f10['getCell'])!=_0x5232aa(0x1b2))continue _0x581585;const _0x70c0bc={};_0x27f143:for(const _0x42af7f in _0x32e65f){if(_0x32e65f[_0x42af7f][_0x5232aa(0x1c8)]){const _0x23de97=_0x234f10['getCell'](_0x32e65f[_0x42af7f][_0x5232aa(0x1c8)]);if(!_0x23de97)continue _0x27f143;try{_0x23de97[_0x5232aa(0x1c4)]();}catch(_0x502a5f){_0x23de97[_0x5232aa(0x1c4)]=()=>{const _0x201026=_0x5232aa;var _0x43787a;return''+(((_0x43787a=_0x23de97===null||_0x23de97===void 0x0?void 0x0:_0x23de97[_0x201026(0x19e)])===null||_0x43787a===void 0x0?void 0x0:_0x43787a[_0x201026(0x1b9)])||'');};}typeof((_0x479fe0=_0x32e65f[_0x42af7f])===null||_0x479fe0===void 0x0?void 0x0:_0x479fe0[_0x5232aa(0x1d8)])==_0x5232aa(0x1b2)?_0x70c0bc[_0x42af7f]=await _0x32e65f[_0x42af7f]['handler'](lodash[_0x5232aa(0x199)]({},_0x42af7f,(_0x23de97===null||_0x23de97===void 0x0?void 0x0:_0x23de97[_0x5232aa(0x1c4)]())||''),_0x23de97[_0x5232aa(0x19e)]):_0x70c0bc[_0x42af7f]=(_0x23de97===null||_0x23de97===void 0x0?void 0x0:_0x23de97['toString']())||'';}}Object['keys'](_0x70c0bc)['length']>0x0&&Object[_0x5232aa(0x1de)](_0x70c0bc)[_0x5232aa(0x1dd)](_0x3fd0f1=>_0x3fd0f1!='')[_0x5232aa(0x1a4)]>0x0&&_0x21c75b[_0x5232aa(0x1ab)](_0x70c0bc);}}}return _0x21c75b;}async['export'](_0x320273,_0x1ebff1,_0x41cc61,_0x24e584,_0x18832c){const _0x46d831=a14_0x364e29;var _0x3e3753,_0x523dbf,_0x38c99f;const _0x1da5cb=new exceljs[(_0x46d831(0x1cc))](),_0x33be5d={},_0x3d849a=[],_0x4898ab=_0x1da5cb[_0x46d831(0x1aa)](_0x46d831(0x1c9),{'views':[{'state':_0x46d831(0x1c0),'ySplit':0x1}]});for(const _0x3b0c8d in _0x1ebff1){_0x33be5d[_0x1ebff1[_0x3b0c8d]['key']]=_0x1ebff1[_0x3b0c8d][_0x46d831(0x1c8)],_0x3d849a[_0x46d831(0x1ab)]({'header':_0x1ebff1[_0x3b0c8d][_0x46d831(0x1c8)],'key':(_0x3e3753=_0x1ebff1[_0x3b0c8d])===null||_0x3e3753===void 0x0?void 0x0:_0x3e3753['key']['replace'](/\./g,'_')});}_0x4898ab['columns']=_0x3d849a;for(const _0x58a0b2 in _0x41cc61){const _0x25da06=_0x41cc61[_0x58a0b2],_0x361560=_0x4898ab[_0x46d831(0x1c2)]({});for(let _0x1e7da5 in _0x1ebff1){const _0x19c872=_0x1ebff1[_0x1e7da5][_0x46d831(0x1d7)][_0x46d831(0x1cd)](/\./g,'_'),_0x463d39=_0x4898ab[_0x46d831(0x1d1)](_0x19c872),_0x261661=_0x361560===null||_0x361560===void 0x0?void 0x0:_0x361560[_0x46d831(0x1d5)](_0x19c872);if(typeof((_0x523dbf=_0x1ebff1[_0x1e7da5])===null||_0x523dbf===void 0x0?void 0x0:_0x523dbf[_0x46d831(0x1bd)])==_0x46d831(0x1b2))_0x261661[_0x46d831(0x1b9)]=await _0x1ebff1[_0x1e7da5][_0x46d831(0x1bd)](_0x25da06,{'row':_0x361560,'col':_0x463d39,'cell':_0x261661,'sheet':_0x4898ab})||'';else typeof((_0x38c99f=_0x1ebff1[_0x1e7da5])===null||_0x38c99f===void 0x0?void 0x0:_0x38c99f[_0x46d831(0x1d8)])=='function'?_0x261661[_0x46d831(0x1b9)]=await _0x1ebff1[_0x1e7da5][_0x46d831(0x1d8)](_0x25da06,{'row':_0x361560,'col':_0x463d39,'cell':_0x261661,'sheet':_0x4898ab})||'':_0x261661['value']=lodash[_0x46d831(0x1c1)](_0x25da06,_0x1ebff1[_0x1e7da5][_0x46d831(0x1d7)],'');}}typeof _0x18832c==_0x46d831(0x1b2)&&await _0x18832c({'workbook':_0x1da5cb,'worksheet':_0x4898ab});let _0x58fbce='';const _0x399fd8=_0x320273+_0x46d831(0x1bc);if(_0x24e584&&_0x24e584[_0x46d831(0x1a9)]('/'))_0x58fbce=''+_0x24e584;else _0x24e584&&!_0x24e584[_0x46d831(0x1a9)]('/')&&!_0x24e584[_0x46d831(0x1a9)]('\x5c')?_0x58fbce=this['app'][_0x46d831(0x1bf)]()+'/'+_0x24e584:_0x58fbce=this[_0x46d831(0x1d3)]['getAppDir']()+_0x46d831(0x1d0)+dayjs()[_0x46d831(0x1a6)](_0x46d831(0x1be));return(_0x58fbce[_0x46d831(0x1db)]('/')||_0x58fbce[_0x46d831(0x1db)]('\x5c'))&&(_0x58fbce=_0x58fbce['substring'](0x0,_0x58fbce[_0x46d831(0x1a4)]-0x1)),_0x58fbce=_0x58fbce[_0x46d831(0x1cd)](/(\\|\/)/g,'/')[_0x46d831(0x1cd)](/\/{2,}/g,'/'),!fs['existsSync'](_0x58fbce)&&fs[_0x46d831(0x1af)](_0x58fbce,{'recursive':!![]}),await _0x1da5cb[_0x46d831(0x1ac)]['writeFile']((_0x58fbce+'/'+_0x399fd8)['replace'](/(\\|\/)/g,'/')['replace'](/\/{2,}/g,'/')),{'filename':_0x399fd8,'filepath':(_0x58fbce[_0x46d831(0x19f)]((''+this[_0x46d831(0x1d3)][_0x46d831(0x1bf)]())[_0x46d831(0x1a4)])+'/'+_0x399fd8)[_0x46d831(0x1cd)](/(\\|\/)/g,'/')[_0x46d831(0x1cd)](/\/{2,}/g,'/')};}async[a14_0x364e29(0x1b6)](_0x394666,_0x12d55a={'suffix':['xls','xlsx']}){const _0x2ac529=a14_0x364e29;return await ExcelStream_1[_0x2ac529(0x1d2)]['instance'](_0x394666,_0x12d55a);}async['download'](_0x596d0f,_0xa5f4f3){return await koasend(_0x596d0f,''+_0xa5f4f3);}};exports[a14_0x364e29(0x1cf)]=ExcelService,__decorate([(0x0,core_1['App'])(),__metadata(a14_0x364e29(0x1a1),Object)],ExcelService['prototype'],a14_0x364e29(0x1d3),void 0x0),exports[a14_0x364e29(0x1cf)]=ExcelService=__decorate([(0x0,core_1['Provide'])(),(0x0,core_1[a14_0x364e29(0x1d4)])(core_1[a14_0x364e29(0x1dc)][a14_0x364e29(0x19a)])],ExcelService);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as exceljs from 'exceljs';
|
|
2
|
+
import { Readable } from 'stream';
|
|
3
|
+
interface ExcelColumn {
|
|
4
|
+
key: string;
|
|
5
|
+
header: string;
|
|
6
|
+
handler?: (row: any, options?: {
|
|
7
|
+
row: exceljs.Row;
|
|
8
|
+
col: exceljs.Column;
|
|
9
|
+
cell: exceljs.Cell;
|
|
10
|
+
sheet: exceljs.Worksheet;
|
|
11
|
+
}) => Promise<any>;
|
|
12
|
+
}
|
|
13
|
+
interface ExcelImportColumn {
|
|
14
|
+
key: string;
|
|
15
|
+
header: string;
|
|
16
|
+
handler?: (row: any, rowCell?: exceljs.CellModel) => Promise<any>;
|
|
17
|
+
}
|
|
18
|
+
export declare class ExcelStream {
|
|
19
|
+
readonly filepath: string;
|
|
20
|
+
protected _WorkbookReader: exceljs.stream.xlsx.WorkbookReader;
|
|
21
|
+
protected _WorkbookWriter: exceljs.stream.xlsx.WorkbookWriter;
|
|
22
|
+
protected _WorksheetWriterMap: Map<number | string, exceljs.Worksheet>;
|
|
23
|
+
constructor(filepath: any);
|
|
24
|
+
get WorkbookReader(): exceljs.stream.xlsx.WorkbookReader;
|
|
25
|
+
get WorkbookWriter(): exceljs.stream.xlsx.WorkbookWriter;
|
|
26
|
+
static instance(file: string, option?: {
|
|
27
|
+
rootpath?: string;
|
|
28
|
+
suffix?: string[];
|
|
29
|
+
}): Promise<ExcelStream>;
|
|
30
|
+
writer(column: Array<ExcelColumn>, columnDatas: Readable | Array<{
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}>, options?: {
|
|
33
|
+
sheet?: number | string;
|
|
34
|
+
fileLimit?: number;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
rowCount: number;
|
|
37
|
+
worksheet?: exceljs.Worksheet;
|
|
38
|
+
done?: () => void;
|
|
39
|
+
fileCount?: number;
|
|
40
|
+
filepaths?: string[];
|
|
41
|
+
}>;
|
|
42
|
+
reader(column: ExcelImportColumn[], callback: (row: any, option: {
|
|
43
|
+
sheet: exceljs.Worksheet;
|
|
44
|
+
row: exceljs.Row;
|
|
45
|
+
}) => Promise<void>, options?: {
|
|
46
|
+
sheets?: number | string | Array<number | string>;
|
|
47
|
+
}): Promise<void>;
|
|
48
|
+
getWorkbookWriterSheet(sheet: number | string, notFindCreate?: boolean): exceljs.Worksheet | undefined;
|
|
49
|
+
save(): Promise<this>;
|
|
50
|
+
private chunkArray;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a15_0x1d49(_0x4082be,_0x5e7c04){_0x4082be=_0x4082be-0x6e;const _0x11a7f2=a15_0x4807();let _0xc561f7=_0x11a7f2[_0x4082be];return _0xc561f7;}const a15_0x6f9dec=a15_0x1d49;(function(_0x16306e,_0x134661){const _0x18d80f=a15_0x1d49,_0x5d8869=_0x16306e();while(!![]){try{const _0x44a62f=-parseInt(_0x18d80f(0x7b))/0x1*(-parseInt(_0x18d80f(0xa2))/0x2)+parseInt(_0x18d80f(0x70))/0x3+-parseInt(_0x18d80f(0x6e))/0x4+-parseInt(_0x18d80f(0xad))/0x5*(parseInt(_0x18d80f(0x75))/0x6)+-parseInt(_0x18d80f(0xa8))/0x7+-parseInt(_0x18d80f(0x89))/0x8*(-parseInt(_0x18d80f(0x88))/0x9)+parseInt(_0x18d80f(0x85))/0xa*(parseInt(_0x18d80f(0x82))/0xb);if(_0x44a62f===_0x134661)break;else _0x5d8869['push'](_0x5d8869['shift']());}catch(_0x3c1d2a){_0x5d8869['push'](_0x5d8869['shift']());}}}(a15_0x4807,0x7b424));function a15_0x4807(){const _0xea660b=['addRow','push','242WjyCSe','keys','xlsx','758430CmNKWr','ExcelStream','(((.+)+)+)+$','9gyAcKT','165976oKVZKg','Transform','length','handler','instance','writer','col','ignore','getWorksheet','writeFile','getColumn','read','row','value','worksheets','_WorksheetWriterMap','lodash','emit','Readable','getCell','forEach','substring','map','existsSync','path','2726oPCYLD','search','filepath','Workbook','finish','header','4894960uOoATN','pipe','toString','apply','model','2910cFhxWS','destroy','includes','WorkbookReader','resume','dirname','constructor','finished','columns','eachCell','cellCount','isNumber','getWorkbookWriterSheet','unpipe','pause','error','set','_WorkbookWriter','replace','key','filter','extname','_WorkbookReader','stream','2872824oEemmD','rootpath','559359GZYuji','addWorksheet','function','sheets','chunkArray','9468DYEiiY','lastIndexOf','commit','save','isArray','mkdirSync','708hUMtYj','__esModule','suffix','get','WorkbookWriter'];a15_0x4807=function(){return _0xea660b;};return a15_0x4807();}const a15_0x696022=(function(){let _0x436834=!![];return function(_0x21d765,_0x3e8b54){const _0x3d23ee=_0x436834?function(){const _0x324c08=a15_0x1d49;if(_0x3e8b54){const _0x3ea283=_0x3e8b54[_0x324c08(0xab)](_0x21d765,arguments);return _0x3e8b54=null,_0x3ea283;}}:function(){};return _0x436834=![],_0x3d23ee;};}()),a15_0xc561f7=a15_0x696022(this,function(){const _0x4acaa3=a15_0x1d49;return a15_0xc561f7[_0x4acaa3(0xaa)]()[_0x4acaa3(0xa3)](_0x4acaa3(0x87))[_0x4acaa3(0xaa)]()[_0x4acaa3(0xb3)](a15_0xc561f7)[_0x4acaa3(0xa3)](_0x4acaa3(0x87));});a15_0xc561f7();'use strict';Object['defineProperty'](exports,a15_0x6f9dec(0x7c),{'value':!![]}),exports[a15_0x6f9dec(0x86)]=void 0x0;const fs=require('fs'),path=require(a15_0x6f9dec(0xa1)),lodash=require(a15_0x6f9dec(0x99)),exceljs=require('exceljs'),stream_1=require(a15_0x6f9dec(0xc4));function isReadableStream(_0x3b90f9){const _0x99fabb=a15_0x6f9dec;return _0x3b90f9&&typeof _0x3b90f9[_0x99fabb(0xa9)]===_0x99fabb(0x72)&&typeof _0x3b90f9['on']===_0x99fabb(0x72)&&typeof _0x3b90f9[_0x99fabb(0x94)]==='function'&&typeof _0x3b90f9[_0x99fabb(0xbb)]===_0x99fabb(0x72)&&typeof _0x3b90f9['resume']==='function';}class ExcelStream{constructor(_0x1bf043){const _0x3491a8=a15_0x6f9dec;this[_0x3491a8(0x98)]=new Map(),this[_0x3491a8(0xa4)]=_0x1bf043;}get[a15_0x6f9dec(0xb0)](){const _0x5b32bf=a15_0x6f9dec;return!this['_WorkbookReader']&&(this[_0x5b32bf(0xc3)]=new exceljs['stream'][(_0x5b32bf(0x84))][(_0x5b32bf(0xb0))](this[_0x5b32bf(0xa4)],{'worksheets':_0x5b32bf(0x9a),'sharedStrings':_0x5b32bf(0x90),'hyperlinks':_0x5b32bf(0x90),'styles':'ignore'})),this[_0x5b32bf(0xc3)];}get['WorkbookWriter'](){const _0x263db7=a15_0x6f9dec;return!this[_0x263db7(0xbe)]&&(this['_WorkbookWriter']=new exceljs[(_0x263db7(0xc4))][(_0x263db7(0x84))]['WorkbookWriter']({'filename':this['filepath'],'useStyles':!![],'useSharedStrings':![]})),this[_0x263db7(0xbe)];}static[a15_0x6f9dec(0x8d)](_0x45ec59,_0x163ea2={'suffix':['xls',a15_0x6f9dec(0x84)]}){return new Promise(async(_0x575bbe,_0x3aa536)=>{const _0x16b36a=a15_0x1d49,_0xee0f01=_0x45ec59[_0x16b36a(0x9e)]((_0x45ec59['indexOf']('/')>-0x1?_0x45ec59[_0x16b36a(0x76)]('/'):_0x45ec59['lastIndexOf']('\x5c'))+0x1),_0x2c9d5c=path[_0x16b36a(0xb2)](((_0x163ea2===null||_0x163ea2===void 0x0?void 0x0:_0x163ea2[_0x16b36a(0x6f)])&&!_0x45ec59['startsWith'](_0x163ea2[_0x16b36a(0x6f)])?_0x163ea2['rootpath']+'/'+_0x45ec59:'/'+_0x45ec59)[_0x16b36a(0xbf)](/(\\|\/)/g,'/')[_0x16b36a(0xbf)](/\/{2,}/g,'/'));if(!((_0x163ea2===null||_0x163ea2===void 0x0?void 0x0:_0x163ea2[_0x16b36a(0x7d)])?_0x163ea2[_0x16b36a(0x7d)]:['xls',_0x16b36a(0x84)])[_0x16b36a(0xaf)](_0xee0f01[_0x16b36a(0x9e)](_0xee0f01[_0x16b36a(0x76)]('.')+0x1)))return _0x3aa536('文件名格式错误');const _0x5adee8=(_0x2c9d5c+'/'+_0xee0f01)['replace'](/(\\|\/)/g,'/')[_0x16b36a(0xbf)](/\/{2,}/g,'/');if(!fs[_0x16b36a(0xa0)](_0x5adee8)){!fs['existsSync'](_0x2c9d5c)&&fs[_0x16b36a(0x7a)](_0x2c9d5c,{'recursive':!![]});const _0x4d139b=new exceljs[(_0x16b36a(0xa5))]();await _0x4d139b[_0x16b36a(0x84)][_0x16b36a(0x92)](_0x5adee8);}return _0x575bbe(new ExcelStream(_0x5adee8));});}async[a15_0x6f9dec(0x8e)](_0x52f278,_0x46cb80,_0x3b2e6e={}){const _0xb30bc=a15_0x6f9dec,{sheet:sheet=0x0,fileLimit:fileLimit=0x0}=_0x3b2e6e,_0x844094=_0x52f278[_0xb30bc(0x9f)](_0x4fd3ac=>({'header':_0x4fd3ac['header'],'key':_0x4fd3ac[_0xb30bc(0xc0)][_0xb30bc(0xbf)](/\./g,'_')}));if(!Array[_0xb30bc(0x79)](_0x46cb80)&&!isReadableStream(_0x46cb80))return{'rowCount':0x0,'worksheet':undefined,'done':()=>void 0x0,'fileCount':0x0,'filepaths':[]};let _0x58f6d5=0x0,_0x5f44d7=0x0,_0x39eaf2=0x0,_0x279d9d=[],_0x25e516;const _0xb7fbe=async()=>{const _0x820a5f=_0xb30bc;if(fileLimit>0x0){_0x5f44d7>0x0&&(await this[_0x820a5f(0x7f)][_0x820a5f(0x77)](),this[_0x820a5f(0x98)]['clear']());const _0x5d5787=path[_0x820a5f(0xc2)](this[_0x820a5f(0xa4)]),_0x68f4d0=this[_0x820a5f(0xa4)][_0x820a5f(0xbf)](_0x5d5787,''),_0x5ef5b8=_0x68f4d0+'-'+(_0x5f44d7+0x1)+_0x5d5787;this[_0x820a5f(0xbe)]=new exceljs[(_0x820a5f(0xc4))]['xlsx'][(_0x820a5f(0x7f))]({'filename':_0x5ef5b8,'useStyles':!![],'useSharedStrings':![]}),_0x279d9d[_0x820a5f(0x81)](_0x5ef5b8),await fsplus['exists'](this[_0x820a5f(0xa4)])&&await fsplus['unlink'](this[_0x820a5f(0xa4)]);}_0x25e516=this[_0x820a5f(0xb9)](sheet,!![]),_0x25e516[_0x820a5f(0xb5)]=_0x844094;},_0x2e8f96=0x64,_0x18b2d9=Array['isArray'](_0x46cb80)?stream_1[_0xb30bc(0x9b)]['from'](this[_0xb30bc(0x74)](_0x46cb80,_0x2e8f96),{'objectMode':!![]}):_0x46cb80,_0x48a868=new stream_1[(_0xb30bc(0x8a))]({'objectMode':!![],'highWaterMark':_0x2e8f96,'transform':async function(_0xdde2fb,_0x47f015,_0x34c634){const _0x4f6bfc=_0xb30bc;Array[_0x4f6bfc(0x79)](_0xdde2fb)&&_0xdde2fb[_0x4f6bfc(0x8b)]>0x0&&_0xdde2fb[_0x4f6bfc(0x9d)](_0x361526=>{const _0x59d0ef=_0x4f6bfc;this[_0x59d0ef(0x81)](_0x361526);}),_0x34c634();}});await _0xb7fbe();const _0x369c04=new stream_1['Writable']({'objectMode':!![],'highWaterMark':_0x2e8f96,async 'write'(_0x239706,_0x54d51e,_0x26b961){const _0x2afc29=_0xb30bc;var _0x13d58d;try{fileLimit>0x0&&_0x39eaf2>=fileLimit&&(_0x5f44d7++,_0x39eaf2=0x0,await _0xb7fbe());const _0x3c5c17=_0x25e516[_0x2afc29(0x80)]({});for(let _0x2df9f3 in _0x52f278){const _0x42b717=_0x52f278[_0x2df9f3][_0x2afc29(0xc0)]['replace'](/\./g,'_'),_0x21f26f=_0x25e516[_0x2afc29(0x93)](_0x42b717),_0x310b0a=_0x3c5c17===null||_0x3c5c17===void 0x0?void 0x0:_0x3c5c17[_0x2afc29(0x9c)](_0x42b717);typeof((_0x13d58d=_0x52f278[_0x2df9f3])===null||_0x13d58d===void 0x0?void 0x0:_0x13d58d[_0x2afc29(0x8c)])==_0x2afc29(0x72)?_0x310b0a[_0x2afc29(0x96)]=await _0x52f278[_0x2df9f3][_0x2afc29(0x8c)](_0x239706,{'row':_0x3c5c17,'col':_0x21f26f,'cell':_0x310b0a,'sheet':_0x25e516})||'':_0x310b0a[_0x2afc29(0x96)]=lodash[_0x2afc29(0x7e)](_0x239706,_0x52f278[_0x2df9f3][_0x2afc29(0xc0)],'');}_0x58f6d5++,_0x39eaf2++,_0x3c5c17[_0x2afc29(0x77)](),_0x26b961();}catch(_0x3bd2f2){_0x26b961(_0x3bd2f2);}},async 'final'(_0x17f05d){try{_0x17f05d();}catch(_0x11cf36){_0x17f05d(_0x11cf36);}}});return new Promise((_0x323a6d,_0x350b6d)=>{const _0x507238=_0xb30bc,_0x3bd9a6=_0xee18ef=>{const _0x16fe02=a15_0x1d49;_0x18b2d9[_0x16fe02(0xae)](),_0x48a868['destroy'](),_0x369c04[_0x16fe02(0xae)](),_0x350b6d(_0xee18ef);};_0x18b2d9['on'](_0x507238(0xbc),_0x3bd9a6)[_0x507238(0xa9)](_0x48a868)['on']('error',_0x3bd9a6)[_0x507238(0xa9)](_0x369c04)['on'](_0x507238(0xbc),_0x3bd9a6)['on'](_0x507238(0xa6),()=>{const _0x1edab4=_0x507238;try{_0x18b2d9[_0x1edab4(0xba)](),_0x48a868[_0x1edab4(0xba)](),_0x48a868['end'](),_0x369c04['end'](),_0x323a6d({'rowCount':_0x58f6d5,'worksheet':_0x25e516,'done':()=>_0x25e516[_0x1edab4(0x77)](),'fileCount':_0x5f44d7+0x1,'filepaths':_0x279d9d});}catch(_0x19cbfa){_0x350b6d(_0x19cbfa);}}),Array[_0x507238(0x79)](_0x46cb80)&&_0x18b2d9[_0x507238(0xb1)]();});}async['reader'](_0x198e72,_0x1749c5,_0x59343e={'sheets':0x0}){const _0x324aae=a15_0x6f9dec;var _0x404d7e,_0x146a17,_0x1d0772;const _0xe07f0e=(_0x59343e===null||_0x59343e===void 0x0?void 0x0:_0x59343e[_0x324aae(0x73)])?Array['isArray'](_0x59343e[_0x324aae(0x73)])?_0x59343e['sheets']:[_0x59343e[_0x324aae(0x73)]]:[0x0],_0x325558=_0x2ae195=>new Promise(async(_0x218e0d,_0x467b50)=>{const _0x345a5f=_0x324aae,_0xdeb789=_0x2ae195['getRow'](0x1),_0x4e3bf6=await new Promise(_0x5feff=>{const _0x18a67e=a15_0x1d49,_0x2f2bfa={};_0xdeb789[_0x18a67e(0xb6)]((_0x568ba4,_0x50099a)=>{const _0x3f22f9=_0x18a67e;for(const _0x10af21 of _0x198e72){if(_0x568ba4[_0x3f22f9(0x96)]==_0x10af21[_0x3f22f9(0xa7)])_0x2f2bfa[_0x10af21['key']]={'header':_0x568ba4[_0x3f22f9(0x8f)],'handler':_0x10af21[_0x3f22f9(0x8c)]};else{if(!_0x2f2bfa[_0x10af21[_0x3f22f9(0xc0)]])try{const _0x4db5de=_0xdeb789&&_0xdeb789['getCell'](_0x10af21['header']);_0x4db5de&&(_0x2f2bfa[_0x10af21[_0x3f22f9(0xc0)]]={'header':_0x4db5de['col'],'handler':_0x10af21[_0x3f22f9(0x8c)]});}catch{}}}_0xdeb789[_0x3f22f9(0xb7)]==_0x50099a&&_0x5feff(_0x2f2bfa);});});_0x2ae195['on'](_0x345a5f(0xb4),_0x17900d=>_0x218e0d(_0x2ae195)),_0x2ae195['on'](_0x345a5f(0xbc),_0x302626=>_0x467b50(_0x302626)),_0x2ae195['on'](_0x345a5f(0x95),async _0x1e9aa3=>{const _0x3e5a27=_0x345a5f;var _0x5c7a1;if(typeof(_0x1e9aa3===null||_0x1e9aa3===void 0x0?void 0x0:_0x1e9aa3[_0x3e5a27(0x9c)])==_0x3e5a27(0x72)){const _0x121ddf={};_0x2e291b:for(const _0x9c9c64 in _0x4e3bf6){if(_0x4e3bf6[_0x9c9c64][_0x3e5a27(0xa7)]){const _0x440c27=_0x1e9aa3[_0x3e5a27(0x9c)](_0x4e3bf6[_0x9c9c64][_0x3e5a27(0xa7)]);if(!_0x440c27)continue _0x2e291b;try{_0x440c27[_0x3e5a27(0xaa)]();}catch(_0x597d56){_0x440c27[_0x3e5a27(0xaa)]=()=>{const _0x59e88e=_0x3e5a27;var _0x11ed23;return''+(((_0x11ed23=_0x440c27===null||_0x440c27===void 0x0?void 0x0:_0x440c27[_0x59e88e(0xac)])===null||_0x11ed23===void 0x0?void 0x0:_0x11ed23[_0x59e88e(0x96)])||'');};}typeof((_0x5c7a1=_0x4e3bf6[_0x9c9c64])===null||_0x5c7a1===void 0x0?void 0x0:_0x5c7a1[_0x3e5a27(0x8c)])==_0x3e5a27(0x72)?_0x121ddf[_0x9c9c64]=await _0x4e3bf6[_0x9c9c64]['handler'](lodash[_0x3e5a27(0xbd)]({},_0x9c9c64,(_0x440c27===null||_0x440c27===void 0x0?void 0x0:_0x440c27[_0x3e5a27(0xaa)]())||''),_0x440c27[_0x3e5a27(0xac)]):_0x121ddf[_0x9c9c64]=(_0x440c27===null||_0x440c27===void 0x0?void 0x0:_0x440c27[_0x3e5a27(0xaa)]())||'';}}Object[_0x3e5a27(0x83)](_0x121ddf)[_0x3e5a27(0x8b)]>0x0&&Object['values'](_0x121ddf)[_0x3e5a27(0xc1)](_0x125fdb=>_0x125fdb!='')[_0x3e5a27(0x8b)]>0x0&&await _0x1749c5(_0x121ddf,{'sheet':_0x2ae195,'row':_0x1e9aa3});}}),await _0x2ae195[_0x345a5f(0x94)]();});for(const _0x3bd587 of _0xe07f0e){const _0x37df48=lodash[_0x324aae(0xb8)](_0x3bd587)?((_0x146a17=(_0x404d7e=this['WorkbookReader'])===null||_0x404d7e===void 0x0?void 0x0:_0x404d7e[_0x324aae(0x97)])===null||_0x146a17===void 0x0?void 0x0:_0x146a17[_0x3bd587])||undefined:(_0x1d0772=this[_0x324aae(0xb0)])===null||_0x1d0772===void 0x0?void 0x0:_0x1d0772[_0x324aae(0x91)](_0x3bd587);_0x37df48&&await _0x325558(_0x37df48);}}[a15_0x6f9dec(0xb9)](_0x35dbbf,_0x5677fc=![]){const _0xe3ac68=a15_0x6f9dec;var _0x7832e,_0x26c53e;let _0x16876d=this[_0xe3ac68(0x98)]['has'](_0x35dbbf)?this['_WorksheetWriterMap'][_0xe3ac68(0x7e)](_0x35dbbf):(_0x7832e=this[_0xe3ac68(0x7f)])===null||_0x7832e===void 0x0?void 0x0:_0x7832e[_0xe3ac68(0x91)](_0x35dbbf);return!_0x16876d&&_0x5677fc&&(_0x16876d=(_0x26c53e=this['WorkbookWriter'])===null||_0x26c53e===void 0x0?void 0x0:_0x26c53e[_0xe3ac68(0x71)](lodash['isNumber'](_0x35dbbf)?undefined:''+_0x35dbbf,{'views':[{'state':'frozen','ySplit':0x1}]}),this[_0xe3ac68(0x98)][_0xe3ac68(0xbd)](_0x35dbbf,_0x16876d)),_0x16876d;}async[a15_0x6f9dec(0x78)](){const _0x59a982=a15_0x6f9dec;var _0xd71211;return await((_0xd71211=this[_0x59a982(0x7f)])===null||_0xd71211===void 0x0?void 0x0:_0xd71211[_0x59a982(0x77)]()),this;}*[a15_0x6f9dec(0x74)](_0x203271,_0x194642){const _0x1a3a0b=a15_0x6f9dec;for(let _0x563721=0x0;_0x563721<_0x203271[_0x1a3a0b(0x8b)];_0x563721+=_0x194642){yield _0x203271['slice'](_0x563721,_0x563721+_0x194642);}}}exports[a15_0x6f9dec(0x86)]=ExcelStream;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ValidatorOptions } from "@anveroapi/validator";
|
|
2
|
+
import { MiddlewareParamArray } from '@midwayjs/core';
|
|
3
|
+
export declare const ACTION_KEY = "anvero-api:action";
|
|
4
|
+
export declare const ACTION_ROUTE_KEY = "anvero-api:action:route";
|
|
5
|
+
export declare const ACTION_RESPONSE_KEY = "anvero-api:action:response";
|
|
6
|
+
export declare const APPSCONFIG_KEY = "anvero-api:apps:config";
|
|
7
|
+
export interface ResponseProperty {
|
|
8
|
+
key: string;
|
|
9
|
+
type: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
children?: ResponseProperty[];
|
|
12
|
+
}
|
|
13
|
+
export interface ErrorResponse {
|
|
14
|
+
code: number;
|
|
15
|
+
message: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ActionResponseOption {
|
|
19
|
+
format?: 'default' | 'custom';
|
|
20
|
+
type?: 'object' | 'array' | 'page';
|
|
21
|
+
description?: string;
|
|
22
|
+
properties?: ResponseProperty[];
|
|
23
|
+
errors?: ErrorResponse[];
|
|
24
|
+
}
|
|
25
|
+
export interface ActionOption {
|
|
26
|
+
prefix?: string;
|
|
27
|
+
alias?: string[];
|
|
28
|
+
tagName?: string;
|
|
29
|
+
sensitive?: boolean;
|
|
30
|
+
description?: string;
|
|
31
|
+
middleware?: MiddlewareParamArray;
|
|
32
|
+
IgnoreMiddleware?: MiddlewareParamArray;
|
|
33
|
+
ignoreGlobalPrefix?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface ActionApiOption {
|
|
36
|
+
apimit?: boolean;
|
|
37
|
+
intercept?: boolean;
|
|
38
|
+
routerName?: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
validate?: ValidatorOptions;
|
|
41
|
+
middleware?: MiddlewareParamArray;
|
|
42
|
+
middlewareIgnore?: MiddlewareParamArray;
|
|
43
|
+
ignoreGlobalPrefix?: boolean;
|
|
44
|
+
response?: ActionResponseOption;
|
|
45
|
+
}
|
|
46
|
+
export declare class AppsConfigTmp {
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a16_0x22ce98=a16_0x5576;(function(_0x285cea,_0x4e5006){var _0x2fec10=a16_0x5576,_0x5142fd=_0x285cea();while(!![]){try{var _0x3b26bc=-parseInt(_0x2fec10(0x11b))/0x1*(parseInt(_0x2fec10(0x117))/0x2)+parseInt(_0x2fec10(0x116))/0x3*(parseInt(_0x2fec10(0x122))/0x4)+-parseInt(_0x2fec10(0x112))/0x5*(parseInt(_0x2fec10(0x113))/0x6)+parseInt(_0x2fec10(0x119))/0x7+parseInt(_0x2fec10(0x10f))/0x8+parseInt(_0x2fec10(0x10c))/0x9+-parseInt(_0x2fec10(0x10d))/0xa*(parseInt(_0x2fec10(0x11c))/0xb);if(_0x3b26bc===_0x4e5006)break;else _0x5142fd['push'](_0x5142fd['shift']());}catch(_0x3d17ed){_0x5142fd['push'](_0x5142fd['shift']());}}}(a16_0x2307,0x60b28));var a16_0x200be6=(function(){var _0x16de37=!![];return function(_0x26a737,_0x119f02){var _0x6a6e31=_0x16de37?function(){var _0x1dd201=a16_0x5576;if(_0x119f02){var _0x1ee691=_0x119f02[_0x1dd201(0x111)](_0x26a737,arguments);return _0x119f02=null,_0x1ee691;}}:function(){};return _0x16de37=![],_0x6a6e31;};}()),a16_0x30ac92=a16_0x200be6(this,function(){var _0x435e55=a16_0x5576;return a16_0x30ac92['toString']()[_0x435e55(0x10e)]('(((.+)+)+)+$')[_0x435e55(0x110)]()['constructor'](a16_0x30ac92)[_0x435e55(0x10e)]('(((.+)+)+)+$');});a16_0x30ac92();'use strict';Object[a16_0x22ce98(0x11e)](exports,a16_0x22ce98(0x120),{'value':!![]}),exports[a16_0x22ce98(0x11a)]=exports['APPSCONFIG_KEY']=exports['ACTION_RESPONSE_KEY']=exports[a16_0x22ce98(0x121)]=exports['ACTION_KEY']=void 0x0,exports[a16_0x22ce98(0x11d)]='anvero-api:action',exports[a16_0x22ce98(0x121)]=a16_0x22ce98(0x115),exports[a16_0x22ce98(0x118)]='anvero-api:action:response',exports[a16_0x22ce98(0x114)]=a16_0x22ce98(0x11f);function a16_0x2307(){var _0x3eb6f7=['__esModule','ACTION_ROUTE_KEY','100AymJca','6173343RJIYdk','20ODxkHT','search','823136RxEhUk','toString','apply','55zUQPNa','323916PdWvcY','APPSCONFIG_KEY','anvero-api:action:route','84129CuCmWj','4GXRBef','ACTION_RESPONSE_KEY','3541636ieHtun','AppsConfigTmp','219353mRaoTW','3119699HsnDJm','ACTION_KEY','defineProperty','anvero-api:apps:config'];a16_0x2307=function(){return _0x3eb6f7;};return a16_0x2307();}function a16_0x5576(_0x4afd68,_0xf74e33){_0x4afd68=_0x4afd68-0x10c;var _0x3fcc88=a16_0x2307();var _0x30ac92=_0x3fcc88[_0x4afd68];return _0x30ac92;}class AppsConfigTmp{}exports['AppsConfigTmp']=AppsConfigTmp;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Readable } from "stream";
|
|
2
|
+
export declare class PageDTO {
|
|
3
|
+
_page?: number;
|
|
4
|
+
_size?: number;
|
|
5
|
+
_order?: string;
|
|
6
|
+
_isreverse?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface UploadFileInfo<T> {
|
|
9
|
+
filename: string;
|
|
10
|
+
fieldName: string;
|
|
11
|
+
mimeType: string;
|
|
12
|
+
data: T extends string ? string : Readable;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a17_0x45b0d3=a17_0x57fd;(function(_0x26b7f5,_0x53dbc8){var _0x2089fb=a17_0x57fd,_0x21707a=_0x26b7f5();while(!![]){try{var _0x208147=parseInt(_0x2089fb(0xee))/0x1+-parseInt(_0x2089fb(0xe2))/0x2*(parseInt(_0x2089fb(0xf7))/0x3)+-parseInt(_0x2089fb(0xf1))/0x4*(-parseInt(_0x2089fb(0xe3))/0x5)+-parseInt(_0x2089fb(0xd9))/0x6*(parseInt(_0x2089fb(0xf3))/0x7)+-parseInt(_0x2089fb(0xe0))/0x8*(parseInt(_0x2089fb(0xf5))/0x9)+parseInt(_0x2089fb(0xec))/0xa+parseInt(_0x2089fb(0xde))/0xb*(-parseInt(_0x2089fb(0xe5))/0xc);if(_0x208147===_0x53dbc8)break;else _0x21707a['push'](_0x21707a['shift']());}catch(_0x4ad99b){_0x21707a['push'](_0x21707a['shift']());}}}(a17_0x1e2a,0x831bf));var a17_0x586e7f=(function(){var _0x3dbcc0=!![];return function(_0x47a140,_0x449f4e){var _0x400e4a=_0x3dbcc0?function(){var _0x264939=a17_0x57fd;if(_0x449f4e){var _0x3c2b1d=_0x449f4e[_0x264939(0xe7)](_0x47a140,arguments);return _0x449f4e=null,_0x3c2b1d;}}:function(){};return _0x3dbcc0=![],_0x400e4a;};}()),a17_0x73c412=a17_0x586e7f(this,function(){var _0x19c219=a17_0x57fd;return a17_0x73c412[_0x19c219(0xdf)]()[_0x19c219(0xfb)]('(((.+)+)+)+$')['toString']()[_0x19c219(0xf4)](a17_0x73c412)[_0x19c219(0xfb)]('(((.+)+)+)+$');});function a17_0x1e2a(){var _0x3869dc=['1656985SfFbTW','toString','224dXkkee','__esModule','1686282HpZKjv','5nyetoZ','1:是;0:否','12kKfdEK','__metadata','apply','Rule','number','design:type','integer','3695340UqtJVQ','_isreverse','1001177mikubK','prototype','_page','3252364vGVseU','metadata','17423GowuLV','constructor','57087OdeRDn','是否倒序','3RBEQti','_order','length','分页数量','search','min','trim','RuleType','valid','排序方式','function','1146WPxHUs','@anveroapi/validator','decorate','string','object'];a17_0x1e2a=function(){return _0x3869dc;};return a17_0x1e2a();}a17_0x73c412();'use strict';function a17_0x57fd(_0x4ed0cc,_0x2bc438){_0x4ed0cc=_0x4ed0cc-0xd7;var _0x48eea2=a17_0x1e2a();var _0x73c412=_0x48eea2[_0x4ed0cc];return _0x73c412;}var __decorate=this&&this['__decorate']||function(_0x22a8fb,_0x23d168,_0x54868f,_0x93b61d){var _0x5cc2aa=a17_0x57fd,_0x2bba43=arguments[_0x5cc2aa(0xf9)],_0x296606=_0x2bba43<0x3?_0x23d168:_0x93b61d===null?_0x93b61d=Object['getOwnPropertyDescriptor'](_0x23d168,_0x54868f):_0x93b61d,_0x5ca3e8;if(typeof Reflect===_0x5cc2aa(0xdd)&&typeof Reflect['decorate']===_0x5cc2aa(0xd8))_0x296606=Reflect[_0x5cc2aa(0xdb)](_0x22a8fb,_0x23d168,_0x54868f,_0x93b61d);else{for(var _0x52ca0a=_0x22a8fb[_0x5cc2aa(0xf9)]-0x1;_0x52ca0a>=0x0;_0x52ca0a--)if(_0x5ca3e8=_0x22a8fb[_0x52ca0a])_0x296606=(_0x2bba43<0x3?_0x5ca3e8(_0x296606):_0x2bba43>0x3?_0x5ca3e8(_0x23d168,_0x54868f,_0x296606):_0x5ca3e8(_0x23d168,_0x54868f))||_0x296606;}return _0x2bba43>0x3&&_0x296606&&Object['defineProperty'](_0x23d168,_0x54868f,_0x296606),_0x296606;},__metadata=this&&this[a17_0x45b0d3(0xe6)]||function(_0x13b13c,_0x3c51b8){var _0x2a9e91=a17_0x45b0d3;if(typeof Reflect===_0x2a9e91(0xdd)&&typeof Reflect[_0x2a9e91(0xf2)]===_0x2a9e91(0xd8))return Reflect[_0x2a9e91(0xf2)](_0x13b13c,_0x3c51b8);};Object['defineProperty'](exports,a17_0x45b0d3(0xe1),{'value':!![]}),exports['PageDTO']=void 0x0;const validator_1=require(a17_0x45b0d3(0xda));class PageDTO{}exports['PageDTO']=PageDTO,__decorate([(0x0,validator_1[a17_0x45b0d3(0xe8)])('分页',validator_1[a17_0x45b0d3(0xfe)][a17_0x45b0d3(0xe9)]()[a17_0x45b0d3(0xeb)]()[a17_0x45b0d3(0xfc)](0x1),'第一页为1,第二页为2'),__metadata(a17_0x45b0d3(0xea),Number)],PageDTO[a17_0x45b0d3(0xef)],a17_0x45b0d3(0xf0),void 0x0),__decorate([(0x0,validator_1[a17_0x45b0d3(0xe8)])(a17_0x45b0d3(0xfa),validator_1[a17_0x45b0d3(0xfe)][a17_0x45b0d3(0xe9)]()[a17_0x45b0d3(0xeb)]()[a17_0x45b0d3(0xfc)](0x1)),__metadata(a17_0x45b0d3(0xea),Number)],PageDTO[a17_0x45b0d3(0xef)],'_size',void 0x0),__decorate([(0x0,validator_1[a17_0x45b0d3(0xe8)])(a17_0x45b0d3(0xd7),validator_1[a17_0x45b0d3(0xfe)][a17_0x45b0d3(0xdc)]()[a17_0x45b0d3(0xfd)]()),__metadata(a17_0x45b0d3(0xea),String)],PageDTO[a17_0x45b0d3(0xef)],a17_0x45b0d3(0xf8),void 0x0),__decorate([(0x0,validator_1[a17_0x45b0d3(0xe8)])(a17_0x45b0d3(0xf6),validator_1['RuleType'][a17_0x45b0d3(0xe9)]()[a17_0x45b0d3(0xeb)]()[a17_0x45b0d3(0xff)](0x0,0x1),a17_0x45b0d3(0xe4)),__metadata(a17_0x45b0d3(0xea),Number)],PageDTO[a17_0x45b0d3(0xef)],a17_0x45b0d3(0xed),void 0x0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a18_0x4005(){var _0x401064=['2142qyWqPA','245LKMHOe','490972haxtPU','anvero-api:intercept','389008TfDdVY','INTERCEPT_KEY','search','__esModule','131726PejZye','defineProperty','975108gVfrVm','3cQCjSc','apply','1655654iCVhmw','InterceptTargetTmp','toString','42370YjgsBC','(((.+)+)+)+$','8DLctPx','54228REygOt'];a18_0x4005=function(){return _0x401064;};return a18_0x4005();}var a18_0x16daed=a18_0x255a;(function(_0x398988,_0x453460){var _0x3d546c=a18_0x255a,_0x3c630f=_0x398988();while(!![]){try{var _0x9ad2bc=parseInt(_0x3d546c(0x188))/0x1+-parseInt(_0x3d546c(0x18e))/0x2+-parseInt(_0x3d546c(0x18f))/0x3*(parseInt(_0x3d546c(0x186))/0x4)+-parseInt(_0x3d546c(0x185))/0x5*(parseInt(_0x3d546c(0x183))/0x6)+parseInt(_0x3d546c(0x18c))/0x7*(parseInt(_0x3d546c(0x182))/0x8)+parseInt(_0x3d546c(0x184))/0x9*(parseInt(_0x3d546c(0x180))/0xa)+parseInt(_0x3d546c(0x17d))/0xb;if(_0x9ad2bc===_0x453460)break;else _0x3c630f['push'](_0x3c630f['shift']());}catch(_0x3c99c2){_0x3c630f['push'](_0x3c630f['shift']());}}}(a18_0x4005,0x7d633));var a18_0x380709=(function(){var _0x3b1391=!![];return function(_0x53848e,_0xd2704e){var _0x36b0e2=_0x3b1391?function(){var _0xac3102=a18_0x255a;if(_0xd2704e){var _0x1e8568=_0xd2704e[_0xac3102(0x17c)](_0x53848e,arguments);return _0xd2704e=null,_0x1e8568;}}:function(){};return _0x3b1391=![],_0x36b0e2;};}()),a18_0x37831e=a18_0x380709(this,function(){var _0x386a0d=a18_0x255a;return a18_0x37831e[_0x386a0d(0x17f)]()[_0x386a0d(0x18a)](_0x386a0d(0x181))[_0x386a0d(0x17f)]()['constructor'](a18_0x37831e)[_0x386a0d(0x18a)](_0x386a0d(0x181));});a18_0x37831e();function a18_0x255a(_0x1dd98f,_0x29fd56){_0x1dd98f=_0x1dd98f-0x17c;var _0x4bc671=a18_0x4005();var _0x37831e=_0x4bc671[_0x1dd98f];return _0x37831e;}'use strict';Object[a18_0x16daed(0x18d)](exports,a18_0x16daed(0x18b),{'value':!![]}),exports[a18_0x16daed(0x17e)]=exports[a18_0x16daed(0x189)]=void 0x0,exports[a18_0x16daed(0x189)]=a18_0x16daed(0x187);class InterceptTargetTmp{}exports['InterceptTargetTmp']=InterceptTargetTmp;
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/// <reference types="@anveroapi/core" />
|
|
2
|
+
export * from './dist/index';
|
|
3
|
+
import { IMidwayApplication } from '@midwayjs/core';
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
export function getAppsConfig(appName?: string): any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare module '@midwayjs/koa/dist/interface' {
|
|
10
|
+
interface Context {
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
app: IMidwayApplication<Context>;
|
|
13
|
+
readonly hosturl: string;
|
|
14
|
+
readonly _matchedRoute?: string;
|
|
15
|
+
readonly _matchedRouteMeta?: {
|
|
16
|
+
module: string;
|
|
17
|
+
routePath: string;
|
|
18
|
+
routeName: string;
|
|
19
|
+
routeMethod: 'get' | 'post';
|
|
20
|
+
routeDescription: string;
|
|
21
|
+
filemethod: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
request:{
|
|
25
|
+
body?: any;
|
|
26
|
+
rawBody: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
koasend(filepath: string, filename?: string): Promise<void>;
|
|
30
|
+
|
|
31
|
+
when(key: string, callbal: (value: any) => {}): void;
|
|
32
|
+
only(keys: Array<Array<any>>): { [key: string]: any };
|
|
33
|
+
input(key?: string, defval?: any): any | { [key: string]: any } | any[];
|
|
34
|
+
|
|
35
|
+
ok(data?: any, extra?: any, code?: number): { code: number, data: any, extra: any };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
declare module 'http' {
|
|
42
|
+
interface IncomingHttpHeaders {
|
|
43
|
+
token: string;
|
|
44
|
+
device: string;
|
|
45
|
+
checkcode: string;
|
|
46
|
+
logintime: string;
|
|
47
|
+
requesttime: string;
|
|
48
|
+
[key:string]: string | undefined;
|
|
49
|
+
}
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anvero-api",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"typings": "index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"public",
|
|
9
|
+
"index.d.ts"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public",
|
|
14
|
+
"registry": "https://registry.npmjs.org/"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@midwayjs/core": "^3.17.1",
|
|
18
|
+
"@midwayjs/busboy": "^3.17.1",
|
|
19
|
+
"@midwayjs/cross-domain": "^3.17.1",
|
|
20
|
+
"@midwayjs/koa": "^3.17.1",
|
|
21
|
+
"@midwayjs/logger": "^3.4.2",
|
|
22
|
+
"@midwayjs/static-file": "^3.17.1",
|
|
23
|
+
"exceljs": "^4.4.0",
|
|
24
|
+
"koa-send": "^5.0.1",
|
|
25
|
+
"minimatch": "^10.1.1",
|
|
26
|
+
"anvero-apihelper": "^3.0.1",
|
|
27
|
+
"@anveroapi/event": "^3.0.0",
|
|
28
|
+
"@anveroapi/cache": "^3.0.0",
|
|
29
|
+
"@anveroapi/core": "^3.0.0",
|
|
30
|
+
"@anveroapi/validator": "^3.0.1",
|
|
31
|
+
"@anveroapi/typeorm": "^3.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "20.10.0",
|
|
35
|
+
"javascript-obfuscator": "^4.0.2",
|
|
36
|
+
"typescript": "~5.9.3"
|
|
37
|
+
},
|
|
38
|
+
"gitHead": "f7d4644d5e0591c4b383021edab6db20d1714880",
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build2": "tsc",
|
|
41
|
+
"build": "tsc && javascript-obfuscator ./dist --output ./dist --config obfuscator.json"
|
|
42
|
+
}
|
|
6
43
|
}
|