@miradorlabs/web-grpc 3.37.0 → 3.38.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": "3.37.0",
3
+ "version": "3.38.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",
@@ -551,6 +551,49 @@ export function aIResourceDimensionToJSON(object: AIResourceDimension): string {
551
551
  }
552
552
  }
553
553
 
554
+ /**
555
+ * AIResourceRankingGroupBy mirrors telemetry.api.v1.AIResourceRankingGroupBy. Unspecified ranks the whole
556
+ * filtered set once.
557
+ */
558
+ export enum AIResourceRankingGroupBy {
559
+ AI_RESOURCE_RANKING_GROUP_BY_UNSPECIFIED = 0,
560
+ /**
561
+ * AI_RESOURCE_RANKING_GROUP_BY_PRINCIPAL - One ranking per principal on the source system that reported it, each what a request filtered to that principal's
562
+ * id and source returns: an event ranks under its user id and under its api key. Work that recorded neither ranks
563
+ * under an API_KEY principal with an empty id, which no filter selects alone (an empty api_key_ids entry also
564
+ * matches user-only work). SKILL / TOOL / COMMAND only.
565
+ */
566
+ AI_RESOURCE_RANKING_GROUP_BY_PRINCIPAL = 1,
567
+ UNRECOGNIZED = -1,
568
+ }
569
+
570
+ export function aIResourceRankingGroupByFromJSON(object: any): AIResourceRankingGroupBy {
571
+ switch (object) {
572
+ case 0:
573
+ case "AI_RESOURCE_RANKING_GROUP_BY_UNSPECIFIED":
574
+ return AIResourceRankingGroupBy.AI_RESOURCE_RANKING_GROUP_BY_UNSPECIFIED;
575
+ case 1:
576
+ case "AI_RESOURCE_RANKING_GROUP_BY_PRINCIPAL":
577
+ return AIResourceRankingGroupBy.AI_RESOURCE_RANKING_GROUP_BY_PRINCIPAL;
578
+ case -1:
579
+ case "UNRECOGNIZED":
580
+ default:
581
+ return AIResourceRankingGroupBy.UNRECOGNIZED;
582
+ }
583
+ }
584
+
585
+ export function aIResourceRankingGroupByToJSON(object: AIResourceRankingGroupBy): string {
586
+ switch (object) {
587
+ case AIResourceRankingGroupBy.AI_RESOURCE_RANKING_GROUP_BY_UNSPECIFIED:
588
+ return "AI_RESOURCE_RANKING_GROUP_BY_UNSPECIFIED";
589
+ case AIResourceRankingGroupBy.AI_RESOURCE_RANKING_GROUP_BY_PRINCIPAL:
590
+ return "AI_RESOURCE_RANKING_GROUP_BY_PRINCIPAL";
591
+ case AIResourceRankingGroupBy.UNRECOGNIZED:
592
+ default:
593
+ return "UNRECOGNIZED";
594
+ }
595
+ }
596
+
554
597
  export enum AIFileLifecycle {
555
598
  AI_FILE_LIFECYCLE_UNSPECIFIED = 0,
556
599
  AI_FILE_LIFECYCLE_UNLANDED = 1,
@@ -1918,12 +1961,21 @@ export interface ResourceRankingsRequest {
1918
1961
  projectId: string;
1919
1962
  filter: AISessionFilter | undefined;
1920
1963
  dimension: AIResourceDimension;
1964
+ /** Splits the ranking into one top-limit list per group. Unspecified ranks the filtered set once. */
1965
+ groupBy: AIResourceRankingGroupBy;
1921
1966
  timeWindow: AnalyticsTimeWindow;
1967
+ /** Max rows, per group when group_by is set; 0 = the default 10, capped at 100. */
1922
1968
  limit: number;
1923
1969
  }
1924
1970
 
1925
1971
  export interface ResourceRankingsResponse {
1926
- status: ResponseStatus | undefined;
1972
+ status:
1973
+ | ResponseStatus
1974
+ | undefined;
1975
+ /**
1976
+ * Ungrouped: count descending, then key. Grouped: by principal kind, id and source system, then count descending
1977
+ * and key within each.
1978
+ */
1927
1979
  rankings: ResourceRanking[];
1928
1980
  dimension: AIResourceDimension;
1929
1981
  windowStart: Date | undefined;
@@ -1936,6 +1988,11 @@ export interface ResourceRanking {
1936
1988
  count: number;
1937
1989
  priorCount: number;
1938
1990
  sessionCount: number;
1991
+ /**
1992
+ * The principal this row ranks under; set only when the request's group_by is PRINCIPAL. An event with both a user id
1993
+ * and an api key ranks under each, unlike DailyActivity's one principal per row (user id, else api key).
1994
+ */
1995
+ principal: DailyActivityPrincipal | undefined;
1939
1996
  }
1940
1997
 
1941
1998
  export interface ModelActivityRequest {
@@ -15263,7 +15320,7 @@ export const ProjectSessionRef: MessageFns<ProjectSessionRef> = {
15263
15320
  };
15264
15321
 
15265
15322
  function createBaseResourceRankingsRequest(): ResourceRankingsRequest {
15266
- return { organizationId: "", projectId: "", filter: undefined, dimension: 0, timeWindow: 0, limit: 0 };
15323
+ return { organizationId: "", projectId: "", filter: undefined, dimension: 0, groupBy: 0, timeWindow: 0, limit: 0 };
15267
15324
  }
15268
15325
 
15269
15326
  export const ResourceRankingsRequest: MessageFns<ResourceRankingsRequest> = {
@@ -15280,6 +15337,9 @@ export const ResourceRankingsRequest: MessageFns<ResourceRankingsRequest> = {
15280
15337
  if (message.dimension !== 0) {
15281
15338
  writer.uint32(32).int32(message.dimension);
15282
15339
  }
15340
+ if (message.groupBy !== 0) {
15341
+ writer.uint32(56).int32(message.groupBy);
15342
+ }
15283
15343
  if (message.timeWindow !== 0) {
15284
15344
  writer.uint32(40).int32(message.timeWindow);
15285
15345
  }
@@ -15334,6 +15394,14 @@ export const ResourceRankingsRequest: MessageFns<ResourceRankingsRequest> = {
15334
15394
  message.dimension = reader.int32() as any;
15335
15395
  continue;
15336
15396
  }
15397
+ case 7: {
15398
+ if (tag !== 56) {
15399
+ break;
15400
+ }
15401
+
15402
+ message.groupBy = reader.int32() as any;
15403
+ continue;
15404
+ }
15337
15405
  case 5: {
15338
15406
  if (tag !== 40) {
15339
15407
  break;
@@ -15376,6 +15444,11 @@ export const ResourceRankingsRequest: MessageFns<ResourceRankingsRequest> = {
15376
15444
  : "",
15377
15445
  filter: isSet(object.filter) ? AISessionFilter.fromJSON(object.filter) : undefined,
15378
15446
  dimension: isSet(object.dimension) ? aIResourceDimensionFromJSON(object.dimension) : 0,
15447
+ groupBy: isSet(object.groupBy)
15448
+ ? aIResourceRankingGroupByFromJSON(object.groupBy)
15449
+ : isSet(object.group_by)
15450
+ ? aIResourceRankingGroupByFromJSON(object.group_by)
15451
+ : 0,
15379
15452
  timeWindow: isSet(object.timeWindow)
15380
15453
  ? analyticsTimeWindowFromJSON(object.timeWindow)
15381
15454
  : isSet(object.time_window)
@@ -15399,6 +15472,9 @@ export const ResourceRankingsRequest: MessageFns<ResourceRankingsRequest> = {
15399
15472
  if (message.dimension !== 0) {
15400
15473
  obj.dimension = aIResourceDimensionToJSON(message.dimension);
15401
15474
  }
15475
+ if (message.groupBy !== 0) {
15476
+ obj.groupBy = aIResourceRankingGroupByToJSON(message.groupBy);
15477
+ }
15402
15478
  if (message.timeWindow !== 0) {
15403
15479
  obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
15404
15480
  }
@@ -15419,6 +15495,7 @@ export const ResourceRankingsRequest: MessageFns<ResourceRankingsRequest> = {
15419
15495
  ? AISessionFilter.fromPartial(object.filter)
15420
15496
  : undefined;
15421
15497
  message.dimension = object.dimension ?? 0;
15498
+ message.groupBy = object.groupBy ?? 0;
15422
15499
  message.timeWindow = object.timeWindow ?? 0;
15423
15500
  message.limit = object.limit ?? 0;
15424
15501
  return message;
@@ -15598,7 +15675,7 @@ export const ResourceRankingsResponse: MessageFns<ResourceRankingsResponse> = {
15598
15675
  };
15599
15676
 
15600
15677
  function createBaseResourceRanking(): ResourceRanking {
15601
- return { key: "", count: 0, priorCount: 0, sessionCount: 0 };
15678
+ return { key: "", count: 0, priorCount: 0, sessionCount: 0, principal: undefined };
15602
15679
  }
15603
15680
 
15604
15681
  export const ResourceRanking: MessageFns<ResourceRanking> = {
@@ -15615,6 +15692,9 @@ export const ResourceRanking: MessageFns<ResourceRanking> = {
15615
15692
  if (message.sessionCount !== 0) {
15616
15693
  writer.uint32(32).uint64(message.sessionCount);
15617
15694
  }
15695
+ if (message.principal !== undefined) {
15696
+ DailyActivityPrincipal.encode(message.principal, writer.uint32(42).fork()).join();
15697
+ }
15618
15698
  return writer;
15619
15699
  },
15620
15700
 
@@ -15663,6 +15743,14 @@ export const ResourceRanking: MessageFns<ResourceRanking> = {
15663
15743
  message.sessionCount = longToNumber(reader.uint64());
15664
15744
  continue;
15665
15745
  }
15746
+ case 5: {
15747
+ if (tag !== 42) {
15748
+ break;
15749
+ }
15750
+
15751
+ message.principal = DailyActivityPrincipal.decode(reader, reader.uint32());
15752
+ continue;
15753
+ }
15666
15754
  }
15667
15755
  if ((tag & 7) === 4 || tag === 0) {
15668
15756
  break;
@@ -15689,6 +15777,7 @@ export const ResourceRanking: MessageFns<ResourceRanking> = {
15689
15777
  : isSet(object.session_count)
15690
15778
  ? globalThis.Number(object.session_count)
15691
15779
  : 0,
15780
+ principal: isSet(object.principal) ? DailyActivityPrincipal.fromJSON(object.principal) : undefined,
15692
15781
  };
15693
15782
  },
15694
15783
 
@@ -15706,6 +15795,9 @@ export const ResourceRanking: MessageFns<ResourceRanking> = {
15706
15795
  if (message.sessionCount !== 0) {
15707
15796
  obj.sessionCount = Math.round(message.sessionCount);
15708
15797
  }
15798
+ if (message.principal !== undefined) {
15799
+ obj.principal = DailyActivityPrincipal.toJSON(message.principal);
15800
+ }
15709
15801
  return obj;
15710
15802
  },
15711
15803
 
@@ -15718,6 +15810,9 @@ export const ResourceRanking: MessageFns<ResourceRanking> = {
15718
15810
  message.count = object.count ?? 0;
15719
15811
  message.priorCount = object.priorCount ?? 0;
15720
15812
  message.sessionCount = object.sessionCount ?? 0;
15813
+ message.principal = (object.principal !== undefined && object.principal !== null)
15814
+ ? DailyActivityPrincipal.fromPartial(object.principal)
15815
+ : undefined;
15721
15816
  return message;
15722
15817
  },
15723
15818
  };
@@ -49,6 +49,7 @@ goog.exportSymbol('proto.gateway.web.v1.AIGitOutcome', null, global);
49
49
  goog.exportSymbol('proto.gateway.web.v1.AIModelPrice', null, global);
50
50
  goog.exportSymbol('proto.gateway.web.v1.AIModelPriceFilter', null, global);
51
51
  goog.exportSymbol('proto.gateway.web.v1.AIResourceDimension', null, global);
52
+ goog.exportSymbol('proto.gateway.web.v1.AIResourceRankingGroupBy', null, global);
52
53
  goog.exportSymbol('proto.gateway.web.v1.AISessionEvent', null, global);
53
54
  goog.exportSymbol('proto.gateway.web.v1.AISessionEventEnvelope', null, global);
54
55
  goog.exportSymbol('proto.gateway.web.v1.AISessionEventEnvelope.FrameCase', null, global);
@@ -27009,6 +27010,7 @@ organizationId: jspb.Message.getFieldWithDefault(msg, 1, ""),
27009
27010
  projectId: jspb.Message.getFieldWithDefault(msg, 2, ""),
27010
27011
  filter: (f = msg.getFilter()) && proto.gateway.web.v1.AISessionFilter.toObject(includeInstance, f),
27011
27012
  dimension: jspb.Message.getFieldWithDefault(msg, 4, 0),
27013
+ groupBy: jspb.Message.getFieldWithDefault(msg, 7, 0),
27012
27014
  timeWindow: jspb.Message.getFieldWithDefault(msg, 5, 0),
27013
27015
  limit: jspb.Message.getFieldWithDefault(msg, 6, 0)
27014
27016
  };
@@ -27064,6 +27066,10 @@ proto.gateway.web.v1.ResourceRankingsRequest.deserializeBinaryFromReader = funct
27064
27066
  var value = /** @type {!proto.gateway.web.v1.AIResourceDimension} */ (reader.readEnum());
27065
27067
  msg.setDimension(value);
27066
27068
  break;
27069
+ case 7:
27070
+ var value = /** @type {!proto.gateway.web.v1.AIResourceRankingGroupBy} */ (reader.readEnum());
27071
+ msg.setGroupBy(value);
27072
+ break;
27067
27073
  case 5:
27068
27074
  var value = /** @type {!proto.gateway.web.v1.AnalyticsTimeWindow} */ (reader.readEnum());
27069
27075
  msg.setTimeWindow(value);
@@ -27130,6 +27136,13 @@ proto.gateway.web.v1.ResourceRankingsRequest.serializeBinaryToWriter = function(
27130
27136
  f
27131
27137
  );
27132
27138
  }
27139
+ f = message.getGroupBy();
27140
+ if (f !== 0.0) {
27141
+ writer.writeEnum(
27142
+ 7,
27143
+ f
27144
+ );
27145
+ }
27133
27146
  f = message.getTimeWindow();
27134
27147
  if (f !== 0.0) {
27135
27148
  writer.writeEnum(
@@ -27238,6 +27251,24 @@ proto.gateway.web.v1.ResourceRankingsRequest.prototype.setDimension = function(v
27238
27251
  };
27239
27252
 
27240
27253
 
27254
+ /**
27255
+ * optional AIResourceRankingGroupBy group_by = 7;
27256
+ * @return {!proto.gateway.web.v1.AIResourceRankingGroupBy}
27257
+ */
27258
+ proto.gateway.web.v1.ResourceRankingsRequest.prototype.getGroupBy = function() {
27259
+ return /** @type {!proto.gateway.web.v1.AIResourceRankingGroupBy} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
27260
+ };
27261
+
27262
+
27263
+ /**
27264
+ * @param {!proto.gateway.web.v1.AIResourceRankingGroupBy} value
27265
+ * @return {!proto.gateway.web.v1.ResourceRankingsRequest} returns this
27266
+ */
27267
+ proto.gateway.web.v1.ResourceRankingsRequest.prototype.setGroupBy = function(value) {
27268
+ return jspb.Message.setProto3EnumField(this, 7, value);
27269
+ };
27270
+
27271
+
27241
27272
  /**
27242
27273
  * optional AnalyticsTimeWindow time_window = 5;
27243
27274
  * @return {!proto.gateway.web.v1.AnalyticsTimeWindow}
@@ -27703,7 +27734,8 @@ proto.gateway.web.v1.ResourceRanking.toObject = function(includeInstance, msg) {
27703
27734
  key: jspb.Message.getFieldWithDefault(msg, 1, ""),
27704
27735
  count: jspb.Message.getFieldWithDefault(msg, 2, 0),
27705
27736
  priorCount: jspb.Message.getFieldWithDefault(msg, 3, 0),
27706
- sessionCount: jspb.Message.getFieldWithDefault(msg, 4, 0)
27737
+ sessionCount: jspb.Message.getFieldWithDefault(msg, 4, 0),
27738
+ principal: (f = msg.getPrincipal()) && proto.gateway.web.v1.DailyActivityPrincipal.toObject(includeInstance, f)
27707
27739
  };
27708
27740
 
27709
27741
  if (includeInstance) {
@@ -27756,6 +27788,11 @@ proto.gateway.web.v1.ResourceRanking.deserializeBinaryFromReader = function(msg,
27756
27788
  var value = /** @type {number} */ (reader.readUint64());
27757
27789
  msg.setSessionCount(value);
27758
27790
  break;
27791
+ case 5:
27792
+ var value = new proto.gateway.web.v1.DailyActivityPrincipal;
27793
+ reader.readMessage(value,proto.gateway.web.v1.DailyActivityPrincipal.deserializeBinaryFromReader);
27794
+ msg.setPrincipal(value);
27795
+ break;
27759
27796
  default:
27760
27797
  reader.skipField();
27761
27798
  break;
@@ -27813,6 +27850,14 @@ proto.gateway.web.v1.ResourceRanking.serializeBinaryToWriter = function(message,
27813
27850
  f
27814
27851
  );
27815
27852
  }
27853
+ f = message.getPrincipal();
27854
+ if (f != null) {
27855
+ writer.writeMessage(
27856
+ 5,
27857
+ f,
27858
+ proto.gateway.web.v1.DailyActivityPrincipal.serializeBinaryToWriter
27859
+ );
27860
+ }
27816
27861
  };
27817
27862
 
27818
27863
 
@@ -27888,6 +27933,43 @@ proto.gateway.web.v1.ResourceRanking.prototype.setSessionCount = function(value)
27888
27933
  };
27889
27934
 
27890
27935
 
27936
+ /**
27937
+ * optional DailyActivityPrincipal principal = 5;
27938
+ * @return {?proto.gateway.web.v1.DailyActivityPrincipal}
27939
+ */
27940
+ proto.gateway.web.v1.ResourceRanking.prototype.getPrincipal = function() {
27941
+ return /** @type{?proto.gateway.web.v1.DailyActivityPrincipal} */ (
27942
+ jspb.Message.getWrapperField(this, proto.gateway.web.v1.DailyActivityPrincipal, 5));
27943
+ };
27944
+
27945
+
27946
+ /**
27947
+ * @param {?proto.gateway.web.v1.DailyActivityPrincipal|undefined} value
27948
+ * @return {!proto.gateway.web.v1.ResourceRanking} returns this
27949
+ */
27950
+ proto.gateway.web.v1.ResourceRanking.prototype.setPrincipal = function(value) {
27951
+ return jspb.Message.setWrapperField(this, 5, value);
27952
+ };
27953
+
27954
+
27955
+ /**
27956
+ * Clears the message field making it undefined.
27957
+ * @return {!proto.gateway.web.v1.ResourceRanking} returns this
27958
+ */
27959
+ proto.gateway.web.v1.ResourceRanking.prototype.clearPrincipal = function() {
27960
+ return this.setPrincipal(undefined);
27961
+ };
27962
+
27963
+
27964
+ /**
27965
+ * Returns whether this field is set.
27966
+ * @return {boolean}
27967
+ */
27968
+ proto.gateway.web.v1.ResourceRanking.prototype.hasPrincipal = function() {
27969
+ return jspb.Message.getField(this, 5) != null;
27970
+ };
27971
+
27972
+
27891
27973
 
27892
27974
  /**
27893
27975
  * List of repeated fields within this message type.
@@ -41417,6 +41499,14 @@ proto.gateway.web.v1.AIResourceDimension = {
41417
41499
  AI_RESOURCE_DIMENSION_COMMAND: 5
41418
41500
  };
41419
41501
 
41502
+ /**
41503
+ * @enum {number}
41504
+ */
41505
+ proto.gateway.web.v1.AIResourceRankingGroupBy = {
41506
+ AI_RESOURCE_RANKING_GROUP_BY_UNSPECIFIED: 0,
41507
+ AI_RESOURCE_RANKING_GROUP_BY_PRINCIPAL: 1
41508
+ };
41509
+
41420
41510
  /**
41421
41511
  * @enum {number}
41422
41512
  */