@abitechdev/openchasqui-spec 0.1.0 → 0.1.1
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 +51 -7
- package/package.json +8 -1
package/README.md
CHANGED
|
@@ -1,12 +1,56 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/abitech-dev/abitech-openchasqui-cli#readme"><img alt="OpenChasqui" src="https://raw.githubusercontent.com/abitech-dev/abitech-openchasqui-cli/main/.github/assets/logo-light.svg" width="320"></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
1
5
|
# @abitechdev/openchasqui-spec
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/@abitechdev/openchasqui-spec)
|
|
8
|
+
[](https://github.com/abitech-dev/abitech-openchasqui-cli/actions/workflows/ci.yml)
|
|
9
|
+
[](https://github.com/abitech-dev/abitech-openchasqui-cli/blob/main/LICENSE)
|
|
10
|
+
|
|
11
|
+
Contrato de OpenChasqui: el modelo canónico de la API, los tipos de la configuración y la interfaz de cada tipo de plugin. Es la única dependencia que necesitas para escribir un plugin propio.
|
|
12
|
+
|
|
13
|
+
> **¿Solo quieres generar colecciones?** Instala el CLI,
|
|
14
|
+
> [`@abitechdev/openchasqui`](https://www.npmjs.com/package/@abitechdev/openchasqui), que ya incluye este paquete.
|
|
15
|
+
|
|
16
|
+
## Instalación
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm i @abitechdev/openchasqui-spec
|
|
20
|
+
pnpm add @abitechdev/openchasqui-spec
|
|
21
|
+
yarn add @abitechdev/openchasqui-spec
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Requiere Node.js 22 o superior.
|
|
25
|
+
|
|
26
|
+
## Uso
|
|
27
|
+
|
|
28
|
+
Un emisor que lista las rutas del contrato:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import type { Emitter } from "@abitechdev/openchasqui-spec";
|
|
32
|
+
|
|
33
|
+
export const routesEmitter: Emitter = {
|
|
34
|
+
name: "routes-emitter",
|
|
35
|
+
kind: "emitter",
|
|
36
|
+
apiVersion: 1,
|
|
37
|
+
target: "routes",
|
|
38
|
+
emit: async ({ model }) => [
|
|
39
|
+
{
|
|
40
|
+
path: "routes.txt",
|
|
41
|
+
contents: model.operations.map((op) => `${op.method} ${op.path}`).join("\n"),
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Los tipos de plugin son `document-transformer`, `loader`, `transformer`,
|
|
48
|
+
`generator`, `validator` y `emitter`.
|
|
49
|
+
|
|
50
|
+
## Documentación
|
|
4
51
|
|
|
5
|
-
|
|
6
|
-
([en español](https://github.com/abitech-dev/abitech-openchasqui-cli#readme)), which generates API collections from
|
|
7
|
-
OpenAPI. Most projects only need the command line,
|
|
8
|
-
[`@abitechdev/openchasqui`](https://www.npmjs.com/package/@abitechdev/openchasqui).
|
|
52
|
+
[Español](https://github.com/abitech-dev/abitech-openchasqui-cli#readme) · [English](https://github.com/abitech-dev/abitech-openchasqui-cli/blob/main/README.en.md)
|
|
9
53
|
|
|
10
|
-
##
|
|
54
|
+
## Licencia
|
|
11
55
|
|
|
12
|
-
Apache-2.0
|
|
56
|
+
[Apache-2.0](https://github.com/abitech-dev/abitech-openchasqui-cli/blob/main/LICENSE). Parte de [OpenChasqui](https://github.com/abitech-dev/abitech-openchasqui-cli).
|
package/package.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abitechdev/openchasqui-spec",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Canonical API model, plugin contract and configuration types for OpenChasqui.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"openapi",
|
|
7
|
+
"api-model",
|
|
8
|
+
"plugin-contract",
|
|
9
|
+
"typescript",
|
|
10
|
+
"openchasqui"
|
|
11
|
+
],
|
|
5
12
|
"license": "Apache-2.0",
|
|
6
13
|
"type": "module",
|
|
7
14
|
"exports": {
|