{"name":"@eggjs/tegg-orm-decorator","version":"4.0.0-beta.3","keywords":["egg","typescript","runtime","tegg"],"author":{"name":"killagu","email":"killa123@126.com"},"license":"MIT","_id":"@eggjs/tegg-orm-decorator@4.0.0-beta.3","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":"644171127@qq.com"}],"homepage":"https://github.com/eggjs/tegg","bugs":{"url":"https://github.com/eggjs/tegg/issues"},"dist":{"shasum":"2d0ed3b45a910156ab6f00d419192086c08f2a39","tarball":"http://registry-npm.ywwl.com/@eggjs/tegg-orm-decorator/download/@eggjs/tegg-orm-decorator-4.0.0-beta.3.tgz","fileCount":39,"integrity":"sha512-dT+VJ70Gx7PMFIYr3gqX5IkjPenY6mcQxc5k6+XDG0dPGT083ZqZhWA+7atlZY4Bc0sB2kWX3f451o82I4QA8A==","signatures":[{"sig":"MEYCIQDsm5yEiSGZT4Tm6R7e6++UF2VCroxk5GadjN28ySlowwIhAMYldUGXtqG4B0EppkZkkv7vJazhRLbEXahFZ7JRj0k4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32262,"size":8985,"noattachment":false,"key":"/@eggjs/tegg-orm-decorator/-/@eggjs/tegg-orm-decorator-4.0.0-beta.3.tgz"},"type":"module","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"}},"gitHead":"6b84b0275fd728a4973746a5341236fe0481a33e","scripts":{"tsc":"npm run clean && tsc -p ./tsconfig.json","clean":"tsc -b --clean","tsc:pub":"npm run tsc","prepublishOnly":"npm run tsc"},"_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/6.6.2/node@v20.17.0+arm64 (darwin)","description":"tegg orm decorator","directories":{},"_nodeVersion":"20.17.0","dependencies":{"lodash":"^4.17.21","pluralize":"^8.0.0","@eggjs/tegg-types":"^4.0.0-beta.3","@eggjs/tegg-metadata":"^4.0.0-beta.3","@eggjs/core-decorator":"^4.0.0-beta.3","@eggjs/tegg-common-util":"^4.0.0-beta.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ts-node":"10","typescript":"5","@types/node":"22","@types/pluralize":"^0.0.33"},"peerDependencies":{"leoric":"^2.6.1"},"_npmOperationalInternal":{"tmp":"tmp/tegg-orm-decorator_4.0.0-beta.3_1742056671394_0.1609793690411565","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":1742056671598,"_cnpm_publish_time":1742056671598,"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"}}