gentics/mesh-cli

add group FAILs with mesh-cli; works via curl/REST

Opened this issue · 0 comments

I've installed

yarn info mesh-cli | grep version: -A1
  version:
   '1.0.0-RC9',

mesh --version
	1.0.0

I can add/create users (note the admin items were added in the original exec of mesh configure)

mesh list user
┌──────────────────────────────────┬───────────────┬────────────────────┬──────────────────────────────┬──────────────────────────────┐
│ UUID                             │ Username      │ Firstname          │ Lastname                     │ Groups                       │
├──────────────────────────────────┼───────────────┼────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 6bc9e7a0872a4dfc89e7a0872a8dfc49 │ site          │ -                  │ -                            │ []                           │
├──────────────────────────────────┼───────────────┼────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ b25407a59a4c443a9407a59a4c643a36 │ admin         │ -                  │ -                            │ [admin]                      │
└──────────────────────────────────┴───────────────┴────────────────────┴──────────────────────────────┴──────────────────────────────┘

and roles

mesh list role
┌──────────────────────────────────┬───────────────┬────────────────────┐
│ UUID                             │ Name          │ Groups             │
├──────────────────────────────────┼───────────────┼────────────────────┤
│ 20466109fc884b9c866109fc886b9c40 │ site          │ []                 │
├──────────────────────────────────┼───────────────┼────────────────────┤
│ 6635ce751baf4693b5ce751bafe6934c │ admin         │ [admin]            │
└──────────────────────────────────┴───────────────┴────────────────────┘

But attempting to add a group fails

mesh l group
┌──────────────────────────────────┬───────────────┬────────────────────┐
│ UUID                             │ Name          │ Roles              │
├──────────────────────────────────┼───────────────┼────────────────────┤
│ 40bbf1bebeed4922bbf1bebeed99224e │ admin         │ [admin]            │
└──────────────────────────────────┴───────────────┴────────────────────┘

/usr/local/share/.config/yarn/global/node_modules/mesh-cli/src/actions/group.js:43
        name: env
              ^

ReferenceError: env is not defined
    at Command.add (/usr/local/share/.config/yarn/global/node_modules/mesh-cli/src/actions/group.js:43:15)
    at Command.listener (/usr/local/share/.config/yarn/global/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:182:13)
    at Command.parseArgs (/usr/local/share/.config/yarn/global/node_modules/commander/index.js:654:12)
    at Command.parse (/usr/local/share/.config/yarn/global/node_modules/commander/index.js:474:21)
    at Object.<anonymous(/usr/local/share/.config/yarn/global/node_modules/mesh-cli/src/main-add.js:105:9)
    at Module._compile (internal/modules/cjs/loader.js:722:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)

It works fine via curl/REST

$CURL \
 -d '{"name" : "site"}' \
 -X POST ${API}/groups/
	{
	  "uuid" : "4bfe16441bd341c8be16441bd3e1c842",
	  "creator" : {
	    "uuid" : "b25407a59a4c443a9407a59a4c643a36"
	  },
	  "created" : "2018-12-01T04:10:23Z",
	  "editor" : {
	    "uuid" : "b25407a59a4c443a9407a59a4c643a36"
	  },
	  "edited" : "2018-12-01T04:10:23Z",
	  "name" : "site",
	  "roles" : [ ],
	  "permissions" : {
	    "create" : true,
	    "read" : true,
	    "update" : true,
	    "delete" : true,
	    "publish" : true,
	    "readPublished" : true
	  }
	}
mesh l group
┌──────────────────────────────────┬───────────────┬────────────────────┐
│ UUID                             │ Name          │ Roles              │
├──────────────────────────────────┼───────────────┼────────────────────┤
│ 4bfe16441bd341c8be16441bd3e1c842 │ site          │ []                 │
├──────────────────────────────────┼───────────────┼────────────────────┤
│ 40bbf1bebeed4922bbf1bebeed99224e │ admin         │ [admin]            │
└──────────────────────────────────┴───────────────┴────────────────────┘

So seems like the issue is localized to mesh-cli.