@bts-soft/core 2.4.6 → 2.4.7
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 +12 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -299,10 +299,10 @@ By calling `setupInterceptors(app)` in your `main.ts`, you enable a powerful sui
|
|
|
299
299
|
Uses `class-transformer` to filter out sensitive fields (marked with `@Exclude()`) and include computed properties (marked with `@Expose()`).
|
|
300
300
|
|
|
301
301
|
2. **`SqlInjectionInterceptor`**:
|
|
302
|
-
A global scanner that intercepts all incoming request payloads (Body, Query, Params) and checks every string against
|
|
302
|
+
A global scanner that intercepts all incoming request payloads (Body, Query, Params) and checks every string against a predefined regex. If a violation is caught, it automatically throws a `400 Bad Request` before the controller logic is executed.
|
|
303
303
|
|
|
304
304
|
3. **`GeneralResponseInterceptor`**:
|
|
305
|
-
|
|
305
|
+
Ensures that every REST response follows the exact same JSON structure. For GraphQL, it automatically skips formatting to preserve schema integrity while still allowing for global error handling.
|
|
306
306
|
|
|
307
307
|
#### The Standard Response Envelope
|
|
308
308
|
```json
|
|
@@ -326,25 +326,28 @@ By calling `setupInterceptors(app)` in your `main.ts`, you enable a powerful sui
|
|
|
326
326
|
### Shared Base Classes
|
|
327
327
|
|
|
328
328
|
#### 1. `BaseEntity` (The Persistence Foundation)
|
|
329
|
-
All database entities in the system should extend
|
|
329
|
+
All database entities in the system should extend a specialized base class.
|
|
330
330
|
|
|
331
|
-
- **ULID Integration**: Instead of predictable numeric IDs, it uses
|
|
331
|
+
- **ULID Integration**: Instead of predictable numeric IDs, it uses ULIDs (Universally Unique Lexicographically Sortable Identifiers) which are both unique and sortable.
|
|
332
332
|
- **Audit Trails**: Automatically generates `createdAt` and `updatedAt` timestamps.
|
|
333
|
-
- **
|
|
333
|
+
- **Multi-ORM Support**: Includes dedicated bases for TypeORM, Sequelize, Mongoose, Prisma, and GraphQL.
|
|
334
334
|
|
|
335
335
|
#### 2. `BaseResponse` (The API Contract)
|
|
336
|
-
Used as a base class for DTOs and GraphQL Object Types to ensure consistency in
|
|
336
|
+
Used as a base class for DTOs and GraphQL Object Types to ensure consistency in response construction.
|
|
337
337
|
|
|
338
338
|
---
|
|
339
339
|
|
|
340
340
|
### Infrastructure Modules
|
|
341
341
|
|
|
342
|
-
The common package
|
|
342
|
+
The common package provides pre-configured NestJS modules:
|
|
343
343
|
|
|
344
344
|
- **`ConfigModule`**: A wrapper around `@nestjs/config` with built-in validation.
|
|
345
|
-
- **`ThrottlingModule`**:
|
|
345
|
+
- **`ThrottlingModule`**: Robust rate limiting that automatically handles both HTTP and GraphQL contexts.
|
|
346
346
|
- **`TranslationModule`**: Integrated `nestjs-i18n` support for multi-language applications (Arabic/English).
|
|
347
|
-
- **`GraphqlModule`**:
|
|
347
|
+
- **`GraphqlModule`**: Standard Apollo Server setup with custom error filters and a context that includes both request and response objects.
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
348
351
|
|
|
349
352
|
---
|
|
350
353
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bts-soft/core",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.7",
|
|
4
4
|
"author": "Omar Sabry",
|
|
5
5
|
"description": "All bts-soft packages - meta-package bundling common, cache, validation, upload, and notifications for NestJS.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@bts-soft/notifications": "1.5.1",
|
|
18
|
-
"@bts-soft/common": "1.3.
|
|
18
|
+
"@bts-soft/common": "1.3.2",
|
|
19
19
|
"@bts-soft/cache": "1.0.9",
|
|
20
20
|
"@bts-soft/validation": "1.1.4",
|
|
21
21
|
"@bts-soft/upload": "1.4.2"
|