{"name":"@eggjs/tegg-orm-decorator","version":"0.1.18","keywords":["egg","typescript","runtime","tegg"],"author":{"name":"killagu","email":"killa123@126.com"},"license":"MIT","_id":"@eggjs/tegg-orm-decorator@0.1.18","homepage":"https://github.com/eggjs/tegg","bugs":{"url":"https://github.com/eggjs/tegg/issues"},"dist":{"shasum":"bc8ca36f1025d634950031d2f7b6ec560f714708","tarball":"http://registry-npm.ywwl.com/@eggjs/tegg-orm-decorator/download/@eggjs/tegg-orm-decorator-0.1.18.tgz","fileCount":32,"integrity":"sha512-3Y6oNZLDJ4WQubtzJe83uHQjJNIUsuBDDmzeofhKdw9AYw0k47ynOyfAJeLBy8AEunZ+/TlGPBmfB6d6/Y7QZg==","signatures":[{"sig":"MEUCIAHxU5mwQJ/Z6A8R/jR6yYfQSNg0f0bgYtz50L0A/Hq4AiEA0Kjt8y+6GVfbxmdTi1Ca03A1KcVhryN4XkXDpnWIkSk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":35905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhztFTCRA9TVsSAnZWagAAy6wP/ROCrAfNlJ2LoqExY/p6\nDXoFNwyzB7/elPoxkt2E9kMsI6pLoDtC5MfFQI2WwK8H7ids/RSRP4R0hnui\nHwdmUZSrsq8TA739bE275VF+GKM/YZ9WdKZhLKYmmjDuU3vgT98Ctz1Pgm0/\njdAAU6BpKuA9rYgp7f35kcGhKw8r9BjhfjqdS6U3pByRumL7RdvCf3Il2v27\nufEJn0PKn5q3JOL0mYkjms3ZOjaq+/rSQRn926gY7onXbdhfigLyU2UuDxyC\nHPaUmHzlh3XjSOjQgSHPtQW+zwRoIRpP6ICWCLV9n+SdvHJCZ46SfMvV31IM\n7S1wrWv7n+/NcAj2G3Uwt0iUTEKL1Q9so+ICPCdh19wnlHkWtHycm4qwTNJ/\n8NO0keLhIamRESIjxeh1NUvz7k+KtmGAqB7V1VPO+9juD8Q4AHU2xYokkh99\nXhu8LWtSfabujqgfgxT/NkyI7b26UCrVTaCz/dV5Rk9qaJK6Y9VVRqgT3Uro\ne349pvLta4gYRRSDfNyZLbHRRgMZ+AeItYqz3VWguNdP+JQnMFYnz5ENejW5\nGzapCJoLRn1qrrpSI11YMN1Ie15vbz/q8/JaLAEBWlJAPJbb/QFe3WSZTam2\n7bEEkJ3K150H7OChYok7sKNncJiK1L2klEEM6seTqOiWHfuWvcbW/T9ez/hL\nqmnj\r\n=XzDq\r\n-----END PGP SIGNATURE-----\r\n","size":9773,"noattachment":false,"key":"/@eggjs/tegg-orm-decorator/-/@eggjs/tegg-orm-decorator-0.1.18.tgz"},"main":"dist/index.js","engines":{"node":">=14.0.0"},"gitHead":"a307030b00824914d23fc32dcd3fa94cadce940d","scripts":{"tsc":"npm run clean && tsc -p ./tsconfig.json","autod":"autod","clean":"tsc -b --clean","tsc:pub":"npm run clean && tsc -p ./tsconfig.pub.json","prepublishOnly":"npm run tsc:pub"},"typings":"dist/index.d.ts","_npmUser":{"name":"wanghx","email":"whxaxes@gmail.com"},"repository":{"url":"git+ssh://git@github.com/eggjs/tegg.git","type":"git","directory":"core/orm-decorator"},"_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (darwin)","description":"tegg orm decorator","directories":{},"_nodeVersion":"12.18.3","dependencies":{"lodash":"^4.17.21","pluralize":"^8.0.0","@eggjs/tegg-metadata":"^0.1.18","@eggjs/core-decorator":"^0.1.18","@eggjs/tegg-common-util":"^0.1.18"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"leoric":"^1.6.7"},"_npmOperationalInternal":{"tmp":"tmp/tegg-orm-decorator_0.1.18_1640943954952_0.20852240233745012","host":"s3://npm-registry-packages"},"readme":"# `@eggjs/tegg-orm-decorator`\n\n## Install\n\n```shell\nnpm i --save @eggjs/tegg-orm-decorator\n```\n\n## Define Model\n\n```ts\nimport { Model, Attribute } from '@eggjs/tegg-orm-decorator';\nimport { DataTypes, Bone } from 'leoric';\n\n@Model()\nexport class App extends Bone {\n  @Attribute(DataTypes.STRING)\n  name: string;\n  @Attribute(DataTypes.STRING)\n  desc: string;\n}\n```\n\n## Use Model\n\n```ts\nimport { SingletonProto, Inject } from '@eggjs/tegg';\nimport { App } from './model/App';\n\n@SingletonProto()\nexport class AppService {\n  @Inject()\n  App: typeof App;\n\n  async createApp(data: {\n    name: string;\n    desc: string;\n  }): Promise<App> {\n    const bone = await this.App.create(data as any);\n    return bone as App;\n  }\n\n  async findApp(name: string): Promise<App | null> {\n    const app = await this.App.findOne({ name });\n    return app as App;\n  }\n}\n\n```\n","publish_time":1640943955108,"maintainers":[{"name":"akitasummer","email":"644171127@qq.com"},{"name":"gxkl","email":"gxkl203@gmail.com"},{"name":"gemwuu","email":"gemwuu@gmail.com"},{"name":"eggjs-admin","email":"fengmk2+eggjs@gmail.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"atian25","email":"atian25@qq.com"},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"wanghx","email":"whxaxes@gmail.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"coolme200","email":"2001-wms@163.com"},{"name":"mansonchor.zzw","email":"mansonchor1987@gmail.com"},{"name":"hubcarl","email":"hubcarl@126.com"}],"_cnpm_publish_time":1640943955108,"dist-tags":{"alpha":"3.57.15-alpha.0","beta":"3.73.0-beta.1","beta-v3":"3.74.0-beta.3","latest":"3.88.2"}}