Coder Social home page Coder Social logo

seam-cli's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

seam-cli's Issues

Show deep objects

console.log cuts off objects like "properties", let's make it so it logs the entire object

the issue is it shows [Object object] instead of fully printing some properties. We can fix this by using console.dir

Implement Interact for ACS Entrances

seam acs entrances get then selecting an acs_entrance_id should allow you to select from a list

There are many similar functions for this, e.g. you can already select ACS Users from a list

Implement Ability to Go Back

Sometimes I'm constructing a query and realize that I want to change something I've already set, or call a different function instead. Currently I have to control-c the whole thing, but it would be go backward. Either arrows or something like inverse select (shift+enter) would do the trick for me.

CLI Error: TypeError: Cannot read properties of undefined (reading 'paths')

Issue:

Seems that the open api path maps are expected to be passed along with the "helper" object. Without these cli hard fails at any restful command requiring path map, throwing error.

Repro:

  • After seam login
  • seam devices list
  • [Make API Call]

Expected:

Device List JSON result

Actual:

CLI Error: TypeError: Cannot read properties of undefined (reading 'paths')
TypeError: Cannot read properties of undefined (reading 'paths')
    at getCommandOpenApiDef (/Users/badpirate/src/seam-cli/lib/get-command-open-api-def.ts:10:27)
    at interactForCommandParams (/Users/badpirate/src/seam-cli/lib/interact-for-command-params.ts:29:12)
    at cli (/Users/badpirate/src/seam-cli/cli.ts:136:24)

fix dependabot

Limit dependabot to update only minor and patch updates to all @seamapi/* dependencies that are in production

List Event -- Set Default Since

Listing events currently requires to provide since or between param, which is kind of annoying if you quickly want to retrieve the latest event in a workspace. It would be nice to just stuff in some default value or simply fetch the last 10-20 events.

➜  seam seam
✔ Select a command: / › events
✔ Select a command: /events › list

✔ [/events/list] Parameters › [Make API Call] /events/list


/events/list
Request Params:
{}


[400]

{
  error: {
    type: 'invalid_input',
    message: 'Must specify either since or between',
    validation_errors: { _errors: [ 'Must specify either since or between' ] },
    request_id: 'baf20eb5-ab0e-4824-8767-111eceece873'
  },
  ok: false
}

Can't Set Heat Temperature Setpoint

When trying to change the set mode of a honeywell thermostat in the Seam HQ office, got the following error.

$ seam
✔ Select a command: / › thermostats
✔ Select a command: /thermostats › heat

✔ [/thermostats/heat] Parameters › device_id*
✔ Select a device: › 308  T6 Pro Smart

✔ [/thermostats/heat] Parameters › heating_set_point_fahrenheit
CLI Error: Error: Didn't know how to handle OpenAPI schema for property: "heating_set_point_fahrenheit"
Error: Didn't know how to handle OpenAPI schema for property: "heating_set_point_fahrenheit"
    at /Users/sybohy/.nvm/versions/node/v20.11.1/lib/node_modules/seam-cli/dist/cli.cjs:17158:9
    at Generator.next (<anonymous>)
    at fulfilled (/Users/sybohy/.nvm/versions/node/v20.11.1/lib/node_modules/seam-cli/dist/cli.cjs:50:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

`seam login`: CLI Error: ReferenceError: fetch is not defined

Attempted installing per [README] instructions on Mac running latest Sonoma, and seam login fails after entering PAT token, throwing "fetch is not defined" error:

✔ Personal Access Token: … seam_[redacted]
PAT saved! You may not begin using the CLI!
CLI Error: ReferenceError: fetch is not defined
ReferenceError: fetch is not defined
    at n (/Users/badpirate/.nvm/versions/node/v16.17.0/lib/node_modules/seam-cli/node_modules/redaxios/dist/redaxios.js:1:891)
    at Function.n.get (/Users/badpirate/.nvm/versions/node/v16.17.0/lib/node_modules/seam-cli/node_modules/redaxios/dist/redaxios.js:1:1380)
    at /Users/badpirate/.nvm/versions/node/v16.17.0/lib/node_modules/seam-cli/dist/cli.cjs:25937:37
    at Generator.next (<anonymous>)
    at /Users/badpirate/.nvm/versions/node/v16.17.0/lib/node_modules/seam-cli/dist/cli.cjs:62:61
    at new Promise (<anonymous>)
    at __async (/Users/badpirate/.nvm/versions/node/v16.17.0/lib/node_modules/seam-cli/dist/cli.cjs:46:10)
    at interactForWorkspaceId (/Users/badpirate/.nvm/versions/node/v16.17.0/lib/node_modules/seam-cli/dist/cli.cjs:25933:36)
    at /Users/badpirate/.nvm/versions/node/v16.17.0/lib/node_modules/seam-cli/dist/cli.cjs:25969:9
    at Generator.next (<anonymous>)

Accepted Provider Selection Broken

When you create a connect webview via the CLI and try to select specific accepted_providers (e.g. Yale), the selection does not go through.
Steps to reproduce:

  1. run seam (my local version is [email protected])
  2. select connect-webviews, then create
  3. select accepted_providers and select yale
  4. issue command and note that payload has an empty array for accepted_providers
~ seam
✔ Select a command: / › connect-webviews
✔ Select a command: /connect_webviews › create

✔ [/connect_webviews/create] Parameters › accepted_providers
✔ accepted_providers: ›

✔ [/connect_webviews/create] Parameters › [Make API Call] /connect_webviews/create


/connect_webviews/create
Request Params:
{ accepted_providers: [] }


[200]
{
  connect_webview: {
    url: 'https://connect.getseam.com/connect_webviews/view?connect_webview_id=xxx&auth_token=yyy,
    status: 'pending',
    workspace_id: 'zzz',
    custom_metadata: {},
    accepted_devices: [],
    login_successful: false,
    selected_provider: null,
    accepted_providers: [
      'august',            'avigilon_alta',
      'brivo',             'schlage',
      'smartthings',       'yale',
      'nuki',              'salto',
      'controlbyweb',      'minut',
      'my_2n',             'kwikset',
      'ttlock',            'noiseaware',
      'igloohome',         'ecobee',
      'hubitat',           'four_suites',
      'dormakaba_oracode', 'lockly',
      'wyze',              'google_nest'
    ],
    any_device_allowed: false,
    connect_webview_id: 'xxx',
    custom_redirect_url: null,
    any_provider_allowed: false,
    device_selection_mode: 'none',
    wait_for_device_creation: false,
    custom_redirect_failure_url: null,
    automatically_manage_new_devices: true,
    created_at: '2024-02-05T22:29:26.432Z',
    authorized_at: null
  },
  ok: true
}

pass api as ctx (second arg)

#27 passes the api everywhere as the first arg, but functions may accept multiple args. This issue is to update the implementation to be similar to seam-connect's where a second arg, ctx, accepts things like the api definition.

Some functions have over 2 params so we should switch to the "context helper" pattern imo with a context that contains the api, maybe the flags.

Eg interactForParams(cmd,ctx)

Originally posted by @seveibar in #27 (comment)

`npm install` fails: E401 Unauthorized

Repro:

On a clean environment:

  • Download the repo
  • npm install

Expected: Builds happy

Actual:

npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/download/@seamapi/types/1.63.1/a78935453802a84e228b56bf39c0e632483d079f - authentication token not provided

Connect Webview Create -- Redirect to Link

It would be super nice to prompt the user to redirect them in their browser to the connect webview url that gets generated after invoking a create command. Or at least offer to copy the url in the clipboard.

~ seam connect-webviews create

✔ [/connect_webviews/create] Parameters › [Make API Call] /connect_webviews/create


/connect_webviews/create
Request Params:
{}


[200]
{
  connect_webview: {
    url: 'https://connect.getseam.com/connect_webviews/view?connect_webview_id=3a966edd-9b46-41c1-a330-b899891b943e&auth_token=CjruEU1FABFwf1ZkpGEeVaUXvN94ugjpE',
    status: 'pending',

Allow a "curl" one line installation

A lot of packages allow you to install them by pasting a "one-liner" into the terminal with curl, something like curl https://install.seam.co | sh. They do this by serving a shell file at the url. How can we create that shell file?

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.