{"name":"@eggjs/tegg-orm-decorator","version":"0.1.6","keywords":["egg","typescript","runtime","tegg"],"author":{"name":"killagu","email":"killa123@126.com"},"license":"MIT","_id":"@eggjs/tegg-orm-decorator@0.1.6","homepage":"https://github.com/eggjs/tegg","bugs":{"url":"https://github.com/eggjs/tegg/issues"},"dist":{"shasum":"c4d74253007700fa1b1e621156c0e74d72b647b0","tarball":"http://registry-npm.ywwl.com/@eggjs/tegg-orm-decorator/download/@eggjs/tegg-orm-decorator-0.1.6.tgz","fileCount":32,"integrity":"sha512-lDpQllW/BoAmCW6B/11f5Jg+/r7k5DbOCuVqmRcgwqE3wXYp/B4OR1MooTLwb29gq5Vpl7UocNfvx7isqGXgUg==","signatures":[{"sig":"MEUCIQDF/Fw/EYPRAQYKX889IoOG82jY5/PZW0FgWjdH4OeW8wIgJGZ7P73KLfW+CpIDoSvdbhIEAKAARw7KmgNBd4pbf1w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":35735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOgBKCRA9TVsSAnZWagAAOxgP/3PPY2Xks4eq0O9QLKde\nyxnVnyr1w1N9IlsXRcKS3eNBVgxk17xsX5A5X6yp14w41h2FpbS4ZdwSA4hT\nTopNAXMB7E86P1VtR/4e+qvq88t8L5cNcPytZ3YIBsujBKBX1VucqUE9sZK0\n5soRH4USgrJqLi+rKUbDR5orFy1Dl0n0zrWbmOUn8VWfGGs9bIXG5rklk8lU\nKQBsTnQi9fKWYGFwPFK4ypIF/EBDW14jfnBFFU1m+/rLHpRjWjpiB/TO7mFt\nLw7JKBTTG5lblRc1OvErBPxUjnwniY1z+O0rTYAnuL1TUcDNc480VhWBSPTy\n96q6y3YxOxpowCuwR2pmBLGlfT5UXmu6h2CZ1TPnDvjWmoMBXyIQWNWrYVKM\nSSnxqSyBjHFxSUyRPkB6zyH29apNjXsoLeSyB64daP91t9zK0rOfdicoe1HP\nMyLZhKl8L0LdvMOp6Ad69eYTqSDcD0Gy47QuQud+2sIkUr/scH0shPQRLG23\nwe1nCVZEhdhbBWU6zMwBuna12Wo03zOqcLO3vzbygrXAxMUYw2VdW87C+sbX\newwZOA1n88htNsrNDqzs5hwEbS/C+FPpPmAtAioW07zdg7v3FJuZqO1w8TtR\nWbZSARX5seel//XiSF+64phhDAb+6hu/YKXTD6/H1r6GjbWw7u7lLyzIi7KD\nyje9\r\n=1smE\r\n-----END PGP SIGNATURE-----\r\n","size":9745,"noattachment":false,"key":"/@eggjs/tegg-orm-decorator/-/@eggjs/tegg-orm-decorator-0.1.6.tgz"},"main":"dist/index.js","engines":{"node":">=14.0.0"},"gitHead":"580a06e883c5f184481ca8ae030ef34d405660e4","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","prepublish":"npm run tsc:pub"},"typings":"dist/index.d.ts","_npmUser":{"name":"killagu","email":"killa07071201@gmail.com"},"repository":{"url":"git+ssh://git@github.com/eggjs/tegg.git","type":"git","directory":"core/orm-decorator"},"_npmVersion":"lerna/3.22.1/node@v14.17.4+x64 (darwin)","description":"tegg orm decorator","directories":{},"_nodeVersion":"14.17.4","dependencies":{"lodash":"^4.17.21","pluralize":"^8.0.0","@eggjs/tegg-metadata":"^0.1.6","@eggjs/core-decorator":"^0.1.5","@eggjs/tegg-common-util":"^0.1.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"leoric":"^1.6.7"},"_npmOperationalInternal":{"tmp":"tmp/tegg-orm-decorator_0.1.6_1631191113954_0.44929395960146","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":1631191114118,"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":1631191114118,"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"}}