twapi-cli

1.2.1 • Public • Published

Command line Textalk Webshop API Client

Do calls to TWAPI from your commandline!

Install

npm install -g twapi-cli

Usage

Usage: twapi-cli -w <webshop> [-a <auth>] [-l <lang>] [-u <api-url>] [--stage] <method> [<param1> <param2> ...]
       twapi-cli -w <webshop> [-a <auth>] [-l <lang>] [-u <api-url>] [--stage] theme-update <theme-id> <patch>
       twapi-cli -w <webshop> [-a <auth>] [-l <lang>] [-u <api-url>] [--stage] theme-set-js <theme-id> <file>

twapi-cli can do three things at the moment, generic calls, updating and patching of Theme API blobb and uploading of script as custom javascript.

Options

Options
-w <webshop> Sets webshop context, defaults to 22222
-a <auth> Auth key to use
-l <lang> Language code for context
-u <api-url> TwApi url, defaults to production
--stage Shorthand for changing Api url to stage

Doing a call

# Defaults to webshop 22222
twapi-cli Theme.select true

# JSON arguments needs ''
twapi-cli Theme.select '{ "uid": true, "name": true }'

Updating a Theme with a patch

The patch can be either a text snippet or the path to a json file.

twapi-cli -w 32208 theme-update 3857 '{"name": "Foo"}'
twapi-cli -w 32208 theme-update 3857 theme.json

Settings Theme settings.custom_javascript.script to contents of a file

twapi-cli -w 32208 theme-set-js 3857 pwned.js

/twapi-cli/

    Package Sidebar

    Install

    npm i twapi-cli

    Weekly Downloads

    1

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    6.51 kB

    Total Files

    5

    Last publish

    Collaborators

    • textalk