Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add /generator path #7

Merged
merged 26 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c27d767
feat: add /generator path
magicmatatjahu Nov 30, 2021
ac53e0b
improve validation of input
magicmatatjahu Nov 30, 2021
f14753a
improve validation of input
magicmatatjahu Nov 30, 2021
9e9d556
improve validation of input
magicmatatjahu Nov 30, 2021
358addf
improve validation of input
magicmatatjahu Nov 30, 2021
108215b
improve validation of request bodies
magicmatatjahu Nov 30, 2021
a449f60
improve validation of request bodies
magicmatatjahu Nov 30, 2021
f1bdd59
improve validation of request bodies
magicmatatjahu Nov 30, 2021
00fb6fd
add tests
magicmatatjahu Dec 1, 2021
72a1d5d
add tests
magicmatatjahu Dec 1, 2021
d034321
add tests
magicmatatjahu Dec 1, 2021
da6c4f5
add tests for /generator path
magicmatatjahu Dec 1, 2021
efbb14f
add logs to ignore folder
magicmatatjahu Dec 1, 2021
f204a4b
extract archiver to separate service
magicmatatjahu Dec 3, 2021
6f5df2a
add more tests
magicmatatjahu Dec 3, 2021
37a9c87
add more tests
magicmatatjahu Dec 3, 2021
b11a011
update deps
magicmatatjahu Dec 3, 2021
0f9a60e
remove unnecessary code
magicmatatjahu Dec 3, 2021
6c5af13
after review
magicmatatjahu Dec 3, 2021
c0163dd
update deps
magicmatatjahu Dec 9, 2021
cee0923
change /generator -> /generate
magicmatatjahu Dec 9, 2021
91db24e
after review
magicmatatjahu Dec 9, 2021
baaa950
remove unnecessary middleware
magicmatatjahu Dec 9, 2021
7ee1471
remove unnecessary files
magicmatatjahu Dec 10, 2021
06f263d
update cors
magicmatatjahu Dec 10, 2021
1e07cf3
trigger build
magicmatatjahu Dec 14, 2021
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ node_modules
.vscode
coverage
lib
examples
logs
*.DS_Store
32 changes: 32 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
coverageReporters: [
'json-summary',
'lcov',
'text'
],
collectCoverageFrom: [
'src/**'
],

preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.tsx?$': 'ts-jest',
},

// Test spec file resolution pattern
// Matches parent folder `tests` or `__tests__` and filename
// should contain `test` or `spec`.
testMatch: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
// Module file extensions for importing
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],

testTimeout: 20000,

setupFiles: ["./tests/jest.setup.ts"],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
},
},
};
12 changes: 12 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"watch": [
"src",
".env"
],
"ext": "js,ts,json",
"ignore": [
"src/**/*.spec.ts",
"src/**/*.test.ts"
],
"exec": "ts-node --transpile-only src/server.ts"
}
14 changes: 9 additions & 5 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ servers:
- url: https://api.asyncapi.com/v1

paths:
/generator:
/generate:
post:
summary: Generate the given AsyncAPI template.
operationId: generator
operationId: generate
tags:
- generate
- generator
- template
externalDocs:
Expand Down Expand Up @@ -80,15 +81,14 @@ components:
type: string
description: Template name to be generated.
enum:
- 'html'
- 'markdown'
- '@asyncapi/html-template'
- '@asyncapi/markdown-template'
parameters:
type: object
description: |
Template parameters to be generated. Each template has different parameters that you should check in the documentation,
which is usually located in the template's repository.
This field is optional but may be required for some templates.
minProperties: 1
additionalProperties: true
Problem:
type: object
Expand Down Expand Up @@ -128,4 +128,8 @@ components:
description: |
An absolute URI that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.
required:
- type
- title
- status
additionalProperties: true
Loading