{"name":"@eggjs/tegg-orm-decorator","version":"3.60.1","keywords":["egg","typescript","runtime","tegg"],"author":{"name":"killagu","email":"killa123@126.com"},"license":"MIT","_id":"@eggjs/tegg-orm-decorator@3.60.1","maintainers":[{"name":"gxkl","email":"gxkl203@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"},{"name":"gemwuu","email":"gemwuu@gmail.com"},{"name":"akitasummer","email":"akitasummer@outlook.com"}],"homepage":"https://github.com/eggjs/tegg","bugs":{"url":"https://github.com/eggjs/tegg/issues"},"dist":{"shasum":"ce96b005d3e0e21810d76943a4173293af62e340","tarball":"http://registry-npm.ywwl.com/@eggjs/tegg-orm-decorator/download/@eggjs/tegg-orm-decorator-3.60.1.tgz","fileCount":31,"integrity":"sha512-xAaamnA2KV1/woFnoYfzm5Tc8n+7Jzz7yiP2nlUphNDm0GZb1zi+kyBb+h3M5yErQE7+nM1iHdeDjxh2zuRgsQ==","signatures":[{"sig":"MEQCIDACIshR+JKZF+Q8/0GgHfaurkbGX0d7alY5VOrAHdoPAiB3v5+Bw1Biapg0JVXVlA6jtCjCSG3GZdeXZ4+IVXuYUA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35338,"size":9775,"noattachment":false,"key":"/@eggjs/tegg-orm-decorator/-/@eggjs/tegg-orm-decorator-3.60.1.tgz"},"main":"dist/index.js","engines":{"node":">=14.0.0"},"gitHead":"f515a0400a804e5a9d4a9a61c26a310b3240bcc2","scripts":{"tsc":"npm run clean && tsc -p ./tsconfig.json","test":"cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha","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":"gxkl","email":"gxkl203@gmail.com"},"repository":{"url":"git+ssh://git@github.com/eggjs/tegg.git","type":"git","directory":"core/orm-decorator"},"_npmVersion":"lerna/6.6.2/node@v20.19.4+x64 (linux)","description":"tegg orm decorator","directories":{},"_nodeVersion":"20.19.4","dependencies":{"lodash":"^4.17.21","pluralize":"^8.0.0","@eggjs/tegg-types":"^3.60.1","@eggjs/tegg-metadata":"^3.60.1","@eggjs/core-decorator":"^3.60.1","@eggjs/tegg-common-util":"^3.60.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.2.0","ts-node":"^10.9.1","cross-env":"^7.0.3","typescript":"^5.0.4","@types/node":"^20.2.4","@types/mocha":"^10.0.1"},"peerDependencies":{"leoric":"^2.6.1"},"_npmOperationalInternal":{"tmp":"tmp/tegg-orm-decorator_3.60.1_1753710995672_0.18662036506630852","host":"s3://npm-registry-packages-npm-production"},"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":1753710995863,"_cnpm_publish_time":1753710995863,"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"}}