Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

feat: add versioning #3

Merged
merged 2 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"scripts": {
"dev": "tsp compile specs --watch & pnpm run _doc",
"compile": "tsp compile specs",
"compile": "tsp compile specs && source ./scripts/compile.sh",
"_doc": "redocly preview-docs schema/@typespec/openapi3/openapi.yaml",
"bundle": "pnpm run compile && redocly build-docs schema/@typespec/openapi3/openapi.yaml --output bundled/index.html",
"format": "tsp format specs"
Expand All @@ -13,7 +13,8 @@
"@typespec/compiler": "latest",
"@typespec/http": "latest",
"@typespec/openapi3": "latest",
"@typespec/rest": "latest"
"@typespec/rest": "latest",
"@typespec/versioning": "latest"
},
"private": true,
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

315 changes: 315 additions & 0 deletions schema/@typespec/openapi3/openapi.v0.1.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,315 @@
openapi: 3.0.0
info:
title: BeLifeline Server API
version: v0.1.0
tags:
- name: Algorithm
- name: Admin
paths:
/admin/algorithm:
post:
tags:
- Admin
operationId: Algorithm_create
parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
type: object
properties:
algorithm_id:
type: string
description: From Admin API
algorithm_name:
type: string
algorithm_description:
type: string
need_external:
type: array
items:
type: string
first_entry_at:
type: string
format: date-time
last_entry_at:
type: string
format: date-time
last_updated_at:
type: string
format: date-time
bearer_token:
type: string
required:
- algorithm_id
- algorithm_name
- algorithm_description
- need_external
- first_entry_at
- last_entry_at
- last_updated_at
- bearer_token
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
algorithm:
$ref: '#/components/schemas/AlgorithmInfomationCreate'
required:
- algorithm
security:
- BearerAuth: []
/admin/algorithm/{algorithm_id}:
delete:
tags:
- Admin
operationId: Algorithm_delete
parameters:
- name: algorithm_id
in: path
required: true
schema:
type: string
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
type: object
properties:
delete_algorithm_id:
type: string
required:
- delete_algorithm_id
security:
- BearerAuth: []
/algorithm:
get:
tags:
- Algorithm
operationId: Algorithm_list
parameters:
- name: limit
in: query
required: false
schema:
type: integer
format: int32
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/AlgorithmInfomation'
security:
- BearerAuth: []
post:
tags:
- Algorithm
operationId: Algorithm_create
parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
$ref: '#/components/schemas/AlgorithmInfomation'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
algorithm:
$ref: '#/components/schemas/AlgorithmInfomationCreate'
required:
- algorithm
security:
- BearerAuth: []
/algorithm/{algorithm_id}:
put:
tags:
- Algorithm
operationId: EachAlgorithm_update
parameters:
- name: algorithm_id
in: path
required: true
schema:
type: string
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
$ref: '#/components/schemas/AlgorithmInfomation'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
update_algorithm:
$ref: '#/components/schemas/AlgorithmInfomationCreateOrUpdate'
required:
- update_algorithm
security:
- BearerAuth: []
get:
tags:
- Algorithm
operationId: EachAlgorithm_get
parameters:
- name: algorithm_id
in: path
required: true
schema:
type: string
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
$ref: '#/components/schemas/AlgorithmInfomation'
security:
- BearerAuth: []
delete:
tags:
- Algorithm
operationId: EachAlgorithm_delete
parameters:
- name: algorithm_id
in: path
required: true
schema:
type: string
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
type: object
properties:
delete_algorithm_id:
type: string
required:
- delete_algorithm_id
security:
- BearerAuth: []
components:
schemas:
AlgorithmInfomation:
type: object
required:
- algorithm_id
- algorithm_name
- algorithm_description
- need_external
- first_entry_at
- last_entry_at
- last_updated_at
properties:
algorithm_id:
type: string
description: From Admin API
algorithm_name:
type: string
algorithm_description:
type: string
need_external:
type: array
items:
type: string
first_entry_at:
type: string
format: date-time
last_entry_at:
type: string
format: date-time
last_updated_at:
type: string
format: date-time
AlgorithmInfomationCreate:
type: object
required:
- algorithm_name
- algorithm_description
- need_external
properties:
algorithm_name:
type: string
algorithm_description:
type: string
need_external:
type: array
items:
type: string
AlgorithmInfomationCreateOrUpdate:
type: object
required:
- algorithm_id
- algorithm_name
- algorithm_description
- need_external
properties:
algorithm_id:
type: string
description: From Admin API
algorithm_name:
type: string
algorithm_description:
type: string
need_external:
type: array
items:
type: string
ExternalInfomation:
type: object
required:
- external_id
- external_name
- external_description
- first_entry_at
- last_updated_at
- updated_history
properties:
external_id:
type: string
external_name:
type: string
external_description:
type: string
first_entry_at:
type: string
format: date-time
last_updated_at:
type: string
format: date-time
updated_history:
type: array
items:
type: string
format: date-time
Versions:
type: string
enum:
- v0.1.0
securitySchemes:
BearerAuth:
type: http
scheme: bearer
Loading