{"name":"@eggjs/tegg-orm-decorator","version":"1.3.1","keywords":["egg","typescript","runtime","tegg"],"author":{"name":"killagu","email":"killa123@126.com"},"license":"MIT","_id":"@eggjs/tegg-orm-decorator@1.3.1","homepage":"https://github.com/eggjs/tegg","bugs":{"url":"https://github.com/eggjs/tegg/issues"},"dist":{"shasum":"f8136084f05c98e91b4a2fc65cd05d0b13c58156","tarball":"http://registry-npm.ywwl.com/@eggjs/tegg-orm-decorator/download/@eggjs/tegg-orm-decorator-1.3.1.tgz","fileCount":32,"integrity":"sha512-81hNpy11m9eaq9nFSGvznhyJqASpVbCC93rFIn37C67vvnd8cTKwIwKkYOb0aPlqVQYRcuQEHz7k9HHxTHf9Cg==","signatures":[{"sig":"MEYCIQDbgEJfFWh6bxwZm2c+Tqs7NJJg9qpjZX9sLa2GAjHP7QIhAJL6q/YJQEI6yJtny64Nmm7BJt7zc/AasQD7ysZmL3d3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36374,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiy9lDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohhQ//WYgE8uWIqw+1OOB/AjyE9uoUJhBnjqrbdW9lptQVQlwSseoO\r\nLHrFslb1iXusov63gMLXuHTxx17mfKDLEe8QM/xQDHhOGUq8Gg6giyTXn+Mn\r\neQCuvhnCCco6wEnMgWpGVlPehIR+PWtULiBjlMJRvhHkE7Dc2MAMcyqxik6V\r\nDeGRdM9zhF4gOCWcryS5G3Z06WD7aicLlNkzCLlbmIisjr4eOr/MWmiR1fap\r\nmOPQxk6MDT2J4GdJKgpIHG2P0ezDF033Ul2X3DWyjTwVRF0t4/ers9sJkaWr\r\njgwyHMrhPwTtZ4Xeeusu+cStlewiBbnRcrWrMTX7IvmqYwSiW2xNqykVt/sF\r\nNNJBYiTcGbTn+7qJ6MYd+P5Nof2EnNRKkx9ZgcnpkL63eNR6kZVqoCtR0dQ1\r\n2Q/nOXXmYSGzZ+ae8ecmXxPrtLcuOAopEK7hQk+oY2xdsTXmnke1XzaVAE/J\r\nNQy4NOF/uBZAE1hKt9RoR6Q9Mj+WRTMlt8M6m85m6Wo37USQY5tjMuMpqKkJ\r\nMguupOwDtvCAVmkj6P9ZCj0sjaTgt7QVpBD6RCWaesigLZ5R0CevqKo1psCb\r\nakbOeLN2OKeqoq9vjr+RvLDrC93ZQAvtYHkWhiU/Kx+05Ky1GGgcYpdoBKMb\r\ndr3l+qucU7+EkTaOVMJkPNjHd3OgxwCxmZQ=\r\n=p9x8\r\n-----END PGP SIGNATURE-----\r\n","size":9944,"noattachment":false,"key":"/@eggjs/tegg-orm-decorator/-/@eggjs/tegg-orm-decorator-1.3.1.tgz"},"main":"dist/index.js","engines":{"node":">=14.0.0"},"gitHead":"f387ec87692607ac61e4fd40871f3694ca373993","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":"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@v16.14.2+x64 (darwin)","description":"tegg orm decorator","directories":{},"_nodeVersion":"16.14.2","dependencies":{"lodash":"^4.17.21","pluralize":"^8.0.0","@eggjs/tegg-metadata":"^1.3.0","@eggjs/core-decorator":"^1.3.0","@eggjs/tegg-common-util":"^1.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"leoric":"^2.6.1"},"_npmOperationalInternal":{"tmp":"tmp/tegg-orm-decorator_1.3.1_1657526594872_0.0060710931564722515","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":1657526595049,"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":1657526595049,"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"}}