{"_id":"@ahmetskilinc/sync-core","_rev":"4-fb1e49b80a949e6fa0e7daf24e54c4dc","name":"@ahmetskilinc/sync-core","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@ahmetskilinc/sync-core","version":"0.1.0","keywords":["sync","realtime","local-first","offline-first","schema"],"license":"MIT","_id":"@ahmetskilinc/sync-core@0.1.0","maintainers":[{"name":"ahmetskilinc","email":"ahmetskilinc@icloud.com"}],"homepage":"https://github.com/ahmetskilinc/sync-engine#readme","bugs":{"url":"https://github.com/ahmetskilinc/sync-engine/issues"},"dist":{"shasum":"32488e13c543fdbc8bc23c71d9db2a7cd7629223","tarball":"https://registry.npmjs.org/@ahmetskilinc/sync-core/-/sync-core-0.1.0.tgz","fileCount":13,"integrity":"sha512-dMx9uAjvITSmJ1TPPTdN2PSXcdJJOkj4br7Bx0EJoU+wIb56nNevdT6J4+NNNv7ygHCyGn3mj9zPc2Y635OGJw==","signatures":[{"sig":"MEUCIQCw2/ginKC8vwQjEx4Woxf7RgmetrVlYdaUvDKYvDZZZwIgLsxPc3fUB6mL3Tdp29gEyK9LTmj295eDg1j1odL2Imw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19858},"main":"./dist/index.js","type":"module","_from":"file:packages/core/ahmetskilinc-sync-core-0.1.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -b","prepublishOnly":"bunx tsc -b"},"_npmUser":{"name":"ahmetskilinc","email":"ahmetskilinc@icloud.com"},"_resolved":"/Users/ahmetkilinc/Developer/sync-engine/packages/core/ahmetskilinc-sync-core-0.1.0.tgz","_integrity":"sha512-dMx9uAjvITSmJ1TPPTdN2PSXcdJJOkj4br7Bx0EJoU+wIb56nNevdT6J4+NNNv7ygHCyGn3mj9zPc2Y635OGJw==","repository":{"url":"git+https://github.com/ahmetskilinc/sync-engine.git","type":"git","directory":"packages/core"},"_npmVersion":"11.6.2","description":"Schema builder and wire protocol for the sync-engine realtime sync toolkit","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sync-core_0.1.0_1785253940233_0.004260044285777198","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@ahmetskilinc/sync-core","version":"0.2.0","keywords":["sync","realtime","local-first","offline-first","schema"],"license":"MIT","_id":"@ahmetskilinc/sync-core@0.2.0","maintainers":[{"name":"ahmetskilinc","email":"ahmetskilinc@icloud.com"}],"dist":{"shasum":"dbf1087acc009b131d91f2950cfb0ae11e8833db","tarball":"https://registry.npmjs.org/@ahmetskilinc/sync-core/-/sync-core-0.2.0.tgz","fileCount":13,"integrity":"sha512-yx5V8rSzeDvOE1lH13ptKMcCA+i44+TaoeH7qbAnKAh5JFjaRaPvwxl3dAkaS92lNvxtEK/z9qpxAytb8dSXjA==","signatures":[{"sig":"MEUCICLgXDWddm+Yc6qDn6sJjsSsFRUbVxVPrORBQE6IwQZMAiEAlN4wq8ts2Mj0RSfxmuIbqVknCdSm6KBT1hqj6YQ8eiE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20195},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","shasum":"dbf1087acc009b131d91f2950cfb0ae11e8833db","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -b","prepublishOnly":"bunx tsc -b"},"_npmUser":{"name":"ahmetskilinc","email":"ahmetskilinc@icloud.com"},"_integrity":"sha512-yx5V8rSzeDvOE1lH13ptKMcCA+i44+TaoeH7qbAnKAh5JFjaRaPvwxl3dAkaS92lNvxtEK/z9qpxAytb8dSXjA==","repository":{"url":"git+https://github.com/ahmetskilinc/sync-engine.git","type":"git","directory":"packages/core"},"_npmVersion":"10.8.3","description":"Schema builder and wire protocol for the sync-engine realtime sync toolkit","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sync-core_0.2.0_1785257730240_0.5824040208381875","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@ahmetskilinc/sync-core","version":"0.3.0","keywords":["sync","realtime","local-first","offline-first","schema"],"author":{"name":"Ahmet Kilinc"},"license":"MIT","_id":"@ahmetskilinc/sync-core@0.3.0","maintainers":[{"name":"ahmetskilinc","email":"ahmetskilinc@icloud.com"}],"homepage":"https://github.com/ahmetskilinc/sync-engine#readme","bugs":{"url":"https://github.com/ahmetskilinc/sync-engine/issues"},"dist":{"shasum":"c971859bd2752a8c5ae611462fd6cdc6a5060fba","tarball":"https://registry.npmjs.org/@ahmetskilinc/sync-core/-/sync-core-0.3.0.tgz","fileCount":18,"integrity":"sha512-RRn1L24Dt0nbX0dB529SBL6vwZmYO2lP0QD1N3UHyBrsdBQ+aGqg9M2A/cSaIP7+RDeoOLjSU19c01GGcBpyMA==","signatures":[{"sig":"MEYCIQCSqpH+JKpMNT4Hyz2ea4yKYONV+NLh03hNIpdhS/9nLQIhAKBa4/fi1MhNGwhDiTOKzP7G2472FOkoQkyaFxIXKnz1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36181},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"731047322ef77a734afac45762fbc4ed735a0bad","scripts":{"build":"tsc -b","prepublishOnly":"bunx tsc -b"},"_npmUser":{"name":"ahmetskilinc","email":"ahmetskilinc@icloud.com"},"repository":{"url":"git+https://github.com/ahmetskilinc/sync-engine.git","type":"git","directory":"packages/core"},"_npmVersion":"11.6.2","description":"Schema builder and wire protocol for the sync-engine realtime sync toolkit","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sync-core_0.3.0_1785598972206_0.9625248191663678","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@ahmetskilinc/sync-core","version":"0.4.0","description":"Schema builder and wire protocol for the sync-engine realtime sync toolkit","license":"MIT","type":"module","sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["sync","realtime","local-first","offline-first","schema"],"scripts":{"build":"tsc -b","prepublishOnly":"bunx tsc -b"},"repository":{"type":"git","url":"git+https://github.com/ahmetskilinc/sync-engine.git","directory":"packages/core"},"publishConfig":{"access":"public"},"engines":{"node":">=18"},"homepage":"https://github.com/ahmetskilinc/sync-engine#readme","bugs":{"url":"https://github.com/ahmetskilinc/sync-engine/issues"},"author":{"name":"Ahmet Kilinc"},"gitHead":"1bb2539de11edec64b930ee0cb1d362aca50d201","_id":"@ahmetskilinc/sync-core@0.4.0","_nodeVersion":"24.19.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-GhDxGLA/Cx+MZhd0T3ltoRHUGJSAq+5x+XyrO77sbA1eSS8hnIjmzgg8PKbs7ccHuMlCv/YiefL9NOvl7D2jsw==","shasum":"22846985acee719fe1c7be5297ded7818c0384db","tarball":"https://registry.npmjs.org/@ahmetskilinc/sync-core/-/sync-core-0.4.0.tgz","fileCount":18,"unpackedSize":44464,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDASKI5wEfeVtW3il4vwYLjgUJ9CrlN+JPQoj8bSdHWiQIhAI6N1bHoEUwMqgRaRtjuu5YROknLJfQxNIO0kWbseiFI"}]},"_npmUser":{"name":"ahmetskilinc","email":"ahmetskilinc@icloud.com"},"directories":{},"maintainers":[{"name":"ahmetskilinc","email":"ahmetskilinc@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sync-core_0.4.0_1787933668747_0.5525341040942584"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-28T15:52:20.011Z","modified":"2026-08-28T16:14:29.072Z","0.1.0":"2026-07-28T15:52:20.359Z","0.2.0":"2026-07-28T16:55:30.381Z","0.3.0":"2026-08-01T15:42:52.363Z","0.4.0":"2026-08-28T16:14:28.874Z"},"bugs":{"url":"https://github.com/ahmetskilinc/sync-engine/issues"},"author":{"name":"Ahmet Kilinc"},"license":"MIT","homepage":"https://github.com/ahmetskilinc/sync-engine#readme","keywords":["sync","realtime","local-first","offline-first","schema"],"repository":{"type":"git","url":"git+https://github.com/ahmetskilinc/sync-engine.git","directory":"packages/core"},"description":"Schema builder and wire protocol for the sync-engine realtime sync toolkit","maintainers":[{"name":"ahmetskilinc","email":"ahmetskilinc@icloud.com"}],"readme":"# @ahmetskilinc/sync-core\n\nSchema builder and wire protocol shared by [`@ahmetskilinc/sync-client`](https://www.npmjs.com/package/@ahmetskilinc/sync-client) and [`@ahmetskilinc/sync-server`](https://www.npmjs.com/package/@ahmetskilinc/sync-server).\n\nYou rarely install this alone — it comes in as a dependency of the other two — but you do import from it to declare your schema.\n\n```bash\nnpm install @ahmetskilinc/sync-core\n```\n\n```ts\nimport { defineModel, defineSchema, p } from \"@ahmetskilinc/sync-core\";\n\nconst Team = defineModel(\"Team\", {\n  name: p.string(),\n});\n\nconst Issue = defineModel(\"Issue\", {\n  title: p.string(),\n  status: p.string(),\n  teamId: p.reference(() => Team),\n  description: p.string().nullable(),\n});\n\nexport const schema = defineSchema([Team, Issue]);\n```\n\nRecords are fully typed via inference. `InferRecord<typeof Issue>` is:\n\n```ts\n{\n  id: string;\n  title: string;\n  status: string;\n  teamId: string;\n  description?: string | null;\n}\n```\n\nNullable properties are optional keys, so you can omit them on create.\n\n## What's in here\n\n- `defineModel` / `defineSchema` / `p` — the schema builder\n- `InferRecord` / `InferCreateInput` / `InferPatch` — type inference helpers\n- `validateData` — runtime validation, used server-side before accepting a transaction\n- `encodeMessage` / `decodeMessage` and the `ClientMessage` / `ServerMessage` / `SyncAction` / `Transaction` wire types\n- `generateId`\n\nZero runtime dependencies.\n\n---\n\nFull documentation: [github.com/ahmetskilinc/sync-engine](https://github.com/ahmetskilinc/sync-engine) · Upgrading? See [MIGRATION.md](https://github.com/ahmetskilinc/sync-engine/blob/main/MIGRATION.md)\n\nMIT\n","readmeFilename":"README.md"}