@miradorlabs/web-grpc 3.18.0 → 3.20.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 (34) hide show
  1. package/google/api/field_behavior.ts +1 -1
  2. package/google/protobuf/descriptor.ts +1 -1
  3. package/google/protobuf/duration.ts +1 -1
  4. package/google/protobuf/timestamp.ts +1 -1
  5. package/package.json +1 -1
  6. package/proto/gateway/common/v1/attribute_value.ts +1 -1
  7. package/proto/gateway/common/v1/status.ts +1 -1
  8. package/proto/gateway/common/v1/types.ts +1 -1
  9. package/proto/gateway/web/v1/account_gateway.ts +1 -1
  10. package/proto/gateway/web/v1/admin_gateway.ts +950 -99
  11. package/proto/gateway/web/v1/admin_gateway_grpc_pb.js +138 -0
  12. package/proto/gateway/web/v1/admin_gateway_pb.js +1728 -0
  13. package/proto/gateway/web/v1/ai_gateway.ts +1 -1
  14. package/proto/gateway/web/v1/attribute_value.ts +1 -1
  15. package/proto/gateway/web/v1/beta_gateway.ts +1 -1
  16. package/proto/gateway/web/v1/chain_gateway.ts +1 -1
  17. package/proto/gateway/web/v1/common.ts +1 -1
  18. package/proto/gateway/web/v1/derived_metric_gateway.ts +1 -1
  19. package/proto/gateway/web/v1/github_connector.ts +1 -1
  20. package/proto/gateway/web/v1/integration_gateway.ts +1 -1
  21. package/proto/gateway/web/v1/log_gateway.ts +1 -1
  22. package/proto/gateway/web/v1/market_gateway.ts +1 -1
  23. package/proto/gateway/web/v1/metric_gateway.ts +1 -1
  24. package/proto/gateway/web/v1/oauth_gateway.ts +1 -1
  25. package/proto/gateway/web/v1/plan_gateway.ts +1 -1
  26. package/proto/gateway/web/v1/policy_gateway.ts +27 -3
  27. package/proto/gateway/web/v1/policy_gateway_pb.js +31 -1
  28. package/proto/gateway/web/v1/reference_gateway.ts +1994 -83
  29. package/proto/gateway/web/v1/reference_gateway_grpc_pb.js +145 -0
  30. package/proto/gateway/web/v1/reference_gateway_pb.js +3777 -43
  31. package/proto/gateway/web/v1/rule_gateway.ts +1 -1
  32. package/proto/gateway/web/v1/slo_gateway.ts +1 -1
  33. package/proto/gateway/web/v1/trace_gateway.ts +1 -1
  34. package/proto/gateway/web/v1/trace_measure_gateway.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.12.4
3
+ // protoc-gen-ts_proto v2.13.0
4
4
  // protoc v3.21.12
5
5
  // source: proto/gateway/web/v1/reference_gateway.proto
6
6
 
@@ -9,6 +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 { Pagination } from "./trace_gateway";
12
13
 
13
14
  export const protobufPackage = "gateway.web.v1";
14
15
 
@@ -58,6 +59,90 @@ export function aIReferenceNameScopeToJSON(object: AIReferenceNameScope): string
58
59
  }
59
60
  }
60
61
 
62
+ /** AIReferenceGroupStatus mirrors telemetry.api.v1.AIReferenceGroupStatus. Unspecified does not filter. */
63
+ export enum AIReferenceGroupStatus {
64
+ AI_REFERENCE_GROUP_STATUS_UNSPECIFIED = 0,
65
+ /** AI_REFERENCE_GROUP_STATUS_UNREVIEWED - A stored name in the group awaits review (unreviewed_names is not empty). */
66
+ AI_REFERENCE_GROUP_STATUS_UNREVIEWED = 1,
67
+ /** AI_REFERENCE_GROUP_STATUS_REVIEWED - No stored name in the group awaits review. */
68
+ AI_REFERENCE_GROUP_STATUS_REVIEWED = 2,
69
+ UNRECOGNIZED = -1,
70
+ }
71
+
72
+ export function aIReferenceGroupStatusFromJSON(object: any): AIReferenceGroupStatus {
73
+ switch (object) {
74
+ case 0:
75
+ case "AI_REFERENCE_GROUP_STATUS_UNSPECIFIED":
76
+ return AIReferenceGroupStatus.AI_REFERENCE_GROUP_STATUS_UNSPECIFIED;
77
+ case 1:
78
+ case "AI_REFERENCE_GROUP_STATUS_UNREVIEWED":
79
+ return AIReferenceGroupStatus.AI_REFERENCE_GROUP_STATUS_UNREVIEWED;
80
+ case 2:
81
+ case "AI_REFERENCE_GROUP_STATUS_REVIEWED":
82
+ return AIReferenceGroupStatus.AI_REFERENCE_GROUP_STATUS_REVIEWED;
83
+ case -1:
84
+ case "UNRECOGNIZED":
85
+ default:
86
+ return AIReferenceGroupStatus.UNRECOGNIZED;
87
+ }
88
+ }
89
+
90
+ export function aIReferenceGroupStatusToJSON(object: AIReferenceGroupStatus): string {
91
+ switch (object) {
92
+ case AIReferenceGroupStatus.AI_REFERENCE_GROUP_STATUS_UNSPECIFIED:
93
+ return "AI_REFERENCE_GROUP_STATUS_UNSPECIFIED";
94
+ case AIReferenceGroupStatus.AI_REFERENCE_GROUP_STATUS_UNREVIEWED:
95
+ return "AI_REFERENCE_GROUP_STATUS_UNREVIEWED";
96
+ case AIReferenceGroupStatus.AI_REFERENCE_GROUP_STATUS_REVIEWED:
97
+ return "AI_REFERENCE_GROUP_STATUS_REVIEWED";
98
+ case AIReferenceGroupStatus.UNRECOGNIZED:
99
+ default:
100
+ return "UNRECOGNIZED";
101
+ }
102
+ }
103
+
104
+ /** AIReferenceGroupObservation mirrors telemetry.api.v1.AIReferenceGroupObservation. Unspecified does not filter. */
105
+ export enum AIReferenceGroupObservation {
106
+ AI_REFERENCE_GROUP_OBSERVATION_UNSPECIFIED = 0,
107
+ /** AI_REFERENCE_GROUP_OBSERVATION_OBSERVED - An organization of the request's organization_ids reported a name in the group. */
108
+ AI_REFERENCE_GROUP_OBSERVATION_OBSERVED = 1,
109
+ /** AI_REFERENCE_GROUP_OBSERVATION_UNOBSERVED - Only the registry holds the group's names (a price catalog's spelling, another organization's name). */
110
+ AI_REFERENCE_GROUP_OBSERVATION_UNOBSERVED = 2,
111
+ UNRECOGNIZED = -1,
112
+ }
113
+
114
+ export function aIReferenceGroupObservationFromJSON(object: any): AIReferenceGroupObservation {
115
+ switch (object) {
116
+ case 0:
117
+ case "AI_REFERENCE_GROUP_OBSERVATION_UNSPECIFIED":
118
+ return AIReferenceGroupObservation.AI_REFERENCE_GROUP_OBSERVATION_UNSPECIFIED;
119
+ case 1:
120
+ case "AI_REFERENCE_GROUP_OBSERVATION_OBSERVED":
121
+ return AIReferenceGroupObservation.AI_REFERENCE_GROUP_OBSERVATION_OBSERVED;
122
+ case 2:
123
+ case "AI_REFERENCE_GROUP_OBSERVATION_UNOBSERVED":
124
+ return AIReferenceGroupObservation.AI_REFERENCE_GROUP_OBSERVATION_UNOBSERVED;
125
+ case -1:
126
+ case "UNRECOGNIZED":
127
+ default:
128
+ return AIReferenceGroupObservation.UNRECOGNIZED;
129
+ }
130
+ }
131
+
132
+ export function aIReferenceGroupObservationToJSON(object: AIReferenceGroupObservation): string {
133
+ switch (object) {
134
+ case AIReferenceGroupObservation.AI_REFERENCE_GROUP_OBSERVATION_UNSPECIFIED:
135
+ return "AI_REFERENCE_GROUP_OBSERVATION_UNSPECIFIED";
136
+ case AIReferenceGroupObservation.AI_REFERENCE_GROUP_OBSERVATION_OBSERVED:
137
+ return "AI_REFERENCE_GROUP_OBSERVATION_OBSERVED";
138
+ case AIReferenceGroupObservation.AI_REFERENCE_GROUP_OBSERVATION_UNOBSERVED:
139
+ return "AI_REFERENCE_GROUP_OBSERVATION_UNOBSERVED";
140
+ case AIReferenceGroupObservation.UNRECOGNIZED:
141
+ default:
142
+ return "UNRECOGNIZED";
143
+ }
144
+ }
145
+
61
146
  /** AIReferenceNameOrigin mirrors telemetry.api.v1.AIReferenceNameOrigin. */
62
147
  export enum AIReferenceNameOrigin {
63
148
  AI_REFERENCE_NAME_ORIGIN_UNSPECIFIED = 0,
@@ -249,6 +334,156 @@ export interface ListAIBillersResponse {
249
334
  billers: AIReferenceName[];
250
335
  }
251
336
 
337
+ export interface ListAIProviderGroupsRequest {
338
+ /**
339
+ * The caller's organizations of this product whose telemetry counts as observed; the gateway resolves the
340
+ * caller's membership of each, and any other id fails the request.
341
+ */
342
+ organizationIds: string[];
343
+ filter:
344
+ | AIReferenceGroupFilter
345
+ | undefined;
346
+ /** 1-indexed; below 1 = 1. A page past the last returns the last page: read pagination.page. */
347
+ page: number;
348
+ /** 1-1000; 0 = 50. */
349
+ perPage: number;
350
+ }
351
+
352
+ export interface ListAIProviderGroupsResponse {
353
+ status: ResponseStatus | undefined;
354
+ groups: AIReferenceGroup[];
355
+ /** total_count is the groups the filter keeps, exact, computed on every request; anchor_timestamp is unset. */
356
+ pagination: Pagination | undefined;
357
+ counts: AIReferenceGroupCounts | undefined;
358
+ }
359
+
360
+ export interface ListAIModelGroupsRequest {
361
+ /**
362
+ * The caller's organizations of this product whose telemetry counts as observed; the gateway resolves the
363
+ * caller's membership of each, and any other id fails the request.
364
+ */
365
+ organizationIds: string[];
366
+ filter:
367
+ | AIReferenceGroupFilter
368
+ | undefined;
369
+ /** 1-indexed; below 1 = 1. A page past the last returns the last page: read pagination.page. */
370
+ page: number;
371
+ /** 1-1000; 0 = 50. */
372
+ perPage: number;
373
+ }
374
+
375
+ export interface ListAIModelGroupsResponse {
376
+ status: ResponseStatus | undefined;
377
+ groups: AIReferenceGroup[];
378
+ /** total_count is the groups the filter keeps, exact, computed on every request; anchor_timestamp is unset. */
379
+ pagination: Pagination | undefined;
380
+ counts: AIReferenceGroupCounts | undefined;
381
+ }
382
+
383
+ export interface ListAIEffortGroupsRequest {
384
+ /**
385
+ * The caller's organizations of this product whose telemetry counts as observed; the gateway resolves the
386
+ * caller's membership of each, and any other id fails the request.
387
+ */
388
+ organizationIds: string[];
389
+ filter:
390
+ | AIReferenceGroupFilter
391
+ | undefined;
392
+ /** 1-indexed; below 1 = 1. A page past the last returns the last page: read pagination.page. */
393
+ page: number;
394
+ /** 1-1000; 0 = 50. */
395
+ perPage: number;
396
+ }
397
+
398
+ export interface ListAIEffortGroupsResponse {
399
+ status: ResponseStatus | undefined;
400
+ groups: AIReferenceGroup[];
401
+ /** total_count is the groups the filter keeps, exact, computed on every request; anchor_timestamp is unset. */
402
+ pagination: Pagination | undefined;
403
+ counts: AIReferenceGroupCounts | undefined;
404
+ }
405
+
406
+ export interface ListAIBillerGroupsRequest {
407
+ /**
408
+ * The caller's organizations of this product whose telemetry counts as observed; the gateway resolves the
409
+ * caller's membership of each, and any other id fails the request.
410
+ */
411
+ organizationIds: string[];
412
+ filter:
413
+ | AIReferenceGroupFilter
414
+ | undefined;
415
+ /** 1-indexed; below 1 = 1. A page past the last returns the last page: read pagination.page. */
416
+ page: number;
417
+ /** 1-1000; 0 = 50. */
418
+ perPage: number;
419
+ }
420
+
421
+ export interface ListAIBillerGroupsResponse {
422
+ status: ResponseStatus | undefined;
423
+ groups: AIReferenceGroup[];
424
+ /** total_count is the groups the filter keeps, exact, computed on every request; anchor_timestamp is unset. */
425
+ pagination: Pagination | undefined;
426
+ counts: AIReferenceGroupCounts | undefined;
427
+ }
428
+
429
+ /**
430
+ * AIReferenceGroupFilter mirrors telemetry.api.v1.AIReferenceGroupFilter. Set fields AND; an unset field does
431
+ * not filter. Each field matches the group as a whole.
432
+ */
433
+ export interface AIReferenceGroupFilter {
434
+ /** Case-insensitive substring (trimmed) of the group's display name or any of its stored names. */
435
+ search: string;
436
+ status: AIReferenceGroupStatus;
437
+ observation: AIReferenceGroupObservation;
438
+ /** Exact source ("claude", "price:litellm"): keeps the groups holding a name it reported. */
439
+ sourceSystem: string;
440
+ }
441
+
442
+ /** AIReferenceGroup mirrors telemetry.api.v1.AIReferenceGroup: one row of a reference table. */
443
+ export interface AIReferenceGroup {
444
+ displayName: string;
445
+ /** Sorted by name (byte order); the empty effort first. */
446
+ names: AIReferenceName[];
447
+ /** Every source that reported a name in the group, sorted (byte order). */
448
+ sourceSystems: string[];
449
+ /**
450
+ * Staff set at least one of the names (origin MANUAL). Independent of status: a group with a confirmed name
451
+ * still awaits review while unreviewed_names is not empty.
452
+ */
453
+ confirmed: boolean;
454
+ /** The stored names awaiting review (origin not MANUAL; never the empty effort), sorted (byte order). */
455
+ unreviewedNames: string[];
456
+ /** An organization of the request's organization_ids reported a name in the group. */
457
+ observed: boolean;
458
+ }
459
+
460
+ /**
461
+ * AIReferenceGroupCounts mirrors telemetry.api.v1.AIReferenceGroupCounts. Every count is exact, computed on
462
+ * every request.
463
+ */
464
+ export interface AIReferenceGroupCounts {
465
+ /** The whole table, unfiltered. */
466
+ totalNameCount: number;
467
+ totalGroupCount: number;
468
+ totalUnreviewedGroupCount: number;
469
+ /** The groups each status would keep under the filter's search, observation and source_system. */
470
+ unreviewedGroupCount: number;
471
+ reviewedGroupCount: number;
472
+ /** The groups each observation would keep under the filter's search, status and source_system. */
473
+ observedGroupCount: number;
474
+ unobservedGroupCount: number;
475
+ /** The unreviewed names in the groups the whole filter keeps: what Confirm<X> with the same filter writes. */
476
+ unreviewedNameCount: number;
477
+ /** Every source that reported a name in the table (unfiltered), sorted by source_system (byte order). */
478
+ sources: AIReferenceSourceCount[];
479
+ }
480
+
481
+ /** AIReferenceSourceCount is one source and the groups holding a name it reported. */
482
+ export interface AIReferenceSourceCount {
483
+ sourceSystem: string;
484
+ groupCount: number;
485
+ }
486
+
252
487
  /** AIReferenceName mirrors telemetry.api.v1.AIReferenceName: one raw name's display name. */
253
488
  export interface AIReferenceName {
254
489
  name: string;
@@ -1860,34 +2095,28 @@ export const ListAIBillersResponse: MessageFns<ListAIBillersResponse> = {
1860
2095
  },
1861
2096
  };
1862
2097
 
1863
- function createBaseAIReferenceName(): AIReferenceName {
1864
- return { name: "", displayName: "", sourceSystems: [], origin: 0, updatedAt: undefined, observed: false };
2098
+ function createBaseListAIProviderGroupsRequest(): ListAIProviderGroupsRequest {
2099
+ return { organizationIds: [], filter: undefined, page: 0, perPage: 0 };
1865
2100
  }
1866
2101
 
1867
- export const AIReferenceName: MessageFns<AIReferenceName> = {
1868
- encode(message: AIReferenceName, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1869
- if (message.name !== "") {
1870
- writer.uint32(10).string(message.name);
1871
- }
1872
- if (message.displayName !== "") {
1873
- writer.uint32(18).string(message.displayName);
1874
- }
1875
- for (const v of message.sourceSystems) {
1876
- writer.uint32(26).string(v!);
2102
+ export const ListAIProviderGroupsRequest: MessageFns<ListAIProviderGroupsRequest> = {
2103
+ encode(message: ListAIProviderGroupsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2104
+ for (const v of message.organizationIds) {
2105
+ writer.uint32(10).string(v!);
1877
2106
  }
1878
- if (message.origin !== 0) {
1879
- writer.uint32(32).int32(message.origin);
2107
+ if (message.filter !== undefined) {
2108
+ AIReferenceGroupFilter.encode(message.filter, writer.uint32(18).fork()).join();
1880
2109
  }
1881
- if (message.updatedAt !== undefined) {
1882
- Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(42).fork()).join();
2110
+ if (message.page !== 0) {
2111
+ writer.uint32(24).int32(message.page);
1883
2112
  }
1884
- if (message.observed !== false) {
1885
- writer.uint32(48).bool(message.observed);
2113
+ if (message.perPage !== 0) {
2114
+ writer.uint32(32).int32(message.perPage);
1886
2115
  }
1887
2116
  return writer;
1888
2117
  },
1889
2118
 
1890
- decode(input: BinaryReader | Uint8Array, length?: number): AIReferenceName {
2119
+ decode(input: BinaryReader | Uint8Array, length?: number): ListAIProviderGroupsRequest {
1891
2120
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1892
2121
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1893
2122
  if (previousRecursionDepth >= 100) {
@@ -1896,7 +2125,7 @@ export const AIReferenceName: MessageFns<AIReferenceName> = {
1896
2125
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1897
2126
  try {
1898
2127
  const end = length === undefined ? reader.len : reader.pos + length;
1899
- const message = createBaseAIReferenceName();
2128
+ const message = createBaseListAIProviderGroupsRequest();
1900
2129
  while (reader.pos < end) {
1901
2130
  const tag = reader.uint32();
1902
2131
  switch (tag >>> 3) {
@@ -1905,7 +2134,7 @@ export const AIReferenceName: MessageFns<AIReferenceName> = {
1905
2134
  break;
1906
2135
  }
1907
2136
 
1908
- message.name = reader.string();
2137
+ message.organizationIds.push(reader.string());
1909
2138
  continue;
1910
2139
  }
1911
2140
  case 2: {
@@ -1913,15 +2142,15 @@ export const AIReferenceName: MessageFns<AIReferenceName> = {
1913
2142
  break;
1914
2143
  }
1915
2144
 
1916
- message.displayName = reader.string();
2145
+ message.filter = AIReferenceGroupFilter.decode(reader, reader.uint32());
1917
2146
  continue;
1918
2147
  }
1919
2148
  case 3: {
1920
- if (tag !== 26) {
2149
+ if (tag !== 24) {
1921
2150
  break;
1922
2151
  }
1923
2152
 
1924
- message.sourceSystems.push(reader.string());
2153
+ message.page = reader.int32();
1925
2154
  continue;
1926
2155
  }
1927
2156
  case 4: {
@@ -1929,23 +2158,134 @@ export const AIReferenceName: MessageFns<AIReferenceName> = {
1929
2158
  break;
1930
2159
  }
1931
2160
 
1932
- message.origin = reader.int32() as any;
2161
+ message.perPage = reader.int32();
1933
2162
  continue;
1934
2163
  }
1935
- case 5: {
1936
- if (tag !== 42) {
2164
+ }
2165
+ if ((tag & 7) === 4 || tag === 0) {
2166
+ break;
2167
+ }
2168
+ reader.skip(tag & 7);
2169
+ }
2170
+ return message;
2171
+ } finally {
2172
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2173
+ }
2174
+ },
2175
+
2176
+ fromJSON(object: any): ListAIProviderGroupsRequest {
2177
+ return {
2178
+ organizationIds: globalThis.Array.isArray(object?.organizationIds)
2179
+ ? object.organizationIds.map((e: any) => globalThis.String(e))
2180
+ : globalThis.Array.isArray(object?.organization_ids)
2181
+ ? object.organization_ids.map((e: any) => globalThis.String(e))
2182
+ : [],
2183
+ filter: isSet(object.filter) ? AIReferenceGroupFilter.fromJSON(object.filter) : undefined,
2184
+ page: isSet(object.page) ? globalThis.Number(object.page) : 0,
2185
+ perPage: isSet(object.perPage)
2186
+ ? globalThis.Number(object.perPage)
2187
+ : isSet(object.per_page)
2188
+ ? globalThis.Number(object.per_page)
2189
+ : 0,
2190
+ };
2191
+ },
2192
+
2193
+ toJSON(message: ListAIProviderGroupsRequest): unknown {
2194
+ const obj: any = {};
2195
+ if (message.organizationIds?.length) {
2196
+ obj.organizationIds = message.organizationIds;
2197
+ }
2198
+ if (message.filter !== undefined) {
2199
+ obj.filter = AIReferenceGroupFilter.toJSON(message.filter);
2200
+ }
2201
+ if (message.page !== 0) {
2202
+ obj.page = Math.round(message.page);
2203
+ }
2204
+ if (message.perPage !== 0) {
2205
+ obj.perPage = Math.round(message.perPage);
2206
+ }
2207
+ return obj;
2208
+ },
2209
+
2210
+ create<I extends Exact<DeepPartial<ListAIProviderGroupsRequest>, I>>(base?: I): ListAIProviderGroupsRequest {
2211
+ return ListAIProviderGroupsRequest.fromPartial(base ?? ({} as any));
2212
+ },
2213
+ fromPartial<I extends Exact<DeepPartial<ListAIProviderGroupsRequest>, I>>(object: I): ListAIProviderGroupsRequest {
2214
+ const message = createBaseListAIProviderGroupsRequest();
2215
+ message.organizationIds = object.organizationIds?.map((e) => e) || [];
2216
+ message.filter = (object.filter !== undefined && object.filter !== null)
2217
+ ? AIReferenceGroupFilter.fromPartial(object.filter)
2218
+ : undefined;
2219
+ message.page = object.page ?? 0;
2220
+ message.perPage = object.perPage ?? 0;
2221
+ return message;
2222
+ },
2223
+ };
2224
+
2225
+ function createBaseListAIProviderGroupsResponse(): ListAIProviderGroupsResponse {
2226
+ return { status: undefined, groups: [], pagination: undefined, counts: undefined };
2227
+ }
2228
+
2229
+ export const ListAIProviderGroupsResponse: MessageFns<ListAIProviderGroupsResponse> = {
2230
+ encode(message: ListAIProviderGroupsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2231
+ if (message.status !== undefined) {
2232
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
2233
+ }
2234
+ for (const v of message.groups) {
2235
+ AIReferenceGroup.encode(v!, writer.uint32(18).fork()).join();
2236
+ }
2237
+ if (message.pagination !== undefined) {
2238
+ Pagination.encode(message.pagination, writer.uint32(26).fork()).join();
2239
+ }
2240
+ if (message.counts !== undefined) {
2241
+ AIReferenceGroupCounts.encode(message.counts, writer.uint32(34).fork()).join();
2242
+ }
2243
+ return writer;
2244
+ },
2245
+
2246
+ decode(input: BinaryReader | Uint8Array, length?: number): ListAIProviderGroupsResponse {
2247
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2248
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2249
+ if (previousRecursionDepth >= 100) {
2250
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2251
+ }
2252
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2253
+ try {
2254
+ const end = length === undefined ? reader.len : reader.pos + length;
2255
+ const message = createBaseListAIProviderGroupsResponse();
2256
+ while (reader.pos < end) {
2257
+ const tag = reader.uint32();
2258
+ switch (tag >>> 3) {
2259
+ case 1: {
2260
+ if (tag !== 10) {
1937
2261
  break;
1938
2262
  }
1939
2263
 
1940
- message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2264
+ message.status = ResponseStatus.decode(reader, reader.uint32());
1941
2265
  continue;
1942
2266
  }
1943
- case 6: {
1944
- if (tag !== 48) {
2267
+ case 2: {
2268
+ if (tag !== 18) {
1945
2269
  break;
1946
2270
  }
1947
2271
 
1948
- message.observed = reader.bool();
2272
+ message.groups.push(AIReferenceGroup.decode(reader, reader.uint32()));
2273
+ continue;
2274
+ }
2275
+ case 3: {
2276
+ if (tag !== 26) {
2277
+ break;
2278
+ }
2279
+
2280
+ message.pagination = Pagination.decode(reader, reader.uint32());
2281
+ continue;
2282
+ }
2283
+ case 4: {
2284
+ if (tag !== 34) {
2285
+ break;
2286
+ }
2287
+
2288
+ message.counts = AIReferenceGroupCounts.decode(reader, reader.uint32());
1949
2289
  continue;
1950
2290
  }
1951
2291
  }
@@ -1960,81 +2300,1621 @@ export const AIReferenceName: MessageFns<AIReferenceName> = {
1960
2300
  }
1961
2301
  },
1962
2302
 
1963
- fromJSON(object: any): AIReferenceName {
2303
+ fromJSON(object: any): ListAIProviderGroupsResponse {
1964
2304
  return {
1965
- name: isSet(object.name) ? globalThis.String(object.name) : "",
1966
- displayName: isSet(object.displayName)
1967
- ? globalThis.String(object.displayName)
1968
- : isSet(object.display_name)
1969
- ? globalThis.String(object.display_name)
1970
- : "",
1971
- sourceSystems: globalThis.Array.isArray(object?.sourceSystems)
1972
- ? object.sourceSystems.map((e: any) => globalThis.String(e))
1973
- : globalThis.Array.isArray(object?.source_systems)
1974
- ? object.source_systems.map((e: any) => globalThis.String(e))
2305
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
2306
+ groups: globalThis.Array.isArray(object?.groups)
2307
+ ? object.groups.map((e: any) => AIReferenceGroup.fromJSON(e))
1975
2308
  : [],
1976
- origin: isSet(object.origin) ? aIReferenceNameOriginFromJSON(object.origin) : 0,
1977
- updatedAt: isSet(object.updatedAt)
1978
- ? fromJsonTimestamp(object.updatedAt)
1979
- : isSet(object.updated_at)
1980
- ? fromJsonTimestamp(object.updated_at)
1981
- : undefined,
1982
- observed: isSet(object.observed) ? globalThis.Boolean(object.observed) : false,
2309
+ pagination: isSet(object.pagination) ? Pagination.fromJSON(object.pagination) : undefined,
2310
+ counts: isSet(object.counts) ? AIReferenceGroupCounts.fromJSON(object.counts) : undefined,
1983
2311
  };
1984
2312
  },
1985
2313
 
1986
- toJSON(message: AIReferenceName): unknown {
2314
+ toJSON(message: ListAIProviderGroupsResponse): unknown {
1987
2315
  const obj: any = {};
1988
- if (message.name !== "") {
1989
- obj.name = message.name;
1990
- }
1991
- if (message.displayName !== "") {
1992
- obj.displayName = message.displayName;
1993
- }
1994
- if (message.sourceSystems?.length) {
1995
- obj.sourceSystems = message.sourceSystems;
2316
+ if (message.status !== undefined) {
2317
+ obj.status = ResponseStatus.toJSON(message.status);
1996
2318
  }
1997
- if (message.origin !== 0) {
1998
- obj.origin = aIReferenceNameOriginToJSON(message.origin);
2319
+ if (message.groups?.length) {
2320
+ obj.groups = message.groups.map((e) => AIReferenceGroup.toJSON(e));
1999
2321
  }
2000
- if (message.updatedAt !== undefined) {
2001
- obj.updatedAt = message.updatedAt.toISOString();
2322
+ if (message.pagination !== undefined) {
2323
+ obj.pagination = Pagination.toJSON(message.pagination);
2002
2324
  }
2003
- if (message.observed !== false) {
2004
- obj.observed = message.observed;
2325
+ if (message.counts !== undefined) {
2326
+ obj.counts = AIReferenceGroupCounts.toJSON(message.counts);
2005
2327
  }
2006
2328
  return obj;
2007
2329
  },
2008
2330
 
2009
- create<I extends Exact<DeepPartial<AIReferenceName>, I>>(base?: I): AIReferenceName {
2010
- return AIReferenceName.fromPartial(base ?? ({} as any));
2331
+ create<I extends Exact<DeepPartial<ListAIProviderGroupsResponse>, I>>(base?: I): ListAIProviderGroupsResponse {
2332
+ return ListAIProviderGroupsResponse.fromPartial(base ?? ({} as any));
2011
2333
  },
2012
- fromPartial<I extends Exact<DeepPartial<AIReferenceName>, I>>(object: I): AIReferenceName {
2013
- const message = createBaseAIReferenceName();
2014
- message.name = object.name ?? "";
2015
- message.displayName = object.displayName ?? "";
2016
- message.sourceSystems = object.sourceSystems?.map((e) => e) || [];
2017
- message.origin = object.origin ?? 0;
2018
- message.updatedAt = object.updatedAt ?? undefined;
2019
- message.observed = object.observed ?? false;
2334
+ fromPartial<I extends Exact<DeepPartial<ListAIProviderGroupsResponse>, I>>(object: I): ListAIProviderGroupsResponse {
2335
+ const message = createBaseListAIProviderGroupsResponse();
2336
+ message.status = (object.status !== undefined && object.status !== null)
2337
+ ? ResponseStatus.fromPartial(object.status)
2338
+ : undefined;
2339
+ message.groups = object.groups?.map((e) => AIReferenceGroup.fromPartial(e)) || [];
2340
+ message.pagination = (object.pagination !== undefined && object.pagination !== null)
2341
+ ? Pagination.fromPartial(object.pagination)
2342
+ : undefined;
2343
+ message.counts = (object.counts !== undefined && object.counts !== null)
2344
+ ? AIReferenceGroupCounts.fromPartial(object.counts)
2345
+ : undefined;
2020
2346
  return message;
2021
2347
  },
2022
2348
  };
2023
2349
 
2024
- /**
2025
- * ReferenceGatewayService is the frontend-facing surface for the AI reference data an org reads: its
2026
- * principals (writes org-admin only) and the provider / model / effort / biller display names. The
2027
- * name tables are global: each List returns the names the org's own telemetry reported, mapped through
2028
- * them (scope ALL: every recorded name); Mirador staff edit them through AdminGatewayService. It proxies telemetry.api.v1.AIReferenceService.
2029
- */
2030
- export interface ReferenceGatewayService {
2031
- ListPrincipals(request: ListPrincipalsRequest, metadata?: Metadata): Promise<ListPrincipalsResponse>;
2350
+ function createBaseListAIModelGroupsRequest(): ListAIModelGroupsRequest {
2351
+ return { organizationIds: [], filter: undefined, page: 0, perPage: 0 };
2352
+ }
2353
+
2354
+ export const ListAIModelGroupsRequest: MessageFns<ListAIModelGroupsRequest> = {
2355
+ encode(message: ListAIModelGroupsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2356
+ for (const v of message.organizationIds) {
2357
+ writer.uint32(10).string(v!);
2358
+ }
2359
+ if (message.filter !== undefined) {
2360
+ AIReferenceGroupFilter.encode(message.filter, writer.uint32(18).fork()).join();
2361
+ }
2362
+ if (message.page !== 0) {
2363
+ writer.uint32(24).int32(message.page);
2364
+ }
2365
+ if (message.perPage !== 0) {
2366
+ writer.uint32(32).int32(message.perPage);
2367
+ }
2368
+ return writer;
2369
+ },
2370
+
2371
+ decode(input: BinaryReader | Uint8Array, length?: number): ListAIModelGroupsRequest {
2372
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2373
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2374
+ if (previousRecursionDepth >= 100) {
2375
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2376
+ }
2377
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2378
+ try {
2379
+ const end = length === undefined ? reader.len : reader.pos + length;
2380
+ const message = createBaseListAIModelGroupsRequest();
2381
+ while (reader.pos < end) {
2382
+ const tag = reader.uint32();
2383
+ switch (tag >>> 3) {
2384
+ case 1: {
2385
+ if (tag !== 10) {
2386
+ break;
2387
+ }
2388
+
2389
+ message.organizationIds.push(reader.string());
2390
+ continue;
2391
+ }
2392
+ case 2: {
2393
+ if (tag !== 18) {
2394
+ break;
2395
+ }
2396
+
2397
+ message.filter = AIReferenceGroupFilter.decode(reader, reader.uint32());
2398
+ continue;
2399
+ }
2400
+ case 3: {
2401
+ if (tag !== 24) {
2402
+ break;
2403
+ }
2404
+
2405
+ message.page = reader.int32();
2406
+ continue;
2407
+ }
2408
+ case 4: {
2409
+ if (tag !== 32) {
2410
+ break;
2411
+ }
2412
+
2413
+ message.perPage = reader.int32();
2414
+ continue;
2415
+ }
2416
+ }
2417
+ if ((tag & 7) === 4 || tag === 0) {
2418
+ break;
2419
+ }
2420
+ reader.skip(tag & 7);
2421
+ }
2422
+ return message;
2423
+ } finally {
2424
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2425
+ }
2426
+ },
2427
+
2428
+ fromJSON(object: any): ListAIModelGroupsRequest {
2429
+ return {
2430
+ organizationIds: globalThis.Array.isArray(object?.organizationIds)
2431
+ ? object.organizationIds.map((e: any) => globalThis.String(e))
2432
+ : globalThis.Array.isArray(object?.organization_ids)
2433
+ ? object.organization_ids.map((e: any) => globalThis.String(e))
2434
+ : [],
2435
+ filter: isSet(object.filter) ? AIReferenceGroupFilter.fromJSON(object.filter) : undefined,
2436
+ page: isSet(object.page) ? globalThis.Number(object.page) : 0,
2437
+ perPage: isSet(object.perPage)
2438
+ ? globalThis.Number(object.perPage)
2439
+ : isSet(object.per_page)
2440
+ ? globalThis.Number(object.per_page)
2441
+ : 0,
2442
+ };
2443
+ },
2444
+
2445
+ toJSON(message: ListAIModelGroupsRequest): unknown {
2446
+ const obj: any = {};
2447
+ if (message.organizationIds?.length) {
2448
+ obj.organizationIds = message.organizationIds;
2449
+ }
2450
+ if (message.filter !== undefined) {
2451
+ obj.filter = AIReferenceGroupFilter.toJSON(message.filter);
2452
+ }
2453
+ if (message.page !== 0) {
2454
+ obj.page = Math.round(message.page);
2455
+ }
2456
+ if (message.perPage !== 0) {
2457
+ obj.perPage = Math.round(message.perPage);
2458
+ }
2459
+ return obj;
2460
+ },
2461
+
2462
+ create<I extends Exact<DeepPartial<ListAIModelGroupsRequest>, I>>(base?: I): ListAIModelGroupsRequest {
2463
+ return ListAIModelGroupsRequest.fromPartial(base ?? ({} as any));
2464
+ },
2465
+ fromPartial<I extends Exact<DeepPartial<ListAIModelGroupsRequest>, I>>(object: I): ListAIModelGroupsRequest {
2466
+ const message = createBaseListAIModelGroupsRequest();
2467
+ message.organizationIds = object.organizationIds?.map((e) => e) || [];
2468
+ message.filter = (object.filter !== undefined && object.filter !== null)
2469
+ ? AIReferenceGroupFilter.fromPartial(object.filter)
2470
+ : undefined;
2471
+ message.page = object.page ?? 0;
2472
+ message.perPage = object.perPage ?? 0;
2473
+ return message;
2474
+ },
2475
+ };
2476
+
2477
+ function createBaseListAIModelGroupsResponse(): ListAIModelGroupsResponse {
2478
+ return { status: undefined, groups: [], pagination: undefined, counts: undefined };
2479
+ }
2480
+
2481
+ export const ListAIModelGroupsResponse: MessageFns<ListAIModelGroupsResponse> = {
2482
+ encode(message: ListAIModelGroupsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2483
+ if (message.status !== undefined) {
2484
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
2485
+ }
2486
+ for (const v of message.groups) {
2487
+ AIReferenceGroup.encode(v!, writer.uint32(18).fork()).join();
2488
+ }
2489
+ if (message.pagination !== undefined) {
2490
+ Pagination.encode(message.pagination, writer.uint32(26).fork()).join();
2491
+ }
2492
+ if (message.counts !== undefined) {
2493
+ AIReferenceGroupCounts.encode(message.counts, writer.uint32(34).fork()).join();
2494
+ }
2495
+ return writer;
2496
+ },
2497
+
2498
+ decode(input: BinaryReader | Uint8Array, length?: number): ListAIModelGroupsResponse {
2499
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2500
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2501
+ if (previousRecursionDepth >= 100) {
2502
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2503
+ }
2504
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2505
+ try {
2506
+ const end = length === undefined ? reader.len : reader.pos + length;
2507
+ const message = createBaseListAIModelGroupsResponse();
2508
+ while (reader.pos < end) {
2509
+ const tag = reader.uint32();
2510
+ switch (tag >>> 3) {
2511
+ case 1: {
2512
+ if (tag !== 10) {
2513
+ break;
2514
+ }
2515
+
2516
+ message.status = ResponseStatus.decode(reader, reader.uint32());
2517
+ continue;
2518
+ }
2519
+ case 2: {
2520
+ if (tag !== 18) {
2521
+ break;
2522
+ }
2523
+
2524
+ message.groups.push(AIReferenceGroup.decode(reader, reader.uint32()));
2525
+ continue;
2526
+ }
2527
+ case 3: {
2528
+ if (tag !== 26) {
2529
+ break;
2530
+ }
2531
+
2532
+ message.pagination = Pagination.decode(reader, reader.uint32());
2533
+ continue;
2534
+ }
2535
+ case 4: {
2536
+ if (tag !== 34) {
2537
+ break;
2538
+ }
2539
+
2540
+ message.counts = AIReferenceGroupCounts.decode(reader, reader.uint32());
2541
+ continue;
2542
+ }
2543
+ }
2544
+ if ((tag & 7) === 4 || tag === 0) {
2545
+ break;
2546
+ }
2547
+ reader.skip(tag & 7);
2548
+ }
2549
+ return message;
2550
+ } finally {
2551
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2552
+ }
2553
+ },
2554
+
2555
+ fromJSON(object: any): ListAIModelGroupsResponse {
2556
+ return {
2557
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
2558
+ groups: globalThis.Array.isArray(object?.groups)
2559
+ ? object.groups.map((e: any) => AIReferenceGroup.fromJSON(e))
2560
+ : [],
2561
+ pagination: isSet(object.pagination) ? Pagination.fromJSON(object.pagination) : undefined,
2562
+ counts: isSet(object.counts) ? AIReferenceGroupCounts.fromJSON(object.counts) : undefined,
2563
+ };
2564
+ },
2565
+
2566
+ toJSON(message: ListAIModelGroupsResponse): unknown {
2567
+ const obj: any = {};
2568
+ if (message.status !== undefined) {
2569
+ obj.status = ResponseStatus.toJSON(message.status);
2570
+ }
2571
+ if (message.groups?.length) {
2572
+ obj.groups = message.groups.map((e) => AIReferenceGroup.toJSON(e));
2573
+ }
2574
+ if (message.pagination !== undefined) {
2575
+ obj.pagination = Pagination.toJSON(message.pagination);
2576
+ }
2577
+ if (message.counts !== undefined) {
2578
+ obj.counts = AIReferenceGroupCounts.toJSON(message.counts);
2579
+ }
2580
+ return obj;
2581
+ },
2582
+
2583
+ create<I extends Exact<DeepPartial<ListAIModelGroupsResponse>, I>>(base?: I): ListAIModelGroupsResponse {
2584
+ return ListAIModelGroupsResponse.fromPartial(base ?? ({} as any));
2585
+ },
2586
+ fromPartial<I extends Exact<DeepPartial<ListAIModelGroupsResponse>, I>>(object: I): ListAIModelGroupsResponse {
2587
+ const message = createBaseListAIModelGroupsResponse();
2588
+ message.status = (object.status !== undefined && object.status !== null)
2589
+ ? ResponseStatus.fromPartial(object.status)
2590
+ : undefined;
2591
+ message.groups = object.groups?.map((e) => AIReferenceGroup.fromPartial(e)) || [];
2592
+ message.pagination = (object.pagination !== undefined && object.pagination !== null)
2593
+ ? Pagination.fromPartial(object.pagination)
2594
+ : undefined;
2595
+ message.counts = (object.counts !== undefined && object.counts !== null)
2596
+ ? AIReferenceGroupCounts.fromPartial(object.counts)
2597
+ : undefined;
2598
+ return message;
2599
+ },
2600
+ };
2601
+
2602
+ function createBaseListAIEffortGroupsRequest(): ListAIEffortGroupsRequest {
2603
+ return { organizationIds: [], filter: undefined, page: 0, perPage: 0 };
2604
+ }
2605
+
2606
+ export const ListAIEffortGroupsRequest: MessageFns<ListAIEffortGroupsRequest> = {
2607
+ encode(message: ListAIEffortGroupsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2608
+ for (const v of message.organizationIds) {
2609
+ writer.uint32(10).string(v!);
2610
+ }
2611
+ if (message.filter !== undefined) {
2612
+ AIReferenceGroupFilter.encode(message.filter, writer.uint32(18).fork()).join();
2613
+ }
2614
+ if (message.page !== 0) {
2615
+ writer.uint32(24).int32(message.page);
2616
+ }
2617
+ if (message.perPage !== 0) {
2618
+ writer.uint32(32).int32(message.perPage);
2619
+ }
2620
+ return writer;
2621
+ },
2622
+
2623
+ decode(input: BinaryReader | Uint8Array, length?: number): ListAIEffortGroupsRequest {
2624
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2625
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2626
+ if (previousRecursionDepth >= 100) {
2627
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2628
+ }
2629
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2630
+ try {
2631
+ const end = length === undefined ? reader.len : reader.pos + length;
2632
+ const message = createBaseListAIEffortGroupsRequest();
2633
+ while (reader.pos < end) {
2634
+ const tag = reader.uint32();
2635
+ switch (tag >>> 3) {
2636
+ case 1: {
2637
+ if (tag !== 10) {
2638
+ break;
2639
+ }
2640
+
2641
+ message.organizationIds.push(reader.string());
2642
+ continue;
2643
+ }
2644
+ case 2: {
2645
+ if (tag !== 18) {
2646
+ break;
2647
+ }
2648
+
2649
+ message.filter = AIReferenceGroupFilter.decode(reader, reader.uint32());
2650
+ continue;
2651
+ }
2652
+ case 3: {
2653
+ if (tag !== 24) {
2654
+ break;
2655
+ }
2656
+
2657
+ message.page = reader.int32();
2658
+ continue;
2659
+ }
2660
+ case 4: {
2661
+ if (tag !== 32) {
2662
+ break;
2663
+ }
2664
+
2665
+ message.perPage = reader.int32();
2666
+ continue;
2667
+ }
2668
+ }
2669
+ if ((tag & 7) === 4 || tag === 0) {
2670
+ break;
2671
+ }
2672
+ reader.skip(tag & 7);
2673
+ }
2674
+ return message;
2675
+ } finally {
2676
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2677
+ }
2678
+ },
2679
+
2680
+ fromJSON(object: any): ListAIEffortGroupsRequest {
2681
+ return {
2682
+ organizationIds: globalThis.Array.isArray(object?.organizationIds)
2683
+ ? object.organizationIds.map((e: any) => globalThis.String(e))
2684
+ : globalThis.Array.isArray(object?.organization_ids)
2685
+ ? object.organization_ids.map((e: any) => globalThis.String(e))
2686
+ : [],
2687
+ filter: isSet(object.filter) ? AIReferenceGroupFilter.fromJSON(object.filter) : undefined,
2688
+ page: isSet(object.page) ? globalThis.Number(object.page) : 0,
2689
+ perPage: isSet(object.perPage)
2690
+ ? globalThis.Number(object.perPage)
2691
+ : isSet(object.per_page)
2692
+ ? globalThis.Number(object.per_page)
2693
+ : 0,
2694
+ };
2695
+ },
2696
+
2697
+ toJSON(message: ListAIEffortGroupsRequest): unknown {
2698
+ const obj: any = {};
2699
+ if (message.organizationIds?.length) {
2700
+ obj.organizationIds = message.organizationIds;
2701
+ }
2702
+ if (message.filter !== undefined) {
2703
+ obj.filter = AIReferenceGroupFilter.toJSON(message.filter);
2704
+ }
2705
+ if (message.page !== 0) {
2706
+ obj.page = Math.round(message.page);
2707
+ }
2708
+ if (message.perPage !== 0) {
2709
+ obj.perPage = Math.round(message.perPage);
2710
+ }
2711
+ return obj;
2712
+ },
2713
+
2714
+ create<I extends Exact<DeepPartial<ListAIEffortGroupsRequest>, I>>(base?: I): ListAIEffortGroupsRequest {
2715
+ return ListAIEffortGroupsRequest.fromPartial(base ?? ({} as any));
2716
+ },
2717
+ fromPartial<I extends Exact<DeepPartial<ListAIEffortGroupsRequest>, I>>(object: I): ListAIEffortGroupsRequest {
2718
+ const message = createBaseListAIEffortGroupsRequest();
2719
+ message.organizationIds = object.organizationIds?.map((e) => e) || [];
2720
+ message.filter = (object.filter !== undefined && object.filter !== null)
2721
+ ? AIReferenceGroupFilter.fromPartial(object.filter)
2722
+ : undefined;
2723
+ message.page = object.page ?? 0;
2724
+ message.perPage = object.perPage ?? 0;
2725
+ return message;
2726
+ },
2727
+ };
2728
+
2729
+ function createBaseListAIEffortGroupsResponse(): ListAIEffortGroupsResponse {
2730
+ return { status: undefined, groups: [], pagination: undefined, counts: undefined };
2731
+ }
2732
+
2733
+ export const ListAIEffortGroupsResponse: MessageFns<ListAIEffortGroupsResponse> = {
2734
+ encode(message: ListAIEffortGroupsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2735
+ if (message.status !== undefined) {
2736
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
2737
+ }
2738
+ for (const v of message.groups) {
2739
+ AIReferenceGroup.encode(v!, writer.uint32(18).fork()).join();
2740
+ }
2741
+ if (message.pagination !== undefined) {
2742
+ Pagination.encode(message.pagination, writer.uint32(26).fork()).join();
2743
+ }
2744
+ if (message.counts !== undefined) {
2745
+ AIReferenceGroupCounts.encode(message.counts, writer.uint32(34).fork()).join();
2746
+ }
2747
+ return writer;
2748
+ },
2749
+
2750
+ decode(input: BinaryReader | Uint8Array, length?: number): ListAIEffortGroupsResponse {
2751
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2752
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2753
+ if (previousRecursionDepth >= 100) {
2754
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2755
+ }
2756
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2757
+ try {
2758
+ const end = length === undefined ? reader.len : reader.pos + length;
2759
+ const message = createBaseListAIEffortGroupsResponse();
2760
+ while (reader.pos < end) {
2761
+ const tag = reader.uint32();
2762
+ switch (tag >>> 3) {
2763
+ case 1: {
2764
+ if (tag !== 10) {
2765
+ break;
2766
+ }
2767
+
2768
+ message.status = ResponseStatus.decode(reader, reader.uint32());
2769
+ continue;
2770
+ }
2771
+ case 2: {
2772
+ if (tag !== 18) {
2773
+ break;
2774
+ }
2775
+
2776
+ message.groups.push(AIReferenceGroup.decode(reader, reader.uint32()));
2777
+ continue;
2778
+ }
2779
+ case 3: {
2780
+ if (tag !== 26) {
2781
+ break;
2782
+ }
2783
+
2784
+ message.pagination = Pagination.decode(reader, reader.uint32());
2785
+ continue;
2786
+ }
2787
+ case 4: {
2788
+ if (tag !== 34) {
2789
+ break;
2790
+ }
2791
+
2792
+ message.counts = AIReferenceGroupCounts.decode(reader, reader.uint32());
2793
+ continue;
2794
+ }
2795
+ }
2796
+ if ((tag & 7) === 4 || tag === 0) {
2797
+ break;
2798
+ }
2799
+ reader.skip(tag & 7);
2800
+ }
2801
+ return message;
2802
+ } finally {
2803
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2804
+ }
2805
+ },
2806
+
2807
+ fromJSON(object: any): ListAIEffortGroupsResponse {
2808
+ return {
2809
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
2810
+ groups: globalThis.Array.isArray(object?.groups)
2811
+ ? object.groups.map((e: any) => AIReferenceGroup.fromJSON(e))
2812
+ : [],
2813
+ pagination: isSet(object.pagination) ? Pagination.fromJSON(object.pagination) : undefined,
2814
+ counts: isSet(object.counts) ? AIReferenceGroupCounts.fromJSON(object.counts) : undefined,
2815
+ };
2816
+ },
2817
+
2818
+ toJSON(message: ListAIEffortGroupsResponse): unknown {
2819
+ const obj: any = {};
2820
+ if (message.status !== undefined) {
2821
+ obj.status = ResponseStatus.toJSON(message.status);
2822
+ }
2823
+ if (message.groups?.length) {
2824
+ obj.groups = message.groups.map((e) => AIReferenceGroup.toJSON(e));
2825
+ }
2826
+ if (message.pagination !== undefined) {
2827
+ obj.pagination = Pagination.toJSON(message.pagination);
2828
+ }
2829
+ if (message.counts !== undefined) {
2830
+ obj.counts = AIReferenceGroupCounts.toJSON(message.counts);
2831
+ }
2832
+ return obj;
2833
+ },
2834
+
2835
+ create<I extends Exact<DeepPartial<ListAIEffortGroupsResponse>, I>>(base?: I): ListAIEffortGroupsResponse {
2836
+ return ListAIEffortGroupsResponse.fromPartial(base ?? ({} as any));
2837
+ },
2838
+ fromPartial<I extends Exact<DeepPartial<ListAIEffortGroupsResponse>, I>>(object: I): ListAIEffortGroupsResponse {
2839
+ const message = createBaseListAIEffortGroupsResponse();
2840
+ message.status = (object.status !== undefined && object.status !== null)
2841
+ ? ResponseStatus.fromPartial(object.status)
2842
+ : undefined;
2843
+ message.groups = object.groups?.map((e) => AIReferenceGroup.fromPartial(e)) || [];
2844
+ message.pagination = (object.pagination !== undefined && object.pagination !== null)
2845
+ ? Pagination.fromPartial(object.pagination)
2846
+ : undefined;
2847
+ message.counts = (object.counts !== undefined && object.counts !== null)
2848
+ ? AIReferenceGroupCounts.fromPartial(object.counts)
2849
+ : undefined;
2850
+ return message;
2851
+ },
2852
+ };
2853
+
2854
+ function createBaseListAIBillerGroupsRequest(): ListAIBillerGroupsRequest {
2855
+ return { organizationIds: [], filter: undefined, page: 0, perPage: 0 };
2856
+ }
2857
+
2858
+ export const ListAIBillerGroupsRequest: MessageFns<ListAIBillerGroupsRequest> = {
2859
+ encode(message: ListAIBillerGroupsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2860
+ for (const v of message.organizationIds) {
2861
+ writer.uint32(10).string(v!);
2862
+ }
2863
+ if (message.filter !== undefined) {
2864
+ AIReferenceGroupFilter.encode(message.filter, writer.uint32(18).fork()).join();
2865
+ }
2866
+ if (message.page !== 0) {
2867
+ writer.uint32(24).int32(message.page);
2868
+ }
2869
+ if (message.perPage !== 0) {
2870
+ writer.uint32(32).int32(message.perPage);
2871
+ }
2872
+ return writer;
2873
+ },
2874
+
2875
+ decode(input: BinaryReader | Uint8Array, length?: number): ListAIBillerGroupsRequest {
2876
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2877
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2878
+ if (previousRecursionDepth >= 100) {
2879
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2880
+ }
2881
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2882
+ try {
2883
+ const end = length === undefined ? reader.len : reader.pos + length;
2884
+ const message = createBaseListAIBillerGroupsRequest();
2885
+ while (reader.pos < end) {
2886
+ const tag = reader.uint32();
2887
+ switch (tag >>> 3) {
2888
+ case 1: {
2889
+ if (tag !== 10) {
2890
+ break;
2891
+ }
2892
+
2893
+ message.organizationIds.push(reader.string());
2894
+ continue;
2895
+ }
2896
+ case 2: {
2897
+ if (tag !== 18) {
2898
+ break;
2899
+ }
2900
+
2901
+ message.filter = AIReferenceGroupFilter.decode(reader, reader.uint32());
2902
+ continue;
2903
+ }
2904
+ case 3: {
2905
+ if (tag !== 24) {
2906
+ break;
2907
+ }
2908
+
2909
+ message.page = reader.int32();
2910
+ continue;
2911
+ }
2912
+ case 4: {
2913
+ if (tag !== 32) {
2914
+ break;
2915
+ }
2916
+
2917
+ message.perPage = reader.int32();
2918
+ continue;
2919
+ }
2920
+ }
2921
+ if ((tag & 7) === 4 || tag === 0) {
2922
+ break;
2923
+ }
2924
+ reader.skip(tag & 7);
2925
+ }
2926
+ return message;
2927
+ } finally {
2928
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2929
+ }
2930
+ },
2931
+
2932
+ fromJSON(object: any): ListAIBillerGroupsRequest {
2933
+ return {
2934
+ organizationIds: globalThis.Array.isArray(object?.organizationIds)
2935
+ ? object.organizationIds.map((e: any) => globalThis.String(e))
2936
+ : globalThis.Array.isArray(object?.organization_ids)
2937
+ ? object.organization_ids.map((e: any) => globalThis.String(e))
2938
+ : [],
2939
+ filter: isSet(object.filter) ? AIReferenceGroupFilter.fromJSON(object.filter) : undefined,
2940
+ page: isSet(object.page) ? globalThis.Number(object.page) : 0,
2941
+ perPage: isSet(object.perPage)
2942
+ ? globalThis.Number(object.perPage)
2943
+ : isSet(object.per_page)
2944
+ ? globalThis.Number(object.per_page)
2945
+ : 0,
2946
+ };
2947
+ },
2948
+
2949
+ toJSON(message: ListAIBillerGroupsRequest): unknown {
2950
+ const obj: any = {};
2951
+ if (message.organizationIds?.length) {
2952
+ obj.organizationIds = message.organizationIds;
2953
+ }
2954
+ if (message.filter !== undefined) {
2955
+ obj.filter = AIReferenceGroupFilter.toJSON(message.filter);
2956
+ }
2957
+ if (message.page !== 0) {
2958
+ obj.page = Math.round(message.page);
2959
+ }
2960
+ if (message.perPage !== 0) {
2961
+ obj.perPage = Math.round(message.perPage);
2962
+ }
2963
+ return obj;
2964
+ },
2965
+
2966
+ create<I extends Exact<DeepPartial<ListAIBillerGroupsRequest>, I>>(base?: I): ListAIBillerGroupsRequest {
2967
+ return ListAIBillerGroupsRequest.fromPartial(base ?? ({} as any));
2968
+ },
2969
+ fromPartial<I extends Exact<DeepPartial<ListAIBillerGroupsRequest>, I>>(object: I): ListAIBillerGroupsRequest {
2970
+ const message = createBaseListAIBillerGroupsRequest();
2971
+ message.organizationIds = object.organizationIds?.map((e) => e) || [];
2972
+ message.filter = (object.filter !== undefined && object.filter !== null)
2973
+ ? AIReferenceGroupFilter.fromPartial(object.filter)
2974
+ : undefined;
2975
+ message.page = object.page ?? 0;
2976
+ message.perPage = object.perPage ?? 0;
2977
+ return message;
2978
+ },
2979
+ };
2980
+
2981
+ function createBaseListAIBillerGroupsResponse(): ListAIBillerGroupsResponse {
2982
+ return { status: undefined, groups: [], pagination: undefined, counts: undefined };
2983
+ }
2984
+
2985
+ export const ListAIBillerGroupsResponse: MessageFns<ListAIBillerGroupsResponse> = {
2986
+ encode(message: ListAIBillerGroupsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2987
+ if (message.status !== undefined) {
2988
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
2989
+ }
2990
+ for (const v of message.groups) {
2991
+ AIReferenceGroup.encode(v!, writer.uint32(18).fork()).join();
2992
+ }
2993
+ if (message.pagination !== undefined) {
2994
+ Pagination.encode(message.pagination, writer.uint32(26).fork()).join();
2995
+ }
2996
+ if (message.counts !== undefined) {
2997
+ AIReferenceGroupCounts.encode(message.counts, writer.uint32(34).fork()).join();
2998
+ }
2999
+ return writer;
3000
+ },
3001
+
3002
+ decode(input: BinaryReader | Uint8Array, length?: number): ListAIBillerGroupsResponse {
3003
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3004
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
3005
+ if (previousRecursionDepth >= 100) {
3006
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3007
+ }
3008
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
3009
+ try {
3010
+ const end = length === undefined ? reader.len : reader.pos + length;
3011
+ const message = createBaseListAIBillerGroupsResponse();
3012
+ while (reader.pos < end) {
3013
+ const tag = reader.uint32();
3014
+ switch (tag >>> 3) {
3015
+ case 1: {
3016
+ if (tag !== 10) {
3017
+ break;
3018
+ }
3019
+
3020
+ message.status = ResponseStatus.decode(reader, reader.uint32());
3021
+ continue;
3022
+ }
3023
+ case 2: {
3024
+ if (tag !== 18) {
3025
+ break;
3026
+ }
3027
+
3028
+ message.groups.push(AIReferenceGroup.decode(reader, reader.uint32()));
3029
+ continue;
3030
+ }
3031
+ case 3: {
3032
+ if (tag !== 26) {
3033
+ break;
3034
+ }
3035
+
3036
+ message.pagination = Pagination.decode(reader, reader.uint32());
3037
+ continue;
3038
+ }
3039
+ case 4: {
3040
+ if (tag !== 34) {
3041
+ break;
3042
+ }
3043
+
3044
+ message.counts = AIReferenceGroupCounts.decode(reader, reader.uint32());
3045
+ continue;
3046
+ }
3047
+ }
3048
+ if ((tag & 7) === 4 || tag === 0) {
3049
+ break;
3050
+ }
3051
+ reader.skip(tag & 7);
3052
+ }
3053
+ return message;
3054
+ } finally {
3055
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
3056
+ }
3057
+ },
3058
+
3059
+ fromJSON(object: any): ListAIBillerGroupsResponse {
3060
+ return {
3061
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
3062
+ groups: globalThis.Array.isArray(object?.groups)
3063
+ ? object.groups.map((e: any) => AIReferenceGroup.fromJSON(e))
3064
+ : [],
3065
+ pagination: isSet(object.pagination) ? Pagination.fromJSON(object.pagination) : undefined,
3066
+ counts: isSet(object.counts) ? AIReferenceGroupCounts.fromJSON(object.counts) : undefined,
3067
+ };
3068
+ },
3069
+
3070
+ toJSON(message: ListAIBillerGroupsResponse): unknown {
3071
+ const obj: any = {};
3072
+ if (message.status !== undefined) {
3073
+ obj.status = ResponseStatus.toJSON(message.status);
3074
+ }
3075
+ if (message.groups?.length) {
3076
+ obj.groups = message.groups.map((e) => AIReferenceGroup.toJSON(e));
3077
+ }
3078
+ if (message.pagination !== undefined) {
3079
+ obj.pagination = Pagination.toJSON(message.pagination);
3080
+ }
3081
+ if (message.counts !== undefined) {
3082
+ obj.counts = AIReferenceGroupCounts.toJSON(message.counts);
3083
+ }
3084
+ return obj;
3085
+ },
3086
+
3087
+ create<I extends Exact<DeepPartial<ListAIBillerGroupsResponse>, I>>(base?: I): ListAIBillerGroupsResponse {
3088
+ return ListAIBillerGroupsResponse.fromPartial(base ?? ({} as any));
3089
+ },
3090
+ fromPartial<I extends Exact<DeepPartial<ListAIBillerGroupsResponse>, I>>(object: I): ListAIBillerGroupsResponse {
3091
+ const message = createBaseListAIBillerGroupsResponse();
3092
+ message.status = (object.status !== undefined && object.status !== null)
3093
+ ? ResponseStatus.fromPartial(object.status)
3094
+ : undefined;
3095
+ message.groups = object.groups?.map((e) => AIReferenceGroup.fromPartial(e)) || [];
3096
+ message.pagination = (object.pagination !== undefined && object.pagination !== null)
3097
+ ? Pagination.fromPartial(object.pagination)
3098
+ : undefined;
3099
+ message.counts = (object.counts !== undefined && object.counts !== null)
3100
+ ? AIReferenceGroupCounts.fromPartial(object.counts)
3101
+ : undefined;
3102
+ return message;
3103
+ },
3104
+ };
3105
+
3106
+ function createBaseAIReferenceGroupFilter(): AIReferenceGroupFilter {
3107
+ return { search: "", status: 0, observation: 0, sourceSystem: "" };
3108
+ }
3109
+
3110
+ export const AIReferenceGroupFilter: MessageFns<AIReferenceGroupFilter> = {
3111
+ encode(message: AIReferenceGroupFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3112
+ if (message.search !== "") {
3113
+ writer.uint32(10).string(message.search);
3114
+ }
3115
+ if (message.status !== 0) {
3116
+ writer.uint32(16).int32(message.status);
3117
+ }
3118
+ if (message.observation !== 0) {
3119
+ writer.uint32(24).int32(message.observation);
3120
+ }
3121
+ if (message.sourceSystem !== "") {
3122
+ writer.uint32(34).string(message.sourceSystem);
3123
+ }
3124
+ return writer;
3125
+ },
3126
+
3127
+ decode(input: BinaryReader | Uint8Array, length?: number): AIReferenceGroupFilter {
3128
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3129
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
3130
+ if (previousRecursionDepth >= 100) {
3131
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3132
+ }
3133
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
3134
+ try {
3135
+ const end = length === undefined ? reader.len : reader.pos + length;
3136
+ const message = createBaseAIReferenceGroupFilter();
3137
+ while (reader.pos < end) {
3138
+ const tag = reader.uint32();
3139
+ switch (tag >>> 3) {
3140
+ case 1: {
3141
+ if (tag !== 10) {
3142
+ break;
3143
+ }
3144
+
3145
+ message.search = reader.string();
3146
+ continue;
3147
+ }
3148
+ case 2: {
3149
+ if (tag !== 16) {
3150
+ break;
3151
+ }
3152
+
3153
+ message.status = reader.int32() as any;
3154
+ continue;
3155
+ }
3156
+ case 3: {
3157
+ if (tag !== 24) {
3158
+ break;
3159
+ }
3160
+
3161
+ message.observation = reader.int32() as any;
3162
+ continue;
3163
+ }
3164
+ case 4: {
3165
+ if (tag !== 34) {
3166
+ break;
3167
+ }
3168
+
3169
+ message.sourceSystem = reader.string();
3170
+ continue;
3171
+ }
3172
+ }
3173
+ if ((tag & 7) === 4 || tag === 0) {
3174
+ break;
3175
+ }
3176
+ reader.skip(tag & 7);
3177
+ }
3178
+ return message;
3179
+ } finally {
3180
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
3181
+ }
3182
+ },
3183
+
3184
+ fromJSON(object: any): AIReferenceGroupFilter {
3185
+ return {
3186
+ search: isSet(object.search) ? globalThis.String(object.search) : "",
3187
+ status: isSet(object.status) ? aIReferenceGroupStatusFromJSON(object.status) : 0,
3188
+ observation: isSet(object.observation) ? aIReferenceGroupObservationFromJSON(object.observation) : 0,
3189
+ sourceSystem: isSet(object.sourceSystem)
3190
+ ? globalThis.String(object.sourceSystem)
3191
+ : isSet(object.source_system)
3192
+ ? globalThis.String(object.source_system)
3193
+ : "",
3194
+ };
3195
+ },
3196
+
3197
+ toJSON(message: AIReferenceGroupFilter): unknown {
3198
+ const obj: any = {};
3199
+ if (message.search !== "") {
3200
+ obj.search = message.search;
3201
+ }
3202
+ if (message.status !== 0) {
3203
+ obj.status = aIReferenceGroupStatusToJSON(message.status);
3204
+ }
3205
+ if (message.observation !== 0) {
3206
+ obj.observation = aIReferenceGroupObservationToJSON(message.observation);
3207
+ }
3208
+ if (message.sourceSystem !== "") {
3209
+ obj.sourceSystem = message.sourceSystem;
3210
+ }
3211
+ return obj;
3212
+ },
3213
+
3214
+ create<I extends Exact<DeepPartial<AIReferenceGroupFilter>, I>>(base?: I): AIReferenceGroupFilter {
3215
+ return AIReferenceGroupFilter.fromPartial(base ?? ({} as any));
3216
+ },
3217
+ fromPartial<I extends Exact<DeepPartial<AIReferenceGroupFilter>, I>>(object: I): AIReferenceGroupFilter {
3218
+ const message = createBaseAIReferenceGroupFilter();
3219
+ message.search = object.search ?? "";
3220
+ message.status = object.status ?? 0;
3221
+ message.observation = object.observation ?? 0;
3222
+ message.sourceSystem = object.sourceSystem ?? "";
3223
+ return message;
3224
+ },
3225
+ };
3226
+
3227
+ function createBaseAIReferenceGroup(): AIReferenceGroup {
3228
+ return { displayName: "", names: [], sourceSystems: [], confirmed: false, unreviewedNames: [], observed: false };
3229
+ }
3230
+
3231
+ export const AIReferenceGroup: MessageFns<AIReferenceGroup> = {
3232
+ encode(message: AIReferenceGroup, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3233
+ if (message.displayName !== "") {
3234
+ writer.uint32(10).string(message.displayName);
3235
+ }
3236
+ for (const v of message.names) {
3237
+ AIReferenceName.encode(v!, writer.uint32(18).fork()).join();
3238
+ }
3239
+ for (const v of message.sourceSystems) {
3240
+ writer.uint32(26).string(v!);
3241
+ }
3242
+ if (message.confirmed !== false) {
3243
+ writer.uint32(32).bool(message.confirmed);
3244
+ }
3245
+ for (const v of message.unreviewedNames) {
3246
+ writer.uint32(42).string(v!);
3247
+ }
3248
+ if (message.observed !== false) {
3249
+ writer.uint32(48).bool(message.observed);
3250
+ }
3251
+ return writer;
3252
+ },
3253
+
3254
+ decode(input: BinaryReader | Uint8Array, length?: number): AIReferenceGroup {
3255
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3256
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
3257
+ if (previousRecursionDepth >= 100) {
3258
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3259
+ }
3260
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
3261
+ try {
3262
+ const end = length === undefined ? reader.len : reader.pos + length;
3263
+ const message = createBaseAIReferenceGroup();
3264
+ while (reader.pos < end) {
3265
+ const tag = reader.uint32();
3266
+ switch (tag >>> 3) {
3267
+ case 1: {
3268
+ if (tag !== 10) {
3269
+ break;
3270
+ }
3271
+
3272
+ message.displayName = reader.string();
3273
+ continue;
3274
+ }
3275
+ case 2: {
3276
+ if (tag !== 18) {
3277
+ break;
3278
+ }
3279
+
3280
+ message.names.push(AIReferenceName.decode(reader, reader.uint32()));
3281
+ continue;
3282
+ }
3283
+ case 3: {
3284
+ if (tag !== 26) {
3285
+ break;
3286
+ }
3287
+
3288
+ message.sourceSystems.push(reader.string());
3289
+ continue;
3290
+ }
3291
+ case 4: {
3292
+ if (tag !== 32) {
3293
+ break;
3294
+ }
3295
+
3296
+ message.confirmed = reader.bool();
3297
+ continue;
3298
+ }
3299
+ case 5: {
3300
+ if (tag !== 42) {
3301
+ break;
3302
+ }
3303
+
3304
+ message.unreviewedNames.push(reader.string());
3305
+ continue;
3306
+ }
3307
+ case 6: {
3308
+ if (tag !== 48) {
3309
+ break;
3310
+ }
3311
+
3312
+ message.observed = reader.bool();
3313
+ continue;
3314
+ }
3315
+ }
3316
+ if ((tag & 7) === 4 || tag === 0) {
3317
+ break;
3318
+ }
3319
+ reader.skip(tag & 7);
3320
+ }
3321
+ return message;
3322
+ } finally {
3323
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
3324
+ }
3325
+ },
3326
+
3327
+ fromJSON(object: any): AIReferenceGroup {
3328
+ return {
3329
+ displayName: isSet(object.displayName)
3330
+ ? globalThis.String(object.displayName)
3331
+ : isSet(object.display_name)
3332
+ ? globalThis.String(object.display_name)
3333
+ : "",
3334
+ names: globalThis.Array.isArray(object?.names) ? object.names.map((e: any) => AIReferenceName.fromJSON(e)) : [],
3335
+ sourceSystems: globalThis.Array.isArray(object?.sourceSystems)
3336
+ ? object.sourceSystems.map((e: any) => globalThis.String(e))
3337
+ : globalThis.Array.isArray(object?.source_systems)
3338
+ ? object.source_systems.map((e: any) => globalThis.String(e))
3339
+ : [],
3340
+ confirmed: isSet(object.confirmed) ? globalThis.Boolean(object.confirmed) : false,
3341
+ unreviewedNames: globalThis.Array.isArray(object?.unreviewedNames)
3342
+ ? object.unreviewedNames.map((e: any) => globalThis.String(e))
3343
+ : globalThis.Array.isArray(object?.unreviewed_names)
3344
+ ? object.unreviewed_names.map((e: any) => globalThis.String(e))
3345
+ : [],
3346
+ observed: isSet(object.observed) ? globalThis.Boolean(object.observed) : false,
3347
+ };
3348
+ },
3349
+
3350
+ toJSON(message: AIReferenceGroup): unknown {
3351
+ const obj: any = {};
3352
+ if (message.displayName !== "") {
3353
+ obj.displayName = message.displayName;
3354
+ }
3355
+ if (message.names?.length) {
3356
+ obj.names = message.names.map((e) => AIReferenceName.toJSON(e));
3357
+ }
3358
+ if (message.sourceSystems?.length) {
3359
+ obj.sourceSystems = message.sourceSystems;
3360
+ }
3361
+ if (message.confirmed !== false) {
3362
+ obj.confirmed = message.confirmed;
3363
+ }
3364
+ if (message.unreviewedNames?.length) {
3365
+ obj.unreviewedNames = message.unreviewedNames;
3366
+ }
3367
+ if (message.observed !== false) {
3368
+ obj.observed = message.observed;
3369
+ }
3370
+ return obj;
3371
+ },
3372
+
3373
+ create<I extends Exact<DeepPartial<AIReferenceGroup>, I>>(base?: I): AIReferenceGroup {
3374
+ return AIReferenceGroup.fromPartial(base ?? ({} as any));
3375
+ },
3376
+ fromPartial<I extends Exact<DeepPartial<AIReferenceGroup>, I>>(object: I): AIReferenceGroup {
3377
+ const message = createBaseAIReferenceGroup();
3378
+ message.displayName = object.displayName ?? "";
3379
+ message.names = object.names?.map((e) => AIReferenceName.fromPartial(e)) || [];
3380
+ message.sourceSystems = object.sourceSystems?.map((e) => e) || [];
3381
+ message.confirmed = object.confirmed ?? false;
3382
+ message.unreviewedNames = object.unreviewedNames?.map((e) => e) || [];
3383
+ message.observed = object.observed ?? false;
3384
+ return message;
3385
+ },
3386
+ };
3387
+
3388
+ function createBaseAIReferenceGroupCounts(): AIReferenceGroupCounts {
3389
+ return {
3390
+ totalNameCount: 0,
3391
+ totalGroupCount: 0,
3392
+ totalUnreviewedGroupCount: 0,
3393
+ unreviewedGroupCount: 0,
3394
+ reviewedGroupCount: 0,
3395
+ observedGroupCount: 0,
3396
+ unobservedGroupCount: 0,
3397
+ unreviewedNameCount: 0,
3398
+ sources: [],
3399
+ };
3400
+ }
3401
+
3402
+ export const AIReferenceGroupCounts: MessageFns<AIReferenceGroupCounts> = {
3403
+ encode(message: AIReferenceGroupCounts, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3404
+ if (message.totalNameCount !== 0) {
3405
+ writer.uint32(8).int64(message.totalNameCount);
3406
+ }
3407
+ if (message.totalGroupCount !== 0) {
3408
+ writer.uint32(16).int64(message.totalGroupCount);
3409
+ }
3410
+ if (message.totalUnreviewedGroupCount !== 0) {
3411
+ writer.uint32(24).int64(message.totalUnreviewedGroupCount);
3412
+ }
3413
+ if (message.unreviewedGroupCount !== 0) {
3414
+ writer.uint32(32).int64(message.unreviewedGroupCount);
3415
+ }
3416
+ if (message.reviewedGroupCount !== 0) {
3417
+ writer.uint32(40).int64(message.reviewedGroupCount);
3418
+ }
3419
+ if (message.observedGroupCount !== 0) {
3420
+ writer.uint32(48).int64(message.observedGroupCount);
3421
+ }
3422
+ if (message.unobservedGroupCount !== 0) {
3423
+ writer.uint32(56).int64(message.unobservedGroupCount);
3424
+ }
3425
+ if (message.unreviewedNameCount !== 0) {
3426
+ writer.uint32(64).int64(message.unreviewedNameCount);
3427
+ }
3428
+ for (const v of message.sources) {
3429
+ AIReferenceSourceCount.encode(v!, writer.uint32(74).fork()).join();
3430
+ }
3431
+ return writer;
3432
+ },
3433
+
3434
+ decode(input: BinaryReader | Uint8Array, length?: number): AIReferenceGroupCounts {
3435
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3436
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
3437
+ if (previousRecursionDepth >= 100) {
3438
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3439
+ }
3440
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
3441
+ try {
3442
+ const end = length === undefined ? reader.len : reader.pos + length;
3443
+ const message = createBaseAIReferenceGroupCounts();
3444
+ while (reader.pos < end) {
3445
+ const tag = reader.uint32();
3446
+ switch (tag >>> 3) {
3447
+ case 1: {
3448
+ if (tag !== 8) {
3449
+ break;
3450
+ }
3451
+
3452
+ message.totalNameCount = longToNumber(reader.int64());
3453
+ continue;
3454
+ }
3455
+ case 2: {
3456
+ if (tag !== 16) {
3457
+ break;
3458
+ }
3459
+
3460
+ message.totalGroupCount = longToNumber(reader.int64());
3461
+ continue;
3462
+ }
3463
+ case 3: {
3464
+ if (tag !== 24) {
3465
+ break;
3466
+ }
3467
+
3468
+ message.totalUnreviewedGroupCount = longToNumber(reader.int64());
3469
+ continue;
3470
+ }
3471
+ case 4: {
3472
+ if (tag !== 32) {
3473
+ break;
3474
+ }
3475
+
3476
+ message.unreviewedGroupCount = longToNumber(reader.int64());
3477
+ continue;
3478
+ }
3479
+ case 5: {
3480
+ if (tag !== 40) {
3481
+ break;
3482
+ }
3483
+
3484
+ message.reviewedGroupCount = longToNumber(reader.int64());
3485
+ continue;
3486
+ }
3487
+ case 6: {
3488
+ if (tag !== 48) {
3489
+ break;
3490
+ }
3491
+
3492
+ message.observedGroupCount = longToNumber(reader.int64());
3493
+ continue;
3494
+ }
3495
+ case 7: {
3496
+ if (tag !== 56) {
3497
+ break;
3498
+ }
3499
+
3500
+ message.unobservedGroupCount = longToNumber(reader.int64());
3501
+ continue;
3502
+ }
3503
+ case 8: {
3504
+ if (tag !== 64) {
3505
+ break;
3506
+ }
3507
+
3508
+ message.unreviewedNameCount = longToNumber(reader.int64());
3509
+ continue;
3510
+ }
3511
+ case 9: {
3512
+ if (tag !== 74) {
3513
+ break;
3514
+ }
3515
+
3516
+ message.sources.push(AIReferenceSourceCount.decode(reader, reader.uint32()));
3517
+ continue;
3518
+ }
3519
+ }
3520
+ if ((tag & 7) === 4 || tag === 0) {
3521
+ break;
3522
+ }
3523
+ reader.skip(tag & 7);
3524
+ }
3525
+ return message;
3526
+ } finally {
3527
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
3528
+ }
3529
+ },
3530
+
3531
+ fromJSON(object: any): AIReferenceGroupCounts {
3532
+ return {
3533
+ totalNameCount: isSet(object.totalNameCount)
3534
+ ? globalThis.Number(object.totalNameCount)
3535
+ : isSet(object.total_name_count)
3536
+ ? globalThis.Number(object.total_name_count)
3537
+ : 0,
3538
+ totalGroupCount: isSet(object.totalGroupCount)
3539
+ ? globalThis.Number(object.totalGroupCount)
3540
+ : isSet(object.total_group_count)
3541
+ ? globalThis.Number(object.total_group_count)
3542
+ : 0,
3543
+ totalUnreviewedGroupCount: isSet(object.totalUnreviewedGroupCount)
3544
+ ? globalThis.Number(object.totalUnreviewedGroupCount)
3545
+ : isSet(object.total_unreviewed_group_count)
3546
+ ? globalThis.Number(object.total_unreviewed_group_count)
3547
+ : 0,
3548
+ unreviewedGroupCount: isSet(object.unreviewedGroupCount)
3549
+ ? globalThis.Number(object.unreviewedGroupCount)
3550
+ : isSet(object.unreviewed_group_count)
3551
+ ? globalThis.Number(object.unreviewed_group_count)
3552
+ : 0,
3553
+ reviewedGroupCount: isSet(object.reviewedGroupCount)
3554
+ ? globalThis.Number(object.reviewedGroupCount)
3555
+ : isSet(object.reviewed_group_count)
3556
+ ? globalThis.Number(object.reviewed_group_count)
3557
+ : 0,
3558
+ observedGroupCount: isSet(object.observedGroupCount)
3559
+ ? globalThis.Number(object.observedGroupCount)
3560
+ : isSet(object.observed_group_count)
3561
+ ? globalThis.Number(object.observed_group_count)
3562
+ : 0,
3563
+ unobservedGroupCount: isSet(object.unobservedGroupCount)
3564
+ ? globalThis.Number(object.unobservedGroupCount)
3565
+ : isSet(object.unobserved_group_count)
3566
+ ? globalThis.Number(object.unobserved_group_count)
3567
+ : 0,
3568
+ unreviewedNameCount: isSet(object.unreviewedNameCount)
3569
+ ? globalThis.Number(object.unreviewedNameCount)
3570
+ : isSet(object.unreviewed_name_count)
3571
+ ? globalThis.Number(object.unreviewed_name_count)
3572
+ : 0,
3573
+ sources: globalThis.Array.isArray(object?.sources)
3574
+ ? object.sources.map((e: any) => AIReferenceSourceCount.fromJSON(e))
3575
+ : [],
3576
+ };
3577
+ },
3578
+
3579
+ toJSON(message: AIReferenceGroupCounts): unknown {
3580
+ const obj: any = {};
3581
+ if (message.totalNameCount !== 0) {
3582
+ obj.totalNameCount = Math.round(message.totalNameCount);
3583
+ }
3584
+ if (message.totalGroupCount !== 0) {
3585
+ obj.totalGroupCount = Math.round(message.totalGroupCount);
3586
+ }
3587
+ if (message.totalUnreviewedGroupCount !== 0) {
3588
+ obj.totalUnreviewedGroupCount = Math.round(message.totalUnreviewedGroupCount);
3589
+ }
3590
+ if (message.unreviewedGroupCount !== 0) {
3591
+ obj.unreviewedGroupCount = Math.round(message.unreviewedGroupCount);
3592
+ }
3593
+ if (message.reviewedGroupCount !== 0) {
3594
+ obj.reviewedGroupCount = Math.round(message.reviewedGroupCount);
3595
+ }
3596
+ if (message.observedGroupCount !== 0) {
3597
+ obj.observedGroupCount = Math.round(message.observedGroupCount);
3598
+ }
3599
+ if (message.unobservedGroupCount !== 0) {
3600
+ obj.unobservedGroupCount = Math.round(message.unobservedGroupCount);
3601
+ }
3602
+ if (message.unreviewedNameCount !== 0) {
3603
+ obj.unreviewedNameCount = Math.round(message.unreviewedNameCount);
3604
+ }
3605
+ if (message.sources?.length) {
3606
+ obj.sources = message.sources.map((e) => AIReferenceSourceCount.toJSON(e));
3607
+ }
3608
+ return obj;
3609
+ },
3610
+
3611
+ create<I extends Exact<DeepPartial<AIReferenceGroupCounts>, I>>(base?: I): AIReferenceGroupCounts {
3612
+ return AIReferenceGroupCounts.fromPartial(base ?? ({} as any));
3613
+ },
3614
+ fromPartial<I extends Exact<DeepPartial<AIReferenceGroupCounts>, I>>(object: I): AIReferenceGroupCounts {
3615
+ const message = createBaseAIReferenceGroupCounts();
3616
+ message.totalNameCount = object.totalNameCount ?? 0;
3617
+ message.totalGroupCount = object.totalGroupCount ?? 0;
3618
+ message.totalUnreviewedGroupCount = object.totalUnreviewedGroupCount ?? 0;
3619
+ message.unreviewedGroupCount = object.unreviewedGroupCount ?? 0;
3620
+ message.reviewedGroupCount = object.reviewedGroupCount ?? 0;
3621
+ message.observedGroupCount = object.observedGroupCount ?? 0;
3622
+ message.unobservedGroupCount = object.unobservedGroupCount ?? 0;
3623
+ message.unreviewedNameCount = object.unreviewedNameCount ?? 0;
3624
+ message.sources = object.sources?.map((e) => AIReferenceSourceCount.fromPartial(e)) || [];
3625
+ return message;
3626
+ },
3627
+ };
3628
+
3629
+ function createBaseAIReferenceSourceCount(): AIReferenceSourceCount {
3630
+ return { sourceSystem: "", groupCount: 0 };
3631
+ }
3632
+
3633
+ export const AIReferenceSourceCount: MessageFns<AIReferenceSourceCount> = {
3634
+ encode(message: AIReferenceSourceCount, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3635
+ if (message.sourceSystem !== "") {
3636
+ writer.uint32(10).string(message.sourceSystem);
3637
+ }
3638
+ if (message.groupCount !== 0) {
3639
+ writer.uint32(16).int64(message.groupCount);
3640
+ }
3641
+ return writer;
3642
+ },
3643
+
3644
+ decode(input: BinaryReader | Uint8Array, length?: number): AIReferenceSourceCount {
3645
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3646
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
3647
+ if (previousRecursionDepth >= 100) {
3648
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3649
+ }
3650
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
3651
+ try {
3652
+ const end = length === undefined ? reader.len : reader.pos + length;
3653
+ const message = createBaseAIReferenceSourceCount();
3654
+ while (reader.pos < end) {
3655
+ const tag = reader.uint32();
3656
+ switch (tag >>> 3) {
3657
+ case 1: {
3658
+ if (tag !== 10) {
3659
+ break;
3660
+ }
3661
+
3662
+ message.sourceSystem = reader.string();
3663
+ continue;
3664
+ }
3665
+ case 2: {
3666
+ if (tag !== 16) {
3667
+ break;
3668
+ }
3669
+
3670
+ message.groupCount = longToNumber(reader.int64());
3671
+ continue;
3672
+ }
3673
+ }
3674
+ if ((tag & 7) === 4 || tag === 0) {
3675
+ break;
3676
+ }
3677
+ reader.skip(tag & 7);
3678
+ }
3679
+ return message;
3680
+ } finally {
3681
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
3682
+ }
3683
+ },
3684
+
3685
+ fromJSON(object: any): AIReferenceSourceCount {
3686
+ return {
3687
+ sourceSystem: isSet(object.sourceSystem)
3688
+ ? globalThis.String(object.sourceSystem)
3689
+ : isSet(object.source_system)
3690
+ ? globalThis.String(object.source_system)
3691
+ : "",
3692
+ groupCount: isSet(object.groupCount)
3693
+ ? globalThis.Number(object.groupCount)
3694
+ : isSet(object.group_count)
3695
+ ? globalThis.Number(object.group_count)
3696
+ : 0,
3697
+ };
3698
+ },
3699
+
3700
+ toJSON(message: AIReferenceSourceCount): unknown {
3701
+ const obj: any = {};
3702
+ if (message.sourceSystem !== "") {
3703
+ obj.sourceSystem = message.sourceSystem;
3704
+ }
3705
+ if (message.groupCount !== 0) {
3706
+ obj.groupCount = Math.round(message.groupCount);
3707
+ }
3708
+ return obj;
3709
+ },
3710
+
3711
+ create<I extends Exact<DeepPartial<AIReferenceSourceCount>, I>>(base?: I): AIReferenceSourceCount {
3712
+ return AIReferenceSourceCount.fromPartial(base ?? ({} as any));
3713
+ },
3714
+ fromPartial<I extends Exact<DeepPartial<AIReferenceSourceCount>, I>>(object: I): AIReferenceSourceCount {
3715
+ const message = createBaseAIReferenceSourceCount();
3716
+ message.sourceSystem = object.sourceSystem ?? "";
3717
+ message.groupCount = object.groupCount ?? 0;
3718
+ return message;
3719
+ },
3720
+ };
3721
+
3722
+ function createBaseAIReferenceName(): AIReferenceName {
3723
+ return { name: "", displayName: "", sourceSystems: [], origin: 0, updatedAt: undefined, observed: false };
3724
+ }
3725
+
3726
+ export const AIReferenceName: MessageFns<AIReferenceName> = {
3727
+ encode(message: AIReferenceName, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3728
+ if (message.name !== "") {
3729
+ writer.uint32(10).string(message.name);
3730
+ }
3731
+ if (message.displayName !== "") {
3732
+ writer.uint32(18).string(message.displayName);
3733
+ }
3734
+ for (const v of message.sourceSystems) {
3735
+ writer.uint32(26).string(v!);
3736
+ }
3737
+ if (message.origin !== 0) {
3738
+ writer.uint32(32).int32(message.origin);
3739
+ }
3740
+ if (message.updatedAt !== undefined) {
3741
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(42).fork()).join();
3742
+ }
3743
+ if (message.observed !== false) {
3744
+ writer.uint32(48).bool(message.observed);
3745
+ }
3746
+ return writer;
3747
+ },
3748
+
3749
+ decode(input: BinaryReader | Uint8Array, length?: number): AIReferenceName {
3750
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3751
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
3752
+ if (previousRecursionDepth >= 100) {
3753
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3754
+ }
3755
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
3756
+ try {
3757
+ const end = length === undefined ? reader.len : reader.pos + length;
3758
+ const message = createBaseAIReferenceName();
3759
+ while (reader.pos < end) {
3760
+ const tag = reader.uint32();
3761
+ switch (tag >>> 3) {
3762
+ case 1: {
3763
+ if (tag !== 10) {
3764
+ break;
3765
+ }
3766
+
3767
+ message.name = reader.string();
3768
+ continue;
3769
+ }
3770
+ case 2: {
3771
+ if (tag !== 18) {
3772
+ break;
3773
+ }
3774
+
3775
+ message.displayName = reader.string();
3776
+ continue;
3777
+ }
3778
+ case 3: {
3779
+ if (tag !== 26) {
3780
+ break;
3781
+ }
3782
+
3783
+ message.sourceSystems.push(reader.string());
3784
+ continue;
3785
+ }
3786
+ case 4: {
3787
+ if (tag !== 32) {
3788
+ break;
3789
+ }
3790
+
3791
+ message.origin = reader.int32() as any;
3792
+ continue;
3793
+ }
3794
+ case 5: {
3795
+ if (tag !== 42) {
3796
+ break;
3797
+ }
3798
+
3799
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3800
+ continue;
3801
+ }
3802
+ case 6: {
3803
+ if (tag !== 48) {
3804
+ break;
3805
+ }
3806
+
3807
+ message.observed = reader.bool();
3808
+ continue;
3809
+ }
3810
+ }
3811
+ if ((tag & 7) === 4 || tag === 0) {
3812
+ break;
3813
+ }
3814
+ reader.skip(tag & 7);
3815
+ }
3816
+ return message;
3817
+ } finally {
3818
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
3819
+ }
3820
+ },
3821
+
3822
+ fromJSON(object: any): AIReferenceName {
3823
+ return {
3824
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
3825
+ displayName: isSet(object.displayName)
3826
+ ? globalThis.String(object.displayName)
3827
+ : isSet(object.display_name)
3828
+ ? globalThis.String(object.display_name)
3829
+ : "",
3830
+ sourceSystems: globalThis.Array.isArray(object?.sourceSystems)
3831
+ ? object.sourceSystems.map((e: any) => globalThis.String(e))
3832
+ : globalThis.Array.isArray(object?.source_systems)
3833
+ ? object.source_systems.map((e: any) => globalThis.String(e))
3834
+ : [],
3835
+ origin: isSet(object.origin) ? aIReferenceNameOriginFromJSON(object.origin) : 0,
3836
+ updatedAt: isSet(object.updatedAt)
3837
+ ? fromJsonTimestamp(object.updatedAt)
3838
+ : isSet(object.updated_at)
3839
+ ? fromJsonTimestamp(object.updated_at)
3840
+ : undefined,
3841
+ observed: isSet(object.observed) ? globalThis.Boolean(object.observed) : false,
3842
+ };
3843
+ },
3844
+
3845
+ toJSON(message: AIReferenceName): unknown {
3846
+ const obj: any = {};
3847
+ if (message.name !== "") {
3848
+ obj.name = message.name;
3849
+ }
3850
+ if (message.displayName !== "") {
3851
+ obj.displayName = message.displayName;
3852
+ }
3853
+ if (message.sourceSystems?.length) {
3854
+ obj.sourceSystems = message.sourceSystems;
3855
+ }
3856
+ if (message.origin !== 0) {
3857
+ obj.origin = aIReferenceNameOriginToJSON(message.origin);
3858
+ }
3859
+ if (message.updatedAt !== undefined) {
3860
+ obj.updatedAt = message.updatedAt.toISOString();
3861
+ }
3862
+ if (message.observed !== false) {
3863
+ obj.observed = message.observed;
3864
+ }
3865
+ return obj;
3866
+ },
3867
+
3868
+ create<I extends Exact<DeepPartial<AIReferenceName>, I>>(base?: I): AIReferenceName {
3869
+ return AIReferenceName.fromPartial(base ?? ({} as any));
3870
+ },
3871
+ fromPartial<I extends Exact<DeepPartial<AIReferenceName>, I>>(object: I): AIReferenceName {
3872
+ const message = createBaseAIReferenceName();
3873
+ message.name = object.name ?? "";
3874
+ message.displayName = object.displayName ?? "";
3875
+ message.sourceSystems = object.sourceSystems?.map((e) => e) || [];
3876
+ message.origin = object.origin ?? 0;
3877
+ message.updatedAt = object.updatedAt ?? undefined;
3878
+ message.observed = object.observed ?? false;
3879
+ return message;
3880
+ },
3881
+ };
3882
+
3883
+ /**
3884
+ * ReferenceGatewayService is the frontend-facing surface for the AI reference data an org reads: its
3885
+ * principals (writes org-admin only) and the provider / model / effort / biller display names. The
3886
+ * name tables are global: each List returns the names the org's own telemetry reported, mapped through
3887
+ * them (scope ALL: every recorded name); Mirador staff edit them through AdminGatewayService. It proxies telemetry.api.v1.AIReferenceService.
3888
+ */
3889
+ export interface ReferenceGatewayService {
3890
+ ListPrincipals(request: ListPrincipalsRequest, metadata?: Metadata): Promise<ListPrincipalsResponse>;
2032
3891
  UpdatePrincipal(request: UpdatePrincipalRequest, metadata?: Metadata): Promise<UpdatePrincipalResponse>;
2033
3892
  /** Any org member reads the name tables. Every stored name of the table has an entry, recorded or not. */
2034
3893
  ListAIProviders(request: ListAIProvidersRequest, metadata?: Metadata): Promise<ListAIProvidersResponse>;
2035
3894
  ListAIModels(request: ListAIModelsRequest, metadata?: Metadata): Promise<ListAIModelsResponse>;
2036
3895
  ListAIEfforts(request: ListAIEffortsRequest, metadata?: Metadata): Promise<ListAIEffortsResponse>;
2037
3896
  ListAIBillers(request: ListAIBillersRequest, metadata?: Metadata): Promise<ListAIBillersResponse>;
3897
+ /**
3898
+ * Each List<X>Groups pages one table as the admin pages show it: one group per display name, filtered and
3899
+ * counted server-side (it proxies telemetry.api.v1.AIReferenceService). A name is observed when an organization
3900
+ * of organization_ids reported it, and carries the sources that reported it to them; every other recorded name
3901
+ * is listed unobserved with only its price-catalog sources. The empty effort (a call that reported none) is
3902
+ * always listed observed.
3903
+ *
3904
+ * Groups come in one fixed order, so there is no sort field: efforts by their step on the effort meter
3905
+ * (default, minimal, low, medium, high, xhigh, max, then unplaced), then display name; the other tables by
3906
+ * display name. A display name that is no level takes the step of its first stored name the meter places, else
3907
+ * of its own words; a top-step spelling other than max ("maximum", "ultra", "highest") sits at xhigh. Display
3908
+ * names compare as bytes and name one group each, so no two groups tie and pages never overlap. An empty result
3909
+ * is page 1 of total_pages 0.
3910
+ */
3911
+ ListAIProviderGroups(
3912
+ request: ListAIProviderGroupsRequest,
3913
+ metadata?: Metadata,
3914
+ ): Promise<ListAIProviderGroupsResponse>;
3915
+ ListAIModelGroups(request: ListAIModelGroupsRequest, metadata?: Metadata): Promise<ListAIModelGroupsResponse>;
3916
+ ListAIEffortGroups(request: ListAIEffortGroupsRequest, metadata?: Metadata): Promise<ListAIEffortGroupsResponse>;
3917
+ ListAIBillerGroups(request: ListAIBillerGroupsRequest, metadata?: Metadata): Promise<ListAIBillerGroupsResponse>;
2038
3918
  }
2039
3919
 
2040
3920
  export const ReferenceGatewayServiceServiceName = "gateway.web.v1.ReferenceGatewayService";
@@ -2050,6 +3930,10 @@ export class ReferenceGatewayServiceClientImpl implements ReferenceGatewayServic
2050
3930
  this.ListAIModels = this.ListAIModels.bind(this);
2051
3931
  this.ListAIEfforts = this.ListAIEfforts.bind(this);
2052
3932
  this.ListAIBillers = this.ListAIBillers.bind(this);
3933
+ this.ListAIProviderGroups = this.ListAIProviderGroups.bind(this);
3934
+ this.ListAIModelGroups = this.ListAIModelGroups.bind(this);
3935
+ this.ListAIEffortGroups = this.ListAIEffortGroups.bind(this);
3936
+ this.ListAIBillerGroups = this.ListAIBillerGroups.bind(this);
2053
3937
  }
2054
3938
  ListPrincipals(request: ListPrincipalsRequest, metadata?: Metadata): Promise<ListPrincipalsResponse> {
2055
3939
  const data = ListPrincipalsRequest.encode(request).finish();
@@ -2086,6 +3970,33 @@ export class ReferenceGatewayServiceClientImpl implements ReferenceGatewayServic
2086
3970
  const promise = this.rpc.request(this.service, "ListAIBillers", data, metadata);
2087
3971
  return promise.then((data) => ListAIBillersResponse.decode(new BinaryReader(data)));
2088
3972
  }
3973
+
3974
+ ListAIProviderGroups(
3975
+ request: ListAIProviderGroupsRequest,
3976
+ metadata?: Metadata,
3977
+ ): Promise<ListAIProviderGroupsResponse> {
3978
+ const data = ListAIProviderGroupsRequest.encode(request).finish();
3979
+ const promise = this.rpc.request(this.service, "ListAIProviderGroups", data, metadata);
3980
+ return promise.then((data) => ListAIProviderGroupsResponse.decode(new BinaryReader(data)));
3981
+ }
3982
+
3983
+ ListAIModelGroups(request: ListAIModelGroupsRequest, metadata?: Metadata): Promise<ListAIModelGroupsResponse> {
3984
+ const data = ListAIModelGroupsRequest.encode(request).finish();
3985
+ const promise = this.rpc.request(this.service, "ListAIModelGroups", data, metadata);
3986
+ return promise.then((data) => ListAIModelGroupsResponse.decode(new BinaryReader(data)));
3987
+ }
3988
+
3989
+ ListAIEffortGroups(request: ListAIEffortGroupsRequest, metadata?: Metadata): Promise<ListAIEffortGroupsResponse> {
3990
+ const data = ListAIEffortGroupsRequest.encode(request).finish();
3991
+ const promise = this.rpc.request(this.service, "ListAIEffortGroups", data, metadata);
3992
+ return promise.then((data) => ListAIEffortGroupsResponse.decode(new BinaryReader(data)));
3993
+ }
3994
+
3995
+ ListAIBillerGroups(request: ListAIBillerGroupsRequest, metadata?: Metadata): Promise<ListAIBillerGroupsResponse> {
3996
+ const data = ListAIBillerGroupsRequest.encode(request).finish();
3997
+ const promise = this.rpc.request(this.service, "ListAIBillerGroups", data, metadata);
3998
+ return promise.then((data) => ListAIBillerGroupsResponse.decode(new BinaryReader(data)));
3999
+ }
2089
4000
  }
2090
4001
 
2091
4002
  interface Rpc {