2.48.0 • Published 2 months ago

@smartsoft001/domain-core v2.48.0

Weekly downloads
2,023
License
-
Repository
-
Last release
2 months ago

@smartsoft001/domain-core

Installation

npm i @smartsoft001/domain-core

Repositories

IItemRepository

create - Creates a new entity in the storage system.

returns a Promise<void> that resolves when the entity is successfully created.

createMany - Creates multiple entities in the storage system.

returns a Promise<void> that resolves when all entities are successfully created.

update - Updates an existing entity in the storage system.

returns a Promise<void> that resolves when the entity is successfully updated.

updatePartial - Partially updates an existing entity in the storage system.

Partial<T>& { id: string }

returns a Promise<void> that resolves when the entity is successfully updated.

updatePartialManyByCriteria - Partially updates multiple entities that match the specified criteria.

Partial<T>

returns a Promise<void> that resolves when the entities are successfully updated.

updatePartialManyBySpecification - Partially updates multiple entities that match the specified specification.

Partial<T>

returns a Promise<void> that resolves when the entities are successfully updated.

delete - Deletes an entity from the storage system by its ID.

returns a Promise<void> that resolves when the entity is successfully deleted.

getById - Retrieves an entity from the storage system by its ID.

returns a Promise<T> that resolves to the retrieved entity.

getByCriteria - Retrieves entities from the storage system that match the specified criteria.

returns a Promise<{ data: T[]; totalCount: number }> that resolves to an object containing the matching entities and the total count.

getBySpecification - Retrieves entities from the storage system that match the specified specification.

returns a Promise<{ data: T[]; totalCount: number }> that resolves to an object containing the matching entities and the total count.

countBySpecification - Counts the number of entities in the storage system that match the specified specification.

returns a Promise<number> that resolves to a count of matching entities.

clear - Counts the number of entities in the storage system that match the specified specification.

returns a Promise<void> that resolves when the storage system is cleared.

changesByCriteria - Returns an observable that emits changes to entities that match the specified criteria.

returns a Observable<any> that emits changes to the matching entities.

IAttachmentRepository

upload - Uploads a file to the storage system.

{ streamCallback?: (r: any) => void }

returns a Promise<void> that when the upload is complete. throws an error if the upload fails.

Example usage with MongoDB implementation:

const repository = new MongoAttachmentRepository(config);

const fileStream = fs.createReadStream('/path/to/file');

await repository.upload({
  id: 'unique-file-id',
  fileName: 'example.txt',
  stream: fileStream,
  mimeType: 'text/plain',
  encoding: 'utf-8'
}, {
  streamCallback: (writeStream) => {
    console.log('Upload started');
  }
});

console.log('File uploaded successfully');

getInfo - Retrieves metadata information about a file stored in the storage system.

returns a Promise<{ fileName: string, contentType: string, length: number } | null> that resolves to an object containing file metadata, or null if the file is not found.

throws an error if retrieving the file information fails.

getStream - Retrieves a stream for downloading a file from the storage system.

{ start: number; end: number }

returns a Promise<any> that resolves to a readable stream of the file.

throws an error if retrieving the file stream fails.

delete - Deletes a file from the storage system.

returns a Promise<void> that resolves when the file has been successfully deleted.

throws an error if the deletion fails.

2.48.0

2 months ago

2.46.0

2 months ago

2.45.0

2 months ago

2.44.0

2 months ago

2.43.0

3 months ago

2.30.0

3 months ago

2.41.0

3 months ago

2.40.0

3 months ago

2.39.0

3 months ago

2.26.0

3 months ago

2.37.0

3 months ago

2.47.0

2 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

1 year ago

1.1.72

1 year ago

1.1.71

1 year 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.0.804

2 years ago

1.0.803

2 years ago

1.1.1

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.4

2 years ago

1.0.789

2 years ago

1.0.788

3 years ago

1.0.785

3 years ago

1.0.786

3 years ago

1.0.792

2 years ago

1.0.791

2 years ago

1.0.794

2 years ago

1.0.793

2 years ago

1.0.790

2 years ago

1.0.781

3 years ago

1.0.783

3 years ago

1.0.782

3 years ago

1.0.784

3 years ago

1.0.770

3 years ago

1.0.772

3 years ago

1.0.771

3 years ago

1.0.778

3 years ago

1.0.777

3 years ago

1.0.779

3 years ago

1.0.774

3 years ago

1.0.773

3 years ago

1.0.776

3 years ago

1.0.775

3 years ago

1.0.761

3 years ago

1.0.760

3 years ago

1.0.767

3 years ago

1.0.769

3 years ago

1.0.768

3 years ago

1.0.763

3 years ago

1.0.762

3 years ago

1.0.764

3 years ago

1.0.759

3 years ago

1.0.750

3 years ago

1.0.756

3 years ago

1.0.755

3 years ago

1.0.758

3 years ago

1.0.752

3 years ago

1.0.751

3 years ago

1.0.754

3 years ago

1.0.753

3 years ago

1.0.748

3 years ago

1.0.747

3 years ago

1.0.745

3 years ago

1.0.744

3 years ago

1.0.746

3 years ago

1.0.740

3 years ago

1.0.743

3 years ago

1.0.742

3 years ago

1.0.738

3 years ago

1.0.739

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.688

3 years ago

1.0.727

3 years ago

1.0.726

3 years ago

1.0.729

3 years ago

1.0.728

3 years ago

1.0.695

3 years ago

1.0.694

3 years ago

1.0.697

3 years ago

1.0.696

3 years ago

1.0.699

3 years ago

1.0.698

3 years ago

1.0.701

3 years ago

1.0.703

3 years ago

1.0.702

3 years ago

1.0.723

3 years ago

1.0.725

3 years ago

1.0.721

3 years ago

1.0.720

3 years ago

1.0.716

3 years ago

1.0.715

3 years ago

1.0.717

3 years ago

1.0.711

3 years ago

1.0.714

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.660

3 years ago

1.0.662

3 years ago

1.0.661

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.651

3 years ago

1.0.650

3 years ago

1.0.657

3 years ago

1.0.656

3 years ago

1.0.659

3 years ago

1.0.658

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.682

3 years ago

1.0.681

3 years ago

1.0.684

3 years ago

1.0.683

3 years ago

1.0.680

3 years ago

1.0.686

3 years ago

1.0.685

3 years ago

1.0.687

3 years ago

1.0.670

3 years ago

1.0.679

3 years ago

1.0.678

3 years ago

1.0.675

3 years ago

1.0.677

3 years ago

1.0.676

3 years ago

1.0.640

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.639

3 years ago

1.0.638

3 years ago

1.0.637

3 years ago

1.0.636

3 years ago

1.0.634

3 years ago

1.0.633

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.631

3 years ago

1.0.630

3 years ago

1.0.632

3 years ago

1.0.628

3 years ago

1.0.627

3 years ago

1.0.617

3 years ago

1.0.616

3 years ago

1.0.619

3 years ago

1.0.618

3 years ago

1.0.613

3 years ago

1.0.615

3 years ago

1.0.614

3 years ago

1.0.609

3 years ago

1.0.606

3 years ago

1.0.605

3 years ago

1.0.608

3 years ago

1.0.607

3 years ago

1.0.583

3 years ago

1.0.585

3 years ago

1.0.587

3 years ago

1.0.586

3 years ago

1.0.589

3 years ago

1.0.588

3 years ago

1.0.594

3 years ago

1.0.593

3 years ago

1.0.596

3 years ago

1.0.595

3 years ago

1.0.592

3 years ago

1.0.598

3 years ago

1.0.597

3 years ago

1.0.599

3 years ago

1.0.602

3 years ago

1.0.601

3 years ago

1.0.604

3 years ago

1.0.603

3 years ago

1.0.567

3 years ago

1.0.563

3 years ago

1.0.565

3 years ago

1.0.564

3 years ago

1.0.566

3 years ago

1.0.562

3 years ago

1.0.561

3 years ago

1.0.560

3 years ago

1.0.552

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.553

3 years ago

1.0.556

3 years ago

1.0.555

3 years ago

1.0.550

3 years ago

1.0.551

3 years ago

1.0.547

3 years ago

1.0.546

3 years ago

1.0.549

3 years ago

1.0.548

3 years ago

1.0.545

3 years ago

1.0.541

3 years ago

1.0.543

3 years ago

1.0.544

3 years ago

1.0.540

3 years ago

1.0.539

3 years ago

1.0.538

3 years ago

1.0.530

3 years ago

1.0.536

3 years ago

1.0.535

3 years ago

1.0.537

3 years ago

1.0.532

3 years ago

1.0.531

3 years ago

1.0.534

3 years ago

1.0.533

3 years ago

1.0.529

3 years ago

1.0.527

3 years ago

1.0.525

3 years ago

1.0.524

3 years ago

1.0.526

3 years ago

1.0.521

3 years ago

1.0.520

3 years ago

1.0.523

3 years ago

1.0.522

3 years ago

1.0.518

3 years ago

1.0.519

3 years ago

1.0.517

3 years ago

1.0.516

3 years ago

1.0.514

3 years ago

1.0.513

3 years ago

1.0.515

3 years ago

1.0.512

3 years ago

1.0.511

3 years ago

1.0.510

3 years ago

1.0.509

3 years ago

1.0.508

3 years ago

1.0.507

3 years ago

1.0.505

3 years ago

1.0.504

3 years ago

1.0.506

3 years ago

1.0.503

3 years ago

1.0.502

3 years ago

1.0.501

3 years ago

1.0.500

3 years ago

1.0.499

3 years ago

1.0.498

3 years ago

1.0.497

3 years ago

1.0.496

3 years ago

1.0.495

3 years ago

1.0.494

3 years ago

1.0.493

3 years ago

1.0.492

3 years ago

1.0.491

3 years ago

1.0.489

3 years ago

1.0.486

3 years ago

1.0.485

3 years ago

1.0.484

3 years ago

1.0.483

3 years ago

1.0.482

3 years ago

1.0.481

3 years ago

1.0.480

3 years ago

1.0.479

3 years ago

1.0.478

3 years ago

1.0.477

3 years ago

1.0.476

3 years ago

1.0.475

3 years ago

1.0.474

3 years ago

1.0.473

3 years ago

1.0.471

3 years ago

1.0.466

3 years ago

1.0.465

3 years ago

1.0.464

3 years ago

1.0.463

3 years ago

1.0.462

3 years ago

1.0.461

3 years ago

1.0.460

3 years ago

1.0.459

3 years ago

1.0.458

3 years ago

1.0.457

3 years ago

1.0.456

3 years ago

1.0.455

3 years ago

1.0.454

3 years ago

1.0.453

3 years ago

1.0.452

3 years ago

1.0.451

3 years ago

1.0.450

3 years ago

1.0.449

3 years ago

1.0.448

3 years ago

1.0.446

3 years ago

1.0.445

3 years ago

1.0.444

3 years ago

1.0.442

3 years ago

1.0.443

3 years ago

1.0.440

3 years ago

1.0.441

3 years ago

1.0.439

3 years ago

1.0.438

3 years ago

1.0.437

3 years ago

1.0.436

3 years ago

1.0.435

3 years ago

1.0.434

3 years ago

1.0.432

3 years ago

1.0.431

3 years ago

1.0.430

3 years ago

1.0.428

3 years ago

1.0.426

3 years ago

1.0.425

3 years ago

1.0.421

3 years ago

1.0.418

3 years ago

1.0.417

3 years ago

1.0.415

4 years ago

1.0.414

4 years ago

1.0.411

4 years ago

1.0.410

4 years ago

1.0.409

4 years ago

1.0.408

4 years ago

1.0.407

4 years ago

1.0.405

4 years ago

1.0.403

4 years ago

1.0.402

4 years ago

1.0.399

4 years ago

1.0.396

4 years ago

1.0.384

4 years ago

1.0.381

4 years ago

1.0.383

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.369

4 years ago

1.0.368

4 years ago

1.0.367

4 years ago

1.0.366

4 years ago

1.0.362

4 years ago

1.0.365

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.354

4 years ago

1.0.355

4 years ago

1.0.352

4 years ago

1.0.353

4 years ago

1.0.351

4 years ago

1.0.350

4 years ago

1.0.349

4 years ago

1.0.348

4 years ago

1.0.345

4 years ago

1.0.347

4 years ago

1.0.346

4 years ago

1.0.344

4 years ago

1.0.343

4 years ago

1.0.341

4 years ago

1.0.342

4 years ago

1.0.340

4 years ago

1.0.338

4 years ago

1.0.339

4 years ago

1.0.337

4 years ago

1.0.336

4 years ago

1.0.335

4 years ago

1.0.334

4 years ago

1.0.333

4 years ago

1.0.332

4 years ago

1.0.331

4 years ago

1.0.330

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.325

4 years ago

1.0.324

4 years ago

1.0.323

4 years ago

1.0.322

4 years ago

1.0.321

4 years ago

1.0.320

4 years ago

1.0.319

4 years ago

1.0.318

4 years ago

1.0.317

4 years ago

1.0.316

4 years ago

1.0.315

4 years ago

1.0.314

4 years ago

1.0.313

4 years ago

1.0.312

4 years ago

1.0.311

4 years ago

1.0.310

4 years ago

1.0.309

4 years ago

1.0.308

4 years ago

1.0.305

4 years ago

1.0.307

4 years ago

1.0.306

4 years ago

1.0.304

4 years ago

1.0.303

4 years ago

1.0.301

4 years ago

1.0.302

4 years ago

1.0.300

4 years ago

1.0.299

4 years ago

1.0.297

4 years ago

1.0.296

4 years ago

1.0.298

4 years ago

1.0.295

4 years ago

1.0.294

4 years ago

1.0.293

4 years ago

1.0.292

4 years ago

1.0.291

4 years ago

1.0.290

4 years ago

1.0.288

4 years ago

1.0.287

4 years ago

1.0.289

4 years ago

1.0.286

4 years ago

1.0.285

4 years ago

1.0.282

4 years ago

1.0.281

4 years ago

1.0.284

4 years ago

1.0.283

4 years ago

1.0.279

4 years ago

1.0.277

4 years ago

1.0.278

4 years ago

1.0.275

4 years ago

1.0.276

4 years ago

1.0.257

4 years ago

1.0.256

4 years ago

1.0.259

4 years ago

1.0.258

4 years ago

1.0.274

4 years ago

1.0.271

4 years ago

1.0.270

4 years ago

1.0.273

4 years ago

1.0.272

4 years ago

1.0.255

4 years ago

1.0.253

4 years ago

1.0.254

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.235

4 years ago

1.0.234

4 years ago

1.0.237

4 years ago

1.0.236

4 years ago

1.0.233

4 years ago

1.0.232

4 years ago

1.0.231

4 years ago

1.0.230

4 years ago

1.0.229

4 years ago

1.0.228

4 years ago

1.0.227

4 years ago

1.0.226

4 years ago

1.0.224

4 years ago

1.0.223

4 years ago

1.0.225

4 years ago

1.0.222

4 years ago

1.0.220

4 years ago

1.0.221

4 years ago

1.0.217

4 years ago

1.0.219

4 years ago

1.0.218

4 years ago

1.0.216

4 years ago

1.0.215

4 years ago

1.0.214

4 years ago

1.0.213

4 years ago

1.0.212

4 years ago

1.0.211

4 years ago

1.0.210

4 years ago

1.0.208

4 years ago

1.0.209

4 years ago

1.0.206

4 years ago

1.0.205

4 years ago

1.0.207

4 years ago

1.0.202

4 years ago

1.0.201

4 years ago

1.0.204

4 years ago

1.0.203

4 years ago

1.0.200

4 years ago

1.0.198

4 years ago

1.0.199

4 years ago

1.0.197

4 years ago

1.0.196

4 years ago

1.0.195

4 years ago

1.0.194

4 years ago

1.0.193

4 years ago

1.0.190

4 years ago

1.0.192

4 years ago

1.0.191

4 years ago

1.0.187

4 years ago

1.0.189

4 years ago

1.0.188

4 years ago

1.0.186

4 years ago

1.0.183

4 years ago

1.0.185

4 years ago

1.0.184

4 years ago

1.0.182

4 years ago

1.0.181

4 years ago

1.0.180

4 years ago

1.0.179

4 years ago

1.0.178

4 years ago

1.0.176

4 years ago

1.0.175

4 years ago

1.0.177

4 years ago

1.0.165

4 years ago

1.0.164

4 years ago

1.0.163

4 years ago

1.0.162

4 years ago

1.0.161

4 years ago

1.0.160

4 years ago

1.0.159

4 years ago

1.0.158

4 years ago

1.0.156

4 years ago

1.0.157

4 years ago

1.0.155

4 years ago

1.0.154

4 years ago

1.0.153

4 years ago

1.0.152

4 years ago

1.0.147

4 years ago

1.0.146

4 years ago

1.0.149

4 years ago

1.0.148

4 years ago

1.0.150

4 years ago

1.0.151

4 years ago

1.0.145

4 years ago

1.0.144

4 years ago

1.0.143

4 years ago

1.0.142

4 years ago

1.0.141

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.136

4 years ago

1.0.135

4 years ago

1.0.125

4 years ago

1.0.124

4 years ago

1.0.123

4 years ago

1.0.122

4 years ago

1.0.111

4 years ago

1.0.110

4 years ago

1.0.109

4 years ago

1.0.77

4 years ago

1.0.79

4 years ago

1.0.78

4 years ago

1.0.89

4 years ago

1.0.99

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.69

4 years ago

1.0.70

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.55

4 years ago

1.0.56

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.49

4 years ago

1.0.50

4 years ago

1.0.46

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.41

4 years ago

1.0.39

4 years ago

1.0.40

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.30

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.19

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

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.18

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

4 years ago

1.0.8

4 years ago

1.0.7

4 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