2.48.0 • Published 3 months ago

@smartsoft001/models v2.48.0

Weekly downloads
2,100
License
-
Repository
-
Last release
3 months ago

Decorators

@Model Decorator

Used to annotate a class as a "model," adding metadata and a custom toJSON method. This method serializes the instance into JSON format, including fields marked with specific metadata. Associates the model with metadata (IModelOptions) using reflection, allowing for dynamic handling of models at runtime.

@Field Decorator

Used to annotate properties of a model class, providing additional metadata (IFieldOptions) such as field type, requirements, and custom behavior for serialization or validation. Defines how properties should be accessed, mutated, and serialized, including special handling for arrays and specific types.

Utility Functions

Metadata Retrieval

Functions like getModelFieldKeys, getModelFieldOptions, getModelFieldsWithOptions, and getModelOptions are used to retrieve metadata about models and their fields. This enables dynamic inspection and manipulation of models.

Model Validation

getInvalidFields - Checks for fields that have invalid values based on specified rules (such as being required during "create" or "update" operations) and permissions. This is useful for form validation or API input validation.

Model Casting

castModel - Adjusts an instance of a model by removing fields that do not conform to the specified mode ("create", "update") or the provided permissions. This ensures the instance is valid and adheres to the constraints defined by the model's metadata.

Model Check

isModel - Determines if an object is a model decorated with the @Model decorator.

2.48.0

3 months ago

2.46.0

3 months ago

2.45.0

3 months ago

2.44.0

3 months ago

2.43.0

4 months ago

2.31.0

4 months ago

2.30.0

4 months ago

2.41.0

4 months ago

2.40.0

4 months ago

2.39.0

4 months ago

2.27.0

4 months ago

2.26.0

4 months ago

2.37.0

4 months ago

2.25.0

4 months ago

2.47.0

3 months ago

2.24.0

4 months ago

2.23.0

4 months ago

2.21.0

9 months ago

1.1.91

1 year ago

1.1.90

1 year ago

1.1.78

1 year ago

1.1.77

1 year ago

1.1.75

1 year ago

1.1.81

1 year ago

1.1.85

1 year ago

1.1.84

1 year ago

1.1.83

1 year ago

1.1.82

1 year ago

1.1.89

1 year ago

1.1.88

1 year ago

1.1.70

2 years ago

1.1.72

2 years ago

1.1.71

2 years ago

1.1.63

2 years ago

1.1.62

2 years ago

1.1.61

2 years ago

1.1.67

2 years ago

1.1.66

2 years ago

1.1.65

2 years ago

1.1.64

2 years ago

1.1.69

2 years ago

1.1.68

2 years ago

1.1.59

2 years ago

1.1.58

2 years ago

1.1.57

2 years ago

1.1.60

2 years ago

1.1.56

2 years ago

1.1.52

2 years ago

1.1.51

2 years ago

1.1.50

2 years ago

1.1.55

2 years ago

1.1.54

2 years ago

1.1.53

2 years ago

1.1.29

2 years ago

1.1.34

2 years ago

1.1.33

2 years ago

1.1.32

2 years ago

1.1.31

2 years ago

1.1.38

2 years ago

1.1.37

2 years ago

1.1.36

2 years ago

1.1.35

2 years ago

1.1.39

2 years ago

1.1.41

2 years ago

1.1.40

2 years ago

1.1.19

2 years ago

1.1.22

2 years ago

1.1.21

2 years ago

1.1.24

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.1

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.4

3 years ago

1.0.831

3 years ago

1.0.830

3 years ago

1.0.821

3 years ago

1.0.820

3 years ago

1.0.819

3 years ago

1.0.818

3 years ago

1.0.815

3 years ago

1.0.817

3 years ago

1.0.816

3 years ago

1.0.813

3 years ago

1.0.812

3 years ago

1.0.781

3 years ago

1.0.780

3 years ago

1.0.783

3 years ago

1.0.782

3 years ago

1.0.789

3 years ago

1.0.788

3 years ago

1.0.785

3 years ago

1.0.787

3 years ago

1.0.786

3 years ago

1.0.778

3 years ago

1.0.777

3 years ago

1.0.779

3 years ago

1.0.775

3 years ago

1.0.791

3 years ago

1.0.794

3 years ago

1.0.790

3 years ago

1.0.799

3 years ago

1.0.796

3 years ago

1.0.795

3 years ago

1.0.798

3 years ago

1.0.797

3 years ago

1.0.811

3 years ago

1.0.810

3 years ago

1.0.808

3 years ago

1.0.809

3 years ago

1.0.804

3 years ago

1.0.803

3 years ago

1.0.806

3 years ago

1.0.805

3 years ago

1.0.800

3 years ago

1.0.802

3 years ago

1.0.801

3 years ago

1.0.774

3 years ago

1.0.770

3 years ago

1.0.772

3 years ago

1.0.771

3 years ago

1.0.773

3 years ago

1.0.767

3 years ago

1.0.769

3 years ago

1.0.761

3 years ago

1.0.760

3 years ago

1.0.766

3 years ago

1.0.763

3 years ago

1.0.762

3 years ago

1.0.765

3 years ago

1.0.759

3 years ago

1.0.758

3 years ago

1.0.757

3 years ago

1.0.744

3 years ago

1.0.747

3 years ago

1.0.741

3 years ago

1.0.743

3 years ago

1.0.742

3 years ago

1.0.738

3 years ago

1.0.737

3 years ago

1.0.734

3 years ago

1.0.733

3 years ago

1.0.736

3 years ago

1.0.735

3 years ago

1.0.730

3 years ago

1.0.732

3 years ago

1.0.731

3 years ago

1.0.726

3 years ago

1.0.729

3 years ago

1.0.728

3 years ago

1.0.750

3 years ago

1.0.756

3 years ago

1.0.755

3 years ago

1.0.752

3 years ago

1.0.754

3 years ago

1.0.753

3 years ago

1.0.748

3 years ago

1.0.723

3 years ago

1.0.722

3 years ago

1.0.725

3 years ago

1.0.724

3 years ago

1.0.721

3 years ago

1.0.715

3 years ago

1.0.668

3 years ago

1.0.667

3 years ago

1.0.669

3 years ago

1.0.664

3 years ago

1.0.663

3 years ago

1.0.666

3 years ago

1.0.665

3 years ago

1.0.682

3 years ago

1.0.681

3 years ago

1.0.684

3 years ago

1.0.683

3 years ago

1.0.689

3 years ago

1.0.686

3 years ago

1.0.685

3 years ago

1.0.688

3 years ago

1.0.687

3 years ago

1.0.671

3 years ago

1.0.670

3 years ago

1.0.679

3 years ago

1.0.678

3 years ago

1.0.677

3 years ago

1.0.676

3 years ago

1.0.693

3 years ago

1.0.692

3 years ago

1.0.691

3 years ago

1.0.690

3 years ago

1.0.697

3 years ago

1.0.703

3 years ago

1.0.702

3 years ago

1.0.712

3 years ago

1.0.711

3 years ago

1.0.714

3 years ago

1.0.713

3 years ago

1.0.710

3 years ago

1.0.709

3 years ago

1.0.708

3 years ago

1.0.705

3 years ago

1.0.704

3 years ago

1.0.707

3 years ago

1.0.706

3 years ago

1.0.661

3 years ago

1.0.660

3 years ago

1.0.651

3 years ago

1.0.650

3 years ago

1.0.657

3 years ago

1.0.659

3 years ago

1.0.658

3 years ago

1.0.653

3 years ago

1.0.652

3 years ago

1.0.655

3 years ago

1.0.654

3 years ago

1.0.649

3 years ago

1.0.648

3 years ago

1.0.647

3 years ago

1.0.624

3 years ago

1.0.623

3 years ago

1.0.626

3 years ago

1.0.625

3 years ago

1.0.620

3 years ago

1.0.622

3 years ago

1.0.621

3 years ago

1.0.616

3 years ago

1.0.619

3 years ago

1.0.613

3 years ago

1.0.612

3 years ago

1.0.615

3 years ago

1.0.614

3 years ago

1.0.610

3 years ago

1.0.640

3 years ago

1.0.646

3 years ago

1.0.645

3 years ago

1.0.642

3 years ago

1.0.641

3 years ago

1.0.644

3 years ago

1.0.643

3 years ago

1.0.635

3 years ago

1.0.634

3 years ago

1.0.636

3 years ago

1.0.631

3 years ago

1.0.630

3 years ago

1.0.633

3 years ago

1.0.632

3 years ago

1.0.628

3 years ago

1.0.629

3 years ago

1.0.594

3 years ago

1.0.593

3 years ago

1.0.590

3 years ago

1.0.592

3 years ago

1.0.591

3 years ago

1.0.589

3 years ago

1.0.587

3 years ago

1.0.588

3 years ago

1.0.583

3 years ago

1.0.582

3 years ago

1.0.585

3 years ago

1.0.584

3 years ago

1.0.581

3 years ago

1.0.580

3 years ago

1.0.586

3 years ago

1.0.579

3 years ago

1.0.578

3 years ago

1.0.577

3 years ago

1.0.574

3 years ago

1.0.576

3 years ago

1.0.575

3 years ago

1.0.573

3 years ago

1.0.572

3 years ago

1.0.568

3 years ago

1.0.571

3 years ago

1.0.570

3 years ago

1.0.565

3 years ago

1.0.567

3 years ago

1.0.566

3 years ago

1.0.561

3 years ago

1.0.560

3 years ago

1.0.563

3 years ago

1.0.562

3 years ago

1.0.564

3 years ago

1.0.558

3 years ago

1.0.557

3 years ago

1.0.559

3 years ago

1.0.554

3 years ago

1.0.556

3 years ago

1.0.552

3 years ago

1.0.551

3 years ago

1.0.553

3 years ago

1.0.547

3 years ago

1.0.549

3 years ago

1.0.548

3 years ago

1.0.550

3 years ago

1.0.546

3 years ago

1.0.545

3 years ago

1.0.543

3 years ago

1.0.544

3 years ago

1.0.541

3 years ago

1.0.540

3 years ago

1.0.542

3 years ago

1.0.539

3 years ago

1.0.538

3 years ago

1.0.536

3 years ago

1.0.535

3 years ago

1.0.537

3 years ago

1.0.534

3 years ago

1.0.532

3 years ago

1.0.531

3 years ago

1.0.533

3 years ago

1.0.530

3 years ago

1.0.529

3 years ago

1.0.528

3 years ago

1.0.527

3 years ago

1.0.526

4 years ago

1.0.525

4 years ago

1.0.524

4 years ago

1.0.523

4 years ago

1.0.522

4 years ago

1.0.521

4 years ago

1.0.520

4 years ago

1.0.519

4 years ago

1.0.518

4 years ago

1.0.516

4 years ago

1.0.513

4 years ago

1.0.512

4 years ago

1.0.511

4 years ago

1.0.510

4 years ago

1.0.509

4 years ago

1.0.508

4 years ago

1.0.507

4 years ago

1.0.505

4 years ago

1.0.506

4 years ago

1.0.504

4 years ago

1.0.503

4 years ago

1.0.502

4 years ago

1.0.501

4 years ago

1.0.500

4 years ago

1.0.498

4 years ago

1.0.493

4 years ago

1.0.492

4 years ago

1.0.491

4 years ago

1.0.490

4 years ago

1.0.489

4 years ago

1.0.484

4 years ago

1.0.486

4 years ago

1.0.485

4 years ago

1.0.488

4 years ago

1.0.487

4 years ago

1.0.483

4 years ago

1.0.482

4 years ago

1.0.481

4 years ago

1.0.480

4 years ago

1.0.479

4 years ago

1.0.477

4 years ago

1.0.478

4 years ago

1.0.476

4 years ago

1.0.475

4 years ago

1.0.473

4 years ago

1.0.472

4 years ago

1.0.471

4 years ago

1.0.469

4 years ago

1.0.470

4 years ago

1.0.466

4 years ago

1.0.468

4 years ago

1.0.467

4 years ago

1.0.465

4 years ago

1.0.464

4 years ago

1.0.462

4 years ago

1.0.463

4 years ago

1.0.461

4 years ago

1.0.459

4 years ago

1.0.458

4 years ago

1.0.457

4 years ago

1.0.455

4 years ago

1.0.453

4 years ago

1.0.448

4 years ago

1.0.452

4 years ago

1.0.445

4 years ago

1.0.444

4 years ago

1.0.442

4 years ago

1.0.441

4 years ago

1.0.438

4 years ago

1.0.437

4 years ago

1.0.436

4 years ago

1.0.435

4 years ago

1.0.434

4 years ago

1.0.432

4 years ago

1.0.430

4 years ago

1.0.429

4 years ago

1.0.426

4 years ago

1.0.423

4 years ago

1.0.411

4 years ago

1.0.410

4 years ago

1.0.408

4 years ago

1.0.409

4 years ago

1.0.407

4 years ago

1.0.406

4 years ago

1.0.404

4 years ago

1.0.405

4 years ago

1.0.403

4 years ago

1.0.402

4 years ago

1.0.401

4 years ago

1.0.400

4 years ago

1.0.399

4 years ago

1.0.398

4 years ago

1.0.396

4 years ago

1.0.395

4 years ago

1.0.394

4 years ago

1.0.393

4 years ago

1.0.389

4 years ago

1.0.392

4 years ago

1.0.385

4 years ago

1.0.386

4 years ago

1.0.384

4 years ago

1.0.383

4 years ago

1.0.381

4 years ago

1.0.382

4 years ago

1.0.380

4 years ago

1.0.379

4 years ago

1.0.378

4 years ago

1.0.377

4 years ago

1.0.376

4 years ago

1.0.375

4 years ago

1.0.374

4 years ago

1.0.373

4 years ago

1.0.372

4 years ago

1.0.371

4 years ago

1.0.370

4 years ago

1.0.369

4 years ago

1.0.368

4 years ago

1.0.367

4 years ago

1.0.365

4 years ago

1.0.366

4 years ago

1.0.364

4 years ago

1.0.363

4 years ago

1.0.362

4 years ago

1.0.361

4 years ago

1.0.360

4 years ago

1.0.359

4 years ago

1.0.358

4 years ago

1.0.357

4 years ago

1.0.356

4 years ago

1.0.355

4 years ago

1.0.354

4 years ago

1.0.352

4 years ago

1.0.351

4 years ago

1.0.353

4 years ago

1.0.350

4 years ago

1.0.349

4 years ago

1.0.348

4 years ago

1.0.347

4 years ago

1.0.346

4 years ago

1.0.345

4 years ago

1.0.344

4 years ago

1.0.343

4 years ago

1.0.342

4 years ago

1.0.341

4 years ago

1.0.340

4 years ago

1.0.339

4 years ago

1.0.338

4 years ago

1.0.337

4 years ago

1.0.336

4 years ago

1.0.335

4 years ago

1.0.332

4 years ago

1.0.334

4 years ago

1.0.333

4 years ago

1.0.330

4 years ago

1.0.331

4 years ago

1.0.329

4 years ago

1.0.328

4 years ago

1.0.327

4 years ago

1.0.326

4 years ago

1.0.321

4 years ago

1.0.323

4 years ago

1.0.322

4 years ago

1.0.325

4 years ago

1.0.324

4 years ago

1.0.320

4 years ago

1.0.319

4 years ago

1.0.316

4 years ago

1.0.315

4 years ago

1.0.318

4 years ago

1.0.317

4 years ago

1.0.314

4 years ago

1.0.307

4 years ago

1.0.306

4 years ago

1.0.310

4 years ago

1.0.312

4 years ago

1.0.311

4 years ago

1.0.313

4 years ago

1.0.309

4 years ago

1.0.308

4 years ago

1.0.305

4 years ago

1.0.304

4 years ago

1.0.303

4 years ago

1.0.302

4 years ago

1.0.301

4 years ago

1.0.300

4 years ago

1.0.297

4 years ago

1.0.296

4 years ago

1.0.299

4 years ago

1.0.298

4 years ago

1.0.285

4 years ago

1.0.282

4 years ago

1.0.284

4 years ago

1.0.283

4 years ago

1.0.281

4 years ago

1.0.280

4 years ago

1.0.279

4 years ago

1.0.277

4 years ago

1.0.276

4 years ago

1.0.278

4 years ago

1.0.275

4 years ago

1.0.274

4 years ago

1.0.273

4 years ago

1.0.272

4 years ago

1.0.269

4 years ago

1.0.271

4 years ago

1.0.270

4 years ago

1.0.264

4 years ago

1.0.266

4 years ago

1.0.265

4 years ago

1.0.268

4 years ago

1.0.267

4 years ago

1.0.263

4 years ago

1.0.260

4 years ago

1.0.262

4 years ago

1.0.261

4 years ago

1.0.259

4 years ago

1.0.258

4 years ago

1.0.257

4 years ago

1.0.256

4 years ago

1.0.255

4 years ago

1.0.254

4 years ago

1.0.253

4 years ago

1.0.252

4 years ago

1.0.251

4 years ago

1.0.250

4 years ago

1.0.249

4 years ago

1.0.248

4 years ago

1.0.246

4 years ago

1.0.247

4 years ago

1.0.244

4 years ago

1.0.243

4 years ago

1.0.245

4 years ago

1.0.242

4 years ago

1.0.241

4 years ago

1.0.240

4 years ago

1.0.239

4 years ago

1.0.238

4 years ago

1.0.237

4 years ago

1.0.236

4 years ago

1.0.235

4 years ago

1.0.234

4 years ago

1.0.228

4 years ago

1.0.227

4 years ago

1.0.229

4 years ago

1.0.226

4 years ago

1.0.231

4 years ago

1.0.230

4 years ago

1.0.233

4 years ago

1.0.232

4 years ago

1.0.224

4 years ago

1.0.225

4 years ago

1.0.223

4 years ago

1.0.222

4 years ago

1.0.221

4 years ago

1.0.220

4 years ago

1.0.219

4 years ago

1.0.217

4 years ago

1.0.218

4 years ago

1.0.216

4 years ago

1.0.213

4 years ago

1.0.215

4 years ago

1.0.214

4 years ago

1.0.212

4 years ago

1.0.211

4 years ago

1.0.210

4 years ago

1.0.209

4 years ago

1.0.208

4 years ago

1.0.207

4 years ago

1.0.206

4 years ago

1.0.205

4 years ago

1.0.204

4 years ago

1.0.202

4 years ago

1.0.201

4 years ago

1.0.203

4 years ago

1.0.180

4 years ago

1.0.179

4 years ago

1.0.178

4 years ago

1.0.177

4 years ago

1.0.176

4 years ago

1.0.175

4 years ago

1.0.174

4 years ago

1.0.173

4 years ago

1.0.172

4 years ago

1.0.171

4 years ago

1.0.170

4 years ago

1.0.169

4 years ago

1.0.167

4 years ago

1.0.168

4 years ago

1.0.165

4 years ago

1.0.164

4 years ago

1.0.166

4 years ago

1.0.161

4 years ago

1.0.163

4 years ago

1.0.162

4 years ago

1.0.160

4 years ago

1.0.159

4 years ago

1.0.156

4 years ago

1.0.158

4 years ago

1.0.157

4 years ago

1.0.154

4 years ago

1.0.155

4 years ago

1.0.153

4 years ago

1.0.152

4 years ago

1.0.151

4 years ago

1.0.150

4 years ago

1.0.140

4 years ago

1.0.139

4 years ago

1.0.138

4 years ago

1.0.137

4 years ago

1.0.126

4 years ago

1.0.125

4 years ago

1.0.104

4 years ago

1.0.124

4 years ago

1.0.114

4 years ago

1.0.94

4 years ago

1.0.93

4 years ago

1.0.92

4 years ago

1.0.91

4 years ago

1.0.90

4 years ago

1.0.89

4 years ago

1.0.88

4 years ago

1.0.87

4 years ago

1.0.86

4 years ago

1.0.85

4 years ago

1.0.84

4 years ago

1.0.83

4 years ago

1.0.82

4 years ago

1.0.81

4 years ago

1.0.80

4 years ago

1.0.79

4 years ago

1.0.78

4 years ago

1.0.77

4 years ago

1.0.76

4 years ago

1.0.75

4 years ago

1.0.74

4 years ago

1.0.73

4 years ago

1.0.72

4 years ago

1.0.71

4 years ago

1.0.70

4 years ago

1.0.69

4 years ago

1.0.68

4 years ago

1.0.67

4 years ago

1.0.66

4 years ago

1.0.65

4 years ago

1.0.64

4 years ago

1.0.63

4 years ago

1.0.62

4 years ago

1.0.61

4 years ago

1.0.60

4 years ago

1.0.59

4 years ago

1.0.58

4 years ago

1.0.57

4 years ago

1.0.56

4 years ago

1.0.55

4 years ago

1.0.54

4 years ago

1.0.53

4 years ago

1.0.52

4 years ago

1.0.51

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.49

4 years ago

1.0.50

4 years ago

1.0.45

4 years ago

1.0.44

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.40

4 years ago

1.0.41

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.29

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.20

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago