@abitechdev/openchasqui-transformer-overlay 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 +62 -7
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -1,12 +1,67 @@
|
|
|
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-transformer-overlay
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/@abitechdev/openchasqui-transformer-overlay)
|
|
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
|
+
Aplica documentos [OpenAPI Overlay 1.0](https://spec.openapis.org/overlay/v1.0.html) antes de cargar el contrato: renombra, reagrupa u oculta endpoints sin tocar el original.
|
|
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-core @abitechdev/openchasqui-loader-openapi @abitechdev/openchasqui-emitter-bruno @abitechdev/openchasqui-transformer-overlay
|
|
20
|
+
pnpm add @abitechdev/openchasqui-core @abitechdev/openchasqui-loader-openapi @abitechdev/openchasqui-emitter-bruno @abitechdev/openchasqui-transformer-overlay
|
|
21
|
+
yarn add @abitechdev/openchasqui-core @abitechdev/openchasqui-loader-openapi @abitechdev/openchasqui-emitter-bruno @abitechdev/openchasqui-transformer-overlay
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Requiere Node.js 22 o superior.
|
|
25
|
+
|
|
26
|
+
## Uso
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
# nombres.overlay.yaml
|
|
30
|
+
overlay: 1.0.0
|
|
31
|
+
info: { title: Nombres en español, version: 1.0.0 }
|
|
32
|
+
actions:
|
|
33
|
+
- target: $.paths['/pets'].get
|
|
34
|
+
update:
|
|
35
|
+
summary: Listar mascotas
|
|
36
|
+
x-openchasqui-folder: Mascotas
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { readFile } from "node:fs/promises";
|
|
41
|
+
import { run } from "@abitechdev/openchasqui-core";
|
|
42
|
+
import { openApiLoader } from "@abitechdev/openchasqui-loader-openapi";
|
|
43
|
+
import { brunoEmitter } from "@abitechdev/openchasqui-emitter-bruno";
|
|
44
|
+
import { overlayTransformer } from "@abitechdev/openchasqui-transformer-overlay";
|
|
45
|
+
|
|
46
|
+
const result = await run(
|
|
47
|
+
{
|
|
48
|
+
version: 1,
|
|
49
|
+
source: "openapi.yaml",
|
|
50
|
+
overlays: ["nombres.overlay.yaml"],
|
|
51
|
+
targets: ["bruno"],
|
|
52
|
+
output: "collections",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
reader: { readText: (path) => readFile(path, "utf8") },
|
|
56
|
+
plugins: [overlayTransformer, openApiLoader, brunoEmitter],
|
|
57
|
+
},
|
|
58
|
+
);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Documentación
|
|
4
62
|
|
|
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).
|
|
63
|
+
[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
64
|
|
|
10
|
-
##
|
|
65
|
+
## Licencia
|
|
11
66
|
|
|
12
|
-
Apache-2.0
|
|
67
|
+
[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-transformer-overlay",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Applies OpenAPI Overlay 1.0 documents before loading the contract.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"openapi",
|
|
7
|
+
"openapi-overlay",
|
|
8
|
+
"overlay",
|
|
9
|
+
"jsonpath",
|
|
10
|
+
"openchasqui"
|
|
11
|
+
],
|
|
5
12
|
"license": "Apache-2.0",
|
|
6
13
|
"type": "module",
|
|
7
14
|
"exports": {
|
|
@@ -26,9 +33,9 @@
|
|
|
26
33
|
"dependencies": {
|
|
27
34
|
"json-p3": "3.0.3",
|
|
28
35
|
"yaml": "2.9.1",
|
|
29
|
-
"@abitechdev/openchasqui-spec": "^0.1.
|
|
36
|
+
"@abitechdev/openchasqui-spec": "^0.1.1"
|
|
30
37
|
},
|
|
31
38
|
"devDependencies": {
|
|
32
|
-
"@abitechdev/openchasqui-core": "^0.1.
|
|
39
|
+
"@abitechdev/openchasqui-core": "^0.1.1"
|
|
33
40
|
}
|
|
34
41
|
}
|