@miradorlabs/web-grpc 3.33.0 → 3.35.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 (33) 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 +32 -10
  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 +1773 -132
  11. package/proto/gateway/web/v1/admin_gateway_grpc_pb.js +146 -0
  12. package/proto/gateway/web/v1/admin_gateway_pb.js +2865 -0
  13. package/proto/gateway/web/v1/ai_gateway.ts +1016 -186
  14. package/proto/gateway/web/v1/ai_gateway_grpc_pb.js +36 -0
  15. package/proto/gateway/web/v1/ai_gateway_pb.js +1593 -118
  16. package/proto/gateway/web/v1/attribute_value.ts +1 -1
  17. package/proto/gateway/web/v1/beta_gateway.ts +1 -1
  18. package/proto/gateway/web/v1/chain_gateway.ts +1 -1
  19. package/proto/gateway/web/v1/common.ts +1 -1
  20. package/proto/gateway/web/v1/derived_metric_gateway.ts +1 -1
  21. package/proto/gateway/web/v1/github_connector.ts +1 -1
  22. package/proto/gateway/web/v1/integration_gateway.ts +1 -1
  23. package/proto/gateway/web/v1/log_gateway.ts +1 -1
  24. package/proto/gateway/web/v1/market_gateway.ts +1 -1
  25. package/proto/gateway/web/v1/metric_gateway.ts +1 -1
  26. package/proto/gateway/web/v1/oauth_gateway.ts +1 -1
  27. package/proto/gateway/web/v1/plan_gateway.ts +1 -1
  28. package/proto/gateway/web/v1/policy_gateway.ts +1 -1
  29. package/proto/gateway/web/v1/reference_gateway.ts +1 -1
  30. package/proto/gateway/web/v1/rule_gateway.ts +1 -1
  31. package/proto/gateway/web/v1/slo_gateway.ts +1 -1
  32. package/proto/gateway/web/v1/trace_gateway.ts +1 -1
  33. 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.15.0
3
+ // protoc-gen-ts_proto v2.15.3
4
4
  // protoc v3.21.12
5
5
  // source: google/api/field_behavior.proto
6
6
 
@@ -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.15.0
3
+ // protoc-gen-ts_proto v2.15.3
4
4
  // protoc v3.21.12
5
5
  // source: google/protobuf/descriptor.proto
6
6
 
@@ -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.15.0
3
+ // protoc-gen-ts_proto v2.15.3
4
4
  // protoc v3.21.12
5
5
  // source: google/protobuf/duration.proto
6
6
 
@@ -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.15.0
3
+ // protoc-gen-ts_proto v2.15.3
4
4
  // protoc v3.21.12
5
5
  // source: google/protobuf/timestamp.proto
6
6
 
@@ -173,21 +173,17 @@ export const Timestamp: MessageFns<Timestamp> = {
173
173
  },
174
174
 
175
175
  fromJSON(object: any): Timestamp {
176
+ if (typeof object === "string") {
177
+ return Timestamp.fromJSON(timestampFromJson(object));
178
+ }
176
179
  return {
177
180
  seconds: isSet(object.seconds) ? globalThis.Number(object.seconds) : 0,
178
181
  nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
179
182
  };
180
183
  },
181
184
 
182
- toJSON(message: Timestamp): unknown {
183
- const obj: any = {};
184
- if (message.seconds !== 0) {
185
- obj.seconds = Math.round(message.seconds);
186
- }
187
- if (message.nanos !== 0) {
188
- obj.nanos = Math.round(message.nanos);
189
- }
190
- return obj;
185
+ toJSON(message: Timestamp): string {
186
+ return timestampToJson(globalThis.Number(message.seconds ?? 0), message.nanos ?? 0);
191
187
  },
192
188
 
193
189
  create<I extends Exact<DeepPartial<Timestamp>, I>>(base?: I): Timestamp {
@@ -213,6 +209,32 @@ type KeysOfUnion<T> = T extends T ? keyof T : never;
213
209
  export type Exact<P, I extends P> = P extends Builtin ? P
214
210
  : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
215
211
 
212
+ const timestampJsonRegex = /^.+T\d{2}:\d{2}:\d{2}(\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
213
+
214
+ function timestampFromJson(value: string): { seconds: number; nanos: number } {
215
+ const match = timestampJsonRegex.exec(value);
216
+ // Date only keeps milliseconds, so it parses the string without the fractional seconds
217
+ const fraction = match?.[1];
218
+ const millis = match
219
+ ? new globalThis.Date(fraction === undefined ? value : value.replace(fraction, "")).getTime()
220
+ : NaN;
221
+ if (!match || globalThis.Number.isNaN(millis)) {
222
+ throw new globalThis.Error(`Invalid timestamp: ${value}`);
223
+ }
224
+ const nanos = fraction === undefined ? 0 : globalThis.Number(fraction.slice(1, 10).padEnd(9, "0"));
225
+ return { seconds: millis / 1_000, nanos };
226
+ }
227
+
228
+ function timestampToJson(seconds: number, nanos: number): string {
229
+ const date = new globalThis.Date(seconds * 1_000).toISOString().slice(0, 19);
230
+ if (nanos === 0) {
231
+ return `${date}Z`;
232
+ }
233
+ const padded = nanos.toString().padStart(9, "0");
234
+ const len = nanos % 1_000_000 === 0 ? 3 : nanos % 1_000 === 0 ? 6 : 9;
235
+ return `${date}.${padded.slice(0, len)}Z`;
236
+ }
237
+
216
238
  function longToNumber(int64: { toString(): string }): number {
217
239
  const num = globalThis.Number(int64.toString());
218
240
  if (num > globalThis.Number.MAX_SAFE_INTEGER) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miradorlabs/web-grpc",
3
- "version": "3.33.0",
3
+ "version": "3.35.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",
@@ -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.15.0
3
+ // protoc-gen-ts_proto v2.15.3
4
4
  // protoc v3.21.12
5
5
  // source: proto/gateway/common/v1/attribute_value.proto
6
6
 
@@ -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.15.0
3
+ // protoc-gen-ts_proto v2.15.3
4
4
  // protoc v3.21.12
5
5
  // source: proto/gateway/common/v1/status.proto
6
6
 
@@ -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.15.0
3
+ // protoc-gen-ts_proto v2.15.3
4
4
  // protoc v3.21.12
5
5
  // source: proto/gateway/common/v1/types.proto
6
6
 
@@ -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.15.0
3
+ // protoc-gen-ts_proto v2.15.3
4
4
  // protoc v3.21.12
5
5
  // source: proto/gateway/web/v1/account_gateway.proto
6
6