{"name":"@eggjs/tegg-orm-decorator","version":"3.4.0","keywords":["egg","typescript","runtime","tegg"],"author":{"name":"killagu","email":"killa123@126.com"},"license":"MIT","_id":"@eggjs/tegg-orm-decorator@3.4.0","homepage":"https://github.com/eggjs/tegg","bugs":{"url":"https://github.com/eggjs/tegg/issues"},"dist":{"shasum":"783a4a08ca6625b329e868f01d33a41427e1649e","tarball":"http://registry-npm.ywwl.com/@eggjs/tegg-orm-decorator/download/@eggjs/tegg-orm-decorator-3.4.0.tgz","fileCount":31,"integrity":"sha512-1j7LpMxFUS4fVa4VCrx6cenyvpZ+ProwhWyGNjulEzBV4ULI/AXIWL8ZWMqnKIwI35dORPVeMrJFmnxSOgvhEQ==","signatures":[{"sig":"MEQCIHDXoHAVs5Kaucy32oJfGHsf2xShXYy1p3qzPG4+mp5nAiAvm+ilV6P0cCEySWRAsmIHSZlUlsMRYNXPjKmLlCGpyA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2iEdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXZw//c2AJ0nyvs+Nduhq2kjHW+91TcGdM9aDAbQxbUNldTu0PRIac\r\ne8QUgPW+Z6B7I5W32mG5odUejy79JDIGGAxE+0huhG8TnyQOdxzpzxYOvFW7\r\nFsGeAmsaAV5/nQDNsoRqz0nG+0WWXpsx5k0r/PpdJdwUrkHapxv++0QDhBSo\r\nVhVvSDokXpqRBVHgJQ9+kVA9FQeih7NCrhIrywDiMXiE6m6KC9M83lu+s07R\r\nbEmYzLvp3ivcPzqPR1Em07qskoK4Mn+8vCgM0PCmA0rmtOidh9RXSYYJ30zN\r\nzwHE1pCZuewgXVF78rfoyEAPcKaOiKX1n+JpHoX3UJ5RJpOlxIAtQ3kQAGe5\r\n6psWzfuTMbodG52idi2YlWlLBRSXz3EORuyJnb0gOWLYYCk0t14z8akKiL/2\r\nBJ4rb238kCY0ay5K2+4g/yth/uIBySuqJRqcZTcqvylPH1kGS8ej+Kq0ipNq\r\nXNe+x3kS/Xf4z0XFMq8ehgfIaYZ8aVVXNHL4SkMbTtXPteymIOIt89h8DE91\r\nDhgs9tFIizLSjMV80INXq1L0ldOSjG4o2dakpJd3UTSJoQpg6Rbzm7aGymkb\r\nM9euREeT89IDy2U8EZwllaBFKzZ8IXANvxI9QFUjwE/w3CHA3zI92h6FUPxz\r\nVjJCxYc/FiwNsj+R4JCjOtlltHRnQELA+3U=\r\n=lauv\r\n-----END PGP SIGNATURE-----\r\n","size":9952,"noattachment":false,"key":"/@eggjs/tegg-orm-decorator/-/@eggjs/tegg-orm-decorator-3.4.0.tgz"},"main":"dist/index.js","engines":{"node":">=14.0.0"},"gitHead":"b47d1514a4d8d6cc8ce0e380b7c35fe6ae1c446f","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":"killagu","email":"killa07071201@gmail.com"},"repository":{"url":"git+ssh://git@github.com/eggjs/tegg.git","type":"git","directory":"core/orm-decorator"},"_npmVersion":"lerna/6.4.1/node@v16.18.1+x64 (darwin)","description":"tegg orm decorator","directories":{},"_nodeVersion":"16.18.1","dependencies":{"lodash":"^4.17.21","pluralize":"^8.0.0","@eggjs/tegg-metadata":"^3.2.4","@eggjs/core-decorator":"^3.2.3","@eggjs/tegg-common-util":"^3.2.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.2.0","ts-node":"^10.9.1","cross-env":"^7.0.3","typescript":"^4.9.4","@types/node":"^18.11.18","@types/mocha":"^10.0.1"},"peerDependencies":{"leoric":"^2.6.1"},"_npmOperationalInternal":{"tmp":"tmp/tegg-orm-decorator_3.4.0_1675239709125_0.8824011328085648","host":"s3://npm-registry-packages"},"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":1675239709355,"maintainers":[{"name":"akitasummer","email":"644171127@qq.com"},{"name":"gxkl","email":"gxkl203@gmail.com"},{"name":"gemwuu","email":"gemwuu@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"}],"_cnpm_publish_time":1675239709355,"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"}}