@tdxvolt/volt-client-grpc 0.20.31 → 0.20.32

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.
package/lib/index.cjs CHANGED
@@ -1770,6 +1770,12 @@ service SyncAPI {
1770
1770
  // Watch synapse paths for changes.
1771
1771
  rpc WatchSynapsePath(stream WatchSynapsePathRequest) returns (stream WatchSynapsePathResponse);
1772
1772
 
1773
+ // Get the state of a synapse document on this Volt. Reports whether the content this Volt holds matches the \`__hash\` advertised in the synapse metadata.
1774
+ rpc GetSynapseDocumentState(GetSynapseDocumentStateRequest) returns (GetSynapseDocumentStateResponse);
1775
+
1776
+ // Watch synapse documents for state changes. The server sends the current state of every watched document before any subsequent transitions, so a watcher started after content lands does not miss it.
1777
+ rpc WatchSynapseDocumentState(stream WatchSynapseDocumentStateRequest) returns (stream WatchSynapseDocumentStateResponse);
1778
+
1773
1779
  // Write a single value to a given synapse JSON path.
1774
1780
  rpc WriteSynapsePath(WriteSynapsePathRequest) returns (WriteSynapsePathResponse);
1775
1781
 
@@ -1980,8 +1986,8 @@ message SetSynapseDocumentMetadataRequest {
1980
1986
  // Any additional application-specific JSON to attach to the document.
1981
1987
  string json = 4;
1982
1988
 
1983
- // Set to true when the document content is already present (content-first) or the document is intentionally empty, so the server bootstraps \`__hash\` immediately. Leave false (the default) when content will be written after this call.
1984
- bool content_ready = 6;
1989
+ // Set to true to publish \`__hash\` immediately, because the content is already present (content-first) or the document is intentionally empty. Leave false (the default) when content will be written after this call, in which case the server publishes \`__hash\` once that content arrives. This is creator intent at create time; it says nothing about whether other Volts hold the content (see GetSynapseDocumentState).
1990
+ bool publish_hash = 6;
1985
1991
 
1986
1992
  // For blob documents, the content hash to bind. The server verifies the blob is stored (or the hash is sha256 of empty bytes) and writes \`__hash\`. Omit for a metadata-first create. Must not be set for map/array/text documents; the server computes those hashes from Yjs content.
1987
1993
  string blob_hash = 7;
@@ -2054,9 +2060,6 @@ message SyncDocumentResponse {
2054
2060
 
2055
2061
  // Parameters to start watching synapse paths. Sent as the first message.
2056
2062
  message WatchSynapsePathStart {
2057
- // DEPRECATED: Use synapse_id instead.
2058
- string database_id = 1;
2059
-
2060
2063
  // The id of the synapse that contains the document.
2061
2064
  string synapse_id = 4;
2062
2065
 
@@ -2217,16 +2220,100 @@ message RevertSyncDocumentVersionResponse {
2217
2220
  string version_id = 2;
2218
2221
  }
2219
2222
 
2223
+ // The state of a synapse document. \`__hash\` in the synapse metadata says what the content is; this says whether this Volt holds it yet. Metadata replicates independently of content, so a document can be ANNOUNCED here and READY on the Volt that produced it.
2224
+ enum SynapseDocumentState {
2225
+ SYNAPSE_DOCUMENT_STATE_UNKNOWN = 0;
2226
+
2227
+ // No metadata entry for this document on this Volt.
2228
+ SYNAPSE_DOCUMENT_STATE_ABSENT = 1;
2229
+
2230
+ // Metadata entry exists but no \`__hash\` has been published yet, so no content has been committed. See SetSynapseDocumentMetadata.publish_hash.
2231
+ SYNAPSE_DOCUMENT_STATE_DRAFT = 2;
2232
+
2233
+ // \`__hash\` is published but the content this Volt holds does not match it. The content is still in flight; wait for READY before reading it.
2234
+ SYNAPSE_DOCUMENT_STATE_ANNOUNCED = 3;
2235
+
2236
+ // The content this Volt holds matches \`__hash\`. The document can be read.
2237
+ SYNAPSE_DOCUMENT_STATE_READY = 4;
2238
+
2239
+ // The metadata entry was removed.
2240
+ SYNAPSE_DOCUMENT_STATE_DELETED = 5;
2241
+ }
2242
+
2243
+ message GetSynapseDocumentStateRequest {
2244
+ // The id of the synapse that contains the document.
2245
+ string synapse_id = 1;
2246
+
2247
+ // The id of the document to query.
2248
+ string document_id = 2;
2249
+ }
2250
+
2251
+ message GetSynapseDocumentStateResponse {
2252
+ // Details of any error that occurred on the call.
2253
+ tdx.volt_api.volt.v1.Status status = 1;
2254
+
2255
+ // The state of the document.
2256
+ SynapseDocumentState state = 2;
2257
+
2258
+ // The content hash advertised in the synapse metadata (\`__hash\`). Empty for ABSENT and DRAFT documents.
2259
+ string hash = 3;
2260
+
2261
+ // The content hash this Volt actually holds. Empty when no content has landed here yet. Equal to \`hash\` when the state is READY.
2262
+ string local_hash = 4;
2263
+ }
2264
+
2265
+ // Parameters to start watching synapse document state. Sent as the first message.
2266
+ message WatchSynapseDocumentStateStart {
2267
+ // The id of the synapse to watch.
2268
+ string synapse_id = 1;
2269
+
2270
+ // The ids of the documents to watch. Leave empty to watch every document in the synapse, including documents added after the watch starts.
2271
+ repeated string document_id = 2;
2272
+ }
2273
+
2274
+ message WatchSynapseDocumentStateRequest {
2275
+ oneof payload {
2276
+ // Start watching; must be sent as the first message.
2277
+ WatchSynapseDocumentStateStart start = 1;
2278
+
2279
+ // Request to stop the watch.
2280
+ bool stop = 2;
2281
+ }
2282
+ }
2283
+
2284
+ message WatchSynapseDocumentStateUpdate {
2285
+ // The id of the document whose state changed.
2286
+ string document_id = 1;
2287
+
2288
+ SynapseDocumentState state = 2;
2289
+
2290
+ // The content hash advertised in the synapse metadata (\`__hash\`).
2291
+ string hash = 3;
2292
+
2293
+ // The content hash this Volt actually holds.
2294
+ string local_hash = 4;
2295
+ }
2296
+
2297
+ message WatchSynapseDocumentStateResponse {
2298
+ oneof result {
2299
+ // Details of any error that occurred on the call.
2300
+ tdx.volt_api.volt.v1.Status status = 1;
2301
+
2302
+ // A document state update.
2303
+ WatchSynapseDocumentStateUpdate update = 2;
2304
+ }
2305
+ }
2306
+
2220
2307
  message HasSynapseBlobRequest {
2221
2308
  // The id of the synapse that stores the blob.
2222
2309
  string synapse_id = 1;
2223
2310
 
2224
- // sha256 of the raw file bytes, encoded as unpadded base64url (same family
2225
- // as VoltDrive content hashes).
2311
+ // SHA-256 of the raw file bytes, encoded as unpadded base64url.
2226
2312
  string hash = 2;
2227
2313
  }
2228
2314
 
2229
2315
  message HasSynapseBlobResponse {
2316
+ // Details of any error that occurred on the call.
2230
2317
  tdx.volt_api.volt.v1.Status status = 1;
2231
2318
 
2232
2319
  // True if a blob with this hash is already stored.
@@ -2234,6 +2321,7 @@ message HasSynapseBlobResponse {
2234
2321
  }
2235
2322
 
2236
2323
  message PutSynapseBlobStart {
2324
+ // The id of the synapse that stores the blob.
2237
2325
  string synapse_id = 1;
2238
2326
 
2239
2327
  // Expected sha256 (base64url) of the concatenated payload bytes.
@@ -2264,13 +2352,20 @@ message PutSynapseBlobResponse {
2264
2352
  }
2265
2353
 
2266
2354
  message GetSynapseBlobRequest {
2355
+ // The id of the synapse that stores the blob.
2267
2356
  string synapse_id = 1;
2357
+
2358
+ // SHA-256 of the raw file bytes, encoded as unpadded base64url.
2268
2359
  string hash = 2;
2269
2360
  }
2270
2361
 
2271
2362
  message GetSynapseBlobResponse {
2363
+ // The next chunk of blob data or details of any error that occurred on the call.
2272
2364
  oneof payload {
2365
+ // The next chunk of blob data.
2273
2366
  bytes block = 1;
2367
+
2368
+ // Details of any error that occurred on the call.
2274
2369
  tdx.volt_api.volt.v1.Status status = 2;
2275
2370
  }
2276
2371
  }
@@ -2648,6 +2743,9 @@ message VoltParameters {
2648
2743
 
2649
2744
  // Optional per-method gRPC rate limits (see GrpcRpcRateLimit). Keyed by peer identity or fingerprint.
2650
2745
  repeated GrpcRpcRateLimit grpc_rpc_rate_limit = 57;
2746
+
2747
+ // Deadline in milliseconds for outbound unary gRPC calls made by this Volt (relay, synapse, mirroring, drive and DID registry calls). If unset or zero, the built-in defaults are used.
2748
+ uint32 grpc_unary_deadline = 58;
2651
2749
  }
2652
2750
 
2653
2751
  message VoltEndpoint {
@@ -7091,6 +7189,10 @@ class VoltClient extends EventEmitter__default["default"] {
7091
7189
  );
7092
7190
  }
7093
7191
 
7192
+ GetSynapseDocumentState(request) {
7193
+ return unaryCallInternal.call(this, "GetSynapseDocumentState", request);
7194
+ }
7195
+
7094
7196
  SaveSynapse(request) {
7095
7197
  return unaryCallInternal.call(this, "SaveSynapse", request);
7096
7198
  }
@@ -7114,6 +7216,16 @@ class VoltClient extends EventEmitter__default["default"] {
7114
7216
  return syncDocumentCall.start(grpcClient, request);
7115
7217
  }
7116
7218
 
7219
+ WatchSynapseDocumentState(request) {
7220
+ this.getVoltAPIClient();
7221
+
7222
+ new GRPCCall(
7223
+ this,
7224
+ "WatchSynapseDocumentState",
7225
+ "METHOD_TYPE_BIDI"
7226
+ );
7227
+ }
7228
+
7117
7229
  WatchSynapsePath(request) {
7118
7230
  const grpcClient = this.getVoltAPIClient();
7119
7231
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.20.31",
6
+ "version": "0.20.32",
7
7
  "description": "tdx Volt library for nodejs clients",
8
8
  "type": "module",
9
9
  "exports": {
@@ -33,8 +33,8 @@
33
33
  "author": "toby.ealden@gmail.com",
34
34
  "license": "ISC",
35
35
  "dependencies": {
36
- "@tdxvolt/volt-client-web": "^0.20.31",
37
- "@tdxvolt/volt-utility": "^0.20.31",
36
+ "@tdxvolt/volt-client-web": "^0.20.32",
37
+ "@tdxvolt/volt-utility": "^0.20.32",
38
38
  "debug": "^4.1.1",
39
39
  "ip": "^1.1.5",
40
40
  "jsonwebtoken": "^8.5.1",
@@ -751,6 +751,10 @@ export class VoltClient extends EventEmitter {
751
751
  );
752
752
  }
753
753
 
754
+ GetSynapseDocumentState(request) {
755
+ return unaryCallInternal.call(this, "GetSynapseDocumentState", request);
756
+ }
757
+
754
758
  SaveSynapse(request) {
755
759
  return unaryCallInternal.call(this, "SaveSynapse", request);
756
760
  }
@@ -774,6 +778,16 @@ export class VoltClient extends EventEmitter {
774
778
  return syncDocumentCall.start(grpcClient, request);
775
779
  }
776
780
 
781
+ WatchSynapseDocumentState(request) {
782
+ const grpcClient = this.getVoltAPIClient();
783
+
784
+ const watchDocumentStateCall = new GRPCCall(
785
+ this,
786
+ "WatchSynapseDocumentState",
787
+ "METHOD_TYPE_BIDI"
788
+ );
789
+ }
790
+
777
791
  WatchSynapsePath(request) {
778
792
  const grpcClient = this.getVoltAPIClient();
779
793
 
@@ -1222,6 +1222,12 @@ service SyncAPI {
1222
1222
  // Watch synapse paths for changes.
1223
1223
  rpc WatchSynapsePath(stream WatchSynapsePathRequest) returns (stream WatchSynapsePathResponse);
1224
1224
 
1225
+ // Get the state of a synapse document on this Volt. Reports whether the content this Volt holds matches the \`__hash\` advertised in the synapse metadata.
1226
+ rpc GetSynapseDocumentState(GetSynapseDocumentStateRequest) returns (GetSynapseDocumentStateResponse);
1227
+
1228
+ // Watch synapse documents for state changes. The server sends the current state of every watched document before any subsequent transitions, so a watcher started after content lands does not miss it.
1229
+ rpc WatchSynapseDocumentState(stream WatchSynapseDocumentStateRequest) returns (stream WatchSynapseDocumentStateResponse);
1230
+
1225
1231
  // Write a single value to a given synapse JSON path.
1226
1232
  rpc WriteSynapsePath(WriteSynapsePathRequest) returns (WriteSynapsePathResponse);
1227
1233
 
@@ -1432,8 +1438,8 @@ message SetSynapseDocumentMetadataRequest {
1432
1438
  // Any additional application-specific JSON to attach to the document.
1433
1439
  string json = 4;
1434
1440
 
1435
- // Set to true when the document content is already present (content-first) or the document is intentionally empty, so the server bootstraps \`__hash\` immediately. Leave false (the default) when content will be written after this call.
1436
- bool content_ready = 6;
1441
+ // Set to true to publish \`__hash\` immediately, because the content is already present (content-first) or the document is intentionally empty. Leave false (the default) when content will be written after this call, in which case the server publishes \`__hash\` once that content arrives. This is creator intent at create time; it says nothing about whether other Volts hold the content (see GetSynapseDocumentState).
1442
+ bool publish_hash = 6;
1437
1443
 
1438
1444
  // For blob documents, the content hash to bind. The server verifies the blob is stored (or the hash is sha256 of empty bytes) and writes \`__hash\`. Omit for a metadata-first create. Must not be set for map/array/text documents; the server computes those hashes from Yjs content.
1439
1445
  string blob_hash = 7;
@@ -1506,9 +1512,6 @@ message SyncDocumentResponse {
1506
1512
 
1507
1513
  // Parameters to start watching synapse paths. Sent as the first message.
1508
1514
  message WatchSynapsePathStart {
1509
- // DEPRECATED: Use synapse_id instead.
1510
- string database_id = 1;
1511
-
1512
1515
  // The id of the synapse that contains the document.
1513
1516
  string synapse_id = 4;
1514
1517
 
@@ -1669,16 +1672,100 @@ message RevertSyncDocumentVersionResponse {
1669
1672
  string version_id = 2;
1670
1673
  }
1671
1674
 
1675
+ // The state of a synapse document. \`__hash\` in the synapse metadata says what the content is; this says whether this Volt holds it yet. Metadata replicates independently of content, so a document can be ANNOUNCED here and READY on the Volt that produced it.
1676
+ enum SynapseDocumentState {
1677
+ SYNAPSE_DOCUMENT_STATE_UNKNOWN = 0;
1678
+
1679
+ // No metadata entry for this document on this Volt.
1680
+ SYNAPSE_DOCUMENT_STATE_ABSENT = 1;
1681
+
1682
+ // Metadata entry exists but no \`__hash\` has been published yet, so no content has been committed. See SetSynapseDocumentMetadata.publish_hash.
1683
+ SYNAPSE_DOCUMENT_STATE_DRAFT = 2;
1684
+
1685
+ // \`__hash\` is published but the content this Volt holds does not match it. The content is still in flight; wait for READY before reading it.
1686
+ SYNAPSE_DOCUMENT_STATE_ANNOUNCED = 3;
1687
+
1688
+ // The content this Volt holds matches \`__hash\`. The document can be read.
1689
+ SYNAPSE_DOCUMENT_STATE_READY = 4;
1690
+
1691
+ // The metadata entry was removed.
1692
+ SYNAPSE_DOCUMENT_STATE_DELETED = 5;
1693
+ }
1694
+
1695
+ message GetSynapseDocumentStateRequest {
1696
+ // The id of the synapse that contains the document.
1697
+ string synapse_id = 1;
1698
+
1699
+ // The id of the document to query.
1700
+ string document_id = 2;
1701
+ }
1702
+
1703
+ message GetSynapseDocumentStateResponse {
1704
+ // Details of any error that occurred on the call.
1705
+ tdx.volt_api.volt.v1.Status status = 1;
1706
+
1707
+ // The state of the document.
1708
+ SynapseDocumentState state = 2;
1709
+
1710
+ // The content hash advertised in the synapse metadata (\`__hash\`). Empty for ABSENT and DRAFT documents.
1711
+ string hash = 3;
1712
+
1713
+ // The content hash this Volt actually holds. Empty when no content has landed here yet. Equal to \`hash\` when the state is READY.
1714
+ string local_hash = 4;
1715
+ }
1716
+
1717
+ // Parameters to start watching synapse document state. Sent as the first message.
1718
+ message WatchSynapseDocumentStateStart {
1719
+ // The id of the synapse to watch.
1720
+ string synapse_id = 1;
1721
+
1722
+ // The ids of the documents to watch. Leave empty to watch every document in the synapse, including documents added after the watch starts.
1723
+ repeated string document_id = 2;
1724
+ }
1725
+
1726
+ message WatchSynapseDocumentStateRequest {
1727
+ oneof payload {
1728
+ // Start watching; must be sent as the first message.
1729
+ WatchSynapseDocumentStateStart start = 1;
1730
+
1731
+ // Request to stop the watch.
1732
+ bool stop = 2;
1733
+ }
1734
+ }
1735
+
1736
+ message WatchSynapseDocumentStateUpdate {
1737
+ // The id of the document whose state changed.
1738
+ string document_id = 1;
1739
+
1740
+ SynapseDocumentState state = 2;
1741
+
1742
+ // The content hash advertised in the synapse metadata (\`__hash\`).
1743
+ string hash = 3;
1744
+
1745
+ // The content hash this Volt actually holds.
1746
+ string local_hash = 4;
1747
+ }
1748
+
1749
+ message WatchSynapseDocumentStateResponse {
1750
+ oneof result {
1751
+ // Details of any error that occurred on the call.
1752
+ tdx.volt_api.volt.v1.Status status = 1;
1753
+
1754
+ // A document state update.
1755
+ WatchSynapseDocumentStateUpdate update = 2;
1756
+ }
1757
+ }
1758
+
1672
1759
  message HasSynapseBlobRequest {
1673
1760
  // The id of the synapse that stores the blob.
1674
1761
  string synapse_id = 1;
1675
1762
 
1676
- // sha256 of the raw file bytes, encoded as unpadded base64url (same family
1677
- // as VoltDrive content hashes).
1763
+ // SHA-256 of the raw file bytes, encoded as unpadded base64url.
1678
1764
  string hash = 2;
1679
1765
  }
1680
1766
 
1681
1767
  message HasSynapseBlobResponse {
1768
+ // Details of any error that occurred on the call.
1682
1769
  tdx.volt_api.volt.v1.Status status = 1;
1683
1770
 
1684
1771
  // True if a blob with this hash is already stored.
@@ -1686,6 +1773,7 @@ message HasSynapseBlobResponse {
1686
1773
  }
1687
1774
 
1688
1775
  message PutSynapseBlobStart {
1776
+ // The id of the synapse that stores the blob.
1689
1777
  string synapse_id = 1;
1690
1778
 
1691
1779
  // Expected sha256 (base64url) of the concatenated payload bytes.
@@ -1716,13 +1804,20 @@ message PutSynapseBlobResponse {
1716
1804
  }
1717
1805
 
1718
1806
  message GetSynapseBlobRequest {
1807
+ // The id of the synapse that stores the blob.
1719
1808
  string synapse_id = 1;
1809
+
1810
+ // SHA-256 of the raw file bytes, encoded as unpadded base64url.
1720
1811
  string hash = 2;
1721
1812
  }
1722
1813
 
1723
1814
  message GetSynapseBlobResponse {
1815
+ // The next chunk of blob data or details of any error that occurred on the call.
1724
1816
  oneof payload {
1817
+ // The next chunk of blob data.
1725
1818
  bytes block = 1;
1819
+
1820
+ // Details of any error that occurred on the call.
1726
1821
  tdx.volt_api.volt.v1.Status status = 2;
1727
1822
  }
1728
1823
  }
@@ -2100,6 +2195,9 @@ message VoltParameters {
2100
2195
 
2101
2196
  // Optional per-method gRPC rate limits (see GrpcRpcRateLimit). Keyed by peer identity or fingerprint.
2102
2197
  repeated GrpcRpcRateLimit grpc_rpc_rate_limit = 57;
2198
+
2199
+ // Deadline in milliseconds for outbound unary gRPC calls made by this Volt (relay, synapse, mirroring, drive and DID registry calls). If unset or zero, the built-in defaults are used.
2200
+ uint32 grpc_unary_deadline = 58;
2103
2201
  }
2104
2202
 
2105
2203
  message VoltEndpoint {