{"_id":"@damatjs/jobs","_rev":"7-d03cbb62bafaf3b3d6b193640f080303","name":"@damatjs/jobs","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"@damatjs/jobs","version":"1.0.0","author":{"name":"Abel Lamesgen"},"license":"MIT","_id":"@damatjs/jobs@1.0.0","maintainers":[{"name":"abeltyr","email":"abeltyr@gmail.com"}],"homepage":"https://github.com/damatjs/damat#readme","bugs":{"url":"https://github.com/damatjs/damat/issues"},"dist":{"shasum":"a3348851c0f79d1bd931b722700d1c4ed2cde6ea","tarball":"https://registry.npmjs.org/@damatjs/jobs/-/jobs-1.0.0.tgz","fileCount":618,"integrity":"sha512-ZvBlpp2iGbVJUJBd2Oqrt9RQzmrDOqAvdGHBK4A3jd0cnJZmX2UtDUKyp5rl7XGJY4AyIIRfbuJctQ7CldHWVQ==","signatures":[{"sig":"MEQCIALX/oXrvcGJf+7DsC+bQzL2v36hV/q3n/29RyO0833LAiBIRdV5awnHMIDjDEKgLcP1jpNiKkXm4sizHZgZiK0Rpw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@damatjs%2fjobs@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":424932},"main":"dist/index.js","type":"module","_from":"file:/tmp/damat-publish-rLt7Ae/damatjs-jobs-1.0.0.tgz","types":"dist/index.d.ts","engines":{"bun":">=1.1.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./migrations":{"types":"./dist/migrations/index.d.ts","default":"./dist/migrations/index.js"},"./pipeline-integration":{"types":"./dist/pipeline-integration.d.ts","default":"./dist/pipeline-integration.js"}},"scripts":{"lint":"oxlint src","test":"bun ../../../scripts/test/package.ts DAMAT_JOBS_DATABASE_URL --max-concurrency=1","build":"rm -rf tsconfig.tsbuildinfo dist && tsc","watch":"tsc --watch","prepublishOnly":"test -f dist/index.js || (echo 'Error: dist/index.js not found. Run bun run build first.' && exit 1)"},"_npmUser":{"name":"abeltyr","email":"abeltyr@gmail.com"},"_resolved":"/tmp/damat-publish-rLt7Ae/damatjs-jobs-1.0.0.tgz","_integrity":"sha512-ZvBlpp2iGbVJUJBd2Oqrt9RQzmrDOqAvdGHBK4A3jd0cnJZmX2UtDUKyp5rl7XGJY4AyIIRfbuJctQ7CldHWVQ==","repository":{"url":"git+https://github.com/damatjs/damat.git","type":"git","directory":"packages/core/jobs"},"_npmVersion":"10.9.8","description":"Durable PostgreSQL background jobs and fenced workers for Damat apps","directories":{},"_nodeVersion":"22.23.1","dependencies":{"@damatjs/deps":"1.0.0","@damatjs/logger":"1.0.0","@damatjs/durability":"1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"1.3.9","typescript":"^5.9.3","@damatjs/typescript-config":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jobs_1.0.0_1784709578059_0.0320965155200299","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@damatjs/jobs","version":"1.0.1","author":{"name":"Abel Lamesgen"},"license":"MIT","_id":"@damatjs/jobs@1.0.1","maintainers":[{"name":"abeltyr","email":"abeltyr@gmail.com"}],"homepage":"https://github.com/damatjs/damat#readme","bugs":{"url":"https://github.com/damatjs/damat/issues"},"dist":{"shasum":"05825f841776f10a3b3673dedd2a8130ddc3fac4","tarball":"https://registry.npmjs.org/@damatjs/jobs/-/jobs-1.0.1.tgz","fileCount":618,"integrity":"sha512-y67HImwbwIPCRhNOXVRMwI59nukmT7y/bxqT6o/TQUrBwy4TYZjWenYWymIzfPefruTIth3dIIR9f3K/7hH04g==","signatures":[{"sig":"MEUCICABddL7D6DwD1YF9/s3lNdT4C28sgPewpQaTlzy+F/jAiEAmrtnYX4ZC41R5QwgvaHVrnqslRmPYR9J9S79lD4ZkU8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@damatjs%2fjobs@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":424932},"main":"dist/index.js","type":"module","_from":"file:/tmp/damat-publish-BnWRsi/damatjs-jobs-1.0.1.tgz","types":"dist/index.d.ts","engines":{"bun":">=1.1.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./migrations":{"types":"./dist/migrations/index.d.ts","default":"./dist/migrations/index.js"},"./pipeline-integration":{"types":"./dist/pipeline-integration.d.ts","default":"./dist/pipeline-integration.js"}},"scripts":{"lint":"oxlint src","test":"bun ../../../scripts/test/package.ts DAMAT_JOBS_DATABASE_URL --max-concurrency=1","build":"rm -rf tsconfig.tsbuildinfo dist && tsc","watch":"tsc --watch","prepublishOnly":"test -f dist/index.js || (echo 'Error: dist/index.js not found. Run bun run build first.' && exit 1)"},"_npmUser":{"name":"abeltyr","email":"abeltyr@gmail.com"},"_resolved":"/tmp/damat-publish-BnWRsi/damatjs-jobs-1.0.1.tgz","_integrity":"sha512-y67HImwbwIPCRhNOXVRMwI59nukmT7y/bxqT6o/TQUrBwy4TYZjWenYWymIzfPefruTIth3dIIR9f3K/7hH04g==","repository":{"url":"git+https://github.com/damatjs/damat.git","type":"git","directory":"packages/core/jobs"},"_npmVersion":"10.9.8","description":"Durable PostgreSQL background jobs and fenced workers for Damat apps","directories":{},"_nodeVersion":"22.23.1","dependencies":{"@damatjs/deps":"1.0.1","@damatjs/logger":"1.0.1","@damatjs/durability":"1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"1.3.9","typescript":"^5.9.3","@damatjs/typescript-config":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jobs_1.0.1_1784795822960_0.7869456570921518","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@damatjs/jobs","version":"1.0.2","author":{"name":"Abel Lamesgen"},"license":"MIT","_id":"@damatjs/jobs@1.0.2","maintainers":[{"name":"abeltyr","email":"abeltyr@gmail.com"}],"homepage":"https://github.com/damatjs/damat#readme","bugs":{"url":"https://github.com/damatjs/damat/issues"},"dist":{"shasum":"a76cf2bf71a8e35a93a8cd0107a01352635cba07","tarball":"https://registry.npmjs.org/@damatjs/jobs/-/jobs-1.0.2.tgz","fileCount":618,"integrity":"sha512-+AlWCYyub0xxlM4u/j8nvbGRkj7T5JZ2wKf6eW65ZrACLlcWwdfGhHyVIj/nUQl0SqMSNB6rIjf6VOqaZjCssQ==","signatures":[{"sig":"MEUCIQDBgBA2JLIpRSVTNvkmEheTcwnl0NYCcL1uNcLTic59XgIgfscWMUt27qqVE1Fi5MeWst154wvCk1y1U95WLlI0MjI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@damatjs%2fjobs@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":425092},"main":"dist/index.js","type":"module","_from":"file:/tmp/damat-publish-487F86/damatjs-jobs-1.0.2.tgz","types":"dist/index.d.ts","engines":{"bun":">=1.1.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./migrations":{"types":"./dist/migrations/index.d.ts","default":"./dist/migrations/index.js"},"./pipeline-integration":{"types":"./dist/pipeline-integration.d.ts","default":"./dist/pipeline-integration.js"}},"scripts":{"lint":"oxlint src","test":"bun ../../../scripts/test/package.ts DAMAT_JOBS_DATABASE_URL --max-concurrency=1","build":"rm -rf tsconfig.tsbuildinfo dist && tsc","watch":"tsc --watch","prepublishOnly":"test -f dist/index.js || (echo 'Error: dist/index.js not found. Run bun run build first.' && exit 1)"},"_npmUser":{"name":"abeltyr","email":"abeltyr@gmail.com"},"_resolved":"/tmp/damat-publish-487F86/damatjs-jobs-1.0.2.tgz","_integrity":"sha512-+AlWCYyub0xxlM4u/j8nvbGRkj7T5JZ2wKf6eW65ZrACLlcWwdfGhHyVIj/nUQl0SqMSNB6rIjf6VOqaZjCssQ==","repository":{"url":"git+https://github.com/damatjs/damat.git","type":"git","directory":"packages/core/jobs"},"_npmVersion":"10.9.8","description":"Durable PostgreSQL background jobs and fenced workers for Damat apps","directories":{},"_nodeVersion":"22.23.1","dependencies":{"@damatjs/deps":"1.0.1","@damatjs/logger":"1.0.1","@damatjs/durability":"1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"1.3.9","typescript":"^5.9.3","@damatjs/typescript-config":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jobs_1.0.2_1784819359848_0.4735710723096973","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@damatjs/jobs","version":"1.0.3","author":{"name":"Abel Lamesgen"},"license":"MIT","_id":"@damatjs/jobs@1.0.3","maintainers":[{"name":"abeltyr","email":"abeltyr@gmail.com"}],"homepage":"https://github.com/damatjs/damat#readme","bugs":{"url":"https://github.com/damatjs/damat/issues"},"dist":{"shasum":"3aa683dd43f55248cccca4bcb1e041a4577c3e57","tarball":"https://registry.npmjs.org/@damatjs/jobs/-/jobs-1.0.3.tgz","fileCount":618,"integrity":"sha512-hqUmhBy79nEL8SqayW8HlTg6Lcp77uH5R10ZoyuAvttiTcQ3d3nFn8p9WkGf6f4mr/gJiqSOeQYKrycZEA/qog==","signatures":[{"sig":"MEQCIF9CsmthtahaGOWl/kLnZnd5XbFmrVo7YeR1TbwRosa2AiA6l8hAzpojyBOA3m4AbUeiyf2tOaCzT72Ck3E9q4XYRg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@damatjs%2fjobs@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":425092},"main":"dist/index.js","type":"module","_from":"file:/tmp/damat-publish-9lh99O/damatjs-jobs-1.0.3.tgz","types":"dist/index.d.ts","engines":{"bun":">=1.1.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./migrations":{"types":"./dist/migrations/index.d.ts","default":"./dist/migrations/index.js"},"./pipeline-integration":{"types":"./dist/pipeline-integration.d.ts","default":"./dist/pipeline-integration.js"}},"scripts":{"lint":"oxlint src","test":"bun ../../../scripts/test/package.ts DAMAT_JOBS_DATABASE_URL --max-concurrency=1","build":"rm -rf tsconfig.tsbuildinfo dist && tsc","watch":"tsc --watch","prepublishOnly":"test -f dist/index.js || (echo 'Error: dist/index.js not found. Run bun run build first.' && exit 1)"},"_npmUser":{"name":"abeltyr","email":"abeltyr@gmail.com"},"_resolved":"/tmp/damat-publish-9lh99O/damatjs-jobs-1.0.3.tgz","_integrity":"sha512-hqUmhBy79nEL8SqayW8HlTg6Lcp77uH5R10ZoyuAvttiTcQ3d3nFn8p9WkGf6f4mr/gJiqSOeQYKrycZEA/qog==","repository":{"url":"git+https://github.com/damatjs/damat.git","type":"git","directory":"packages/core/jobs"},"_npmVersion":"10.9.8","description":"Durable PostgreSQL background jobs and fenced workers for Damat apps","directories":{},"_nodeVersion":"22.23.1","dependencies":{"@damatjs/deps":"1.0.3","@damatjs/logger":"1.0.3","@damatjs/durability":"1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"1.3.9","typescript":"^5.9.3","@damatjs/typescript-config":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jobs_1.0.3_1784835813369_0.4657135312002383","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@damatjs/jobs","version":"1.0.4","author":{"name":"Abel Lamesgen"},"license":"MIT","_id":"@damatjs/jobs@1.0.4","maintainers":[{"name":"abeltyr","email":"abeltyr@gmail.com"}],"homepage":"https://github.com/damatjs/damat#readme","bugs":{"url":"https://github.com/damatjs/damat/issues"},"dist":{"shasum":"b212bc4c9fa6eb1bb95820dea5edd511710908d1","tarball":"https://registry.npmjs.org/@damatjs/jobs/-/jobs-1.0.4.tgz","fileCount":622,"integrity":"sha512-dU4AzbItJQDoGviZO2Qn/hxoLzeUiv0fE5echeeKUxraHfyIktjkGKKWey33R3NnRzDmPjD/U3O+x7B3y4+DSQ==","signatures":[{"sig":"MEYCIQC85llvFjZqPpHTaJaIgFnnDC1o0xaKvrEmNowRTdPvuQIhAMNXiMs4S4MVZu3w7xEg7P9ggb5kuAEzwwhx2O0SYyZ3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@damatjs%2fjobs@1.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":428697},"main":"dist/index.js","type":"module","_from":"file:/tmp/damat-publish-kNzZ3H/damatjs-jobs-1.0.4.tgz","types":"dist/index.d.ts","engines":{"bun":">=1.1.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./migrations":{"types":"./dist/migrations/index.d.ts","default":"./dist/migrations/index.js"},"./pipeline-integration":{"types":"./dist/pipeline-integration.d.ts","default":"./dist/pipeline-integration.js"}},"scripts":{"lint":"oxlint src","test":"bun ../../../scripts/test/package.ts DAMAT_JOBS_DATABASE_URL --max-concurrency=1","build":"rm -rf tsconfig.tsbuildinfo dist && tsc","watch":"tsc --watch","prepublishOnly":"test -f dist/index.js || (echo 'Error: dist/index.js not found. Run bun run build first.' && exit 1)"},"_npmUser":{"name":"abeltyr","email":"abeltyr@gmail.com"},"_resolved":"/tmp/damat-publish-kNzZ3H/damatjs-jobs-1.0.4.tgz","_integrity":"sha512-dU4AzbItJQDoGviZO2Qn/hxoLzeUiv0fE5echeeKUxraHfyIktjkGKKWey33R3NnRzDmPjD/U3O+x7B3y4+DSQ==","repository":{"url":"git+https://github.com/damatjs/damat.git","type":"git","directory":"packages/core/jobs"},"_npmVersion":"10.9.8","description":"Durable PostgreSQL background jobs and fenced workers for Damat apps","directories":{},"_nodeVersion":"22.23.1","dependencies":{"@damatjs/deps":"1.0.4","@damatjs/logger":"1.0.4","@damatjs/durability":"1.0.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"1.3.9","typescript":"^5.9.3","@damatjs/typescript-config":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jobs_1.0.4_1785070673635_0.5534846489804686","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@damatjs/jobs","version":"1.0.5","author":{"name":"Abel Lamesgen"},"license":"MIT","_id":"@damatjs/jobs@1.0.5","maintainers":[{"name":"abeltyr","email":"abeltyr@gmail.com"}],"homepage":"https://github.com/damatjs/damat#readme","bugs":{"url":"https://github.com/damatjs/damat/issues"},"dist":{"shasum":"3e2bf34c975c274521ecc7f8a6bae1e986c28a3d","tarball":"https://registry.npmjs.org/@damatjs/jobs/-/jobs-1.0.5.tgz","fileCount":622,"integrity":"sha512-Iwm7KAmj5+5aIS33KVeRaJCq7lMVyT/cN4J3yk/pWfd9W1v45VqjpaKf7BPBIgHNVDaagS6NBDOPOfyKQe9mmA==","signatures":[{"sig":"MEQCIE37zXGVf6OS7osmWY6PIDfQMbPHbesXGpdwS57pRZVKAiBo0dmPebuGTNGstgRB85+LUZ021i6zQJLyAWI7emWi4A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@damatjs%2fjobs@1.0.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":428697},"main":"dist/index.js","type":"module","_from":"file:/tmp/damat-publish-4y9xyF/damatjs-jobs-1.0.5.tgz","types":"dist/index.d.ts","engines":{"bun":">=1.1.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./migrations":{"types":"./dist/migrations/index.d.ts","default":"./dist/migrations/index.js"},"./pipeline-integration":{"types":"./dist/pipeline-integration.d.ts","default":"./dist/pipeline-integration.js"}},"scripts":{"lint":"oxlint src","test":"bun ../../../scripts/test/package.ts DAMAT_JOBS_DATABASE_URL --max-concurrency=1","build":"rm -rf tsconfig.tsbuildinfo dist && tsc","watch":"tsc --watch","prepublishOnly":"test -f dist/index.js || (echo 'Error: dist/index.js not found. Run bun run build first.' && exit 1)"},"_npmUser":{"name":"abeltyr","email":"abeltyr@gmail.com"},"_resolved":"/tmp/damat-publish-4y9xyF/damatjs-jobs-1.0.5.tgz","_integrity":"sha512-Iwm7KAmj5+5aIS33KVeRaJCq7lMVyT/cN4J3yk/pWfd9W1v45VqjpaKf7BPBIgHNVDaagS6NBDOPOfyKQe9mmA==","repository":{"url":"git+https://github.com/damatjs/damat.git","type":"git","directory":"packages/core/jobs"},"_npmVersion":"10.9.8","description":"Durable PostgreSQL background jobs and fenced workers for Damat apps","directories":{},"_nodeVersion":"22.23.1","dependencies":{"@damatjs/deps":"1.0.5","@damatjs/logger":"1.0.5","@damatjs/durability":"1.0.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"1.3.9","typescript":"^5.9.3","@damatjs/typescript-config":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jobs_1.0.5_1785252053662_0.8732613087057757","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@damatjs/jobs","description":"Durable PostgreSQL background jobs and fenced workers for Damat apps","version":"1.0.6","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./migrations":{"types":"./dist/migrations/index.d.ts","default":"./dist/migrations/index.js"},"./pipeline-integration":{"types":"./dist/pipeline-integration.d.ts","default":"./dist/pipeline-integration.js"}},"engines":{"bun":">=1.1.0"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/damatjs/damat.git","directory":"packages/core/jobs"},"license":"MIT","author":{"name":"Abel Lamesgen"},"dependencies":{"@damatjs/deps":"1.0.6","@damatjs/durability":"1.0.6","@damatjs/logger":"1.0.6"},"devDependencies":{"@damatjs/typescript-config":"0.0.1","@types/bun":"1.3.9","typescript":"^5.9.3"},"scripts":{"build":"rm -rf tsconfig.tsbuildinfo dist && tsc","watch":"tsc --watch","test":"bun ../../../scripts/test/package.ts DAMAT_JOBS_DATABASE_URL --max-concurrency=1","lint":"oxlint src","prepublishOnly":"test -f dist/index.js || (echo 'Error: dist/index.js not found. Run bun run build first.' && exit 1)"},"_id":"@damatjs/jobs@1.0.6","bugs":{"url":"https://github.com/damatjs/damat/issues"},"homepage":"https://github.com/damatjs/damat#readme","_integrity":"sha512-q/J9acQTkZ+Dn8C3PDDl25zZVaQqCGpDn2ZXzSZNiu5u1LmPlfvwmVHIT+pL584wxjsRD1qjORuJQCL08a0qQQ==","_resolved":"/tmp/damat-publish-95eWXm/damatjs-jobs-1.0.6.tgz","_from":"file:/tmp/damat-publish-95eWXm/damatjs-jobs-1.0.6.tgz","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-q/J9acQTkZ+Dn8C3PDDl25zZVaQqCGpDn2ZXzSZNiu5u1LmPlfvwmVHIT+pL584wxjsRD1qjORuJQCL08a0qQQ==","shasum":"add5b7693e76e02166538140f696a8eb32820526","tarball":"https://registry.npmjs.org/@damatjs/jobs/-/jobs-1.0.6.tgz","fileCount":626,"unpackedSize":430709,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@damatjs%2fjobs@1.0.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICbK3vxWUhBBnS6qofM8mRfl24mnosVykW/BmzFdBx0aAiEAvWWJLPGcqCl4FMVWc6pJ6qFTGJhk35TR6Pkp2BOTVGM="}]},"_npmUser":{"name":"abeltyr","email":"abeltyr@gmail.com"},"directories":{},"maintainers":[{"name":"abeltyr","email":"abeltyr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/jobs_1.0.6_1786390123507_0.29030513594537677"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-22T08:39:37.855Z","modified":"2026-08-10T19:28:44.079Z","1.0.0":"2026-07-22T08:39:38.213Z","1.0.1":"2026-07-23T08:37:03.117Z","1.0.2":"2026-07-23T15:09:19.981Z","1.0.3":"2026-07-23T19:43:33.559Z","1.0.4":"2026-07-26T12:57:53.796Z","1.0.5":"2026-07-28T15:20:53.821Z","1.0.6":"2026-08-10T19:28:43.672Z"},"bugs":{"url":"https://github.com/damatjs/damat/issues"},"author":{"name":"Abel Lamesgen"},"license":"MIT","homepage":"https://github.com/damatjs/damat#readme","repository":{"type":"git","url":"git+https://github.com/damatjs/damat.git","directory":"packages/core/jobs"},"description":"Durable PostgreSQL background jobs and fenced workers for Damat apps","maintainers":[{"name":"abeltyr","email":"abeltyr@gmail.com"}],"readme":"# @damatjs/jobs\n\nDurable PostgreSQL background jobs for Damat applications.\n\nJobs persist their run, retry policy, attempts, progress, structured logs,\nactivity, cancellation, result, and errors. Workers use fenced leases and\n`FOR UPDATE SKIP LOCKED`, so several processes can safely poll the same queue.\n\n## Install and migrate\n\n```bash\nbun add @damatjs/jobs\ndamat-orm migrate:up\n```\n\nFramework applications configure `projectConfig.databaseUrl` and\n`services.jobs`. Redis is not required. Optional Redis wake-ups reduce polling\nlatency without becoming the source of truth.\n\nJob tables are framework-owned relations in the PostgreSQL `damat` schema.\nRun the package migration before starting workers; the ordered relocation\nmigration moves existing job tables from `public` without changing their names.\n\n## Define and enqueue\n\n```ts\nimport { defineJob, enqueueJob } from \"@damatjs/jobs\";\n\ndeclare module \"@damatjs/jobs\" {\n  interface JobMap {\n    \"send-welcome\": { userId: string };\n  }\n}\n\ndefineJob(\n  \"send-welcome\",\n  async ({ userId }, context) => {\n    await context.progress(25, { phase: \"render\" });\n    await context.log(\"info\", \"Sending welcome\", { userId });\n    await mailer.sendWelcome(userId);\n    return { sent: true };\n  },\n  { queue: \"mail\", maxAttempts: 5, backoffMs: 2_000 },\n);\n\nconst run = await enqueueJob(\n  \"send-welcome\",\n  { userId: \"u1\" },\n  {\n    priority: 10,\n    metadata: { source: \"signup\" },\n  },\n);\n```\n\n`enqueueJob` may receive an active durability transaction executor so the\ndomain write and enqueue commit together. Without one it uses the configured\ndurability client. PostgreSQL calculates relative enqueue delays from its own\nclock, so immediate jobs remain claimable when an application host's wall clock\ndiffers slightly from the database.\n\n## Schedule jobs\n\n```ts\nimport { createJobSchedule, listJobSchedules } from \"@damatjs/jobs\";\n\nawait createJobSchedule({\n  name: \"daily-cleanup\",\n  jobName: \"cleanup\",\n  payload: {},\n  schedule: { kind: \"interval\", everyMs: 86_400_000 },\n});\n\nconst schedules = await listJobSchedules({ enabled: true });\n```\n\nOne-time and fixed-interval schedules are supported. Cron is rejected. Each\noccurrence and the schedule's next occurrence advance in one transaction.\nUnique schedule/time identities make overlapping reconcilers idempotent.\nOptional schedule deduplication suppresses runs until its TTL expires.\n\n## Run a worker\n\n```ts\nimport { JobWorker } from \"@damatjs/jobs\";\n\nconst worker = new JobWorker({\n  queue: \"mail\",\n  concurrency: 4,\n  pollIntervalMs: 5_000,\n  registryHeartbeatIntervalMs: 30_000,\n});\n\nworker.start();\nawait worker.stop({ graceMs: 30_000 });\n```\n\nFramework apps normally use:\n\n```ts\nprojectConfig: {\n  databaseUrl: process.env.DATABASE_URL,\n},\nservices: {\n  jobs: { queue: \"mail\", concurrency: 4 },\n},\nruntime: {\n  mode: \"worker\", // or \"all\" to serve HTTP too\n  workers: [\"jobs\"],\n},\n```\n\nThe framework defaults to `runtime.mode: \"all\"` and selects enabled durable\ncapabilities, so the `runtime` block can be omitted when one process serves HTTP\nand jobs. A dedicated worker deployment can instead set\n`DAMAT_RUNTIME_MODE=worker` and `DAMAT_WORKER_TYPES=jobs` without changing the\napplication build.\n\nThe worker starts after modules register their definitions and after PostgreSQL\nmigration readiness succeeds. Calling `start()`\nagain while that worker is running is idempotent. A worker instance is one-shot:\nafter stop begins, another `start()` throws synchronously; construct a new\nworker to run again. `stop()` stops new claims, marks the worker as stopping,\nwaits up to the grace period, then aborts unfinished handler signals and stops\nrenewing their leases. Shutdown and terminal transitions wait for an in-flight\nrenewal to settle, so no heartbeat can extend a lease after either boundary\nreturns. The registry remains `stopping` while handler code is\nstill running and changes to `stopped` only after it settles and PostgreSQL\npersists that transition. Persistence failures reject `stop()` and a later\n`stop()` retries them. Registry heartbeats and reconciliation remain active\nthrough the graceful drain phase, then quiesce before the worker persists its\nfinal `stopped` transition.\n\nThe worker also owns bounded lease, retry, schedule, idempotency, and retention\nreconciliation. Expired leases, not worker-registry state, decide recovery.\nRecovery activity retains the expired worker and lease token. An immediately\nreclaimed run records that recovery to `queued`, then records a separate claim\nfor the new worker and token.\nFramework-managed workers use Redis wake-ups while healthy and perform a\nPostgreSQL safety scan every 30 seconds. If Redis is missing or unauthorized,\nthe shared coordinator falls back to PostgreSQL discovery within five seconds.\nStandalone workers default to five-second PostgreSQL polling.\n\nConfigure enqueue-side wake-ups with `configureJobWakeupPublisher(redis)` and\npass a Redis-compatible client as `wakeupRedis` to a worker. The worker uses a\ndedicated duplicated subscriber. Missing Redis, malformed messages, and\npublish failures only reduce responsiveness to the polling interval. Subscriber\nconnection errors are handled through structured warnings rather than escaping\nas raw unhandled Redis events. Mutations inside a caller-owned transaction do\nnot publish directly. They still write a\ntransactional acceleration-outbox row; the framework relay publishes it only\nafter the outer transaction commits.\n\nWorker options are validated when the worker is constructed. Queue and supplied\nworker IDs must be non-empty, concurrency and log limits must be positive\nintegers, timing values must be finite and positive, and the progress interval\nmay also be zero. The job heartbeat must be shorter than its lease. Registry\nheartbeats default to durable snapshots every 30 seconds and are capped at 120\nseconds. Framework Redis liveness expires after 10 seconds; inspection treats\nPostgreSQL snapshots as stale after 90 seconds by default. Concurrency is capped\nat PostgreSQL's signed 32-bit maximum;\ntimers are capped at 2,147,483,647 ms; log limits must be safe integers.\n`stop({ graceMs })` applies the same timer ceiling and accepts zero for an\nimmediate abort.\n\n## Delivery semantics\n\n- Delivery is at least once; handlers should make side effects idempotent.\n- Claims, attempts, and activity are created in one transaction.\n- Every heartbeat and terminal transition matches run, worker, lease token,\n  and lease expiry. A stale worker cannot finish reclaimed work.\n- Failures use persisted exponential backoff and become dead letters after the\n  final attempt. An invalid or overflowing retry date dead-letters rather than\n  retaining a stuck lease. Unknown definitions dead-letter immediately.\n- Queued work cancels immediately. Running cancellation reaches the handler\n  through `context.signal`; completion also rechecks the request atomically.\n- Handler results must be JSON-safe. Invalid results fail visibly through the\n  normal retry/dead-letter path.\n- Terminal activity includes the latest persisted progress snapshot. Structured\n  log byte limits use the same PostgreSQL `jsonb` representation that is stored.\n\n## Inspection and administration\n\nPipeline-created jobs carry internal `_damatPipeline` ownership metadata. Their\nfenced terminal transaction writes a pipeline acceleration-outbox signal in the\nsame commit, so the graph router cannot observe a completion that PostgreSQL did\nnot commit. Ordinary job retention excludes these runs: pipeline retention\ndeletes the owning node records, complete child tree, and backing jobs together.\nThe framework integration hook lives at `@damatjs/jobs/pipeline-integration`;\napplications should use pipeline clients rather than replacing that hook.\n\nThe package exposes a typed headless client rather than unauthenticated routes:\n\n```ts\nimport { createJobInspectionClient } from \"@damatjs/jobs\";\n\nconst jobs = createJobInspectionClient({\n  cursorSigningKey: process.env.INSPECTION_CURSOR_KEY!,\n  visibility: \"metadata\",\n  redaction: { keys: [\"token\", \"password\"] },\n});\n\nconst page = await jobs.listRuns({\n  views: [\"processing\", \"failed\"],\n  limit: 50,\n});\nconst detail = await jobs.getRun(page.items[0]!.id);\n```\n\nLists use signed timestamp-and-UUID cursors. Native statuses remain unchanged;\n`upcoming`, `processing`, `retrying`, `failed`, and `completed` are derived\nviews, while recovery is an independent flag. Detail reads use one\nrepeatable-read snapshot and include attempts, activity, logs, leases, workers,\nqueue controls, and schedule history. Visibility defaults to `metadata`;\npayload and result access requires `full`. Queue-control history returns at most\n500 entries and sets `controlHistoryTruncated` when more records exist.\n\nOperational summaries measure queue wait from `availableAt`, so intentional\nschedule delay is excluded, and attribute the sample to its half-open\nattempt-start window. Every immutable attempt captures `availableAt` and\n`waitMs` atomically from the run's current availability, preserving retry\nwaits. Legacy attempts keep unknown timing omitted and are excluded from\ndistributions rather than treated as zero. Capacity includes active workers\nonly; active and stale counts plus heartbeat diagnostics exclude stopping and\nstopped workers.\nActive and stale per-worker records expose capabilities, state, concurrency,\nin-flight load, and heartbeat age; stopped and stopping history is excluded.\nApplication and deployment metadata follow inspection visibility and redaction.\nThroughput rows are grouped by bucket, queue, and job name.\nConfigured redaction also applies to grouped failure messages.\n\nBounded summaries expose current status, wait, lease, worker, and dead-letter\nstate plus half-open time-window throughput, activity, and duration metrics.\nAdministrative cancellation, retry, queue pause/resume, schedule enable/disable,\nand retention require a validated actor and append immutable audit history.\nApplications decide how to authenticate and present these records.\n\nRetention defaults to 90 days and accepts `\"forever\"`. PostgreSQL keeps the\ncomplete inspection timeline; Redis stores only rebuildable ready identifiers,\nworker liveness, and invalidation signals.\n\n## Public definition API\n\n`JobMap`, `defineJob`, `getJobDefinition`, `getAllJobDefinitions`, and\n`clearJobDefinitions` use one process-wide registry. Raw Redis queue access is\nnot part of the jobs API.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}