@miradorlabs/web-grpc 2.49.0 → 2.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miradorlabs/web-grpc",
3
- "version": "2.49.0",
3
+ "version": "2.51.0",
4
4
  "description": "Generated gRPC (grpc-js) client stubs for the Mirador web gateway.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -945,6 +945,26 @@ export interface ListModelPricesResponse {
945
945
  totalCount?: number | undefined;
946
946
  }
947
947
 
948
+ export interface ListModelPriceHistoryRequest {
949
+ organizationId: string;
950
+ projectId: string;
951
+ /** model is required; source and provider narrow it further. */
952
+ filter:
953
+ | AIModelPriceFilter
954
+ | undefined;
955
+ /** Half-open [start_time, end_time); either may be unset to read to that end. */
956
+ startTime: Date | undefined;
957
+ endTime: Date | undefined;
958
+ pageSize: number;
959
+ }
960
+
961
+ export interface ListModelPriceHistoryResponse {
962
+ status: ResponseStatus | undefined;
963
+ prices: AIModelPrice[];
964
+ /** page_size cut the series short — older observations exist beyond the last row. */
965
+ truncated: boolean;
966
+ }
967
+
948
968
  export interface AIModelPrice {
949
969
  source: string;
950
970
  provider: string;
@@ -8178,6 +8198,289 @@ export const ListModelPricesResponse: MessageFns<ListModelPricesResponse> = {
8178
8198
  },
8179
8199
  };
8180
8200
 
8201
+ function createBaseListModelPriceHistoryRequest(): ListModelPriceHistoryRequest {
8202
+ return {
8203
+ organizationId: "",
8204
+ projectId: "",
8205
+ filter: undefined,
8206
+ startTime: undefined,
8207
+ endTime: undefined,
8208
+ pageSize: 0,
8209
+ };
8210
+ }
8211
+
8212
+ export const ListModelPriceHistoryRequest: MessageFns<ListModelPriceHistoryRequest> = {
8213
+ encode(message: ListModelPriceHistoryRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
8214
+ if (message.organizationId !== "") {
8215
+ writer.uint32(10).string(message.organizationId);
8216
+ }
8217
+ if (message.projectId !== "") {
8218
+ writer.uint32(18).string(message.projectId);
8219
+ }
8220
+ if (message.filter !== undefined) {
8221
+ AIModelPriceFilter.encode(message.filter, writer.uint32(26).fork()).join();
8222
+ }
8223
+ if (message.startTime !== undefined) {
8224
+ Timestamp.encode(toTimestamp(message.startTime), writer.uint32(34).fork()).join();
8225
+ }
8226
+ if (message.endTime !== undefined) {
8227
+ Timestamp.encode(toTimestamp(message.endTime), writer.uint32(42).fork()).join();
8228
+ }
8229
+ if (message.pageSize !== 0) {
8230
+ writer.uint32(48).int32(message.pageSize);
8231
+ }
8232
+ return writer;
8233
+ },
8234
+
8235
+ decode(input: BinaryReader | Uint8Array, length?: number): ListModelPriceHistoryRequest {
8236
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
8237
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
8238
+ if (previousRecursionDepth >= 100) {
8239
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
8240
+ }
8241
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
8242
+ try {
8243
+ const end = length === undefined ? reader.len : reader.pos + length;
8244
+ const message = createBaseListModelPriceHistoryRequest();
8245
+ while (reader.pos < end) {
8246
+ const tag = reader.uint32();
8247
+ switch (tag >>> 3) {
8248
+ case 1: {
8249
+ if (tag !== 10) {
8250
+ break;
8251
+ }
8252
+
8253
+ message.organizationId = reader.string();
8254
+ continue;
8255
+ }
8256
+ case 2: {
8257
+ if (tag !== 18) {
8258
+ break;
8259
+ }
8260
+
8261
+ message.projectId = reader.string();
8262
+ continue;
8263
+ }
8264
+ case 3: {
8265
+ if (tag !== 26) {
8266
+ break;
8267
+ }
8268
+
8269
+ message.filter = AIModelPriceFilter.decode(reader, reader.uint32());
8270
+ continue;
8271
+ }
8272
+ case 4: {
8273
+ if (tag !== 34) {
8274
+ break;
8275
+ }
8276
+
8277
+ message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
8278
+ continue;
8279
+ }
8280
+ case 5: {
8281
+ if (tag !== 42) {
8282
+ break;
8283
+ }
8284
+
8285
+ message.endTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
8286
+ continue;
8287
+ }
8288
+ case 6: {
8289
+ if (tag !== 48) {
8290
+ break;
8291
+ }
8292
+
8293
+ message.pageSize = reader.int32();
8294
+ continue;
8295
+ }
8296
+ }
8297
+ if ((tag & 7) === 4 || tag === 0) {
8298
+ break;
8299
+ }
8300
+ reader.skip(tag & 7);
8301
+ }
8302
+ return message;
8303
+ } finally {
8304
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
8305
+ }
8306
+ },
8307
+
8308
+ fromJSON(object: any): ListModelPriceHistoryRequest {
8309
+ return {
8310
+ organizationId: isSet(object.organizationId)
8311
+ ? globalThis.String(object.organizationId)
8312
+ : isSet(object.organization_id)
8313
+ ? globalThis.String(object.organization_id)
8314
+ : "",
8315
+ projectId: isSet(object.projectId)
8316
+ ? globalThis.String(object.projectId)
8317
+ : isSet(object.project_id)
8318
+ ? globalThis.String(object.project_id)
8319
+ : "",
8320
+ filter: isSet(object.filter) ? AIModelPriceFilter.fromJSON(object.filter) : undefined,
8321
+ startTime: isSet(object.startTime)
8322
+ ? fromJsonTimestamp(object.startTime)
8323
+ : isSet(object.start_time)
8324
+ ? fromJsonTimestamp(object.start_time)
8325
+ : undefined,
8326
+ endTime: isSet(object.endTime)
8327
+ ? fromJsonTimestamp(object.endTime)
8328
+ : isSet(object.end_time)
8329
+ ? fromJsonTimestamp(object.end_time)
8330
+ : undefined,
8331
+ pageSize: isSet(object.pageSize)
8332
+ ? globalThis.Number(object.pageSize)
8333
+ : isSet(object.page_size)
8334
+ ? globalThis.Number(object.page_size)
8335
+ : 0,
8336
+ };
8337
+ },
8338
+
8339
+ toJSON(message: ListModelPriceHistoryRequest): unknown {
8340
+ const obj: any = {};
8341
+ if (message.organizationId !== "") {
8342
+ obj.organizationId = message.organizationId;
8343
+ }
8344
+ if (message.projectId !== "") {
8345
+ obj.projectId = message.projectId;
8346
+ }
8347
+ if (message.filter !== undefined) {
8348
+ obj.filter = AIModelPriceFilter.toJSON(message.filter);
8349
+ }
8350
+ if (message.startTime !== undefined) {
8351
+ obj.startTime = message.startTime.toISOString();
8352
+ }
8353
+ if (message.endTime !== undefined) {
8354
+ obj.endTime = message.endTime.toISOString();
8355
+ }
8356
+ if (message.pageSize !== 0) {
8357
+ obj.pageSize = Math.round(message.pageSize);
8358
+ }
8359
+ return obj;
8360
+ },
8361
+
8362
+ create<I extends Exact<DeepPartial<ListModelPriceHistoryRequest>, I>>(base?: I): ListModelPriceHistoryRequest {
8363
+ return ListModelPriceHistoryRequest.fromPartial(base ?? ({} as any));
8364
+ },
8365
+ fromPartial<I extends Exact<DeepPartial<ListModelPriceHistoryRequest>, I>>(object: I): ListModelPriceHistoryRequest {
8366
+ const message = createBaseListModelPriceHistoryRequest();
8367
+ message.organizationId = object.organizationId ?? "";
8368
+ message.projectId = object.projectId ?? "";
8369
+ message.filter = (object.filter !== undefined && object.filter !== null)
8370
+ ? AIModelPriceFilter.fromPartial(object.filter)
8371
+ : undefined;
8372
+ message.startTime = object.startTime ?? undefined;
8373
+ message.endTime = object.endTime ?? undefined;
8374
+ message.pageSize = object.pageSize ?? 0;
8375
+ return message;
8376
+ },
8377
+ };
8378
+
8379
+ function createBaseListModelPriceHistoryResponse(): ListModelPriceHistoryResponse {
8380
+ return { status: undefined, prices: [], truncated: false };
8381
+ }
8382
+
8383
+ export const ListModelPriceHistoryResponse: MessageFns<ListModelPriceHistoryResponse> = {
8384
+ encode(message: ListModelPriceHistoryResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
8385
+ if (message.status !== undefined) {
8386
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
8387
+ }
8388
+ for (const v of message.prices) {
8389
+ AIModelPrice.encode(v!, writer.uint32(18).fork()).join();
8390
+ }
8391
+ if (message.truncated !== false) {
8392
+ writer.uint32(24).bool(message.truncated);
8393
+ }
8394
+ return writer;
8395
+ },
8396
+
8397
+ decode(input: BinaryReader | Uint8Array, length?: number): ListModelPriceHistoryResponse {
8398
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
8399
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
8400
+ if (previousRecursionDepth >= 100) {
8401
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
8402
+ }
8403
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
8404
+ try {
8405
+ const end = length === undefined ? reader.len : reader.pos + length;
8406
+ const message = createBaseListModelPriceHistoryResponse();
8407
+ while (reader.pos < end) {
8408
+ const tag = reader.uint32();
8409
+ switch (tag >>> 3) {
8410
+ case 1: {
8411
+ if (tag !== 10) {
8412
+ break;
8413
+ }
8414
+
8415
+ message.status = ResponseStatus.decode(reader, reader.uint32());
8416
+ continue;
8417
+ }
8418
+ case 2: {
8419
+ if (tag !== 18) {
8420
+ break;
8421
+ }
8422
+
8423
+ message.prices.push(AIModelPrice.decode(reader, reader.uint32()));
8424
+ continue;
8425
+ }
8426
+ case 3: {
8427
+ if (tag !== 24) {
8428
+ break;
8429
+ }
8430
+
8431
+ message.truncated = reader.bool();
8432
+ continue;
8433
+ }
8434
+ }
8435
+ if ((tag & 7) === 4 || tag === 0) {
8436
+ break;
8437
+ }
8438
+ reader.skip(tag & 7);
8439
+ }
8440
+ return message;
8441
+ } finally {
8442
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
8443
+ }
8444
+ },
8445
+
8446
+ fromJSON(object: any): ListModelPriceHistoryResponse {
8447
+ return {
8448
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
8449
+ prices: globalThis.Array.isArray(object?.prices) ? object.prices.map((e: any) => AIModelPrice.fromJSON(e)) : [],
8450
+ truncated: isSet(object.truncated) ? globalThis.Boolean(object.truncated) : false,
8451
+ };
8452
+ },
8453
+
8454
+ toJSON(message: ListModelPriceHistoryResponse): unknown {
8455
+ const obj: any = {};
8456
+ if (message.status !== undefined) {
8457
+ obj.status = ResponseStatus.toJSON(message.status);
8458
+ }
8459
+ if (message.prices?.length) {
8460
+ obj.prices = message.prices.map((e) => AIModelPrice.toJSON(e));
8461
+ }
8462
+ if (message.truncated !== false) {
8463
+ obj.truncated = message.truncated;
8464
+ }
8465
+ return obj;
8466
+ },
8467
+
8468
+ create<I extends Exact<DeepPartial<ListModelPriceHistoryResponse>, I>>(base?: I): ListModelPriceHistoryResponse {
8469
+ return ListModelPriceHistoryResponse.fromPartial(base ?? ({} as any));
8470
+ },
8471
+ fromPartial<I extends Exact<DeepPartial<ListModelPriceHistoryResponse>, I>>(
8472
+ object: I,
8473
+ ): ListModelPriceHistoryResponse {
8474
+ const message = createBaseListModelPriceHistoryResponse();
8475
+ message.status = (object.status !== undefined && object.status !== null)
8476
+ ? ResponseStatus.fromPartial(object.status)
8477
+ : undefined;
8478
+ message.prices = object.prices?.map((e) => AIModelPrice.fromPartial(e)) || [];
8479
+ message.truncated = object.truncated ?? false;
8480
+ return message;
8481
+ },
8482
+ };
8483
+
8181
8484
  function createBaseAIModelPrice(): AIModelPrice {
8182
8485
  return {
8183
8486
  source: "",
@@ -8590,6 +8893,14 @@ export interface AIGatewayService {
8590
8893
  StreamFileStateSummary(request: FileStateSummaryRequest, metadata?: Metadata): Observable<FileStateSummary>;
8591
8894
  /** Latest observed list price per (source, provider, model) from the global catalog. */
8592
8895
  ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse>;
8896
+ /**
8897
+ * Every stored observation for the filtered models over a time range, oldest first —
8898
+ * the rows ListModelPrices collapses. filter.model is required.
8899
+ */
8900
+ ListModelPriceHistory(
8901
+ request: ListModelPriceHistoryRequest,
8902
+ metadata?: Metadata,
8903
+ ): Promise<ListModelPriceHistoryResponse>;
8593
8904
  }
8594
8905
 
8595
8906
  export const AIGatewayServiceServiceName = "gateway.web.v1.AIGatewayService";
@@ -8613,6 +8924,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
8613
8924
  this.GetFileStateSummary = this.GetFileStateSummary.bind(this);
8614
8925
  this.StreamFileStateSummary = this.StreamFileStateSummary.bind(this);
8615
8926
  this.ListModelPrices = this.ListModelPrices.bind(this);
8927
+ this.ListModelPriceHistory = this.ListModelPriceHistory.bind(this);
8616
8928
  }
8617
8929
  ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse> {
8618
8930
  const data = ListSessionsRequest.encode(request).finish();
@@ -8700,6 +9012,15 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
8700
9012
  const promise = this.rpc.request(this.service, "ListModelPrices", data, metadata);
8701
9013
  return promise.then((data) => ListModelPricesResponse.decode(new BinaryReader(data)));
8702
9014
  }
9015
+
9016
+ ListModelPriceHistory(
9017
+ request: ListModelPriceHistoryRequest,
9018
+ metadata?: Metadata,
9019
+ ): Promise<ListModelPriceHistoryResponse> {
9020
+ const data = ListModelPriceHistoryRequest.encode(request).finish();
9021
+ const promise = this.rpc.request(this.service, "ListModelPriceHistory", data, metadata);
9022
+ return promise.then((data) => ListModelPriceHistoryResponse.decode(new BinaryReader(data)));
9023
+ }
8703
9024
  }
8704
9025
 
8705
9026
  interface Rpc {
@@ -140,6 +140,28 @@ function deserialize_gateway_web_v1_ListGitActivitiesResponse(buffer_arg) {
140
140
  return proto_gateway_web_v1_ai_gateway_pb.ListGitActivitiesResponse.deserializeBinary(new Uint8Array(buffer_arg));
141
141
  }
142
142
 
143
+ function serialize_gateway_web_v1_ListModelPriceHistoryRequest(arg) {
144
+ if (!(arg instanceof proto_gateway_web_v1_ai_gateway_pb.ListModelPriceHistoryRequest)) {
145
+ throw new Error('Expected argument of type gateway.web.v1.ListModelPriceHistoryRequest');
146
+ }
147
+ return Buffer.from(arg.serializeBinary());
148
+ }
149
+
150
+ function deserialize_gateway_web_v1_ListModelPriceHistoryRequest(buffer_arg) {
151
+ return proto_gateway_web_v1_ai_gateway_pb.ListModelPriceHistoryRequest.deserializeBinary(new Uint8Array(buffer_arg));
152
+ }
153
+
154
+ function serialize_gateway_web_v1_ListModelPriceHistoryResponse(arg) {
155
+ if (!(arg instanceof proto_gateway_web_v1_ai_gateway_pb.ListModelPriceHistoryResponse)) {
156
+ throw new Error('Expected argument of type gateway.web.v1.ListModelPriceHistoryResponse');
157
+ }
158
+ return Buffer.from(arg.serializeBinary());
159
+ }
160
+
161
+ function deserialize_gateway_web_v1_ListModelPriceHistoryResponse(buffer_arg) {
162
+ return proto_gateway_web_v1_ai_gateway_pb.ListModelPriceHistoryResponse.deserializeBinary(new Uint8Array(buffer_arg));
163
+ }
164
+
143
165
  function serialize_gateway_web_v1_ListModelPricesRequest(arg) {
144
166
  if (!(arg instanceof proto_gateway_web_v1_ai_gateway_pb.ListModelPricesRequest)) {
145
167
  throw new Error('Expected argument of type gateway.web.v1.ListModelPricesRequest');
@@ -473,6 +495,19 @@ listModelPrices: {
473
495
  responseSerialize: serialize_gateway_web_v1_ListModelPricesResponse,
474
496
  responseDeserialize: deserialize_gateway_web_v1_ListModelPricesResponse,
475
497
  },
498
+ // Every stored observation for the filtered models over a time range, oldest first —
499
+ // the rows ListModelPrices collapses. filter.model is required.
500
+ listModelPriceHistory: {
501
+ path: '/gateway.web.v1.AIGatewayService/ListModelPriceHistory',
502
+ requestStream: false,
503
+ responseStream: false,
504
+ requestType: proto_gateway_web_v1_ai_gateway_pb.ListModelPriceHistoryRequest,
505
+ responseType: proto_gateway_web_v1_ai_gateway_pb.ListModelPriceHistoryResponse,
506
+ requestSerialize: serialize_gateway_web_v1_ListModelPriceHistoryRequest,
507
+ requestDeserialize: deserialize_gateway_web_v1_ListModelPriceHistoryRequest,
508
+ responseSerialize: serialize_gateway_web_v1_ListModelPriceHistoryResponse,
509
+ responseDeserialize: deserialize_gateway_web_v1_ListModelPriceHistoryResponse,
510
+ },
476
511
  };
477
512
 
478
513
  exports.AIGatewayServiceClient = grpc.makeGenericClientConstructor(AIGatewayServiceService, 'AIGatewayService');