@bypixeltv/kvstore 1.0.0 → 1.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 (2) hide show
  1. package/dist/kvstore.proto +30 -0
  2. package/package.json +1 -1
@@ -11,6 +11,10 @@ service KVStore {
11
11
  // Single shard: atomic; multi-shard: independent shard batches, per-item outcomes.
12
12
  // Clients MUST NOT blindly retry UNKNOWN_OUTCOME on a network failure.
13
13
  rpc BatchWrite(BatchWriteRequest) returns (BatchWriteResponse);
14
+ // Atomic conditional writes, including operations routed to multiple shards.
15
+ rpc Transact(TransactionRequest) returns (TransactionResponse);
16
+ // Private coordinator-to-voter transport, authenticated by the join token.
17
+ rpc ControlTransaction(TransactionControlRequest) returns (TransactionControlResponse);
14
18
  rpc Head(HeadRequest) returns (HeadResponse);
15
19
  rpc Watch(WatchRequest) returns (stream WatchResponse);
16
20
  rpc Scan(ScanRequest) returns (stream ScanResponse);
@@ -82,6 +86,32 @@ message BatchWriteResult {
82
86
  }
83
87
  message BatchWriteResponse { repeated BatchWriteResult results = 1; }
84
88
 
89
+ message TransactionCheck {
90
+ string namespace = 1;
91
+ string key = 2;
92
+ oneof expected {
93
+ // Zero means the key is absent or expired.
94
+ uint64 revision = 3;
95
+ // An exact byte match requires a currently present value.
96
+ bytes value = 4;
97
+ }
98
+ }
99
+
100
+ message TransactionRequest {
101
+ // Reuse an ID only to resolve the outcome of the same exact request.
102
+ string request_id = 1;
103
+ repeated TransactionCheck checks = 2;
104
+ repeated BatchWriteOperation operations = 3;
105
+ }
106
+
107
+ message TransactionResponse {
108
+ // False means a definitively aborted transaction, with no mutations.
109
+ // A transport error may have an unknown outcome. Retry the same request ID.
110
+ bool committed = 1;
111
+ }
112
+
113
+ message TransactionControlRequest { bytes payload = 1; }
114
+ message TransactionControlResponse { bytes payload = 1; }
85
115
 
86
116
  // On standalone and single-Raft: Head gives the authoritative revision.
87
117
  // Multi-Raft requires use_vector_cursor and returns cursor (revision=0).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bypixeltv/kvstore",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Node.js and TypeScript gRPC client for KVStore",
5
5
  "license": "MIT",
6
6
  "type": "module",