{"name":"@eggjs/tegg-orm-decorator","version":"4.0.0-beta.11","keywords":["egg","typescript","runtime","tegg"],"author":{"name":"killagu","email":"killa123@126.com"},"license":"MIT","_id":"@eggjs/tegg-orm-decorator@4.0.0-beta.11","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":"akitasummer@outlook.com"}],"homepage":"https://github.com/eggjs/tegg/tree/next/core/orm-decorator","bugs":{"url":"https://github.com/eggjs/tegg/issues"},"dist":{"shasum":"292db58cf12a5c6c3cfb6dd062697b1c8b3d90e4","tarball":"http://registry-npm.ywwl.com/@eggjs/tegg-orm-decorator/download/@eggjs/tegg-orm-decorator-4.0.0-beta.11.tgz","fileCount":39,"integrity":"sha512-Sy4OwCMqN8E0ydDCHSKt7uoSTeHd3tSwuU6ClMtiCpGXmbQZe07jncq1RZH2v3BzalzpYfYccnukFex/q2jbYw==","signatures":[{"sig":"MEUCIECLFt+hfrmP9cxgIDaM8Hm9/rM6NGNApGj6lRg5jFcTAiEA3Apbt1RgF1H3JRcutcAW6iEr5YYrTAmLye22r7pex4g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@eggjs%2ftegg-orm-decorator@4.0.0-beta.11","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":33706,"size":9379,"noattachment":false,"key":"/@eggjs/tegg-orm-decorator/-/@eggjs/tegg-orm-decorator-4.0.0-beta.11.tgz"},"main":"./dist/index.js","type":"module","_from":"file:eggjs-tegg-orm-decorator-4.0.0-beta.11.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.18.0"},"exports":{".":"./dist/index.js","./package.json":"./package.json"},"scripts":{"build":"tsdown && npm run clean && tsc -p tsconfig.build.json","clean":"rimraf dist *.tsbuildinfo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:81d78df9-c3ba-4d1a-ab65-f74af7361943"}},"_resolved":"/tmp/2f459dbb3e00f9312f88cf0aa50ac3d4/eggjs-tegg-orm-decorator-4.0.0-beta.11.tgz","_integrity":"sha512-Sy4OwCMqN8E0ydDCHSKt7uoSTeHd3tSwuU6ClMtiCpGXmbQZe07jncq1RZH2v3BzalzpYfYccnukFex/q2jbYw==","repository":{"url":"git+ssh://git@github.com/eggjs/tegg.git","type":"git","directory":"core/orm-decorator"},"_npmVersion":"11.6.1","description":"tegg orm decorator","directories":{},"_nodeVersion":"22.20.0","dependencies":{"lodash":"^4.17.21","pluralize":"^8.0.0","@eggjs/tegg-types":"4.0.0-beta.11","@eggjs/core-decorator":"4.0.0-beta.11"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsdown":"^0.15.6","typescript":"^5.9.3","@types/node":"^22.10.5","@types/lodash":"^4.17.20","unplugin-unused":"^0.5.3","@types/pluralize":"^0.0.33"},"_npmOperationalInternal":{"tmp":"tmp/tegg-orm-decorator_4.0.0-beta.11_1759689005154_0.4777845699913541","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":1759689005340,"_cnpm_publish_time":1759689005340,"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"}}