@miradorlabs/web-grpc 2.26.1 → 2.28.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miradorlabs/web-grpc",
3
- "version": "2.26.1",
3
+ "version": "2.28.0",
4
4
  "description": "Generated gRPC (grpc-js) client stubs for the Mirador web gateway.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1734,22 +1734,22 @@ export interface StreamTraceMetadataRequest {
1734
1734
  }
1735
1735
 
1736
1736
  /**
1737
- * TraceMetadataEnvelope wraps metadata stream events
1738
- * First message is always a snapshot, followed by incremental updates
1737
+ * Every event is a complete replacement snapshot. Consumers must replace their
1738
+ * local catalogue on every snapshot so expiry and truncation remain exact.
1739
1739
  */
1740
1740
  export interface TraceMetadataEnvelope {
1741
- snapshot?: MetadataSnapshot | undefined;
1742
- update?: MetadataUpdate | undefined;
1741
+ snapshot: MetadataSnapshot | undefined;
1743
1742
  }
1744
1743
 
1745
- /**
1746
- * MetadataSnapshot contains the full metadata state for initial load
1747
- * Two shapes: attributes (all key/values), tags (all unique tags)
1748
- */
1744
+ /** MetadataSnapshot contains the complete bounded state for its reported window. */
1749
1745
  export interface MetadataSnapshot {
1750
1746
  /** all key -> unique values */
1751
1747
  attributes: { [key: string]: AttributeValues };
1752
1748
  tags: string[];
1749
+ rangeStart?: Date | undefined;
1750
+ rangeEnd?: Date | undefined;
1751
+ attributesTruncated: boolean;
1752
+ tagsTruncated: boolean;
1753
1753
  }
1754
1754
 
1755
1755
  export interface MetadataSnapshot_AttributesEntry {
@@ -1757,21 +1757,10 @@ export interface MetadataSnapshot_AttributesEntry {
1757
1757
  value: AttributeValues | undefined;
1758
1758
  }
1759
1759
 
1760
- /** MetadataUpdate contains incremental metadata changes */
1761
- export interface MetadataUpdate {
1762
- /** new key/values */
1763
- addedAttributes: { [key: string]: AttributeValues };
1764
- addedTags: string[];
1765
- }
1766
-
1767
- export interface MetadataUpdate_AddedAttributesEntry {
1768
- key: string;
1769
- value: AttributeValues | undefined;
1770
- }
1771
-
1772
1760
  /** AttributeValues holds unique values for an attribute key */
1773
1761
  export interface AttributeValues {
1774
1762
  values: string[];
1763
+ valuesTruncated: boolean;
1775
1764
  }
1776
1765
 
1777
1766
  export interface DeleteTraceRequest {
@@ -4909,7 +4898,7 @@ export const StreamTraceMetadataRequest: MessageFns<StreamTraceMetadataRequest>
4909
4898
  };
4910
4899
 
4911
4900
  function createBaseTraceMetadataEnvelope(): TraceMetadataEnvelope {
4912
- return { snapshot: undefined, update: undefined };
4901
+ return { snapshot: undefined };
4913
4902
  }
4914
4903
 
4915
4904
  export const TraceMetadataEnvelope: MessageFns<TraceMetadataEnvelope> = {
@@ -4917,9 +4906,6 @@ export const TraceMetadataEnvelope: MessageFns<TraceMetadataEnvelope> = {
4917
4906
  if (message.snapshot !== undefined) {
4918
4907
  MetadataSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
4919
4908
  }
4920
- if (message.update !== undefined) {
4921
- MetadataUpdate.encode(message.update, writer.uint32(18).fork()).join();
4922
- }
4923
4909
  return writer;
4924
4910
  },
4925
4911
 
@@ -4938,14 +4924,6 @@ export const TraceMetadataEnvelope: MessageFns<TraceMetadataEnvelope> = {
4938
4924
  message.snapshot = MetadataSnapshot.decode(reader, reader.uint32());
4939
4925
  continue;
4940
4926
  }
4941
- case 2: {
4942
- if (tag !== 18) {
4943
- break;
4944
- }
4945
-
4946
- message.update = MetadataUpdate.decode(reader, reader.uint32());
4947
- continue;
4948
- }
4949
4927
  }
4950
4928
  if ((tag & 7) === 4 || tag === 0) {
4951
4929
  break;
@@ -4956,10 +4934,7 @@ export const TraceMetadataEnvelope: MessageFns<TraceMetadataEnvelope> = {
4956
4934
  },
4957
4935
 
4958
4936
  fromJSON(object: any): TraceMetadataEnvelope {
4959
- return {
4960
- snapshot: isSet(object.snapshot) ? MetadataSnapshot.fromJSON(object.snapshot) : undefined,
4961
- update: isSet(object.update) ? MetadataUpdate.fromJSON(object.update) : undefined,
4962
- };
4937
+ return { snapshot: isSet(object.snapshot) ? MetadataSnapshot.fromJSON(object.snapshot) : undefined };
4963
4938
  },
4964
4939
 
4965
4940
  toJSON(message: TraceMetadataEnvelope): unknown {
@@ -4967,9 +4942,6 @@ export const TraceMetadataEnvelope: MessageFns<TraceMetadataEnvelope> = {
4967
4942
  if (message.snapshot !== undefined) {
4968
4943
  obj.snapshot = MetadataSnapshot.toJSON(message.snapshot);
4969
4944
  }
4970
- if (message.update !== undefined) {
4971
- obj.update = MetadataUpdate.toJSON(message.update);
4972
- }
4973
4945
  return obj;
4974
4946
  },
4975
4947
 
@@ -4981,15 +4953,19 @@ export const TraceMetadataEnvelope: MessageFns<TraceMetadataEnvelope> = {
4981
4953
  message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
4982
4954
  ? MetadataSnapshot.fromPartial(object.snapshot)
4983
4955
  : undefined;
4984
- message.update = (object.update !== undefined && object.update !== null)
4985
- ? MetadataUpdate.fromPartial(object.update)
4986
- : undefined;
4987
4956
  return message;
4988
4957
  },
4989
4958
  };
4990
4959
 
4991
4960
  function createBaseMetadataSnapshot(): MetadataSnapshot {
4992
- return { attributes: {}, tags: [] };
4961
+ return {
4962
+ attributes: {},
4963
+ tags: [],
4964
+ rangeStart: undefined,
4965
+ rangeEnd: undefined,
4966
+ attributesTruncated: false,
4967
+ tagsTruncated: false,
4968
+ };
4993
4969
  }
4994
4970
 
4995
4971
  export const MetadataSnapshot: MessageFns<MetadataSnapshot> = {
@@ -5000,6 +4976,18 @@ export const MetadataSnapshot: MessageFns<MetadataSnapshot> = {
5000
4976
  for (const v of message.tags) {
5001
4977
  writer.uint32(18).string(v!);
5002
4978
  }
4979
+ if (message.rangeStart !== undefined) {
4980
+ Timestamp.encode(toTimestamp(message.rangeStart), writer.uint32(26).fork()).join();
4981
+ }
4982
+ if (message.rangeEnd !== undefined) {
4983
+ Timestamp.encode(toTimestamp(message.rangeEnd), writer.uint32(34).fork()).join();
4984
+ }
4985
+ if (message.attributesTruncated !== false) {
4986
+ writer.uint32(40).bool(message.attributesTruncated);
4987
+ }
4988
+ if (message.tagsTruncated !== false) {
4989
+ writer.uint32(48).bool(message.tagsTruncated);
4990
+ }
5003
4991
  return writer;
5004
4992
  },
5005
4993
 
@@ -5029,6 +5017,38 @@ export const MetadataSnapshot: MessageFns<MetadataSnapshot> = {
5029
5017
  message.tags.push(reader.string());
5030
5018
  continue;
5031
5019
  }
5020
+ case 3: {
5021
+ if (tag !== 26) {
5022
+ break;
5023
+ }
5024
+
5025
+ message.rangeStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
5026
+ continue;
5027
+ }
5028
+ case 4: {
5029
+ if (tag !== 34) {
5030
+ break;
5031
+ }
5032
+
5033
+ message.rangeEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
5034
+ continue;
5035
+ }
5036
+ case 5: {
5037
+ if (tag !== 40) {
5038
+ break;
5039
+ }
5040
+
5041
+ message.attributesTruncated = reader.bool();
5042
+ continue;
5043
+ }
5044
+ case 6: {
5045
+ if (tag !== 48) {
5046
+ break;
5047
+ }
5048
+
5049
+ message.tagsTruncated = reader.bool();
5050
+ continue;
5051
+ }
5032
5052
  }
5033
5053
  if ((tag & 7) === 4 || tag === 0) {
5034
5054
  break;
@@ -5050,6 +5070,26 @@ export const MetadataSnapshot: MessageFns<MetadataSnapshot> = {
5050
5070
  )
5051
5071
  : {},
5052
5072
  tags: globalThis.Array.isArray(object?.tags) ? object.tags.map((e: any) => globalThis.String(e)) : [],
5073
+ rangeStart: isSet(object.rangeStart)
5074
+ ? fromJsonTimestamp(object.rangeStart)
5075
+ : isSet(object.range_start)
5076
+ ? fromJsonTimestamp(object.range_start)
5077
+ : undefined,
5078
+ rangeEnd: isSet(object.rangeEnd)
5079
+ ? fromJsonTimestamp(object.rangeEnd)
5080
+ : isSet(object.range_end)
5081
+ ? fromJsonTimestamp(object.range_end)
5082
+ : undefined,
5083
+ attributesTruncated: isSet(object.attributesTruncated)
5084
+ ? globalThis.Boolean(object.attributesTruncated)
5085
+ : isSet(object.attributes_truncated)
5086
+ ? globalThis.Boolean(object.attributes_truncated)
5087
+ : false,
5088
+ tagsTruncated: isSet(object.tagsTruncated)
5089
+ ? globalThis.Boolean(object.tagsTruncated)
5090
+ : isSet(object.tags_truncated)
5091
+ ? globalThis.Boolean(object.tags_truncated)
5092
+ : false,
5053
5093
  };
5054
5094
  },
5055
5095
 
@@ -5067,6 +5107,18 @@ export const MetadataSnapshot: MessageFns<MetadataSnapshot> = {
5067
5107
  if (message.tags?.length) {
5068
5108
  obj.tags = message.tags;
5069
5109
  }
5110
+ if (message.rangeStart !== undefined) {
5111
+ obj.rangeStart = message.rangeStart.toISOString();
5112
+ }
5113
+ if (message.rangeEnd !== undefined) {
5114
+ obj.rangeEnd = message.rangeEnd.toISOString();
5115
+ }
5116
+ if (message.attributesTruncated !== false) {
5117
+ obj.attributesTruncated = message.attributesTruncated;
5118
+ }
5119
+ if (message.tagsTruncated !== false) {
5120
+ obj.tagsTruncated = message.tagsTruncated;
5121
+ }
5070
5122
  return obj;
5071
5123
  },
5072
5124
 
@@ -5085,6 +5137,10 @@ export const MetadataSnapshot: MessageFns<MetadataSnapshot> = {
5085
5137
  {},
5086
5138
  );
5087
5139
  message.tags = object.tags?.map((e) => e) || [];
5140
+ message.rangeStart = object.rangeStart ?? undefined;
5141
+ message.rangeEnd = object.rangeEnd ?? undefined;
5142
+ message.attributesTruncated = object.attributesTruncated ?? false;
5143
+ message.tagsTruncated = object.tagsTruncated ?? false;
5088
5144
  return message;
5089
5145
  },
5090
5146
  };
@@ -5171,201 +5227,8 @@ export const MetadataSnapshot_AttributesEntry: MessageFns<MetadataSnapshot_Attri
5171
5227
  },
5172
5228
  };
5173
5229
 
5174
- function createBaseMetadataUpdate(): MetadataUpdate {
5175
- return { addedAttributes: {}, addedTags: [] };
5176
- }
5177
-
5178
- export const MetadataUpdate: MessageFns<MetadataUpdate> = {
5179
- encode(message: MetadataUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
5180
- globalThis.Object.entries(message.addedAttributes).forEach(([key, value]: [string, AttributeValues]) => {
5181
- MetadataUpdate_AddedAttributesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
5182
- });
5183
- for (const v of message.addedTags) {
5184
- writer.uint32(18).string(v!);
5185
- }
5186
- return writer;
5187
- },
5188
-
5189
- decode(input: BinaryReader | Uint8Array, length?: number): MetadataUpdate {
5190
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
5191
- const end = length === undefined ? reader.len : reader.pos + length;
5192
- const message = createBaseMetadataUpdate();
5193
- while (reader.pos < end) {
5194
- const tag = reader.uint32();
5195
- switch (tag >>> 3) {
5196
- case 1: {
5197
- if (tag !== 10) {
5198
- break;
5199
- }
5200
-
5201
- const entry1 = MetadataUpdate_AddedAttributesEntry.decode(reader, reader.uint32());
5202
- if (entry1.value !== undefined) {
5203
- message.addedAttributes[entry1.key] = entry1.value;
5204
- }
5205
- continue;
5206
- }
5207
- case 2: {
5208
- if (tag !== 18) {
5209
- break;
5210
- }
5211
-
5212
- message.addedTags.push(reader.string());
5213
- continue;
5214
- }
5215
- }
5216
- if ((tag & 7) === 4 || tag === 0) {
5217
- break;
5218
- }
5219
- reader.skip(tag & 7);
5220
- }
5221
- return message;
5222
- },
5223
-
5224
- fromJSON(object: any): MetadataUpdate {
5225
- return {
5226
- addedAttributes: isObject(object.addedAttributes)
5227
- ? (globalThis.Object.entries(object.addedAttributes) as [string, any][]).reduce(
5228
- (acc: { [key: string]: AttributeValues }, [key, value]: [string, any]) => {
5229
- acc[key] = AttributeValues.fromJSON(value);
5230
- return acc;
5231
- },
5232
- {},
5233
- )
5234
- : isObject(object.added_attributes)
5235
- ? (globalThis.Object.entries(object.added_attributes) as [string, any][]).reduce(
5236
- (acc: { [key: string]: AttributeValues }, [key, value]: [string, any]) => {
5237
- acc[key] = AttributeValues.fromJSON(value);
5238
- return acc;
5239
- },
5240
- {},
5241
- )
5242
- : {},
5243
- addedTags: globalThis.Array.isArray(object?.addedTags)
5244
- ? object.addedTags.map((e: any) => globalThis.String(e))
5245
- : globalThis.Array.isArray(object?.added_tags)
5246
- ? object.added_tags.map((e: any) => globalThis.String(e))
5247
- : [],
5248
- };
5249
- },
5250
-
5251
- toJSON(message: MetadataUpdate): unknown {
5252
- const obj: any = {};
5253
- if (message.addedAttributes) {
5254
- const entries = globalThis.Object.entries(message.addedAttributes) as [string, AttributeValues][];
5255
- if (entries.length > 0) {
5256
- obj.addedAttributes = {};
5257
- entries.forEach(([k, v]) => {
5258
- obj.addedAttributes[k] = AttributeValues.toJSON(v);
5259
- });
5260
- }
5261
- }
5262
- if (message.addedTags?.length) {
5263
- obj.addedTags = message.addedTags;
5264
- }
5265
- return obj;
5266
- },
5267
-
5268
- create<I extends Exact<DeepPartial<MetadataUpdate>, I>>(base?: I): MetadataUpdate {
5269
- return MetadataUpdate.fromPartial(base ?? ({} as any));
5270
- },
5271
- fromPartial<I extends Exact<DeepPartial<MetadataUpdate>, I>>(object: I): MetadataUpdate {
5272
- const message = createBaseMetadataUpdate();
5273
- message.addedAttributes = (globalThis.Object.entries(object.addedAttributes ?? {}) as [string, AttributeValues][])
5274
- .reduce((acc: { [key: string]: AttributeValues }, [key, value]: [string, AttributeValues]) => {
5275
- if (value !== undefined) {
5276
- acc[key] = AttributeValues.fromPartial(value);
5277
- }
5278
- return acc;
5279
- }, {});
5280
- message.addedTags = object.addedTags?.map((e) => e) || [];
5281
- return message;
5282
- },
5283
- };
5284
-
5285
- function createBaseMetadataUpdate_AddedAttributesEntry(): MetadataUpdate_AddedAttributesEntry {
5286
- return { key: "", value: undefined };
5287
- }
5288
-
5289
- export const MetadataUpdate_AddedAttributesEntry: MessageFns<MetadataUpdate_AddedAttributesEntry> = {
5290
- encode(message: MetadataUpdate_AddedAttributesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
5291
- if (message.key !== "") {
5292
- writer.uint32(10).string(message.key);
5293
- }
5294
- if (message.value !== undefined) {
5295
- AttributeValues.encode(message.value, writer.uint32(18).fork()).join();
5296
- }
5297
- return writer;
5298
- },
5299
-
5300
- decode(input: BinaryReader | Uint8Array, length?: number): MetadataUpdate_AddedAttributesEntry {
5301
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
5302
- const end = length === undefined ? reader.len : reader.pos + length;
5303
- const message = createBaseMetadataUpdate_AddedAttributesEntry();
5304
- while (reader.pos < end) {
5305
- const tag = reader.uint32();
5306
- switch (tag >>> 3) {
5307
- case 1: {
5308
- if (tag !== 10) {
5309
- break;
5310
- }
5311
-
5312
- message.key = reader.string();
5313
- continue;
5314
- }
5315
- case 2: {
5316
- if (tag !== 18) {
5317
- break;
5318
- }
5319
-
5320
- message.value = AttributeValues.decode(reader, reader.uint32());
5321
- continue;
5322
- }
5323
- }
5324
- if ((tag & 7) === 4 || tag === 0) {
5325
- break;
5326
- }
5327
- reader.skip(tag & 7);
5328
- }
5329
- return message;
5330
- },
5331
-
5332
- fromJSON(object: any): MetadataUpdate_AddedAttributesEntry {
5333
- return {
5334
- key: isSet(object.key) ? globalThis.String(object.key) : "",
5335
- value: isSet(object.value) ? AttributeValues.fromJSON(object.value) : undefined,
5336
- };
5337
- },
5338
-
5339
- toJSON(message: MetadataUpdate_AddedAttributesEntry): unknown {
5340
- const obj: any = {};
5341
- if (message.key !== "") {
5342
- obj.key = message.key;
5343
- }
5344
- if (message.value !== undefined) {
5345
- obj.value = AttributeValues.toJSON(message.value);
5346
- }
5347
- return obj;
5348
- },
5349
-
5350
- create<I extends Exact<DeepPartial<MetadataUpdate_AddedAttributesEntry>, I>>(
5351
- base?: I,
5352
- ): MetadataUpdate_AddedAttributesEntry {
5353
- return MetadataUpdate_AddedAttributesEntry.fromPartial(base ?? ({} as any));
5354
- },
5355
- fromPartial<I extends Exact<DeepPartial<MetadataUpdate_AddedAttributesEntry>, I>>(
5356
- object: I,
5357
- ): MetadataUpdate_AddedAttributesEntry {
5358
- const message = createBaseMetadataUpdate_AddedAttributesEntry();
5359
- message.key = object.key ?? "";
5360
- message.value = (object.value !== undefined && object.value !== null)
5361
- ? AttributeValues.fromPartial(object.value)
5362
- : undefined;
5363
- return message;
5364
- },
5365
- };
5366
-
5367
5230
  function createBaseAttributeValues(): AttributeValues {
5368
- return { values: [] };
5231
+ return { values: [], valuesTruncated: false };
5369
5232
  }
5370
5233
 
5371
5234
  export const AttributeValues: MessageFns<AttributeValues> = {
@@ -5373,6 +5236,9 @@ export const AttributeValues: MessageFns<AttributeValues> = {
5373
5236
  for (const v of message.values) {
5374
5237
  writer.uint32(10).string(v!);
5375
5238
  }
5239
+ if (message.valuesTruncated !== false) {
5240
+ writer.uint32(16).bool(message.valuesTruncated);
5241
+ }
5376
5242
  return writer;
5377
5243
  },
5378
5244
 
@@ -5391,6 +5257,14 @@ export const AttributeValues: MessageFns<AttributeValues> = {
5391
5257
  message.values.push(reader.string());
5392
5258
  continue;
5393
5259
  }
5260
+ case 2: {
5261
+ if (tag !== 16) {
5262
+ break;
5263
+ }
5264
+
5265
+ message.valuesTruncated = reader.bool();
5266
+ continue;
5267
+ }
5394
5268
  }
5395
5269
  if ((tag & 7) === 4 || tag === 0) {
5396
5270
  break;
@@ -5403,6 +5277,11 @@ export const AttributeValues: MessageFns<AttributeValues> = {
5403
5277
  fromJSON(object: any): AttributeValues {
5404
5278
  return {
5405
5279
  values: globalThis.Array.isArray(object?.values) ? object.values.map((e: any) => globalThis.String(e)) : [],
5280
+ valuesTruncated: isSet(object.valuesTruncated)
5281
+ ? globalThis.Boolean(object.valuesTruncated)
5282
+ : isSet(object.values_truncated)
5283
+ ? globalThis.Boolean(object.values_truncated)
5284
+ : false,
5406
5285
  };
5407
5286
  },
5408
5287
 
@@ -5411,6 +5290,9 @@ export const AttributeValues: MessageFns<AttributeValues> = {
5411
5290
  if (message.values?.length) {
5412
5291
  obj.values = message.values;
5413
5292
  }
5293
+ if (message.valuesTruncated !== false) {
5294
+ obj.valuesTruncated = message.valuesTruncated;
5295
+ }
5414
5296
  return obj;
5415
5297
  },
5416
5298
 
@@ -5420,6 +5302,7 @@ export const AttributeValues: MessageFns<AttributeValues> = {
5420
5302
  fromPartial<I extends Exact<DeepPartial<AttributeValues>, I>>(object: I): AttributeValues {
5421
5303
  const message = createBaseAttributeValues();
5422
5304
  message.values = object.values?.map((e) => e) || [];
5305
+ message.valuesTruncated = object.valuesTruncated ?? false;
5423
5306
  return message;
5424
5307
  },
5425
5308
  };