{"_id":"@eggjs/orm-decorator@4.0.2-rc.0","bugs":{"url":"https://github.com/eggjs/egg/issues"},"dist":{"shasum":"3d8622aff98f1debba0d984cc306d5611166db74","tarball":"http://registry-npm.ywwl.com/@eggjs/orm-decorator/download/@eggjs/orm-decorator-4.0.2-rc.0.tgz","fileCount":36,"integrity":"sha512-AJ/VNkRaXVZetUijjY/aj3qmusdkwrvKtcJ+uX10IGoSpSroKTuTAQhyNu2BUdPO4csxSv+DMAQuwJ9tcqUFaw==","signatures":[{"sig":"MEYCIQDvkvV6tcj0V8JXDh3rbZiTfOtNHjuXoy26ID44eoRbVQIhAIGE0EVsr7BzPC5xn2th/omkLoS0YSr1c9svz5phPE51","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD12kgOfUAn7rVR1ia+Y1t6xG2iFAvkVlYPHbPykroVTAIhAIhXk2zciqZ9D7TJm3eUhWxDvNRwyX3aFyQjfl5ooCAM"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@eggjs%2form-decorator@4.0.2-rc.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":20185,"size":4987,"noattachment":false,"key":"/@eggjs/orm-decorator/-/@eggjs/orm-decorator-4.0.2-rc.0.tgz"},"main":"./dist/index.js","name":"@eggjs/orm-decorator","type":"module","types":"./dist/index.d.ts","author":{"name":"killagu","email":"killa123@126.com"},"module":"./dist/index.js","engines":{"node":">=22.18.0"},"exports":{".":"./dist/index.js","./package.json":"./package.json"},"gitHead":"c92333429c2dfbdc5ddd06c7f3e238b4b07cbf41","license":"MIT","scripts":{"typecheck":"tsgo --noEmit"},"version":"4.0.2-rc.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e2d00dc7-b16a-4d41-923f-82d9c82afbaf"}},"homepage":"https://github.com/eggjs/egg/tree/next/tegg/core/orm-decorator","keywords":["egg","runtime","tegg","typescript"],"repository":{"url":"git+https://github.com/eggjs/egg.git","type":"git","directory":"tegg/core/orm-decorator"},"_npmVersion":"11.19.0","description":"tegg orm decorator","directories":{},"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":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"coolme200","email":"2001-wms@163.com"},{"name":"akitasummer","email":"644171127@qq.com"},{"name":"elrrrrrrr","email":"elrrrrrrr@gmail.com"},{"name":"niania","email":"ljracm@gmail.com"}],"_nodeVersion":"24.21.0","dependencies":{"lodash":"^4.17.21","pluralize":"^8.0.0","@eggjs/tegg-types":"4.0.2-rc.0","@eggjs/core-decorator":"4.0.2-rc.0"},"publishConfig":{"access":"public","exports":{".":"./dist/index.js","./package.json":"./package.json"}},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.9.3","@types/node":"^24.10.2","@types/lodash":"^4.17.20","@types/pluralize":"^0.0.33"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/orm-decorator_4.0.2-rc.0_1790176886816_0.6486160164676997"},"readme":"# `@eggjs/orm-decorator`\n\n[![NPM version][npm-image]][npm-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n[![Node.js Version](https://img.shields.io/node/v/@eggjs/orm-decorator.svg?style=flat)](https://nodejs.org/en/download/)\n\n[npm-image]: https://img.shields.io/npm/v/@eggjs/orm-decorator.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/@eggjs/orm-decorator\n[snyk-image]: https://snyk.io/test/npm/@eggjs/orm-decorator/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/@eggjs/orm-decorator\n[download-image]: https://img.shields.io/npm/dm/@eggjs/orm-decorator.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@eggjs/orm-decorator\n\n## Install\n\n```shell\nnpm i --save @eggjs/orm-decorator\n```\n\n## Define Model\n\n```ts\nimport { Model, Attribute } from '@eggjs/orm-decorator';\nimport leoric from 'leoric';\n\nconst { DataTypes, Bone } = 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: { name: string; desc: string }): 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","publish_time":1790176886889,"_cnpm_publish_time":1790176886889,"dist-tags":{"beta":"4.0.2-beta.27","latest":"4.1.0","rc":"4.0.2-rc.1"}}