{"name":"@eggjs/tegg-orm-decorator","version":"1.5.2","keywords":["egg","typescript","runtime","tegg"],"author":{"name":"killagu","email":"killa123@126.com"},"license":"MIT","_id":"@eggjs/tegg-orm-decorator@1.5.2","homepage":"https://github.com/eggjs/tegg","bugs":{"url":"https://github.com/eggjs/tegg/issues"},"dist":{"shasum":"bebbbe2e48cdb38b4dcb958bc540bc8b5e5d2684","tarball":"http://registry-npm.ywwl.com/@eggjs/tegg-orm-decorator/download/@eggjs/tegg-orm-decorator-1.5.2.tgz","fileCount":32,"integrity":"sha512-SR3ipFz42TE2MSrBi2DWBDlqh33I9LQ6rDDqo+osa2nxzywQcThLR+ejyc8HSj+ta0ZH4WNNWAeoVDyTS+ojnA==","signatures":[{"sig":"MEQCIAkNr/9NOUO3wpyip8TWTW7G8v8uVPGerDBSeys4pm4mAiAXUiNGOySBRHL94A0OgxuTXAx8ajPFWXlYgO8d0wWVHQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":37301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiY/4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSzBAAi2kwHG6ONEOVHIOZ+eibxi2ClNJi76WsEMFPJ63maH1YDgNQ\r\nTri+7KPsDjGbWyF0CkTuQJ4FKsS3Y5YSbEWgouGbmtJEcst83KWrixr2v41m\r\nhfCTFMpXzonEX1vYEKwHlzZpz7U27EwCnLni+NJRi1Bhc8JpSVuETwFAS2An\r\niEmKvAm4MAw1yIJPgEZOlcnw+ZpvQSWDRn7yX1m2AqhZLY0TrJ3uP7SPq0yN\r\nOw3ruqAEdcIOA6Z2hgyapB5PYZ98UdKLFnsiLFFvoiYZHsNiHeCkzzLaVAxx\r\nOyMO/NugHGvUS5ssR3/uk2CW6mwszNrt7tgVCxHtpTavBcpzW4Ksv+J1WUQR\r\nf4BvloWshV2/tx+exII7NWP84qAtITx0Bi7nAx96qyIlgRGA5t/mP181HSGi\r\n/i1tlnFROUGmxaUUdSsDhtHu1Vj/x6HmtYSKWljhjwKKePXthcTgtCiIJ8o9\r\nOV8MSCcHTrUPHzZrpkw9T+1MTnjVxKtuE9iJhpjU8Bh6N+3TnQrtVKNuHUAc\r\nr+RkfEWvtC594+zAHOZeKTrWGzf3xSv7zzK/sum8TMBImRSO/4YLjXV/oIFU\r\nDnFuCN3UKuTLA/g0Nyk20QCW3hIr5+W57SfyK/zpIm7wYJ+zpOhWs1FSK4A5\r\nBaCN4CGhSAD6tN5C1JjYARoFFf9Z021vYLY=\r\n=+XVT\r\n-----END PGP SIGNATURE-----\r\n","size":10203,"noattachment":false,"key":"/@eggjs/tegg-orm-decorator/-/@eggjs/tegg-orm-decorator-1.5.2.tgz"},"main":"dist/index.js","engines":{"node":">=14.0.0"},"gitHead":"de0d2cd055cc6deca938b74aabb90ef5f9fc0dd7","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.4.2","@eggjs/core-decorator":"^1.4.2","@eggjs/tegg-common-util":"^1.2.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"leoric":"^2.6.1"},"_npmOperationalInternal":{"tmp":"tmp/tegg-orm-decorator_1.5.2_1669959672750_0.7309982370991337","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":1669959672894,"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":1669959672894,"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"}}