@abitechdev/openchasqui-generator-examples 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 +48 -7
- package/package.json +14 -6
package/README.md
CHANGED
|
@@ -1,12 +1,53 @@
|
|
|
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-generator-examples
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/@abitechdev/openchasqui-generator-examples)
|
|
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
|
+
Completa los ejemplos que faltan en parámetros y cuerpos con datos sintéticos deterministas. Con `data: es-pe` usa datos peruanos: nombres, DNI, RUC, celular y ubigeo.
|
|
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-generator-examples
|
|
20
|
+
pnpm add @abitechdev/openchasqui-core @abitechdev/openchasqui-loader-openapi @abitechdev/openchasqui-emitter-bruno @abitechdev/openchasqui-generator-examples
|
|
21
|
+
yarn add @abitechdev/openchasqui-core @abitechdev/openchasqui-loader-openapi @abitechdev/openchasqui-emitter-bruno @abitechdev/openchasqui-generator-examples
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Requiere Node.js 22 o superior.
|
|
25
|
+
|
|
26
|
+
## Uso
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { readFile } from "node:fs/promises";
|
|
30
|
+
import { run } from "@abitechdev/openchasqui-core";
|
|
31
|
+
import { openApiLoader } from "@abitechdev/openchasqui-loader-openapi";
|
|
32
|
+
import { brunoEmitter } from "@abitechdev/openchasqui-emitter-bruno";
|
|
33
|
+
import { examplesGenerator } from "@abitechdev/openchasqui-generator-examples";
|
|
34
|
+
|
|
35
|
+
const result = await run(
|
|
36
|
+
{ version: 1, source: "openapi.yaml", data: "es-pe", targets: ["bruno"], output: "collections" },
|
|
37
|
+
{
|
|
38
|
+
reader: { readText: (path) => readFile(path, "utf8") },
|
|
39
|
+
plugins: [openApiLoader, examplesGenerator, brunoEmitter],
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Respeta los ejemplos que el contrato ya declara. La misma operación produce
|
|
45
|
+
siempre los mismos datos.
|
|
46
|
+
|
|
47
|
+
## Documentación
|
|
4
48
|
|
|
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).
|
|
49
|
+
[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
50
|
|
|
10
|
-
##
|
|
51
|
+
## Licencia
|
|
11
52
|
|
|
12
|
-
Apache-2.0
|
|
53
|
+
[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,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abitechdev/openchasqui-generator-examples",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Fills missing parameter and body examples with deterministic synthetic data.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"openapi",
|
|
7
|
+
"examples",
|
|
8
|
+
"fake-data",
|
|
9
|
+
"test-data",
|
|
10
|
+
"peru",
|
|
11
|
+
"openchasqui"
|
|
12
|
+
],
|
|
5
13
|
"license": "Apache-2.0",
|
|
6
14
|
"type": "module",
|
|
7
15
|
"exports": {
|
|
@@ -24,12 +32,12 @@
|
|
|
24
32
|
"directory": "packages/generator-examples"
|
|
25
33
|
},
|
|
26
34
|
"dependencies": {
|
|
27
|
-
"@abitechdev/openchasqui-plugin-kit": "^0.1.
|
|
28
|
-
"@abitechdev/openchasqui-spec": "^0.1.
|
|
29
|
-
"@abitechdev/openchasqui-data-es-pe": "^0.1.
|
|
35
|
+
"@abitechdev/openchasqui-plugin-kit": "^0.1.1",
|
|
36
|
+
"@abitechdev/openchasqui-spec": "^0.1.1",
|
|
37
|
+
"@abitechdev/openchasqui-data-es-pe": "^0.1.1"
|
|
30
38
|
},
|
|
31
39
|
"devDependencies": {
|
|
32
|
-
"@abitechdev/openchasqui-core": "^0.1.
|
|
33
|
-
"@abitechdev/openchasqui-loader-openapi": "^0.1.
|
|
40
|
+
"@abitechdev/openchasqui-core": "^0.1.1",
|
|
41
|
+
"@abitechdev/openchasqui-loader-openapi": "^0.1.1"
|
|
34
42
|
}
|
|
35
43
|
}
|