This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from cm-dyoshikawa/readme
fix readme and niseliff-sdk
- Loading branch information
Showing
6 changed files
with
116 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,117 @@ | |
|
||
NiseLine is inspired by [LocalStack](https://github.com/localstack/localstack). Goal of this tool is to create a mock service for [LINE](https://line.me/ja/). | ||
|
||
## Setup | ||
## Getting Started | ||
|
||
### Docker | ||
Launch NiseLine server. | ||
|
||
```bash | ||
docker run -d -p 3000:3000 dyoshikawa/niseline:latest | ||
``` | ||
|
||
And install NiseLiff SDK. | ||
|
||
```bash | ||
npm i @niseline/niseliff | ||
``` | ||
|
||
Use NiseLiff sdk in your client app! | ||
|
||
```tsx | ||
import { buildNiseLiff } from '@niseline/niseliff' | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
|
||
const niseliff = buildNiseLiff() | ||
|
||
niseliff | ||
.init({ | ||
liffId: 'DEFAULT_LIFF_ID', // You can any value | ||
}) | ||
.then(() => { | ||
ReactDOM.render( | ||
<React.StrictMode>Your client app</React.StrictMode>, | ||
document.getElementById('root') | ||
) | ||
}) | ||
``` | ||
|
||
## NiseLiff SDK | ||
|
||
### Setup | ||
|
||
```bash | ||
npm i @niseline/niseliff | ||
``` | ||
|
||
### Usage | ||
|
||
```tsx | ||
import { buildNiseLiff } from '@niseline/niseliff' | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
|
||
const niseliff = buildNiseLiff() | ||
|
||
niseliff | ||
.init({ | ||
liffId: 'DEFAULT_LIFF_ID', // You can any value | ||
}) | ||
.then(() => { | ||
ReactDOM.render( | ||
<React.StrictMode>Your client app</React.StrictMode>, | ||
document.getElementById('root') | ||
) | ||
}) | ||
``` | ||
|
||
### Features | ||
|
||
- [x] [Initialize liff app](https://developers.line.biz/ja/reference/liff/#initialize-liff-app) | ||
- [x] [Get os](https://developers.line.biz/ja/reference/liff/#get-os) | ||
- [x] [Get language](https://developers.line.biz/ja/reference/liff/#get-language) | ||
- [x] [Get version](https://developers.line.biz/ja/reference/liff/#get-version) | ||
- [x] [Get line version](https://developers.line.biz/ja/reference/liff/#get-line-version) | ||
- [x] [Is in client](https://developers.line.biz/ja/reference/liff/#is-in-client) | ||
- [x] [Is logged in](https://developers.line.biz/ja/reference/liff/#is-logged-in) | ||
- [x] [Is api available](https://developers.line.biz/ja/reference/liff/#is-api-available) | ||
- [x] [Login](https://developers.line.biz/ja/reference/liff/#login) | ||
- [x] [Logout](https://developers.line.biz/ja/reference/liff/#logout) | ||
- [x] [Get access token](https://developers.line.biz/ja/reference/liff/#get-access-token) | ||
- [x] [Get ID token](https://developers.line.biz/ja/reference/liff/#get-id-token) | ||
- [x] [Get decoded ID token](https://developers.line.biz/ja/reference/liff/#get-decoded-id-token) | ||
- [x] [Get context](https://developers.line.biz/ja/reference/liff/#get-context) | ||
- [x] [Get profile](https://developers.line.biz/ja/reference/liff/#get-profile) | ||
- [x] [Get friendship](https://developers.line.biz/ja/reference/liff/#get-friendship) | ||
- [ ] [Permission query](https://developers.line.biz/ja/reference/liff/#permission-query) | ||
- [ ] [Permission request all](https://developers.line.biz/ja/reference/liff/#permission-request-all) | ||
- [ ] [Permanent link create url by](https://developers.line.biz/ja/reference/liff/#permanent-link-create-url-by) | ||
- [ ] [Permanent link create url](https://developers.line.biz/ja/reference/liff/#permanent-link-create-url) | ||
- [ ] [Permanent link set extra query param](https://developers.line.biz/ja/reference/liff/#permanent-linke-set-extra-query-param) | ||
- [x] [Send messages](https://developers.line.biz/ja/reference/liff/#send-messages) | ||
- [x] [Open window](https://developers.line.biz/ja/reference/liff/#open-window) | ||
- [ ] [Share target picker](https://developers.line.biz/ja/reference/liff/#share-target-picker) | ||
- [ ] [Scan code v2](https://developers.line.biz/ja/reference/liff/#scan-code-v2) | ||
- [ ] [Scan code](https://developers.line.biz/ja/reference/liff/#scan-code) | ||
- [x] [Close window](https://developers.line.biz/ja/reference/liff/#close-window) | ||
- [x] [Init plugins](https://developers.line.biz/ja/reference/liff/#init-plugins) | ||
- [ ] [Bluetooth get availability](https://developers.line.biz/ja/reference/liff/#bluetooth-get-availability) | ||
- [ ] [Bluetooth request device](https://developers.line.biz/ja/reference/liff/#bluetooth-request-device) | ||
- [ ] [Bluetooth referring device](https://developers.line.biz/ja/reference/liff/#bluetooth-referring-device) | ||
|
||
## NiseLine Server | ||
|
||
### Setup | ||
|
||
#### Docker | ||
|
||
```bash | ||
docker run -d -p 3000:3000 dyoshikawa/niseline:latest | ||
curl http://localhost:3000/niseline/ping | ||
# => {"ping":"pong"} | ||
``` | ||
|
||
### Docker Compose | ||
#### Docker Compose | ||
|
||
```yaml | ||
# docker-compose.yml | ||
|
@@ -30,7 +130,7 @@ curl http://localhost:3000/niseline/ping | |
# => {"ping":"pong"} | ||
``` | ||
|
||
## Usage | ||
### Usage | ||
|
||
```bash | ||
curl --request POST \ | ||
|
@@ -46,9 +146,9 @@ curl -v -X POST 'http://localhost:3000/oauth2/v2.1/verify' \ | |
# => {"iss":"https://example.com","sub":"FOO_ID","aud":"1234567890","exp":1504169092,"iat":1504263657,"nonce":"0987654asdf","amr":["pwd"],"name":"Foo","picture":"http://example.com/foo.jpg","email":"[email protected]"} | ||
``` | ||
|
||
## Features | ||
### Features | ||
|
||
### Login API | ||
#### Login API | ||
|
||
- [ ] [Issue access token](https://developers.line.biz/ja/reference/line-login/#issue-access-token) | ||
- [x] [Verify access token](https://developers.line.biz/ja/reference/line-login/#verify-access-token) | ||
|
@@ -58,7 +158,7 @@ curl -v -X POST 'http://localhost:3000/oauth2/v2.1/verify' \ | |
- [x] [Get user profile](https://developers.line.biz/ja/reference/line-login/#get-user-profile) | ||
- [x] [Get friendship status](https://developers.line.biz/ja/reference/line-login/#get-friendship-status) | ||
|
||
### Messaging API | ||
#### Messaging API | ||
|
||
- [x] [Send reply message](https://developers.line.biz/ja/reference/messaging-api/#send-reply-message) | ||
- [x] [Send push message](https://developers.line.biz/ja/reference/messaging-api/#send-push-message) | ||
|
@@ -74,37 +174,3 @@ curl -v -X POST 'http://localhost:3000/oauth2/v2.1/verify' \ | |
- [ ] [Get number of multicast messages](https://developers.line.biz/ja/reference/messaging-api/#get-number-of-multicast-messages) | ||
- [ ] [Get number of broadcast messages](https://developers.line.biz/ja/reference/messaging-api/#get-number-of-broadcast-messages) | ||
- [ ] [Retry api request](https://developers.line.biz/ja/reference/messaging-api/#retry-api-request) | ||
|
||
### Client SDK | ||
|
||
- [x] [Initialize liff app](https://developers.line.biz/ja/reference/liff/#initialize-liff-app) | ||
- [x] [Get os](https://developers.line.biz/ja/reference/liff/#get-os) | ||
- [x] [Get language](https://developers.line.biz/ja/reference/liff/#get-language) | ||
- [x] [Get version](https://developers.line.biz/ja/reference/liff/#get-version) | ||
- [x] [Get line version](https://developers.line.biz/ja/reference/liff/#get-line-version) | ||
- [x] [Is in client](https://developers.line.biz/ja/reference/liff/#is-in-client) | ||
- [x] [Is logged in](https://developers.line.biz/ja/reference/liff/#is-logged-in) | ||
- [x] [Is api available](https://developers.line.biz/ja/reference/liff/#is-api-available) | ||
- [x] [Login](https://developers.line.biz/ja/reference/liff/#login) | ||
- [x] [Logout](https://developers.line.biz/ja/reference/liff/#logout) | ||
- [x] [Get access token](https://developers.line.biz/ja/reference/liff/#get-access-token) | ||
- [x] [Get ID token](https://developers.line.biz/ja/reference/liff/#get-id-token) | ||
- [x] [Get decoded ID token](https://developers.line.biz/ja/reference/liff/#get-decoded-id-token) | ||
- [x] [Get context](https://developers.line.biz/ja/reference/liff/#get-context) | ||
- [x] [Get profile](https://developers.line.biz/ja/reference/liff/#get-profile) | ||
- [x] [Get friendship](https://developers.line.biz/ja/reference/liff/#get-friendship) | ||
- [ ] [Permission query](https://developers.line.biz/ja/reference/liff/#permission-query) | ||
- [ ] [Permission request all](https://developers.line.biz/ja/reference/liff/#permission-request-all) | ||
- [ ] [Permanent link create url by](https://developers.line.biz/ja/reference/liff/#permanent-link-create-url-by) | ||
- [ ] [Permanent link create url](https://developers.line.biz/ja/reference/liff/#permanent-link-create-url) | ||
- [ ] [Permanent link set extra query param](https://developers.line.biz/ja/reference/liff/#permanent-linke-set-extra-query-param) | ||
- [x] [Send messages](https://developers.line.biz/ja/reference/liff/#send-messages) | ||
- [x] [Open window](https://developers.line.biz/ja/reference/liff/#open-window) | ||
- [ ] [Share target picker](https://developers.line.biz/ja/reference/liff/#share-target-picker) | ||
- [ ] [Scan code v2](https://developers.line.biz/ja/reference/liff/#scan-code-v2) | ||
- [ ] [Scan code](https://developers.line.biz/ja/reference/liff/#scan-code) | ||
- [x] [Close window](https://developers.line.biz/ja/reference/liff/#close-window) | ||
- [x] [Init plugins](https://developers.line.biz/ja/reference/liff/#init-plugins) | ||
- [ ] [Bluetooth get availability](https://developers.line.biz/ja/reference/liff/#bluetooth-get-availability) | ||
- [ ] [Bluetooth request device](https://developers.line.biz/ja/reference/liff/#bluetooth-request-device) | ||
- [ ] [Bluetooth referring device](https://developers.line.biz/ja/reference/liff/#bluetooth-referring-device) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "server", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "", | ||
"private": true, | ||
"scripts": { | ||
|