Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit a2f6e2a

Browse files
authored
Merge pull request #106 from polyphony-chat/typespec
TypeSpec
2 parents aa4cc14 + 144b255 commit a2f6e2a

27 files changed

+2777
-38
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.md linguist-detectable
22
styles/* linguist-vendored
3-
styles/config linguist-detectable
3+
styles/config linguist-detectable
4+
*.tsp linguist-language=TypeSpec

.github/dependabot.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,10 @@ updates:
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "weekly"
12-
12+
- package-ecosystem: "npm"
13+
directories:
14+
- "/api/core"
15+
- "/api/auth"
16+
- "/api/chat"
17+
schedule:
18+
interval: "weekly"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build and Deploy OpenAPI configuration
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
permissions:
8+
contents: write
9+
jobs:
10+
build_and_deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Configure git Credentials
17+
run: |
18+
git config user.name github-actions[bot]
19+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: "lts/*"
23+
cache: "npm"
24+
cache-dependency-path: "./api/core/package-lock.json"
25+
- name: Install TypeSpec and compile project
26+
run: |
27+
cd ./api/src/core/
28+
npm install -g @typespec/compiler
29+
npm install
30+
tsp compile .
31+
- name: Commit OpenAPI specification to repository
32+
run: |
33+
cd ../../
34+
mv ./src/core/tsp-output/@typespec/openapi3/openapi.v1.0.yaml ./build/core-openapi3.yaml
35+
git add ./build/*
36+
git commit -m "[bot]update openapi3 schema"
37+
git push

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# typespec
2+
3+
# Default TypeSpec output
4+
dist/
5+
6+
# Dependency directories
7+
node_modules/
8+
19
# Byte-compiled / optimized / DLL files
210
__pycache__/
311
*.py[cod]
@@ -8,7 +16,6 @@ __pycache__/
816

917
# Distribution / packaging
1018
.Python
11-
build/
1219
develop-eggs/
1320
dist/
1421
downloads/

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"davidanson.vscode-markdownlint",
44
"chrischinchilla.vale-vscode",
55
"valentjn.vscode-ltex",
6-
"gruntfuggly.todo-tree"
6+
"gruntfuggly.todo-tree",
7+
"typespec.typespec-vscode"
78
]
89
}

.vscode/ltex.dictionary.en-US.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ polyproto-auth
1919
CAs
2020
TTLs
2121
NLnet
22+
OpenAPI
23+
TypeSpec
24+
Protobuf

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 polyphony
3+
Copyright (c) 2023 The "polyphony-chat" GitHub Organization and all "docs" repository contributors.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ Built with mkdocs-material and python3.12
55

66
## File structure
77

8-
The `/docs` folder has the specification documents for the polyproto protocol. The `docs/APIs` folder houses the API documentation for the polyproto-core and polyphony-chat reference implementation.
8+
The `/docs` folder has the specification documents for the polyproto protocol.
99

1010
The `/snippets` folder has snippets of text used in many places in the documentation. This is to ensure consistency across the documentation. Error messages appearing in many places are also stored in the `/snippets/errors` folder.
1111

12+
API documentation in form of [TypeSpec](https://typespec.io) files can be found in the `/api` directory.
13+
TypeSpec can compile to OpenAPI3, JSON Schema and Protobuf. Our TypeSpec project is targeting OpenAPI3
14+
output. Read the TypeSpec documentation for information on how to compile TypeSpec or use a pre-compiled
15+
version of the OpenAPI schema if you'd like.
16+
1217
## Contributing
1318

1419
The best way to contribute is to open an issue if you find any problems with the documentation. Creating an issue is generally the best way to contribute to any open source project. Issues allow for an exchange between contributors and maintainers to discuss the viability of implementing an issue, usually minimizing frustration.

api/build/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# polyproto OpenAPI3 specification
2+
3+
This folder contains pre-compiled OpenAPI3 specification documents for polyproto.

0 commit comments

Comments
 (0)