@klerick/json-api-nestjs 10.0.0-beta.7 → 10.0.0-beta.9

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +140 -0
  3. package/package.json +1 -1
  4. package/src/index.d.ts +3 -3
  5. package/src/index.js +4 -1
  6. package/src/index.js.map +1 -1
  7. package/src/lib/constants/reflection.d.ts +2 -0
  8. package/src/lib/constants/reflection.js +3 -1
  9. package/src/lib/constants/reflection.js.map +1 -1
  10. package/src/lib/modules/mixin/decorators/index.d.ts +1 -0
  11. package/src/lib/modules/mixin/decorators/index.js +1 -0
  12. package/src/lib/modules/mixin/decorators/index.js.map +1 -1
  13. package/src/lib/modules/mixin/decorators/json-api-read-only/json-api-read-only.decorator.d.ts +48 -0
  14. package/src/lib/modules/mixin/decorators/json-api-read-only/json-api-read-only.decorator.js +83 -0
  15. package/src/lib/modules/mixin/decorators/json-api-read-only/json-api-read-only.decorator.js.map +1 -0
  16. package/src/lib/modules/mixin/factory/zod-validate.factory.js +11 -6
  17. package/src/lib/modules/mixin/factory/zod-validate.factory.js.map +1 -1
  18. package/src/lib/modules/mixin/helpers/utils.d.ts +2 -0
  19. package/src/lib/modules/mixin/helpers/utils.js +10 -0
  20. package/src/lib/modules/mixin/helpers/utils.js.map +1 -1
  21. package/src/lib/modules/mixin/service/json-api-transformer.service.js +22 -0
  22. package/src/lib/modules/mixin/service/json-api-transformer.service.js.map +1 -1
  23. package/src/lib/modules/mixin/swagger/method/patch-one.js +4 -1
  24. package/src/lib/modules/mixin/swagger/method/patch-one.js.map +1 -1
  25. package/src/lib/modules/mixin/swagger/method/post-one.js +4 -1
  26. package/src/lib/modules/mixin/swagger/method/post-one.js.map +1 -1
  27. package/src/lib/modules/mixin/zod/zod-input-patch-schema/index.d.ts +14 -3
  28. package/src/lib/modules/mixin/zod/zod-input-patch-schema/index.js +5 -6
  29. package/src/lib/modules/mixin/zod/zod-input-patch-schema/index.js.map +1 -1
  30. package/src/lib/modules/mixin/zod/zod-input-post-schema/index.d.ts +14 -4
  31. package/src/lib/modules/mixin/zod/zod-input-post-schema/index.js +5 -6
  32. package/src/lib/modules/mixin/zod/zod-input-post-schema/index.js.map +1 -1
  33. package/src/lib/modules/mixin/zod/zod-share/attributes.d.ts +2 -2
  34. package/src/lib/modules/mixin/zod/zod-share/attributes.js +9 -3
  35. package/src/lib/modules/mixin/zod/zod-share/attributes.js.map +1 -1
  36. package/src/lib/types/entity-param.type.d.ts +6 -4
  37. package/src/lib/types/entity-param.type.js +13 -0
  38. package/src/lib/types/entity-param.type.js.map +1 -1
  39. package/src/lib/types/index.d.ts +1 -0
  40. package/src/lib/types/index.js +1 -0
  41. package/src/lib/types/index.js.map +1 -1
  42. package/src/lib/types/json-api-read-only.d.ts +51 -0
  43. package/src/lib/types/json-api-read-only.js +3 -0
  44. package/src/lib/types/json-api-read-only.js.map +1 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## 10.0.0-beta.9 (2026-01-20)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **json-api-nestjs:** enhance Patch and Post schema handling, add utility for merging patch data and refine type definitions for attributes and relationships ([2887603](https://github.com/klerick/nestjs-json-api/commit/2887603))
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - Alex H
10
+
11
+ ## 10.0.0-beta.8 (2026-01-19)
12
+
13
+ ### 🚀 Features
14
+
15
+ - **json-api-nestjs:** add read-only and immutable field decorators with validation schema updates and inheritance support ([fccf757](https://github.com/klerick/nestjs-json-api/commit/fccf757))
16
+ - **json-api-nestjs,json-api-nestjs-microorm,json-api-nestjs-typeorm:** add support for automatic resource linkage in to-one relations, update FK field detection and handling ([0dd670d](https://github.com/klerick/nestjs-json-api/commit/0dd670d))
17
+
18
+ ### ❤️ Thank You
19
+
20
+ - Alex H
21
+
1
22
  ## 10.0.0-beta.7 (2025-12-26)
2
23
 
3
24
  This was a version bump only for json-api-nestjs to align it with other projects, there were no code changes.
package/README.md CHANGED
@@ -445,3 +445,143 @@ export class AtomicInterceptor<T> implements NestInterceptor {
445
445
  }
446
446
  ```
447
447
  **isAtomic** - is array of params of method
448
+
449
+ ## Resource Linkage for To-One Relations
450
+
451
+ According to the [JSON:API specification](https://jsonapi.org/format/#document-resource-object-linkage), relationships should include a `data` member containing resource linkage (the `id` and `type` of the related resource).
452
+
453
+ For **to-one relations** (ManyToOne, OneToOne), if your entity has an FK field (foreign key), the library will automatically include `relationships.{relation}.data` in responses **even without using `include`**.
454
+
455
+ **Example response:**
456
+ ```json
457
+ {
458
+ "data": {
459
+ "id": "1",
460
+ "type": "comments",
461
+ "attributes": { "text": "Hello" },
462
+ "relationships": {
463
+ "user": {
464
+ "links": { "self": "/api/comments/1/relationships/user" },
465
+ "data": { "id": "5", "type": "users" }
466
+ }
467
+ }
468
+ }
469
+ }
470
+ ```
471
+
472
+ If the FK field is `null`, then `data` will also be `null`:
473
+ ```json
474
+ "relationships": {
475
+ "user": {
476
+ "links": { "self": "/api/comments/1/relationships/user" },
477
+ "data": null
478
+ }
479
+ }
480
+ ```
481
+
482
+ **Note:** TypeORM and MikroORM implement FK field detection differently. See the respective adapter documentation for details on how to define FK fields in your entities.
483
+
484
+ ## Field Access Control Decorators
485
+
486
+ The library provides two decorators to control field accessibility in POST and PATCH operations:
487
+
488
+ ### @JsonApiReadOnly()
489
+
490
+ Fields marked with `@JsonApiReadOnly()` are completely excluded from input validation schemas. They cannot be set via POST or PATCH requests and are not shown in Swagger documentation for input.
491
+
492
+ **Use case:** Server-managed fields like `createdAt`, `updatedAt`, computed fields.
493
+
494
+ ```typescript
495
+ import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';
496
+ import { JsonApiReadOnly } from '@klerick/json-api-nestjs';
497
+
498
+ @Entity()
499
+ export class Users {
500
+ @PrimaryGeneratedColumn()
501
+ id: number;
502
+
503
+ @Column()
504
+ login: string;
505
+
506
+ @JsonApiReadOnly()
507
+ @CreateDateColumn()
508
+ createdAt: Date;
509
+
510
+ @JsonApiReadOnly()
511
+ @UpdateDateColumn()
512
+ updatedAt: Date;
513
+ }
514
+ ```
515
+
516
+ With this configuration:
517
+ - **POST /users** - `createdAt` and `updatedAt` fields are not accepted
518
+ - **PATCH /users/:id** - `createdAt` and `updatedAt` fields are not accepted
519
+
520
+ ### @JsonApiImmutable()
521
+
522
+ Fields marked with `@JsonApiImmutable()` can be optionally set during creation (POST) but cannot be modified after (PATCH).
523
+
524
+ **Use case:** Fields that should be set once and never changed, like `externalId`, `slug`, or `username`.
525
+
526
+ ```typescript
527
+ import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
528
+ import { JsonApiImmutable } from '@klerick/json-api-nestjs';
529
+
530
+ @Entity()
531
+ export class Users {
532
+ @PrimaryGeneratedColumn()
533
+ id: number;
534
+
535
+ @JsonApiImmutable()
536
+ @Column({ unique: true })
537
+ login: string;
538
+
539
+ @Column()
540
+ firstName: string;
541
+
542
+ @Column()
543
+ lastName: string;
544
+ }
545
+ ```
546
+
547
+ With this configuration:
548
+ - **POST /users** - `login` is optional, can be provided or omitted
549
+ - **PATCH /users/:id** - `login` is not accepted (cannot be changed)
550
+
551
+ ### Combining Decorators
552
+
553
+ You can use both decorators in the same entity:
554
+
555
+ ```typescript
556
+ @Entity()
557
+ export class Article {
558
+ @PrimaryGeneratedColumn()
559
+ id: number;
560
+
561
+ @JsonApiImmutable()
562
+ @Column({ unique: true })
563
+ slug: string;
564
+
565
+ @Column()
566
+ title: string;
567
+
568
+ @Column()
569
+ content: string;
570
+
571
+ @JsonApiReadOnly()
572
+ @CreateDateColumn()
573
+ createdAt: Date;
574
+
575
+ @JsonApiReadOnly()
576
+ @UpdateDateColumn()
577
+ updatedAt: Date;
578
+ }
579
+ ```
580
+
581
+ | Field | POST | PATCH |
582
+ |-------|------|-------|
583
+ | `slug` | Optional | Not accepted |
584
+ | `title` | Required | Optional |
585
+ | `content` | Required | Optional |
586
+ | `createdAt` | Not accepted | Not accepted |
587
+ | `updatedAt` | Not accepted | Not accepted |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klerick/json-api-nestjs",
3
- "version": "10.0.0-beta.7",
3
+ "version": "10.0.0-beta.9",
4
4
  "type": "commonjs",
5
5
  "description": "JsonApi Plugin for NestJs",
6
6
  "keywords": [
package/src/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { JsonApiModule } from './lib/json-api.module';
2
2
  export { JsonBaseController } from './lib/modules/mixin/controllers/json-base.controller';
3
- export { JsonApi, InjectService } from './lib/modules/mixin/decorators';
4
- export { entityForClass, excludeMethod, } from './lib/modules/mixin/helpers/utils';
5
- export { PrepareParams, NestProvider, ValidateQueryError, UnionToTuple, EntityParam, TypeField, Params, } from './lib/types';
3
+ export { JsonApi, InjectService, JsonApiReadOnly, JsonApiImmutable } from './lib/modules/mixin/decorators';
4
+ export { entityForClass, excludeMethod, patchInputData, } from './lib/modules/mixin/helpers/utils';
5
+ export { PrepareParams, NestProvider, ValidateQueryError, UnionToTuple, EntityParam, TypeField, Params, JsonApiReadOnlyField, JsonApiImmutableField, } from './lib/types';
6
6
  export { JsonApiTransformerService, ErrorFormatService, EntityParamMapService } from './lib/modules/mixin/service';
7
7
  export { MODULE_OPTIONS_TOKEN, CONTROLLER_OPTIONS_TOKEN, ASC, DESC, FIND_ONE_ROW_ENTITY, CHECK_RELATION_NAME, RUN_IN_TRANSACTION_FUNCTION, ORM_SERVICE, ENTITY_PARAM_MAP, DEFAULT_PAGE_SIZE, DEFAULT_QUERY_PAGE, CURRENT_ENTITY, METHOD_NAME } from './lib/constants';
8
8
  export { OrmService, OrmService as JsonApiService, EntityControllerParam, CheckRelationName, FindOneRowEntity, RunInTransaction, EntityParamMap, MethodName } from './lib/modules/mixin/types';
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.METHOD_NAME = exports.CURRENT_ENTITY = exports.DEFAULT_QUERY_PAGE = exports.DEFAULT_PAGE_SIZE = exports.ENTITY_PARAM_MAP = exports.ORM_SERVICE = exports.RUN_IN_TRANSACTION_FUNCTION = exports.CHECK_RELATION_NAME = exports.FIND_ONE_ROW_ENTITY = exports.DESC = exports.ASC = exports.CONTROLLER_OPTIONS_TOKEN = exports.MODULE_OPTIONS_TOKEN = exports.EntityParamMapService = exports.ErrorFormatService = exports.JsonApiTransformerService = exports.TypeField = exports.excludeMethod = exports.entityForClass = exports.InjectService = exports.JsonApi = exports.JsonBaseController = exports.JsonApiModule = void 0;
3
+ exports.METHOD_NAME = exports.CURRENT_ENTITY = exports.DEFAULT_QUERY_PAGE = exports.DEFAULT_PAGE_SIZE = exports.ENTITY_PARAM_MAP = exports.ORM_SERVICE = exports.RUN_IN_TRANSACTION_FUNCTION = exports.CHECK_RELATION_NAME = exports.FIND_ONE_ROW_ENTITY = exports.DESC = exports.ASC = exports.CONTROLLER_OPTIONS_TOKEN = exports.MODULE_OPTIONS_TOKEN = exports.EntityParamMapService = exports.ErrorFormatService = exports.JsonApiTransformerService = exports.TypeField = exports.patchInputData = exports.excludeMethod = exports.entityForClass = exports.JsonApiImmutable = exports.JsonApiReadOnly = exports.InjectService = exports.JsonApi = exports.JsonBaseController = exports.JsonApiModule = void 0;
4
4
  var json_api_module_1 = require("./lib/json-api.module");
5
5
  Object.defineProperty(exports, "JsonApiModule", { enumerable: true, get: function () { return json_api_module_1.JsonApiModule; } });
6
6
  var json_base_controller_1 = require("./lib/modules/mixin/controllers/json-base.controller");
@@ -8,9 +8,12 @@ Object.defineProperty(exports, "JsonBaseController", { enumerable: true, get: fu
8
8
  var decorators_1 = require("./lib/modules/mixin/decorators");
9
9
  Object.defineProperty(exports, "JsonApi", { enumerable: true, get: function () { return decorators_1.JsonApi; } });
10
10
  Object.defineProperty(exports, "InjectService", { enumerable: true, get: function () { return decorators_1.InjectService; } });
11
+ Object.defineProperty(exports, "JsonApiReadOnly", { enumerable: true, get: function () { return decorators_1.JsonApiReadOnly; } });
12
+ Object.defineProperty(exports, "JsonApiImmutable", { enumerable: true, get: function () { return decorators_1.JsonApiImmutable; } });
11
13
  var utils_1 = require("./lib/modules/mixin/helpers/utils");
12
14
  Object.defineProperty(exports, "entityForClass", { enumerable: true, get: function () { return utils_1.entityForClass; } });
13
15
  Object.defineProperty(exports, "excludeMethod", { enumerable: true, get: function () { return utils_1.excludeMethod; } });
16
+ Object.defineProperty(exports, "patchInputData", { enumerable: true, get: function () { return utils_1.patchInputData; } });
14
17
  var types_1 = require("./lib/types");
15
18
  Object.defineProperty(exports, "TypeField", { enumerable: true, get: function () { return types_1.TypeField; } });
16
19
  var service_1 = require("./lib/modules/mixin/service");
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/json-api/json-api-nestjs/src/index.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AAA7C,gHAAA,aAAa,OAAA;AAEtB,6FAA0F;AAAjF,0HAAA,kBAAkB,OAAA;AAC3B,6DAAwE;AAA/D,qGAAA,OAAO,OAAA;AAAE,2GAAA,aAAa,OAAA;AAC/B,2DAG2C;AAFzC,uGAAA,cAAc,OAAA;AACd,sGAAA,aAAa,OAAA;AAEf,qCAQqB;AAFnB,kGAAA,SAAS,OAAA;AAGX,uDAIqC;AAHnC,oHAAA,yBAAyB,OAAA;AACzB,6GAAA,kBAAkB,OAAA;AAClB,gHAAA,qBAAqB,OAAA;AAEvB,6CAcyB;AAbvB,iHAAA,oBAAoB,OAAA;AACpB,qHAAA,wBAAwB,OAAA;AACxB,gGAAA,GAAG,OAAA;AACH,iGAAA,IAAI,OAAA;AACJ,gHAAA,mBAAmB,OAAA;AACnB,gHAAA,mBAAmB,OAAA;AACnB,wHAAA,2BAA2B,OAAA;AAC3B,wGAAA,WAAW,OAAA;AACX,6GAAA,gBAAgB,OAAA;AAChB,8GAAA,iBAAiB,OAAA;AACjB,+GAAA,kBAAkB,OAAA;AAClB,2GAAA,cAAc,OAAA;AACd,wGAAA,WAAW,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/json-api/json-api-nestjs/src/index.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AAA7C,gHAAA,aAAa,OAAA;AAEtB,6FAA0F;AAAjF,0HAAA,kBAAkB,OAAA;AAC3B,6DAA2G;AAAlG,qGAAA,OAAO,OAAA;AAAE,2GAAA,aAAa,OAAA;AAAE,6GAAA,eAAe,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AAClE,2DAI2C;AAHzC,uGAAA,cAAc,OAAA;AACd,sGAAA,aAAa,OAAA;AACb,uGAAA,cAAc,OAAA;AAEhB,qCAUqB;AAJnB,kGAAA,SAAS,OAAA;AAKX,uDAIqC;AAHnC,oHAAA,yBAAyB,OAAA;AACzB,6GAAA,kBAAkB,OAAA;AAClB,gHAAA,qBAAqB,OAAA;AAEvB,6CAcyB;AAbvB,iHAAA,oBAAoB,OAAA;AACpB,qHAAA,wBAAwB,OAAA;AACxB,gGAAA,GAAG,OAAA;AACH,iGAAA,IAAI,OAAA;AACJ,gHAAA,mBAAmB,OAAA;AACnB,gHAAA,mBAAmB,OAAA;AACnB,wHAAA,2BAA2B,OAAA;AAC3B,wGAAA,WAAW,OAAA;AACX,6GAAA,gBAAgB,OAAA;AAChB,8GAAA,iBAAiB,OAAA;AACjB,+GAAA,kBAAkB,OAAA;AAClB,2GAAA,cAAc,OAAA;AACd,wGAAA,WAAW,OAAA"}
@@ -1,2 +1,4 @@
1
1
  export declare const JSON_API_DECORATOR_ENTITY: unique symbol;
2
2
  export declare const JSON_API_DECORATOR_OPTIONS: unique symbol;
3
+ export declare const JSON_API_DECORATOR_READ_ONLY: unique symbol;
4
+ export declare const JSON_API_DECORATOR_IMMUTABLE: unique symbol;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JSON_API_DECORATOR_OPTIONS = exports.JSON_API_DECORATOR_ENTITY = void 0;
3
+ exports.JSON_API_DECORATOR_IMMUTABLE = exports.JSON_API_DECORATOR_READ_ONLY = exports.JSON_API_DECORATOR_OPTIONS = exports.JSON_API_DECORATOR_ENTITY = void 0;
4
4
  exports.JSON_API_DECORATOR_ENTITY = Symbol('JSON_API_ENTITY');
5
5
  exports.JSON_API_DECORATOR_OPTIONS = Symbol('JSON_API_OPTIONS');
6
+ exports.JSON_API_DECORATOR_READ_ONLY = Symbol('JSON_API_READ_ONLY');
7
+ exports.JSON_API_DECORATOR_IMMUTABLE = Symbol('JSON_API_IMMUTABLE');
6
8
  //# sourceMappingURL=reflection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reflection.js","sourceRoot":"","sources":["../../../../../../../libs/json-api/json-api-nestjs/src/lib/constants/reflection.ts"],"names":[],"mappings":";;;AAAa,QAAA,yBAAyB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACtD,QAAA,0BAA0B,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"reflection.js","sourceRoot":"","sources":["../../../../../../../libs/json-api/json-api-nestjs/src/lib/constants/reflection.ts"],"names":[],"mappings":";;;AAAa,QAAA,yBAAyB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACtD,QAAA,0BAA0B,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACxD,QAAA,4BAA4B,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAC5D,QAAA,4BAA4B,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './json-api/json-api.decorator';
2
2
  export * from './inject-service/inject-service.decorator';
3
+ export * from './json-api-read-only/json-api-read-only.decorator';
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./json-api/json-api.decorator"), exports);
5
5
  tslib_1.__exportStar(require("./inject-service/inject-service.decorator"), exports);
6
+ tslib_1.__exportStar(require("./json-api-read-only/json-api-read-only.decorator"), exports);
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/decorators/index.ts"],"names":[],"mappings":";;;AAAA,wEAA8C;AAC9C,oFAA0D"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/decorators/index.ts"],"names":[],"mappings":";;;AAAA,wEAA8C;AAC9C,oFAA0D;AAC1D,4FAAkE"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Marks a field as read-only for JSON:API.
3
+ * The field will be excluded from POST/PATCH validation.
4
+ *
5
+ * Use together with JsonApiReadOnly type for compile-time checking.
6
+ *
7
+ * Note: For FK fields (relationFkField), only the type marker is needed
8
+ * since runtime exclusion is handled automatically.
9
+ *
10
+ * @example
11
+ * // Computed/auto-generated field - decorator + type marker
12
+ * @Property()
13
+ * @JsonApiReadOnly()
14
+ * public createdAt!: Date & JsonApiReadOnly;
15
+ *
16
+ * @example
17
+ * // FK field - only type marker needed (no decorator required)
18
+ * @Property({ persist: false })
19
+ * public createdById!: number & Opt & JsonApiReadOnly;
20
+ */
21
+ export declare function JsonApiReadOnly(): PropertyDecorator;
22
+ type Constructor = new (...args: unknown[]) => object;
23
+ /**
24
+ * Get list of read-only fields from entity class.
25
+ * Collects metadata from entire prototype chain (handles inheritance).
26
+ */
27
+ export declare function getJsonApiReadOnlyFields(target: Constructor): string[];
28
+ /**
29
+ * Marks a field as immutable for JSON:API.
30
+ * The field will be optional in POST validation and excluded from PATCH validation.
31
+ *
32
+ * Use case: fields that are computed by business logic for regular users,
33
+ * but can be set by admins during creation. Cannot be modified after creation.
34
+ *
35
+ * Use together with JsonApiImmutable type for compile-time checking.
36
+ *
37
+ * @example
38
+ * @Property()
39
+ * @JsonApiImmutable()
40
+ * public score!: number & JsonApiImmutable;
41
+ */
42
+ export declare function JsonApiImmutable(): PropertyDecorator;
43
+ /**
44
+ * Get list of immutable fields from entity class.
45
+ * Collects metadata from entire prototype chain (handles inheritance).
46
+ */
47
+ export declare function getJsonApiImmutableFields(target: Constructor): string[];
48
+ export {};
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JsonApiReadOnly = JsonApiReadOnly;
4
+ exports.getJsonApiReadOnlyFields = getJsonApiReadOnlyFields;
5
+ exports.JsonApiImmutable = JsonApiImmutable;
6
+ exports.getJsonApiImmutableFields = getJsonApiImmutableFields;
7
+ const constants_1 = require("../../../../constants");
8
+ /**
9
+ * Marks a field as read-only for JSON:API.
10
+ * The field will be excluded from POST/PATCH validation.
11
+ *
12
+ * Use together with JsonApiReadOnly type for compile-time checking.
13
+ *
14
+ * Note: For FK fields (relationFkField), only the type marker is needed
15
+ * since runtime exclusion is handled automatically.
16
+ *
17
+ * @example
18
+ * // Computed/auto-generated field - decorator + type marker
19
+ * @Property()
20
+ * @JsonApiReadOnly()
21
+ * public createdAt!: Date & JsonApiReadOnly;
22
+ *
23
+ * @example
24
+ * // FK field - only type marker needed (no decorator required)
25
+ * @Property({ persist: false })
26
+ * public createdById!: number & Opt & JsonApiReadOnly;
27
+ */
28
+ function JsonApiReadOnly() {
29
+ return (target, propertyKey) => {
30
+ const existingKeys = Reflect.getMetadata(constants_1.JSON_API_DECORATOR_READ_ONLY, target.constructor) || [];
31
+ Reflect.defineMetadata(constants_1.JSON_API_DECORATOR_READ_ONLY, [...existingKeys, propertyKey], target.constructor);
32
+ };
33
+ }
34
+ /**
35
+ * Get list of read-only fields from entity class.
36
+ * Collects metadata from entire prototype chain (handles inheritance).
37
+ */
38
+ function getJsonApiReadOnlyFields(target) {
39
+ return collectFieldsFromPrototypeChain(target, constants_1.JSON_API_DECORATOR_READ_ONLY);
40
+ }
41
+ /**
42
+ * Marks a field as immutable for JSON:API.
43
+ * The field will be optional in POST validation and excluded from PATCH validation.
44
+ *
45
+ * Use case: fields that are computed by business logic for regular users,
46
+ * but can be set by admins during creation. Cannot be modified after creation.
47
+ *
48
+ * Use together with JsonApiImmutable type for compile-time checking.
49
+ *
50
+ * @example
51
+ * @Property()
52
+ * @JsonApiImmutable()
53
+ * public score!: number & JsonApiImmutable;
54
+ */
55
+ function JsonApiImmutable() {
56
+ return (target, propertyKey) => {
57
+ const existingKeys = Reflect.getMetadata(constants_1.JSON_API_DECORATOR_IMMUTABLE, target.constructor) || [];
58
+ Reflect.defineMetadata(constants_1.JSON_API_DECORATOR_IMMUTABLE, [...existingKeys, propertyKey], target.constructor);
59
+ };
60
+ }
61
+ /**
62
+ * Get list of immutable fields from entity class.
63
+ * Collects metadata from entire prototype chain (handles inheritance).
64
+ */
65
+ function getJsonApiImmutableFields(target) {
66
+ return collectFieldsFromPrototypeChain(target, constants_1.JSON_API_DECORATOR_IMMUTABLE);
67
+ }
68
+ /**
69
+ * Helper function to collect fields from prototype chain.
70
+ */
71
+ function collectFieldsFromPrototypeChain(target, metadataKey) {
72
+ const allKeys = new Set();
73
+ let currentTarget = target;
74
+ while (currentTarget && currentTarget !== Object) {
75
+ const keys = Reflect.getOwnMetadata(metadataKey, currentTarget) || [];
76
+ for (const key of keys) {
77
+ allKeys.add(key.toString());
78
+ }
79
+ currentTarget = Object.getPrototypeOf(currentTarget);
80
+ }
81
+ return Array.from(allKeys);
82
+ }
83
+ //# sourceMappingURL=json-api-read-only.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-api-read-only.decorator.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/decorators/json-api-read-only/json-api-read-only.decorator.ts"],"names":[],"mappings":";;AAyBA,0CAWC;AAQD,4DAEC;AAgBD,4CAWC;AAMD,8DAEC;AAjFD,qDAG+B;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E,CAAC;QAE3D,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9B,CAAC;QAED,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC"}
@@ -8,6 +8,7 @@ exports.ZodPatchSchema = ZodPatchSchema;
8
8
  const zod_1 = require("../zod");
9
9
  const constants_1 = require("../../../constants");
10
10
  const service_1 = require("../service");
11
+ const decorators_1 = require("../decorators");
11
12
  function ZodInputQuerySchema() {
12
13
  return {
13
14
  provide: constants_1.ZOD_INPUT_QUERY_SCHEMA,
@@ -29,18 +30,22 @@ function ZodQuerySchema() {
29
30
  function ZodPostSchema() {
30
31
  return {
31
32
  provide: constants_1.ZOD_POST_SCHEMA,
32
- inject: [service_1.EntityParamMapService],
33
- useFactory: (entityParamMapService) => {
34
- return (0, zod_1.zodPost)(entityParamMapService);
33
+ inject: [service_1.EntityParamMapService, constants_1.CURRENT_ENTITY],
34
+ useFactory: (entityParamMapService, entity) => {
35
+ const readOnlyProps = (0, decorators_1.getJsonApiReadOnlyFields)(entity);
36
+ const immutableProps = (0, decorators_1.getJsonApiImmutableFields)(entity);
37
+ return (0, zod_1.zodPost)(entityParamMapService, readOnlyProps, immutableProps);
35
38
  },
36
39
  };
37
40
  }
38
41
  function ZodPatchSchema() {
39
42
  return {
40
43
  provide: constants_1.ZOD_PATCH_SCHEMA,
41
- inject: [service_1.EntityParamMapService],
42
- useFactory: (entityParamMapService) => {
43
- return (0, zod_1.zodPatch)(entityParamMapService);
44
+ inject: [service_1.EntityParamMapService, constants_1.CURRENT_ENTITY],
45
+ useFactory: (entityParamMapService, entity) => {
46
+ const readOnlyProps = (0, decorators_1.getJsonApiReadOnlyFields)(entity);
47
+ const immutableProps = (0, decorators_1.getJsonApiImmutableFields)(entity);
48
+ return (0, zod_1.zodPatch)(entityParamMapService, readOnlyProps, immutableProps);
44
49
  },
45
50
  };
46
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"zod-validate.factory.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/factory/zod-validate.factory.ts"],"names":[],"mappings":";;;AA2BA,kDAWC;AACD,wCAWC;AACD,sCAWC;AAED,wCAWC;AA3ED,gCAagB;AAEhB,kDAO4B;AAE5B,wCAAmD;AAGnD,SAAgB,mBAAmB;IAIjC,OAAO;QACL,OAAO,EAAE,kCAAsB;QAC/B,MAAM,EAAE,CAAC,+BAAqB,CAAC;QAC/B,UAAU,EAAE,CAAC,qBAAsD,EAAE,EAAE;YACrE,OAAO,IAAA,mBAAa,EAAC,qBAAqB,CAAC,CAAC;QAC9C,CAAC;KACF,CAAC;AACJ,CAAC;AACD,SAAgB,cAAc;IAI5B,OAAO;QACL,OAAO,EAAE,4BAAgB;QACzB,MAAM,EAAE,CAAC,+BAAqB,CAAC;QAC/B,UAAU,EAAE,CAAC,qBAAsD,EAAE,EAAE;YACrE,OAAO,IAAA,cAAQ,EAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;KACF,CAAC;AACJ,CAAC;AACD,SAAgB,aAAa;IAI3B,OAAO;QACL,OAAO,EAAE,2BAAe;QACxB,MAAM,EAAE,CAAC,+BAAqB,CAAC;QAC/B,UAAU,EAAE,CAAC,qBAAsD,EAAE,EAAE;YACrE,OAAO,IAAA,aAAO,EAAC,qBAAqB,CAAC,CAAC;QACxC,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,cAAc;IAI5B,OAAO;QACL,OAAO,EAAE,4BAAgB;QACzB,MAAM,EAAE,CAAC,+BAAqB,CAAC;QAC/B,UAAU,EAAE,CAAC,qBAAsD,EAAE,EAAE;YACrE,OAAO,IAAA,cAAQ,EAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;KACF,CAAC;AACJ,CAAC;AACY,QAAA,8BAA8B,GACzC;IACE,OAAO,EAAE,wCAA4B;IACrC,QAAQ,EAAE,yBAAmB;CAC9B,CAAC;AAES,QAAA,+BAA+B,GAC1C;IACE,OAAO,EAAE,yCAA6B;IACtC,QAAQ,EAAE,0BAAoB;CAC/B,CAAC"}
1
+ {"version":3,"file":"zod-validate.factory.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/factory/zod-validate.factory.ts"],"names":[],"mappings":";;;AAgCA,kDAWC;AACD,wCAWC;AACD,sCAgBC;AAED,wCAgBC;AAvFD,gCAagB;AAEhB,kDAQ4B;AAE5B,wCAAmD;AACnD,8CAAoF;AAGpF,SAAgB,mBAAmB;IAIjC,OAAO;QACL,OAAO,EAAE,kCAAsB;QAC/B,MAAM,EAAE,CAAC,+BAAqB,CAAC;QAC/B,UAAU,EAAE,CAAC,qBAAsD,EAAE,EAAE;YACrE,OAAO,IAAA,mBAAa,EAAC,qBAAqB,CAAC,CAAC;QAC9C,CAAC;KACF,CAAC;AACJ,CAAC;AACD,SAAgB,cAAc;IAI5B,OAAO;QACL,OAAO,EAAE,4BAAgB;QACzB,MAAM,EAAE,CAAC,+BAAqB,CAAC;QAC/B,UAAU,EAAE,CAAC,qBAAsD,EAAE,EAAE;YACrE,OAAO,IAAA,cAAQ,EAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;KACF,CAAC;AACJ,CAAC;AACD,SAAgB,aAAa;IAI3B,OAAO;QACL,OAAO,EAAE,2BAAe;QACxB,MAAM,EAAE,CAAC,+BAAqB,EAAE,0BAAc,CAAC;QAC/C,UAAU,EAAE,CACV,qBAAsD,EACtD,MAAsB,EACtB,EAAE;YACF,MAAM,aAAa,GAAG,IAAA,qCAAwB,EAAC,MAAM,CAAoC,CAAC;YAC1F,MAAM,cAAc,GAAG,IAAA,sCAAyB,EAAC,MAAM,CAAqC,CAAC;YAC7F,OAAO,IAAA,aAAO,EAAC,qBAAqB,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;QACvE,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,cAAc;IAI5B,OAAO;QACL,OAAO,EAAE,4BAAgB;QACzB,MAAM,EAAE,CAAC,+BAAqB,EAAE,0BAAc,CAAC;QAC/C,UAAU,EAAE,CACV,qBAAsD,EACtD,MAAsB,EACtB,EAAE;YACF,MAAM,aAAa,GAAG,IAAA,qCAAwB,EAAC,MAAM,CAAoC,CAAC;YAC1F,MAAM,cAAc,GAAG,IAAA,sCAAyB,EAAC,MAAM,CAAqC,CAAC;YAC7F,OAAO,IAAA,cAAQ,EAAC,qBAAqB,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;QACxE,CAAC;KACF,CAAC;AACJ,CAAC;AACY,QAAA,8BAA8B,GACzC;IACE,OAAO,EAAE,wCAA4B;IACrC,QAAQ,EAAE,yBAAmB;CAC9B,CAAC;AAES,QAAA,+BAA+B,GAC1C;IACE,OAAO,EAAE,yCAA6B;IACtC,QAAQ,EAAE,0BAAoB;CAC/B,CAAC"}
@@ -1,9 +1,11 @@
1
1
  import { EntityClass, AnyEntity } from '@klerick/json-api-nestjs-shared';
2
2
  import { MethodName } from '../types';
3
3
  import { Type } from '@nestjs/common/interfaces';
4
+ import { PostData, PatchData, Attributes, PatchDataRaw, PostDataRaw } from '../zod';
4
5
  export declare const nameIt: (name: string, cls: new (...rest: unknown[]) => Record<never, unknown>) => {
5
6
  new (...arg: unknown[]): {};
6
7
  };
7
8
  export declare function getProviderName<Entity extends object>(entity: EntityClass<Entity>, name: string): string;
8
9
  export declare function excludeMethod(names: Array<Partial<MethodName>>): Array<MethodName>;
9
10
  export declare function entityForClass<T = any>(type: Type<T>): EntityClass<AnyEntity>;
11
+ export declare function patchInputData<E extends object, IdKey extends string = 'id'>(data: PostData<E, IdKey> | PatchData<E, IdKey>, patch: Partial<Attributes<E, IdKey, true>>): PostData<E, IdKey> | PatchData<E, IdKey> extends PatchData<E, IdKey> ? PatchDataRaw<E, IdKey> : PostDataRaw<E, IdKey>;
@@ -4,6 +4,7 @@ exports.nameIt = void 0;
4
4
  exports.getProviderName = getProviderName;
5
5
  exports.excludeMethod = excludeMethod;
6
6
  exports.entityForClass = entityForClass;
7
+ exports.patchInputData = patchInputData;
7
8
  const json_api_nestjs_shared_1 = require("@klerick/json-api-nestjs-shared");
8
9
  const change_case_commonjs_1 = require("change-case-commonjs");
9
10
  const bindings_1 = require("../config/bindings");
@@ -27,4 +28,13 @@ function excludeMethod(names) {
27
28
  function entityForClass(type) {
28
29
  return Reflect.getMetadata(constants_1.JSON_API_DECORATOR_ENTITY, type);
29
30
  }
31
+ function patchInputData(data, patch) {
32
+ return {
33
+ ...data,
34
+ attributes: {
35
+ ...data.attributes,
36
+ ...patch,
37
+ },
38
+ };
39
+ }
30
40
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/helpers/utils.ts"],"names":[],"mappings":";;;AA0BA,0CAMC;AAED,sCAUC;AAED,wCAEC;AAhDD,4EAKyC;AACzC,+DAAkD;AAIlD,iDAA8C;AAE9C,kDAA+D;AAExD,MAAM,MAAM,GAAG,CACpB,IAAY,EACZ,GAAuD,EACvD,EAAE,CACF,CAAC;IACC,CAAC,IAAI,CAAC,EAAE,KAAM,SAAQ,GAAG;QACvB,YAAY,GAAG,GAAc;YAC3B,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;QAChB,CAAC;KACF;CACF,CAAC,IAAI,CAAC,CAAC,CAAC;AAVE,QAAA,MAAM,UAUR;AAEX,SAAgB,eAAe,CAC7B,MAA2B,EAC3B,IAAY;IAEZ,MAAM,UAAU,GAAG,IAAA,sCAAa,EAAC,MAAM,CAAC,CAAC;IACzC,OAAO,GAAG,IAAA,iCAAU,EAAC,UAAU,CAAC,GAAG,IAAI,EAAE,CAAC;AAC5C,CAAC;AAED,SAAgB,aAAa,CAC3B,KAAiC;IAEjC,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAC5B,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,EACzC,EAA0C,CAC3C,CAAC;IACF,OAAO,oCAAW,CAAC,IAAI,CAAC,mBAAQ,CAAC,CAAC,MAAM,CACtC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CACV,CAAC;AACzB,CAAC;AAED,SAAgB,cAAc,CAAU,IAAa;IACnD,OAAO,OAAO,CAAC,WAAW,CAAC,qCAAyB,EAAE,IAAI,CAAC,CAAC;AAC9D,CAAC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/helpers/utils.ts"],"names":[],"mappings":";;;AAiCA,0CAMC;AAED,sCAUC;AAED,wCAEC;AACD,wCAeC;AAvED,4EAKyC;AACzC,+DAAkD;AAIlD,iDAA8C;AAE9C,kDAA+D;AASxD,MAAM,MAAM,GAAG,CACpB,IAAY,EACZ,GAAuD,EACvD,EAAE,CACF,CAAC;IACC,CAAC,IAAI,CAAC,EAAE,KAAM,SAAQ,GAAG;QACvB,YAAY,GAAG,GAAc;YAC3B,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;QAChB,CAAC;KACF;CACF,CAAC,IAAI,CAAC,CAAC,CAAC;AAVE,QAAA,MAAM,UAUR;AAEX,SAAgB,eAAe,CAC7B,MAA2B,EAC3B,IAAY;IAEZ,MAAM,UAAU,GAAG,IAAA,sCAAa,EAAC,MAAM,CAAC,CAAC;IACzC,OAAO,GAAG,IAAA,iCAAU,EAAC,UAAU,CAAC,GAAG,IAAI,EAAE,CAAC;AAC5C,CAAC;AAED,SAAgB,aAAa,CAC3B,KAAiC;IAEjC,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAC5B,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,EACzC,EAA0C,CAC3C,CAAC;IACF,OAAO,oCAAW,CAAC,IAAI,CAAC,mBAAQ,CAAC,CAAC,MAAM,CACtC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CACV,CAAC;AACzB,CAAC;AAED,SAAgB,cAAc,CAAU,IAAa;IACnD,OAAO,OAAO,CAAC,WAAW,CAAC,qCAAyB,EAAE,IAAI,CAAC,CAAC;AAC9D,CAAC;AACD,SAAgB,cAAc,CAC5B,IAA8C,EAC9C,KAA0C;IAI1C,OAAO;QACL,GAAG,IAAI;QACP,UAAU,EAAE;YACV,GAAG,IAAI,CAAC,UAAU;YAClB,GAAG,KAAK;SACT;KAGsB,CAAC;AAC5B,CAAC"}
@@ -116,6 +116,28 @@ class JsonApiTransformerService {
116
116
  self: this.getLink(mapProps.typeName, item[primaryColumnName], 'relationships', i.toString()),
117
117
  },
118
118
  };
119
+ // Если relation НЕ в include, но есть FK поле — используем его для resource linkage
120
+ if (!includeMap.has(i) && !mapProps.relationProperty[i].isArray) {
121
+ const fkFieldName = mapProps.relationFkField[i];
122
+ if (fkFieldName) {
123
+ const fkValue = item[fkFieldName];
124
+ if (fkValue != null) {
125
+ const relationMapPops = this.entityParamMapService.getParamMap(mapProps.relationProperty[i].entityClass);
126
+ if (relationMapPops) {
127
+ // @ts-expect-error incorrect parse
128
+ acum[i]['data'] = {
129
+ id: String(fkValue),
130
+ type: relationMapPops.typeName,
131
+ };
132
+ }
133
+ }
134
+ else {
135
+ // FK поле null → data: null
136
+ // @ts-expect-error incorrect parse
137
+ acum[i]['data'] = null;
138
+ }
139
+ }
140
+ }
119
141
  if (includeMap.has(i)) {
120
142
  const relationMapPops = this.entityParamMapService.getParamMap(mapProps.relationProperty[i].entityClass);
121
143
  if (!relationMapPops)
@@ -1 +1 @@
1
- {"version":3,"file":"json-api-transformer.service.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/service/json-api-transformer.service.ts"],"names":[],"mappings":";;;;AAAA,2CAAoE;AACpE,uCAAiD;AACjD,4EAWyC;AACzC,+EAA0E;AAI1E,yEAAmE;AAEnE,SAAS,gBAAgB,CACvB,MAAS,EACT,UAAkB;IAElB,MAAM,UAAU,GAAG,MAAwB,CAAC;IAC5C,IAAI,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,iBAAiB,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IACnE,CAAC;AACH,CAAC;AAED,IAAA,mBAAU,GAAE,CAAC;AACb,MAAa,yBAAyB;IAID,iBAAiB,CAAqB;IAGjE,qBAAqB,CAAmC;IAExD,QAAQ,CAAY;IAE5B,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC;IAClD,CAAC;IAED,IAAI,OAAO;QACT,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC,CAAC;QACrB,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,eAAe,EAAE,CAAC;QACxD,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC;QAEvD,MAAM,gBAAgB,GAAG,IAAI,qCAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAEtE,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,eAAe,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,OAAO,IAAI,OAAO,CAAC,IAAI,KAAK,uB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AO,GAAG,QAAQ,CAAC,wBAAwB,CAAC,CAAC;gBACnD,IAAI,CAAC,OAAO;oBAAE,SAAS;gBACvB,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC3B,KAAK,MAAM,CAAC,IAAI,OAAc,EAAE,CAAC;wBAC/B,YAAY,CAAC,IAAI,CACf,IAAI,CAAC,aAAa,CAChB,CAAC,EACD,eAAmD,EACnD,eAAmD,CACpD,CACF,CAAC;oBACJ,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,YAAY,CAAC,IAAI,CACf,IAAI,CAAC,aAAa,CAChB,OAAO,EACP,eAA0D,EAC1D,eAA+C,CAChD,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;IAEO,OAAO,CAAC,GAAG,SAAmB;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;QAC3B,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;CACF;AArTD,8DAqTC;AAjToC;IAAlC,IAAA,eAAM,EAAC,wBAAiB,CAAC;sCAA6B,wBAAiB;oEAAC;AAGjE;IADP,IAAA,eAAM,EAAC,gDAAqB,CAAC;sCACE,gDAAqB;wEAAW"}
1
+ {"version":3,"file":"json-api-transformer.service.js","sourceRoot":"","sources":["../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/service/json-api-transformer.service.ts"],"names":[],"mappings":";;;;AAAA,2CAAoE;AACpE,uCAAiD;AACjD,4EAWyC;AACzC,+EAA0E;AAI1E,yEAAmE;AAEnE,SAAS,gBAAgB,CACvB,MAAS,EACT,UAAkB;IAElB,MAAM,UAAU,GAAG,MAAwB,CAAC;IAC5C,IAAI,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI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BAAiB,CAAC;sCAA6B,wBAAiB;oEAAC;AAGjE;IADP,IAAA,eAAM,EAAC,gDAAqB,CAAC;sCACE,gDAAqB;wEAAW"}
@@ -6,9 +6,12 @@ const swagger_1 = require("@nestjs/swagger");
6
6
  const types_1 = require("../../../../types");
7
7
  const utils_1 = require("../utils");
8
8
  const zod_2 = require("../../zod");
9
+ const decorators_1 = require("../../decorators");
9
10
  function patchOne(controller, descriptor, entity, mapEntity, methodName) {
10
11
  const entityName = entity.name;
11
12
  const primaryColumnType = mapEntity.entityParaMap.primaryColumnType;
13
+ const readOnlyProps = (0, decorators_1.getJsonApiReadOnlyFields)(entity);
14
+ const immutableProps = (0, decorators_1.getJsonApiImmutableFields)(entity);
12
15
  (0, swagger_1.ApiOperation)({
13
16
  summary: `Update item of resource "${entityName}"`,
14
17
  operationId: `${controller.constructor.name}_${methodName}`,
@@ -21,7 +24,7 @@ function patchOne(controller, descriptor, entity, mapEntity, methodName) {
21
24
  })(controller, methodName, descriptor);
22
25
  (0, swagger_1.ApiBody)({
23
26
  description: `Json api schema for update "${entityName}" item`,
24
- schema: zod_1.z.toJSONSchema((0, zod_2.zodPatch)(mapEntity), utils_1.zodToJSONSchemaParams),
27
+ schema: zod_1.z.toJSONSchema((0, zod_2.zodPatch)(mapEntity, readOnlyProps, immutableProps), utils_1.zodToJSONSchemaParams),
25
28
  required: true,
26
29
  })(controller, methodName, descriptor);
27
30
  (0, swagger_1.ApiResponse)({
@@ -1 +1 @@
1
- {"version":3,"file":"patch-one.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/patch-one.ts"],"names":[],"mappings":";;AAmBA,4BAgDC;AAlED,6BAAwB;AAKxB,6CAA+E;AAG/E,6CAA8C;AAE9C,oCAIkB;AAClB,mCAAqC;AAGrC,SAAgB,QAAQ,CACtB,UAAqB,EACrB,UAA8B,EAC9B,MAAsB,EACtB,SAA0C,EAC1C,UAAkB;IAElB,MAAM,UAAU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AAG;QACX,WAAW,EAAE,oBAAoB;QACjC,MAAM,EAAE,mBAAW;KACpB,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
1
+ {"version":3,"file":"patch-one.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/patch-one.ts"],"names":[],"mappings":";;AA2BA,4BAuDC;AAjFD,6BAAwB;AAKxB,6CAA+E;AAG/E,6CAI2B;AAE3B,oCAIkB;AAClB,mCAAqC;AAErC,iDAG0B;AAE1B,SAAgB,QAAQ,CACtB,UAAqB,EACrB,UAA8B,EAC9B,MAAsB,EACtB,SAA0C,EAC1C,UAAkB;IAElB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;IAE/B,MAAM,iBAAiB,GAAG,SAAS,CAAC,aAAa,CAAC,iBAAiB,CAAC;IACpE,MAAM,aAAa,GAAG,IAAA,qCAAwB,EAC5C,MAAM,CAC4B,CAAC;IACrC,MAAM,cAAc,GAAG,IAAA,sCAAyB,EAC9C,MAAM,CAC6B,CAAC;IAEtC,IAAA,sBAAY,EAAC;QACX,OAAO,EAAE,4BAA4B,UAAU,GAAG;QAClD,WAAW,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,IAAI,UAAU,EAAE;KAC5D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,kBAAQ,EAAC;QACP,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,iBAAiB,KAAK,iBAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;QACnE,WAAW,EAAE,mBAAmB,UAAU,GAAG;KAC9C,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,iBAAO,EAAC;QACN,WAAW,EAAE,+BAA+B,UAAU,QAAQ;QAC9D,MAAM,EAAE,OAAC,CAAC,YAAY,CACpB,IAAA,cAAQ,EAAC,SAAS,EAAE,aAAa,EAAE,cAAc,CAAC,EAClD,6BAAqB,CACY;QACnC,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,qBAAqB,UAAU,oBAAoB;QAChE,MAAM,EAAE,IAAA,0BAAkB,EAAC,MAAM,EAAE,SAAS,CAAC;KAC9C,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,uBAAuB;QACpC,MAAM,EAAE,mBAAW;KACpB,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,oBAAoB;QACjC,MAAM,EAAE,mBAAW;KACpB,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
@@ -5,15 +5,18 @@ const swagger_1 = require("@nestjs/swagger");
5
5
  const zod_1 = require("zod");
6
6
  const utils_1 = require("../utils");
7
7
  const zod_2 = require("../../zod");
8
+ const decorators_1 = require("../../decorators");
8
9
  function postOne(controller, descriptor, entity, mapEntity, methodName) {
9
10
  const entityName = entity.name;
11
+ const readOnlyProps = (0, decorators_1.getJsonApiReadOnlyFields)(entity);
12
+ const immutableProps = (0, decorators_1.getJsonApiImmutableFields)(entity);
10
13
  (0, swagger_1.ApiOperation)({
11
14
  summary: `Create item of resource "${entityName}"`,
12
15
  operationId: `${controller.constructor.name}_${methodName}`,
13
16
  })(controller, methodName, descriptor);
14
17
  (0, swagger_1.ApiBody)({
15
18
  description: `Json api schema for new "${entityName}" item`,
16
- schema: zod_1.z.toJSONSchema((0, zod_2.zodPost)(mapEntity), utils_1.zodToJSONSchemaParams),
19
+ schema: zod_1.z.toJSONSchema((0, zod_2.zodPost)(mapEntity, readOnlyProps, immutableProps), utils_1.zodToJSONSchemaParams),
17
20
  required: true,
18
21
  })(controller, methodName, descriptor);
19
22
  (0, swagger_1.ApiResponse)({
@@ -1 +1 @@
1
- {"version":3,"file":"post-one.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/post-one.ts"],"names":[],"mappings":";;AAiBA,0BAsCC;AAvDD,6CAAqE;AACrE,6BAAwB;AAQxB,oCAIkB;AAClB,mCAAoC;AAGpC,SAAgB,OAAO,CACrB,UAAqB,EACrB,UAA8B,EAC9B,MAAsB,EACtB,SAA0C,EAC1C,UAAkB;IAElB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;IAC/B,IAAA,sBAAY,EAAC;QACX,OAAO,EAAE,4BAA4B,UAAU,GAAG;QAClD,WAAW,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,IAAI,UAAU,EAAE;KAC5D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,iBAAO,EAAC;QACN,WAAW,EAAE,4BAA4B,UAAU,QAAQ;QAC3D,MAAM,EAAE,OAAC,CAAC,YAAY,CAAC,IAAA,aAAO,EAAC,SAAS,CAAC,EAAE,6BAAqB,CAE7C;QACnB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,qBAAqB,UAAU,oBAAoB;QAChE,MAAM,EAAE,IAAA,0BAAkB,EAAC,MAAM,EAAE,SAAS,CAAC;KAC9C,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,uBAAuB;QACpC,MAAM,EAAE,mBAAW;KACpB,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,oBAAoB;QACjC,MAAM,EAAE,mBAAW;KACpB,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
1
+ {"version":3,"file":"post-one.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/swagger/method/post-one.ts"],"names":[],"mappings":";;AAmBA,0BA+CC;AAlED,6CAAqE;AACrE,6BAAwB;AAQxB,oCAIkB;AAClB,mCAAoC;AAEpC,iDAAuF;AAGvF,SAAgB,OAAO,CACrB,UAAqB,EACrB,UAA8B,EAC9B,MAAsB,EACtB,SAA0C,EAC1C,UAAkB;IAElB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;IAE/B,MAAM,aAAa,GAAG,IAAA,qCAAwB,EAC5C,MAAM,CAC4B,CAAC;IACrC,MAAM,cAAc,GAAG,IAAA,sCAAyB,EAC9C,MAAM,CAC6B,CAAC;IAEtC,IAAA,sBAAY,EAAC;QACX,OAAO,EAAE,4BAA4B,UAAU,GAAG;QAClD,WAAW,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,IAAI,UAAU,EAAE;KAC5D,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,iBAAO,EAAC;QACN,WAAW,EAAE,4BAA4B,UAAU,QAAQ;QAC3D,MAAM,EAAE,OAAC,CAAC,YAAY,CACpB,IAAA,aAAO,EAAC,SAAS,EAAE,aAAa,EAAE,cAAc,CAAC,EACjD,6BAAqB,CACY;QACnC,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,qBAAqB,UAAU,oBAAoB;QAChE,MAAM,EAAE,IAAA,0BAAkB,EAAC,MAAM,EAAE,SAAS,CAAC;KAC9C,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,uBAAuB;QACpC,MAAM,EAAE,mBAAW;KACpB,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEvC,IAAA,qBAAW,EAAC;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,oBAAoB;QACjC,MAAM,EAAE,mBAAW;KACpB,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { z, ZodObject, ZodOptional } from 'zod';
2
- import { ZodAttributes, ZodId, ZodRelationships, ZodType } from '../zod-share';
2
+ import { ZodAttributes, ZodId, ZodRelationships, ZodType, Id, Attributes, Relationships } from '../zod-share';
3
3
  import { EntityParamMapService } from '../../service';
4
+ import { ExtractJsonApiReadOnlyKeys, ExtractJsonApiImmutableKeys } from '../../../../types';
4
5
  type ZodPatchPatchShape<E extends object, IdKey extends string> = {
5
6
  id: ZodId;
6
7
  type: ZodType<string>;
@@ -11,7 +12,17 @@ type ZodInputPatchSchema<E extends object, IdKey extends string> = ZodObject<Zod
11
12
  type ZodInputPatchDataShape<E extends object, IdKey extends string> = {
12
13
  data: ZodInputPatchSchema<E, IdKey>;
13
14
  };
14
- export declare function zodPatch<E extends object, IdKey extends string>(entityParamMapService: EntityParamMapService<E, IdKey>): ZodPatch<E, IdKey>;
15
+ export declare function zodPatch<E extends object, IdKey extends string>(entityParamMapService: EntityParamMapService<E, IdKey>, readOnlyProps?: ExtractJsonApiReadOnlyKeys<E>[], immutableProps?: ExtractJsonApiImmutableKeys<E>[]): ZodPatch<E, IdKey>;
15
16
  export type ZodPatch<E extends object, IdKey extends string> = ZodObject<ZodInputPatchDataShape<E, IdKey>, z.core.$strict>;
16
- export type PatchData<E extends object, IdKey extends string> = z.infer<ZodPatch<E, IdKey>>['data'];
17
+ export type PatchDataRaw<E extends object, IdKey extends string> = z.infer<ZodPatch<E, IdKey>>['data'];
18
+ type PatchAttributesType<E extends object, IdKey extends string> = Partial<Omit<Attributes<E, IdKey>, ExtractJsonApiReadOnlyKeys<E> | ExtractJsonApiImmutableKeys<E>>>;
19
+ export type PatchData<E extends object, IdKey extends string> = {
20
+ id: Id;
21
+ type: string;
22
+ attributes?: PatchAttributesType<E, IdKey>;
23
+ relationships?: Relationships<E, IdKey, true>;
24
+ };
25
+ export type Patch<E extends object, IdKey extends string> = {
26
+ data: PatchData<E, IdKey>;
27
+ };
17
28
  export {};
@@ -3,19 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.zodPatch = zodPatch;
4
4
  const zod_1 = require("zod");
5
5
  const zod_share_1 = require("../zod-share");
6
- function getShape(entityParamMapService) {
6
+ function getShape(entityParamMapService, readOnlyProps = [], immutableProps = []) {
7
7
  const shape = {
8
8
  id: (0, zod_share_1.zodId)(entityParamMapService.entityParaMap.primaryColumnType),
9
9
  type: (0, zod_share_1.zodType)(entityParamMapService.entityParaMap.typeName),
10
- attributes: (0, zod_share_1.zodAttributes)(entityParamMapService, true).optional(),
10
+ attributes: (0, zod_share_1.zodAttributes)(entityParamMapService, true, readOnlyProps, immutableProps).optional(),
11
11
  relationships: (0, zod_share_1.zodRelationships)(entityParamMapService, true).optional(),
12
12
  };
13
13
  return zod_1.z.strictObject(shape);
14
14
  }
15
- function zodPatch(entityParamMapService) {
16
- const shape = getShape(entityParamMapService);
17
- return zod_1.z
18
- .strictObject({
15
+ function zodPatch(entityParamMapService, readOnlyProps = [], immutableProps = []) {
16
+ const shape = getShape(entityParamMapService, readOnlyProps, immutableProps);
17
+ return zod_1.z.strictObject({
19
18
  data: shape,
20
19
  });
21
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-input-patch-schema/index.ts"],"names":[],"mappings":";;AA8CA,4BASC;AAvDD,6BAAgD;AAChD,4CASsB;AAqBtB,SAAS,QAAQ,CACf,qBAAsD;IAEtD,MAAM,KAAK,GAAG;QACZ,EAAE,EAAE,IAAA,iBAAK,EACP,qBAAqB,CAAC,aAAa,CAAC,iBAA8B,CACnE;QACD,IAAI,EAAE,IAAA,mBAAO,EAAC,qBAAqB,CAAC,aAAa,CAAC,QAAQ,CAAC;QAC3D,UAAU,EAAE,IAAA,yBAAa,EAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE;QACjE,aAAa,EAAE,IAAA,4BAAgB,EAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE;KACxE,CAAC;IAEF,OAAO,OAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAgB,QAAQ,CACtB,qBAAsD;IAEtD,MAAM,KAAK,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAE9C,OAAO,OAAC;SACL,YAAY,CAAC;QACZ,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC;AACP,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-input-patch-schema/index.ts"],"names":[],"mappings":";;AAmDA,4BAUC;AA7DD,6BAAgD;AAChD,4CAYsB;AAqBtB,SAAS,QAAQ,CACf,qBAAsD,EACtD,gBAAiD,EAAE,EACnD,iBAAmD,EAAE;IAErD,MAAM,KAAK,GAAG;QACZ,EAAE,EAAE,IAAA,iBAAK,EACP,qBAAqB,CAAC,aAAa,CAAC,iBAA8B,CACnE;QACD,IAAI,EAAE,IAAA,mBAAO,EAAC,qBAAqB,CAAC,aAAa,CAAC,QAAQ,CAAC;QAC3D,UAAU,EAAE,IAAA,yBAAa,EAAC,qBAAqB,EAAE,IAAI,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC,QAAQ,EAAE;QAChG,aAAa,EAAE,IAAA,4BAAgB,EAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE;KACxE,CAAC;IAEF,OAAO,OAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAgB,QAAQ,CACtB,qBAAsD,EACtD,gBAAiD,EAAE,EACnD,iBAAmD,EAAE;IAErD,MAAM,KAAK,GAAG,QAAQ,CAAC,qBAAqB,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;IAE7E,OAAO,OAAC,CAAC,YAAY,CAAC;QACpB,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC;AACL,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { z, ZodObject, ZodOptional } from 'zod';
2
- import { ZodId, ZodType, ZodAttributes, ZodRelationships } from '../zod-share';
2
+ import { ExtractJsonApiReadOnlyKeys, ExtractJsonApiImmutableKeys } from '../../../../types';
3
+ import { ZodId, ZodType, ZodAttributes, ZodRelationships, Id, Attributes, Relationships } from '../zod-share';
3
4
  import { EntityParamMapService } from '../../service';
4
5
  type ZodInputPostShape<E extends object, IdKey extends string> = {
5
6
  id: ZodOptional<ZodId>;
@@ -11,8 +12,17 @@ type ZodInputPostSchema<E extends object, IdKey extends string> = ZodObject<ZodI
11
12
  type ZodInputPostDataShape<E extends object, IdKey extends string> = {
12
13
  data: ZodInputPostSchema<E, IdKey>;
13
14
  };
14
- export declare function zodPost<E extends object, IdKey extends string>(entityParamMapService: EntityParamMapService<E, IdKey>): ZodPost<E, IdKey>;
15
+ export declare function zodPost<E extends object, IdKey extends string>(entityParamMapService: EntityParamMapService<E, IdKey>, readOnlyProps?: ExtractJsonApiReadOnlyKeys<E>[], immutableProps?: ExtractJsonApiImmutableKeys<E>[]): ZodPost<E, IdKey>;
15
16
  export type ZodPost<E extends object, IdKey extends string> = ZodObject<ZodInputPostDataShape<E, IdKey>, z.core.$strict>;
16
- export type Post<E extends object, IdKey extends string> = z.infer<ZodPost<E, IdKey>>;
17
- export type PostData<E extends object, IdKey extends string> = Post<E, IdKey>['data'];
17
+ export type PostDataRaw<E extends object, IdKey extends string> = Post<E, IdKey>['data'];
18
+ type PostAttributesType<E extends object, IdKey extends string> = Omit<Attributes<E, IdKey, false>, ExtractJsonApiReadOnlyKeys<E> | ExtractJsonApiImmutableKeys<E>> & Partial<Pick<Attributes<E, IdKey, false>, Extract<ExtractJsonApiImmutableKeys<E>, keyof Attributes<E, IdKey, false>>>>;
19
+ export type PostData<E extends object, IdKey extends string> = {
20
+ id?: Id;
21
+ type: string;
22
+ attributes: PostAttributesType<E, IdKey>;
23
+ relationships?: Relationships<E, IdKey, false>;
24
+ };
25
+ export type Post<E extends object, IdKey extends string> = {
26
+ data: PostData<E, IdKey>;
27
+ };
18
28
  export {};
@@ -3,19 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.zodPost = zodPost;
4
4
  const zod_1 = require("zod");
5
5
  const zod_share_1 = require("../zod-share");
6
- function getShape(entityParamMapService) {
6
+ function getShape(entityParamMapService, readOnlyProps = [], immutableProps = []) {
7
7
  const shape = {
8
8
  id: (0, zod_share_1.zodId)(entityParamMapService.entityParaMap.primaryColumnType).optional(),
9
9
  type: (0, zod_share_1.zodType)(entityParamMapService.entityParaMap.typeName),
10
- attributes: (0, zod_share_1.zodAttributes)(entityParamMapService, false),
10
+ attributes: (0, zod_share_1.zodAttributes)(entityParamMapService, false, readOnlyProps, immutableProps),
11
11
  relationships: (0, zod_share_1.zodRelationships)(entityParamMapService, false).optional(),
12
12
  };
13
13
  return zod_1.z.strictObject(shape);
14
14
  }
15
- function zodPost(entityParamMapService) {
16
- return zod_1.z
17
- .strictObject({
18
- data: getShape(entityParamMapService),
15
+ function zodPost(entityParamMapService, readOnlyProps = [], immutableProps = []) {
16
+ return zod_1.z.strictObject({
17
+ data: getShape(entityParamMapService, readOnlyProps, immutableProps),
19
18
  });
20
19
  }
21
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-input-post-schema/index.ts"],"names":[],"mappings":";;AA8CA,0BAOC;AArDD,6BAAgD;AAGhD,4CASsB;AAmBtB,SAAS,QAAQ,CACf,qBAAsD;IAEtD,MAAM,KAAK,GAAG;QACZ,EAAE,EAAE,IAAA,iBAAK,EACP,qBAAqB,CAAC,aAAa,CAAC,iBAA8B,CACnE,CAAC,QAAQ,EAAE;QACZ,IAAI,EAAE,IAAA,mBAAO,EAAC,qBAAqB,CAAC,aAAa,CAAC,QAAQ,CAAC;QAC3D,UAAU,EAAE,IAAA,yBAAa,EAAC,qBAAqB,EAAE,KAAK,CAAC;QACvD,aAAa,EAAE,IAAA,4BAAgB,EAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE;KACzE,CAAC;IAEF,OAAO,OAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAgB,OAAO,CACrB,qBAAsD;IAEtD,OAAO,OAAC;SACL,YAAY,CAAC;QACZ,IAAI,EAAE,QAAQ,CAAC,qBAAqB,CAAC;KACtC,CAAC,CAAA;AACN,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-input-post-schema/index.ts"],"names":[],"mappings":";;AA6DA,0BAQC;AArED,6BAAgD;AAOhD,4CAYsB;AAoBtB,SAAS,QAAQ,CACf,qBAAsD,EACtD,gBAAiD,EAAE,EACnD,iBAAmD,EAAE;IAErD,MAAM,KAAK,GAAG;QACZ,EAAE,EAAE,IAAA,iBAAK,EACP,qBAAqB,CAAC,aAAa,CAAC,iBAA8B,CACnE,CAAC,QAAQ,EAAE;QACZ,IAAI,EAAE,IAAA,mBAAO,EAAC,qBAAqB,CAAC,aAAa,CAAC,QAAQ,CAAC;QAC3D,UAAU,EAAE,IAAA,yBAAa,EACvB,qBAAqB,EACrB,KAAK,EACL,aAAa,EACb,cAAc,CACf;QACD,aAAa,EAAE,IAAA,4BAAgB,EAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE;KACzE,CAAC;IAEF,OAAO,OAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAgB,OAAO,CACrB,qBAAsD,EACtD,gBAAiD,EAAE,EACnD,iBAAmD,EAAE;IAErD,OAAO,OAAC,CAAC,YAAY,CAAC;QACpB,IAAI,EAAE,QAAQ,CAAC,qBAAqB,EAAE,aAAa,EAAE,cAAc,CAAC;KACrE,CAAC,CAAC;AACL,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z, ZodArray } from 'zod';
2
- import { EntityParam, TypeField } from '../../../../types';
2
+ import { EntityParam, TypeField, ExtractJsonApiReadOnlyKeys, ExtractJsonApiImmutableKeys } from '../../../../types';
3
3
  import { ResultSchema } from './type';
4
4
  import { EntityParamMapService } from '../../service';
5
5
  export declare function getZodRulesForNumber<Null extends true | false, isPatch extends true | false>(isNullable: Null, isPatch: isPatch): ResultSchema<z.ZodPipe<z.ZodTransform<number, unknown>, z.ZodNumber>, Null, isPatch>;
@@ -20,7 +20,7 @@ type ZodRules<E extends object, IdKey extends string, P extends keyof E, IsArray
20
20
  export type ShapeAttributesType<E extends object, IdKey extends string, isPatch extends boolean> = {
21
21
  [K in keyof OmitPrimary<E, IdKey>]: ZodRules<E, IdKey, K, IsTypeArray<OmitPrimary<E, IdKey>[K]>, isPatch>;
22
22
  };
23
- export declare function zodAttributes<E extends object, IdKey extends string, S extends true | false = false>(entityParamMapService: EntityParamMapService<E, IdKey>, isPatch: S): z.ZodObject<ShapeAttributesType<E, IdKey, S> extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strict>;
23
+ export declare function zodAttributes<E extends object, IdKey extends string, S extends true | false = false>(entityParamMapService: EntityParamMapService<E, IdKey>, isPatch: S, readOnlyProps?: ExtractJsonApiReadOnlyKeys<E>[], immutableProps?: ExtractJsonApiImmutableKeys<E>[]): z.ZodObject<ShapeAttributesType<E, IdKey, S> extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strict>;
24
24
  export type ZodAttributes<E extends object, IdKey extends string, K extends true | false = false> = ReturnType<typeof zodAttributes<E, IdKey, K>>;
25
25
  export type Attributes<E extends object, IdKey extends string, K extends true | false = false> = z.infer<ZodAttributes<E, IdKey, K>>;
26
26
  export {};
@@ -67,11 +67,17 @@ function buildSchema(paramMap, propsName, isPatch) {
67
67
  function assertOmitKeysProps(primaryColumnName, key) {
68
68
  return !(key.toString() === primaryColumnName);
69
69
  }
70
- function zodAttributes(entityParamMapService, isPatch) {
70
+ function zodAttributes(entityParamMapService, isPatch, readOnlyProps = [], immutableProps = []) {
71
71
  const paramsMap = entityParamMapService.entityParaMap;
72
+ const excludeProps = isPatch
73
+ ? [...readOnlyProps, ...immutableProps]
74
+ : readOnlyProps;
72
75
  const objectShape = json_api_nestjs_shared_1.ObjectTyped.keys(paramsMap.propsType).reduce((acum, key) => {
73
- if (assertOmitKeysProps(paramsMap.primaryColumnName, key)) {
74
- acum[key] = buildSchema(paramsMap, key, isPatch);
76
+ if (assertOmitKeysProps(paramsMap.primaryColumnName, key) &&
77
+ !excludeProps.includes(key)) {
78
+ const isImmutable = immutableProps.includes(key);
79
+ const schema = buildSchema(paramsMap, key, isPatch || isImmutable);
80
+ acum[key] = schema;
75
81
  }
76
82
  return acum;
77
83
  }, {});
@@ -1 +1 @@
1
- {"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-share/attributes.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OAAO,qBAAqB,CAAC,UAAU,EAAE,OAAO,CAM/C,CAAC;QACJ,KAAK,iBAAS,CAAC,MAAM;YACnB,OAAO,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAM9C,CAAC;QACJ,KAAK,iBAAS,CAAC,MAAM;YACnB,OAAO,mBAAmB,CAAC,UAAU,EAAE,OAAO,CAM7C,CAAC;QACJ;YACE,OAAO,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAM9C,CAAC;IACN,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAC1B,iBAA6D,EAC7D,GAA0B;IAE1B,OAAO,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,iBAAiB,CAAC,CAAC;AACjD,CAAC;AAED,SAAgB,aAAa,CAI3B,qBAAsD,EAAE,OAAU;IAClE,MAAM,SAAS,GAAG,qBAAqB,CAAC,aAAa,CAAC;IAEtD,MAAM,WAAW,GAAG,oCAAW,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,MAAM,CAC9D,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QACZ,IAAI,mBAAmB,CAAC,SAAS,CAAC,iBAAiB,EAAE,GAAG,CAAC,EAAE,CAAC;YAC1D,IAAI,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACnD,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,EACD,EAAsC,CACvC,CAAC;IAEF,OAAO,OAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,IAAA,0BAAc,GAAE,CAAC,CAAC;AACjE,CAAC"}
1
+ {"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../../../../../../../../../libs/json-api/json-api-nestjs/src/lib/modules/mixin/zod/zod-share/attributes.ts"],"names":[],"mappings":";;AASA,oDAMC;AAiOD,sCAkCC;AAlRD,4EAA8D;AAC9D,6BAA2C;AAE3C,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MAAM,CAAC,IAAA,0BAAc,GAAE,CAAC,CAAC;AACjE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { Union, Object } from 'ts-toolbelt';
2
2
  import { PropertyKeys, RelationKeys, IsIterator, Constructor } from '@klerick/json-api-nestjs-shared';
3
3
  import { CastIteratorType, UnionToTuple, IsArray, CastArrayType } from './utils-type';
4
+ type ExtractBaseType<T> = T extends Date ? Date : T extends boolean ? boolean : T extends number ? number : T extends string ? string : T extends null ? null : T extends undefined ? undefined : T extends (infer U)[] ? U[] : object;
4
5
  export declare enum TypeField {
5
6
  array = "array",
6
7
  date = "date",
@@ -11,15 +12,15 @@ export declare enum TypeField {
11
12
  null = "null"
12
13
  }
13
14
  export type TypeForId = Extract<TypeField, TypeField.number | TypeField.string>;
14
- type TypeProps<T> = T extends Date ? TypeField.date : T extends any[] ? TypeField.array : T extends object ? TypeField.object : T extends boolean ? TypeField.boolean : T extends number ? TypeField.number : T extends string ? TypeField.string : TypeField.object;
15
+ type TypeProps<T> = T extends Date ? TypeField.date : T extends any[] ? TypeField.array : T extends object ? TypeField.object : T extends boolean ? TypeField.boolean : T extends number ? TypeField.number : T extends string ? TypeField.string : T extends undefined ? never : TypeField.object;
15
16
  export type PropertyWithType<E extends object, IdKey extends string = 'id'> = {
16
- [K in PropertyKeys<E, IdKey>]: Exclude<E[K], null> extends never ? TypeField.null : TypeProps<Exclude<E[K], null>>;
17
+ [K in PropertyKeys<E, IdKey>]: Exclude<E[K], null | undefined> extends never ? TypeField.null : TypeProps<ExtractBaseType<Exclude<E[K], null | undefined>>>;
17
18
  };
18
19
  export type ArrayProperty<E extends object, IdKey extends string = 'id'> = {
19
- [K in PropertyKeys<E, IdKey>]: Exclude<E[K], null> extends never ? never : IsArray<Exclude<E[K], null>> extends 1 ? K : never;
20
+ [K in PropertyKeys<E, IdKey>]: Exclude<E[K], null | undefined> extends never ? never : IsArray<Exclude<E[K], null | undefined>> extends 1 ? K : never;
20
21
  }[PropertyKeys<E, IdKey>];
21
22
  export type ArrayPropertyType<E extends object, IdKey extends string = 'id'> = {
22
- [K in ArrayProperty<E, IdKey>]: TypeProps<CastArrayType<Exclude<E[K], null>>>;
23
+ [K in ArrayProperty<E, IdKey>]: TypeProps<CastArrayType<Exclude<E[K], null | undefined>>>;
23
24
  };
24
25
  export type NullableProperty<E extends object, IdKey extends string = 'id'> = Union.Intersect<Object.NullableKeys<E>, PropertyKeys<E, IdKey>>;
25
26
  export type RelationProperty<E extends object, IdKey extends string = 'id'> = {
@@ -41,6 +42,7 @@ export type EntityParam<E extends object, IdKey extends string = 'id'> = {
41
42
  className: string;
42
43
  relations: UnionToTuple<RelationKeys<E, IdKey>>;
43
44
  relationProperty: RelationProperty<E>;
45
+ relationFkField: Partial<Record<RelationKeys<E, IdKey>, string>>;
44
46
  };
45
47
  type RelationType<E extends object, IdKey extends string, K extends keyof EntityParam<E, IdKey>['relationProperty']> = EntityParam<E, IdKey>['relationProperty'][K]['entityClass'] extends Constructor<infer T> ? Exclude<T, null> : never;
46
48
  export type EntityRelationProps<E extends object, IdKey extends string = 'id'> = {
@@ -1,6 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TypeField = void 0;
4
+ // import {
5
+ // JsonApiReadOnlyField,
6
+ // JsonApiImmutableField,
7
+ // } from './json-api-read-only';
8
+ // // Remove marker types from value type
9
+ // type CleanMarkerTypes<T> = T extends JsonApiReadOnlyField &
10
+ // JsonApiImmutableField
11
+ // ? Omit<T, keyof JsonApiReadOnlyField | keyof JsonApiImmutableField>
12
+ // : T extends JsonApiReadOnlyField
13
+ // ? Omit<T, keyof JsonApiReadOnlyField>
14
+ // : T extends JsonApiImmutableField
15
+ // ? Omit<T, keyof JsonApiImmutableField>
16
+ // : T;
4
17
  var TypeField;
5
18
  (function (TypeField) {
6
19
  TypeField["array"] = "array";
@@ -1 +1 @@
1
- {"version":3,"file":"entity-param.type.js","sourceRoot":"","sources":["../../../../../../../libs/json-api/json-api-nestjs/src/lib/types/entity-param.type.ts"],"names":[],"mappings":";;;AAcA,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;IACnB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,0BAAa,CAAA;AACf,CAAC,EARW,SAAS,yBAAT,SAAS,QAQpB"}
1
+ {"version":3,"file":"entity-param.type.js","sourceRoot":"","sources":["../../../../../../../libs/json-api/json-api-nestjs/src/lib/types/entity-param.type.ts"],"names":[],"mappings":";;;AAyBA,WAAW;AACX,0BAA0B;AAC1B,2BAA2B;AAC3B,iCAAiC;AAEjC,yCAAyC;AACzC,8DAA8D;AAC9D,0BAA0B;AAC1B,wEAAwE;AACxE,qCAAqC;AACrC,0CAA0C;AAC1C,sCAAsC;AACtC,2CAA2C;AAC3C,SAAS;AAET,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;IACnB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,0BAAa,CAAA;AACf,CAAC,EARW,SAAS,yBAAT,SAAS,QAQpB"}
@@ -3,3 +3,4 @@ export * from './module-options.types';
3
3
  export * from './utils-type';
4
4
  export * from './entity-param.type';
5
5
  export * from './error.types';
6
+ export * from './json-api-read-only';
@@ -6,4 +6,5 @@ tslib_1.__exportStar(require("./module-options.types"), exports);
6
6
  tslib_1.__exportStar(require("./utils-type"), exports);
7
7
  tslib_1.__exportStar(require("./entity-param.type"), exports);
8
8
  tslib_1.__exportStar(require("./error.types"), exports);
9
+ tslib_1.__exportStar(require("./json-api-read-only"), exports);
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/json-api/json-api-nestjs/src/lib/types/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B;AAC9B,iEAAuC;AACvC,uDAA6B;AAC7B,8DAAoC;AACpC,wDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/json-api/json-api-nestjs/src/lib/types/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B;AAC9B,iEAAuC;AACvC,uDAA6B;AAC7B,8DAAoC;AACpC,wDAA8B;AAC9B,+DAAqC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Marker type for fields that should be excluded from POST/PATCH input.
3
+ * Use with @JsonApiReadOnly() decorator for runtime exclusion.
4
+ *
5
+ * For FK fields (relationFkField), only the type marker is needed
6
+ * since runtime exclusion is handled automatically.
7
+ *
8
+ * @example
9
+ * // FK field - only type marker needed
10
+ * @Property({ persist: false })
11
+ * public createdById!: number & Opt & JsonApiReadOnlyField;
12
+ *
13
+ * // Other read-only fields - decorator + type marker
14
+ * @Property()
15
+ * @JsonApiReadOnly()
16
+ * public createdAt!: Date & JsonApiReadOnlyField;
17
+ */
18
+ export type JsonApiReadOnlyField = {
19
+ readonly __jsonApiReadOnly?: never;
20
+ };
21
+ /**
22
+ * Extracts keys of fields marked as JsonApiReadOnlyField
23
+ */
24
+ export type ExtractJsonApiReadOnlyKeys<T> = {
25
+ [K in keyof T]: T[K] extends JsonApiReadOnlyField ? K : never;
26
+ }[keyof T];
27
+ /**
28
+ * Omits JsonApiReadOnlyField fields from type
29
+ */
30
+ export type OmitJsonApiReadOnly<T> = Omit<T, ExtractJsonApiReadOnlyKeys<T>>;
31
+ /**
32
+ * Marker type for fields that can be set on POST (optional) but excluded from PATCH.
33
+ * Use with @JsonApiImmutable() decorator for runtime behavior.
34
+ *
35
+ * Use case: fields that are computed by business logic for regular users,
36
+ * but can be set by admins during creation. Cannot be modified after creation.
37
+ *
38
+ * @example
39
+ * @Property()
40
+ * @JsonApiImmutable()
41
+ * public score!: number & JsonApiImmutableField;
42
+ */
43
+ export type JsonApiImmutableField = {
44
+ readonly __jsonApiImmutable?: never;
45
+ };
46
+ /**
47
+ * Extracts keys of fields marked as JsonApiImmutableField
48
+ */
49
+ export type ExtractJsonApiImmutableKeys<T> = {
50
+ [K in keyof T]: T[K] extends JsonApiImmutableField ? K : never;
51
+ }[keyof T];
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=json-api-read-only.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-api-read-only.js","sourceRoot":"","sources":["../../../../../../../libs/json-api/json-api-nestjs/src/lib/types/json-api-read-only.ts"],"names":[],"mappings":""}