0.6.1 • Published 2 years ago

gyuma v0.6.1

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

Gyuma OAuth

Gyuma is an OAuth client for kintone of Node.js.

Install

Local (for API)

$ npm install --save gyuma
 or
$ yarn add gyuma

Global (for CLI)

$ npm install -g gyuma
 or
$ yarn global add gyuma

API

const gyuma = require('gyuma')
const request = require('request-promise')

;(async () => {
  const domain = 'example.cybozu.com'
  const params = {
    domain,
    client_id: process.env.OAUTH2_CLIENT_ID,
    client_secret: process.env.OAUTH2_CLIENT_SECRET,
    scope: 'k:app_settings:read k:app_settings:write',
    password: 'xxxxx',
    // port: 3000,
  }
  const access_token = await gyuma(params)

  const options = {
    url: `https://${domain}/k/v1/app/form/fields.json?app=256`,
    headers: {
      Authorization: `Bearer ${access_token}`,
    },
    json: true,
  }
  console.log(await request(options))
})()

CLI

$ gyuma \
-d example.cybozu.com \
-i xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
-s xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
-S "k:app_settings:read k:app_settings:write"

options

  -h, --help                          Output usage information
  -v, --version                       Output version information
  -d, --domain=<DOMAIN>               kintone domain name
  -i, --client_id=<CLIENT_ID>         kintone OAuth2 Client ID
  -s, --client_secret=<CLIENT_SECRET> kintone OAuth2 Client Secret
  -S, --scope=<SCOPE>                 kintone OAuth2 Scope
  -p, --password=<PASSWORD>           Credentials Password
  -P, --port=<PORT>                   Web Server port number - defaults to 3000

kintone Official Documents

How to add OAuth clients (β) - English

OAuthクライアントの使用(β)- 日本語

0.4.5

2 years ago

0.3.6

2 years ago

0.4.4

2 years ago

0.3.7

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.6.1

2 years ago

0.5.2

2 years ago

0.4.3

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.4.2

2 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago