{"_id":"@apex-org/convector-core-model","name":"@apex-org/convector-core-model","dist-tags":{"canary":"1.3.10-0-alpha.2486f88c","latest":"1.3.10-0-alpha.2486f88c"},"versions":{"1.3.10-0-alpha.2486f88c":{"name":"@apex-org/convector-core-model","version":"1.3.10-0-alpha.2486f88c","description":"Convector Model base class","license":"Apache-2.0","repository":{"type":"git","url":"https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-core-model"},"keywords":["typescript","chaincode","blockchain","hyperledger","solutions","environment","hyperledger fabric","smart contract","run","hurley","composer"],"homepage":"https://worldsibu.tech/convector/convector-smart-contracts/","main":"./dist/src/index.js","typings":"./dist/src/index.d.ts","publishConfig":{"access":"public"},"scripts":{"clean":"rimraf dist","clean:docs":"rimraf docs","build":"npm run clean && tsc","watch":"npm-scripts-watcher","prepare":"npm run build","lint":"tslint --fix -c '../../tslint.json' -p './tsconfig.json'","test":"mocha -r ts-node/register tests/**/*.spec.ts --reporter spec","predocs:generate":"npm run clean:docs","docs:generate":"typedoc src --mode file --out docs --target ES6 --excludePrivate","docs:serve":"http-server docs"},"watch":{"src/**/*.ts":["build"]},"peerDependencies":{"reflect-metadata":">=0.1.12"},"dependencies":{"@worldsibu/convector-core-errors":"^1.3.9","@worldsibu/convector-core-storage":"^1.3.9","tslib":"^1.9.0","window-or-global":"^1.0.1","yup":"^0.26.10"},"devDependencies":{"http-server":"^0.11.1","mocha":"^5.0.3","npm-scripts-watcher":"^1.0.2","reflect-metadata":"^0.1.12","rimraf":"^2.6.2","ts-node":"^6.0.3","tslint":"^5.9.1","typedoc":"^0.11.1","typescript":"2.8.3"},"_id":"@apex-org/convector-core-model@1.3.10-0-alpha.2486f88c","_nodeVersion":"10.18.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-2J4zn3vJLjeAjLToIJprLFtHK9lQVkf004xtnKuqbwFHOqWuhNTIMYrsZlDjQBvuqVxEXCsoFAKl8Qd6RmaLSQ==","shasum":"e3276aff95c2eca8d34bbf9c38a9c1e229094236","tarball":"https://registry.npmjs.org/@apex-org/convector-core-model/-/convector-core-model-1.3.10-0-alpha.2486f88c.tgz","fileCount":21,"unpackedSize":43898,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFdorKQLG6Hq9WYyQLlQRQ2qSUzL2+iylaJguVR+FaFwIgU/iIZ6eNpN3i1QhiZCiwEVnhAVmBtn3LEUXf5e5BDPE="}]},"_npmUser":{"name":"akshaysood112","email":"akshay.sood@live.com"},"directories":{},"maintainers":[{"name":"akshaysood112","email":"akshay.sood@live.com"},{"name":"rodolfoleal","email":"rodolfo.pk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/convector-core-model_1.3.10-0-alpha.2486f88c_1686238587643_0.4835406789797225"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-08T15:36:27.580Z","1.3.10-0-alpha.2486f88c":"2023-06-08T15:36:27.881Z","modified":"2023-06-08T15:36:28.087Z"},"maintainers":[{"name":"akshaysood112","email":"akshay.sood@live.com"},{"name":"rodolfoleal","email":"rodolfo.pk@gmail.com"}],"description":"Convector Model base class","homepage":"https://worldsibu.tech/convector/convector-smart-contracts/","keywords":["typescript","chaincode","blockchain","hyperledger","solutions","environment","hyperledger fabric","smart contract","run","hurley","composer"],"repository":{"type":"git","url":"https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-core-model"},"license":"Apache-2.0","readme":"# Convector Model\n\nThis module contains the base model to be used as a base for any other model.\n\n## Usage\n\nThe children classes can be used in 1 of 3 ways:\n\n### As an model query\n\n```ts\nclass MyModel extends ConvectorModel<MyModel> { ... }\n\nconst model = new MyModel(id);\nmodel.fetch()\n  .then(onModelFound)\n  .catch(onModelNotFound);\n```\n\n### As a param constructor and validator\n\n```ts\nclass MyModel extends ConvectorModel<MyModel> { /* ... */ }\n\n@Controller('my-controller')\nclass MyController {\n  @Invokable()\n  public async myMethod(\n    @Param(MyModel)\n    myModel: MyModel\n  ) {\n    myModel.save();\n  }\n}\n```\n\n### As a container to start filling the model\n\n```ts\nclass MyModel extends ConvectorModel<MyModel> { /* ... */ }\n\nconst myModel = new MyModel();\nmyModel.name = 'name';\nmyModel.info = 'info';\n/* ... */\nmyModel.save();\n```\n","readmeFilename":"README.md"}