Skip to content

Commit 05e1fd4

Browse files
authored
Merge pull request #471 from tokuhirom/openapi-prototype
Openapi
2 parents 4b5816b + 2d60d48 commit 05e1fd4

File tree

388 files changed

+16255
-1525
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

388 files changed

+16255
-1525
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ insert_final_newline = true
1010

1111
[*.md]
1212
trim_trailing_whitespace = false
13+
14+
[*.py]
15+
indent_size = 4
16+
17+
[*.java]
18+
indent_size = 4

.github/workflows/deploy-docs.yml

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,35 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v4
14-
- name: Use Node.js 18
15-
uses: actions/setup-node@v3
16-
with:
17-
node-version: 18
18-
- name: Install Dependency
19-
run: npm ci
20-
- name: Config Internal Git
21-
run: |
22-
git config --global user.email "action@github.com"
23-
git config --global user.name "GitHub Action"
24-
- name: Clone Doc History
25-
uses: actions/checkout@v4
26-
with:
27-
ref: 'gh-pages'
28-
path: 'doc-dist'
29-
- name: Clean Doc Directory
30-
run: |
31-
cd doc-dist
32-
ls | grep -v '.git' | xargs rm -r
33-
cd ../
34-
- name: Build Docs
35-
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build
36-
- name: Copy & Deploy
37-
run: |
38-
cp -r docs/.vuepress/dist/* doc-dist/
39-
cd doc-dist
40-
git add -A
41-
git commit -m 'Deploy docs'
42-
git push
13+
- uses: actions/checkout@v4
14+
- name: Use Node.js 18
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: 18
18+
- name: Install Dependency
19+
run: npm ci
20+
- name: Config Internal Git
21+
run: |
22+
git config --global user.email "action@github.com"
23+
git config --global user.name "GitHub Action"
24+
- name: Clone Doc History
25+
uses: actions/checkout@v4
26+
with:
27+
ref: 'gh-pages'
28+
path: 'doc-dist'
29+
- name: Clean Doc Directory
30+
run: |
31+
cd doc-dist
32+
ls | grep -v '.git' | xargs rm -r
33+
cd ../
34+
- name: Build API Docs
35+
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run apidocs
36+
- name: Build Docs
37+
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build
38+
- name: Copy & Deploy
39+
run: |
40+
cp -r docs/.vuepress/dist/* doc-dist/
41+
cd doc-dist
42+
git add -A
43+
git commit -m 'Deploy docs'
44+
git push

.github/workflows/update-code.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Generate OpenAPI based code
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
tests:
11+
name: Generate OpenAPI based code
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
# Setup
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
- name: Update submodules
20+
run: git submodule update --remote --recursive
21+
- uses: actions/setup-node@v3
22+
id: setup_node_id
23+
with:
24+
node-version: 18
25+
- name: actions/setup-java@v3
26+
uses: actions/setup-java@v3
27+
with:
28+
distribution: 'temurin'
29+
java-version: 17
30+
architecture: x64
31+
32+
# Generate codes
33+
- run: |
34+
python3 generate-code.py
35+
# Run tests
36+
- run: npm run test
37+
- run: |
38+
diff=$(git --no-pager diff --name-only)
39+
echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
40+
echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
41+
- if: ${{ env.DIFF_IS_EMPTY != 'true' }}
42+
run: |
43+
git config user.name github-actions
44+
git config user.email github-actions@github.com
45+
git checkout -b update-diff-${{ env.CURRENT_DATETIME }}
46+
47+
git add lib/**
48+
git commit --allow-empty -m "Codes are generated by openapi"
49+
50+
git push origin update-diff-${{ env.CURRENT_DATETIME }}
51+
gh pr create -B ${{ github.ref_name }} -t "Codes are generated by openapi" -b "" --label "line-openapi-update"
52+
env:
53+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@ test/helpers/request.json
6565

6666
# IDE
6767
.idea/
68+
69+
git_push.sh

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "line-openapi"]
2+
path = line-openapi
3+
url = git@github.com:line/line-openapi.git

.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# openapi-generator generated files.
2+
lib/channel-access-token/
3+
lib/insight/
4+
lib/liff/
5+
lib/manage-audience/
6+
lib/messaging-api/
7+
lib/module/
8+
lib/module-attach/
9+
lib/shop/
10+
lib/webhook/

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/.vuepress/.cache/
22
/.vuepress/.temp/
3+
/apidocs/

docs/.vuepress/config.js

Lines changed: 79 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,84 @@
1-
import { defaultTheme } from 'vuepress'
1+
import {defaultTheme} from 'vuepress'
22

33
export default {
4-
base: "/line-bot-sdk-nodejs/",
5-
head: [
6-
["link", { rel: "icon", href: "/favicon.ico" }]
7-
],
8-
title: "line-bot-sdk-nodejs",
9-
description: "Node.js SDK for LINE Messaging API",
10-
theme: defaultTheme({
11-
// default theme config
12-
navbar: [
13-
{
14-
text: "Introduction",
15-
link: "/"
16-
},
17-
{
18-
text: "Getting Started",
19-
link: "/getting-started"
20-
},
21-
{
22-
text: "Guide",
23-
link: "/guide"
24-
},
25-
{
26-
text: "API Reference",
27-
link: "/api-reference"
28-
29-
},
30-
{
31-
text: "Contributing",
32-
link: "/CONTRIBUTING"
33-
},
34-
{
35-
text: "LINE Developers",
36-
link: "https://developers.line.biz/en/"
37-
},
38-
{
39-
text: "GitHub",
40-
link: "https://github.com/line/line-bot-sdk-nodejs/"
41-
},
4+
base: "/line-bot-sdk-nodejs/",
5+
head: [
6+
["link", {rel: "icon", href: "/favicon.ico"}]
427
],
43-
sidebar: [
44-
{
45-
title: "Introduction",
46-
collapsable: false,
47-
children: [
48-
"",
49-
]
50-
},
51-
{
52-
title: "Getting Started",
53-
collapsable: false,
54-
children: [
55-
"/getting-started/requirements",
56-
"/getting-started/install",
57-
"/getting-started/basic-usage",
58-
]
59-
},
60-
{
61-
title: "Guide",
62-
collapsable: false,
63-
children: [
64-
"/guide/webhook",
65-
"/guide/client",
66-
"/guide/typescript",
67-
]
68-
},
69-
{
70-
title: "API Reference",
71-
collapsable: false,
72-
children: [
73-
"/api-reference/client",
74-
"/api-reference/validate-signature",
75-
"/api-reference/middleware",
76-
"/api-reference/exceptions",
77-
"/api-reference/message-and-event-objects",
78-
]
79-
},
80-
{
81-
title: "Contributing",
82-
collapsable: false,
83-
children: [
84-
"/CONTRIBUTING",
8+
title: "line-bot-sdk-nodejs",
9+
description: "Node.js SDK for LINE Messaging API",
10+
theme: defaultTheme({
11+
// default theme config
12+
navbar: [
13+
{
14+
text: "Introduction",
15+
link: "/"
16+
},
17+
{
18+
text: "Getting Started",
19+
link: "/getting-started"
20+
},
21+
{
22+
text: "Guide",
23+
link: "/guide"
24+
},
25+
{
26+
text: "API Reference",
27+
link: "/apidocs/modules.html"
28+
},
29+
{
30+
text: "Contributing",
31+
link: "/CONTRIBUTING"
32+
},
33+
{
34+
text: "LINE Developers",
35+
link: "https://developers.line.biz/en/"
36+
},
37+
{
38+
text: "GitHub",
39+
link: "https://github.com/line/line-bot-sdk-nodejs/"
40+
},
41+
],
42+
sidebar: [
43+
{
44+
title: "Introduction",
45+
collapsable: false,
46+
children: [
47+
"",
48+
]
49+
},
50+
{
51+
title: "Getting Started",
52+
collapsable: false,
53+
children: [
54+
"/getting-started/requirements",
55+
"/getting-started/install",
56+
"/getting-started/basic-usage",
57+
]
58+
},
59+
{
60+
title: "Guide",
61+
collapsable: false,
62+
children: [
63+
"/guide/webhook",
64+
"/guide/client",
65+
"/guide/typescript",
66+
]
67+
},
68+
{
69+
title: "API Reference",
70+
collapsable: false,
71+
children: [
72+
"/apidocs/modules.html"
73+
]
74+
},
75+
{
76+
title: "Contributing",
77+
collapsable: false,
78+
children: [
79+
"/CONTRIBUTING",
80+
]
81+
},
8582
]
86-
},
87-
]
88-
}),
83+
}),
8984
}

docs/api-reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ For the detailed API reference of each, please refer to their own pages.
1818
- [middleware](api-reference/middleware.md)
1919
- [Exceptions](api-reference/exceptions.md)
2020
- [Message and event objects](api-reference/message-and-event-objects.md)
21+
- [Reference document](apidoc/README.md)
22+
- [Reference document](apidoc/modules.md)

0 commit comments

Comments
 (0)