{"name":"@eggjs/tegg-orm-decorator","version":"1.0.0","keywords":["egg","typescript","runtime","tegg"],"author":{"name":"killagu","email":"killa123@126.com"},"license":"MIT","_id":"@eggjs/tegg-orm-decorator@1.0.0","homepage":"https://github.com/eggjs/tegg","bugs":{"url":"https://github.com/eggjs/tegg/issues"},"dist":{"shasum":"93f03346daa2ef5ee162ae3eff5732585c3bcd04","tarball":"http://registry-npm.ywwl.com/@eggjs/tegg-orm-decorator/download/@eggjs/tegg-orm-decorator-1.0.0.tgz","fileCount":32,"integrity":"sha512-yq5F0vIBU5298EdgrSqV7O6uauW5lyEMMQ1vwrAPDWTX5p3a0aVWULu9wp6Au9hicYyDXMMgEONkRAqF9sElTA==","signatures":[{"sig":"MEUCIQCPD5cQ3oCsmiz+xkPf/6TYDjmc5gi7jADAWrPyoec5IgIgOiHE2hGeEW66fqdAu2pQGAeqbEScU2S+ERmhk+EByh8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAdvTCRA9TVsSAnZWagAAvFEP/2Qaf69w7ViVwKrPJSPO\noi9zKRyy/wBFsJSUpytbmTQGjFagvi4NWHr8yB6xbDeTpfetKUmPL66XZDqN\nGygtT/klGXN/L8bzCGHh1nLR19hTRS827ZDmt7IRbXcA4aQk6G0kefnS4HcG\n7eHwuu2723NPozqXkpQHDVXT+zgGIoGhLWkorGzu3Is8OH9Jp1jGHmFu5hwT\ny9XjogVXqym92yrhx+2HDezK7XgOUqBkeTpJW1T2UavXbW+Ycs+upnU8Kb76\nbi++KzMi8sBX2vGwhAHhpX+9xRUrLON7Byn69Wp58RhaDV/trMDcit2/1IiL\n40TOJjAo+FZaI/IV6ZerGRFF/cz4U9ktjWw/H9jED/8X7a8lvQL7YD1gwaGY\nRbFYOf+iyP33WNwj/nkO8xvCrspAvIaCWfZ+jK5J3GlrOIQxYEAo82MSx3j8\nCbytW82Z8FQ6SBoDiNQ0/eadPYOJvB53HrlsDI3tul3/jT6X2MMKOcVvHRL7\n6dNGtTCll8YOFgqVAGl/jLMCwJPBXOUDa6W7JGdAE4GUHflUxyxCCQWg2TbZ\nyvpiqfuYQDNCNy6puO38JKxyVDJ3JmRcsEAecRJMjzWPMYVPo3k1DALqjHZI\nq/OF748jWSejDB5RRAm6lYlIeDZl3I/rgDqFZmPk88PPENmyNG2fockQXrxJ\nsMRl\r\n=uSed\r\n-----END PGP SIGNATURE-----\r\n","size":9838,"noattachment":false,"key":"/@eggjs/tegg-orm-decorator/-/@eggjs/tegg-orm-decorator-1.0.0.tgz"},"main":"dist/index.js","engines":{"node":">=14.0.0"},"gitHead":"5851321b2488752f6702ff99023b1f70a6541eab","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@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":"^1.0.0","@eggjs/core-decorator":"^1.0.0","@eggjs/tegg-common-util":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"leoric":"^1.6.7"},"_npmOperationalInternal":{"tmp":"tmp/tegg-orm-decorator_1.0.0_1644288979766_0.45423328166623955","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":1644288979916,"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":1644288979916,"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"}}