Refactor API types and sync logic
Rename and refactor the types passed over the API to be based on an entity that's either living or a tombstone. A living entity has a deleted property that's either undefined or false, while a tombstone has a deleted property set to true. All entities have a numeric id and an updatedAt timestamp. To sync entities, an array of replacements are passed around. Living entities are replaced with tombstones when they're deleted. And tombstones are replaced with living entities when restored.
This commit is contained in:
parent
251e83f640
commit
fe06d0d6bd
36 changed files with 1242 additions and 834 deletions
11
pnpm-lock.yaml
generated
11
pnpm-lock.yaml
generated
|
@ -29,6 +29,9 @@ importers:
|
|||
web-push:
|
||||
specifier: ^3.6.7
|
||||
version: 3.6.7
|
||||
zod:
|
||||
specifier: ^3.25.30
|
||||
version: 3.25.30
|
||||
devDependencies:
|
||||
'@types/luxon':
|
||||
specifier: ^3.4.2
|
||||
|
@ -3498,8 +3501,8 @@ packages:
|
|||
resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==}
|
||||
engines: {node: '>= 14'}
|
||||
|
||||
zod@3.25.23:
|
||||
resolution: {integrity: sha512-Od2bdMosahjSrSgJtakrwjMDb1zM1A3VIHCPGveZt/3/wlrTWBya2lmEh2OYe4OIu8mPTmmr0gnLHIWQXdtWBg==}
|
||||
zod@3.25.30:
|
||||
resolution: {integrity: sha512-VolhdEtu6TJr/fzGuHA/SZ5ixvXqA6ADOG9VRcQ3rdOKmF5hkmcJbyaQjUH5BgmpA9gej++zYRX7zjSmdReIwA==}
|
||||
|
||||
snapshots:
|
||||
|
||||
|
@ -3929,7 +3932,7 @@ snapshots:
|
|||
unixify: 1.0.0
|
||||
urlpattern-polyfill: 8.0.2
|
||||
yargs: 17.7.2
|
||||
zod: 3.25.23
|
||||
zod: 3.25.30
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
- rollup
|
||||
|
@ -7318,4 +7321,4 @@ snapshots:
|
|||
compress-commons: 6.0.2
|
||||
readable-stream: 4.7.0
|
||||
|
||||
zod@3.25.23: {}
|
||||
zod@3.25.30: {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue