@zola_do/crud 0.2.15 → 0.2.17
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 +105 -0
- package/dist/{shared/api-data → optional/swagger}/api-paginated-response.js +1 -1
- package/dist/optional/swagger/api-paginated-response.js.map +1 -0
- package/dist/optional/swagger/data-response-format.d.ts +11 -0
- package/dist/optional/swagger/data-response-format.js +50 -0
- package/dist/optional/swagger/data-response-format.js.map +1 -0
- package/dist/optional/swagger.d.ts +2 -0
- package/dist/optional/swagger.js +19 -0
- package/dist/optional/swagger.js.map +1 -0
- package/dist/shared/api-data/data-response-format.js +0 -42
- package/dist/shared/api-data/data-response-format.js.map +1 -1
- package/dist/shared/api-data/index.d.ts +0 -1
- package/dist/shared/api-data/index.js +0 -1
- package/dist/shared/api-data/index.js.map +1 -1
- package/dist/shared/exceptions/global-exception.filter.d.ts +5 -0
- package/dist/shared/exceptions/global-exception.filter.js +16 -5
- package/dist/shared/exceptions/global-exception.filter.js.map +1 -1
- package/dist/shared/utils/get-client-ip.helper.d.ts +12 -0
- package/dist/shared/utils/get-client-ip.helper.js +26 -0
- package/dist/shared/utils/get-client-ip.helper.js.map +1 -0
- package/dist/shared/utils/index.d.ts +1 -0
- package/dist/shared/utils/index.js +1 -0
- package/dist/shared/utils/index.js.map +1 -1
- package/dist/shared/utils/redis-idempotency.store.d.ts +12 -0
- package/dist/shared/utils/redis-idempotency.store.js +27 -0
- package/dist/shared/utils/redis-idempotency.store.js.map +1 -0
- package/dist/shared/utils/validate-dto.js +2 -1
- package/dist/shared/utils/validate-dto.js.map +1 -1
- package/package.json +8 -3
- package/dist/shared/api-data/api-paginated-response.js.map +0 -1
- /package/dist/{shared/api-data → optional/swagger}/api-paginated-response.d.ts +0 -0
package/README.md
CHANGED
|
@@ -752,8 +752,25 @@ import {
|
|
|
752
752
|
} from '@zola_do/crud';
|
|
753
753
|
```
|
|
754
754
|
|
|
755
|
+
## Supply chain / Socket.dev
|
|
756
|
+
|
|
757
|
+
Dependency Alerts on npm reflect **NestJS, Express, TypeORM, and authorization transitives**, not malware in `@zola_do/crud` source. Use subpath imports (`./optional/swagger`, `./optional/rpc`) where possible to keep optional peer trees smaller.
|
|
758
|
+
|
|
759
|
+
See [docs/SUPPLY_CHAIN.md](../../docs/SUPPLY_CHAIN.md) for per-alert triage.
|
|
760
|
+
|
|
755
761
|
## Optional Features
|
|
756
762
|
|
|
763
|
+
### Swagger OpenAPI helpers
|
|
764
|
+
|
|
765
|
+
Paginated response decorators and data response DTOs require `@nestjs/swagger`:
|
|
766
|
+
|
|
767
|
+
```typescript
|
|
768
|
+
import {
|
|
769
|
+
ApiPaginatedResponse,
|
|
770
|
+
DataResponseFormat,
|
|
771
|
+
} from '@zola_do/crud/optional/swagger';
|
|
772
|
+
```
|
|
773
|
+
|
|
757
774
|
### RPC Exception Filter
|
|
758
775
|
|
|
759
776
|
For NestJS microservices:
|
|
@@ -774,6 +791,94 @@ export class OrdersModule {}
|
|
|
774
791
|
|
|
775
792
|
Requires `@nestjs/microservices` peer dependency.
|
|
776
793
|
|
|
794
|
+
## Advanced features
|
|
795
|
+
|
|
796
|
+
### Bulk create and bulk delete
|
|
797
|
+
|
|
798
|
+
Enable batch endpoints on `EntityCrudController`:
|
|
799
|
+
|
|
800
|
+
```typescript
|
|
801
|
+
@EntityCrudController(
|
|
802
|
+
{
|
|
803
|
+
enableBulkCreate: true,
|
|
804
|
+
enableBulkDelete: true,
|
|
805
|
+
bulkCreatePermission: 'products:create',
|
|
806
|
+
bulkDeletePermission: 'products:delete',
|
|
807
|
+
},
|
|
808
|
+
Product,
|
|
809
|
+
)
|
|
810
|
+
export class ProductController extends EntityCrudControllerHost {}
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
- `POST /products/bulk` — body `{ items: [...] }`
|
|
814
|
+
- `POST /products/bulk-delete` — body `{ ids: string[] }`
|
|
815
|
+
- Disable per operation with `operations.bulkCreate` / `operations.bulkDelete` (`hide` | `block`)
|
|
816
|
+
|
|
817
|
+
### Create idempotency
|
|
818
|
+
|
|
819
|
+
Register a `CrudIdempotencyStore` and enable on entity options:
|
|
820
|
+
|
|
821
|
+
```typescript
|
|
822
|
+
import {
|
|
823
|
+
CRUD_IDEMPOTENCY_STORE,
|
|
824
|
+
InMemoryCrudIdempotencyStore,
|
|
825
|
+
} from '@zola_do/crud';
|
|
826
|
+
|
|
827
|
+
@Module({
|
|
828
|
+
providers: [
|
|
829
|
+
{
|
|
830
|
+
provide: CRUD_IDEMPOTENCY_STORE,
|
|
831
|
+
useClass: InMemoryCrudIdempotencyStore, // swap for Redis in production
|
|
832
|
+
},
|
|
833
|
+
],
|
|
834
|
+
})
|
|
835
|
+
export class AppModule {}
|
|
836
|
+
|
|
837
|
+
@EntityCrudController({ idempotency: { enabled: true, ttlMs: 86_400_000 } }, Order)
|
|
838
|
+
export class OrderController extends EntityCrudControllerHost {}
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
Clients send `Idempotency-Key` (configurable via `headerName`). Replays return the stored create response.
|
|
842
|
+
|
|
843
|
+
### Optimistic concurrency
|
|
844
|
+
|
|
845
|
+
```typescript
|
|
846
|
+
@EntityCrudController({ optimisticConcurrency: true }, Product)
|
|
847
|
+
export class ProductController extends EntityCrudControllerHost {}
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
Updates require a version field on the entity; conflicts return HTTP 409.
|
|
851
|
+
|
|
852
|
+
### Cursor pagination (plain query params)
|
|
853
|
+
|
|
854
|
+
CRUD list endpoints accept compact `?q=` (see `@zola_do/collection-query`) **or** plain params:
|
|
855
|
+
|
|
856
|
+
```
|
|
857
|
+
GET /products?cursor=<token>&limit=20&direction=next
|
|
858
|
+
GET /products?cursor=<token>&limit=20&direction=prev
|
|
859
|
+
```
|
|
860
|
+
|
|
861
|
+
Response may include cursor metadata alongside `total` / `items` when cursor mode is active.
|
|
862
|
+
|
|
863
|
+
### `collectionQueryDefaults`
|
|
864
|
+
|
|
865
|
+
Apply default column allowlists for every list on a controller:
|
|
866
|
+
|
|
867
|
+
```typescript
|
|
868
|
+
@EntityCrudController(
|
|
869
|
+
{
|
|
870
|
+
collectionQueryDefaults: {
|
|
871
|
+
allowedFilterColumns: ['name', 'status', 'createdAt'],
|
|
872
|
+
allowedSortColumns: ['name', 'createdAt'],
|
|
873
|
+
},
|
|
874
|
+
},
|
|
875
|
+
Product,
|
|
876
|
+
)
|
|
877
|
+
export class ProductController extends EntityCrudControllerHost {}
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
Unset allowlists skip enforcement — set defaults for defense in depth.
|
|
881
|
+
|
|
777
882
|
## Troubleshooting
|
|
778
883
|
|
|
779
884
|
### Q: How do I add custom methods to the CRUD service?
|
|
@@ -8,7 +8,7 @@ const ApiPaginatedResponse = (model) => {
|
|
|
8
8
|
return (0, common_1.applyDecorators)((0, swagger_1.ApiOkResponse)({
|
|
9
9
|
schema: {
|
|
10
10
|
allOf: [
|
|
11
|
-
{ $ref: (0, swagger_1.getSchemaPath)(data_response_format_1.
|
|
11
|
+
{ $ref: (0, swagger_1.getSchemaPath)(data_response_format_1.DataResponseFormatSwagger) },
|
|
12
12
|
{
|
|
13
13
|
properties: {
|
|
14
14
|
total: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-paginated-response.js","sourceRoot":"","sources":["../../../src/optional/swagger/api-paginated-response.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,6CAA+D;AAC/D,iEAAmE;AAE5D,MAAM,oBAAoB,GAAG,CAClC,KAAa,EACb,EAAE;IACF,OAAO,IAAA,wBAAe,EACpB,IAAA,uBAAa,EAAC;QACZ,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,gDAAyB,CAAC,EAAE;gBAClD;oBACE,UAAU,EAAE;wBACV,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;yBACf;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,KAAK,CAAC,EAAE;yBACtC;wBACD,UAAU,EAAE;4BACV,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,IAAI;yBACf;wBACD,UAAU,EAAE;4BACV,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,IAAI;yBACf;wBACD,WAAW,EAAE;4BACX,IAAI,EAAE,SAAS;4BACf,QAAQ,EAAE,IAAI;yBACf;wBACD,EAAE,EAAE;4BACF,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,IAAI;yBACf;wBACD,EAAE,EAAE;4BACF,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,IAAI;yBACf;wBACD,EAAE,EAAE;4BACF,IAAI,EAAE,SAAS;4BACf,QAAQ,EAAE,IAAI;yBACf;qBACF;iBACF;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AA/CW,QAAA,oBAAoB,wBA+C/B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class DataResponseFormatSwagger<T> {
|
|
2
|
+
total: number;
|
|
3
|
+
items: T[];
|
|
4
|
+
nextCursor?: string;
|
|
5
|
+
prevCursor?: string;
|
|
6
|
+
hasNextPage?: boolean;
|
|
7
|
+
nc?: string;
|
|
8
|
+
pc?: string;
|
|
9
|
+
hn?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export { DataResponseFormatSwagger as DataResponseFormatDto };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DataResponseFormatDto = exports.DataResponseFormatSwagger = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
class DataResponseFormatSwagger {
|
|
15
|
+
}
|
|
16
|
+
exports.DataResponseFormatSwagger = DataResponseFormatSwagger;
|
|
17
|
+
exports.DataResponseFormatDto = DataResponseFormatSwagger;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)(),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], DataResponseFormatSwagger.prototype, "total", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, swagger_1.ApiProperty)({ isArray: true }),
|
|
24
|
+
__metadata("design:type", Array)
|
|
25
|
+
], DataResponseFormatSwagger.prototype, "items", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], DataResponseFormatSwagger.prototype, "nextCursor", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], DataResponseFormatSwagger.prototype, "prevCursor", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
36
|
+
__metadata("design:type", Boolean)
|
|
37
|
+
], DataResponseFormatSwagger.prototype, "hasNextPage", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], DataResponseFormatSwagger.prototype, "nc", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], DataResponseFormatSwagger.prototype, "pc", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
48
|
+
__metadata("design:type", Boolean)
|
|
49
|
+
], DataResponseFormatSwagger.prototype, "hn", void 0);
|
|
50
|
+
//# sourceMappingURL=data-response-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-response-format.js","sourceRoot":"","sources":["../../../src/optional/swagger/data-response-format.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAE9C,MAAa,yBAAyB;CAwBrC;AAxBD,8DAwBC;AAGqC,0DAAqB;AAzBzD;IADC,IAAA,qBAAW,GAAE;;wDACC;AAGf;IADC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;wDACnB;AAGZ;IADC,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;6DACb;AAGpB;IADC,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;6DACb;AAGpB;IADC,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;8DACX;AAGtB;IADC,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qDACrB;AAGZ;IADC,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qDACrB;AAGZ;IADC,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qDACpB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./swagger/api-paginated-response"), exports);
|
|
18
|
+
__exportStar(require("./swagger/data-response-format"), exports);
|
|
19
|
+
//# sourceMappingURL=swagger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swagger.js","sourceRoot":"","sources":["../../src/optional/swagger.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,iEAA+C"}
|
|
@@ -1,49 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.DataResponseFormat = void 0;
|
|
13
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
14
4
|
class DataResponseFormat {
|
|
15
5
|
}
|
|
16
6
|
exports.DataResponseFormat = DataResponseFormat;
|
|
17
|
-
__decorate([
|
|
18
|
-
(0, swagger_1.ApiProperty)(),
|
|
19
|
-
__metadata("design:type", Number)
|
|
20
|
-
], DataResponseFormat.prototype, "total", void 0);
|
|
21
|
-
__decorate([
|
|
22
|
-
(0, swagger_1.ApiProperty)({ isArray: true }),
|
|
23
|
-
__metadata("design:type", Array)
|
|
24
|
-
], DataResponseFormat.prototype, "items", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, swagger_1.ApiProperty)({ required: false }),
|
|
27
|
-
__metadata("design:type", String)
|
|
28
|
-
], DataResponseFormat.prototype, "nextCursor", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, swagger_1.ApiProperty)({ required: false }),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], DataResponseFormat.prototype, "prevCursor", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, swagger_1.ApiProperty)({ required: false }),
|
|
35
|
-
__metadata("design:type", Boolean)
|
|
36
|
-
], DataResponseFormat.prototype, "hasNextPage", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, swagger_1.ApiProperty)({ required: false }),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], DataResponseFormat.prototype, "nc", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, swagger_1.ApiProperty)({ required: false }),
|
|
43
|
-
__metadata("design:type", String)
|
|
44
|
-
], DataResponseFormat.prototype, "pc", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, swagger_1.ApiProperty)({ required: false }),
|
|
47
|
-
__metadata("design:type", Boolean)
|
|
48
|
-
], DataResponseFormat.prototype, "hn", void 0);
|
|
49
7
|
//# sourceMappingURL=data-response-format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-response-format.js","sourceRoot":"","sources":["../../../src/shared/api-data/data-response-format.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-response-format.js","sourceRoot":"","sources":["../../../src/shared/api-data/data-response-format.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAkB;CAS9B;AATD,gDASC"}
|
|
@@ -14,6 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./api-paginated-response"), exports);
|
|
18
17
|
__exportStar(require("./data-response-format"), exports);
|
|
19
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/api-data/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/api-data/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ArgumentsHost, ExceptionFilter } from '@nestjs/common';
|
|
2
|
+
export type GlobalExceptionFilterOptions = {
|
|
3
|
+
includePath?: boolean;
|
|
4
|
+
};
|
|
2
5
|
export declare class GlobalExceptionFilter implements ExceptionFilter {
|
|
3
6
|
private readonly logger;
|
|
7
|
+
private readonly includePath;
|
|
8
|
+
constructor(options?: GlobalExceptionFilterOptions);
|
|
4
9
|
catch(exception: any, host: ArgumentsHost): void;
|
|
5
10
|
}
|
|
@@ -5,10 +5,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
8
11
|
var GlobalExceptionFilter_1;
|
|
9
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
13
|
exports.GlobalExceptionFilter = void 0;
|
|
11
14
|
const common_1 = require("@nestjs/common");
|
|
15
|
+
const get_client_ip_helper_1 = require("../utils/get-client-ip.helper");
|
|
12
16
|
function normalizeHttpExceptionMessage(exception) {
|
|
13
17
|
const res = exception.getResponse();
|
|
14
18
|
if (typeof res === 'string') {
|
|
@@ -26,11 +30,12 @@ function normalizeHttpExceptionMessage(exception) {
|
|
|
26
30
|
return exception.message;
|
|
27
31
|
}
|
|
28
32
|
let GlobalExceptionFilter = GlobalExceptionFilter_1 = class GlobalExceptionFilter {
|
|
29
|
-
constructor() {
|
|
33
|
+
constructor(options = {}) {
|
|
30
34
|
this.logger = new common_1.Logger(GlobalExceptionFilter_1.name);
|
|
35
|
+
this.includePath = options.includePath !== false;
|
|
31
36
|
}
|
|
32
37
|
catch(exception, host) {
|
|
33
|
-
var _a, _b, _c
|
|
38
|
+
var _a, _b, _c;
|
|
34
39
|
const ctx = host.switchToHttp();
|
|
35
40
|
const response = ctx.getResponse();
|
|
36
41
|
const request = ctx.getRequest();
|
|
@@ -42,6 +47,9 @@ let GlobalExceptionFilter = GlobalExceptionFilter_1 = class GlobalExceptionFilte
|
|
|
42
47
|
let message;
|
|
43
48
|
if (isHttp) {
|
|
44
49
|
message = normalizeHttpExceptionMessage(exception);
|
|
50
|
+
if (isProd && status >= common_1.HttpStatus.INTERNAL_SERVER_ERROR) {
|
|
51
|
+
message = 'Internal server error';
|
|
52
|
+
}
|
|
45
53
|
}
|
|
46
54
|
else {
|
|
47
55
|
const err = exception;
|
|
@@ -52,17 +60,20 @@ let GlobalExceptionFilter = GlobalExceptionFilter_1 = class GlobalExceptionFilte
|
|
|
52
60
|
const responseData = {
|
|
53
61
|
statusCode: status,
|
|
54
62
|
message,
|
|
55
|
-
path: request.url,
|
|
56
63
|
timestamp: new Date().toISOString(),
|
|
57
64
|
};
|
|
65
|
+
if (this.includePath) {
|
|
66
|
+
responseData.path = request.url;
|
|
67
|
+
}
|
|
58
68
|
const err = exception instanceof Error ? exception : undefined;
|
|
59
|
-
this.logger.error(Object.assign(Object.assign({}, responseData), { exceptionMessage: err === null || err === void 0 ? void 0 : err.message, stack: err === null || err === void 0 ? void 0 : err.stack, name: err === null || err === void 0 ? void 0 : err.name, remoteAddress: (_b = (_a = request.socket) === null || _a === void 0 ? void 0 : _a.remoteAddress) !== null && _b !== void 0 ? _b : (_c = request.connection) === null || _c === void 0 ? void 0 : _c.remoteAddress
|
|
69
|
+
this.logger.error(Object.assign(Object.assign({}, responseData), { exceptionMessage: err === null || err === void 0 ? void 0 : err.message, stack: err === null || err === void 0 ? void 0 : err.stack, name: err === null || err === void 0 ? void 0 : err.name, clientIp: (0, get_client_ip_helper_1.getClientIp)(request), remoteAddress: (_b = (_a = request.socket) === null || _a === void 0 ? void 0 : _a.remoteAddress) !== null && _b !== void 0 ? _b : (_c = request.connection) === null || _c === void 0 ? void 0 : _c.remoteAddress }));
|
|
60
70
|
response.status(status).json(responseData);
|
|
61
71
|
return;
|
|
62
72
|
}
|
|
63
73
|
};
|
|
64
74
|
exports.GlobalExceptionFilter = GlobalExceptionFilter;
|
|
65
75
|
exports.GlobalExceptionFilter = GlobalExceptionFilter = GlobalExceptionFilter_1 = __decorate([
|
|
66
|
-
(0, common_1.Catch)()
|
|
76
|
+
(0, common_1.Catch)(),
|
|
77
|
+
__metadata("design:paramtypes", [Object])
|
|
67
78
|
], GlobalExceptionFilter);
|
|
68
79
|
//# sourceMappingURL=global-exception.filter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-exception.filter.js","sourceRoot":"","sources":["../../../src/shared/exceptions/global-exception.filter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"global-exception.filter.js","sourceRoot":"","sources":["../../../src/shared/exceptions/global-exception.filter.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ClientIpRequest = {
|
|
2
|
+
ip?: string;
|
|
3
|
+
ips?: string[];
|
|
4
|
+
headers?: Record<string, string | string[] | undefined>;
|
|
5
|
+
socket?: {
|
|
6
|
+
remoteAddress?: string;
|
|
7
|
+
};
|
|
8
|
+
connection?: {
|
|
9
|
+
remoteAddress?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare function getClientIp(req: ClientIpRequest): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getClientIp = getClientIp;
|
|
4
|
+
function getClientIp(req) {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6
|
+
if ((_a = req.ips) === null || _a === void 0 ? void 0 : _a.length) {
|
|
7
|
+
return req.ips[0];
|
|
8
|
+
}
|
|
9
|
+
if (req.ip) {
|
|
10
|
+
return req.ip;
|
|
11
|
+
}
|
|
12
|
+
const xff = (_b = req.headers) === null || _b === void 0 ? void 0 : _b['x-forwarded-for'];
|
|
13
|
+
if (xff) {
|
|
14
|
+
const raw = Array.isArray(xff) ? xff[0] : xff;
|
|
15
|
+
const first = (_c = raw.split(',')[0]) === null || _c === void 0 ? void 0 : _c.trim();
|
|
16
|
+
if (first) {
|
|
17
|
+
return first;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const realIp = (_d = req.headers) === null || _d === void 0 ? void 0 : _d['x-real-ip'];
|
|
21
|
+
if (realIp) {
|
|
22
|
+
return Array.isArray(realIp) ? realIp[0] : realIp;
|
|
23
|
+
}
|
|
24
|
+
return ((_h = (_f = (_e = req.socket) === null || _e === void 0 ? void 0 : _e.remoteAddress) !== null && _f !== void 0 ? _f : (_g = req.connection) === null || _g === void 0 ? void 0 : _g.remoteAddress) !== null && _h !== void 0 ? _h : 'unknown');
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=get-client-ip.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-client-ip.helper.js","sourceRoot":"","sources":["../../../src/shared/utils/get-client-ip.helper.ts"],"names":[],"mappings":";;AAaA,kCA4BC;AA5BD,SAAgB,WAAW,CAAC,GAAoB;;IAC9C,IAAI,MAAA,GAAG,CAAC,GAAG,0CAAE,MAAM,EAAE,CAAC;QACpB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC;QACX,OAAO,GAAG,CAAC,EAAE,CAAC;IAChB,CAAC;IAED,MAAM,GAAG,GAAG,MAAA,GAAG,CAAC,OAAO,0CAAG,iBAAiB,CAAC,CAAC;IAC7C,IAAI,GAAG,EAAE,CAAC;QACR,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAC9C,MAAM,KAAK,GAAG,MAAA,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,0CAAE,IAAI,EAAE,CAAC;QACxC,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAG,MAAA,GAAG,CAAC,OAAO,0CAAG,WAAW,CAAC,CAAC;IAC1C,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACpD,CAAC;IAED,OAAO,CACL,MAAA,MAAA,MAAA,GAAG,CAAC,MAAM,0CAAE,aAAa,mCACzB,MAAA,GAAG,CAAC,UAAU,0CAAE,aAAa,mCAC7B,SAAS,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -4,5 +4,6 @@ export * from './crud-hooks.helper';
|
|
|
4
4
|
export * from './cursor-query.helper';
|
|
5
5
|
export * from './collection-query-merge';
|
|
6
6
|
export * from './in-memory-idempotency.store';
|
|
7
|
+
export * from './redis-idempotency.store';
|
|
7
8
|
export * from './transactional-repository.helper';
|
|
8
9
|
export * from './crud-transaction.decorators';
|
|
@@ -20,6 +20,7 @@ __exportStar(require("./crud-hooks.helper"), exports);
|
|
|
20
20
|
__exportStar(require("./cursor-query.helper"), exports);
|
|
21
21
|
__exportStar(require("./collection-query-merge"), exports);
|
|
22
22
|
__exportStar(require("./in-memory-idempotency.store"), exports);
|
|
23
|
+
__exportStar(require("./redis-idempotency.store"), exports);
|
|
23
24
|
__exportStar(require("./transactional-repository.helper"), exports);
|
|
24
25
|
__exportStar(require("./crud-transaction.decorators"), exports);
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,iDAA+B;AAC/B,sDAAoC;AACpC,wDAAsC;AACtC,2DAAyC;AACzC,gEAA8C;AAC9C,oEAAkD;AAClD,gEAA8C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,iDAA+B;AAC/B,sDAAoC;AACpC,wDAAsC;AACtC,2DAAyC;AACzC,gEAA8C;AAC9C,4DAA0C;AAC1C,oEAAkD;AAClD,gEAA8C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CrudIdempotencyStore } from '../types/crud-idempotency-store.interface';
|
|
2
|
+
export type RedisIdempotencyClient = {
|
|
3
|
+
get(key: string): Promise<string | null>;
|
|
4
|
+
set(key: string, value: string, mode: 'PX', ttlMs: number): Promise<unknown>;
|
|
5
|
+
};
|
|
6
|
+
export declare class RedisCrudIdempotencyStore implements CrudIdempotencyStore {
|
|
7
|
+
private readonly redis;
|
|
8
|
+
private readonly keyPrefix;
|
|
9
|
+
constructor(redis: RedisIdempotencyClient, keyPrefix?: string);
|
|
10
|
+
get(key: string): Promise<any | undefined>;
|
|
11
|
+
set(key: string, body: any, ttlMs?: number): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisCrudIdempotencyStore = void 0;
|
|
4
|
+
class RedisCrudIdempotencyStore {
|
|
5
|
+
constructor(redis, keyPrefix = 'crud:idempotency:') {
|
|
6
|
+
this.redis = redis;
|
|
7
|
+
this.keyPrefix = keyPrefix;
|
|
8
|
+
}
|
|
9
|
+
async get(key) {
|
|
10
|
+
const raw = await this.redis.get(`${this.keyPrefix}${key}`);
|
|
11
|
+
if (!raw) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
return JSON.parse(raw);
|
|
16
|
+
}
|
|
17
|
+
catch (_a) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async set(key, body, ttlMs) {
|
|
22
|
+
const ttl = ttlMs && ttlMs > 0 ? ttlMs : 86400000;
|
|
23
|
+
await this.redis.set(`${this.keyPrefix}${key}`, JSON.stringify(body), 'PX', ttl);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.RedisCrudIdempotencyStore = RedisCrudIdempotencyStore;
|
|
27
|
+
//# sourceMappingURL=redis-idempotency.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-idempotency.store.js","sourceRoot":"","sources":["../../../src/shared/utils/redis-idempotency.store.ts"],"names":[],"mappings":";;;AAWA,MAAa,yBAAyB;IACpC,YACmB,KAA6B,EAC7B,YAAY,mBAAmB;QAD/B,UAAK,GAAL,KAAK,CAAwB;QAC7B,cAAS,GAAT,SAAS,CAAsB;IAC/C,CAAC;IAEJ,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,GAAG,GAAG,EAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,IAAS,EAAE,KAAc;QAC9C,MAAM,GAAG,GAAG,KAAK,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAU,CAAC;QACpD,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAClB,GAAG,IAAI,CAAC,SAAS,GAAG,GAAG,EAAE,EACzB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EACpB,IAAI,EACJ,GAAG,CACJ,CAAC;IACJ,CAAC;CACF;AA3BD,8DA2BC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateDto = validateDto;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
4
5
|
const class_transformer_1 = require("class-transformer");
|
|
5
6
|
const class_validator_1 = require("class-validator");
|
|
6
7
|
async function validateDto(dto, itemData) {
|
|
@@ -8,7 +9,7 @@ async function validateDto(dto, itemData) {
|
|
|
8
9
|
const errors = (0, class_validator_1.validateSync)(instance);
|
|
9
10
|
const errorMessages = errors.flatMap((e) => Object.values(e.constraints));
|
|
10
11
|
if (errorMessages.length > 0) {
|
|
11
|
-
throw errorMessages;
|
|
12
|
+
throw new common_1.BadRequestException({ errors: errorMessages });
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=validate-dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-dto.js","sourceRoot":"","sources":["../../../src/shared/utils/validate-dto.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"validate-dto.js","sourceRoot":"","sources":["../../../src/shared/utils/validate-dto.ts"],"names":[],"mappings":";;AAIA,kCAOC;AAXD,2CAAqD;AACrD,yDAAoD;AACpD,qDAA+C;AAExC,KAAK,UAAU,WAAW,CAAC,GAAQ,EAAE,QAAa;IACvD,MAAM,QAAQ,GAAG,IAAA,mCAAe,EAAC,GAAG,EAAE,QAAQ,CAAQ,CAAC;IACvD,MAAM,MAAM,GAAG,IAAA,8BAAY,EAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1E,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,4BAAmB,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zola_do/crud",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.17",
|
|
4
4
|
"description": "Generic CRUD controllers and services for NestJS",
|
|
5
5
|
"author": "zolaDO",
|
|
6
6
|
"license": "ISC",
|
|
@@ -43,6 +43,11 @@
|
|
|
43
43
|
"types": "./dist/optional/rpc.d.ts",
|
|
44
44
|
"require": "./dist/optional/rpc.js",
|
|
45
45
|
"default": "./dist/optional/rpc.js"
|
|
46
|
+
},
|
|
47
|
+
"./optional/swagger": {
|
|
48
|
+
"types": "./dist/optional/swagger.d.ts",
|
|
49
|
+
"require": "./dist/optional/swagger.js",
|
|
50
|
+
"default": "./dist/optional/swagger.js"
|
|
46
51
|
}
|
|
47
52
|
},
|
|
48
53
|
"files": [
|
|
@@ -78,8 +83,8 @@
|
|
|
78
83
|
}
|
|
79
84
|
},
|
|
80
85
|
"dependencies": {
|
|
81
|
-
"@zola_do/collection-query": "^0.2.
|
|
82
|
-
"@zola_do/authorization": "^0.2.
|
|
86
|
+
"@zola_do/collection-query": "^0.2.15",
|
|
87
|
+
"@zola_do/authorization": "^0.2.15"
|
|
83
88
|
},
|
|
84
89
|
"devDependencies": {
|
|
85
90
|
"rimraf": "^6.1.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-paginated-response.js","sourceRoot":"","sources":["../../../src/shared/api-data/api-paginated-response.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,6CAA+D;AAC/D,iEAA4D;AACrD,MAAM,oBAAoB,GAAG,CAClC,KAAa,EACb,EAAE;IACF,OAAO,IAAA,wBAAe,EACpB,IAAA,uBAAa,EAAC;QACZ,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,yCAAkB,CAAC,EAAE;gBAC3C;oBACE,UAAU,EAAE;wBACV,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;yBACf;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,KAAK,CAAC,EAAE;yBACtC;wBACD,UAAU,EAAE;4BACV,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,IAAI;yBACf;wBACD,UAAU,EAAE;4BACV,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,IAAI;yBACf;wBACD,WAAW,EAAE;4BACX,IAAI,EAAE,SAAS;4BACf,QAAQ,EAAE,IAAI;yBACf;wBACD,EAAE,EAAE;4BACF,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,IAAI;yBACf;wBACD,EAAE,EAAE;4BACF,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,IAAI;yBACf;wBACD,EAAE,EAAE;4BACF,IAAI,EAAE,SAAS;4BACf,QAAQ,EAAE,IAAI;yBACf;qBACF;iBACF;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AA/CW,QAAA,oBAAoB,wBA+C/B"}
|
|
File without changes
|