@miradorlabs/web-grpc 3.32.0 → 3.34.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/google/api/field_behavior.ts +1 -1
- package/google/protobuf/descriptor.ts +1 -1
- package/google/protobuf/duration.ts +1 -1
- package/google/protobuf/timestamp.ts +32 -10
- package/package.json +1 -1
- package/proto/gateway/common/v1/attribute_value.ts +1 -1
- package/proto/gateway/common/v1/status.ts +1 -1
- package/proto/gateway/common/v1/types.ts +1 -1
- package/proto/gateway/web/v1/account_gateway.ts +1 -1
- package/proto/gateway/web/v1/admin_gateway.ts +755 -1
- package/proto/gateway/web/v1/admin_gateway_grpc_pb.js +37 -0
- package/proto/gateway/web/v1/admin_gateway_pb.js +1061 -0
- package/proto/gateway/web/v1/ai_gateway.ts +6698 -4933
- package/proto/gateway/web/v1/ai_gateway_grpc_pb.js +73 -0
- package/proto/gateway/web/v1/ai_gateway_pb.js +11056 -7894
- package/proto/gateway/web/v1/attribute_value.ts +1 -1
- package/proto/gateway/web/v1/beta_gateway.ts +1 -1
- package/proto/gateway/web/v1/chain_gateway.ts +1 -1
- package/proto/gateway/web/v1/common.ts +1 -1
- package/proto/gateway/web/v1/derived_metric_gateway.ts +1 -1
- package/proto/gateway/web/v1/github_connector.ts +1 -1
- package/proto/gateway/web/v1/integration_gateway.ts +1 -1
- package/proto/gateway/web/v1/log_gateway.ts +1 -1
- package/proto/gateway/web/v1/market_gateway.ts +1 -1
- package/proto/gateway/web/v1/metric_gateway.ts +1 -1
- package/proto/gateway/web/v1/oauth_gateway.ts +1 -1
- package/proto/gateway/web/v1/plan_gateway.ts +1 -1
- package/proto/gateway/web/v1/policy_gateway.ts +1 -1
- package/proto/gateway/web/v1/reference_gateway.ts +1 -1
- package/proto/gateway/web/v1/rule_gateway.ts +1 -1
- package/proto/gateway/web/v1/slo_gateway.ts +1 -1
- package/proto/gateway/web/v1/trace_gateway.ts +1 -1
- 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.
|
|
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):
|
|
183
|
-
|
|
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