{"name":"@eggjs/tegg-orm-decorator","version":"3.88.1","description":"tegg orm decorator","main":"dist/index.js","typings":"dist/index.d.ts","keywords":["egg","typescript","runtime","tegg"],"scripts":{"test":"cross-env NODE_ENV=test NODE_OPTIONS='--no-deprecation' mocha","clean":"tsc -b --clean","tsc":"ut run clean && tsc -p ./tsconfig.json","tsc:pub":"ut run clean && tsc -p ./tsconfig.pub.json","prepublishOnly":"ut tsc:pub"},"author":{"name":"killagu","email":"killa123@126.com"},"license":"MIT","homepage":"https://github.com/eggjs/tegg","bugs":{"url":"https://github.com/eggjs/tegg/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/eggjs/tegg.git","directory":"core/orm-decorator"},"engines":{"node":">=14.0.0"},"dependencies":{"@eggjs/core-decorator":"^3.88.1","@eggjs/tegg-common-util":"^3.88.1","@eggjs/tegg-metadata":"^3.88.1","@eggjs/tegg-types":"^3.88.1","lodash":"^4.17.21","pluralize":"^8.0.0"},"peerDependencies":{"leoric":"^2.6.1"},"publishConfig":{"access":"public"},"devDependencies":{"@types/mocha":"^10.0.1","@types/node":"^20.2.4","cross-env":"^7.0.3","mocha":"^10.2.0","ts-node":"^10.9.1","typescript":"^5.0.4"},"gitHead":"c21401cd56b74b8a6692d5709dfe15d8fca57b48","_id":"@eggjs/tegg-orm-decorator@3.88.1","_nodeVersion":"20.20.2","_npmVersion":"lerna/6.6.2/node@v20.20.2+x64 (linux)","dist":{"integrity":"sha512-p+U9h/HlJcxnENcVXBW2n7LN07K2sCGAE4BlkZj8R60V3Arsjmdg72Os0HAhaedAcQyJ0WCEJbuGWsBw/5zSGw==","shasum":"27646caabdef3946be7739d436084a9b416a61a9","tarball":"http://registry-npm.ywwl.com/@eggjs/tegg-orm-decorator/download/@eggjs/tegg-orm-decorator-3.88.1.tgz","fileCount":31,"unpackedSize":35331,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGaOlS70iCNrmnxLhpY/zSp99isr2HxVqt0lmKP8hIOwAiBE7FZQCuTvZ9MvLgaZrd85wTnXL/ptoltVp80Al5CqDA=="}],"size":9778,"noattachment":false,"key":"/@eggjs/tegg-orm-decorator/-/@eggjs/tegg-orm-decorator-3.88.1.tgz"},"_npmUser":{"name":"akitasummer","email":"644171127@qq.com"},"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"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tegg-orm-decorator_3.88.1_1788854385883_0.6931488619697692"},"_hasShrinkwrap":false,"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":1788854386008,"_cnpm_publish_time":1788854386008,"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"}}