diff --git a/CHANGELOG.md b/CHANGELOG.md index 24ec2e4..b670fb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## [2.3.0](https://github.com/andersondanilo/jsonapi-fractal/compare/v2.2.0...v2.3.0) (2023-01-14) + + +### Features + +* custom relationship types ([#20](https://github.com/andersondanilo/jsonapi-fractal/issues/20)) ([70653e7](https://github.com/andersondanilo/jsonapi-fractal/commit/70653e7e618ef18b048ff7616d54ca2ddacfb76d)) + + +### Bug Fixes + +* changeCase for relation names ([#21](https://github.com/andersondanilo/jsonapi-fractal/issues/21)) ([d8ca17f](https://github.com/andersondanilo/jsonapi-fractal/commit/d8ca17f6ea3e04979131ad70e55c9bdd02f4fc88)) + ## [2.2.0](https://github.com/andersondanilo/jsonapi-fractal/compare/v2.1.0...v2.2.0) (2022-09-23) diff --git a/docs/README.md b/docs/README.md index 59f637f..618661b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -70,7 +70,7 @@ ___ #### Defined in -[src/types.ts:17](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L17) +[src/types.ts:17](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L17) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[src/context.ts:5](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L5) +[src/context.ts:5](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L5) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[src/types.ts:15](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L15) +[src/types.ts:15](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L15) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[src/types.ts:11](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L11) +[src/types.ts:11](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L11) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[src/types.ts:28](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L28) +[src/types.ts:28](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L28) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[src/types.ts:21](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L21) +[src/types.ts:21](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L21) ___ @@ -146,7 +146,7 @@ ___ #### Defined in -[src/types.ts:19](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L19) +[src/types.ts:19](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L19) ___ @@ -156,7 +156,7 @@ ___ #### Defined in -[src/types.ts:13](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L13) +[src/types.ts:13](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L13) ___ @@ -166,7 +166,7 @@ ___ #### Defined in -[src/types.ts:35](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L35) +[src/types.ts:35](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L35) ___ @@ -192,7 +192,7 @@ ___ #### Defined in -[src/types.ts:50](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L50) +[src/types.ts:50](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L50) ___ @@ -209,7 +209,7 @@ ___ #### Defined in -[src/types.ts:39](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L39) +[src/types.ts:39](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L39) ___ @@ -234,7 +234,7 @@ ___ #### Defined in -[src/transformer.ts:24](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/transformer.ts#L24) +[src/transformer.ts:24](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/transformer.ts#L24) ___ @@ -266,7 +266,7 @@ ___ #### Defined in -[src/transformer.ts:19](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/transformer.ts#L19) +[src/transformer.ts:19](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/transformer.ts#L19) ___ @@ -283,7 +283,7 @@ ___ #### Defined in -[src/types.ts:23](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L23) +[src/types.ts:23](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L23) ___ @@ -293,13 +293,13 @@ ___ #### Defined in -[src/types.ts:37](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L37) +[src/types.ts:37](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L37) ___ ### SerializeOptions -Ƭ **SerializeOptions**<`TExtraOptions`\>: [`Options`](README.md#options)<`TExtraOptions`\> & { `relationships?`: `string`[] } +Ƭ **SerializeOptions**<`TExtraOptions`\>: [`Options`](README.md#options)<`TExtraOptions`\> & { `relationships?`: `string`[] \| `Record`<`string`, `string`\> } #### Type parameters @@ -309,7 +309,7 @@ ___ #### Defined in -[src/types.ts:63](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L63) +[src/types.ts:63](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L63) ___ @@ -326,7 +326,7 @@ ___ #### Defined in -[src/transformer.ts:14](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/transformer.ts#L14) +[src/transformer.ts:14](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/transformer.ts#L14) ## Functions @@ -356,7 +356,7 @@ Deserialize a JSON:API response #### Defined in -[src/deserializer.ts:12](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/deserializer.ts#L12) +[src/deserializer.ts:12](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/deserializer.ts#L12) ___ @@ -387,7 +387,7 @@ Serialize the entity #### Defined in -[src/serializer.ts:32](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/serializer.ts#L32) +[src/serializer.ts:32](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/serializer.ts#L32) ___ @@ -410,7 +410,7 @@ Create a ContextBuilder, used to configure the transformation #### Defined in -[src/serializer.ts:21](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/serializer.ts#L21) +[src/serializer.ts:21](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/serializer.ts#L21) ___ @@ -433,4 +433,4 @@ Keep only a set of fields on a given object #### Defined in -[src/utils.ts:55](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/utils.ts#L55) +[src/utils.ts:54](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/utils.ts#L54) diff --git a/docs/classes/ContextBuilder.md b/docs/classes/ContextBuilder.md index 9faa4ce..2aa14a3 100644 --- a/docs/classes/ContextBuilder.md +++ b/docs/classes/ContextBuilder.md @@ -53,7 +53,7 @@ #### Defined in -[src/context.ts:18](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L18) +[src/context.ts:18](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L18) ## Properties @@ -63,7 +63,7 @@ #### Defined in -[src/context.ts:15](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L15) +[src/context.ts:15](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L15) ___ @@ -73,7 +73,7 @@ ___ #### Defined in -[src/context.ts:13](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L13) +[src/context.ts:13](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L13) ___ @@ -83,7 +83,7 @@ ___ #### Defined in -[src/context.ts:16](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L16) +[src/context.ts:16](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L16) ___ @@ -107,7 +107,7 @@ ___ #### Defined in -[src/context.ts:18](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L18) +[src/context.ts:18](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L18) ___ @@ -117,7 +117,7 @@ ___ #### Defined in -[src/context.ts:14](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L14) +[src/context.ts:14](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L14) ## Methods @@ -131,7 +131,7 @@ ___ #### Defined in -[src/context.ts:60](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L60) +[src/context.ts:60](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L60) ___ @@ -145,7 +145,7 @@ ___ #### Defined in -[src/context.ts:43](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L43) +[src/context.ts:43](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L43) ___ @@ -165,7 +165,7 @@ ___ #### Defined in -[src/context.ts:31](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L31) +[src/context.ts:31](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L31) ___ @@ -185,7 +185,7 @@ ___ #### Defined in -[src/context.ts:20](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L20) +[src/context.ts:20](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L20) ___ @@ -205,7 +205,7 @@ ___ #### Defined in -[src/context.ts:37](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L37) +[src/context.ts:37](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L37) ___ @@ -225,4 +225,4 @@ ___ #### Defined in -[src/context.ts:25](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/context.ts#L25) +[src/context.ts:25](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/context.ts#L25) diff --git a/docs/classes/DefaultTransformer.md b/docs/classes/DefaultTransformer.md index 44d5864..43c53ad 100644 --- a/docs/classes/DefaultTransformer.md +++ b/docs/classes/DefaultTransformer.md @@ -34,7 +34,7 @@ ### constructor -• **new DefaultTransformer**<`TEntity`, `TExtraOptions`\>(`type`, `relationshipNames?`) +• **new DefaultTransformer**<`TEntity`, `TExtraOptions`\>(`type`, `relationships?`) #### Type parameters @@ -48,7 +48,7 @@ | Name | Type | Default value | | :------ | :------ | :------ | | `type` | `string` | `undefined` | -| `relationshipNames` | `string`[] | `[]` | +| `relationships` | `string`[] \| `Record`<`string`, `string`\> | `[]` | #### Overrides @@ -56,7 +56,7 @@ #### Defined in -[src/default-transformer.ts:8](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/default-transformer.ts#L8) +[src/default-transformer.ts:8](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/default-transformer.ts#L8) ## Properties @@ -70,7 +70,7 @@ #### Defined in -[src/default-transformer.ts:6](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/default-transformer.ts#L6) +[src/default-transformer.ts:6](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/default-transformer.ts#L6) ___ @@ -84,7 +84,7 @@ ___ #### Defined in -[src/default-transformer.ts:8](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/default-transformer.ts#L8) +[src/default-transformer.ts:8](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/default-transformer.ts#L8) ## Methods @@ -108,4 +108,4 @@ ___ #### Defined in -[src/default-transformer.ts:23](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/default-transformer.ts#L23) +[src/default-transformer.ts:28](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/default-transformer.ts#L28) diff --git a/docs/classes/JsonApiFractalError.md b/docs/classes/JsonApiFractalError.md index 0d8983c..6ee4c67 100644 --- a/docs/classes/JsonApiFractalError.md +++ b/docs/classes/JsonApiFractalError.md @@ -44,7 +44,7 @@ Error.constructor #### Defined in -[src/errors.ts:2](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/errors.ts#L2) +[src/errors.ts:2](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/errors.ts#L2) ## Properties @@ -58,7 +58,7 @@ Error.message #### Defined in -node_modules/typescript/lib/lib.es5.d.ts:1041 +node_modules/typescript/lib/lib.es5.d.ts:1054 ___ @@ -72,7 +72,7 @@ Error.name #### Defined in -node_modules/typescript/lib/lib.es5.d.ts:1040 +node_modules/typescript/lib/lib.es5.d.ts:1053 ___ @@ -86,7 +86,7 @@ Error.stack #### Defined in -node_modules/typescript/lib/lib.es5.d.ts:1042 +node_modules/typescript/lib/lib.es5.d.ts:1055 ___ diff --git a/docs/classes/Transformer.md b/docs/classes/Transformer.md index 7816f9f..5fce822 100644 --- a/docs/classes/Transformer.md +++ b/docs/classes/Transformer.md @@ -45,7 +45,7 @@ #### Defined in -[src/transformer.ts:8](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/transformer.ts#L8) +[src/transformer.ts:8](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/transformer.ts#L8) ## Properties @@ -55,7 +55,7 @@ #### Defined in -[src/transformer.ts:5](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/transformer.ts#L5) +[src/transformer.ts:5](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/transformer.ts#L5) ___ @@ -65,7 +65,7 @@ ___ #### Defined in -[src/transformer.ts:4](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/transformer.ts#L4) +[src/transformer.ts:4](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/transformer.ts#L4) ## Methods @@ -86,4 +86,4 @@ ___ #### Defined in -[src/transformer.ts:6](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/transformer.ts#L6) +[src/transformer.ts:6](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/transformer.ts#L6) diff --git a/docs/enums/CaseType.md b/docs/enums/CaseType.md index 890e884..9a12224 100644 --- a/docs/enums/CaseType.md +++ b/docs/enums/CaseType.md @@ -18,7 +18,7 @@ #### Defined in -[src/types.ts:45](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L45) +[src/types.ts:45](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L45) ___ @@ -28,7 +28,7 @@ ___ #### Defined in -[src/types.ts:47](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L47) +[src/types.ts:47](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L47) ___ @@ -38,4 +38,4 @@ ___ #### Defined in -[src/types.ts:46](https://github.com/andersondanilo/jsonapi-fractal/blob/fc0b05d/src/types.ts#L46) +[src/types.ts:46](https://github.com/andersondanilo/jsonapi-fractal/blob/d8ca17f/src/types.ts#L46) diff --git a/package.json b/package.json index b761fae..97f4d60 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jsonapi-fractal", - "version": "2.2.0", + "version": "2.3.0", "description": "JSON:API Serializer inspired by Fractal (PHP)", "license": "MIT", "main": "dist/index",