Skip to content

Commit

Permalink
Merge pull request #471 from tokuhirom/openapi-prototype
Browse files Browse the repository at this point in the history
Openapi
  • Loading branch information
tokuhirom authored Sep 27, 2023
2 parents 4b5816b + 2d60d48 commit 05e1fd4
Show file tree
Hide file tree
Showing 388 changed files with 16,255 additions and 1,525 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.py]
indent_size = 4

[*.java]
indent_size = 4
62 changes: 32 additions & 30 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,35 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependency
run: npm ci
- name: Config Internal Git
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
- name: Clone Doc History
uses: actions/checkout@v4
with:
ref: 'gh-pages'
path: 'doc-dist'
- name: Clean Doc Directory
run: |
cd doc-dist
ls | grep -v '.git' | xargs rm -r
cd ../
- name: Build Docs
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build
- name: Copy & Deploy
run: |
cp -r docs/.vuepress/dist/* doc-dist/
cd doc-dist
git add -A
git commit -m 'Deploy docs'
git push
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependency
run: npm ci
- name: Config Internal Git
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
- name: Clone Doc History
uses: actions/checkout@v4
with:
ref: 'gh-pages'
path: 'doc-dist'
- name: Clean Doc Directory
run: |
cd doc-dist
ls | grep -v '.git' | xargs rm -r
cd ../
- name: Build API Docs
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run apidocs
- name: Build Docs
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build
- name: Copy & Deploy
run: |
cp -r docs/.vuepress/dist/* doc-dist/
cd doc-dist
git add -A
git commit -m 'Deploy docs'
git push
53 changes: 53 additions & 0 deletions .github/workflows/update-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Generate OpenAPI based code

on:
workflow_dispatch:
push:
branches:
- master

jobs:
tests:
name: Generate OpenAPI based code
runs-on: ubuntu-latest

steps:
# Setup
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Update submodules
run: git submodule update --remote --recursive
- uses: actions/setup-node@v3
id: setup_node_id
with:
node-version: 18
- name: actions/setup-java@v3
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
architecture: x64

# Generate codes
- run: |
python3 generate-code.py
# Run tests
- run: npm run test
- run: |
diff=$(git --no-pager diff --name-only)
echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
- if: ${{ env.DIFF_IS_EMPTY != 'true' }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git checkout -b update-diff-${{ env.CURRENT_DATETIME }}
git add lib/**
git commit --allow-empty -m "Codes are generated by openapi"
git push origin update-diff-${{ env.CURRENT_DATETIME }}
gh pr create -B ${{ github.ref_name }} -t "Codes are generated by openapi" -b "" --label "line-openapi-update"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ test/helpers/request.json

# IDE
.idea/

git_push.sh
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "line-openapi"]
path = line-openapi
url = git@github.com:line/line-openapi.git
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# openapi-generator generated files.
lib/channel-access-token/
lib/insight/
lib/liff/
lib/manage-audience/
lib/messaging-api/
lib/module/
lib/module-attach/
lib/shop/
lib/webhook/
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.vuepress/.cache/
/.vuepress/.temp/
/apidocs/
163 changes: 79 additions & 84 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,89 +1,84 @@
import { defaultTheme } from 'vuepress'
import {defaultTheme} from 'vuepress'

export default {
base: "/line-bot-sdk-nodejs/",
head: [
["link", { rel: "icon", href: "/favicon.ico" }]
],
title: "line-bot-sdk-nodejs",
description: "Node.js SDK for LINE Messaging API",
theme: defaultTheme({
// default theme config
navbar: [
{
text: "Introduction",
link: "/"
},
{
text: "Getting Started",
link: "/getting-started"
},
{
text: "Guide",
link: "/guide"
},
{
text: "API Reference",
link: "/api-reference"

},
{
text: "Contributing",
link: "/CONTRIBUTING"
},
{
text: "LINE Developers",
link: "https://developers.line.biz/en/"
},
{
text: "GitHub",
link: "https://github.com/line/line-bot-sdk-nodejs/"
},
base: "/line-bot-sdk-nodejs/",
head: [
["link", {rel: "icon", href: "/favicon.ico"}]
],
sidebar: [
{
title: "Introduction",
collapsable: false,
children: [
"",
]
},
{
title: "Getting Started",
collapsable: false,
children: [
"/getting-started/requirements",
"/getting-started/install",
"/getting-started/basic-usage",
]
},
{
title: "Guide",
collapsable: false,
children: [
"/guide/webhook",
"/guide/client",
"/guide/typescript",
]
},
{
title: "API Reference",
collapsable: false,
children: [
"/api-reference/client",
"/api-reference/validate-signature",
"/api-reference/middleware",
"/api-reference/exceptions",
"/api-reference/message-and-event-objects",
]
},
{
title: "Contributing",
collapsable: false,
children: [
"/CONTRIBUTING",
title: "line-bot-sdk-nodejs",
description: "Node.js SDK for LINE Messaging API",
theme: defaultTheme({
// default theme config
navbar: [
{
text: "Introduction",
link: "/"
},
{
text: "Getting Started",
link: "/getting-started"
},
{
text: "Guide",
link: "/guide"
},
{
text: "API Reference",
link: "/apidocs/modules.html"
},
{
text: "Contributing",
link: "/CONTRIBUTING"
},
{
text: "LINE Developers",
link: "https://developers.line.biz/en/"
},
{
text: "GitHub",
link: "https://github.com/line/line-bot-sdk-nodejs/"
},
],
sidebar: [
{
title: "Introduction",
collapsable: false,
children: [
"",
]
},
{
title: "Getting Started",
collapsable: false,
children: [
"/getting-started/requirements",
"/getting-started/install",
"/getting-started/basic-usage",
]
},
{
title: "Guide",
collapsable: false,
children: [
"/guide/webhook",
"/guide/client",
"/guide/typescript",
]
},
{
title: "API Reference",
collapsable: false,
children: [
"/apidocs/modules.html"
]
},
{
title: "Contributing",
collapsable: false,
children: [
"/CONTRIBUTING",
]
},
]
},
]
}),
}),
}
2 changes: 2 additions & 0 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ For the detailed API reference of each, please refer to their own pages.
- [middleware](api-reference/middleware.md)
- [Exceptions](api-reference/exceptions.md)
- [Message and event objects](api-reference/message-and-event-objects.md)
- [Reference document](apidoc/README.md)
- [Reference document](apidoc/modules.md)
Loading

0 comments on commit 05e1fd4

Please sign in to comment.