@smartsoft001/models 2.62.0 → 2.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "extends": ["../../../.eslintrc.json"],
3
3
  "ignorePatterns": ["!**/*"],
4
+ "rules": {
5
+ "import/order": "off"
6
+ },
4
7
  "overrides": [
5
8
  {
6
9
  "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
package/README.md CHANGED
@@ -1,28 +1,36 @@
1
1
  ## Decorators
2
+
2
3
  ### @Model Decorator
3
- Used to annotate a class as a "model," adding metadata and a custom toJSON method. This method serializes the instance
4
- into JSON format, including fields marked with specific metadata. Associates the model with metadata (IModelOptions)
4
+
5
+ Used to annotate a class as a "model," adding metadata and a custom toJSON method. This method serializes the instance
6
+ into JSON format, including fields marked with specific metadata. Associates the model with metadata (IModelOptions)
5
7
  using reflection, allowing for dynamic handling of models at runtime.
6
8
 
7
9
  ### @Field Decorator
8
- Used to annotate properties of a model class, providing additional metadata (IFieldOptions) such as field type,
9
- requirements, and custom behavior for serialization or validation. Defines how properties should be accessed, mutated,
10
+
11
+ Used to annotate properties of a model class, providing additional metadata (IFieldOptions) such as field type,
12
+ requirements, and custom behavior for serialization or validation. Defines how properties should be accessed, mutated,
10
13
  and serialized, including special handling for arrays and specific types.
11
14
 
12
15
  ## Utility Functions
16
+
13
17
  ### Metadata Retrieval
18
+
14
19
  Functions like **getModelFieldKeys**, **getModelFieldOptions**, **getModelFieldsWithOptions**, and **getModelOptions**
15
20
  are used to retrieve metadata about models and their fields. This enables dynamic inspection and manipulation of models.
16
21
 
17
22
  ### Model Validation
18
- **getInvalidFields** - Checks for fields that have invalid values based on specified rules
19
- (such as being required during "create" or "update" operations) and permissions. This is useful for form validation or
23
+
24
+ **getInvalidFields** - Checks for fields that have invalid values based on specified rules
25
+ (such as being required during "create" or "update" operations) and permissions. This is useful for form validation or
20
26
  API input validation.
21
27
 
22
28
  ### Model Casting
23
- **castModel** - Adjusts an instance of a model by removing fields that do not conform to the specified mode
29
+
30
+ **castModel** - Adjusts an instance of a model by removing fields that do not conform to the specified mode
24
31
  ("create", "update") or the provided permissions. This ensures the instance is valid and adheres to the constraints
25
32
  defined by the model's metadata.
26
33
 
27
34
  ### Model Check
35
+
28
36
  **isModel** - Determines if an object is a model decorated with the @Model decorator.
package/package.json CHANGED
@@ -4,9 +4,9 @@
4
4
  "dependencies": {
5
5
  "reflect-metadata": "^0.2.1",
6
6
  "rxjs": "^7.8.1",
7
- "@smartsoft001/utils": "^2.62.0"
7
+ "@smartsoft001/utils": "^2.65.0"
8
8
  },
9
- "version": "2.62.0",
9
+ "version": "2.65.0",
10
10
  "main": "./src/index.js",
11
11
  "typings": "./src/index.d.ts"
12
12
  }