@miradorlabs/web-grpc 4.34.0 → 4.36.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.
@@ -9,7 +9,7 @@ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
9
  import type { Metadata } from "@grpc/grpc-js";
10
10
  import { Timestamp } from "../../../../google/protobuf/timestamp";
11
11
  import { ResponseStatus } from "../../common/v1/status";
12
- import { AISessionEventRef, AISessionInsight, AISkillSuggestion } from "./ai_gateway";
12
+ import { AISessionEventRef, AISessionInsight, AISessionInsightTopic, AISkillSuggestion } from "./ai_gateway";
13
13
 
14
14
  export const protobufPackage = "gateway.web.v1";
15
15
 
@@ -254,6 +254,53 @@ export interface ListProjectInsightCardsResponse {
254
254
  nextPageToken: string;
255
255
  }
256
256
 
257
+ export interface GetInsightsOverviewRequest {
258
+ organizationId: string;
259
+ projectId: string;
260
+ /**
261
+ * The window's start, which is scope: the insights and cards whose analyzed_at is at or after it. At most 35 days
262
+ * before the server's clock, else a validation error; a start in the future answers an empty overview.
263
+ */
264
+ analyzedAfter: Date | undefined;
265
+ }
266
+
267
+ export interface GetInsightsOverviewResponse {
268
+ status:
269
+ | ResponseStatus
270
+ | undefined;
271
+ /**
272
+ * The insights ListSessionInsights serves (no filter) whose SessionInsightEntry.analyzed_at is at or after
273
+ * analyzed_after, one row per topic with at least one, ordered by topic key, then name; insights without a topic
274
+ * are one row with topic unset, first. The rows add up to those insights.
275
+ */
276
+ sessionInsightTopicCounts: SessionInsightTopicCount[];
277
+ /**
278
+ * The cards ListProjectInsightCards serves (each local day's latest run, only when READY) whose
279
+ * AIProjectInsightCard.analyzed_at is at or after analyzed_after, one row per kind with at least one card, ordered
280
+ * by kind. A card counts by when its run analyzed the day, not by the day: a day that closed before analyzed_after
281
+ * but whose served run analyzed it after counts, and a day whose served run analyzed it before does not.
282
+ * A rerun of a day replaces its served run, so it can move that day's cards into the window between reads.
283
+ */
284
+ projectInsightKindCounts: ProjectInsightKindCount[];
285
+ }
286
+
287
+ /** SessionInsightTopicCount is how many insights are filed under one topic (AISessionInsight.topic). */
288
+ export interface SessionInsightTopicCount {
289
+ /**
290
+ * As AISessionInsight.topic: key and name for a topics file topic (the name as the newest insight carries it), an
291
+ * empty key and the model's name for a model-named topic, one row per exact name (case and spacing kept, so two
292
+ * spellings are two rows); unset for insights without a topic.
293
+ */
294
+ topic: AISessionInsightTopic | undefined;
295
+ insights: number;
296
+ }
297
+
298
+ /** ProjectInsightKindCount is how many served cards carry one kind (AIProjectInsight.kind). */
299
+ export interface ProjectInsightKindCount {
300
+ kind: AIProjectInsightKind;
301
+ cards: number;
302
+ }
303
+
257
304
  /**
258
305
  * AIProjectInsightCard is one card with the run that served it: label it with its day and analysis ("Nov 3 (final)",
259
306
  * "Today until 14:00, analyzed 14:06").
@@ -1150,6 +1197,404 @@ export const ListProjectInsightCardsResponse: MessageFns<ListProjectInsightCards
1150
1197
  },
1151
1198
  };
1152
1199
 
1200
+ function createBaseGetInsightsOverviewRequest(): GetInsightsOverviewRequest {
1201
+ return { organizationId: "", projectId: "", analyzedAfter: undefined };
1202
+ }
1203
+
1204
+ export const GetInsightsOverviewRequest: MessageFns<GetInsightsOverviewRequest> = {
1205
+ encode(message: GetInsightsOverviewRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1206
+ if (message.organizationId !== "") {
1207
+ writer.uint32(10).string(message.organizationId);
1208
+ }
1209
+ if (message.projectId !== "") {
1210
+ writer.uint32(18).string(message.projectId);
1211
+ }
1212
+ if (message.analyzedAfter !== undefined) {
1213
+ Timestamp.encode(toTimestamp(message.analyzedAfter), writer.uint32(26).fork()).join();
1214
+ }
1215
+ return writer;
1216
+ },
1217
+
1218
+ decode(input: BinaryReader | Uint8Array, length?: number): GetInsightsOverviewRequest {
1219
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1220
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1221
+ if (previousRecursionDepth >= 100) {
1222
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1223
+ }
1224
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1225
+ try {
1226
+ const end = length === undefined ? reader.len : reader.pos + length;
1227
+ const message = createBaseGetInsightsOverviewRequest();
1228
+ while (reader.pos < end) {
1229
+ const tag = reader.uint32();
1230
+ switch (tag >>> 3) {
1231
+ case 1: {
1232
+ if (tag !== 10) {
1233
+ break;
1234
+ }
1235
+
1236
+ message.organizationId = reader.string();
1237
+ continue;
1238
+ }
1239
+ case 2: {
1240
+ if (tag !== 18) {
1241
+ break;
1242
+ }
1243
+
1244
+ message.projectId = reader.string();
1245
+ continue;
1246
+ }
1247
+ case 3: {
1248
+ if (tag !== 26) {
1249
+ break;
1250
+ }
1251
+
1252
+ message.analyzedAfter = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1253
+ continue;
1254
+ }
1255
+ }
1256
+ if ((tag & 7) === 4 || tag === 0) {
1257
+ break;
1258
+ }
1259
+ reader.skip(tag & 7);
1260
+ }
1261
+ return message;
1262
+ } finally {
1263
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1264
+ }
1265
+ },
1266
+
1267
+ fromJSON(object: any): GetInsightsOverviewRequest {
1268
+ return {
1269
+ organizationId: isSet(object.organizationId)
1270
+ ? globalThis.String(object.organizationId)
1271
+ : isSet(object.organization_id)
1272
+ ? globalThis.String(object.organization_id)
1273
+ : "",
1274
+ projectId: isSet(object.projectId)
1275
+ ? globalThis.String(object.projectId)
1276
+ : isSet(object.project_id)
1277
+ ? globalThis.String(object.project_id)
1278
+ : "",
1279
+ analyzedAfter: isSet(object.analyzedAfter)
1280
+ ? fromJsonTimestamp(object.analyzedAfter)
1281
+ : isSet(object.analyzed_after)
1282
+ ? fromJsonTimestamp(object.analyzed_after)
1283
+ : undefined,
1284
+ };
1285
+ },
1286
+
1287
+ toJSON(message: GetInsightsOverviewRequest): unknown {
1288
+ const obj: any = {};
1289
+ if (message.organizationId !== "") {
1290
+ obj.organizationId = message.organizationId;
1291
+ }
1292
+ if (message.projectId !== "") {
1293
+ obj.projectId = message.projectId;
1294
+ }
1295
+ if (message.analyzedAfter !== undefined) {
1296
+ obj.analyzedAfter = message.analyzedAfter.toISOString();
1297
+ }
1298
+ return obj;
1299
+ },
1300
+
1301
+ create<I extends Exact<DeepPartial<GetInsightsOverviewRequest>, I>>(base?: I): GetInsightsOverviewRequest {
1302
+ return GetInsightsOverviewRequest.fromPartial(base ?? ({} as any));
1303
+ },
1304
+ fromPartial<I extends Exact<DeepPartial<GetInsightsOverviewRequest>, I>>(object: I): GetInsightsOverviewRequest {
1305
+ const message = createBaseGetInsightsOverviewRequest();
1306
+ message.organizationId = object.organizationId ?? "";
1307
+ message.projectId = object.projectId ?? "";
1308
+ message.analyzedAfter = object.analyzedAfter ?? undefined;
1309
+ return message;
1310
+ },
1311
+ };
1312
+
1313
+ function createBaseGetInsightsOverviewResponse(): GetInsightsOverviewResponse {
1314
+ return { status: undefined, sessionInsightTopicCounts: [], projectInsightKindCounts: [] };
1315
+ }
1316
+
1317
+ export const GetInsightsOverviewResponse: MessageFns<GetInsightsOverviewResponse> = {
1318
+ encode(message: GetInsightsOverviewResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1319
+ if (message.status !== undefined) {
1320
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
1321
+ }
1322
+ for (const v of message.sessionInsightTopicCounts) {
1323
+ SessionInsightTopicCount.encode(v!, writer.uint32(18).fork()).join();
1324
+ }
1325
+ for (const v of message.projectInsightKindCounts) {
1326
+ ProjectInsightKindCount.encode(v!, writer.uint32(26).fork()).join();
1327
+ }
1328
+ return writer;
1329
+ },
1330
+
1331
+ decode(input: BinaryReader | Uint8Array, length?: number): GetInsightsOverviewResponse {
1332
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1333
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1334
+ if (previousRecursionDepth >= 100) {
1335
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1336
+ }
1337
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1338
+ try {
1339
+ const end = length === undefined ? reader.len : reader.pos + length;
1340
+ const message = createBaseGetInsightsOverviewResponse();
1341
+ while (reader.pos < end) {
1342
+ const tag = reader.uint32();
1343
+ switch (tag >>> 3) {
1344
+ case 1: {
1345
+ if (tag !== 10) {
1346
+ break;
1347
+ }
1348
+
1349
+ message.status = ResponseStatus.decode(reader, reader.uint32());
1350
+ continue;
1351
+ }
1352
+ case 2: {
1353
+ if (tag !== 18) {
1354
+ break;
1355
+ }
1356
+
1357
+ message.sessionInsightTopicCounts.push(SessionInsightTopicCount.decode(reader, reader.uint32()));
1358
+ continue;
1359
+ }
1360
+ case 3: {
1361
+ if (tag !== 26) {
1362
+ break;
1363
+ }
1364
+
1365
+ message.projectInsightKindCounts.push(ProjectInsightKindCount.decode(reader, reader.uint32()));
1366
+ continue;
1367
+ }
1368
+ }
1369
+ if ((tag & 7) === 4 || tag === 0) {
1370
+ break;
1371
+ }
1372
+ reader.skip(tag & 7);
1373
+ }
1374
+ return message;
1375
+ } finally {
1376
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1377
+ }
1378
+ },
1379
+
1380
+ fromJSON(object: any): GetInsightsOverviewResponse {
1381
+ return {
1382
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
1383
+ sessionInsightTopicCounts: globalThis.Array.isArray(object?.sessionInsightTopicCounts)
1384
+ ? object.sessionInsightTopicCounts.map((e: any) => SessionInsightTopicCount.fromJSON(e))
1385
+ : globalThis.Array.isArray(object?.session_insight_topic_counts)
1386
+ ? object.session_insight_topic_counts.map((e: any) => SessionInsightTopicCount.fromJSON(e))
1387
+ : [],
1388
+ projectInsightKindCounts: globalThis.Array.isArray(object?.projectInsightKindCounts)
1389
+ ? object.projectInsightKindCounts.map((e: any) => ProjectInsightKindCount.fromJSON(e))
1390
+ : globalThis.Array.isArray(object?.project_insight_kind_counts)
1391
+ ? object.project_insight_kind_counts.map((e: any) => ProjectInsightKindCount.fromJSON(e))
1392
+ : [],
1393
+ };
1394
+ },
1395
+
1396
+ toJSON(message: GetInsightsOverviewResponse): unknown {
1397
+ const obj: any = {};
1398
+ if (message.status !== undefined) {
1399
+ obj.status = ResponseStatus.toJSON(message.status);
1400
+ }
1401
+ if (message.sessionInsightTopicCounts?.length) {
1402
+ obj.sessionInsightTopicCounts = message.sessionInsightTopicCounts.map((e) => SessionInsightTopicCount.toJSON(e));
1403
+ }
1404
+ if (message.projectInsightKindCounts?.length) {
1405
+ obj.projectInsightKindCounts = message.projectInsightKindCounts.map((e) => ProjectInsightKindCount.toJSON(e));
1406
+ }
1407
+ return obj;
1408
+ },
1409
+
1410
+ create<I extends Exact<DeepPartial<GetInsightsOverviewResponse>, I>>(base?: I): GetInsightsOverviewResponse {
1411
+ return GetInsightsOverviewResponse.fromPartial(base ?? ({} as any));
1412
+ },
1413
+ fromPartial<I extends Exact<DeepPartial<GetInsightsOverviewResponse>, I>>(object: I): GetInsightsOverviewResponse {
1414
+ const message = createBaseGetInsightsOverviewResponse();
1415
+ message.status = (object.status !== undefined && object.status !== null)
1416
+ ? ResponseStatus.fromPartial(object.status)
1417
+ : undefined;
1418
+ message.sessionInsightTopicCounts =
1419
+ object.sessionInsightTopicCounts?.map((e) => SessionInsightTopicCount.fromPartial(e)) || [];
1420
+ message.projectInsightKindCounts =
1421
+ object.projectInsightKindCounts?.map((e) => ProjectInsightKindCount.fromPartial(e)) || [];
1422
+ return message;
1423
+ },
1424
+ };
1425
+
1426
+ function createBaseSessionInsightTopicCount(): SessionInsightTopicCount {
1427
+ return { topic: undefined, insights: 0 };
1428
+ }
1429
+
1430
+ export const SessionInsightTopicCount: MessageFns<SessionInsightTopicCount> = {
1431
+ encode(message: SessionInsightTopicCount, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1432
+ if (message.topic !== undefined) {
1433
+ AISessionInsightTopic.encode(message.topic, writer.uint32(10).fork()).join();
1434
+ }
1435
+ if (message.insights !== 0) {
1436
+ writer.uint32(16).uint64(message.insights);
1437
+ }
1438
+ return writer;
1439
+ },
1440
+
1441
+ decode(input: BinaryReader | Uint8Array, length?: number): SessionInsightTopicCount {
1442
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1443
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1444
+ if (previousRecursionDepth >= 100) {
1445
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1446
+ }
1447
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1448
+ try {
1449
+ const end = length === undefined ? reader.len : reader.pos + length;
1450
+ const message = createBaseSessionInsightTopicCount();
1451
+ while (reader.pos < end) {
1452
+ const tag = reader.uint32();
1453
+ switch (tag >>> 3) {
1454
+ case 1: {
1455
+ if (tag !== 10) {
1456
+ break;
1457
+ }
1458
+
1459
+ message.topic = AISessionInsightTopic.decode(reader, reader.uint32());
1460
+ continue;
1461
+ }
1462
+ case 2: {
1463
+ if (tag !== 16) {
1464
+ break;
1465
+ }
1466
+
1467
+ message.insights = longToNumber(reader.uint64());
1468
+ continue;
1469
+ }
1470
+ }
1471
+ if ((tag & 7) === 4 || tag === 0) {
1472
+ break;
1473
+ }
1474
+ reader.skip(tag & 7);
1475
+ }
1476
+ return message;
1477
+ } finally {
1478
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1479
+ }
1480
+ },
1481
+
1482
+ fromJSON(object: any): SessionInsightTopicCount {
1483
+ return {
1484
+ topic: isSet(object.topic) ? AISessionInsightTopic.fromJSON(object.topic) : undefined,
1485
+ insights: isSet(object.insights) ? globalThis.Number(object.insights) : 0,
1486
+ };
1487
+ },
1488
+
1489
+ toJSON(message: SessionInsightTopicCount): unknown {
1490
+ const obj: any = {};
1491
+ if (message.topic !== undefined) {
1492
+ obj.topic = AISessionInsightTopic.toJSON(message.topic);
1493
+ }
1494
+ if (message.insights !== 0) {
1495
+ obj.insights = Math.round(message.insights);
1496
+ }
1497
+ return obj;
1498
+ },
1499
+
1500
+ create<I extends Exact<DeepPartial<SessionInsightTopicCount>, I>>(base?: I): SessionInsightTopicCount {
1501
+ return SessionInsightTopicCount.fromPartial(base ?? ({} as any));
1502
+ },
1503
+ fromPartial<I extends Exact<DeepPartial<SessionInsightTopicCount>, I>>(object: I): SessionInsightTopicCount {
1504
+ const message = createBaseSessionInsightTopicCount();
1505
+ message.topic = (object.topic !== undefined && object.topic !== null)
1506
+ ? AISessionInsightTopic.fromPartial(object.topic)
1507
+ : undefined;
1508
+ message.insights = object.insights ?? 0;
1509
+ return message;
1510
+ },
1511
+ };
1512
+
1513
+ function createBaseProjectInsightKindCount(): ProjectInsightKindCount {
1514
+ return { kind: 0, cards: 0 };
1515
+ }
1516
+
1517
+ export const ProjectInsightKindCount: MessageFns<ProjectInsightKindCount> = {
1518
+ encode(message: ProjectInsightKindCount, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1519
+ if (message.kind !== 0) {
1520
+ writer.uint32(8).int32(message.kind);
1521
+ }
1522
+ if (message.cards !== 0) {
1523
+ writer.uint32(16).uint64(message.cards);
1524
+ }
1525
+ return writer;
1526
+ },
1527
+
1528
+ decode(input: BinaryReader | Uint8Array, length?: number): ProjectInsightKindCount {
1529
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1530
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1531
+ if (previousRecursionDepth >= 100) {
1532
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1533
+ }
1534
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1535
+ try {
1536
+ const end = length === undefined ? reader.len : reader.pos + length;
1537
+ const message = createBaseProjectInsightKindCount();
1538
+ while (reader.pos < end) {
1539
+ const tag = reader.uint32();
1540
+ switch (tag >>> 3) {
1541
+ case 1: {
1542
+ if (tag !== 8) {
1543
+ break;
1544
+ }
1545
+
1546
+ message.kind = reader.int32() as any;
1547
+ continue;
1548
+ }
1549
+ case 2: {
1550
+ if (tag !== 16) {
1551
+ break;
1552
+ }
1553
+
1554
+ message.cards = longToNumber(reader.uint64());
1555
+ continue;
1556
+ }
1557
+ }
1558
+ if ((tag & 7) === 4 || tag === 0) {
1559
+ break;
1560
+ }
1561
+ reader.skip(tag & 7);
1562
+ }
1563
+ return message;
1564
+ } finally {
1565
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1566
+ }
1567
+ },
1568
+
1569
+ fromJSON(object: any): ProjectInsightKindCount {
1570
+ return {
1571
+ kind: isSet(object.kind) ? aIProjectInsightKindFromJSON(object.kind) : 0,
1572
+ cards: isSet(object.cards) ? globalThis.Number(object.cards) : 0,
1573
+ };
1574
+ },
1575
+
1576
+ toJSON(message: ProjectInsightKindCount): unknown {
1577
+ const obj: any = {};
1578
+ if (message.kind !== 0) {
1579
+ obj.kind = aIProjectInsightKindToJSON(message.kind);
1580
+ }
1581
+ if (message.cards !== 0) {
1582
+ obj.cards = Math.round(message.cards);
1583
+ }
1584
+ return obj;
1585
+ },
1586
+
1587
+ create<I extends Exact<DeepPartial<ProjectInsightKindCount>, I>>(base?: I): ProjectInsightKindCount {
1588
+ return ProjectInsightKindCount.fromPartial(base ?? ({} as any));
1589
+ },
1590
+ fromPartial<I extends Exact<DeepPartial<ProjectInsightKindCount>, I>>(object: I): ProjectInsightKindCount {
1591
+ const message = createBaseProjectInsightKindCount();
1592
+ message.kind = object.kind ?? 0;
1593
+ message.cards = object.cards ?? 0;
1594
+ return message;
1595
+ },
1596
+ };
1597
+
1153
1598
  function createBaseAIProjectInsightCard(): AIProjectInsightCard {
1154
1599
  return { insight: undefined, runId: "", localDate: "", timeZone: "", windowClosed: false, analyzedAt: undefined };
1155
1600
  }
@@ -2570,6 +3015,12 @@ export interface AIInsightsGatewayService {
2570
3015
  request: ListProjectInsightCardsRequest,
2571
3016
  metadata?: Metadata,
2572
3017
  ): Promise<ListProjectInsightCardsResponse>;
3018
+ /**
3019
+ * The project's insights in one window counted without listing them: ListSessionInsights' insights by topic and
3020
+ * ListProjectInsightCards' cards by kind, from the same rows those RPCs serve. A part that cannot be read fails the
3021
+ * call, so a zero is a count of none. Mirrors ai.api.v1.
3022
+ */
3023
+ GetInsightsOverview(request: GetInsightsOverviewRequest, metadata?: Metadata): Promise<GetInsightsOverviewResponse>;
2573
3024
  /**
2574
3025
  * The caller's ratings of up to 100 of the project's insights; an insight they have not rated is left out rather
2575
3026
  * than an error (unlike AIP-231). Mirrors ai.api.v1.
@@ -2596,6 +3047,7 @@ export class AIInsightsGatewayServiceClientImpl implements AIInsightsGatewayServ
2596
3047
  this.rpc = rpc;
2597
3048
  this.ListSessionInsights = this.ListSessionInsights.bind(this);
2598
3049
  this.ListProjectInsightCards = this.ListProjectInsightCards.bind(this);
3050
+ this.GetInsightsOverview = this.GetInsightsOverview.bind(this);
2599
3051
  this.BatchGetInsightRatings = this.BatchGetInsightRatings.bind(this);
2600
3052
  this.SetInsightRating = this.SetInsightRating.bind(this);
2601
3053
  this.DeleteInsightRating = this.DeleteInsightRating.bind(this);
@@ -2615,6 +3067,12 @@ export class AIInsightsGatewayServiceClientImpl implements AIInsightsGatewayServ
2615
3067
  return promise.then((data) => ListProjectInsightCardsResponse.decode(new BinaryReader(data)));
2616
3068
  }
2617
3069
 
3070
+ GetInsightsOverview(request: GetInsightsOverviewRequest, metadata?: Metadata): Promise<GetInsightsOverviewResponse> {
3071
+ const data = GetInsightsOverviewRequest.encode(request).finish();
3072
+ const promise = this.rpc.request(this.service, "GetInsightsOverview", data, metadata);
3073
+ return promise.then((data) => GetInsightsOverviewResponse.decode(new BinaryReader(data)));
3074
+ }
3075
+
2618
3076
  BatchGetInsightRatings(
2619
3077
  request: BatchGetInsightRatingsRequest,
2620
3078
  metadata?: Metadata,
@@ -2678,6 +3136,17 @@ function fromJsonTimestamp(o: any): Date {
2678
3136
  }
2679
3137
  }
2680
3138
 
3139
+ function longToNumber(int64: { toString(): string }): number {
3140
+ const num = globalThis.Number(int64.toString());
3141
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
3142
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
3143
+ }
3144
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
3145
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
3146
+ }
3147
+ return num;
3148
+ }
3149
+
2681
3150
  function isSet(value: any): boolean {
2682
3151
  return value !== null && value !== undefined;
2683
3152
  }
@@ -52,6 +52,28 @@ function deserialize_gateway_web_v1_DeleteInsightRatingResponse(buffer_arg) {
52
52
  return proto_gateway_web_v1_ai_insights_gateway_pb.DeleteInsightRatingResponse.deserializeBinary(new Uint8Array(buffer_arg));
53
53
  }
54
54
 
55
+ function serialize_gateway_web_v1_GetInsightsOverviewRequest(arg) {
56
+ if (!(arg instanceof proto_gateway_web_v1_ai_insights_gateway_pb.GetInsightsOverviewRequest)) {
57
+ throw new Error('Expected argument of type gateway.web.v1.GetInsightsOverviewRequest');
58
+ }
59
+ return Buffer.from(arg.serializeBinary());
60
+ }
61
+
62
+ function deserialize_gateway_web_v1_GetInsightsOverviewRequest(buffer_arg) {
63
+ return proto_gateway_web_v1_ai_insights_gateway_pb.GetInsightsOverviewRequest.deserializeBinary(new Uint8Array(buffer_arg));
64
+ }
65
+
66
+ function serialize_gateway_web_v1_GetInsightsOverviewResponse(arg) {
67
+ if (!(arg instanceof proto_gateway_web_v1_ai_insights_gateway_pb.GetInsightsOverviewResponse)) {
68
+ throw new Error('Expected argument of type gateway.web.v1.GetInsightsOverviewResponse');
69
+ }
70
+ return Buffer.from(arg.serializeBinary());
71
+ }
72
+
73
+ function deserialize_gateway_web_v1_GetInsightsOverviewResponse(buffer_arg) {
74
+ return proto_gateway_web_v1_ai_insights_gateway_pb.GetInsightsOverviewResponse.deserializeBinary(new Uint8Array(buffer_arg));
75
+ }
76
+
55
77
  function serialize_gateway_web_v1_ListProjectInsightCardsRequest(arg) {
56
78
  if (!(arg instanceof proto_gateway_web_v1_ai_insights_gateway_pb.ListProjectInsightCardsRequest)) {
57
79
  throw new Error('Expected argument of type gateway.web.v1.ListProjectInsightCardsRequest');
@@ -149,6 +171,20 @@ listProjectInsightCards: {
149
171
  responseSerialize: serialize_gateway_web_v1_ListProjectInsightCardsResponse,
150
172
  responseDeserialize: deserialize_gateway_web_v1_ListProjectInsightCardsResponse,
151
173
  },
174
+ // The project's insights in one window counted without listing them: ListSessionInsights' insights by topic and
175
+ // ListProjectInsightCards' cards by kind, from the same rows those RPCs serve. A part that cannot be read fails the
176
+ // call, so a zero is a count of none. Mirrors ai.api.v1.
177
+ getInsightsOverview: {
178
+ path: '/gateway.web.v1.AIInsightsGatewayService/GetInsightsOverview',
179
+ requestStream: false,
180
+ responseStream: false,
181
+ requestType: proto_gateway_web_v1_ai_insights_gateway_pb.GetInsightsOverviewRequest,
182
+ responseType: proto_gateway_web_v1_ai_insights_gateway_pb.GetInsightsOverviewResponse,
183
+ requestSerialize: serialize_gateway_web_v1_GetInsightsOverviewRequest,
184
+ requestDeserialize: deserialize_gateway_web_v1_GetInsightsOverviewRequest,
185
+ responseSerialize: serialize_gateway_web_v1_GetInsightsOverviewResponse,
186
+ responseDeserialize: deserialize_gateway_web_v1_GetInsightsOverviewResponse,
187
+ },
152
188
  // The caller's ratings of up to 100 of the project's insights; an insight they have not rated is left out rather
153
189
  // than an error (unlike AIP-231). Mirrors ai.api.v1.
154
190
  batchGetInsightRatings: {