@topgunbuild/server 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +64 -0
  2. package/dist/BetterSqlite3Adapter-LUMODVC3.mjs +10 -0
  3. package/dist/BetterSqlite3Adapter-LUMODVC3.mjs.map +1 -0
  4. package/dist/chunk-5CZA6O2S.mjs +782 -0
  5. package/dist/chunk-5CZA6O2S.mjs.map +1 -0
  6. package/dist/chunk-73CP5EN6.mjs +227 -0
  7. package/dist/chunk-73CP5EN6.mjs.map +1 -0
  8. package/dist/chunk-FJ6ZGZIA.mjs +43 -0
  9. package/dist/chunk-FJ6ZGZIA.mjs.map +1 -0
  10. package/dist/chunk-IQNKZPW3.mjs +31660 -0
  11. package/dist/chunk-IQNKZPW3.mjs.map +1 -0
  12. package/dist/chunk-ZTICMRY6.mjs +7 -0
  13. package/dist/chunk-ZTICMRY6.mjs.map +1 -0
  14. package/dist/index.d.mts +5951 -1969
  15. package/dist/index.d.ts +5951 -1969
  16. package/dist/index.js +31309 -13744
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +519 -15487
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/lib-ZCWT55TO.mjs +6 -0
  21. package/dist/lib-ZCWT55TO.mjs.map +1 -0
  22. package/dist/start-server.d.mts +2 -0
  23. package/dist/start-server.d.ts +2 -0
  24. package/dist/start-server.js +31751 -0
  25. package/dist/start-server.js.map +1 -0
  26. package/dist/start-server.mjs +112 -0
  27. package/dist/start-server.mjs.map +1 -0
  28. package/dist/workers/worker-scripts/base.worker.js +477 -0
  29. package/dist/workers/worker-scripts/base.worker.js.map +1 -0
  30. package/dist/workers/worker-scripts/crdt.worker.js +452 -0
  31. package/dist/workers/worker-scripts/crdt.worker.js.map +1 -0
  32. package/dist/workers/worker-scripts/merkle.worker.js +452 -0
  33. package/dist/workers/worker-scripts/merkle.worker.js.map +1 -0
  34. package/dist/workers/worker-scripts/serialization.worker.js +452 -0
  35. package/dist/workers/worker-scripts/serialization.worker.js.map +1 -0
  36. package/dist/workers/worker-scripts/test.worker.js +452 -0
  37. package/dist/workers/worker-scripts/test.worker.js.map +1 -0
  38. package/package.json +6 -3
@@ -0,0 +1,7 @@
1
+ // src/storage/IServerStorage.ts
2
+ var ORMAP_MARKER = "__ORMAP__";
3
+
4
+ export {
5
+ ORMAP_MARKER
6
+ };
7
+ //# sourceMappingURL=chunk-ZTICMRY6.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/storage/IServerStorage.ts"],"sourcesContent":["import { LWWRecord, ORMapRecord } from '@topgunbuild/core';\n\n/**\n * Marker used in ts_node_id column to distinguish ORMap values from LWW records.\n * This allows storing both CRDT types in the same table structure.\n * Used by PostgresAdapter and BetterSqlite3Adapter.\n */\nexport const ORMAP_MARKER = '__ORMAP__';\n\nexport type ORMapValue<V> = {\n type: 'OR';\n records: ORMapRecord<V>[];\n};\n\nexport type ORMapTombstones = {\n type: 'OR_TOMBSTONES';\n tags: string[];\n};\n\nexport type StorageValue<V> = LWWRecord<V> | ORMapValue<V> | ORMapTombstones;\n\n/**\n * Server Persistence Interface (MapStore).\n * Aligned with specifications/06_SERVER_INTEGRATIONS.md\n * \n * Note: We include mapName in all methods because a single storage adapter\n * instance typically handles multiple maps in the system (e.g. single DB connection).\n */\nexport interface IServerStorage {\n /**\n * Initialize the storage connection.\n */\n initialize(): Promise<void>;\n\n /**\n * Close the storage connection.\n */\n close(): Promise<void>;\n\n /**\n * Loads the value of a given key.\n * Called when a client requests a key that is not in the Server RAM (if using partial loading),\n * or during sync.\n */\n load(mapName: string, key: string): Promise<StorageValue<any> | undefined>;\n\n /**\n * Loads multiple keys.\n * Optimization for batch requests.\n */\n loadAll(mapName: string, keys: string[]): Promise<Map<string, StorageValue<any>>>;\n\n /**\n * Loads all keys from the store for a specific map.\n * Used for pre-loading the cache on startup or understanding dataset size.\n */\n loadAllKeys(mapName: string): Promise<string[]>;\n\n /**\n * Stores the key-value pair.\n */\n store(mapName: string, key: string, record: StorageValue<any>): Promise<void>;\n\n /**\n * Stores multiple entries.\n * Used for efficient batch writes to the DB.\n */\n storeAll(mapName: string, records: Map<string, StorageValue<any>>): Promise<void>;\n\n /**\n * Deletes the entry with the given key.\n */\n delete(mapName: string, key: string): Promise<void>;\n\n /**\n * Deletes multiple entries.\n */\n deleteAll(mapName: string, keys: string[]): Promise<void>;\n}\n"],"mappings":";AAOO,IAAM,eAAe;","names":[]}