tsoa-next 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.MD +57 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +7 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/package.json +53 -0
package/README.MD
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://tsoa-community.github.io/docs/" target="blank">
|
|
3
|
+
<h1>tsoa-next</h1>
|
|
4
|
+
</a>
|
|
5
|
+
Pronounced so·uh
|
|
6
|
+
|
|
7
|
+
OpenAPI-compliant REST APIs using TypeScript and Node
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
[](https://www.npmjs.com/package/tsoa-next)
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
## Goal
|
|
15
|
+
|
|
16
|
+
- TypeScript controllers and models as the single source of truth for your API
|
|
17
|
+
- A valid OpenAPI (formerly Swagger) spec (2.0 or 3.0 if you choose 😍) is generated from your controllers and models, including:
|
|
18
|
+
- Paths (e.g. GET /users)
|
|
19
|
+
- Definitions based on TypeScript interfaces (models)
|
|
20
|
+
- Parameters/model properties marked as required or optional based on TypeScript (e.g. myProperty?: string is optional in the OpenAPI spec)
|
|
21
|
+
- jsDoc supported for object descriptions (most other metadata can be inferred from TypeScript types)
|
|
22
|
+
- Routes are generated for middleware of choice
|
|
23
|
+
- Express, Hapi, and Koa currently supported, other middleware can be supported using a simple handlebars template
|
|
24
|
+
- Validate request payloads
|
|
25
|
+
|
|
26
|
+
## Philosophy
|
|
27
|
+
|
|
28
|
+
- Rely on TypeScript type annotations to generate API metadata if possible
|
|
29
|
+
- If regular type annotations aren't an appropriate way to express metadata, use decorators
|
|
30
|
+
- Use jsdoc for pure text metadata (e.g. endpoint descriptions)
|
|
31
|
+
- Minimize boilerplate
|
|
32
|
+
- Models are best represented by interfaces (pure data structures), but can also be represented by classes
|
|
33
|
+
- Runtime validation of tsoa-next should behave as closely as possible to the specifications that the generated OpenAPI 2/3 schema describes. Any differences in validation logic are clarified by logging warnings during the generation of the OpenAPI Specification (OAS) and/or the routes.
|
|
34
|
+
- Please note that by enabling OpenAPI 3 you minimize the chances of divergent validation logic since OpenAPI 3 has a more expressive schema syntax.
|
|
35
|
+
|
|
36
|
+
## Getting Started
|
|
37
|
+
|
|
38
|
+
- Requirements:
|
|
39
|
+
- Node.js 24.14 or newer
|
|
40
|
+
- npm 11 or newer
|
|
41
|
+
- [Documentation](https://tsoa-community.github.io/docs/)
|
|
42
|
+
- [API Reference](https://tsoa-community.github.io/reference/)
|
|
43
|
+
- [Getting started guide](https://tsoa-community.github.io/docs/getting-started)
|
|
44
|
+
|
|
45
|
+
## Examples
|
|
46
|
+
|
|
47
|
+
Check out the [guides](https://tsoa-community.github.io/docs/getting-started)
|
|
48
|
+
|
|
49
|
+
See example controllers in [the tests](tests/fixtures/controllers)
|
|
50
|
+
|
|
51
|
+
See example models in [the tests](tests/fixtures/testModel.ts)
|
|
52
|
+
|
|
53
|
+
## Help wanted
|
|
54
|
+
|
|
55
|
+
### Contributing code
|
|
56
|
+
|
|
57
|
+
To contribute (via a PR), please first see the [Contributing Guide](https://github.com/vannadii/tsoa-next/tree/master/docs/CONTRIBUTING.md)
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA,wCAAuC;AAEvC,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM;IAAE,KAAK,IAAA,YAAM,GAAE,CAAA"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("@tsoa-next/runtime"), exports);
|
|
18
|
+
__exportStar(require("@tsoa-next/cli"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,iDAA8B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tsoa-next",
|
|
3
|
+
"version": "7.1.0",
|
|
4
|
+
"description": "Build swagger-compliant REST APIs using TypeScript and Node",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"typings": "./dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"bin": {
|
|
11
|
+
"tsoa": "dist/cli.js"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "npm run tsc",
|
|
15
|
+
"tsc": "tsc -b",
|
|
16
|
+
"watch": "tsc -b -w"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"codegen",
|
|
20
|
+
"express",
|
|
21
|
+
"generation",
|
|
22
|
+
"hapi.js",
|
|
23
|
+
"koa",
|
|
24
|
+
"node",
|
|
25
|
+
"node.js",
|
|
26
|
+
"openapi",
|
|
27
|
+
"server",
|
|
28
|
+
"swagger",
|
|
29
|
+
"typescript"
|
|
30
|
+
],
|
|
31
|
+
"author": "Luke Autry <lukeautry@gmail.com> (http://www.lukeautry.com)",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@tsoa-next/cli": "7.1.0",
|
|
35
|
+
"@tsoa-next/runtime": "7.1.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "24.12.0",
|
|
39
|
+
"typescript": "^5.9.3"
|
|
40
|
+
},
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "https://github.com/VannaDii/tsoa-next.git"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=24.14.0",
|
|
47
|
+
"npm": ">=11.0.0"
|
|
48
|
+
},
|
|
49
|
+
"engineStrict": true,
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
}
|
|
53
|
+
}
|