{"name":"@eggjs/transaction-decorator","version":"4.0.2-beta.13","keywords":["decorator","egg","tegg","transaction","typescript"],"author":{"name":"qile222","email":"chhxxc@gmail.com"},"license":"MIT","_id":"@eggjs/transaction-decorator@4.0.2-beta.13","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":"niania","email":"ljracm@gmail.com"}],"homepage":"https://github.com/eggjs/egg/tree/next/tegg/core/transaction-decorator","bugs":{"url":"https://github.com/eggjs/egg/issues"},"dist":{"shasum":"d5992acc00c8983fc622f4d35d5c59d77c031955","tarball":"http://registry-npm.ywwl.com/@eggjs/transaction-decorator/download/@eggjs/transaction-decorator-4.0.2-beta.13.tgz","fileCount":17,"integrity":"sha512-QwCZIHXlcoq9FSIA6/rYCObarn6E4u/LvEoRUCpoy5A52StlX0CUsmj4XluJAhY2cHi/Wadi+5sNMr0EWILhgg==","signatures":[{"sig":"MEQCIAdhXGOdfKeeRwtNnvavGFF+9hFjJS3i/N7O5FyjKSIjAiBOFyvcSgnWBPaOj4MXdaBZ9g1XGh5dPm3bhSBoebH/ow==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@eggjs%2ftransaction-decorator@4.0.2-beta.13","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":7928,"size":3054,"noattachment":false,"key":"/@eggjs/transaction-decorator/-/@eggjs/transaction-decorator-4.0.2-beta.13.tgz"},"main":"./dist/index.js","type":"module","_from":"file:eggjs-transaction-decorator-4.0.2-beta.13.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.18.0"},"exports":{".":"./dist/index.js","./package.json":"./package.json"},"scripts":{"typecheck":"tsgo --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1fb60ca7-4b12-4519-9444-0d11e9d13cc9"}},"_resolved":"/tmp/18af834d3ebdfffa10ad065aaddb82c4/eggjs-transaction-decorator-4.0.2-beta.13.tgz","_integrity":"sha512-QwCZIHXlcoq9FSIA6/rYCObarn6E4u/LvEoRUCpoy5A52StlX0CUsmj4XluJAhY2cHi/Wadi+5sNMr0EWILhgg==","repository":{"url":"git+https://github.com/eggjs/egg.git","type":"git","directory":"tegg/core/transaction-decorator"},"_npmVersion":"11.13.0","description":"tegg transaction decorator","directories":{},"_nodeVersion":"24.16.0","dependencies":{"@eggjs/tegg-types":"4.0.2-beta.13","@eggjs/core-decorator":"4.0.2-beta.13"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.9.3","@types/node":"^24.10.2"},"_npmOperationalInternal":{"tmp":"tmp/transaction-decorator_4.0.2-beta.13_1782289627109_0.526416610316228","host":"s3://npm-registry-packages-npm-production"},"readme":"# @eggjs/transaction-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/transaction-decorator.svg?style=flat)](https://nodejs.org/en/download/)\n\n[npm-image]: https://img.shields.io/npm/v/@eggjs/transaction-decorator.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/@eggjs/transaction-decorator\n[snyk-image]: https://snyk.io/test/npm/@eggjs/transaction-decorator/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/@eggjs/transaction-decorator\n[download-image]: https://img.shields.io/npm/dm/@eggjs/transaction-decorator.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@eggjs/transaction-decorator\n\n事务注解\n\n## Usage\n\n### 传播机制\n\n```ts\nexport class Foo {\n  @Transactional({ propagation: PropagationType.ALWAYS_NEW })\n  async bar() {\n    await this.foo();\n  }\n\n  @Transactional({ propagation: PropagationType.REQUIRED })\n  async foo(msg) {\n    console.log('has msg: ', msg);\n  }\n}\n```\n\n### 数据源\n\n```ts\nexport class Bar {\n  @Transactional({ dataSourceName: 'xx' })\n  async bar() {\n    await this.foo();\n  }\n}\n```\n\nFoo.bar 始终会在一个独立的事务中执行，而 Foo.foo 会在 Foo.bar 的事务中执行\n","publish_time":1782289627242,"_cnpm_publish_time":1782289627242,"dist-tags":{"beta":"4.0.2-beta.27","latest":"4.1.0","rc":"4.0.2-rc.1"}}