<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: How to initialize @sap/dwc-cli as Node.js dependency correctly? in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/how-to-initialize-sap-dwc-cli-as-node-js-dependency-correctly/qaa-p/12651509#M4746261</link>
    <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;jascha.kanngiesser&lt;/SPAN&gt; ,&lt;/P&gt;&lt;P&gt;i get this logs with verbose option:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;[
  [
    '%s %s',
    'GET',
    '&amp;lt;tenant&amp;gt;/dwaas-core/api/v1/discovery'
  ],
  [ '%d %s', 200, 'OK' ],
  [ 'Correlation ID 21f7ae1a-f632-4e89-4562-2428520b2aac' ]
]&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So i assume that the request worked. But when i am looking at the commands nothing changed. I do it like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;console.log(Object.keys(client))&lt;BR /&gt;###&lt;BR /&gt;[
  'dwc',        'cache',
  'cache init', 'cache clean',
  'cache show', 'host',
  'host set',   'host show',
  'host clean', 'login',
  'logout',     'passcode-url',
  'secrets',    'secrets show'
]&lt;BR /&gt;###&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Mar 2023 08:53:46 GMT</pubDate>
    <dc:creator>7aeser</dc:creator>
    <dc:date>2023-03-02T08:53:46Z</dc:date>
    <item>
      <title>How to initialize @sap/dwc-cli as Node.js dependency correctly?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-initialize-sap-dwc-cli-as-node-js-dependency-correctly/qaq-p/12651507</link>
      <description>&lt;P&gt;Hey folks,&lt;/P&gt;
  &lt;P&gt;I noticed that if I use the @sap/dwc-cli as Node.js dependency within node, that it get not correctly initialized.&lt;/P&gt;
  &lt;P&gt;So basically i do:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;const options = { "--host": myhosturl, "--access-token": "********", "--refresh-token": "**********" }&lt;BR /&gt;let client = await dwc.getCommands(tenantURL);&lt;BR /&gt;await client["cache init"](options)&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;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,&lt;BR /&gt;It works if i initialize the cache manually within the terminal.&lt;BR /&gt;&lt;BR /&gt;For solving this i thought of removing the global installation of @sap/dwc-cli, but this does not solve the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 14:12:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-initialize-sap-dwc-cli-as-node-js-dependency-correctly/qaq-p/12651507</guid>
      <dc:creator>7aeser</dc:creator>
      <dc:date>2023-03-01T14:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize @sap/dwc-cli as Node.js dependency correctly?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-initialize-sap-dwc-cli-as-node-js-dependency-correctly/qaa-p/12651508#M4746260</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;lkaeser&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;is &lt;EM&gt;myhosturl&lt;/EM&gt; and &lt;EM&gt;tenantURL&lt;/EM&gt; 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?&lt;/P&gt;&lt;P&gt;To analyze the situation further, you can provide a custom logger implementation, see &lt;A href="https://www.npmjs.com/package/@sap/dwc-cli#provide-custom-logger-function" target="test_blank"&gt;https://www.npmjs.com/package/@sap/dwc-cli#provide-custom-logger-function&lt;/A&gt;, store all the outputs and errors, and log them to the console.&lt;/P&gt;&lt;P&gt;In addition, you can add the &lt;EM&gt;"verbose": true&lt;/EM&gt; option to the &lt;EM&gt;options&lt;/EM&gt; map to get more insights.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 06:58:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-initialize-sap-dwc-cli-as-node-js-dependency-correctly/qaa-p/12651508#M4746260</guid>
      <dc:creator>jascha_meiswinkel</dc:creator>
      <dc:date>2023-03-02T06:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize @sap/dwc-cli as Node.js dependency correctly?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-initialize-sap-dwc-cli-as-node-js-dependency-correctly/qaa-p/12651509#M4746261</link>
      <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;jascha.kanngiesser&lt;/SPAN&gt; ,&lt;/P&gt;&lt;P&gt;i get this logs with verbose option:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;[
  [
    '%s %s',
    'GET',
    '&amp;lt;tenant&amp;gt;/dwaas-core/api/v1/discovery'
  ],
  [ '%d %s', 200, 'OK' ],
  [ 'Correlation ID 21f7ae1a-f632-4e89-4562-2428520b2aac' ]
]&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So i assume that the request worked. But when i am looking at the commands nothing changed. I do it like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;console.log(Object.keys(client))&lt;BR /&gt;###&lt;BR /&gt;[
  'dwc',        'cache',
  'cache init', 'cache clean',
  'cache show', 'host',
  'host set',   'host show',
  'host clean', 'login',
  'logout',     'passcode-url',
  'secrets',    'secrets show'
]&lt;BR /&gt;###&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Mar 2023 08:53:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-initialize-sap-dwc-cli-as-node-js-dependency-correctly/qaa-p/12651509#M4746261</guid>
      <dc:creator>7aeser</dc:creator>
      <dc:date>2023-03-02T08:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize @sap/dwc-cli as Node.js dependency correctly?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-initialize-sap-dwc-cli-as-node-js-dependency-correctly/qaa-p/12651510#M4746262</link>
      <description>&lt;P&gt;Have you called client = await dwc.getCommands(tenantURL) again after you had called await client["cache init"](options)?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;let client = await dwc.getCommands(tenantURL);&lt;BR /&gt;await client["cache init"](options);&lt;BR /&gt;client = await dwc.getCommands(tenantURL);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Mar 2023 12:20:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-initialize-sap-dwc-cli-as-node-js-dependency-correctly/qaa-p/12651510#M4746262</guid>
      <dc:creator>jascha_meiswinkel</dc:creator>
      <dc:date>2023-03-03T12:20:15Z</dc:date>
    </item>
  </channel>
</rss>

