tetherdb 0.1.0

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 (194) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +277 -0
  3. package/bin/tetherdb.js +7 -0
  4. package/dist/cli/args.d.cts +20 -0
  5. package/dist/cli/args.d.ts +20 -0
  6. package/dist/cli/args.d.ts.map +1 -0
  7. package/dist/cli/backend.d.cts +15 -0
  8. package/dist/cli/backend.d.ts +15 -0
  9. package/dist/cli/backend.d.ts.map +1 -0
  10. package/dist/cli/cli.d.cts +8 -0
  11. package/dist/cli/cli.d.ts +8 -0
  12. package/dist/cli/cli.d.ts.map +1 -0
  13. package/dist/cli/commands/apps.d.cts +9 -0
  14. package/dist/cli/commands/apps.d.ts +9 -0
  15. package/dist/cli/commands/apps.d.ts.map +1 -0
  16. package/dist/cli/commands/help.d.cts +5 -0
  17. package/dist/cli/commands/help.d.ts +5 -0
  18. package/dist/cli/commands/help.d.ts.map +1 -0
  19. package/dist/cli/commands/index.d.cts +8 -0
  20. package/dist/cli/commands/index.d.ts +8 -0
  21. package/dist/cli/commands/index.d.ts.map +1 -0
  22. package/dist/cli/commands/maintenance.d.cts +9 -0
  23. package/dist/cli/commands/maintenance.d.ts +9 -0
  24. package/dist/cli/commands/maintenance.d.ts.map +1 -0
  25. package/dist/cli/commands/serve.d.cts +14 -0
  26. package/dist/cli/commands/serve.d.ts +14 -0
  27. package/dist/cli/commands/serve.d.ts.map +1 -0
  28. package/dist/cli/commands/status.d.cts +9 -0
  29. package/dist/cli/commands/status.d.ts +9 -0
  30. package/dist/cli/commands/status.d.ts.map +1 -0
  31. package/dist/cli/commands/tables.d.cts +9 -0
  32. package/dist/cli/commands/tables.d.ts +9 -0
  33. package/dist/cli/commands/tables.d.ts.map +1 -0
  34. package/dist/cli/commands/users.d.cts +9 -0
  35. package/dist/cli/commands/users.d.ts +9 -0
  36. package/dist/cli/commands/users.d.ts.map +1 -0
  37. package/dist/cli/index.cjs +3999 -0
  38. package/dist/cli/index.cjs.map +1 -0
  39. package/dist/cli/index.d.cts +7 -0
  40. package/dist/cli/index.d.ts +7 -0
  41. package/dist/cli/index.d.ts.map +1 -0
  42. package/dist/cli/index.js +3958 -0
  43. package/dist/cli/index.js.map +1 -0
  44. package/dist/client/auth.d.cts +155 -0
  45. package/dist/client/auth.d.ts +155 -0
  46. package/dist/client/auth.d.ts.map +1 -0
  47. package/dist/client/client.d.cts +122 -0
  48. package/dist/client/client.d.ts +122 -0
  49. package/dist/client/client.d.ts.map +1 -0
  50. package/dist/client/errors.d.cts +39 -0
  51. package/dist/client/errors.d.ts +39 -0
  52. package/dist/client/errors.d.ts.map +1 -0
  53. package/dist/client/index.cjs +1742 -0
  54. package/dist/client/index.cjs.map +1 -0
  55. package/dist/client/index.d.cts +12 -0
  56. package/dist/client/index.d.ts +12 -0
  57. package/dist/client/index.d.ts.map +1 -0
  58. package/dist/client/index.js +1707 -0
  59. package/dist/client/index.js.map +1 -0
  60. package/dist/client/shared/event.d.cts +29 -0
  61. package/dist/client/shared/event.d.ts +29 -0
  62. package/dist/client/shared/event.d.ts.map +1 -0
  63. package/dist/client/shared/id.d.cts +5 -0
  64. package/dist/client/shared/id.d.ts +5 -0
  65. package/dist/client/shared/id.d.ts.map +1 -0
  66. package/dist/client/storage.d.cts +183 -0
  67. package/dist/client/storage.d.ts +183 -0
  68. package/dist/client/storage.d.ts.map +1 -0
  69. package/dist/client/sync.d.cts +126 -0
  70. package/dist/client/sync.d.ts +126 -0
  71. package/dist/client/sync.d.ts.map +1 -0
  72. package/dist/client/table.d.cts +146 -0
  73. package/dist/client/table.d.ts +146 -0
  74. package/dist/client/table.d.ts.map +1 -0
  75. package/dist/index.cjs +1742 -0
  76. package/dist/index.cjs.map +1 -0
  77. package/dist/index.d.cts +7 -0
  78. package/dist/index.d.ts +7 -0
  79. package/dist/index.d.ts.map +1 -0
  80. package/dist/index.js +1707 -0
  81. package/dist/index.js.map +1 -0
  82. package/dist/server/crypto.d.cts +55 -0
  83. package/dist/server/crypto.d.ts +55 -0
  84. package/dist/server/crypto.d.ts.map +1 -0
  85. package/dist/server/errors.d.cts +39 -0
  86. package/dist/server/errors.d.ts +39 -0
  87. package/dist/server/errors.d.ts.map +1 -0
  88. package/dist/server/index.cjs +3621 -0
  89. package/dist/server/index.cjs.map +1 -0
  90. package/dist/server/index.d.cts +10 -0
  91. package/dist/server/index.d.ts +10 -0
  92. package/dist/server/index.d.ts.map +1 -0
  93. package/dist/server/index.js +3569 -0
  94. package/dist/server/index.js.map +1 -0
  95. package/dist/server/lock.d.cts +56 -0
  96. package/dist/server/lock.d.ts +56 -0
  97. package/dist/server/lock.d.ts.map +1 -0
  98. package/dist/server/rate-limiter.d.cts +81 -0
  99. package/dist/server/rate-limiter.d.ts +81 -0
  100. package/dist/server/rate-limiter.d.ts.map +1 -0
  101. package/dist/server/server.d.cts +206 -0
  102. package/dist/server/server.d.ts +206 -0
  103. package/dist/server/server.d.ts.map +1 -0
  104. package/dist/server/storage/app.d.cts +70 -0
  105. package/dist/server/storage/app.d.ts +70 -0
  106. package/dist/server/storage/app.d.ts.map +1 -0
  107. package/dist/server/storage/base/app.d.cts +42 -0
  108. package/dist/server/storage/base/app.d.ts +42 -0
  109. package/dist/server/storage/base/app.d.ts.map +1 -0
  110. package/dist/server/storage/base/index.d.cts +5 -0
  111. package/dist/server/storage/base/index.d.ts +5 -0
  112. package/dist/server/storage/base/index.d.ts.map +1 -0
  113. package/dist/server/storage/base/storage.d.cts +40 -0
  114. package/dist/server/storage/base/storage.d.ts +40 -0
  115. package/dist/server/storage/base/storage.d.ts.map +1 -0
  116. package/dist/server/storage/base/table.d.cts +32 -0
  117. package/dist/server/storage/base/table.d.ts +32 -0
  118. package/dist/server/storage/base/table.d.ts.map +1 -0
  119. package/dist/server/storage/base/user.d.cts +31 -0
  120. package/dist/server/storage/base/user.d.ts +31 -0
  121. package/dist/server/storage/base/user.d.ts.map +1 -0
  122. package/dist/server/storage/file/app.d.cts +50 -0
  123. package/dist/server/storage/file/app.d.ts +50 -0
  124. package/dist/server/storage/file/app.d.ts.map +1 -0
  125. package/dist/server/storage/file/index.d.cts +5 -0
  126. package/dist/server/storage/file/index.d.ts +5 -0
  127. package/dist/server/storage/file/index.d.ts.map +1 -0
  128. package/dist/server/storage/file/storage.d.cts +67 -0
  129. package/dist/server/storage/file/storage.d.ts +67 -0
  130. package/dist/server/storage/file/storage.d.ts.map +1 -0
  131. package/dist/server/storage/file/table.d.cts +14 -0
  132. package/dist/server/storage/file/table.d.ts +14 -0
  133. package/dist/server/storage/file/table.d.ts.map +1 -0
  134. package/dist/server/storage/file/user.d.cts +14 -0
  135. package/dist/server/storage/file/user.d.ts +14 -0
  136. package/dist/server/storage/file/user.d.ts.map +1 -0
  137. package/dist/server/storage/index.d.cts +14 -0
  138. package/dist/server/storage/index.d.ts +14 -0
  139. package/dist/server/storage/index.d.ts.map +1 -0
  140. package/dist/server/storage/memory/app.d.cts +29 -0
  141. package/dist/server/storage/memory/app.d.ts +29 -0
  142. package/dist/server/storage/memory/app.d.ts.map +1 -0
  143. package/dist/server/storage/memory/index.d.cts +5 -0
  144. package/dist/server/storage/memory/index.d.ts +5 -0
  145. package/dist/server/storage/memory/index.d.ts.map +1 -0
  146. package/dist/server/storage/memory/storage.d.cts +47 -0
  147. package/dist/server/storage/memory/storage.d.ts +47 -0
  148. package/dist/server/storage/memory/storage.d.ts.map +1 -0
  149. package/dist/server/storage/memory/table.d.cts +17 -0
  150. package/dist/server/storage/memory/table.d.ts +17 -0
  151. package/dist/server/storage/memory/table.d.ts.map +1 -0
  152. package/dist/server/storage/memory/user.d.cts +21 -0
  153. package/dist/server/storage/memory/user.d.ts +21 -0
  154. package/dist/server/storage/memory/user.d.ts.map +1 -0
  155. package/dist/server/storage/sqlite/app.d.cts +31 -0
  156. package/dist/server/storage/sqlite/app.d.ts +31 -0
  157. package/dist/server/storage/sqlite/app.d.ts.map +1 -0
  158. package/dist/server/storage/sqlite/index.d.cts +5 -0
  159. package/dist/server/storage/sqlite/index.d.ts +5 -0
  160. package/dist/server/storage/sqlite/index.d.ts.map +1 -0
  161. package/dist/server/storage/sqlite/storage.d.cts +92 -0
  162. package/dist/server/storage/sqlite/storage.d.ts +92 -0
  163. package/dist/server/storage/sqlite/storage.d.ts.map +1 -0
  164. package/dist/server/storage/sqlite/table.d.cts +15 -0
  165. package/dist/server/storage/sqlite/table.d.ts +15 -0
  166. package/dist/server/storage/sqlite/table.d.ts.map +1 -0
  167. package/dist/server/storage/sqlite/user.d.cts +14 -0
  168. package/dist/server/storage/sqlite/user.d.ts +14 -0
  169. package/dist/server/storage/sqlite/user.d.ts.map +1 -0
  170. package/dist/server/storage/storage.d.cts +152 -0
  171. package/dist/server/storage/storage.d.ts +152 -0
  172. package/dist/server/storage/storage.d.ts.map +1 -0
  173. package/dist/server/storage/table.d.cts +45 -0
  174. package/dist/server/storage/table.d.ts +45 -0
  175. package/dist/server/storage/table.d.ts.map +1 -0
  176. package/dist/server/storage/user.d.cts +45 -0
  177. package/dist/server/storage/user.d.ts +45 -0
  178. package/dist/server/storage/user.d.ts.map +1 -0
  179. package/dist/server/sync.d.cts +67 -0
  180. package/dist/server/sync.d.ts +67 -0
  181. package/dist/server/sync.d.ts.map +1 -0
  182. package/dist/server/validate.d.cts +113 -0
  183. package/dist/server/validate.d.ts +113 -0
  184. package/dist/server/validate.d.ts.map +1 -0
  185. package/dist/shared/clock.d.cts +22 -0
  186. package/dist/shared/clock.d.ts +22 -0
  187. package/dist/shared/clock.d.ts.map +1 -0
  188. package/dist/shared/path.d.cts +12 -0
  189. package/dist/shared/path.d.ts +12 -0
  190. package/dist/shared/path.d.ts.map +1 -0
  191. package/dist/shared/types.d.cts +234 -0
  192. package/dist/shared/types.d.ts +234 -0
  193. package/dist/shared/types.d.ts.map +1 -0
  194. package/package.json +133 -0
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Security, input validation, and sanitization utilities for the TetherDB server.
3
+ * Protects server-side storage and synchronization from injection and traversal attacks.
4
+ *
5
+ * @module tetherdb/server/validate
6
+ */
7
+ /** Minimum allowed username character length. */
8
+ export declare const MIN_USERNAME_LENGTH = 4;
9
+ /** Maximum allowed username character length. */
10
+ export declare const MAX_USERNAME_LENGTH = 128;
11
+ /** Minimum allowed password character length. */
12
+ export declare const MIN_PASSWORD_LENGTH = 4;
13
+ /** Maximum allowed password character length. */
14
+ export declare const MAX_PASSWORD_LENGTH = 512;
15
+ /** Maximum allowable future timestamp drift in milliseconds (5 minutes). */
16
+ export declare const MAX_FUTURE_TIMESTAMP_DRIFT_MS: number;
17
+ /**
18
+ * Validates a change timestamp, ensuring it is a valid finite epoch number
19
+ * and does not exceed the maximum allowable future drift.
20
+ *
21
+ * @param timestamp - The epoch timestamp in milliseconds.
22
+ * @param maxFutureDriftMs - Optional maximum allowable future drift in ms (defaults to 5 minutes).
23
+ * @returns The validated timestamp.
24
+ * @throws TetherServerError if timestamp is not finite, is non-positive, or exceeds drift bounds.
25
+ */
26
+ export declare function validateTimestamp(timestamp: number, maxFutureDriftMs?: number): number;
27
+ /**
28
+ * Validates a user ID string ensuring it is safe for filesystem use.
29
+ *
30
+ * @param userId - The user ID to validate.
31
+ * @returns The validated user ID.
32
+ * @throws TetherServerError if the user ID is invalid or contains unsafe characters.
33
+ */
34
+ export declare function validateUserId(userId: string): string;
35
+ /**
36
+ * Validates an application namespace identifier.
37
+ *
38
+ * @param appId - The application ID to validate.
39
+ * @returns The validated application ID.
40
+ * @throws TetherServerError if the application ID is invalid.
41
+ */
42
+ export declare function validateAppId(appId: string): string;
43
+ /**
44
+ * Validates a table name ensuring it is safe for filesystem use.
45
+ *
46
+ * @param tableName - The table name to validate.
47
+ * @returns The validated table name.
48
+ * @throws TetherServerError if the table name is invalid.
49
+ */
50
+ export declare function validateTableName(tableName: string): string;
51
+ /**
52
+ * Validates a record ID ensuring it is a non-empty string within size limits.
53
+ *
54
+ * @param id - The record identifier to validate.
55
+ * @returns The validated record ID.
56
+ * @throws TetherServerError if the record ID is invalid or exceeds max length.
57
+ */
58
+ export declare function validateRecordId(id: string): string;
59
+ /**
60
+ * Normalizes a username by trimming whitespace and converting to lowercase.
61
+ *
62
+ * @param username - The raw username string.
63
+ * @returns The normalized username (lowercase and trimmed).
64
+ */
65
+ export declare function normalizeUsername(username: string): string;
66
+ /**
67
+ * Validates and normalizes a username for account creation or authentication.
68
+ * Usernames must be between 4 and 128 characters long.
69
+ *
70
+ * @param username - The username to validate.
71
+ * @returns The validated and normalized username (trimmed and lowercase).
72
+ * @throws TetherServerError if the username is invalid or out of length bounds.
73
+ */
74
+ export declare function validateUsername(username: string): string;
75
+ /**
76
+ * Normalizes a password by trimming surrounding whitespace.
77
+ *
78
+ * @param password - The raw password string.
79
+ * @returns The normalized password (trimmed).
80
+ */
81
+ export declare function normalizePassword(password: string): string;
82
+ /**
83
+ * Validates a password for user account creation or authentication.
84
+ *
85
+ * @param password - The password string to validate.
86
+ * @returns The validated password.
87
+ * @throws TetherServerError if the password is not a string, is empty, or exceeds length bounds.
88
+ */
89
+ export declare function validatePassword(password: string): string;
90
+ /**
91
+ * Validates a client correlation or batch ID.
92
+ *
93
+ * @param id - The batch or client identifier.
94
+ * @param name - Identifier type description (e.g. 'batchId', 'clientId').
95
+ * @returns The validated ID.
96
+ * @throws TetherServerError if the identifier format is invalid.
97
+ */
98
+ export declare function validateIdentifier(id: string, name?: string): string;
99
+ /**
100
+ * Estimates the byte size of an arbitrary JavaScript value or object when serialized.
101
+ *
102
+ * @param value - The value to measure.
103
+ * @returns Size in bytes.
104
+ */
105
+ export declare function calculateByteSize(value: unknown): number;
106
+ /**
107
+ * Calculates a 2-character hex/hash bucket for directory partitioning by user ID.
108
+ *
109
+ * @param userId - Unique user identifier.
110
+ * @returns 2-character bucket string (e.g. 'f4', '0a').
111
+ */
112
+ export declare function getUserBucket(userId: string): string;
113
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate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B,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAUxD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIpD"}
@@ -0,0 +1,22 @@
1
+ import type { ChangeRecord, StoredRecord } from './types.cjs';
2
+ /**
3
+ * Determines whether an incoming mutation should overwrite an existing stored record
4
+ * using Last-Write-Wins (LWW) conflict resolution.
5
+ *
6
+ * Conflict resolution rules:
7
+ * 1. If no existing record exists, returns `true`.
8
+ * 2. If incoming timestamp is strictly greater, returns `true`.
9
+ * 3. If incoming timestamp is strictly less, returns `false`.
10
+ * 4. If timestamps are equal, performs deterministic lexicographical tie-breaking using `clientId`.
11
+ *
12
+ * @param incoming - The candidate change record with timestamp and optional client metadata.
13
+ * @param existing - The current record stored locally or on the server.
14
+ * @returns `true` if the incoming change wins the conflict and should overwrite the existing record; otherwise `false`.
15
+ */
16
+ export declare function shouldOverwrite(incoming: Pick<ChangeRecord, 'timestamp'> & {
17
+ clientId?: string;
18
+ version?: number;
19
+ }, existing?: Pick<StoredRecord, 'timestamp' | 'version'> & {
20
+ clientId?: string;
21
+ }): boolean;
22
+ //# sourceMappingURL=clock.d.ts.map
@@ -0,0 +1,22 @@
1
+ import type { ChangeRecord, StoredRecord } from './types.js';
2
+ /**
3
+ * Determines whether an incoming mutation should overwrite an existing stored record
4
+ * using Last-Write-Wins (LWW) conflict resolution.
5
+ *
6
+ * Conflict resolution rules:
7
+ * 1. If no existing record exists, returns `true`.
8
+ * 2. If incoming timestamp is strictly greater, returns `true`.
9
+ * 3. If incoming timestamp is strictly less, returns `false`.
10
+ * 4. If timestamps are equal, performs deterministic lexicographical tie-breaking using `clientId`.
11
+ *
12
+ * @param incoming - The candidate change record with timestamp and optional client metadata.
13
+ * @param existing - The current record stored locally or on the server.
14
+ * @returns `true` if the incoming change wins the conflict and should overwrite the existing record; otherwise `false`.
15
+ */
16
+ export declare function shouldOverwrite(incoming: Pick<ChangeRecord, 'timestamp'> & {
17
+ clientId?: string;
18
+ version?: number;
19
+ }, existing?: Pick<StoredRecord, 'timestamp' | 'version'> & {
20
+ clientId?: string;
21
+ }): boolean;
22
+ //# sourceMappingURL=clock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../src/shared/clock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,GAAG;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,EACD,QAAQ,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,SAAS,CAAC,GAAG;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GACA,OAAO,CAaT"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Utility functions for path normalization across client and server.
3
+ */
4
+ /**
5
+ * Normalizes a base path ensuring it starts with a leading slash and has no trailing slash.
6
+ * An empty string or single slash normalizes to an empty string.
7
+ *
8
+ * @param path - The base path to normalize.
9
+ * @returns Normalized base path (e.g. '/api' or '').
10
+ */
11
+ export declare function normalizeBasePath(path: string): string;
12
+ //# sourceMappingURL=path.d.ts.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Utility functions for path normalization across client and server.
3
+ */
4
+ /**
5
+ * Normalizes a base path ensuring it starts with a leading slash and has no trailing slash.
6
+ * An empty string or single slash normalizes to an empty string.
7
+ *
8
+ * @param path - The base path to normalize.
9
+ * @returns Normalized base path (e.g. '/api' or '').
10
+ */
11
+ export declare function normalizeBasePath(path: string): string;
12
+ //# sourceMappingURL=path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/shared/path.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKtD"}
@@ -0,0 +1,234 @@
1
+ /**
2
+ * The type of mutation operation performed on a record.
3
+ */
4
+ export declare enum OperationType {
5
+ /** Insert or update a record payload. */
6
+ Put = "put",
7
+ /** Delete a record (tombstone). */
8
+ Delete = "delete"
9
+ }
10
+ /**
11
+ * Represents an individual mutation operation record to be synced.
12
+ *
13
+ * @typeParam T - The data type of the record payload.
14
+ */
15
+ export interface ChangeRecord<T = unknown> {
16
+ /** The target table name. */
17
+ table: string;
18
+ /** The unique record identifier within the table. */
19
+ id: string;
20
+ /** The mutation operation type. */
21
+ op: OperationType;
22
+ /** The data payload for 'put' operations. */
23
+ data?: T;
24
+ /** Monotonic epoch timestamp when the change was initiated. */
25
+ timestamp: number;
26
+ /** Identifier of the client that originated the change. */
27
+ clientId: string;
28
+ /** Incremental version counter for the record. */
29
+ version?: number;
30
+ /** Server-assigned global sequential index. */
31
+ seq?: number;
32
+ }
33
+ /**
34
+ * Represents a persisted record with local metadata.
35
+ *
36
+ * @typeParam T - The data type of the stored record value.
37
+ */
38
+ export interface StoredRecord<T = unknown> {
39
+ /** The unique record identifier. */
40
+ id: string;
41
+ /** The stored value payload. */
42
+ data: T;
43
+ /** Epoch timestamp of the last write. */
44
+ timestamp: number;
45
+ /** Record revision version. */
46
+ version: number;
47
+ /** Flag indicating whether the record is marked as deleted (tombstone). */
48
+ deleted?: boolean;
49
+ /** Identifier of client that performed the write. */
50
+ clientId?: string;
51
+ }
52
+ /**
53
+ * Represents a single record entry in a full database snapshot.
54
+ *
55
+ * @typeParam T - The data type of the record payload.
56
+ */
57
+ export interface SnapshotRecord<T = unknown> extends StoredRecord<T> {
58
+ /** The table name. */
59
+ table: string;
60
+ }
61
+ /**
62
+ * Current wire protocol version number.
63
+ */
64
+ export declare const PROTOCOL_VERSION = 1;
65
+ /**
66
+ * Types of messages sent from the client to the server over the WebSocket sync connection.
67
+ */
68
+ export declare enum ClientMessageType {
69
+ /** Authenticate connection with user token and initial sync sequence. */
70
+ Auth = "auth",
71
+ /** Submit a batch of local pending changes to the server. */
72
+ ChangeBatch = "change_batch",
73
+ /** Heartbeat ping message to verify connection liveness. */
74
+ Ping = "ping"
75
+ }
76
+ /**
77
+ * Client authentication handshake message.
78
+ */
79
+ export interface AuthClientMessage {
80
+ type: ClientMessageType.Auth;
81
+ /** Wire protocol version number (must equal `PROTOCOL_VERSION`). */
82
+ protocolVersion: number;
83
+ /** Signed authentication session token. */
84
+ token: string;
85
+ /** Unique client instance identifier. */
86
+ clientId: string;
87
+ /** Last synchronized sequence number known to the client. */
88
+ lastSyncSeq?: number;
89
+ /** Application namespace identifier. */
90
+ appId: string;
91
+ /** Optional client capabilities supported by this client session. */
92
+ capabilities?: string[];
93
+ }
94
+ /**
95
+ * Client mutation batch message.
96
+ */
97
+ export interface ChangeBatchClientMessage {
98
+ type: ClientMessageType.ChangeBatch;
99
+ /** Unique client instance identifier. */
100
+ clientId: string;
101
+ /** Unique batch correlation identifier. */
102
+ batchId: string;
103
+ /** Array of change operations to apply. */
104
+ changes: ChangeRecord[];
105
+ }
106
+ /**
107
+ * Client heartbeat ping message.
108
+ */
109
+ export interface PingClientMessage {
110
+ type: ClientMessageType.Ping;
111
+ }
112
+ /**
113
+ * Discriminated union of all messages sent from client to server.
114
+ */
115
+ export type ClientMessage = AuthClientMessage | ChangeBatchClientMessage | PingClientMessage;
116
+ /**
117
+ * Types of messages sent from the server to the client over the WebSocket sync connection.
118
+ */
119
+ export declare enum ServerMessageType {
120
+ /** Authentication succeeded. */
121
+ AuthSuccess = "auth_success",
122
+ /** Authentication failed. */
123
+ AuthError = "auth_error",
124
+ /** Full dataset snapshot sent when client connects without prior sync sequence. */
125
+ SyncSnapshot = "sync_snapshot",
126
+ /** Delta diff of changes that occurred since client's lastSyncSeq. */
127
+ SyncDiff = "sync_diff",
128
+ /** Confirmation that a client change batch was applied. */
129
+ ChangeAck = "change_ack",
130
+ /** Real-time broadcast of changes applied by another client session of the same user. */
131
+ BroadcastChanges = "broadcast_changes",
132
+ /** Heartbeat pong response. */
133
+ Pong = "pong",
134
+ /** General server error notification. */
135
+ Error = "error"
136
+ }
137
+ /**
138
+ * Server authentication success response message.
139
+ */
140
+ export interface AuthSuccessServerMessage {
141
+ type: ServerMessageType.AuthSuccess;
142
+ /** Wire protocol version number. */
143
+ protocolVersion: number;
144
+ /** Authenticated user account identifier. */
145
+ userId: string;
146
+ /** Current global sequence number of the user's data on the server. */
147
+ currentSeq: number;
148
+ /** Refreshed session token for sliding session validity. */
149
+ token?: string;
150
+ /** Optional server capabilities supported by this server instance. */
151
+ capabilities?: string[];
152
+ }
153
+ /**
154
+ * Server authentication failure response message.
155
+ */
156
+ export interface AuthErrorServerMessage {
157
+ type: ServerMessageType.AuthError;
158
+ /** Error description message. */
159
+ message: string;
160
+ }
161
+ /**
162
+ * Server full dataset snapshot message.
163
+ */
164
+ export interface SyncSnapshotServerMessage {
165
+ type: ServerMessageType.SyncSnapshot;
166
+ /** Sequence number corresponding to the snapshot state. */
167
+ seq: number;
168
+ /** All active records across tables. */
169
+ snapshot: SnapshotRecord[];
170
+ }
171
+ /**
172
+ * Server incremental delta diff message.
173
+ */
174
+ export interface SyncDiffServerMessage {
175
+ type: ServerMessageType.SyncDiff;
176
+ /** Starting sequence number (exclusive). */
177
+ fromSeq: number;
178
+ /** Ending sequence number (inclusive). */
179
+ toSeq: number;
180
+ /** Array of applied changes in sequential order. */
181
+ changes: ChangeRecord[];
182
+ }
183
+ /**
184
+ * Server batch acknowledgement message.
185
+ */
186
+ export interface ChangeAckServerMessage {
187
+ type: ServerMessageType.ChangeAck;
188
+ /** The correlation identifier of the acknowledged batch. */
189
+ batchId: string;
190
+ /** The new global sequence number after applying the batch. */
191
+ appliedSeq: number;
192
+ }
193
+ /**
194
+ * Server real-time changes broadcast message.
195
+ */
196
+ export interface BroadcastChangesServerMessage {
197
+ type: ServerMessageType.BroadcastChanges;
198
+ /** Client ID that originated the change. */
199
+ fromClientId: string;
200
+ /** Global sequence number assigned to these changes. */
201
+ seq: number;
202
+ /** Array of applied changes. */
203
+ changes: ChangeRecord[];
204
+ }
205
+ /**
206
+ * Server heartbeat pong response message.
207
+ */
208
+ export interface PongServerMessage {
209
+ type: ServerMessageType.Pong;
210
+ }
211
+ /**
212
+ * Server error notification message.
213
+ */
214
+ export interface ErrorServerMessage {
215
+ type: ServerMessageType.Error;
216
+ /** Error description message. */
217
+ message: string;
218
+ }
219
+ /**
220
+ * Discriminated union of all messages sent from server to client.
221
+ */
222
+ export type ServerMessage = AuthSuccessServerMessage | AuthErrorServerMessage | SyncSnapshotServerMessage | SyncDiffServerMessage | ChangeAckServerMessage | BroadcastChangesServerMessage | PongServerMessage | ErrorServerMessage;
223
+ /**
224
+ * Metadata stored locally tracking synchronization progress.
225
+ */
226
+ export interface SyncMetadata {
227
+ /** The latest sequence number synchronized with the server. */
228
+ lastSyncSeq: number;
229
+ /** Epoch timestamp of the last successful synchronization. */
230
+ lastSyncTimestamp: number;
231
+ /** Unique client instance identifier. */
232
+ clientId: string;
233
+ }
234
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,234 @@
1
+ /**
2
+ * The type of mutation operation performed on a record.
3
+ */
4
+ export declare enum OperationType {
5
+ /** Insert or update a record payload. */
6
+ Put = "put",
7
+ /** Delete a record (tombstone). */
8
+ Delete = "delete"
9
+ }
10
+ /**
11
+ * Represents an individual mutation operation record to be synced.
12
+ *
13
+ * @typeParam T - The data type of the record payload.
14
+ */
15
+ export interface ChangeRecord<T = unknown> {
16
+ /** The target table name. */
17
+ table: string;
18
+ /** The unique record identifier within the table. */
19
+ id: string;
20
+ /** The mutation operation type. */
21
+ op: OperationType;
22
+ /** The data payload for 'put' operations. */
23
+ data?: T;
24
+ /** Monotonic epoch timestamp when the change was initiated. */
25
+ timestamp: number;
26
+ /** Identifier of the client that originated the change. */
27
+ clientId: string;
28
+ /** Incremental version counter for the record. */
29
+ version?: number;
30
+ /** Server-assigned global sequential index. */
31
+ seq?: number;
32
+ }
33
+ /**
34
+ * Represents a persisted record with local metadata.
35
+ *
36
+ * @typeParam T - The data type of the stored record value.
37
+ */
38
+ export interface StoredRecord<T = unknown> {
39
+ /** The unique record identifier. */
40
+ id: string;
41
+ /** The stored value payload. */
42
+ data: T;
43
+ /** Epoch timestamp of the last write. */
44
+ timestamp: number;
45
+ /** Record revision version. */
46
+ version: number;
47
+ /** Flag indicating whether the record is marked as deleted (tombstone). */
48
+ deleted?: boolean;
49
+ /** Identifier of client that performed the write. */
50
+ clientId?: string;
51
+ }
52
+ /**
53
+ * Represents a single record entry in a full database snapshot.
54
+ *
55
+ * @typeParam T - The data type of the record payload.
56
+ */
57
+ export interface SnapshotRecord<T = unknown> extends StoredRecord<T> {
58
+ /** The table name. */
59
+ table: string;
60
+ }
61
+ /**
62
+ * Current wire protocol version number.
63
+ */
64
+ export declare const PROTOCOL_VERSION = 1;
65
+ /**
66
+ * Types of messages sent from the client to the server over the WebSocket sync connection.
67
+ */
68
+ export declare enum ClientMessageType {
69
+ /** Authenticate connection with user token and initial sync sequence. */
70
+ Auth = "auth",
71
+ /** Submit a batch of local pending changes to the server. */
72
+ ChangeBatch = "change_batch",
73
+ /** Heartbeat ping message to verify connection liveness. */
74
+ Ping = "ping"
75
+ }
76
+ /**
77
+ * Client authentication handshake message.
78
+ */
79
+ export interface AuthClientMessage {
80
+ type: ClientMessageType.Auth;
81
+ /** Wire protocol version number (must equal `PROTOCOL_VERSION`). */
82
+ protocolVersion: number;
83
+ /** Signed authentication session token. */
84
+ token: string;
85
+ /** Unique client instance identifier. */
86
+ clientId: string;
87
+ /** Last synchronized sequence number known to the client. */
88
+ lastSyncSeq?: number;
89
+ /** Application namespace identifier. */
90
+ appId: string;
91
+ /** Optional client capabilities supported by this client session. */
92
+ capabilities?: string[];
93
+ }
94
+ /**
95
+ * Client mutation batch message.
96
+ */
97
+ export interface ChangeBatchClientMessage {
98
+ type: ClientMessageType.ChangeBatch;
99
+ /** Unique client instance identifier. */
100
+ clientId: string;
101
+ /** Unique batch correlation identifier. */
102
+ batchId: string;
103
+ /** Array of change operations to apply. */
104
+ changes: ChangeRecord[];
105
+ }
106
+ /**
107
+ * Client heartbeat ping message.
108
+ */
109
+ export interface PingClientMessage {
110
+ type: ClientMessageType.Ping;
111
+ }
112
+ /**
113
+ * Discriminated union of all messages sent from client to server.
114
+ */
115
+ export type ClientMessage = AuthClientMessage | ChangeBatchClientMessage | PingClientMessage;
116
+ /**
117
+ * Types of messages sent from the server to the client over the WebSocket sync connection.
118
+ */
119
+ export declare enum ServerMessageType {
120
+ /** Authentication succeeded. */
121
+ AuthSuccess = "auth_success",
122
+ /** Authentication failed. */
123
+ AuthError = "auth_error",
124
+ /** Full dataset snapshot sent when client connects without prior sync sequence. */
125
+ SyncSnapshot = "sync_snapshot",
126
+ /** Delta diff of changes that occurred since client's lastSyncSeq. */
127
+ SyncDiff = "sync_diff",
128
+ /** Confirmation that a client change batch was applied. */
129
+ ChangeAck = "change_ack",
130
+ /** Real-time broadcast of changes applied by another client session of the same user. */
131
+ BroadcastChanges = "broadcast_changes",
132
+ /** Heartbeat pong response. */
133
+ Pong = "pong",
134
+ /** General server error notification. */
135
+ Error = "error"
136
+ }
137
+ /**
138
+ * Server authentication success response message.
139
+ */
140
+ export interface AuthSuccessServerMessage {
141
+ type: ServerMessageType.AuthSuccess;
142
+ /** Wire protocol version number. */
143
+ protocolVersion: number;
144
+ /** Authenticated user account identifier. */
145
+ userId: string;
146
+ /** Current global sequence number of the user's data on the server. */
147
+ currentSeq: number;
148
+ /** Refreshed session token for sliding session validity. */
149
+ token?: string;
150
+ /** Optional server capabilities supported by this server instance. */
151
+ capabilities?: string[];
152
+ }
153
+ /**
154
+ * Server authentication failure response message.
155
+ */
156
+ export interface AuthErrorServerMessage {
157
+ type: ServerMessageType.AuthError;
158
+ /** Error description message. */
159
+ message: string;
160
+ }
161
+ /**
162
+ * Server full dataset snapshot message.
163
+ */
164
+ export interface SyncSnapshotServerMessage {
165
+ type: ServerMessageType.SyncSnapshot;
166
+ /** Sequence number corresponding to the snapshot state. */
167
+ seq: number;
168
+ /** All active records across tables. */
169
+ snapshot: SnapshotRecord[];
170
+ }
171
+ /**
172
+ * Server incremental delta diff message.
173
+ */
174
+ export interface SyncDiffServerMessage {
175
+ type: ServerMessageType.SyncDiff;
176
+ /** Starting sequence number (exclusive). */
177
+ fromSeq: number;
178
+ /** Ending sequence number (inclusive). */
179
+ toSeq: number;
180
+ /** Array of applied changes in sequential order. */
181
+ changes: ChangeRecord[];
182
+ }
183
+ /**
184
+ * Server batch acknowledgement message.
185
+ */
186
+ export interface ChangeAckServerMessage {
187
+ type: ServerMessageType.ChangeAck;
188
+ /** The correlation identifier of the acknowledged batch. */
189
+ batchId: string;
190
+ /** The new global sequence number after applying the batch. */
191
+ appliedSeq: number;
192
+ }
193
+ /**
194
+ * Server real-time changes broadcast message.
195
+ */
196
+ export interface BroadcastChangesServerMessage {
197
+ type: ServerMessageType.BroadcastChanges;
198
+ /** Client ID that originated the change. */
199
+ fromClientId: string;
200
+ /** Global sequence number assigned to these changes. */
201
+ seq: number;
202
+ /** Array of applied changes. */
203
+ changes: ChangeRecord[];
204
+ }
205
+ /**
206
+ * Server heartbeat pong response message.
207
+ */
208
+ export interface PongServerMessage {
209
+ type: ServerMessageType.Pong;
210
+ }
211
+ /**
212
+ * Server error notification message.
213
+ */
214
+ export interface ErrorServerMessage {
215
+ type: ServerMessageType.Error;
216
+ /** Error description message. */
217
+ message: string;
218
+ }
219
+ /**
220
+ * Discriminated union of all messages sent from server to client.
221
+ */
222
+ export type ServerMessage = AuthSuccessServerMessage | AuthErrorServerMessage | SyncSnapshotServerMessage | SyncDiffServerMessage | ChangeAckServerMessage | BroadcastChangesServerMessage | PongServerMessage | ErrorServerMessage;
223
+ /**
224
+ * Metadata stored locally tracking synchronization progress.
225
+ */
226
+ export interface SyncMetadata {
227
+ /** The latest sequence number synchronized with the server. */
228
+ lastSyncSeq: number;
229
+ /** Epoch timestamp of the last successful synchronization. */
230
+ lastSyncTimestamp: number;
231
+ /** Unique client instance identifier. */
232
+ clientId: string;
233
+ }
234
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,aAAa;IACvB,yCAAyC;IACzC,GAAG,QAAQ;IACX,mCAAmC;IACnC,MAAM,WAAW;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,EAAE,EAAE,aAAa,CAAC;IAClB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,IAAI,EAAE,CAAC,CAAC;IACR,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO,CAAE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