Giter VIP home page Giter VIP logo

cli's People

Contributors

anoopmsivadas avatar dependabot[bot] avatar jaepass avatar mureinik avatar rafaeelaudibert avatar robbieaverill avatar scopeynz avatar sudiptog81 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cli's Issues

Add request helper

We'll need a request helper to authorize API calls from our commands. We can probably re-use a lot of the logic that exists already in the login-helper login() method.

Gracefully handle running commands while not logged in

If I run the logs command before I've logged in, I get this error:

Error: Could not locate required credentials to subscribe to a log feed
    at LogFeed.getConfiguration (~/dev/chec/chec-cli/src/helpers/log-feed.js:14:13)
    at LogFeed.getChannel (~/dev/chec/chec-cli/src/helpers/log-feed.js:27:33)
    at LogFeed.onLog (~/dev/chec/chec-cli/src/helpers/log-feed.js:22:10)
    at LogsCommand.registerLogFeed (~/dev/chec/chec-cli/src/commands/logs.js:101:10)
    at LogsCommand.run (~/dev/chec/chec-cli/src/commands/logs.js:53:10)
    at LogsCommand._run (~/dev/chec/chec-cli/node_modules/@oclif/command/lib/command.js:44:31)

We could use a hook to ensure that you're logged in before running various commands, and show a friendly message like "You aren't logged in yet, run chec-cli login then try again"

Possible EventEmitter memory leak detected, while watchings logs

I'd set up my chec logs command to watch for a while, then run some operations. I navigated into a couple of the log entries individually, then back to the list again between each. The second I went back to the list I got this error:

[2020-12-23 17:00:45]  402  rqst_16P556C38svK08771645 /v1/checkouts/chkt_4oGbZxYBrJRKKw
[2020-12-23 17:01:31]  402  rqst_16w0ud9vU6x708771691 /v1/checkouts/chkt_Mo1r6yqVAZXRe5
⠋ Listening for logs from Chec. Press "up" to navigate through the exisiting logs(node:20964) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 keypress listeners added to [ReadStream]. Use emitter.setMaxListeners() to increase limit
⠙ Listening for logs from Chec. Press "up" to navigate through the exisiting logs

demo-store command should ask to confirm seeding

If I were to set up multiple demo stores, I wouldn't necessarily want to have multiple sets of products seeded. If it were to ask to confirm whether I wanted this I could say no before it does this.

HTTP ERROR [422] . The given data was invalid.

Hope you are well, I'm new to commerce.js and I've been trying to create a capture of the cart, so as to get the payment confirmation. My API is being called as below.

image

the orderData variable is as below

image

the error am getting

image

please help. Thanks

Group commands into sections

COMMANDS
  help      display help for chec
  log       Get full detail about a given log ID
  login     Log into your Chec.io account
  logout    Log out of your account
  logs      Show a summary of your API requests processed by Chec.io
  register  Register an account with Chec.io
  request   Run abstract API request

I think we could group these. They represent auth commands, and then functional commands. That might be a good start?

Info messages going to stdout

Hello! When I login & run

$ chec request GET /v1/products > chec.json

I'm suprised to find the first line of output is - Processing...\n before the JSON data starts.

Shouldn't this be sent to stderr, so my shell redirect produces a valid JSON file?

Add `--file` argument to `request` command

If I want to use chec request POST /v1/assets to upload an asset, the file contents must be a base64 encoded string (for local uploads anyway). This easily exceeds bash's limit for length, so we could add a --file argument (-f short) to specify a file to load and provide as the request body. Maybe it could be JSON only for now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.