@maka/maka-cli 3.3.68 → 4.0.75
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/.eslintrc.json +19 -0
- package/.mocharc.json +3 -0
- package/README.md +4 -10
- package/dist/README.md +27 -0
- package/dist/command.js +1 -0
- package/dist/commands/_index.js +1 -0
- package/dist/commands/aws/_index.js +1 -0
- package/dist/commands/aws/aws.command.js +1 -0
- package/dist/commands/aws/ci.sub.cmd.js +1 -0
- package/dist/commands/aws/ckp.sub.cmd.js +1 -0
- package/dist/commands/aws/csg.sub.cmd.js +1 -0
- package/dist/commands/aws/di.sub.cmd.js +1 -0
- package/dist/commands/aws/dks.sub.cmd.js +1 -0
- package/dist/commands/aws/rbi.sub.cmd.js +1 -0
- package/dist/commands/aws/sth.sub.cmd.js +1 -0
- package/dist/commands/aws/ti.sub.cmd.js +1 -0
- package/dist/commands/build/_index.js +1 -0
- package/dist/commands/build/build.js +1 -0
- package/dist/commands/build/docker.sub.cmd.js +1 -0
- package/dist/commands/create.js +1 -0
- package/dist/commands/debug.js +1 -0
- package/dist/commands/deploy.js +1 -0
- package/dist/commands/game/_index.js +1 -0
- package/dist/commands/game/battleship.sub.cmd.js +1 -0
- package/dist/commands/game/play.command.js +1 -0
- package/dist/commands/game/pong.sub.cmd.js +1 -0
- package/dist/commands/game/snake.sub.cmd.js +1 -0
- package/dist/commands/game/tetris.sub.cmd.js +1 -0
- package/dist/commands/generate.js +1 -0
- package/dist/commands/get/_index.js +1 -0
- package/dist/commands/get/get.command.js +1 -0
- package/dist/commands/get/global.sub.cmd.js +1 -0
- package/dist/commands/get/local.sub.cmd.js +1 -0
- package/dist/commands/help.js +1 -0
- package/dist/commands/install.js +1 -0
- package/dist/commands/jsdoc.js +1 -0
- package/dist/commands/login.js +1 -0
- package/dist/commands/logout.js +1 -0
- package/dist/commands/logs.js +1 -0
- package/dist/commands/maka.cmd.js +1 -0
- package/dist/commands/murder.js +1 -0
- package/dist/commands/reconfig.js +1 -0
- package/dist/commands/run.js +1 -0
- package/dist/commands/set/_index.js +1 -0
- package/dist/commands/set/global.sub.cmd.js +1 -0
- package/dist/commands/set/local.sub.cmd.js +1 -0
- package/dist/commands/set/set.command.js +1 -0
- package/dist/commands/ssh.js +1 -0
- package/dist/commands/ssl.js +1 -0
- package/dist/commands/test.js +1 -0
- package/dist/commands/version.js +1 -0
- package/dist/error.js +1 -0
- package/dist/generator.js +1 -0
- package/dist/generators/_index.js +1 -0
- package/dist/generators/api.js +1 -0
- package/dist/generators/collection.js +1 -0
- package/dist/generators/component.js +1 -0
- package/dist/generators/config.js +1 -0
- package/dist/generators/dbc.js +1 -0
- package/dist/generators/dockerfile.js +1 -0
- package/dist/generators/hook.js +1 -0
- package/dist/generators/kit.js +1 -0
- package/dist/generators/layout.js +1 -0
- package/dist/generators/maka.gen.js +1 -0
- package/dist/generators/methods.js +1 -0
- package/dist/generators/package.js +1 -0
- package/dist/generators/page.js +1 -0
- package/dist/generators/publish.js +1 -0
- package/dist/generators/route.js +1 -0
- package/dist/generators/scaffold.js +1 -0
- package/dist/generators/service.js +1 -0
- package/dist/maka.js +2 -0
- package/dist/templates/meteor/api/api.js +11 -0
- package/dist/templates/meteor/api/api.js.ts +11 -0
- package/dist/templates/meteor/api/collection.js +86 -0
- package/dist/templates/meteor/api/collection.js.ts +94 -0
- package/dist/templates/meteor/api/fixtures.js +23 -0
- package/dist/templates/meteor/api/fixtures.js.ts +23 -0
- package/dist/templates/meteor/api/methods.js +136 -0
- package/dist/templates/meteor/api/methods.js.ts +137 -0
- package/dist/templates/meteor/api/publications.js +31 -0
- package/dist/templates/meteor/api/publications.js.ts +31 -0
- package/dist/templates/meteor/api/register-api.js +15 -0
- package/dist/templates/meteor/api/register-api.js.ts +15 -0
- package/dist/templates/meteor/api/resolvers.js +9 -0
- package/dist/templates/meteor/api/resolvers.js.ts +9 -0
- package/dist/templates/meteor/api/tests.js +1 -0
- package/dist/templates/meteor/api/tests.js.ts +1 -0
- package/dist/templates/meteor/api/typeDefs.js +5 -0
- package/dist/templates/meteor/api/typeDefs.js.ts +5 -0
- package/dist/templates/meteor/app/client/.gitkeep +0 -0
- package/dist/templates/meteor/app/client/body.html +3 -0
- package/dist/templates/meteor/app/client/head.html +25 -0
- package/dist/templates/meteor/app/client/main.app-tests.js +9 -0
- package/dist/templates/meteor/app/client/main.app-tests.js.jsx +9 -0
- package/dist/templates/meteor/app/client/main.app-tests.js.ts +9 -0
- package/dist/templates/meteor/app/client/main.app-tests.js.tsx +9 -0
- package/dist/templates/meteor/app/client/main.js +1 -0
- package/dist/templates/meteor/app/client/main.js.jsx +1 -0
- package/dist/templates/meteor/app/client/main.js.ts +1 -0
- package/dist/templates/meteor/app/client/main.js.tsx +1 -0
- package/dist/templates/meteor/app/imports/api/.gitkeep +0 -0
- package/dist/templates/meteor/app/imports/startup/client/index.js +19 -0
- package/dist/templates/meteor/app/imports/startup/client/index.js.jsx +100 -0
- package/dist/templates/meteor/app/imports/startup/client/index.js.ts +19 -0
- package/dist/templates/meteor/app/imports/startup/client/index.js.tsx +101 -0
- package/dist/templates/meteor/app/imports/startup/client/routes.js +39 -0
- package/dist/templates/meteor/app/imports/startup/client/routes.js.jsx +48 -0
- package/dist/templates/meteor/app/imports/startup/client/routes.js.ts +24 -0
- package/dist/templates/meteor/app/imports/startup/client/routes.js.tsx +48 -0
- package/dist/templates/meteor/app/imports/startup/client/templates.js +9 -0
- package/dist/templates/meteor/app/imports/startup/client/templates.js.jsx +9 -0
- package/dist/templates/meteor/app/imports/startup/client/templates.js.ts +9 -0
- package/dist/templates/meteor/app/imports/startup/client/templates.js.tsx +9 -0
- package/dist/templates/meteor/app/imports/startup/lib/index.js +1 -0
- package/dist/templates/meteor/app/imports/startup/lib/index.js.jsx +10 -0
- package/dist/templates/meteor/app/imports/startup/lib/index.js.ts +1 -0
- package/dist/templates/meteor/app/imports/startup/lib/index.js.tsx +10 -0
- package/dist/templates/meteor/app/imports/startup/lib/routes.js.jsx +48 -0
- package/dist/templates/meteor/app/imports/startup/lib/routes.js.tsx +48 -0
- package/dist/templates/meteor/app/imports/startup/lib/templates.js.jsx +0 -0
- package/dist/templates/meteor/app/imports/startup/lib/templates.js.tsx +0 -0
- package/dist/templates/meteor/app/imports/startup/server/index.js +1 -0
- package/dist/templates/meteor/app/imports/startup/server/index.js.jsx +139 -0
- package/dist/templates/meteor/app/imports/startup/server/index.js.ts +0 -0
- package/dist/templates/meteor/app/imports/startup/server/index.js.tsx +138 -0
- package/dist/templates/meteor/app/imports/ui/test-helpers.js +24 -0
- package/dist/templates/meteor/app/imports/ui/test-helpers.js.ts +24 -0
- package/dist/templates/meteor/app/lib/.gitkeep +0 -0
- package/dist/templates/meteor/app/lib/main.js +1 -0
- package/dist/templates/meteor/app/lib/main.js.jsx +1 -0
- package/dist/templates/meteor/app/lib/main.js.ts +1 -0
- package/dist/templates/meteor/app/lib/main.js.tsx +1 -0
- package/dist/templates/meteor/app/maka.d.ts +160 -0
- package/dist/templates/meteor/app/meteor.d.ts +955 -0
- package/dist/templates/meteor/app/packages/.gitkeep +0 -0
- package/dist/templates/meteor/app/private/.gitkeep +0 -0
- package/dist/templates/meteor/app/public/.gitkeep +0 -0
- package/dist/templates/meteor/app/public/favicon.ico +0 -0
- package/dist/templates/meteor/app/public/manifest.json +9 -0
- package/dist/templates/meteor/app/public/sw.js +30 -0
- package/dist/templates/meteor/app/public/sw.js.jsx +30 -0
- package/dist/templates/meteor/app/public/sw.js.ts +30 -0
- package/dist/templates/meteor/app/public/sw.js.tsx +30 -0
- package/dist/templates/meteor/app/server/.gitkeep +0 -0
- package/dist/templates/meteor/app/server/main.app-tests.js +9 -0
- package/dist/templates/meteor/app/server/main.app-tests.js.jsx +9 -0
- package/dist/templates/meteor/app/server/main.app-tests.js.ts +9 -0
- package/dist/templates/meteor/app/server/main.app-tests.js.tsx +9 -0
- package/dist/templates/meteor/app/server/main.js +3 -0
- package/dist/templates/meteor/app/server/main.js.jsx +3 -0
- package/dist/templates/meteor/app/server/main.js.ts +3 -0
- package/dist/templates/meteor/app/server/main.js.tsx +3 -0
- package/dist/templates/meteor/app/tsconfig.json +26 -0
- package/dist/templates/meteor/collection/collection.js +85 -0
- package/dist/templates/meteor/collection/collection.js.ts +97 -0
- package/dist/templates/meteor/collection/tests.js +27 -0
- package/dist/templates/meteor/collection/tests.js.ts +27 -0
- package/dist/templates/meteor/config/docker-compose.yaml +17 -0
- package/dist/templates/meteor/config/pm2.config.js +25 -0
- package/dist/templates/meteor/config/process.env +5 -0
- package/dist/templates/meteor/config/settings.json +8 -0
- package/dist/templates/meteor/config/ssh.json +6 -0
- package/dist/templates/meteor/dbc/config.js +70 -0
- package/dist/templates/meteor/dbc/config.js.ts +70 -0
- package/dist/templates/meteor/dbc/conn.js +37 -0
- package/dist/templates/meteor/dbc/conn.js.ts +37 -0
- package/dist/templates/meteor/dbc/register-dbc.js +3 -0
- package/dist/templates/meteor/dbc/register-dbc.js.ts +3 -0
- package/dist/templates/meteor/method/method.js +48 -0
- package/dist/templates/meteor/method/method.js.ts +48 -0
- package/dist/templates/meteor/package/client/package.js +0 -0
- package/dist/templates/meteor/package/client/package.js.jsx +0 -0
- package/dist/templates/meteor/package/client/package.js.ts +0 -0
- package/dist/templates/meteor/package/client/package.js.tsx +0 -0
- package/dist/templates/meteor/package/lib/package.js +0 -0
- package/dist/templates/meteor/package/lib/package.js.jsx +0 -0
- package/dist/templates/meteor/package/lib/package.js.ts +0 -0
- package/dist/templates/meteor/package/lib/package.js.tsx +0 -0
- package/dist/templates/meteor/package/package.js +37 -0
- package/dist/templates/meteor/package/package.js.jsx +37 -0
- package/dist/templates/meteor/package/package.js.ts +36 -0
- package/dist/templates/meteor/package/package.js.tsx +37 -0
- package/dist/templates/meteor/package/server/package.js +0 -0
- package/dist/templates/meteor/package/server/package.js.jsx +0 -0
- package/dist/templates/meteor/package/server/package.js.ts +0 -0
- package/dist/templates/meteor/package/server/package.js.tsx +0 -0
- package/dist/templates/meteor/package/tests/client/package.js +5 -0
- package/dist/templates/meteor/package/tests/client/package.js.jsx +5 -0
- package/dist/templates/meteor/package/tests/client/package.js.ts +5 -0
- package/dist/templates/meteor/package/tests/client/package.js.tsx +5 -0
- package/dist/templates/meteor/package/tests/server/package.js +5 -0
- package/dist/templates/meteor/package/tests/server/package.js.jsx +5 -0
- package/dist/templates/meteor/package/tests/server/package.js.ts +5 -0
- package/dist/templates/meteor/package/tests/server/package.js.tsx +5 -0
- package/dist/templates/meteor/project/.maka/config.json +29 -0
- package/dist/templates/meteor/project/README.md +1 -0
- package/dist/templates/meteor/project/build/.gitkeep +0 -0
- package/dist/templates/meteor/project/build/README +4 -0
- package/dist/templates/meteor/project/gitignore +6 -0
- package/dist/templates/meteor/publish/publish.js +3 -0
- package/dist/templates/meteor/publish/publish.js.jsx +3 -0
- package/dist/templates/meteor/publish/publish.js.tsx +3 -0
- package/dist/templates/meteor/publish/publish.ts +3 -0
- package/dist/templates/meteor/service/logger/logger.js +17 -0
- package/dist/templates/meteor/service/logger/logger.js.ts +17 -0
- package/dist/templates/meteor/service/logger/transports.js +31 -0
- package/dist/templates/meteor/service/logger/transports.js.ts +31 -0
- package/dist/templates/meteor/stylesheet/stylesheet.css +5 -0
- package/dist/templates/meteor/stylesheet/stylesheet.css.less +5 -0
- package/dist/templates/meteor/template/template-tests.js +1 -0
- package/dist/templates/meteor/template/template-tests.js.jsx +55 -0
- package/dist/templates/meteor/template/template-tests.js.ts +1 -0
- package/dist/templates/meteor/template/template-tests.js.tsx +55 -0
- package/dist/templates/meteor/template/template.css +6 -0
- package/dist/templates/meteor/template/template.css.less +6 -0
- package/dist/templates/meteor/template/template.html +5 -0
- package/dist/templates/meteor/template/template.js +20 -0
- package/dist/templates/meteor/template/template.js.jsx +77 -0
- package/dist/templates/meteor/template/template.js.ts +1 -0
- package/dist/templates/meteor/template/template.js.tsx +89 -0
- package/dist/templates/react/component/component.css +6 -0
- package/dist/templates/react/component/component.css.less +6 -0
- package/dist/templates/react/component/component.js +0 -0
- package/dist/templates/react/component/component.js.jsx +64 -0
- package/dist/templates/react/component/component.js.ts +0 -0
- package/dist/templates/react/component/component.js.tsx +68 -0
- package/dist/templates/react/hook/hook.js +1 -0
- package/dist/templates/react/hook/hook.js.jsx +25 -0
- package/dist/templates/react/hook/hook.js.ts +0 -0
- package/dist/templates/react/hook/hook.js.tsx +25 -0
- package/dist/templates/react/route/route.js +8 -0
- package/dist/templates/react/route/route.js.jsx +8 -0
- package/dist/templates/react/route/route.js.ts +8 -0
- package/dist/templates/react/route/route.js.tsx +8 -0
- package/dist/templates/react/test/test.js +1 -0
- package/dist/templates/react/test/test.js.jsx +56 -0
- package/dist/templates/react/test/test.js.ts +1 -0
- package/dist/templates/react/test/test.js.tsx +55 -0
- package/dist/templates/service/docker/Dockerfile +54 -0
- package/dist/tool.js +1 -0
- package/dist/tools/actions/actions.class.js +1 -0
- package/dist/tools/actions/actions.test.js +1 -0
- package/dist/tools/aws/aws.class.js +1 -0
- package/dist/tools/aws/aws.interfaces.js +1 -0
- package/dist/tools/aws/aws.test.js +0 -0
- package/dist/tools/docker/docker.class.js +1 -0
- package/dist/tools/docker/docker.interfaces.js +1 -0
- package/dist/tools/docker/docker.test.js +0 -0
- package/dist/tools/fsi/fsi.class.js +1 -0
- package/dist/tools/fsi/fsi.interfaces.js +1 -0
- package/dist/tools/https/https.class.js +1 -0
- package/dist/tools/https/https.interface.js +1 -0
- package/dist/tools/log/log.class.js +1 -0
- package/dist/tools/log/log.interfaces.js +1 -0
- package/dist/tools/log/log.test.js +0 -0
- package/dist/tools/spawn-async/spawn-async.class.js +1 -0
- package/dist/tools/spawn-async/spawn-async.interfaces.js +1 -0
- package/dist/tools/spawn-async/spawn-async.test.js +0 -0
- package/dist/tools/ssh/ssh.class.js +1 -0
- package/dist/tools/ssh/ssh.interfaces.js +1 -0
- package/dist/tools/ssh/ssh.test.js +0 -0
- package/dist/tools/ssl/ssl.class.js +1 -0
- package/dist/tools/ssl/ssl.interfaces.js +0 -0
- package/dist/tools/ssl/ssl.test.js +0 -0
- package/obfuscator.json +29 -0
- package/package.json +86 -27
- package/tsconfig.json +23 -0
- package/AUTHORS +0 -19
- package/LICENSE +0 -1
- package/compiled/linux/maka +0 -0
- package/compiled/macos/maka +0 -0
- package/compiled/win/maka.exe +0 -0
- package/maka +0 -23
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a62d(a,b){const c=a62c();return a62d=function(d,e){d=d-0x11f;let f=c[d];return f;},a62d(a,b);}const a62N=a62d;(function(a,b){const J=a62d,c=a();while(!![]){try{const d=-parseInt(J(0x135))/0x1*(-parseInt(J(0x16c))/0x2)+parseInt(J(0x170))/0x3+-parseInt(J(0x128))/0x4+-parseInt(J(0x13a))/0x5+parseInt(J(0x16f))/0x6*(-parseInt(J(0x159))/0x7)+-parseInt(J(0x157))/0x8+parseInt(J(0x139))/0x9;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a62c,0x32386));const a62b=(function(){let a=!![];return function(b,c){const K=a62d;if(K(0x162)!=='eWydG'){const e=d['apply'](e,arguments);return f=null,e;}else{const e=a?function(){const L=K;if(c){if(L(0x12a)!==L(0x16a)){const f=c[L(0x179)](b,arguments);return c=null,f;}else m[L(0x132)][L(0x168)]&&this[L(0x13e)][L(0x178)]({'filePath':y+'.'+z['engines']['js'],'content':L(0x149)+A[L(0x146)]+'.'+B[L(0x11f)][L(0x152)]+'\x27;\x0a'+L(0x149)+C[L(0x146)]+'.'+D[L(0x11f)][L(0x168)]+'\x27;'}),!t[L(0x132)][L(0x168)]&&this[L(0x13e)][L(0x178)]({'filePath':E+'.'+F[L(0x11f)]['js'],'content':L(0x149)+G[L(0x146)]+'.'+H[L(0x11f)][L(0x152)]+'\x27;'});}}:function(){};return a=![],e;}};}()),a62a=a62b(this,function(){const M=a62d;return a62a[M(0x133)]()['search'](M(0x177))['toString']()[M(0x14e)](a62a)[M(0x120)](M(0x177));});a62a();import a62I from'path';import{Generator}from'../generator.js';import{Log}from'../tools/log/log.class.js';import{camelCase,paramCase,pascalCase}from'change-case';const aliases=['p'];Generator[a62N(0x171)]({'name':a62N(0x142),'aliases':aliases,'usage':a62N(0x13c),'description':a62N(0x161),'examples':[a62N(0x150)]},function(a,b){const O=a62N;let c=O(0x153);const d=this['fsi']['pathFromApp'](b),e=this[O(0x13e)][O(0x12f)]({'pathParts':[c,b['dir'],paramCase(b[O(0x144)]),paramCase(b[O(0x144)])]}),f=this[O(0x13e)][O(0x15e)]();this[O(0x13e)][O(0x145)](f,()=>{const P=O;if(P(0x122)!==P(0x122))c[P(0x175)](P(0x134)),this['fsi'][P(0x166)](P(0x141),{'cwd':d});else{var g;typeof f[P(0x132)][P(0x152)]==='string'&&('JZxZg'!==P(0x12c)?this[P(0x13e)][P(0x178)]({'filePath':e,'content':P(0x13d)+f[P(0x158)]+'\x20}\x20from\x20\x27'+g+'.'+h[P(0x11f)]['js']+P(0x17a)}):(f['template'][P(0x152)]=f[P(0x132)][P(0x152)]==='true'?!![]:![],this[P(0x13e)][P(0x14d)](P(0x152),f['template'][P(0x152)])));if(typeof f[P(0x132)][P(0x16b)]===P(0x154)){if(P(0x127)!==P(0x127)){const o=this[P(0x13e)][P(0x12f)]({'pathParts':[P(0x125),P(0x174),P(0x164),P(0x16d)]});c=this[P(0x13e)][P(0x130)]({'pathParts':[o],'config':d});}else f[P(0x132)][P(0x16b)]=f[P(0x132)][P(0x16b)]===P(0x167)?!![]:![],this['fsi'][P(0x14d)](P(0x16b),f[P(0x132)][P(0x16b)]);}typeof f[P(0x132)][P(0x168)]===P(0x154)&&(f['template'][P(0x168)]=f[P(0x132)]['css']===P(0x167)?!![]:![],this[P(0x13e)][P(0x14d)]('css',f[P(0x132)][P(0x168)]));typeof f[P(0x132)]['js']===P(0x154)&&(f['template']['js']=f['template']['js']==='true'?!![]:![],this[P(0x13e)][P(0x14d)]('js',f[P(0x132)]['js']));!f[P(0x17b)]&&(f[P(0x17b)]={});!b[P(0x12d)]&&!this['fsi'][P(0x13b)](P(0x141))&&(Log[P(0x175)](P(0x134)),this[P(0x13e)]['installNpmPackage'](P(0x141),{'cwd':d}));const i={'name':pascalCase(b[P(0x144)]),'myPath':a62I[P(0x160)](this[P(0x13e)][P(0x129)]({}),e),'cssCaseName':paramCase(b[P(0x144)]),'className':pascalCase(b['resourceName']),'camelCaseName':camelCase(b['resourceName']),'fileName':paramCase(b[P(0x144)]),'graphql':f[P(0x11f)][P(0x121)],'features':f[P(0x17b)],'client':f[P(0x11f)]['client'],'api':f[P(0x11f)][P(0x14c)],'ssr':f[P(0x11f)][P(0x137)],'isStore':b[P(0x165)]('store'),'isComponent':b[P(0x165)](P(0x147)),'isLayout':b[P(0x165)](P(0x15f)),'test':f['engines'][P(0x16b)],'theme':f[P(0x11f)][P(0x15c)]};f[P(0x132)]['html']&&('ItunI'!=='MnoUU'?this[P(0x13e)][P(0x132)]({'srcPath':P(0x12b),'destPath':e+P(0x126),'context':i,'config':f}):(d['template'][P(0x152)]=e[P(0x132)][P(0x152)]===P(0x167)?!![]:![],this['fsi'][P(0x14d)](P(0x152),f[P(0x132)][P(0x152)])));((g=f[P(0x17b)])===null||g===void 0x0?void 0x0:g['withHooks'])||b[P(0x138)]?'WtbuV'==='pvZwA'?this[P(0x13e)][P(0x151)]({'filePath':d,'content':P(0x156)+e+'.'+f['engines']['js']+P(0x17a)}):this['fsi']['template']({'srcPath':P(0x12e),'destPath':e+P(0x148),'framework':'react','context':i,'config':f}):this['fsi'][P(0x132)]({'srcPath':P(0x131),'destPath':e+P(0x148),'framework':P(0x14a),'context':i,'config':f});f[P(0x11f)][P(0x16b)]!==P(0x176)&&this['fsi'][P(0x132)]({'srcPath':'test/test.js','destPath':e+P(0x136),'framework':P(0x14a),'context':i,'config':f});f[P(0x132)][P(0x168)]&&this[P(0x13e)]['template']({'srcPath':P(0x123),'destPath':e+'.css','context':Object[P(0x169)]({},i,{'className':paramCase(b[P(0x144)])}),'config':f});f[P(0x11f)][P(0x164)]!==P(0x14a)&&f[P(0x11f)][P(0x164)]!==P(0x13f)?P(0x172)===P(0x172)?(f[P(0x132)][P(0x168)]&&this[P(0x13e)][P(0x178)]({'filePath':e+'.'+f[P(0x11f)]['js'],'content':P(0x149)+i[P(0x146)]+'.'+f[P(0x11f)][P(0x152)]+P(0x17a)+P(0x149)+i['fileName']+'.'+f['engines'][P(0x168)]+'\x27;'}),!f[P(0x132)][P(0x168)]&&(P(0x15d)!==P(0x15a)?this['fsi'][P(0x178)]({'filePath':e+'.'+f[P(0x11f)]['js'],'content':P(0x149)+i[P(0x146)]+'.'+f[P(0x11f)][P(0x152)]+'\x27;'}):f['template']['css']&&this['fsi'][P(0x178)]({'filePath':k+'.'+l[P(0x11f)]['js'],'content':P(0x149)+m[P(0x146)]+'.'+n[P(0x11f)]['css']+'\x27;'}))):this[P(0x13e)][P(0x178)]({'filePath':g+'.'+h[P(0x11f)]['js'],'content':P(0x149)+i[P(0x146)]+'.'+j[P(0x11f)][P(0x152)]+P(0x17a)+P(0x149)+k[P(0x146)]+'.'+l[P(0x11f)][P(0x168)]+'\x27;'}):P(0x14b)===P(0x14b)?f[P(0x132)][P(0x168)]&&this['fsi'][P(0x178)]({'filePath':e+'.'+f['engines']['js'],'content':P(0x149)+i[P(0x146)]+'.'+f[P(0x11f)][P(0x168)]+'\x27;'}):this['fsi'][P(0x132)]({'srcPath':P(0x12e),'destPath':d+P(0x148),'framework':P(0x14a),'context':e,'config':f});const j=b['dir']?'/'+b[P(0x16e)]+'/':'/',k=''+c+j+i[P(0x146)]+'/'+i[P(0x146)];let l;if(f['engines'][P(0x137)]===P(0x167)){const t=this['fsi']['pathFromApp']({'pathParts':['imports',P(0x174),P(0x14f),P(0x16d)]});l=this['fsi'][P(0x130)]({'pathParts':[t],'config':f});}else{if(P(0x163)===P(0x163)){const u=this[P(0x13e)]['pathFromApp']({'pathParts':['imports','startup',P(0x164),P(0x16d)]});l=this[P(0x13e)][P(0x130)]({'pathParts':[u],'config':f});}else this[P(0x13e)][P(0x178)]({'filePath':e+'.'+f[P(0x11f)]['js'],'content':'import\x20\x27./'+g[P(0x146)]+'.'+h[P(0x11f)][P(0x152)]+'\x27;'});}f[P(0x11f)][P(0x164)]==='react'?P(0x143)===P(0x143)?(f[P(0x11f)]['js']===P(0x173)?this[P(0x13e)]['injectAtBeginningOfFile']({'filePath':l,'content':'import\x20{\x20'+i['className']+'\x20}\x20from\x20\x27'+k+P(0x17a)}):this[P(0x13e)][P(0x178)]({'filePath':l,'content':P(0x13d)+i[P(0x158)]+'\x20}\x20from\x20\x27'+k+'.'+f['engines']['js']+P(0x17a)}),this['fsi'][P(0x151)]({'filePath':l,'content':P(0x124)+i[P(0x158)]+P(0x140)})):(d['template']['js']=e['template']['js']==='true'?!![]:![],this[P(0x13e)]['setTemplate']('js',f['template']['js'])):P(0x155)!==P(0x15b)?this['fsi'][P(0x151)]({'filePath':l,'content':P(0x156)+k+'.'+f['engines']['js']+P(0x17a)}):this[P(0x13e)][P(0x132)]({'srcPath':P(0x12b),'destPath':d+'.html','context':e,'config':f});}});});function a62c(){const Q=['imports','.html','JjXqd','348176DeGiEc','pathFromProject','aRrFu','template/template.html','JZxZg','root','hook/hook.js','pathFromApp','rewriteDestinationPathForEngine','component/component.js','template','toString','Updating\x20npm\x20packages\x20...','151241ZosTti','.app-tests.js','ssr','withHook','6278031eyLhcv','1854765yssPmo','checkNpmPackage','maka\x20{generate,\x20g}:{page,\x20p}\x20[path/]<name>','import\x20{\x20','fsi','vanilla','\x20};\x0a','ramda','page','BOdrR','resourceName','withValue','fileName','component','.js','import\x20\x27./','react','aiOpo','api','setTemplate','constructor','lib','maka\x20g:page\x20todos/todos-item','injectAtEndOfFile','html','/imports/ui/pages','string','MsqSq','import\x20\x27','2359024enNBPt','className','287ibGKWu','wDLKC','ZcVqN','theme','sbWJE','getProjectConfig','layout','relative','Generate\x20a\x20page.','eWydG','cQfzj','client','hasOwnProperty','installNpmPackage','true','css','assign','KmyiK','test','4eUHnhn','templates.js','dir','56226FCINjV','1028241dJksez','create','kUphq','tsx','startup','warn','none','(((.+)+)+)+$','injectAtBeginningOfFile','apply','\x27;\x0a','features','engines','search','graphql','MqsTk','template/template.css','export\x20{\x20'];a62c=function(){return Q;};return a62c();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a63C=a63d;(function(a,b){const z=a63d,c=a();while(!![]){try{const d=-parseInt(z(0x1a7))/0x1*(parseInt(z(0x196))/0x2)+-parseInt(z(0x1b1))/0x3+parseInt(z(0x1a8))/0x4+parseInt(z(0x19c))/0x5*(-parseInt(z(0x194))/0x6)+-parseInt(z(0x18e))/0x7*(parseInt(z(0x19e))/0x8)+parseInt(z(0x19b))/0x9+parseInt(z(0x1a3))/0xa*(parseInt(z(0x1a9))/0xb);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a63c,0x91d2e));const a63b=(function(){let a=!![];return function(b,c){const d=a?function(){const A=a63d;if(A(0x1b8)===A(0x1b8)){if(c){const e=c[A(0x197)](b,arguments);return c=null,e;}}else c(d);}:function(){};return a=![],d;};}()),a63a=a63b(this,function(){const B=a63d;return a63a[B(0x1a5)]()[B(0x19a)](B(0x198))[B(0x1a5)]()[B(0x1a6)](a63a)[B(0x19a)](B(0x198));});a63a();var __awaiter=this&&this[a63C(0x1a0)]||function(a,b,c,d){function e(f){return f instanceof c?f:new c(function(g){const D=a63d;if(D(0x1a1)===D(0x1a1))g(f);else return f instanceof g?h:new i(function(m){m(k);});});}return new(c||(c=Promise))(function(f,g){const H=a63d;function h(k){const E=a63d;try{j(d[E(0x1a2)](k));}catch(l){g(l);}}function i(k){const F=a63d;if(F(0x1b7)==='mXrmD')try{j(d[F(0x1b6)](k));}catch(l){if(F(0x1a4)===F(0x1a4))g(l);else try{i(j['throw'](k));}catch(o){m(o);}}else h['done']?i(j[F(0x18f)]):k(l[F(0x18f)])['then'](m,n);}function j(k){const G=a63d;G(0x195)===G(0x1b4)?d(e['next'](f)):k[G(0x19f)]?f(k[G(0x18f)]):e(k['value'])['then'](h,i);}j((d=d[H(0x197)](a,b||[]))[H(0x1a2)]());});};import{paramCase}from'change-case';function a63c(){const M=['30waDWcz','RXPOM','toString','constructor','2001VBnZFh','2223140lOoCht','8729633PZepBs','getProjectConfig','create','engines','maka\x20{generate,\x20g}:{publish,\x20p}\x20<name>','server/publish.','AdJqF','ZPVQm','2825880MeFbeW','tsx','resourceName','AiSFs','injectAtEndOfFile','throw','mXrmD','gWwwy','publish','2296pinpkF','value','publish/publish.','urdgm','templateContent','fsi','6OUTlXs','dRSHL','302ACAOUt','apply','(((.+)+)+)+$','rewriteDestinationPathForEngine','search','4488102RTNdFU','2696735KTZwts','Generate\x20scaffolding\x20for\x20a\x20publish\x20function.\x0ahttps://docs.meteor.com/api/pubsub.html','25720Uscinx','done','__awaiter','udFld','next'];a63c=function(){return M;};return a63c();}import{Generator}from'../generator.js';function a63d(a,b){const c=a63c();return a63d=function(d,e){d=d-0x18d;let f=c[d];return f;},a63d(a,b);}Generator[a63C(0x1ab)]({'name':a63C(0x18d),'aliases':['p'],'usage':a63C(0x1ad),'description':a63C(0x19d),'examples':['maka\x20g:publish\x20todos']},function(a,b){return __awaiter(this,void 0x0,void 0x0,function*(){const I=a63d;if(I(0x1b0)===I(0x1af)){const d=g?function(){const J=I;if(d){const u=q[J(0x197)](r,arguments);return s=null,u;}}:function(){};return l=![],d;}else{const d=this['fsi'][I(0x1aa)]();this[I(0x193)]['withValue'](d,()=>__awaiter(this,void 0x0,void 0x0,function*(){const K=I,e={'name':b['resourceName'],'collection':paramCase(b[K(0x1b3)]),'noRename':!![]};let f='js';if(d[K(0x1ac)]['js']===K(0x1b2)){if(K(0x191)!=='urdgm'){const j=this['fsi'][K(0x1aa)]();this['fsi']['withValue'](j,()=>j(this,void 0x0,void 0x0,function*(){const L=K,t={'name':m['resourceName'],'collection':n(o[L(0x1b3)]),'noRename':!![]};let u='js';j[L(0x1ac)]['js']==='tsx'&&(u='ts');const v=this[L(0x193)][L(0x199)]({'pathParts':[L(0x1ae)+j['engines']['js']]}),w=this[L(0x193)][L(0x192)]({'srcPath':L(0x190)+u,'context':t,'config':j});this[L(0x193)][L(0x1b5)]({'filePath':v,'content':'\x0a'+w});}));}else f='ts';}const g=this[K(0x193)]['rewriteDestinationPathForEngine']({'pathParts':[K(0x1ae)+d['engines']['js']]}),h=this[K(0x193)][K(0x192)]({'srcPath':'publish/publish.'+f,'context':e,'config':d});this[K(0x193)][K(0x1b5)]({'filePath':g,'content':'\x0a'+h});}));}});});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a64H=a64d;function a64c(){const Y=['24tFqNMX','cwd','startup','throw','__awaiter','root','maka\x20g:route\x20usersShow\x20users/:id/show\x20--layout\x20userView','3591IWWfPM','pathFromApp','maka\x20g:route\x20todosIndex\x20todos','\x22*\x22','join','next','fsi','663164wCxFAV','9978mFjobd','true','Generate\x20scaffolding\x20for\x20a\x20Route.','templateName','map','newForm','injectIntoFile','</Router>','2vDyLph','DFJOa','vanilla','injectAtEndOfFile','const\x20publicRoutes\x20=\x20(<>','imports','15581655YADQNe','1268vknTIV','engines','only','Could\x20not\x20find\x20a\x20suitable\x20location\x20to\x20enable\x20this\x20route.\x20\x20Please\x20inspect\x20','invoke','MasterLayout','create','WNQgo','(((.+)+)+)+$','routes.js','config','oxRFi','value','toLowerCase','VAvvu','rewriteDestinationPathForEngine','layout','length','templateContent','XmKyh','JRFOh','route','jvqKe','hiMGO','PrivateLayout','toString','client','33aHNvXH','ssr','ZwPTg','error','private','injectAfterLineNumber','constructor','iUhAO','HCaLb','qeFAo','wlpfZ','8ftINtt','readFileLines','13456118pIPjEK','<Route','apply','filter','const\x20privateRoutes\x20=\x20(<>','react','1052090jIyjjR','warn','route/route.js','6571045xXmHro','\x0a\x09\x09','hDiPP','includes','154sNzDoR','search'];a64c=function(){return Y;};return a64c();}(function(a,b){const E=a64d,c=a();while(!![]){try{const d=-parseInt(E(0x96))/0x1*(-parseInt(E(0x9d))/0x2)+parseInt(E(0xb8))/0x3*(-parseInt(E(0x8d))/0x4)+parseInt(E(0xce))/0x5+parseInt(E(0x8e))/0x6*(-parseInt(E(0xdb))/0x7)+parseInt(E(0xc3))/0x8*(parseInt(E(0x9c))/0x9)+parseInt(E(0xcb))/0xa*(-parseInt(E(0xd2))/0xb)+parseInt(E(0xd4))/0xc*(parseInt(E(0xc5))/0xd);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a64c,0xec21e));const a64b=(function(){let a=!![];return function(b,c){const d=a?function(){const F=a64d;if(c){const e=c[F(0xc7)](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a64a=a64b(this,function(){const G=a64d;return a64a['toString']()['search'](G(0xa5))[G(0xb6)]()[G(0xbe)](a64a)[G(0xd3)]('(((.+)+)+)+$');});a64a();var __awaiter=this&&this[a64H(0xd8)]||function(a,b,c,d){function e(f){const I=a64d;return I(0xb0)===I(0xb4)?f instanceof g?h:new i(function(m){m(k);}):f instanceof c?f:new c(function(h){const J=I;if(J(0xab)!=='GLhpd')h(f);else return c[J(0xd1)]('const\x20privateRoutes\x20=\x20(<>')?d+0x1:null;});}return new(c||(c=Promise))(function(f,g){const N=a64d;function h(k){const K=a64d;try{j(d['next'](k));}catch(l){if(K(0xa4)!=='WNQgo')return c['includes'](K(0xc9))?d+0x1:null;else g(l);}}function i(k){const L=a64d;if(L(0xc1)!=='bHZHq')try{j(d[L(0xd7)](k));}catch(l){g(l);}else d(e['next'](f));}function j(k){const M=a64d;k['done']?f(k[M(0xa9)]):e(k[M(0xa9)])['then'](h,i);}j((d=d[N(0xc7)](a,b||[]))[N(0x8b)]());});};import a64u from'path';import{Generator}from'../generator.js';import{Log}from'../tools/log/log.class.js';import a64v from'../generators/maka.gen.js';function a64d(a,b){const c=a64c();return a64d=function(d,e){d=d-0x87;let f=c[d];return f;},a64d(a,b);}import{camelCase,paramCase,pascalCase}from'change-case';const aliases=['r'];Generator[a64H(0xa3)]({'name':a64H(0xb2),'aliases':aliases,'validOpts':[a64H(0xbc),a64H(0xad),a64H(0x9f),a64H(0xd5),a64H(0xa7),a64H(0xd9),'withHook'],'usage':'maka\x20{generate,\x20g}:{route,\x20r}\x20[path/]<name>\x20[url]\x20[--private]','description':a64H(0x90),'examples':[a64H(0x88),'maka\x20g:route\x20todosEdit\x20todos/:id/edit',a64H(0xda),'maka\x20g:route\x20lists/listIndex\x20lists']},function(a,b){const O=a64H;try{if(O(0xa8)!=='pHrXJ'){const c=this[O(0x8c)]['getProjectConfig']();this[O(0x8c)]['withValue'](c,()=>__awaiter(this,void 0x0,void 0x0,function*(){const P=O;if(P(0xb3)===P(0xb3)){var d;let f=(d=b[P(0xbc)])!==null&&d!==void 0x0?d:![],g=paramCase(a[0x0]),h='/'+g;a[P(0xae)]>0x1&&(h='/'+a[P(0xc8)](function(m){const Q=P;return'IBwhj'===Q(0xd0)?c[Q(0xd1)]('import\x20*\x20as\x20Component\x20from\x20\x27./templates\x27;')?d+0x1:null:m!=='/';})['join']('/')[P(0xaa)]());g=camelCase(g);b[P(0xad)]&&('EDCoX'===P(0xb1)?c='/'+d[P(0xc8)](function(n){return n!=='/';})['join']('/')[P(0xaa)]():b[P(0xad)]=camelCase(b[P(0xad)]));let i=a64u[P(0x8a)]('/imports/ui/pages',g,g),j={'name':g,'fileCase':paramCase(g),'camelCaseName':camelCase(g),'url':h,'layout':b['layout']||P(0xa2),'templatePath':i,'templateName':pascalCase(g),'client':c[P(0x9e)]['client'],'newForm':![]};if(f){if(P(0xc0)!=='HCaLb')return c[P(0xd1)](P(0x9a))?d+0x1:null;else j[P(0xad)]=P(0xb5);}if(!b[P(0xd9)]){const o=a64v['findGenerator']('page');o&&(yield o[P(0xa1)](a,b));}let k,l;if(c[P(0x9e)][P(0xb7)]==='react'){if(P(0xc2)!==P(0xc2))c[P(0xcc)]('Could\x20not\x20find\x20a\x20suitable\x20location\x20to\x20enable\x20this\x20route.\x20\x20Please\x20inspect\x20'+d);else{if(c[P(0x9e)][P(0xb9)]===P(0x8f)){const t=this['fsi'][P(0x87)]({'pathParts':[P(0x9b),P(0xd6),'lib',P(0xa6)]});k=this['fsi'][P(0xac)]({'pathParts':[t],'config':c});}else{const u=this[P(0x8c)]['pathFromApp']({'pathParts':[P(0x9b),P(0xd6),'client',P(0xa6)]});k=this[P(0x8c)][P(0xac)]({'pathParts':[u],'config':c});}let q=this[P(0x8c)][P(0xc4)](k)[P(0x92)]((v,w)=>{const R=P;if('xYoWI'!==R(0x97))return v[R(0xd1)]('import\x20*\x20as\x20Component\x20from\x20\x27./templates\x27;')?w+0x1:null;else{const y=this[R(0x8c)]['pathFromApp']({'pathParts':[R(0x9b),R(0xd6),R(0xb7),R(0xa6)]});g=this[R(0x8c)][R(0xac)]({'pathParts':[y],'config':h}),i=this[R(0x8c)]['templateContent']({'srcPath':R(0xcd),'context':j}),this[R(0x8c)][R(0x99)]({'filePath':k,'content':'\x0a'+l});}})[P(0xc8)](v=>v!==null),r=this[P(0x8c)][P(0xc4)](k)[P(0x92)]((v,w)=>{const S=P;return v['includes'](S(0x9a))?w+0x1:null;})[P(0xc8)](v=>v!==null),s=this[P(0x8c)][P(0xc4)](k)[P(0x92)]((v,w)=>{const T=P;return v[T(0xd1)](T(0xc9))?w+0x1:null;})['filter'](v=>v!==null);r[P(0xae)]>0x0&&s[P(0xae)]>0x0&&(j[P(0x93)]=!![]);l=this[P(0x8c)][P(0xaf)]({'srcPath':'route/route.js','framework':P(0xca),'context':j,'config':c});if(r[P(0xae)]>0x0||s['length']>0x0){this['fsi'][P(0xbd)]({'filePath':k,'content':l,'lineNumber':q[0x0]});if(f&&s[P(0xae)]>0x0)s=this['fsi']['readFileLines'](k)[P(0x92)]((v,w)=>{const U=P;return v[U(0xd1)](U(0xc9))?w+0x1:null;})[P(0xc8)](v=>v!==null),this[P(0x8c)][P(0xbd)]({'filePath':k,'content':'\x09{'+j['templateName']+'}','lineNumber':s[0x0]});else r[P(0xae)]>0x0?(r=this[P(0x8c)]['readFileLines'](k)[P(0x92)]((v,w)=>{const V=P;return v[V(0xd1)](V(0x9a))?w+0x1:null;})[P(0xc8)](v=>v!==null),this[P(0x8c)]['injectAfterLineNumber']({'filePath':k,'content':'\x09{'+j[P(0x91)]+'}','lineNumber':r[0x0]})):Log[P(0xcc)](P(0xa0)+k);}else{let v=this[P(0x8c)][P(0xc4)](k)['map'](y=>{const W=P;if('sdlkG'===W(0xbf)){let A=this['fsi'][W(0xc4)](d)[W(0x92)](D=>{const X=W;return D[X(0xd1)](X(0x89));}),B=A['indexOf'](!![])>-0x1,C=B?'<Route':W(0x95);this['fsi'][W(0x94)]({'filePath':e,'content':W(0xcf)+f+W(0xcf),'begin':'<Router','end':C});}else return y[W(0xd1)]('\x22*\x22');}),w=v['indexOf'](!![])>-0x1,x=w?P(0xc6):P(0x95);this['fsi']['injectIntoFile']({'filePath':k,'content':P(0xcf)+l+'\x0a\x09\x09','begin':'<Router','end':x});}}}else{if(c[P(0x9e)][P(0xb7)]===P(0x98)){if('ZwPTg'===P(0xba)){const y=this[P(0x8c)][P(0x87)]({'pathParts':[P(0x9b),P(0xd6),'client',P(0xa6)]});k=this[P(0x8c)]['rewriteDestinationPathForEngine']({'pathParts':[y],'config':c}),l=this[P(0x8c)]['templateContent']({'srcPath':P(0xcd),'context':j}),this[P(0x8c)][P(0x99)]({'filePath':k,'content':'\x0a'+l});}else return b[P(0xd1)](P(0x89));}}}else{const B=this['fsi'][P(0x87)]({'pathParts':[P(0x9b),P(0xd6),'client',P(0xa6)]});c=this[P(0x8c)][P(0xac)]({'pathParts':[B],'config':d});}}));}else c(d);}catch(f){Log[O(0xbb)](f);}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a65c(){const F=['80QOSIDi','toString','7852662yELhgo','ETORz','findGenerator','yhcts','constructor','search','create','45VlTRFL','OPLZo','132trWeON','1031856RwWOIl','ghbFa','4yfKjNn','10YjSYBj','4830636QCaKwg','2418556pkisbd','maka\x20{generate,\x20g}:{scaffold,\x20s}\x20[path/]<name>','(((.+)+)+)+$','lRwEz','JyehO','maka\x20g:scaffold\x20todos','invoke','GeMfm','done','apply','jkpFd','next','route','value','api','error','__awaiter','230825bxiclQ','mFgiC','3628823WCfHbA','then','throw','716531IjBxmC'];a65c=function(){return F;};return a65c();}const a65y=a65d;(function(a,b){const v=a65d,c=a();while(!![]){try{const d=parseInt(v(0xb1))/0x1+parseInt(v(0xc3))/0x2+-parseInt(v(0xc2))/0x3*(-parseInt(v(0xc0))/0x4)+parseInt(v(0xbb))/0x5*(parseInt(v(0xbe))/0x6)+parseInt(v(0xac))/0x7*(parseInt(v(0xb2))/0x8)+parseInt(v(0xb4))/0x9*(-parseInt(v(0xc1))/0xa)+-parseInt(v(0xae))/0xb*(parseInt(v(0xbd))/0xc);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a65c,0xdeb56));const a65b=(function(){let a=!![];return function(b,c){const d=a?function(){const w=a65d;if(w(0xad)===w(0xc6))try{i(j['next'](k));}catch(f){m(f);}else{if(c){if(w(0xb7)!==w(0xbf)){const f=c[w(0xa4)](b,arguments);return c=null,f;}else h[w(0xa3)]?i(j[w(0xa8)]):k(l['value'])['then'](m,n);}}}:function(){};return a=![],d;};}()),a65a=a65b(this,function(){const x=a65d;return a65a[x(0xb3)]()[x(0xb9)](x(0xc5))[x(0xb3)]()[x(0xb8)](a65a)['search'](x(0xc5));});a65a();function a65d(a,b){const c=a65c();return a65d=function(d,e){d=d-0xa1;let f=c[d];return f;},a65d(a,b);}var __awaiter=this&&this[a65y(0xab)]||function(a,b,c,d){function e(f){return f instanceof c?f:new c(function(g){const z=a65d;'JyehO'===z(0xc7)?g(f):c(d);});}return new(c||(c=Promise))(function(f,g){const D=a65d;function h(k){const A=a65d;try{j(d[A(0xa6)](k));}catch(l){g(l);}}function i(k){const B=a65d;try{if(B(0xa5)==='jkpFd')j(d[B(0xb0)](k));else{const m=d['apply'](e,arguments);return f=null,m;}}catch(m){if(B(0xbc)!=='OPLZo')try{i(j[B(0xb0)](k));}catch(o){m(o);}else g(m);}}function j(k){const C=a65d;C(0xa2)!==C(0xa2)?c(d):k[C(0xa3)]?f(k[C(0xa8)]):e(k[C(0xa8)])[C(0xaf)](h,i);}j((d=d[D(0xa4)](a,b||[]))[D(0xa6)]());});};import a65u from'../generators/maka.gen.js';import{Generator}from'../generator.js';import{Log}from'../tools/log/log.class.js';Generator[a65y(0xba)]({'name':'scaffold','usage':a65y(0xc4),'description':'Generate\x20scaffolding\x20for\x20a\x20resource.','examples':[a65y(0xc8)]},function(a,b){return __awaiter(this,void 0x0,void 0x0,function*(){const E=a65d;try{if(E(0xb5)===E(0xb5)){const c=a65u[E(0xb6)](E(0xa7));c&&(yield c[E(0xa1)](a,b));const d=a65u[E(0xb6)]('page');d&&(yield d[E(0xa1)](a,b));const f=a65u[E(0xb6)](E(0xa9));f&&(yield f[E(0xa1)](a,b));}else c['error'](d);}catch(h){Log[E(0xaa)](h);}});});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a66d(a,b){const c=a66c();return a66d=function(d,e){d=d-0xb8;let f=c[d];return f;},a66d(a,b);}const a66C=a66d;(function(a,b){const A=a66d,c=a();while(!![]){try{const d=-parseInt(A(0xd2))/0x1+parseInt(A(0xfc))/0x2+parseInt(A(0xbe))/0x3*(-parseInt(A(0xc1))/0x4)+parseInt(A(0xf4))/0x5+-parseInt(A(0xed))/0x6*(-parseInt(A(0xcd))/0x7)+-parseInt(A(0xca))/0x8+-parseInt(A(0xee))/0x9*(parseInt(A(0xf8))/0xa);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a66c,0xcca53));const a66b=(function(){let a=!![];return function(b,c){const d=a?function(){if(c){const e=c['apply'](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a66a=a66b(this,function(){const B=a66d;return a66a[B(0xc8)]()[B(0xe5)](B(0xc7))[B(0xc8)]()[B(0xf7)](a66a)['search'](B(0xc7));});function a66c(){const J=['checkNpmPackage','getProjectConfig','2587850VRTvXP','logger','invoke','pathFromApp','imports','options','Service\x20Type','engines','logger-transports.','1254768UBJELf','error','/imports/startup/lib/collections/logs','16IqjwGv','apply','maka\x20{generate,\x20g}:{service}\x20<service-name>\x20--type=logger','installNpmPackage','injectAtBeginningOfFile','done','(((.+)+)+)+$','toString','Verifying\x20npm\x20package\x20requirements:\x20winston\x20...','8712368ZEnBpe','tsx','(blank)','7nCkRPg','warn','services','PrCaX','indexOf','742693IpTsOD','type','template','Generate\x20a\x20service\x20to\x20run\x20within\x20your\x20meteor\x20application.','svc','Winston\x20Logger','throw','mongo','import\x20Logs\x20from\x20\x27','value','__awaiter','installMeteorPackage','jQdSz','service/logger/transports.js','list','Invalid\x20type\x20','oudod','import\x20{\x20MongoTransport\x20}\x20from\x20\x27','startup','search','create','notice','winston','maka\x20g:s\x20Logger\x20--type=logger','rewriteDestinationPathForType','next','serviceAnswer','9792606JTbKjo','2241agSPaq','ZbfOr','service','resourceName','DYvjq','ylcXm','8140580ZfckBi','collection','fsi','constructor','8480VDQlRM','lib'];a66c=function(){return J;};return a66c();}a66a();var __awaiter=this&&this[a66C(0xdc)]||function(a,b,c,d){function e(f){return f instanceof c?f:new c(function(g){g(f);});}return new(c||(c=Promise))(function(f,g){const G=a66d;function h(k){const D=a66d;try{j(d[D(0xeb)](k));}catch(l){g(l);}}function i(k){const E=a66d;try{j(d[E(0xd8)](k));}catch(l){g(l);}}function j(k){const F=a66d;k[F(0xc6)]?f(k[F(0xdb)]):e(k[F(0xdb)])['then'](h,i);}j((d=d[G(0xc2)](a,b||[]))['next']());});};import{camelCase,paramCase,pascalCase}from'change-case';import a66u from'../generators/maka.gen.js';import{Generator}from'../generator.js';import{Log}from'../tools/log/log.class.js';import{Actions}from'../tools/actions/actions.class.js';Generator[a66C(0xe6)]({'name':a66C(0xf0),'aliases':[a66C(0xd6)],'usage':a66C(0xc3),'description':a66C(0xd5),'examples':[a66C(0xe9)]},function(a,b){return __awaiter(this,void 0x0,void 0x0,function*(){const H=a66d;try{const c=this[H(0xf6)][H(0xfb)]();this[H(0xf6)]['withValue'](c,()=>__awaiter(this,void 0x0,void 0x0,function*(){const I=H;if('Ibxfm'!==I(0xd0)){const d=this['fsi'][I(0xb8)]({}),f=paramCase(b['resourceName']),g=paramCase(b[I(0xf1)]);if(!b[I(0xd3)]){const k={'type':I(0xe0),'name':I(0xec),'message':I(0xbb),'choices':[{'name':I(0xd7),'value':'logger'}]},{serviceAnswer:l}=yield Actions[I(0xba)](k);l&&(b[I(0xd3)]=l);}const h={'name':pascalCase(b[I(0xf1)]),'fileName':f,'camelCase':camelCase(b['resourceName']),'type':b[I(0xd3)],'engine':c[I(0xbc)]['js'],'noRename':!![]};let i='js';if(c[I(0xbc)]['js']===I(0xcb)){if('XGBFh'==='XGBFh')i='ts';else{let n=d[I(0xd3)]?e[I(0xd3)]:I(0xcc);f[I(0xbf)](I(0xe1)+n+',\x20you\x20must\x20provide\x20a\x20valid\x20type\x20as\x20an\x20argument.\x20\x20Usage:');return;}}let j=[I(0xfd)];if(j[I(0xd1)](h[I(0xd3)])<0x0){let n=h[I(0xd3)]?h['type']:I(0xcc);Log[I(0xbf)](I(0xe1)+n+',\x20you\x20must\x20provide\x20a\x20valid\x20type\x20as\x20an\x20argument.\x20\x20Usage:');return;}if(b[I(0xd3)]===I(0xfd)){if('Vordu'===I(0xf3))d(e[I(0xd8)](f));else{if(!this[I(0xf6)][I(0xfa)](I(0xe8))){if(I(0xf2)!==I(0xf2)){if(e){const x=i[I(0xc2)](j,arguments);return k=null,x;}}else Log[I(0xce)](I(0xc9)),yield this[I(0xf6)][I(0xc4)]('winston\x20winston-transport\x20setimmediate',{'cwd':d});}!this[I(0xf6)]['checkMeteorPackage'](I(0xd9))&&(I(0xde)===I(0xde)?(Log[I(0xe7)]('Verifying\x20meteor\x20package\x20requirements:\x20mongo\x20...'),yield this[I(0xf6)][I(0xdd)]('mongo',{'cwd':d})):d(e['next'](f)));let p=this['fsi']['pathFromApp']({'pathParts':[I(0xb9),'startup',I(0xf9),I(0xcf),f+'.'+i]});this[I(0xf6)]['template']({'srcPath':'service/logger/logger.js','destPath':p,'context':h,'config':c});const q=a66u['findGenerator'](I(0xf5));q&&(yield q[I(0xfe)]([g],{'where':'both','appPathPrefix':'lib','dir':''}));let r=this['fsi']['rewriteDestinationPathForType']({'pathParts':[p]});const s=this['fsi']['rewriteDestinationPathForType']({'pathParts':['/imports/startup/lib/services/logger-transports']});this[I(0xf6)][I(0xc5)]({'filePath':r,'content':I(0xe3)+s+'\x27;'});let t=this['fsi'][I(0xb8)]({'pathParts':[I(0xb9),I(0xe4),I(0xf9),I(0xcf),I(0xbd)+i]});this['fsi'][I(0xd4)]({'srcPath':I(0xdf),'destPath':t,'context':h,'config':c});let u=this[I(0xf6)][I(0xea)]({'pathParts':[t]});const v=this[I(0xf6)]['rewriteDestinationPathForType']({'pathParts':[I(0xc0)]});this['fsi'][I(0xc5)]({'filePath':u,'content':I(0xda)+v+'\x27;'});}}}else try{i(j['next'](k));}catch(z){m(z);}}));}catch(d){H(0xe2)!==H(0xef)?Log[H(0xbf)](d):c(d);}});});
|
package/dist/maka.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node --experimental-modules --no-warnings --experimental-json-modules
|
|
2
|
+
const a67C=a67d;(function(a,b){const z=a67d,c=a();while(!![]){try{const d=parseInt(z(0x116))/0x1*(-parseInt(z(0xfe))/0x2)+parseInt(z(0x10c))/0x3*(-parseInt(z(0x10d))/0x4)+parseInt(z(0x106))/0x5*(parseInt(z(0x100))/0x6)+parseInt(z(0x10f))/0x7*(parseInt(z(0x108))/0x8)+-parseInt(z(0x113))/0x9+-parseInt(z(0x10b))/0xa+parseInt(z(0x102))/0xb;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a67c,0xa73f4));const a67b=(function(){let a=!![];return function(b,c){const d=a?function(){const A=a67d;if(c){const e=c[A(0x101)](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a67a=a67b(this,function(){const B=a67d;return a67a[B(0x110)]()[B(0x117)](B(0x10a))[B(0x110)]()[B(0xff)](a67a)['search']('(((.+)+)+)+$');});a67a();import a67u from'minimist';import a67v from'os';import a67w from'path';import a67x from'humps';import a67y from'./commands/maka.cmd.js';import'./commands/_index.js';import'./generators/_index.js';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta[a67C(0x105)]),__dirname=a67w[a67C(0x111)](__filename);global[a67C(0x114)]=__dirname;let total_memory=a67v[a67C(0x107)](),total_mem_in_kb=total_memory/0x400,total_mem_in_mb=total_mem_in_kb/0x400;function a67d(a,b){const c=a67c();return a67d=function(d,e){d=d-0xfc;let f=c[d];return f;},a67d(a,b);}total_mem_in_mb=Math[a67C(0xfd)](total_mem_in_mb),process[a67C(0x112)][a67C(0xfc)]=a67C(0x115)+total_mem_in_mb;const argv=a67u(process[a67C(0x109)]['slice'](0x2)),args=argv['_'],deepCopyArgv=JSON[a67C(0x104)](JSON['stringify'](argv));function a67c(){const D=['url','10BcIUrI','totalmem','128AzdUsv','argv','(((.+)+)+)+$','8591560iUuspp','15RPllPh','313364udImhr','camelizeKeys','494746jnKzSU','toString','dirname','env','3771990xvaRNA','MAKA_COMMAND_PATH','--max-old-space-size=','601403pwYYQK','search','TOOL_NODE_FLAGS','floor','2JWGfZZ','constructor','3717126QkGoaR','apply','6451808PlmzaU','run','parse'];a67c=function(){return D;};return a67c();}delete deepCopyArgv['_'];const opts=a67x[a67C(0x10e)](deepCopyArgv);a67y[a67C(0x103)](args,opts);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meteor } from 'meteor/meteor';
|
|
2
|
+
<% if (api === 'rest') { %>import { Restivus } from 'meteor/maka:rest';<% } else { %>import { Restivus } from 'meteor/nimble:restivus';<% } %>
|
|
3
|
+
import <%= name %> from '/imports/startup/server/collections/<%= fileName %>';
|
|
4
|
+
|
|
5
|
+
const <%= name %>ApiV1 = new Restivus({
|
|
6
|
+
version: 'v1',
|
|
7
|
+
useDefaultAuth: false,
|
|
8
|
+
prettyJson: Meteor.isDevelopment
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
<%= name %>ApiV1.addCollection(<%= name %>);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meteor } from 'meteor/meteor';
|
|
2
|
+
<% if (api === 'rest') { %>import { Restivus } from 'meteor/maka:rest';<% } else { %>import { Restivus } from 'meteor/nimble:restivus';<% } %>
|
|
3
|
+
import <%= name %> from '/imports/startup/server/collections/<%= fileName %>';
|
|
4
|
+
|
|
5
|
+
const <%= name %>ApiV1 = new Restivus({
|
|
6
|
+
version: 'v1',
|
|
7
|
+
useDefaultAuth: false,
|
|
8
|
+
prettyJson: Meteor.isDevelopment
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
<%= name %>ApiV1.addCollection(<%= name %>);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Mongo } from 'meteor/mongo';
|
|
2
|
+
import { check, Match } from 'meteor/maka:check';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @memberof Server.<%= name %>
|
|
6
|
+
* @extends Mongo.Collection
|
|
7
|
+
*/
|
|
8
|
+
class <%= name %>Collection extends Mongo.Collection {
|
|
9
|
+
constructor() {
|
|
10
|
+
super('<%= name %>');
|
|
11
|
+
|
|
12
|
+
this.publicFields = {};
|
|
13
|
+
this.privateFields = {};
|
|
14
|
+
this.allow({
|
|
15
|
+
insert() { return false; },
|
|
16
|
+
update() { return false; },
|
|
17
|
+
remove() { return false; },
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
this.insertSchema = {};
|
|
21
|
+
this.updateSchema = {}; // Note: You'll likely want all properties to be Match.Optional()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
find(selector = {}, modifier) {
|
|
25
|
+
return super.find(selector, modifier);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
findOne(selector = {}, modifier) {
|
|
29
|
+
return super.findOne(selector, modifier);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @public
|
|
34
|
+
* @param { object } doc The document to inserted.
|
|
35
|
+
* @param { object } callback The callback from invocation.
|
|
36
|
+
* @returns { string } The _id of the new doc.
|
|
37
|
+
*/
|
|
38
|
+
insert(doc) {
|
|
39
|
+
if (this._hasSchema()) {
|
|
40
|
+
check(doc, this.insertSchema, 'while validating mongo insert against schema');
|
|
41
|
+
}
|
|
42
|
+
return super.insert(doc);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @public
|
|
47
|
+
* @param { object | string } selector The mongodb selector.
|
|
48
|
+
* @param { object } modifier The mongodb modifier.
|
|
49
|
+
* @returns { string } The _id of the document updated.
|
|
50
|
+
* */
|
|
51
|
+
update(selector, modifier) {
|
|
52
|
+
if (this._hasSchema()) {
|
|
53
|
+
check(modifier.$set, this.updateSchema, 'while validating mongo update against schema');
|
|
54
|
+
}
|
|
55
|
+
return super.update(selector, modifier);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @public
|
|
60
|
+
* @param { object | string } selector The mongodb selector.
|
|
61
|
+
* @returns { string } The _id of the document being removed.
|
|
62
|
+
*/
|
|
63
|
+
remove(selector) {
|
|
64
|
+
return super.remove(selector);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Helper method
|
|
68
|
+
_hasSchema = () => {
|
|
69
|
+
const { insertSchema, updateSchema } = this;
|
|
70
|
+
if (insertSchema) {
|
|
71
|
+
return (Object.keys(insertSchema).length !== 0
|
|
72
|
+
&& insertSchema.constructor === Object);
|
|
73
|
+
}
|
|
74
|
+
if (updateSchema) {
|
|
75
|
+
return (Object.keys(updateSchema).length !== 0
|
|
76
|
+
&& updateSchema.constructor === Object);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @memberof Server.<%= name %>
|
|
83
|
+
* @member <%= name %>
|
|
84
|
+
*/
|
|
85
|
+
const <%= name %> = new <%= name %>Collection();
|
|
86
|
+
export default <%= name %>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Mongo } from 'meteor/mongo';
|
|
2
|
+
import { check, Match } from 'meteor/maka:check';
|
|
3
|
+
|
|
4
|
+
interface <%=name%>Collection {
|
|
5
|
+
publicFields: any;
|
|
6
|
+
privateFields: any;
|
|
7
|
+
deny: any,
|
|
8
|
+
schema: any;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @memberof Server.<%= name %>
|
|
13
|
+
* @extends Mongo.Collection
|
|
14
|
+
*/
|
|
15
|
+
class <%= name %>Collection extends Mongo.Collection<<%=name%>Collection> {
|
|
16
|
+
constructor() {
|
|
17
|
+
super('<%= name %>');
|
|
18
|
+
|
|
19
|
+
this.publicFields = {};
|
|
20
|
+
this.privateFields = {};
|
|
21
|
+
this.allow({
|
|
22
|
+
insert() { return false; },
|
|
23
|
+
update() { return false; },
|
|
24
|
+
remove() { return false; },
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
this.insertSchema = {};
|
|
28
|
+
this.updateSchema = {}; // Note: You'll likely want all properties to be Match.Optional()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
find(selector:any = {}, modifier:object) {
|
|
32
|
+
return super.find(selector, modifier);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
findOne(selector:any = {}, modifier:object) {
|
|
36
|
+
return super.findOne(selector, modifier);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
* @param { object } doc The document to inserted.
|
|
42
|
+
* @param { object } callback The callback from invocation.
|
|
43
|
+
* @returns { string } The _id of the new doc.
|
|
44
|
+
*/
|
|
45
|
+
insert(doc:any) {
|
|
46
|
+
if (this._hasSchema()) {
|
|
47
|
+
check(doc, this.insertSchema, 'while validating mongo insert against schema');
|
|
48
|
+
}
|
|
49
|
+
return super.insert(doc);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @public
|
|
54
|
+
* @param { object | string } selector The mongodb selector.
|
|
55
|
+
* @param { object } modifier The mongodb modifier.
|
|
56
|
+
* @returns { string } The _id of the document updated.
|
|
57
|
+
* */
|
|
58
|
+
update(selector:any, modifier:UpdateModifier) {
|
|
59
|
+
if (this._hasSchema()) {
|
|
60
|
+
check(modifier.$set, this.updateSchema, 'while validating mongo update against schema');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return super.update(selector, modifier);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @public
|
|
68
|
+
* @param { object | string } selector The mongodb selector.
|
|
69
|
+
* @returns { string } The _id of the document being removed.
|
|
70
|
+
*/
|
|
71
|
+
remove(selector:any) {
|
|
72
|
+
return super.remove(selector);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Helper method
|
|
76
|
+
_hasSchema = () => {
|
|
77
|
+
const { insertSchema, updateSchema } = this;
|
|
78
|
+
if (insertSchema) {
|
|
79
|
+
return (Object.keys(insertSchema).length !== 0
|
|
80
|
+
&& insertSchema.constructor === Object);
|
|
81
|
+
}
|
|
82
|
+
if (updateSchema) {
|
|
83
|
+
return (Object.keys(updateSchema).length !== 0
|
|
84
|
+
&& updateSchema.constructor === Object);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @memberof Server.<%= name %>
|
|
91
|
+
* @member <%= name %>
|
|
92
|
+
*/
|
|
93
|
+
const <%= name %> = new <%= name %>Collection();
|
|
94
|
+
export default <%= name %>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Meteor } from 'meteor/meteor';
|
|
2
|
+
import <%= name %> from '/imports/startup/server/collections/<%= fileName %>';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* If the <%= name %> collection is empty on server start, and you'd like to
|
|
6
|
+
* populate it with some data here is a handy spot.
|
|
7
|
+
*
|
|
8
|
+
* Example:
|
|
9
|
+
* ```
|
|
10
|
+
* if (<%= name %>.find({}).count() === 0) {
|
|
11
|
+
* const data = JSON.parse(Assets.getText('<%= fileName %>.json')) || [ {} ];
|
|
12
|
+
* data.forEach((datum) => {
|
|
13
|
+
* <%= name %>.insert(datum);
|
|
14
|
+
* });
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* ```
|
|
18
|
+
* @memberof Server.<%= name %>
|
|
19
|
+
* @member Fixtures
|
|
20
|
+
*/
|
|
21
|
+
Meteor.startup(() => {
|
|
22
|
+
|
|
23
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Meteor } from 'meteor/meteor';
|
|
2
|
+
import <%= name %> from '/imports/startup/server/collections/<%= fileName %>';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* If the <%= name %> collection is empty on server start, and you'd like to
|
|
6
|
+
* populate it with some data here is a handy spot.
|
|
7
|
+
*
|
|
8
|
+
* Example:
|
|
9
|
+
* ```
|
|
10
|
+
* if (<%= name %>.find({}).count() === 0) {
|
|
11
|
+
* const data = JSON.parse(Assets.getText('<%= fileName %>.json')) || [ {} ];
|
|
12
|
+
* data.forEach((datum) => {
|
|
13
|
+
* <%= name %>.insert(datum);
|
|
14
|
+
* });
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* ```
|
|
18
|
+
* @memberof Server.<%= name %>
|
|
19
|
+
* @member Fixtures
|
|
20
|
+
*/
|
|
21
|
+
Meteor.startup(() => {
|
|
22
|
+
|
|
23
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Meteor } from 'meteor/meteor';
|
|
2
|
+
import { ValidatedMethod } from 'meteor/mdg:validated-method';
|
|
3
|
+
import { DDPRateLimiter } from 'meteor/ddp-rate-limiter';
|
|
4
|
+
import { check, Match } from 'meteor/maka:check';
|
|
5
|
+
|
|
6
|
+
import <%= name %> from '/imports/startup/server/collections/<%= fileName %>';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Using ValidatedMethod (maintained by MDG) is the best
|
|
10
|
+
* practice by Meteor Development Group (MDG),
|
|
11
|
+
* and as such is used here to validate that method
|
|
12
|
+
* calls from the client are properly handled.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Client side insert method.
|
|
18
|
+
*
|
|
19
|
+
* @memberof Server.<%= name %>
|
|
20
|
+
* @method
|
|
21
|
+
* @property { string } name String that defines the method.
|
|
22
|
+
* @property { function } validate Is run before the main execution.
|
|
23
|
+
* @property { function } run The main action that is executed.
|
|
24
|
+
*/
|
|
25
|
+
const insert<%= name %> = new ValidatedMethod({
|
|
26
|
+
name: '<%= fileName %>.insert',
|
|
27
|
+
validate(doc) {
|
|
28
|
+
check(doc, Object, 'while checking insert doc');
|
|
29
|
+
//check(this.userId, String, 'while validating user');
|
|
30
|
+
},
|
|
31
|
+
run(doc) {
|
|
32
|
+
//return <%= name %>.insert(doc);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Client side find method.
|
|
38
|
+
*
|
|
39
|
+
* @memberof Server.<%= name %>
|
|
40
|
+
* @method
|
|
41
|
+
* @property { string } name String that defines the method.
|
|
42
|
+
* @property { function } validate Is run before the main execution.
|
|
43
|
+
* @property { function } run The main action that is executed.
|
|
44
|
+
*/
|
|
45
|
+
const find<%= name %> = new ValidatedMethod({
|
|
46
|
+
name: '<%= fileName %>.find',
|
|
47
|
+
validate(doc = {}) {
|
|
48
|
+
check(doc, Match.OneOf(String, Object), 'while checking find selector');
|
|
49
|
+
//check(this.userId, String, 'while validating user');
|
|
50
|
+
},
|
|
51
|
+
run(doc = {}) {
|
|
52
|
+
//return <%= name %>.find(doc).fetch();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Client side findOne method.
|
|
58
|
+
*
|
|
59
|
+
* @memberof Server.<%= name %>
|
|
60
|
+
* @method
|
|
61
|
+
* @property { string } name String that defines the method.
|
|
62
|
+
* @property { function } validate Is run before the main execution.
|
|
63
|
+
* @property { function } run The main action that is executed.
|
|
64
|
+
*/
|
|
65
|
+
const findOne<%= name %> = new ValidatedMethod({
|
|
66
|
+
name: '<%= fileName %>.findOne',
|
|
67
|
+
validate(doc = {}) {
|
|
68
|
+
check(doc, Match.OneOf(String, Object), 'while checking findOne selector');
|
|
69
|
+
//check(this.userId, String, 'while validating user');
|
|
70
|
+
},
|
|
71
|
+
run(doc = {}) {
|
|
72
|
+
//return <%= name %>.findOne(doc);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Client side update method.
|
|
79
|
+
*
|
|
80
|
+
* @memberof Server.<%= name %>
|
|
81
|
+
* @method
|
|
82
|
+
* @property { string } name String that defines the method.
|
|
83
|
+
* @property { function } validate Is run before the main execution.
|
|
84
|
+
* @property { function } run The main action that is executed.
|
|
85
|
+
*/
|
|
86
|
+
const update<%= name %> = new ValidatedMethod({
|
|
87
|
+
name: '<%= fileName %>.update',
|
|
88
|
+
validate({_id, set}) {
|
|
89
|
+
if (typeof _id !== 'string' && typeof set !== 'object') throw 'Usage Error: Expecting signature { _id: <string>, set: <object> }';
|
|
90
|
+
check(_id, String, 'while checking _id selector');
|
|
91
|
+
check(set, Object, 'while checking update set object');
|
|
92
|
+
//check(this.userId, String, 'while validating user');
|
|
93
|
+
},
|
|
94
|
+
run({_id, set}) {
|
|
95
|
+
//return <%= name %>.update(_id, {$set: set});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Client side remove method.
|
|
101
|
+
*
|
|
102
|
+
* @memberof Server.<%= name %>
|
|
103
|
+
* @method
|
|
104
|
+
* @property { string } name String that defines the method.
|
|
105
|
+
* @property { function } validate Is run before the main execution.
|
|
106
|
+
* @property { function } run The main action that is executed.
|
|
107
|
+
*/
|
|
108
|
+
const remove<%= name %> = new ValidatedMethod({
|
|
109
|
+
name: '<%= fileName %>.remove',
|
|
110
|
+
validate(_id) {
|
|
111
|
+
// NOTE: May want to use object removal, but dangerous!!!
|
|
112
|
+
check(_id, String, 'while checking remove _id selector');
|
|
113
|
+
//check(this.userId, String, 'while validating user');
|
|
114
|
+
},
|
|
115
|
+
run(_id) {
|
|
116
|
+
//return <%= name %>.remove(_id);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const RATE_LIMITED_METHODS = [
|
|
121
|
+
insert<%= name %> , find<%= name %>, findOne<%= name %>, update<%= name %> , remove<%= name %>
|
|
122
|
+
].map(value => value['name']);
|
|
123
|
+
|
|
124
|
+
if (Meteor.isServer) {
|
|
125
|
+
const OPERATIONS = 5;
|
|
126
|
+
const PER_SECOND = 1 * 1000; // milliseconds
|
|
127
|
+
// Only allow 5 list operations per connection per second.
|
|
128
|
+
DDPRateLimiter.addRule({
|
|
129
|
+
name(name) {
|
|
130
|
+
return RATE_LIMITED_METHODS.includes(name);
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
// Rate limit per connection ID.
|
|
134
|
+
connectionId() { return true; },
|
|
135
|
+
}, OPERATIONS, PER_SECOND);
|
|
136
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Meteor } from 'meteor/meteor';
|
|
2
|
+
import { ValidatedMethod } from 'meteor/mdg:validated-method';
|
|
3
|
+
import { DDPRateLimiter } from 'meteor/ddp-rate-limiter';
|
|
4
|
+
import { check, Match } from 'meteor/maka:check';
|
|
5
|
+
|
|
6
|
+
import <%= name %> from '/imports/startup/server/collections/<%= fileName %>';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Using ValidatedMethod (maintained by MDG) is the best
|
|
10
|
+
* practice by Meteor Development Group (MDG),
|
|
11
|
+
* and as such is used here to validate that method
|
|
12
|
+
* calls from the client are properly handled.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Client side insert method.
|
|
18
|
+
*
|
|
19
|
+
* @memberof Server.<%= name %>
|
|
20
|
+
* @method
|
|
21
|
+
* @property { string } name String that defines the method.
|
|
22
|
+
* @property { function } validate Is run before the main execution.
|
|
23
|
+
* @property { function } run The main action that is executed.
|
|
24
|
+
*/
|
|
25
|
+
const insert<%= name %> = new ValidatedMethod({
|
|
26
|
+
name: '<%= fileName %>.insert',
|
|
27
|
+
validate(doc) {
|
|
28
|
+
check(doc, Object, 'while checking insert doc');
|
|
29
|
+
//check(this.userId, String, 'while validating user');
|
|
30
|
+
},
|
|
31
|
+
run(doc) {
|
|
32
|
+
//return <%= name %>.insert(doc);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Client side find method.
|
|
38
|
+
*
|
|
39
|
+
* @memberof Server.<%= name %>
|
|
40
|
+
* @method
|
|
41
|
+
* @property { string } name String that defines the method.
|
|
42
|
+
* @property { function } validate Is run before the main execution.
|
|
43
|
+
* @property { function } run The main action that is executed.
|
|
44
|
+
*/
|
|
45
|
+
const find<%= name %> = new ValidatedMethod({
|
|
46
|
+
name: '<%= fileName %>.find',
|
|
47
|
+
validate(doc = {}) {
|
|
48
|
+
check(doc, Match.OneOf(String, Object), 'while checking find selector');
|
|
49
|
+
//check(this.userId, String, 'while validating user');
|
|
50
|
+
},
|
|
51
|
+
run(doc = {}) {
|
|
52
|
+
//return <%= name %>.find(doc).fetch();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Client side findOne method.
|
|
58
|
+
*
|
|
59
|
+
* @memberof Server.<%= name %>
|
|
60
|
+
* @method
|
|
61
|
+
* @property { string } name String that defines the method.
|
|
62
|
+
* @property { function } validate Is run before the main execution.
|
|
63
|
+
* @property { function } run The main action that is executed.
|
|
64
|
+
*/
|
|
65
|
+
const findOne<%= name %> = new ValidatedMethod({
|
|
66
|
+
name: '<%= fileName %>.findOne',
|
|
67
|
+
validate(doc = {}) {
|
|
68
|
+
check(doc, Match.OneOf(String, Object), 'while checking findOne selector');
|
|
69
|
+
//check(this.userId, String, 'while validating user');
|
|
70
|
+
},
|
|
71
|
+
run(doc = {}) {
|
|
72
|
+
//return <%= name %>.findOne(doc);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Client side update method.
|
|
79
|
+
*
|
|
80
|
+
* @memberof Server.<%= name %>
|
|
81
|
+
* @method
|
|
82
|
+
* @property { string } name String that defines the method.
|
|
83
|
+
* @property { function } validate Is run before the main execution.
|
|
84
|
+
* @property { function } run The main action that is executed.
|
|
85
|
+
*/
|
|
86
|
+
const update<%= name %> = new ValidatedMethod({
|
|
87
|
+
name: '<%= fileName %>.update',
|
|
88
|
+
validate({_id, set}) {
|
|
89
|
+
if (typeof _id !== 'string' && typeof set !== 'object') throw 'Usage Error: Expecting signature { _id: <string>, set: <object> }';
|
|
90
|
+
check(_id, String, 'while checking _id selector');
|
|
91
|
+
check(set, Object, 'while checking update set object');
|
|
92
|
+
//check(this.userId, String, 'while validating user');
|
|
93
|
+
},
|
|
94
|
+
run({_id, set}) {
|
|
95
|
+
//return <%= name %>.update(_id, {$set: set});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Client side remove method.
|
|
101
|
+
*
|
|
102
|
+
* @memberof Server.<%= name %>
|
|
103
|
+
* @method
|
|
104
|
+
* @property { string } name String that defines the method.
|
|
105
|
+
* @property { function } validate Is run before the main execution.
|
|
106
|
+
* @property { function } run The main action that is executed.
|
|
107
|
+
*/
|
|
108
|
+
const remove<%= name %> = new ValidatedMethod({
|
|
109
|
+
name: '<%= fileName %>.remove',
|
|
110
|
+
validate(_id) {
|
|
111
|
+
// NOTE: May want to use object removal, but dangerous!!!
|
|
112
|
+
check(_id, String, 'while checking remove _id selector');
|
|
113
|
+
//check(this.userId, String, 'while validating user');
|
|
114
|
+
},
|
|
115
|
+
run(_id) {
|
|
116
|
+
//return <%= name %>.remove(_id);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const RATE_LIMITED_METHODS = [
|
|
121
|
+
insert<%= name %> , find<%= name %>, findOne<%= name %>, update<%= name %> , remove<%= name %>
|
|
122
|
+
].map(value => value['name']);
|
|
123
|
+
|
|
124
|
+
if (Meteor.isServer) {
|
|
125
|
+
const OPERATIONS = 5;
|
|
126
|
+
const PER_SECOND = 1 * 1000; // milliseconds
|
|
127
|
+
// Only allow 5 list operations per connection per second.
|
|
128
|
+
DDPRateLimiter.addRule({
|
|
129
|
+
name(name) {
|
|
130
|
+
return RATE_LIMITED_METHODS.includes(name);
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
// Rate limit per connection ID.
|
|
134
|
+
connectionId() { return true; },
|
|
135
|
+
}, OPERATIONS, PER_SECOND);
|
|
136
|
+
}
|
|
137
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Meteor } from 'meteor/meteor';
|
|
2
|
+
import <%= name %> from '/imports/startup/server/collections/<%= fileName %>';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Collection publications to the client. Publications must
|
|
6
|
+
* return a cursor object.
|
|
7
|
+
*
|
|
8
|
+
* @memberof Server.<%= name %>
|
|
9
|
+
* @member Publications
|
|
10
|
+
*/
|
|
11
|
+
Meteor.publish('<%= fileName %>.public', function <%= camelCase %>Public() {
|
|
12
|
+
const cursor = <%= name %>.find({}, {
|
|
13
|
+
fields: <%= name %>.publicFields,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
return cursor;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
Meteor.publish('<%= fileName %>.private', function <%= camelCase %>Private() {
|
|
20
|
+
if (!this.userId) {
|
|
21
|
+
return this.ready();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const cursor = <%= name %>.find({
|
|
25
|
+
userId: this.userId,
|
|
26
|
+
}, {
|
|
27
|
+
fields: <%= name %>.privateFields,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return cursor;
|
|
31
|
+
});
|