on ‎2023 Mar 01 2:12 PM
Hey folks,
I noticed that if I use the @sap/dwc-cli as Node.js dependency within node, that it get not correctly initialized.
So basically i do:
const options = { "--host": myhosturl, "--access-token": "********", "--refresh-token": "**********" }
let client = await dwc.getCommands(tenantURL);
await client["cache init"](options)
But if then want to use other commands like "spaces list", I get a function not work. I also get no error for running cache init so i assume that access token, refresh token and host are correct,
It works if i initialize the cache manually within the terminal.
For solving this i thought of removing the global installation of @sap/dwc-cli, but this does not solve the problem.
Request clarification before answering.
Hi lkaeser
is myhosturl and tenantURL the same, does it contain the same value? If the cache init command failed, it would have returned a rejected promise. I assume this didn't happen?
To analyze the situation further, you can provide a custom logger implementation, see https://www.npmjs.com/package/@sap/dwc-cli#provide-custom-logger-function, store all the outputs and errors, and log them to the console.
In addition, you can add the "verbose": true option to the options map to get more insights.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi jascha.kanngiesser ,
i get this logs with verbose option:
[
[
'%s %s',
'GET',
'<tenant>/dwaas-core/api/v1/discovery'
],
[ '%d %s', 200, 'OK' ],
[ 'Correlation ID 21f7ae1a-f632-4e89-4562-2428520b2aac' ]
]
So i assume that the request worked. But when i am looking at the commands nothing changed. I do it like
console.log(Object.keys(client))
###
[
'dwc', 'cache',
'cache init', 'cache clean',
'cache show', 'host',
'host set', 'host show',
'host clean', 'login',
'logout', 'passcode-url',
'secrets', 'secrets show'
]
###
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.