@maka/maka-cli 3.3.67 → 4.0.72
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/game.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/maka-maka-telnet-2.0.2.tgz +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-0x9e;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(0xc4))/0x1*(-parseInt(J(0xbf))/0x2)+-parseInt(J(0xd1))/0x3*(parseInt(J(0xa7))/0x4)+-parseInt(J(0xc3))/0x5+parseInt(J(0xc9))/0x6*(parseInt(J(0xba))/0x7)+parseInt(J(0xad))/0x8+parseInt(J(0xf4))/0x9+-parseInt(J(0xc0))/0xa*(-parseInt(J(0xd5))/0xb);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a62c,0x54017));const a62b=(function(){let a=!![];return function(b,c){const K=a62d;if(K(0xb1)!==K(0xb5)){const d=a?function(){const L=K;if('daURj'!==L(0xc7)){if(c){const e=c[L(0xa9)](b,arguments);return c=null,e;}}else this[L(0xbd)]['injectAtBeginningOfFile']({'filePath':e,'content':L(0xec)+f['className']+'\x20}\x20from\x20\x27'+g+'.'+h['engines']['js']+L(0xe5)});}:function(){};return a=![],d;}else c[K(0xf9)]('Updating\x20npm\x20packages\x20...'),this[K(0xbd)][K(0xd3)](K(0xf7),{'cwd':d});};}()),a62a=a62b(this,function(){const M=a62d;return a62a[M(0xea)]()[M(0xe7)](M(0xe8))['toString']()['constructor'](a62a)[M(0xe7)](M(0xe8));});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['create']({'name':a62N(0xc2),'aliases':aliases,'usage':a62N(0xca),'description':a62N(0xbb),'examples':[a62N(0xe2)]},function(a,b){const O=a62N;let c=O(0xf0);const d=this[O(0xbd)]['pathFromApp'](b),e=this[O(0xbd)][O(0xa3)]({'pathParts':[c,b['dir'],paramCase(b['resourceName']),paramCase(b[O(0xb2)])]}),f=this['fsi'][O(0xd8)]();this['fsi'][O(0xb8)](f,()=>{const P=O;if(P(0xbc)!==P(0xd6)){var g;typeof f['template'][P(0xf6)]===P(0xa6)&&(f[P(0xde)][P(0xf6)]=f['template'][P(0xf6)]==='true'?!![]:![],this['fsi'][P(0x9f)](P(0xf6),f[P(0xde)]['html']));if(typeof f['template'][P(0xb0)]===P(0xa6)){if(P(0xdc)===P(0xb7)){const m=d[P(0xa9)](e,arguments);return f=null,m;}else f[P(0xde)][P(0xb0)]=f['template'][P(0xb0)]===P(0xb9)?!![]:![],this[P(0xbd)][P(0x9f)](P(0xb0),f[P(0xde)][P(0xb0)]);}typeof f[P(0xde)][P(0xb4)]===P(0xa6)&&(f['template']['css']=f['template'][P(0xb4)]===P(0xb9)?!![]:![],this[P(0xbd)][P(0x9f)](P(0xb4),f[P(0xde)][P(0xb4)]));if(typeof f[P(0xde)]['js']===P(0xa6)){if(P(0xa2)!=='nYaGW'){const n=g?function(){const Q=P;if(n){const u=q[Q(0xa9)](r,arguments);return s=null,u;}}:function(){};return l=![],n;}else f[P(0xde)]['js']=f[P(0xde)]['js']===P(0xb9)?!![]:![],this['fsi'][P(0x9f)]('js',f[P(0xde)]['js']);}!f[P(0xcc)]&&(P(0xce)===P(0xd0)?(d[P(0xde)]['js']=e[P(0xde)]['js']===P(0xb9)?!![]:![],this[P(0xbd)]['setTemplate']('js',f[P(0xde)]['js'])):f[P(0xcc)]={});!b[P(0xac)]&&!this[P(0xbd)]['checkNpmPackage'](P(0xf7))&&(P(0xd9)!==P(0xd9)?b[P(0xcc)]={}:(Log['warn']('Updating\x20npm\x20packages\x20...'),this['fsi'][P(0xd3)](P(0xf7),{'cwd':d})));const h={'name':pascalCase(b[P(0xb2)]),'myPath':a62I[P(0xcd)](this[P(0xbd)][P(0xd7)]({}),e),'cssCaseName':paramCase(b[P(0xb2)]),'className':pascalCase(b[P(0xb2)]),'camelCaseName':camelCase(b[P(0xb2)]),'fileName':paramCase(b['resourceName']),'graphql':f['engines'][P(0xdb)],'features':f[P(0xcc)],'client':f[P(0xab)][P(0xae)],'api':f['engines'][P(0xf3)],'ssr':f[P(0xab)][P(0x9e)],'isStore':b['hasOwnProperty'](P(0xa1)),'isComponent':b['hasOwnProperty'](P(0xbe)),'isLayout':b[P(0xda)](P(0xf1)),'test':f['engines'][P(0xb0)],'theme':f[P(0xab)][P(0xa8)]};f[P(0xde)][P(0xf6)]&&this[P(0xbd)][P(0xde)]({'srcPath':'template/template.html','destPath':e+'.html','context':h,'config':f});if(((g=f[P(0xcc)])===null||g===void 0x0?void 0x0:g['withHooks'])||b[P(0xee)])'olwNy'!==P(0xa0)?this[P(0xbd)][P(0xde)]({'srcPath':'hook/hook.js','destPath':e+'.js','framework':P(0xc8),'context':h,'config':f}):this[P(0xbd)][P(0xe3)]({'filePath':e+'.'+f[P(0xab)]['js'],'content':P(0xaa)+g[P(0xf8)]+'.'+h[P(0xab)]['html']+'\x27;'});else{if('hnOlL'!=='FlJBW')this[P(0xbd)][P(0xde)]({'srcPath':P(0xb3),'destPath':e+'.js','framework':P(0xc8),'context':h,'config':f});else{const r=this[P(0xbd)]['pathFromApp']({'pathParts':[P(0xdd),P(0xd2),P(0xae),'templates.js']});c=this[P(0xbd)][P(0xe1)]({'pathParts':[r],'config':d});}}f['engines']['test']!=='none'&&(P(0xfa)===P(0xe9)?this[P(0xbd)][P(0xe3)]({'filePath':e+'.'+f['engines']['js'],'content':P(0xaa)+g[P(0xf8)]+'.'+h['engines'][P(0xb4)]+'\x27;'}):this[P(0xbd)][P(0xde)]({'srcPath':P(0xeb),'destPath':e+P(0xb6),'framework':P(0xc8),'context':h,'config':f}));f[P(0xde)][P(0xb4)]&&(P(0xc5)!=='ySwxk'?this[P(0xbd)][P(0xde)]({'srcPath':P(0xc1),'destPath':e+P(0xcf),'context':Object[P(0xef)]({},h,{'className':paramCase(b[P(0xb2)])}),'config':f}):this[P(0xbd)][P(0xe3)]({'filePath':g+'.'+h[P(0xab)]['js'],'content':P(0xaa)+i['fileName']+'.'+j[P(0xab)]['html']+P(0xe5)+'import\x20\x27./'+k['fileName']+'.'+l[P(0xab)][P(0xb4)]+'\x27;'}));if(f[P(0xab)][P(0xae)]!==P(0xc8)&&f[P(0xab)]['client']!==P(0xdf)){if(P(0xa5)==='kaYks')f['template'][P(0xb4)]&&this[P(0xbd)][P(0xe3)]({'filePath':e+'.'+f[P(0xab)]['js'],'content':P(0xaa)+h[P(0xf8)]+'.'+f['engines'][P(0xf6)]+'\x27;\x0a'+'import\x20\x27./'+h[P(0xf8)]+'.'+f[P(0xab)][P(0xb4)]+'\x27;'}),!f[P(0xde)][P(0xb4)]&&this[P(0xbd)][P(0xe3)]({'filePath':e+'.'+f[P(0xab)]['js'],'content':'import\x20\x27./'+h[P(0xf8)]+'.'+f[P(0xab)]['html']+'\x27;'});else{if(e){const u=i[P(0xa9)](j,arguments);return k=null,u;}}}else f[P(0xde)][P(0xb4)]&&this[P(0xbd)][P(0xe3)]({'filePath':e+'.'+f['engines']['js'],'content':'import\x20\x27./'+h[P(0xf8)]+'.'+f[P(0xab)]['css']+'\x27;'});const i=b[P(0xe4)]?'/'+b[P(0xe4)]+'/':'/',j=''+c+i+h[P(0xf8)]+'/'+h[P(0xf8)];let k;if(f[P(0xab)]['ssr']===P(0xb9)){if('dWUGO'!==P(0xaf)){const u=this['fsi']['pathFromApp']({'pathParts':[P(0xdd),P(0xd2),'lib',P(0xed)]});k=this['fsi'][P(0xe1)]({'pathParts':[u],'config':f});}else this[P(0xbd)][P(0xe3)]({'filePath':d,'content':P(0xec)+e['className']+P(0xe6)+f+P(0xe5)});}else{const w=this[P(0xbd)][P(0xa3)]({'pathParts':[P(0xdd),P(0xd2),P(0xae),P(0xed)]});k=this['fsi'][P(0xe1)]({'pathParts':[w],'config':f});}f[P(0xab)][P(0xae)]===P(0xc8)?P(0xe0)!==P(0xe0)?this['fsi'][P(0xde)]({'srcPath':P(0xeb),'destPath':d+P(0xb6),'framework':P(0xc8),'context':e,'config':f}):(f[P(0xab)]['js']==='tsx'?P(0xf5)!==P(0xcb)?this['fsi'][P(0xe3)]({'filePath':k,'content':P(0xec)+h[P(0xd4)]+P(0xe6)+j+P(0xe5)}):f[P(0xde)][P(0xb4)]&&this['fsi']['injectAtBeginningOfFile']({'filePath':k+'.'+l[P(0xab)]['js'],'content':'import\x20\x27./'+m[P(0xf8)]+'.'+n[P(0xab)][P(0xb4)]+'\x27;'}):this['fsi']['injectAtBeginningOfFile']({'filePath':k,'content':P(0xec)+h['className']+P(0xe6)+j+'.'+f['engines']['js']+P(0xe5)}),this[P(0xbd)]['injectAtEndOfFile']({'filePath':k,'content':'export\x20{\x20'+h[P(0xd4)]+P(0xa4)})):this[P(0xbd)][P(0xf2)]({'filePath':k,'content':P(0xc6)+j+'.'+f[P(0xab)]['js']+'\x27;\x0a'});}else d[P(0xde)]['test']=e[P(0xde)][P(0xb0)]===P(0xb9)?!![]:![],this['fsi']['setTemplate'](P(0xb0),f[P(0xde)][P(0xb0)]);});});function a62c(){const R=['template/template.css','page','2267090rSBVsV','31zlPHXe','FFcwn','import\x20\x27','Ewvfn','react','97710dIABLZ','maka\x20{generate,\x20g}:{page,\x20p}\x20[path/]<name>','LyCRH','features','relative','FtKGY','.css','TagRX','36483MSCrBU','startup','installNpmPackage','className','366861OwMcNy','djxbt','pathFromProject','getProjectConfig','llTGP','hasOwnProperty','graphql','BRkyU','imports','template','vanilla','yTjCh','rewriteDestinationPathForEngine','maka\x20g:page\x20todos/todos-item','injectAtBeginningOfFile','dir','\x27;\x0a','\x20}\x20from\x20\x27','search','(((.+)+)+)+$','fZkue','toString','test/test.js','import\x20{\x20','templates.js','withHook','assign','/imports/ui/pages','layout','injectAtEndOfFile','api','4700799dOcxtp','rFbgX','html','ramda','fileName','warn','dMkjK','ssr','setTemplate','acVeO','store','nYaGW','pathFromApp','\x20};\x0a','kaYks','string','148TqomEm','theme','apply','import\x20\x27./','engines','root','846992rsPfeW','client','ZDkhY','test','JbISt','resourceName','component/component.js','css','VIsfb','.app-tests.js','iygla','withValue','true','147gCVVoN','Generate\x20a\x20page.','dziMY','fsi','component','10082TFxBjc','130hpuDNE'];a62c=function(){return R;};return a62c();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a63B=a63d;(function(a,b){const z=a63d,c=a();while(!![]){try{const d=parseInt(z(0x147))/0x1*(-parseInt(z(0x14b))/0x2)+-parseInt(z(0x13c))/0x3*(parseInt(z(0x14d))/0x4)+parseInt(z(0x14a))/0x5+-parseInt(z(0x13e))/0x6+parseInt(z(0x142))/0x7+-parseInt(z(0x144))/0x8+parseInt(z(0x140))/0x9*(parseInt(z(0x13b))/0xa);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a63c,0x6c2bc));function a63c(){const H=['templateContent','maka\x20{generate,\x20g}:{publish,\x20p}\x20<name>','1854835QdAXjY','36LtcQLF','(((.+)+)+)+$','764YAfHZl','getProjectConfig','fsi','ywswS','injectAtEndOfFile','server/publish.','tsx','then','ixekP','maka\x20g:publish\x20todos','publish','resourceName','value','__awaiter','110BuZJnC','6945ThXDID','engines','4558020GdGvdN','publish/publish.','1207107LkhsKW','toString','4613462dhDDKW','search','753064RVyuRh','throw','done','42575IYZPRE'];a63c=function(){return H;};return a63c();}const a63b=(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;};}()),a63a=a63b(this,function(){const A=a63d;return a63a[A(0x141)]()[A(0x143)](A(0x14c))[A(0x141)]()['constructor'](a63a)[A(0x143)](A(0x14c));});a63a();var __awaiter=this&&this[a63B(0x15a)]||function(a,b,c,d){function e(f){return f instanceof c?f:new c(function(g){const C=a63d;if('UwEQr'===C(0x150))return f instanceof g?h:new i(function(m){m(k);});else g(f);});}return new(c||(c=Promise))(function(f,g){function h(k){try{j(d['next'](k));}catch(l){g(l);}}function i(k){const D=a63d;try{j(d[D(0x145)](k));}catch(l){g(l);}}function j(k){const E=a63d;k[E(0x146)]?f(k[E(0x159)]):e(k[E(0x159)])[E(0x154)](h,i);}j((d=d['apply'](a,b||[]))['next']());});};import{paramCase}from'change-case';import{Generator}from'../generator.js';function a63d(a,b){const c=a63c();return a63d=function(d,e){d=d-0x13b;let f=c[d];return f;},a63d(a,b);}Generator['create']({'name':a63B(0x157),'aliases':['p'],'usage':a63B(0x149),'description':'Generate\x20scaffolding\x20for\x20a\x20publish\x20function.\x0ahttps://docs.meteor.com/api/pubsub.html','examples':[a63B(0x156)]},function(a,b){return __awaiter(this,void 0x0,void 0x0,function*(){const F=a63d,c=this['fsi'][F(0x14e)]();this[F(0x14f)]['withValue'](c,()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=F,d={'name':b[G(0x158)],'collection':paramCase(b[G(0x158)]),'noRename':!![]};let e='js';if(c[G(0x13d)]['js']===G(0x153)){if('ixekP'!==G(0x155)){if(e){const i=i['apply'](j,arguments);return k=null,i;}}else e='ts';}const f=this[G(0x14f)]['rewriteDestinationPathForEngine']({'pathParts':[G(0x152)+c['engines']['js']]}),g=this[G(0x14f)][G(0x148)]({'srcPath':G(0x13f)+e,'context':d,'config':c});this[G(0x14f)][G(0x151)]({'filePath':f,'content':'\x0a'+g});}));});});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a64J=a64d;(function(a,b){const F=a64d,c=a();while(!![]){try{const d=-parseInt(F(0x129))/0x1*(parseInt(F(0x141))/0x2)+-parseInt(F(0x12b))/0x3+-parseInt(F(0xf7))/0x4+parseInt(F(0x114))/0x5+-parseInt(F(0x147))/0x6+parseInt(F(0x131))/0x7*(parseInt(F(0xee))/0x8)+parseInt(F(0x13f))/0x9;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a64c,0xc685e));function a64d(a,b){const c=a64c();return a64d=function(d,e){d=d-0xee;let f=c[d];return f;},a64d(a,b);}function a64c(){const W=['bDhLi','route/route.js','/imports/ui/pages','MasterLayout','layout','config','Could\x20not\x20find\x20a\x20suitable\x20location\x20to\x20enable\x20this\x20route.\x20\x20Please\x20inspect\x20','maka\x20g:route\x20todosIndex\x20todos','HNihy','<Router','react','warn','BuLvJ','eovtE','6360390ItCBnv','hTQUJ','templateContent','injectAfterLineNumber','LLQBC','next','getProjectConfig','true','\x22*\x22','create','vanilla','gnZbH','maka\x20g:route\x20todosEdit\x20todos/:id/edit','eupQF','newForm','import\x20*\x20as\x20Component\x20from\x20\x27./templates\x27;','cSAKx','Ddshy','fsi','startup','apply','179013WUigOv','NXDIo','2346795dTgcMg','injectAtEndOfFile','Eqsos','mAeVz','only','tQWIl','4932067gxWTYe','PrivateLayout','then','lib','value','length','filter','(((.+)+)+)+$','join','private','blndD','invoke','__awaiter','rewriteDestinationPathForEngine','19529622QVTTEI','throw','14jcPXfl','vKMKa','root','gIsnr','const\x20privateRoutes\x20=\x20(<>','search','1789530kyrWls','ssr','</Router>','cwd','tmaZI','templateName','client','8ZRmrQR','withValue','toLowerCase','page','pathFromApp','aDFHO','includes','readFileLines','findGenerator','3999424zwFkCX','engines','wATGO','route','imports','injectIntoFile','withHook','maka\x20g:route\x20usersShow\x20users/:id/show\x20--layout\x20userView','const\x20publicRoutes\x20=\x20(<>','lnLrx','dXCsD','indexOf','map','routes.js','\x0a\x09\x09'];a64c=function(){return W;};return a64c();}const a64b=(function(){let a=!![];return function(b,c){const d=a?function(){const G=a64d;if('atfOF'!==G(0x12e)){if(c){if('LLQBC'!==G(0x118))f=this['fsi'][G(0xf5)](g)[G(0x103)]((m,n)=>{const H=G;return m['includes'](H(0x145))?n+0x1:null;})[G(0x137)](l=>l!==null),this[G(0x126)][G(0x117)]({'filePath':h,'content':'\x09{'+i['templateName']+'}','lineNumber':j[0x0]});else{const f=c[G(0x128)](b,arguments);return c=null,f;}}}else{if(e){const h=i[G(0x128)](j,arguments);return k=null,h;}}}:function(){};return a=![],d;};}()),a64a=a64b(this,function(){const I=a64d;return a64a['toString']()[I(0x146)](I(0x138))['toString']()['constructor'](a64a)[I(0x146)](I(0x138));});a64a();var __awaiter=this&&this[a64J(0x13d)]||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 N=a64d;function h(k){const K=a64d;try{if(K(0xf9)!==K(0x113))j(d[K(0x119)](k));else return c[K(0xf4)](K(0x123))?d+0x1:null;}catch(m){g(m);}}function i(k){const L=a64d;if(L(0x121)!=='bjSxs')try{j(d[L(0x140)](k));}catch(l){g(l);}else c='/'+d[L(0x137)](function(n){return n!=='/';})['join']('/')[L(0xf0)]();}function j(k){const M=a64d;if('Isxqa'!==M(0x101))k['done']?f(k[M(0x135)]):e(k[M(0x135)])[M(0x133)](h,i);else try{i(j[M(0x140)](k));}catch(m){m(m);}}j((d=d[N(0x128)](a,b||[]))[N(0x119)]());});};import a64u from'path';import{Generator}from'../generator.js';import{Log}from'../tools/log/log.class.js';import a64v from'../generators/maka.gen.js';import{camelCase,paramCase,pascalCase}from'change-case';const aliases=['r'];Generator[a64J(0x11d)]({'name':a64J(0xfa),'aliases':aliases,'validOpts':[a64J(0x13a),'layout',a64J(0x12f),a64J(0x14a),a64J(0x10b),'root',a64J(0xfd)],'usage':'maka\x20{generate,\x20g}:{route,\x20r}\x20[path/]<name>\x20[url]\x20[--private]','description':'Generate\x20scaffolding\x20for\x20a\x20Route.','examples':[a64J(0x10d),a64J(0x120),a64J(0xfe),'maka\x20g:route\x20lists/listIndex\x20lists']},function(a,b){const O=a64J;try{if(O(0x13b)!=='blndD'){const d=d[O(0x128)](e,arguments);return f=null,d;}else{const d=this[O(0x126)][O(0x11a)]();this[O(0x126)][O(0xef)](d,()=>__awaiter(this,void 0x0,void 0x0,function*(){const P=O;if(P(0x11f)===P(0x14b))return c[P(0xf4)](P(0xff))?d+0x1:null;else{var f;let h=(f=b[P(0x13a)])!==null&&f!==void 0x0?f:![],i=paramCase(a[0x0]),j='/'+i;a[P(0x136)]>0x1&&(P(0x12a)===P(0x12a)?j='/'+a[P(0x137)](function(o){return o!=='/';})[P(0x139)]('/')['toLowerCase']():c(d));i=camelCase(i);b['layout']&&('hTQUJ'!==P(0x115)?c(d):b['layout']=camelCase(b[P(0x10a)]));let k=a64u[P(0x139)](P(0x108),i,i),l={'name':i,'fileCase':paramCase(i),'camelCaseName':camelCase(i),'url':j,'layout':b[P(0x10a)]||P(0x109),'templatePath':k,'templateName':pascalCase(i),'client':d['engines']['client'],'newForm':![]};if(h){if('VxZst'!==P(0x142))l['layout']=P(0x132);else return c[P(0xf4)](P(0x145))?d+0x1:null;}if(!b[P(0x143)]){if(P(0x124)!==P(0x130)){const r=a64v[P(0xf6)](P(0xf1));r&&(yield r[P(0x13c)](a,b));}else b[P(0x10a)]=P(0x132);}let m,n;if(d['engines']['client']===P(0x110)){if(d['engines'][P(0x148)]===P(0x11b)){if('hlRRN'!==P(0xf3)){const w=this[P(0x126)][P(0xf2)]({'pathParts':[P(0xfb),P(0x127),P(0x134),'routes.js']});m=this[P(0x126)][P(0x13e)]({'pathParts':[w],'config':d});}else b[P(0x122)]=!![];}else{if('dBCkJ'===P(0x144)){const z=g?function(){if(z){const A=q['apply'](r,arguments);return s=null,A;}}:function(){};return l=![],z;}else{const z=this[P(0x126)][P(0xf2)]({'pathParts':[P(0xfb),P(0x127),P(0x14d),P(0x104)]});m=this[P(0x126)][P(0x13e)]({'pathParts':[z],'config':d});}}let t=this['fsi']['readFileLines'](m)[P(0x103)]((A,B)=>{const Q=P;return'fyaPf'===Q(0x12d)?f instanceof g?h:new i(function(D){D(k);}):A[Q(0xf4)](Q(0x123))?B+0x1:null;})[P(0x137)](A=>A!==null),u=this[P(0x126)]['readFileLines'](m)[P(0x103)]((A,B)=>{const R=P;return A[R(0xf4)]('const\x20publicRoutes\x20=\x20(<>')?B+0x1:null;})['filter'](A=>A!==null),v=this['fsi']['readFileLines'](m)['map']((A,B)=>{const S=P;if(S(0x106)===S(0x125))d['layout']=e(f[S(0x10a)]);else return A['includes'](S(0x145))?B+0x1:null;})['filter'](A=>A!==null);u[P(0x136)]>0x0&&v['length']>0x0&&(l[P(0x122)]=!![]);n=this[P(0x126)][P(0x116)]({'srcPath':P(0x107),'framework':'react','context':l,'config':d});if(u[P(0x136)]>0x0||v[P(0x136)]>0x0){this[P(0x126)][P(0x117)]({'filePath':m,'content':n,'lineNumber':t[0x0]});if(h&&v[P(0x136)]>0x0)v=this['fsi'][P(0xf5)](m)[P(0x103)]((A,B)=>{const T=P;return'mcQTC'!==T(0x10e)?A[T(0xf4)](T(0x145))?B+0x1:null:c[T(0xf4)](T(0x145))?d+0x1:null;})[P(0x137)](A=>A!==null),this['fsi'][P(0x117)]({'filePath':m,'content':'\x09{'+l[P(0x14c)]+'}','lineNumber':v[0x0]});else u['length']>0x0?(u=this[P(0x126)][P(0xf5)](m)[P(0x103)]((A,B)=>{const U=P;if(U(0x112)===U(0x112))return A[U(0xf4)](U(0xff))?B+0x1:null;else d(e[U(0x119)](f));})[P(0x137)](A=>A!==null),this[P(0x126)][P(0x117)]({'filePath':m,'content':'\x09{'+l[P(0x14c)]+'}','lineNumber':u[0x0]})):Log[P(0x111)](P(0x10c)+m);}else{let A=this['fsi']['readFileLines'](m)[P(0x103)](D=>{const V=P;return D['includes'](V(0x11c));}),B=A[P(0x102)](!![])>-0x1,C=B?'<Route':P(0x149);this[P(0x126)][P(0xfc)]({'filePath':m,'content':P(0x105)+n+P(0x105),'begin':P(0x10f),'end':C});}}else{if(d[P(0xf8)][P(0x14d)]===P(0x11e)){if(P(0x100)!=='lnLrx')c[P(0x111)](P(0x10c)+d);else{const E=this[P(0x126)][P(0xf2)]({'pathParts':[P(0xfb),P(0x127),'client','routes.js']});m=this[P(0x126)][P(0x13e)]({'pathParts':[E],'config':d}),n=this[P(0x126)][P(0x116)]({'srcPath':P(0x107),'context':l}),this[P(0x126)][P(0x12c)]({'filePath':m,'content':'\x0a'+n});}}}}}));}}catch(f){Log['error'](f);}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a65z=a65d;function a65d(a,b){const c=a65c();return a65d=function(d,e){d=d-0xf3;let f=c[d];return f;},a65d(a,b);}(function(a,b){const v=a65d,c=a();while(!![]){try{const d=-parseInt(v(0x114))/0x1*(parseInt(v(0x100))/0x2)+-parseInt(v(0x10f))/0x3+-parseInt(v(0x101))/0x4+-parseInt(v(0x111))/0x5*(-parseInt(v(0x110))/0x6)+-parseInt(v(0xf9))/0x7*(parseInt(v(0xfa))/0x8)+-parseInt(v(0xfc))/0x9*(parseInt(v(0xfd))/0xa)+parseInt(v(0x115))/0xb;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a65c,0x47277));const a65b=(function(){let a=!![];return function(b,c){const w=a65d;if('VplcA'===w(0x103)){const d=a?function(){const x=w;if(c){const e=c[x(0xff)](b,arguments);return c=null,e;}}:function(){};return a=![],d;}else h[w(0x104)]?i(j['value']):k(l[w(0x112)])[w(0x106)](m,n);};}()),a65a=a65b(this,function(){const y=a65d;return a65a[y(0xf5)]()[y(0x108)]('(((.+)+)+)+$')[y(0xf5)]()['constructor'](a65a)['search'](y(0xf4));});a65a();var __awaiter=this&&this[a65z(0x10e)]||function(a,b,c,d){function e(f){const A=a65d;if('prBgk'==='UaCIP')d(e[A(0xfe)](f));else return f instanceof c?f:new c(function(h){h(f);});}return new(c||(c=Promise))(function(f,g){const D=a65d;function h(k){try{j(d['next'](k));}catch(l){g(l);}}function i(k){const B=a65d;if('vxnTC'!=='lrNSw')try{j(d[B(0xfe)](k));}catch(l){if(B(0x10c)===B(0x113))try{i(j[B(0x10a)](k));}catch(o){m(o);}else g(l);}else return c['toString']()[B(0x108)](B(0xf4))[B(0xf5)]()[B(0xf8)](d)[B(0x108)](B(0xf4));}function j(k){const C=a65d;k['done']?f(k['value']):e(k[C(0x112)])[C(0x106)](h,i);}j((d=d[D(0xff)](a,b||[]))[D(0x10a)]());});};function a65c(){const F=['apply','2zEQVdD','1300712TFLXyz','maka\x20g:scaffold\x20todos','VplcA','done','page','then','Generate\x20scaffolding\x20for\x20a\x20resource.','search','findGenerator','next','route','RqKJA','api','__awaiter','347943OjjiuH','6MQiAKL','338885UmviOl','value','gjEkB','501751mKiyYQ','14236112HnsDQA','maka\x20{generate,\x20g}:{scaffold,\x20s}\x20[path/]<name>','(((.+)+)+)+$','toString','invoke','scaffold','constructor','301NHWOpV','5328lIXCXx','PxWKE','153dvoOPf','58220mtACbt','throw'];a65c=function(){return F;};return a65c();}import a65u from'../generators/maka.gen.js';import{Generator}from'../generator.js';import{Log}from'../tools/log/log.class.js';Generator['create']({'name':a65z(0xf7),'usage':a65z(0xf3),'description':a65z(0x107),'examples':[a65z(0x102)]},function(a,b){return __awaiter(this,void 0x0,void 0x0,function*(){const E=a65d;try{const c=a65u[E(0x109)](E(0x10b));c&&(yield c[E(0xf6)](a,b));const d=a65u[E(0x109)](E(0x105));d&&(yield d[E(0xf6)](a,b));const f=a65u[E(0x109)](E(0x10d));if(f){if(E(0xfb)!==E(0xfb))return f instanceof g?h:new i(function(m){m(k);});else yield f[E(0xf6)](a,b);}}catch(h){Log['error'](h);}});});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a66d(a,b){const c=a66c();return a66d=function(d,e){d=d-0x1e7;let f=c[d];return f;},a66d(a,b);}const a66B=a66d;(function(a,b){const x=a66d,c=a();while(!![]){try{const d=-parseInt(x(0x1eb))/0x1*(-parseInt(x(0x237))/0x2)+-parseInt(x(0x239))/0x3+parseInt(x(0x1f7))/0x4*(parseInt(x(0x22c))/0x5)+parseInt(x(0x1f0))/0x6+parseInt(x(0x1e8))/0x7*(parseInt(x(0x223))/0x8)+-parseInt(x(0x236))/0x9+-parseInt(x(0x233))/0xa*(parseInt(x(0x21a))/0xb);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a66c,0x42713));const a66b=(function(){let a=!![];return function(b,c){const d=a?function(){const y=a66d;if(y(0x200)===y(0x22e))return f instanceof g?h:new i(function(m){m(k);});else{if(c){if('USQjt'===y(0x216)){const f=c['apply'](b,arguments);return c=null,f;}else{const h=g?function(){const z=y;if(h){const u=q[z(0x1fb)](r,arguments);return s=null,u;}}:function(){};return l=![],h;}}}}:function(){};return a=![],d;};}()),a66a=a66b(this,function(){const A=a66d;return a66a[A(0x205)]()[A(0x21c)]('(((.+)+)+)+$')['toString']()[A(0x228)](a66a)[A(0x21c)](A(0x21d));});a66a();function a66c(){const J=['winston','eMXhm','imports','USQjt','Ronek','Verifying\x20npm\x20package\x20requirements:\x20winston\x20...','Winston\x20Logger','671yaeANn','UiEBJ','search','(((.+)+)+)+$','throw','invoke','warn','logger','lib','1470864qSNDNo','options','checkMeteorPackage','then','findGenerator','constructor','injectAtBeginningOfFile','indexOf','fxsjx','5xsapFN','maka\x20{generate,\x20g}:{service}\x20<service-name>\x20--type=logger','YMuTc','AyFVG','error','installNpmPackage','Service\x20Type','4210QpuqCm','list','value','4707378QszdiA','22DoErll','collection','209472jvjOCG','/imports/startup/lib/collections/logs','14mqWnlK','logger-transports.','service/logger/logger.js','5179QMSIkw','rewriteDestinationPathForType','wzVXE','import\x20Logs\x20from\x20\x27','getProjectConfig','212490WaFSWL','svc','XOwUH','drEkA','import\x20{\x20MongoTransport\x20}\x20from\x20\x27','__awaiter','fsi','1722376PfQaID','/imports/startup/lib/services/logger-transports','service','next','apply','tsx',',\x20you\x20must\x20provide\x20a\x20valid\x20type\x20as\x20an\x20argument.\x20\x20Usage:','notice','pathFromApp','HAVgj','Generate\x20a\x20service\x20to\x20run\x20within\x20your\x20meteor\x20application.','winston\x20winston-transport\x20setimmediate','installMeteorPackage','Invalid\x20type\x20','toString','engines','services','create','template','resourceName','checkNpmPackage','done','both','startup','type','zLnHS','mongo','withValue'];a66c=function(){return J;};return a66c();}var __awaiter=this&&this[a66B(0x1f5)]||function(a,b,c,d){function e(f){return f instanceof c?f:new c(function(g){const C=a66d;if(C(0x22f)!==C(0x22f))try{i(j[C(0x21e)](k));}catch(i){m(i);}else g(f);});}return new(c||(c=Promise))(function(f,g){const G=a66d;function h(k){const D=a66d;try{j(d[D(0x1fa)](k));}catch(l){if(D(0x22b)!==D(0x214))g(l);else{const n=d[D(0x1fb)](l,arguments);return f=null,n;}}}function i(k){const E=a66d;if(E(0x1f2)===E(0x1f2))try{'drEkA'!==E(0x1f3)?d(e[E(0x21e)](f)):j(d[E(0x21e)](k));}catch(m){g(m);}else try{i(j[E(0x1fa)](k));}catch(o){m(o);}}function j(k){const F=a66d;k[F(0x20c)]?f(k[F(0x235)]):e(k[F(0x235)])[F(0x226)](h,i);}j((d=d['apply'](a,b||[]))[G(0x1fa)]());});};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[a66B(0x208)]({'name':a66B(0x1f9),'aliases':[a66B(0x1f1)],'usage':a66B(0x22d),'description':a66B(0x201),'examples':['maka\x20g:s\x20Logger\x20--type=logger']},function(a,b){return __awaiter(this,void 0x0,void 0x0,function*(){const H=a66d;try{if(H(0x217)==='UNHKH')b='ts';else{const d=this['fsi'][H(0x1ef)]();this[H(0x1f6)][H(0x212)](d,()=>__awaiter(this,void 0x0,void 0x0,function*(){const I=H,f=this[I(0x1f6)]['pathFromApp']({}),g=paramCase(b[I(0x20a)]),h=paramCase(b[I(0x20a)]);if(!b[I(0x20f)]){const l={'type':I(0x234),'name':'serviceAnswer','message':I(0x232),'choices':[{'name':I(0x219),'value':I(0x221)}]},{serviceAnswer:m}=yield Actions[I(0x224)](l);m&&('unzdU'!==I(0x21b)?b[I(0x20f)]=m:d(e['next'](f)));}const i={'name':pascalCase(b[I(0x20a)]),'fileName':g,'camelCase':camelCase(b[I(0x20a)]),'type':b[I(0x20f)],'engine':d['engines']['js'],'noRename':!![]};let j='js';d[I(0x206)]['js']===I(0x1fc)&&(j='ts');let k=[I(0x221)];if(k[I(0x22a)](i[I(0x20f)])<0x0){let o=i[I(0x20f)]?i[I(0x20f)]:'(blank)';Log[I(0x230)](I(0x204)+o+I(0x1fd));return;}if(b[I(0x20f)]==='logger'){!this[I(0x1f6)][I(0x20b)](I(0x213))&&(Log[I(0x220)](I(0x218)),yield this[I(0x1f6)][I(0x231)](I(0x202),{'cwd':f}));!this[I(0x1f6)][I(0x225)]('mongo')&&(Log[I(0x1fe)]('Verifying\x20meteor\x20package\x20requirements:\x20mongo\x20...'),yield this[I(0x1f6)][I(0x203)](I(0x211),{'cwd':f}));let p=this[I(0x1f6)][I(0x1ff)]({'pathParts':[I(0x215),I(0x20e),I(0x222),'services',g+'.'+j]});this[I(0x1f6)][I(0x209)]({'srcPath':I(0x1ea),'destPath':p,'context':i,'config':d});const q=a66u[I(0x227)](I(0x238));q&&(I(0x210)!=='zLnHS'?c(d):yield q[I(0x21f)]([h],{'where':I(0x20d),'appPathPrefix':I(0x222),'dir':''}));let r=this[I(0x1f6)][I(0x1ec)]({'pathParts':[p]});const s=this[I(0x1f6)][I(0x1ec)]({'pathParts':[I(0x1f8)]});this[I(0x1f6)][I(0x229)]({'filePath':r,'content':I(0x1f4)+s+'\x27;'});let t=this[I(0x1f6)][I(0x1ff)]({'pathParts':[I(0x215),'startup',I(0x222),I(0x207),I(0x1e9)+j]});this['fsi']['template']({'srcPath':'service/logger/transports.js','destPath':t,'context':i,'config':d});let u=this[I(0x1f6)][I(0x1ec)]({'pathParts':[t]});const v=this[I(0x1f6)][I(0x1ec)]({'pathParts':[I(0x1e7)]});this[I(0x1f6)]['injectAtBeginningOfFile']({'filePath':u,'content':I(0x1ee)+v+'\x27;'});}}));}}catch(f){'wzVXE'!==H(0x1ed)?h['done']?i(j['value']):k(l[H(0x235)])['then'](m,n):Log[H(0x230)](f);}});});
|
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(0xb2))/0x1*(-parseInt(z(0x9c))/0x2)+-parseInt(z(0xaa))/0x3*(parseInt(z(0xa7))/0x4)+parseInt(z(0xa9))/0x5*(parseInt(z(0x9d))/0x6)+-parseInt(z(0xa0))/0x7*(-parseInt(z(0xa6))/0x8)+parseInt(z(0xa8))/0x9*(parseInt(z(0xa4))/0xa)+parseInt(z(0xad))/0xb+-parseInt(z(0xb1))/0xc;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a67c,0x270f5));const a67b=(function(){let a=!![];return function(b,c){const d=a?function(){const A=a67d;if(c){const e=c[A(0xaf)](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a67a=a67b(this,function(){const B=a67d;return a67a['toString']()['search'](B(0xa3))[B(0xa2)]()['constructor'](a67a)[B(0xae)]('(((.+)+)+)+$');});a67a();function a67d(a,b){const c=a67c();return a67d=function(d,e){d=d-0x9c;let f=c[d];return f;},a67d(a,b);}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(0xa1)]),__dirname=a67w['dirname'](__filename);function a67c(){const D=['1094065zwbXcN','url','toString','(((.+)+)+)+$','10fkfAsM','stringify','8aQdwBg','264ChFFQq','1280547OhtOuP','160305jLFlHP','7653TBWiOn','slice','MAKA_COMMAND_PATH','3399506SACEaf','search','apply','--max-old-space-size=','2754072jDrlHc','2557ZiHShF','TOOL_NODE_FLAGS','parse','64EOqMjS','6VhlFVg','floor','totalmem'];a67c=function(){return D;};return a67c();}global[a67C(0xac)]=__dirname;let total_memory=a67v[a67C(0x9f)](),total_mem_in_kb=total_memory/0x400,total_mem_in_mb=total_mem_in_kb/0x400;total_mem_in_mb=Math[a67C(0x9e)](total_mem_in_mb),process['env'][a67C(0xb3)]=a67C(0xb0)+total_mem_in_mb;const argv=a67u(process['argv'][a67C(0xab)](0x2)),args=argv['_'],deepCopyArgv=JSON[a67C(0xb4)](JSON[a67C(0xa5)](argv));delete deepCopyArgv['_'];const opts=a67x['camelizeKeys'](deepCopyArgv);a67y['run'](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
|
+
});
|