@empathyco/x-adapter 8.1.8 → 8.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-adapter",
3
- "version": "8.1.8",
3
+ "version": "8.2.0",
4
4
  "description": "A utils library to create a client for any API",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -20,7 +20,8 @@
20
20
  "module": "dist/esm/index.js",
21
21
  "types": "dist/types/index.d.ts",
22
22
  "files": [
23
- "dist"
23
+ "dist",
24
+ "skills"
24
25
  ],
25
26
  "engines": {
26
27
  "node": ">=22"
@@ -43,16 +44,16 @@
43
44
  "prepublishOnly": "pnpm run build"
44
45
  },
45
46
  "dependencies": {
46
- "@empathyco/x-utils": "1.0.9"
47
+ "@empathyco/x-utils": "1.1.0"
47
48
  },
48
49
  "devDependencies": {
49
50
  "@vitest/coverage-v8": "4.1.9",
50
- "jsdom": "29.1.1",
51
+ "jsdom": "30.0.1",
51
52
  "typescript": "5.9.3",
52
53
  "vitest": "4.1.9"
53
54
  },
54
55
  "publishConfig": {
55
56
  "access": "public"
56
57
  },
57
- "gitHead": "7ccb116efa9112c1025bea024fdcd0a09cdfadc2"
58
+ "gitHead": "8c0652d19cb33994ce6221c0cd1f36a9e1acdec6"
58
59
  }
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: x-adapter
3
+ description: 'Use when importing, using, or debugging components from x-adapter.'
4
+ ---
5
+
6
+ # x-adapter
7
+
8
+ Librería de utilidades para crear un cliente de cualquier API: configura endpoints, mapea peticiones y respuestas (con o sin schemas) y reutiliza mappers.
9
+
10
+ ## Componentes disponibles
11
+
12
+ - `endpointAdapterFactory` — crea un `EndpointAdapter` (función de petición) a partir de `endpoint`, `httpClient` y mappers.
13
+ - `schemaMapperFactory` — genera mappers de petición/respuesta a partir de un `Schema` (dictcionario de paths o funciones).
14
+ - `createMutableSchema` — crea un `MutableSchema` reutilizable con los métodos `$extends`, `$override` y `$replace`.
15
+ - `identityMapper` / `combineMappers` — mappers auxiliares para identidad y composición.
16
+ - `fetchHttpClient` / `fetchRawHttpClient` — clientes HTTP por defecto basados en la Fetch API.
17
+ - `buildUrl` / `interpolate` — utilidades para construir URLs y parametrizar endpoints (`https://api/{id}`).
18
+
19
+ ## Instalación
20
+
21
+ ```
22
+ npm install @empathyco/x-adapter
23
+ ```