@klerick/json-api-nestjs-shared 1.0.0 → 1.1.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/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 1.1.0 (2026-10-10)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **json-api-nestjs-sdk,json-api-nestjs-shared:** surface the meta a response carries ([2a5be7d](https://github.com/klerick/nestjs-json-api/commit/2a5be7d))
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - Alex H
10
+ - Claude Opus 5 (1M context)
11
+
1
12
  # 1.0.0 (2026-09-12)
2
13
 
3
14
  ### 🚀 Features
@@ -48,6 +48,14 @@ export type Include<Entity, IdKey extends string = 'id'> = ValueOf<{
48
48
  export type BaseIncluded<Entity extends object, IdKey extends string = 'id'> = {
49
49
  included?: Include<Entity, IdKey>[];
50
50
  };
51
- export type ResourceData<Entity extends object, IdKey extends string = 'id'> = MainData & BaseAttribute<Entity, IdKey> & BaseRelationships<Entity, IdKey> & BaseLinks;
51
+ /**
52
+ * A resource object MAY carry its own `meta` (JSON:API 1.1 section 7.2),
53
+ * describing that one resource rather than the response. Optional, so a
54
+ * document without it is unchanged.
55
+ */
56
+ export type BaseResourceMeta<ResourceMetaType = Record<string, unknown>> = {
57
+ meta?: ResourceMetaType;
58
+ };
59
+ export type ResourceData<Entity extends object, IdKey extends string = 'id', ResourceMetaType = Record<string, unknown>> = MainData & BaseAttribute<Entity, IdKey> & BaseRelationships<Entity, IdKey> & BaseResourceMeta<ResourceMetaType> & BaseLinks;
52
60
  export type ResourceObject<Entity extends object, Type extends 'object' | 'array' = 'object', ExtendBase = null, IdKey extends string = 'id'> = BaseMeta<Type, ExtendBase> & BaseResourceData<Entity, Type, IdKey> & BaseIncluded<Entity, IdKey>;
53
61
  export type ResourceObjectRelationships<Entity extends object, IdKey extends string, Rel extends RelationKeys<Entity, IdKey>> = BaseMeta & BaseMainData<Entity, IdKey, Rel>;
@@ -48,6 +48,14 @@ export type Include<Entity, IdKey extends string = 'id'> = ValueOf<{
48
48
  export type BaseIncluded<Entity extends object, IdKey extends string = 'id'> = {
49
49
  included?: Include<Entity, IdKey>[];
50
50
  };
51
- export type ResourceData<Entity extends object, IdKey extends string = 'id'> = MainData & BaseAttribute<Entity, IdKey> & BaseRelationships<Entity, IdKey> & BaseLinks;
51
+ /**
52
+ * A resource object MAY carry its own `meta` (JSON:API 1.1 section 7.2),
53
+ * describing that one resource rather than the response. Optional, so a
54
+ * document without it is unchanged.
55
+ */
56
+ export type BaseResourceMeta<ResourceMetaType = Record<string, unknown>> = {
57
+ meta?: ResourceMetaType;
58
+ };
59
+ export type ResourceData<Entity extends object, IdKey extends string = 'id', ResourceMetaType = Record<string, unknown>> = MainData & BaseAttribute<Entity, IdKey> & BaseRelationships<Entity, IdKey> & BaseResourceMeta<ResourceMetaType> & BaseLinks;
52
60
  export type ResourceObject<Entity extends object, Type extends 'object' | 'array' = 'object', ExtendBase = null, IdKey extends string = 'id'> = BaseMeta<Type, ExtendBase> & BaseResourceData<Entity, Type, IdKey> & BaseIncluded<Entity, IdKey>;
53
61
  export type ResourceObjectRelationships<Entity extends object, IdKey extends string, Rel extends RelationKeys<Entity, IdKey>> = BaseMeta & BaseMainData<Entity, IdKey, Rel>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klerick/json-api-nestjs-shared",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Shared Helper for JsonApi Plugin for NestJs",
5
5
  "keywords": [
6
6
  "nestjs",