@bts-soft/core 2.4.5 → 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.
Files changed (2) hide show
  1. package/README.md +12 -9
  2. 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 the `SQL_INJECTION_REGEX`. If a violation is caught, it automatically throws a `400 Bad Request` before the controller logic is executed.
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
- The most visible part of the common module. It ensures that every response, whether it's a single entity, a list, or an error, follows the exact same JSON structure.
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 `BaseEntity`.
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 **ULIDs** (Universally Unique Lexicographically Sortable Identifiers). These are 26-character strings that are both unique and sortable by creation time.
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
- - **Lifecycle Hooks**: Includes pre-configured `AfterInsert`, `AfterUpdate`, and `BeforeRemove` logging to help with debugging database interactions in production.
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 manual response construction.
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 also provides pre-configured NestJS modules:
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`**: Pre-configured rate limiting to prevent Brute-Force and DDoS attacks.
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`**: The standard Apollo Server setup with custom error filters that bridge the gap between GraphQL and HTTP status codes.
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.5",
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.0",
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"