# @worldsibu/convector-core-model

> Convector Model base class

Latest version **1.3.8** (published 2019-09-03) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @worldsibu/convector-core-model
pnpm add @worldsibu/convector-core-model
yarn add @worldsibu/convector-core-model
bun add @worldsibu/convector-core-model
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.8 |
| Published | 2019-09-03 |
| First published | 2018-06-27 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 42.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 143 |
| Maintainers | diestrin |
| Keywords | typescript, chaincode, blockchain, hyperledger, solutions, environment, hyperledger fabric, smart contract, run, hurley, composer |

## Links

- npm: https://www.npmjs.com/package/@worldsibu/convector-core-model
- Repository: https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-core-model
- Homepage: https://worldsibu.tech/convector/convector-smart-contracts/
- npm.io page: https://npm.io/package/@worldsibu/convector-core-model

## Dependencies (5)

- [yup](https://npm.io/package/yup.md) ^0.26.10
- [tslib](https://npm.io/package/tslib.md) ^1.9.0
- [window-or-global](https://npm.io/package/window-or-global.md) ^1.0.1
- [@worldsibu/convector-core-errors](https://npm.io/package/@worldsibu/convector-core-errors.md) ^1.3.8
- [@worldsibu/convector-core-storage](https://npm.io/package/@worldsibu/convector-core-storage.md) ^1.3.8

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 1.3.8 (latest) — 2019-09-03
- 1.3.10-0-alpha.2486f88c (canary) — 2022-06-02
- 1.3.10-0-alpha.41e75dba — 2022-05-31
- 1.3.10-0-alpha.3f803885 — 2022-05-25
- 1.3.10-0-alpha.32accc48 — 2022-05-25
- 1.3.10-0-alpha.68696fd6 — 2022-05-24
- 1.3.10-0-alpha.b2b47722 — 2022-05-24
- 1.3.10-0-alpha.ab46703c — 2022-05-20
- 1.3.10-0-alpha.d9c98e51 — 2022-05-19
- 1.3.10-0-alpha.74462599 — 2022-05-19
- 1.3.9-0-alpha.013419ca — 2021-08-26
- 1.3.9-0-alpha.09192f1d — 2021-08-26
- 1.3.9-0-alpha.90c7d903 — 2021-02-17
- 1.3.9-0-alpha.b1b143ba — 2021-02-15
- 1.3.9-0-alpha.f9e11059 — 2021-02-12
- … 172 more at https://npm.io/package/@worldsibu/convector-core-model/versions

## README

# Convector Model

This module contains the base model to be used as a base for any other model.

## Usage

The children classes can be used in 1 of 3 ways:

### As an model query

```ts
class MyModel extends ConvectorModel<MyModel> { ... }

const model = new MyModel(id);
model.fetch()
  .then(onModelFound)
  .catch(onModelNotFound);
```

### As a param constructor and validator

```ts
class MyModel extends ConvectorModel<MyModel> { /* ... */ }

@Controller('my-controller')
class MyController {
  @Invokable()
  public async myMethod(
    @Param(MyModel)
    myModel: MyModel
  ) {
    myModel.save();
  }
}
```

### As a container to start filling the model

```ts
class MyModel extends ConvectorModel<MyModel> { /* ... */ }

const myModel = new MyModel();
myModel.name = 'name';
myModel.info = 'info';
/* ... */
myModel.save();
```

---
_Source: https://npm.io/package/@worldsibu/convector-core-model · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
