JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 789
  • Score
    100M100P100Q135033F
  • License Apache-2.0

Wechaty Token Based Authentication Manager

Package Exports

  • wechaty-token

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (wechaty-token) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

wechaty-token

NPM NPM Version npm (tag) TypeScript

wechaty token

Wechaty Token Based Authentication Manager

Install

npm install -g wechaty-token

Usage

$ wechaty-token --help

wechaty-token <subcommand>
> Wechaty utility for discovering and generating tokens

where <subcommand> can be one of:

- generate - Generate a new Wechaty Token
- discover - Wechaty TOKEN Service Discovery

For more help, try running `wechaty-token <subcommand> --help`

Wechaty Token Discovery

$ wechaty-token discover --help

wechaty-token discover
> Wechaty TOKEN Service Discovery

ARGUMENTS:
  <str> - Wechaty Puppet Service TOKEN

FLAGS:
  --help, -h - show help

Example:

# Discover a valid token (in-service)
$ wechaty-token discover puppet_IN_SERVICE_TOKEN
{ host: '8.7.5.2', port: 58871 }
$ echo $?
0

# Discover a unvalid token (out-of-service)
$ wechaty-token discover puppet_OUT_OF_SERVICE_TOKEN
NotFound
$ echo $?
1

Generate Wechaty Token

$ wechaty-token generate --help

wechaty-token generate
> Generate a new Wechaty Token

OPTIONS:
  --type, -t <str> - The type of the Wechaty Puppet Service [optional]

FLAGS:
  --help, -h - show help

Example:

# Generate a UUID token
$ wechaty-token generate
1fab726b-e3d3-40ce-8b7b-d3bd8c9fd280

# Generate token with type `foo`
$ wechaty-token generate --type foo
puppet_foo_1fab726b-e3d3-40ce-8b7b-d3bd8c9fd280

History

master

v0.1 master (Aug 2, 2021)

  1. wechaty-token CLI released
  2. gRPC Resolver for Wechaty: enable schema wechaty:///puppet_TOKEN for gRPC client

v0.0.1 (Aug 1, 2021)

Inited

Author

Huan LI (李卓桓), Google Developer Expert (Machine Learning), zixia@zixia.net

Profile of Huan LI (李卓桓) on StackOverflow

  • Code & Docs © 2018-now Huan LI <zixia@zixia.net>
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons