@miradorlabs/web-grpc 2.2.0 → 2.3.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.
@@ -10,6 +10,7 @@ import type { Metadata } from "@grpc/grpc-js";
10
10
  import { Observable } from "rxjs";
11
11
  import { map } from "rxjs/operators";
12
12
  import { Timestamp } from "../../../../google/protobuf/timestamp";
13
+ import { ResponseStatus } from "../../common/v1/status";
13
14
  import {
14
15
  AnalyticsTimeInterval,
15
16
  analyticsTimeIntervalFromJSON,
@@ -292,6 +293,119 @@ export function attributeFilterOpToJSON(object: AttributeFilterOp): string {
292
293
  }
293
294
  }
294
295
 
296
+ export enum WidgetType {
297
+ WIDGET_TYPE_UNSPECIFIED = 0,
298
+ /** WIDGET_TYPE_TIMESERIES - Bucketed series over the range. */
299
+ WIDGET_TYPE_TIMESERIES = 1,
300
+ /** WIDGET_TYPE_STAT - Single whole-range value. */
301
+ WIDGET_TYPE_STAT = 2,
302
+ /** WIDGET_TYPE_PIE - Whole-range value per group_by combination. */
303
+ WIDGET_TYPE_PIE = 3,
304
+ /** WIDGET_TYPE_TABLE - Row per group_by combination, column per query. */
305
+ WIDGET_TYPE_TABLE = 4,
306
+ /** WIDGET_TYPE_MARKDOWN - Static text, no queries. */
307
+ WIDGET_TYPE_MARKDOWN = 5,
308
+ UNRECOGNIZED = -1,
309
+ }
310
+
311
+ export function widgetTypeFromJSON(object: any): WidgetType {
312
+ switch (object) {
313
+ case 0:
314
+ case "WIDGET_TYPE_UNSPECIFIED":
315
+ return WidgetType.WIDGET_TYPE_UNSPECIFIED;
316
+ case 1:
317
+ case "WIDGET_TYPE_TIMESERIES":
318
+ return WidgetType.WIDGET_TYPE_TIMESERIES;
319
+ case 2:
320
+ case "WIDGET_TYPE_STAT":
321
+ return WidgetType.WIDGET_TYPE_STAT;
322
+ case 3:
323
+ case "WIDGET_TYPE_PIE":
324
+ return WidgetType.WIDGET_TYPE_PIE;
325
+ case 4:
326
+ case "WIDGET_TYPE_TABLE":
327
+ return WidgetType.WIDGET_TYPE_TABLE;
328
+ case 5:
329
+ case "WIDGET_TYPE_MARKDOWN":
330
+ return WidgetType.WIDGET_TYPE_MARKDOWN;
331
+ case -1:
332
+ case "UNRECOGNIZED":
333
+ default:
334
+ return WidgetType.UNRECOGNIZED;
335
+ }
336
+ }
337
+
338
+ export function widgetTypeToJSON(object: WidgetType): string {
339
+ switch (object) {
340
+ case WidgetType.WIDGET_TYPE_UNSPECIFIED:
341
+ return "WIDGET_TYPE_UNSPECIFIED";
342
+ case WidgetType.WIDGET_TYPE_TIMESERIES:
343
+ return "WIDGET_TYPE_TIMESERIES";
344
+ case WidgetType.WIDGET_TYPE_STAT:
345
+ return "WIDGET_TYPE_STAT";
346
+ case WidgetType.WIDGET_TYPE_PIE:
347
+ return "WIDGET_TYPE_PIE";
348
+ case WidgetType.WIDGET_TYPE_TABLE:
349
+ return "WIDGET_TYPE_TABLE";
350
+ case WidgetType.WIDGET_TYPE_MARKDOWN:
351
+ return "WIDGET_TYPE_MARKDOWN";
352
+ case WidgetType.UNRECOGNIZED:
353
+ default:
354
+ return "UNRECOGNIZED";
355
+ }
356
+ }
357
+
358
+ export enum TimeseriesStyle {
359
+ TIMESERIES_STYLE_UNSPECIFIED = 0,
360
+ TIMESERIES_STYLE_LINE = 1,
361
+ TIMESERIES_STYLE_AREA = 2,
362
+ TIMESERIES_STYLE_BAR = 3,
363
+ TIMESERIES_STYLE_STACKED_BAR = 4,
364
+ UNRECOGNIZED = -1,
365
+ }
366
+
367
+ export function timeseriesStyleFromJSON(object: any): TimeseriesStyle {
368
+ switch (object) {
369
+ case 0:
370
+ case "TIMESERIES_STYLE_UNSPECIFIED":
371
+ return TimeseriesStyle.TIMESERIES_STYLE_UNSPECIFIED;
372
+ case 1:
373
+ case "TIMESERIES_STYLE_LINE":
374
+ return TimeseriesStyle.TIMESERIES_STYLE_LINE;
375
+ case 2:
376
+ case "TIMESERIES_STYLE_AREA":
377
+ return TimeseriesStyle.TIMESERIES_STYLE_AREA;
378
+ case 3:
379
+ case "TIMESERIES_STYLE_BAR":
380
+ return TimeseriesStyle.TIMESERIES_STYLE_BAR;
381
+ case 4:
382
+ case "TIMESERIES_STYLE_STACKED_BAR":
383
+ return TimeseriesStyle.TIMESERIES_STYLE_STACKED_BAR;
384
+ case -1:
385
+ case "UNRECOGNIZED":
386
+ default:
387
+ return TimeseriesStyle.UNRECOGNIZED;
388
+ }
389
+ }
390
+
391
+ export function timeseriesStyleToJSON(object: TimeseriesStyle): string {
392
+ switch (object) {
393
+ case TimeseriesStyle.TIMESERIES_STYLE_UNSPECIFIED:
394
+ return "TIMESERIES_STYLE_UNSPECIFIED";
395
+ case TimeseriesStyle.TIMESERIES_STYLE_LINE:
396
+ return "TIMESERIES_STYLE_LINE";
397
+ case TimeseriesStyle.TIMESERIES_STYLE_AREA:
398
+ return "TIMESERIES_STYLE_AREA";
399
+ case TimeseriesStyle.TIMESERIES_STYLE_BAR:
400
+ return "TIMESERIES_STYLE_BAR";
401
+ case TimeseriesStyle.TIMESERIES_STYLE_STACKED_BAR:
402
+ return "TIMESERIES_STYLE_STACKED_BAR";
403
+ case TimeseriesStyle.UNRECOGNIZED:
404
+ default:
405
+ return "UNRECOGNIZED";
406
+ }
407
+ }
408
+
295
409
  export interface StreamMetricsRequest {
296
410
  /** Verified against the caller's identity before proxying. */
297
411
  organizationId: string;
@@ -462,6 +576,182 @@ export interface QuerySeriesUpdate_GroupValuesEntry {
462
576
  value: string;
463
577
  }
464
578
 
579
+ /**
580
+ * Dashboard is the saved document. Server-enforced caps: ≤24 widgets per
581
+ * dashboard, ≤4 queries per widget.
582
+ */
583
+ export interface Dashboard {
584
+ id: string;
585
+ projectId: string;
586
+ name: string;
587
+ description: string;
588
+ /** The view's time range when no override is supplied on the stream request. */
589
+ defaultTimeWindow: AnalyticsTimeWindow;
590
+ widgets: Widget[];
591
+ /** Optimistic lock: incremented on every update; UpdateDashboard must echo it. */
592
+ version: number;
593
+ createdAt: Date | undefined;
594
+ updatedAt: Date | undefined;
595
+ }
596
+
597
+ export interface Widget {
598
+ /**
599
+ * Client-generated, [A-Za-z0-9_-]{1,64}, unique within the dashboard — the
600
+ * correlation key for DashboardDataEnvelope frames.
601
+ */
602
+ id: string;
603
+ name: string;
604
+ type: WidgetType;
605
+ gridPos:
606
+ | GridPos
607
+ | undefined;
608
+ /**
609
+ * Data queries. TIMESERIES 1-4 (one plotted series set per query), STAT and
610
+ * PIE exactly 1, TABLE 1-4 (one column per query), MARKDOWN none.
611
+ * STAT, PIE, and TABLE queries run with a single whole-range bucket.
612
+ */
613
+ queries: MetricQuery[];
614
+ /** UNSPECIFIED = follow the view (stream override or dashboard default). */
615
+ timeWindow: AnalyticsTimeWindow;
616
+ /** UNSPECIFIED = server-derived from the effective range. TIMESERIES only. */
617
+ timeInterval: AnalyticsTimeInterval;
618
+ /** TIMESERIES only; UNSPECIFIED renders as LINE. */
619
+ timeseriesStyle: TimeseriesStyle;
620
+ /** MARKDOWN widgets only: the rendered content (≤16 KiB). */
621
+ markdown: string;
622
+ }
623
+
624
+ /**
625
+ * GridPos places a widget on a 12-column grid; y grows downward and h/w are
626
+ * in grid units.
627
+ */
628
+ export interface GridPos {
629
+ x: number;
630
+ y: number;
631
+ w: number;
632
+ h: number;
633
+ }
634
+
635
+ export interface CreateDashboardRequest {
636
+ /** Verified against the caller's identity before proxying. */
637
+ organizationId: string;
638
+ projectId: string;
639
+ name: string;
640
+ description: string;
641
+ defaultTimeWindow: AnalyticsTimeWindow;
642
+ widgets: Widget[];
643
+ }
644
+
645
+ export interface CreateDashboardResponse {
646
+ status: ResponseStatus | undefined;
647
+ dashboard: Dashboard | undefined;
648
+ }
649
+
650
+ export interface GetDashboardRequest {
651
+ /** Verified against the caller's identity before proxying. */
652
+ organizationId: string;
653
+ projectId: string;
654
+ dashboardId: string;
655
+ }
656
+
657
+ export interface GetDashboardResponse {
658
+ status: ResponseStatus | undefined;
659
+ dashboard: Dashboard | undefined;
660
+ }
661
+
662
+ export interface ListDashboardsRequest {
663
+ /** Verified against the caller's identity before proxying. */
664
+ organizationId: string;
665
+ projectId: string;
666
+ }
667
+
668
+ export interface ListDashboardsResponse {
669
+ status: ResponseStatus | undefined;
670
+ dashboards: DashboardSummary[];
671
+ }
672
+
673
+ /** DashboardSummary lists a dashboard without its widget payload. */
674
+ export interface DashboardSummary {
675
+ id: string;
676
+ name: string;
677
+ description: string;
678
+ widgetCount: number;
679
+ createdAt: Date | undefined;
680
+ updatedAt: Date | undefined;
681
+ }
682
+
683
+ /**
684
+ * UpdateDashboardRequest replaces the dashboard document. A version mismatch
685
+ * fails with FAILED_PRECONDITION and the caller re-fetches, merges, retries.
686
+ */
687
+ export interface UpdateDashboardRequest {
688
+ /** Verified against the caller's identity before proxying. */
689
+ organizationId: string;
690
+ projectId: string;
691
+ dashboardId: string;
692
+ name: string;
693
+ description: string;
694
+ defaultTimeWindow: AnalyticsTimeWindow;
695
+ widgets: Widget[];
696
+ version: number;
697
+ }
698
+
699
+ export interface UpdateDashboardResponse {
700
+ status: ResponseStatus | undefined;
701
+ dashboard: Dashboard | undefined;
702
+ }
703
+
704
+ export interface DeleteDashboardRequest {
705
+ /** Verified against the caller's identity before proxying. */
706
+ organizationId: string;
707
+ projectId: string;
708
+ dashboardId: string;
709
+ }
710
+
711
+ export interface DeleteDashboardResponse {
712
+ status: ResponseStatus | undefined;
713
+ }
714
+
715
+ export interface StreamDashboardDataRequest {
716
+ /** Verified against the caller's identity before proxying. */
717
+ organizationId: string;
718
+ projectId: string;
719
+ dashboardId: string;
720
+ /**
721
+ * Empty = all data widgets; otherwise only the listed ones (viewport
722
+ * lazy-loading). Unknown ids are ignored.
723
+ */
724
+ widgetIds: string[];
725
+ /**
726
+ * View-time override; unset = the dashboard's default_time_window. Widgets
727
+ * with a pinned time_window keep it regardless.
728
+ */
729
+ timeRange: TimeRange | undefined;
730
+ }
731
+
732
+ /**
733
+ * DashboardDataEnvelope tags every frame with the widget and query it belongs
734
+ * to. MARKDOWN widgets never appear — their content rides on the Dashboard.
735
+ */
736
+ export interface DashboardDataEnvelope {
737
+ widgetId: string;
738
+ /** Index into Widget.queries. */
739
+ queryIndex: number;
740
+ snapshot?: QuerySnapshot | undefined;
741
+ update?:
742
+ | QuerySeriesUpdate
743
+ | undefined;
744
+ /**
745
+ * Non-fatal: the query is retried on the next tick, and a later snapshot
746
+ * for the same widget/query supersedes the error.
747
+ */
748
+ error?: WidgetQueryError | undefined;
749
+ }
750
+
751
+ export interface WidgetQueryError {
752
+ message: string;
753
+ }
754
+
465
755
  function createBaseStreamMetricsRequest(): StreamMetricsRequest {
466
756
  return { organizationId: "", projectId: "" };
467
757
  }
@@ -2582,59 +2872,2169 @@ export const QuerySeriesUpdate_GroupValuesEntry: MessageFns<QuerySeriesUpdate_Gr
2582
2872
  },
2583
2873
  };
2584
2874
 
2585
- /**
2586
- * MetricGatewayService is the web surface of telemetry.api.v1 MetricService — the types
2587
- * are domain-isolated copies converted in gateways/internal/convert. Every RPC
2588
- * is a server stream: snapshot first, then live updates.
2589
- *
2590
- * StreamQuery executes one MetricQuery — the same message a dashboard widget
2591
- * stores (dashboard_gateway.proto) — so the metrics explorer, the widget
2592
- * editor preview, and a saved dashboard all run through one query path.
2593
- */
2594
- export interface MetricGatewayService {
2595
- StreamMetrics(request: StreamMetricsRequest, metadata?: Metadata): Observable<MetricCatalogEnvelope>;
2596
- StreamMetricAttributes(
2597
- request: StreamMetricAttributesRequest,
2598
- metadata?: Metadata,
2599
- ): Observable<MetricAttributeEnvelope>;
2600
- /**
2601
- * Ad-hoc query execution: snapshot, then live bucket updates while the
2602
- * stream stays open (relative ranges only; absolute ranges complete after
2603
- * the snapshot). Query failures abort the stream with a gRPC status.
2604
- */
2605
- StreamQuery(request: StreamQueryRequest, metadata?: Metadata): Observable<QueryDataEnvelope>;
2875
+ function createBaseDashboard(): Dashboard {
2876
+ return {
2877
+ id: "",
2878
+ projectId: "",
2879
+ name: "",
2880
+ description: "",
2881
+ defaultTimeWindow: 0,
2882
+ widgets: [],
2883
+ version: 0,
2884
+ createdAt: undefined,
2885
+ updatedAt: undefined,
2886
+ };
2606
2887
  }
2607
2888
 
2608
- export const MetricGatewayServiceServiceName = "gateway.web.v1.MetricGatewayService";
2609
- export class MetricGatewayServiceClientImpl implements MetricGatewayService {
2610
- private readonly rpc: Rpc;
2611
- private readonly service: string;
2612
- constructor(rpc: Rpc, opts?: { service?: string }) {
2613
- this.service = opts?.service || MetricGatewayServiceServiceName;
2614
- this.rpc = rpc;
2615
- this.StreamMetrics = this.StreamMetrics.bind(this);
2616
- this.StreamMetricAttributes = this.StreamMetricAttributes.bind(this);
2617
- this.StreamQuery = this.StreamQuery.bind(this);
2618
- }
2619
- StreamMetrics(request: StreamMetricsRequest, metadata?: Metadata): Observable<MetricCatalogEnvelope> {
2620
- const data = StreamMetricsRequest.encode(request).finish();
2621
- const result = this.rpc.serverStreamingRequest(this.service, "StreamMetrics", data, metadata);
2622
- return result.pipe(map((data) => MetricCatalogEnvelope.decode(new BinaryReader(data))));
2623
- }
2889
+ export const Dashboard: MessageFns<Dashboard> = {
2890
+ encode(message: Dashboard, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2891
+ if (message.id !== "") {
2892
+ writer.uint32(10).string(message.id);
2893
+ }
2894
+ if (message.projectId !== "") {
2895
+ writer.uint32(18).string(message.projectId);
2896
+ }
2897
+ if (message.name !== "") {
2898
+ writer.uint32(26).string(message.name);
2899
+ }
2900
+ if (message.description !== "") {
2901
+ writer.uint32(34).string(message.description);
2902
+ }
2903
+ if (message.defaultTimeWindow !== 0) {
2904
+ writer.uint32(40).int32(message.defaultTimeWindow);
2905
+ }
2906
+ for (const v of message.widgets) {
2907
+ Widget.encode(v!, writer.uint32(50).fork()).join();
2908
+ }
2909
+ if (message.version !== 0) {
2910
+ writer.uint32(56).int64(message.version);
2911
+ }
2912
+ if (message.createdAt !== undefined) {
2913
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(66).fork()).join();
2914
+ }
2915
+ if (message.updatedAt !== undefined) {
2916
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(74).fork()).join();
2917
+ }
2918
+ return writer;
2919
+ },
2624
2920
 
2625
- StreamMetricAttributes(
2626
- request: StreamMetricAttributesRequest,
2627
- metadata?: Metadata,
2628
- ): Observable<MetricAttributeEnvelope> {
2629
- const data = StreamMetricAttributesRequest.encode(request).finish();
2630
- const result = this.rpc.serverStreamingRequest(this.service, "StreamMetricAttributes", data, metadata);
2631
- return result.pipe(map((data) => MetricAttributeEnvelope.decode(new BinaryReader(data))));
2632
- }
2921
+ decode(input: BinaryReader | Uint8Array, length?: number): Dashboard {
2922
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2923
+ const end = length === undefined ? reader.len : reader.pos + length;
2924
+ const message = createBaseDashboard();
2925
+ while (reader.pos < end) {
2926
+ const tag = reader.uint32();
2927
+ switch (tag >>> 3) {
2928
+ case 1: {
2929
+ if (tag !== 10) {
2930
+ break;
2931
+ }
2633
2932
 
2634
- StreamQuery(request: StreamQueryRequest, metadata?: Metadata): Observable<QueryDataEnvelope> {
2635
- const data = StreamQueryRequest.encode(request).finish();
2636
- const result = this.rpc.serverStreamingRequest(this.service, "StreamQuery", data, metadata);
2637
- return result.pipe(map((data) => QueryDataEnvelope.decode(new BinaryReader(data))));
2933
+ message.id = reader.string();
2934
+ continue;
2935
+ }
2936
+ case 2: {
2937
+ if (tag !== 18) {
2938
+ break;
2939
+ }
2940
+
2941
+ message.projectId = reader.string();
2942
+ continue;
2943
+ }
2944
+ case 3: {
2945
+ if (tag !== 26) {
2946
+ break;
2947
+ }
2948
+
2949
+ message.name = reader.string();
2950
+ continue;
2951
+ }
2952
+ case 4: {
2953
+ if (tag !== 34) {
2954
+ break;
2955
+ }
2956
+
2957
+ message.description = reader.string();
2958
+ continue;
2959
+ }
2960
+ case 5: {
2961
+ if (tag !== 40) {
2962
+ break;
2963
+ }
2964
+
2965
+ message.defaultTimeWindow = reader.int32() as any;
2966
+ continue;
2967
+ }
2968
+ case 6: {
2969
+ if (tag !== 50) {
2970
+ break;
2971
+ }
2972
+
2973
+ message.widgets.push(Widget.decode(reader, reader.uint32()));
2974
+ continue;
2975
+ }
2976
+ case 7: {
2977
+ if (tag !== 56) {
2978
+ break;
2979
+ }
2980
+
2981
+ message.version = longToNumber(reader.int64());
2982
+ continue;
2983
+ }
2984
+ case 8: {
2985
+ if (tag !== 66) {
2986
+ break;
2987
+ }
2988
+
2989
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2990
+ continue;
2991
+ }
2992
+ case 9: {
2993
+ if (tag !== 74) {
2994
+ break;
2995
+ }
2996
+
2997
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2998
+ continue;
2999
+ }
3000
+ }
3001
+ if ((tag & 7) === 4 || tag === 0) {
3002
+ break;
3003
+ }
3004
+ reader.skip(tag & 7);
3005
+ }
3006
+ return message;
3007
+ },
3008
+
3009
+ fromJSON(object: any): Dashboard {
3010
+ return {
3011
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
3012
+ projectId: isSet(object.projectId)
3013
+ ? globalThis.String(object.projectId)
3014
+ : isSet(object.project_id)
3015
+ ? globalThis.String(object.project_id)
3016
+ : "",
3017
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
3018
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
3019
+ defaultTimeWindow: isSet(object.defaultTimeWindow)
3020
+ ? analyticsTimeWindowFromJSON(object.defaultTimeWindow)
3021
+ : isSet(object.default_time_window)
3022
+ ? analyticsTimeWindowFromJSON(object.default_time_window)
3023
+ : 0,
3024
+ widgets: globalThis.Array.isArray(object?.widgets) ? object.widgets.map((e: any) => Widget.fromJSON(e)) : [],
3025
+ version: isSet(object.version) ? globalThis.Number(object.version) : 0,
3026
+ createdAt: isSet(object.createdAt)
3027
+ ? fromJsonTimestamp(object.createdAt)
3028
+ : isSet(object.created_at)
3029
+ ? fromJsonTimestamp(object.created_at)
3030
+ : undefined,
3031
+ updatedAt: isSet(object.updatedAt)
3032
+ ? fromJsonTimestamp(object.updatedAt)
3033
+ : isSet(object.updated_at)
3034
+ ? fromJsonTimestamp(object.updated_at)
3035
+ : undefined,
3036
+ };
3037
+ },
3038
+
3039
+ toJSON(message: Dashboard): unknown {
3040
+ const obj: any = {};
3041
+ if (message.id !== "") {
3042
+ obj.id = message.id;
3043
+ }
3044
+ if (message.projectId !== "") {
3045
+ obj.projectId = message.projectId;
3046
+ }
3047
+ if (message.name !== "") {
3048
+ obj.name = message.name;
3049
+ }
3050
+ if (message.description !== "") {
3051
+ obj.description = message.description;
3052
+ }
3053
+ if (message.defaultTimeWindow !== 0) {
3054
+ obj.defaultTimeWindow = analyticsTimeWindowToJSON(message.defaultTimeWindow);
3055
+ }
3056
+ if (message.widgets?.length) {
3057
+ obj.widgets = message.widgets.map((e) => Widget.toJSON(e));
3058
+ }
3059
+ if (message.version !== 0) {
3060
+ obj.version = Math.round(message.version);
3061
+ }
3062
+ if (message.createdAt !== undefined) {
3063
+ obj.createdAt = message.createdAt.toISOString();
3064
+ }
3065
+ if (message.updatedAt !== undefined) {
3066
+ obj.updatedAt = message.updatedAt.toISOString();
3067
+ }
3068
+ return obj;
3069
+ },
3070
+
3071
+ create<I extends Exact<DeepPartial<Dashboard>, I>>(base?: I): Dashboard {
3072
+ return Dashboard.fromPartial(base ?? ({} as any));
3073
+ },
3074
+ fromPartial<I extends Exact<DeepPartial<Dashboard>, I>>(object: I): Dashboard {
3075
+ const message = createBaseDashboard();
3076
+ message.id = object.id ?? "";
3077
+ message.projectId = object.projectId ?? "";
3078
+ message.name = object.name ?? "";
3079
+ message.description = object.description ?? "";
3080
+ message.defaultTimeWindow = object.defaultTimeWindow ?? 0;
3081
+ message.widgets = object.widgets?.map((e) => Widget.fromPartial(e)) || [];
3082
+ message.version = object.version ?? 0;
3083
+ message.createdAt = object.createdAt ?? undefined;
3084
+ message.updatedAt = object.updatedAt ?? undefined;
3085
+ return message;
3086
+ },
3087
+ };
3088
+
3089
+ function createBaseWidget(): Widget {
3090
+ return {
3091
+ id: "",
3092
+ name: "",
3093
+ type: 0,
3094
+ gridPos: undefined,
3095
+ queries: [],
3096
+ timeWindow: 0,
3097
+ timeInterval: 0,
3098
+ timeseriesStyle: 0,
3099
+ markdown: "",
3100
+ };
3101
+ }
3102
+
3103
+ export const Widget: MessageFns<Widget> = {
3104
+ encode(message: Widget, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3105
+ if (message.id !== "") {
3106
+ writer.uint32(10).string(message.id);
3107
+ }
3108
+ if (message.name !== "") {
3109
+ writer.uint32(18).string(message.name);
3110
+ }
3111
+ if (message.type !== 0) {
3112
+ writer.uint32(24).int32(message.type);
3113
+ }
3114
+ if (message.gridPos !== undefined) {
3115
+ GridPos.encode(message.gridPos, writer.uint32(34).fork()).join();
3116
+ }
3117
+ for (const v of message.queries) {
3118
+ MetricQuery.encode(v!, writer.uint32(42).fork()).join();
3119
+ }
3120
+ if (message.timeWindow !== 0) {
3121
+ writer.uint32(48).int32(message.timeWindow);
3122
+ }
3123
+ if (message.timeInterval !== 0) {
3124
+ writer.uint32(56).int32(message.timeInterval);
3125
+ }
3126
+ if (message.timeseriesStyle !== 0) {
3127
+ writer.uint32(64).int32(message.timeseriesStyle);
3128
+ }
3129
+ if (message.markdown !== "") {
3130
+ writer.uint32(74).string(message.markdown);
3131
+ }
3132
+ return writer;
3133
+ },
3134
+
3135
+ decode(input: BinaryReader | Uint8Array, length?: number): Widget {
3136
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3137
+ const end = length === undefined ? reader.len : reader.pos + length;
3138
+ const message = createBaseWidget();
3139
+ while (reader.pos < end) {
3140
+ const tag = reader.uint32();
3141
+ switch (tag >>> 3) {
3142
+ case 1: {
3143
+ if (tag !== 10) {
3144
+ break;
3145
+ }
3146
+
3147
+ message.id = reader.string();
3148
+ continue;
3149
+ }
3150
+ case 2: {
3151
+ if (tag !== 18) {
3152
+ break;
3153
+ }
3154
+
3155
+ message.name = reader.string();
3156
+ continue;
3157
+ }
3158
+ case 3: {
3159
+ if (tag !== 24) {
3160
+ break;
3161
+ }
3162
+
3163
+ message.type = reader.int32() as any;
3164
+ continue;
3165
+ }
3166
+ case 4: {
3167
+ if (tag !== 34) {
3168
+ break;
3169
+ }
3170
+
3171
+ message.gridPos = GridPos.decode(reader, reader.uint32());
3172
+ continue;
3173
+ }
3174
+ case 5: {
3175
+ if (tag !== 42) {
3176
+ break;
3177
+ }
3178
+
3179
+ message.queries.push(MetricQuery.decode(reader, reader.uint32()));
3180
+ continue;
3181
+ }
3182
+ case 6: {
3183
+ if (tag !== 48) {
3184
+ break;
3185
+ }
3186
+
3187
+ message.timeWindow = reader.int32() as any;
3188
+ continue;
3189
+ }
3190
+ case 7: {
3191
+ if (tag !== 56) {
3192
+ break;
3193
+ }
3194
+
3195
+ message.timeInterval = reader.int32() as any;
3196
+ continue;
3197
+ }
3198
+ case 8: {
3199
+ if (tag !== 64) {
3200
+ break;
3201
+ }
3202
+
3203
+ message.timeseriesStyle = reader.int32() as any;
3204
+ continue;
3205
+ }
3206
+ case 9: {
3207
+ if (tag !== 74) {
3208
+ break;
3209
+ }
3210
+
3211
+ message.markdown = reader.string();
3212
+ continue;
3213
+ }
3214
+ }
3215
+ if ((tag & 7) === 4 || tag === 0) {
3216
+ break;
3217
+ }
3218
+ reader.skip(tag & 7);
3219
+ }
3220
+ return message;
3221
+ },
3222
+
3223
+ fromJSON(object: any): Widget {
3224
+ return {
3225
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
3226
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
3227
+ type: isSet(object.type) ? widgetTypeFromJSON(object.type) : 0,
3228
+ gridPos: isSet(object.gridPos)
3229
+ ? GridPos.fromJSON(object.gridPos)
3230
+ : isSet(object.grid_pos)
3231
+ ? GridPos.fromJSON(object.grid_pos)
3232
+ : undefined,
3233
+ queries: globalThis.Array.isArray(object?.queries) ? object.queries.map((e: any) => MetricQuery.fromJSON(e)) : [],
3234
+ timeWindow: isSet(object.timeWindow)
3235
+ ? analyticsTimeWindowFromJSON(object.timeWindow)
3236
+ : isSet(object.time_window)
3237
+ ? analyticsTimeWindowFromJSON(object.time_window)
3238
+ : 0,
3239
+ timeInterval: isSet(object.timeInterval)
3240
+ ? analyticsTimeIntervalFromJSON(object.timeInterval)
3241
+ : isSet(object.time_interval)
3242
+ ? analyticsTimeIntervalFromJSON(object.time_interval)
3243
+ : 0,
3244
+ timeseriesStyle: isSet(object.timeseriesStyle)
3245
+ ? timeseriesStyleFromJSON(object.timeseriesStyle)
3246
+ : isSet(object.timeseries_style)
3247
+ ? timeseriesStyleFromJSON(object.timeseries_style)
3248
+ : 0,
3249
+ markdown: isSet(object.markdown) ? globalThis.String(object.markdown) : "",
3250
+ };
3251
+ },
3252
+
3253
+ toJSON(message: Widget): unknown {
3254
+ const obj: any = {};
3255
+ if (message.id !== "") {
3256
+ obj.id = message.id;
3257
+ }
3258
+ if (message.name !== "") {
3259
+ obj.name = message.name;
3260
+ }
3261
+ if (message.type !== 0) {
3262
+ obj.type = widgetTypeToJSON(message.type);
3263
+ }
3264
+ if (message.gridPos !== undefined) {
3265
+ obj.gridPos = GridPos.toJSON(message.gridPos);
3266
+ }
3267
+ if (message.queries?.length) {
3268
+ obj.queries = message.queries.map((e) => MetricQuery.toJSON(e));
3269
+ }
3270
+ if (message.timeWindow !== 0) {
3271
+ obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
3272
+ }
3273
+ if (message.timeInterval !== 0) {
3274
+ obj.timeInterval = analyticsTimeIntervalToJSON(message.timeInterval);
3275
+ }
3276
+ if (message.timeseriesStyle !== 0) {
3277
+ obj.timeseriesStyle = timeseriesStyleToJSON(message.timeseriesStyle);
3278
+ }
3279
+ if (message.markdown !== "") {
3280
+ obj.markdown = message.markdown;
3281
+ }
3282
+ return obj;
3283
+ },
3284
+
3285
+ create<I extends Exact<DeepPartial<Widget>, I>>(base?: I): Widget {
3286
+ return Widget.fromPartial(base ?? ({} as any));
3287
+ },
3288
+ fromPartial<I extends Exact<DeepPartial<Widget>, I>>(object: I): Widget {
3289
+ const message = createBaseWidget();
3290
+ message.id = object.id ?? "";
3291
+ message.name = object.name ?? "";
3292
+ message.type = object.type ?? 0;
3293
+ message.gridPos = (object.gridPos !== undefined && object.gridPos !== null)
3294
+ ? GridPos.fromPartial(object.gridPos)
3295
+ : undefined;
3296
+ message.queries = object.queries?.map((e) => MetricQuery.fromPartial(e)) || [];
3297
+ message.timeWindow = object.timeWindow ?? 0;
3298
+ message.timeInterval = object.timeInterval ?? 0;
3299
+ message.timeseriesStyle = object.timeseriesStyle ?? 0;
3300
+ message.markdown = object.markdown ?? "";
3301
+ return message;
3302
+ },
3303
+ };
3304
+
3305
+ function createBaseGridPos(): GridPos {
3306
+ return { x: 0, y: 0, w: 0, h: 0 };
3307
+ }
3308
+
3309
+ export const GridPos: MessageFns<GridPos> = {
3310
+ encode(message: GridPos, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3311
+ if (message.x !== 0) {
3312
+ writer.uint32(8).int32(message.x);
3313
+ }
3314
+ if (message.y !== 0) {
3315
+ writer.uint32(16).int32(message.y);
3316
+ }
3317
+ if (message.w !== 0) {
3318
+ writer.uint32(24).int32(message.w);
3319
+ }
3320
+ if (message.h !== 0) {
3321
+ writer.uint32(32).int32(message.h);
3322
+ }
3323
+ return writer;
3324
+ },
3325
+
3326
+ decode(input: BinaryReader | Uint8Array, length?: number): GridPos {
3327
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3328
+ const end = length === undefined ? reader.len : reader.pos + length;
3329
+ const message = createBaseGridPos();
3330
+ while (reader.pos < end) {
3331
+ const tag = reader.uint32();
3332
+ switch (tag >>> 3) {
3333
+ case 1: {
3334
+ if (tag !== 8) {
3335
+ break;
3336
+ }
3337
+
3338
+ message.x = reader.int32();
3339
+ continue;
3340
+ }
3341
+ case 2: {
3342
+ if (tag !== 16) {
3343
+ break;
3344
+ }
3345
+
3346
+ message.y = reader.int32();
3347
+ continue;
3348
+ }
3349
+ case 3: {
3350
+ if (tag !== 24) {
3351
+ break;
3352
+ }
3353
+
3354
+ message.w = reader.int32();
3355
+ continue;
3356
+ }
3357
+ case 4: {
3358
+ if (tag !== 32) {
3359
+ break;
3360
+ }
3361
+
3362
+ message.h = reader.int32();
3363
+ continue;
3364
+ }
3365
+ }
3366
+ if ((tag & 7) === 4 || tag === 0) {
3367
+ break;
3368
+ }
3369
+ reader.skip(tag & 7);
3370
+ }
3371
+ return message;
3372
+ },
3373
+
3374
+ fromJSON(object: any): GridPos {
3375
+ return {
3376
+ x: isSet(object.x) ? globalThis.Number(object.x) : 0,
3377
+ y: isSet(object.y) ? globalThis.Number(object.y) : 0,
3378
+ w: isSet(object.w) ? globalThis.Number(object.w) : 0,
3379
+ h: isSet(object.h) ? globalThis.Number(object.h) : 0,
3380
+ };
3381
+ },
3382
+
3383
+ toJSON(message: GridPos): unknown {
3384
+ const obj: any = {};
3385
+ if (message.x !== 0) {
3386
+ obj.x = Math.round(message.x);
3387
+ }
3388
+ if (message.y !== 0) {
3389
+ obj.y = Math.round(message.y);
3390
+ }
3391
+ if (message.w !== 0) {
3392
+ obj.w = Math.round(message.w);
3393
+ }
3394
+ if (message.h !== 0) {
3395
+ obj.h = Math.round(message.h);
3396
+ }
3397
+ return obj;
3398
+ },
3399
+
3400
+ create<I extends Exact<DeepPartial<GridPos>, I>>(base?: I): GridPos {
3401
+ return GridPos.fromPartial(base ?? ({} as any));
3402
+ },
3403
+ fromPartial<I extends Exact<DeepPartial<GridPos>, I>>(object: I): GridPos {
3404
+ const message = createBaseGridPos();
3405
+ message.x = object.x ?? 0;
3406
+ message.y = object.y ?? 0;
3407
+ message.w = object.w ?? 0;
3408
+ message.h = object.h ?? 0;
3409
+ return message;
3410
+ },
3411
+ };
3412
+
3413
+ function createBaseCreateDashboardRequest(): CreateDashboardRequest {
3414
+ return { organizationId: "", projectId: "", name: "", description: "", defaultTimeWindow: 0, widgets: [] };
3415
+ }
3416
+
3417
+ export const CreateDashboardRequest: MessageFns<CreateDashboardRequest> = {
3418
+ encode(message: CreateDashboardRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3419
+ if (message.organizationId !== "") {
3420
+ writer.uint32(10).string(message.organizationId);
3421
+ }
3422
+ if (message.projectId !== "") {
3423
+ writer.uint32(18).string(message.projectId);
3424
+ }
3425
+ if (message.name !== "") {
3426
+ writer.uint32(26).string(message.name);
3427
+ }
3428
+ if (message.description !== "") {
3429
+ writer.uint32(34).string(message.description);
3430
+ }
3431
+ if (message.defaultTimeWindow !== 0) {
3432
+ writer.uint32(40).int32(message.defaultTimeWindow);
3433
+ }
3434
+ for (const v of message.widgets) {
3435
+ Widget.encode(v!, writer.uint32(50).fork()).join();
3436
+ }
3437
+ return writer;
3438
+ },
3439
+
3440
+ decode(input: BinaryReader | Uint8Array, length?: number): CreateDashboardRequest {
3441
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3442
+ const end = length === undefined ? reader.len : reader.pos + length;
3443
+ const message = createBaseCreateDashboardRequest();
3444
+ while (reader.pos < end) {
3445
+ const tag = reader.uint32();
3446
+ switch (tag >>> 3) {
3447
+ case 1: {
3448
+ if (tag !== 10) {
3449
+ break;
3450
+ }
3451
+
3452
+ message.organizationId = reader.string();
3453
+ continue;
3454
+ }
3455
+ case 2: {
3456
+ if (tag !== 18) {
3457
+ break;
3458
+ }
3459
+
3460
+ message.projectId = reader.string();
3461
+ continue;
3462
+ }
3463
+ case 3: {
3464
+ if (tag !== 26) {
3465
+ break;
3466
+ }
3467
+
3468
+ message.name = reader.string();
3469
+ continue;
3470
+ }
3471
+ case 4: {
3472
+ if (tag !== 34) {
3473
+ break;
3474
+ }
3475
+
3476
+ message.description = reader.string();
3477
+ continue;
3478
+ }
3479
+ case 5: {
3480
+ if (tag !== 40) {
3481
+ break;
3482
+ }
3483
+
3484
+ message.defaultTimeWindow = reader.int32() as any;
3485
+ continue;
3486
+ }
3487
+ case 6: {
3488
+ if (tag !== 50) {
3489
+ break;
3490
+ }
3491
+
3492
+ message.widgets.push(Widget.decode(reader, reader.uint32()));
3493
+ continue;
3494
+ }
3495
+ }
3496
+ if ((tag & 7) === 4 || tag === 0) {
3497
+ break;
3498
+ }
3499
+ reader.skip(tag & 7);
3500
+ }
3501
+ return message;
3502
+ },
3503
+
3504
+ fromJSON(object: any): CreateDashboardRequest {
3505
+ return {
3506
+ organizationId: isSet(object.organizationId)
3507
+ ? globalThis.String(object.organizationId)
3508
+ : isSet(object.organization_id)
3509
+ ? globalThis.String(object.organization_id)
3510
+ : "",
3511
+ projectId: isSet(object.projectId)
3512
+ ? globalThis.String(object.projectId)
3513
+ : isSet(object.project_id)
3514
+ ? globalThis.String(object.project_id)
3515
+ : "",
3516
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
3517
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
3518
+ defaultTimeWindow: isSet(object.defaultTimeWindow)
3519
+ ? analyticsTimeWindowFromJSON(object.defaultTimeWindow)
3520
+ : isSet(object.default_time_window)
3521
+ ? analyticsTimeWindowFromJSON(object.default_time_window)
3522
+ : 0,
3523
+ widgets: globalThis.Array.isArray(object?.widgets) ? object.widgets.map((e: any) => Widget.fromJSON(e)) : [],
3524
+ };
3525
+ },
3526
+
3527
+ toJSON(message: CreateDashboardRequest): unknown {
3528
+ const obj: any = {};
3529
+ if (message.organizationId !== "") {
3530
+ obj.organizationId = message.organizationId;
3531
+ }
3532
+ if (message.projectId !== "") {
3533
+ obj.projectId = message.projectId;
3534
+ }
3535
+ if (message.name !== "") {
3536
+ obj.name = message.name;
3537
+ }
3538
+ if (message.description !== "") {
3539
+ obj.description = message.description;
3540
+ }
3541
+ if (message.defaultTimeWindow !== 0) {
3542
+ obj.defaultTimeWindow = analyticsTimeWindowToJSON(message.defaultTimeWindow);
3543
+ }
3544
+ if (message.widgets?.length) {
3545
+ obj.widgets = message.widgets.map((e) => Widget.toJSON(e));
3546
+ }
3547
+ return obj;
3548
+ },
3549
+
3550
+ create<I extends Exact<DeepPartial<CreateDashboardRequest>, I>>(base?: I): CreateDashboardRequest {
3551
+ return CreateDashboardRequest.fromPartial(base ?? ({} as any));
3552
+ },
3553
+ fromPartial<I extends Exact<DeepPartial<CreateDashboardRequest>, I>>(object: I): CreateDashboardRequest {
3554
+ const message = createBaseCreateDashboardRequest();
3555
+ message.organizationId = object.organizationId ?? "";
3556
+ message.projectId = object.projectId ?? "";
3557
+ message.name = object.name ?? "";
3558
+ message.description = object.description ?? "";
3559
+ message.defaultTimeWindow = object.defaultTimeWindow ?? 0;
3560
+ message.widgets = object.widgets?.map((e) => Widget.fromPartial(e)) || [];
3561
+ return message;
3562
+ },
3563
+ };
3564
+
3565
+ function createBaseCreateDashboardResponse(): CreateDashboardResponse {
3566
+ return { status: undefined, dashboard: undefined };
3567
+ }
3568
+
3569
+ export const CreateDashboardResponse: MessageFns<CreateDashboardResponse> = {
3570
+ encode(message: CreateDashboardResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3571
+ if (message.status !== undefined) {
3572
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
3573
+ }
3574
+ if (message.dashboard !== undefined) {
3575
+ Dashboard.encode(message.dashboard, writer.uint32(18).fork()).join();
3576
+ }
3577
+ return writer;
3578
+ },
3579
+
3580
+ decode(input: BinaryReader | Uint8Array, length?: number): CreateDashboardResponse {
3581
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3582
+ const end = length === undefined ? reader.len : reader.pos + length;
3583
+ const message = createBaseCreateDashboardResponse();
3584
+ while (reader.pos < end) {
3585
+ const tag = reader.uint32();
3586
+ switch (tag >>> 3) {
3587
+ case 1: {
3588
+ if (tag !== 10) {
3589
+ break;
3590
+ }
3591
+
3592
+ message.status = ResponseStatus.decode(reader, reader.uint32());
3593
+ continue;
3594
+ }
3595
+ case 2: {
3596
+ if (tag !== 18) {
3597
+ break;
3598
+ }
3599
+
3600
+ message.dashboard = Dashboard.decode(reader, reader.uint32());
3601
+ continue;
3602
+ }
3603
+ }
3604
+ if ((tag & 7) === 4 || tag === 0) {
3605
+ break;
3606
+ }
3607
+ reader.skip(tag & 7);
3608
+ }
3609
+ return message;
3610
+ },
3611
+
3612
+ fromJSON(object: any): CreateDashboardResponse {
3613
+ return {
3614
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
3615
+ dashboard: isSet(object.dashboard) ? Dashboard.fromJSON(object.dashboard) : undefined,
3616
+ };
3617
+ },
3618
+
3619
+ toJSON(message: CreateDashboardResponse): unknown {
3620
+ const obj: any = {};
3621
+ if (message.status !== undefined) {
3622
+ obj.status = ResponseStatus.toJSON(message.status);
3623
+ }
3624
+ if (message.dashboard !== undefined) {
3625
+ obj.dashboard = Dashboard.toJSON(message.dashboard);
3626
+ }
3627
+ return obj;
3628
+ },
3629
+
3630
+ create<I extends Exact<DeepPartial<CreateDashboardResponse>, I>>(base?: I): CreateDashboardResponse {
3631
+ return CreateDashboardResponse.fromPartial(base ?? ({} as any));
3632
+ },
3633
+ fromPartial<I extends Exact<DeepPartial<CreateDashboardResponse>, I>>(object: I): CreateDashboardResponse {
3634
+ const message = createBaseCreateDashboardResponse();
3635
+ message.status = (object.status !== undefined && object.status !== null)
3636
+ ? ResponseStatus.fromPartial(object.status)
3637
+ : undefined;
3638
+ message.dashboard = (object.dashboard !== undefined && object.dashboard !== null)
3639
+ ? Dashboard.fromPartial(object.dashboard)
3640
+ : undefined;
3641
+ return message;
3642
+ },
3643
+ };
3644
+
3645
+ function createBaseGetDashboardRequest(): GetDashboardRequest {
3646
+ return { organizationId: "", projectId: "", dashboardId: "" };
3647
+ }
3648
+
3649
+ export const GetDashboardRequest: MessageFns<GetDashboardRequest> = {
3650
+ encode(message: GetDashboardRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3651
+ if (message.organizationId !== "") {
3652
+ writer.uint32(10).string(message.organizationId);
3653
+ }
3654
+ if (message.projectId !== "") {
3655
+ writer.uint32(18).string(message.projectId);
3656
+ }
3657
+ if (message.dashboardId !== "") {
3658
+ writer.uint32(26).string(message.dashboardId);
3659
+ }
3660
+ return writer;
3661
+ },
3662
+
3663
+ decode(input: BinaryReader | Uint8Array, length?: number): GetDashboardRequest {
3664
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3665
+ const end = length === undefined ? reader.len : reader.pos + length;
3666
+ const message = createBaseGetDashboardRequest();
3667
+ while (reader.pos < end) {
3668
+ const tag = reader.uint32();
3669
+ switch (tag >>> 3) {
3670
+ case 1: {
3671
+ if (tag !== 10) {
3672
+ break;
3673
+ }
3674
+
3675
+ message.organizationId = reader.string();
3676
+ continue;
3677
+ }
3678
+ case 2: {
3679
+ if (tag !== 18) {
3680
+ break;
3681
+ }
3682
+
3683
+ message.projectId = reader.string();
3684
+ continue;
3685
+ }
3686
+ case 3: {
3687
+ if (tag !== 26) {
3688
+ break;
3689
+ }
3690
+
3691
+ message.dashboardId = reader.string();
3692
+ continue;
3693
+ }
3694
+ }
3695
+ if ((tag & 7) === 4 || tag === 0) {
3696
+ break;
3697
+ }
3698
+ reader.skip(tag & 7);
3699
+ }
3700
+ return message;
3701
+ },
3702
+
3703
+ fromJSON(object: any): GetDashboardRequest {
3704
+ return {
3705
+ organizationId: isSet(object.organizationId)
3706
+ ? globalThis.String(object.organizationId)
3707
+ : isSet(object.organization_id)
3708
+ ? globalThis.String(object.organization_id)
3709
+ : "",
3710
+ projectId: isSet(object.projectId)
3711
+ ? globalThis.String(object.projectId)
3712
+ : isSet(object.project_id)
3713
+ ? globalThis.String(object.project_id)
3714
+ : "",
3715
+ dashboardId: isSet(object.dashboardId)
3716
+ ? globalThis.String(object.dashboardId)
3717
+ : isSet(object.dashboard_id)
3718
+ ? globalThis.String(object.dashboard_id)
3719
+ : "",
3720
+ };
3721
+ },
3722
+
3723
+ toJSON(message: GetDashboardRequest): unknown {
3724
+ const obj: any = {};
3725
+ if (message.organizationId !== "") {
3726
+ obj.organizationId = message.organizationId;
3727
+ }
3728
+ if (message.projectId !== "") {
3729
+ obj.projectId = message.projectId;
3730
+ }
3731
+ if (message.dashboardId !== "") {
3732
+ obj.dashboardId = message.dashboardId;
3733
+ }
3734
+ return obj;
3735
+ },
3736
+
3737
+ create<I extends Exact<DeepPartial<GetDashboardRequest>, I>>(base?: I): GetDashboardRequest {
3738
+ return GetDashboardRequest.fromPartial(base ?? ({} as any));
3739
+ },
3740
+ fromPartial<I extends Exact<DeepPartial<GetDashboardRequest>, I>>(object: I): GetDashboardRequest {
3741
+ const message = createBaseGetDashboardRequest();
3742
+ message.organizationId = object.organizationId ?? "";
3743
+ message.projectId = object.projectId ?? "";
3744
+ message.dashboardId = object.dashboardId ?? "";
3745
+ return message;
3746
+ },
3747
+ };
3748
+
3749
+ function createBaseGetDashboardResponse(): GetDashboardResponse {
3750
+ return { status: undefined, dashboard: undefined };
3751
+ }
3752
+
3753
+ export const GetDashboardResponse: MessageFns<GetDashboardResponse> = {
3754
+ encode(message: GetDashboardResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3755
+ if (message.status !== undefined) {
3756
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
3757
+ }
3758
+ if (message.dashboard !== undefined) {
3759
+ Dashboard.encode(message.dashboard, writer.uint32(18).fork()).join();
3760
+ }
3761
+ return writer;
3762
+ },
3763
+
3764
+ decode(input: BinaryReader | Uint8Array, length?: number): GetDashboardResponse {
3765
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3766
+ const end = length === undefined ? reader.len : reader.pos + length;
3767
+ const message = createBaseGetDashboardResponse();
3768
+ while (reader.pos < end) {
3769
+ const tag = reader.uint32();
3770
+ switch (tag >>> 3) {
3771
+ case 1: {
3772
+ if (tag !== 10) {
3773
+ break;
3774
+ }
3775
+
3776
+ message.status = ResponseStatus.decode(reader, reader.uint32());
3777
+ continue;
3778
+ }
3779
+ case 2: {
3780
+ if (tag !== 18) {
3781
+ break;
3782
+ }
3783
+
3784
+ message.dashboard = Dashboard.decode(reader, reader.uint32());
3785
+ continue;
3786
+ }
3787
+ }
3788
+ if ((tag & 7) === 4 || tag === 0) {
3789
+ break;
3790
+ }
3791
+ reader.skip(tag & 7);
3792
+ }
3793
+ return message;
3794
+ },
3795
+
3796
+ fromJSON(object: any): GetDashboardResponse {
3797
+ return {
3798
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
3799
+ dashboard: isSet(object.dashboard) ? Dashboard.fromJSON(object.dashboard) : undefined,
3800
+ };
3801
+ },
3802
+
3803
+ toJSON(message: GetDashboardResponse): unknown {
3804
+ const obj: any = {};
3805
+ if (message.status !== undefined) {
3806
+ obj.status = ResponseStatus.toJSON(message.status);
3807
+ }
3808
+ if (message.dashboard !== undefined) {
3809
+ obj.dashboard = Dashboard.toJSON(message.dashboard);
3810
+ }
3811
+ return obj;
3812
+ },
3813
+
3814
+ create<I extends Exact<DeepPartial<GetDashboardResponse>, I>>(base?: I): GetDashboardResponse {
3815
+ return GetDashboardResponse.fromPartial(base ?? ({} as any));
3816
+ },
3817
+ fromPartial<I extends Exact<DeepPartial<GetDashboardResponse>, I>>(object: I): GetDashboardResponse {
3818
+ const message = createBaseGetDashboardResponse();
3819
+ message.status = (object.status !== undefined && object.status !== null)
3820
+ ? ResponseStatus.fromPartial(object.status)
3821
+ : undefined;
3822
+ message.dashboard = (object.dashboard !== undefined && object.dashboard !== null)
3823
+ ? Dashboard.fromPartial(object.dashboard)
3824
+ : undefined;
3825
+ return message;
3826
+ },
3827
+ };
3828
+
3829
+ function createBaseListDashboardsRequest(): ListDashboardsRequest {
3830
+ return { organizationId: "", projectId: "" };
3831
+ }
3832
+
3833
+ export const ListDashboardsRequest: MessageFns<ListDashboardsRequest> = {
3834
+ encode(message: ListDashboardsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3835
+ if (message.organizationId !== "") {
3836
+ writer.uint32(10).string(message.organizationId);
3837
+ }
3838
+ if (message.projectId !== "") {
3839
+ writer.uint32(18).string(message.projectId);
3840
+ }
3841
+ return writer;
3842
+ },
3843
+
3844
+ decode(input: BinaryReader | Uint8Array, length?: number): ListDashboardsRequest {
3845
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3846
+ const end = length === undefined ? reader.len : reader.pos + length;
3847
+ const message = createBaseListDashboardsRequest();
3848
+ while (reader.pos < end) {
3849
+ const tag = reader.uint32();
3850
+ switch (tag >>> 3) {
3851
+ case 1: {
3852
+ if (tag !== 10) {
3853
+ break;
3854
+ }
3855
+
3856
+ message.organizationId = reader.string();
3857
+ continue;
3858
+ }
3859
+ case 2: {
3860
+ if (tag !== 18) {
3861
+ break;
3862
+ }
3863
+
3864
+ message.projectId = reader.string();
3865
+ continue;
3866
+ }
3867
+ }
3868
+ if ((tag & 7) === 4 || tag === 0) {
3869
+ break;
3870
+ }
3871
+ reader.skip(tag & 7);
3872
+ }
3873
+ return message;
3874
+ },
3875
+
3876
+ fromJSON(object: any): ListDashboardsRequest {
3877
+ return {
3878
+ organizationId: isSet(object.organizationId)
3879
+ ? globalThis.String(object.organizationId)
3880
+ : isSet(object.organization_id)
3881
+ ? globalThis.String(object.organization_id)
3882
+ : "",
3883
+ projectId: isSet(object.projectId)
3884
+ ? globalThis.String(object.projectId)
3885
+ : isSet(object.project_id)
3886
+ ? globalThis.String(object.project_id)
3887
+ : "",
3888
+ };
3889
+ },
3890
+
3891
+ toJSON(message: ListDashboardsRequest): unknown {
3892
+ const obj: any = {};
3893
+ if (message.organizationId !== "") {
3894
+ obj.organizationId = message.organizationId;
3895
+ }
3896
+ if (message.projectId !== "") {
3897
+ obj.projectId = message.projectId;
3898
+ }
3899
+ return obj;
3900
+ },
3901
+
3902
+ create<I extends Exact<DeepPartial<ListDashboardsRequest>, I>>(base?: I): ListDashboardsRequest {
3903
+ return ListDashboardsRequest.fromPartial(base ?? ({} as any));
3904
+ },
3905
+ fromPartial<I extends Exact<DeepPartial<ListDashboardsRequest>, I>>(object: I): ListDashboardsRequest {
3906
+ const message = createBaseListDashboardsRequest();
3907
+ message.organizationId = object.organizationId ?? "";
3908
+ message.projectId = object.projectId ?? "";
3909
+ return message;
3910
+ },
3911
+ };
3912
+
3913
+ function createBaseListDashboardsResponse(): ListDashboardsResponse {
3914
+ return { status: undefined, dashboards: [] };
3915
+ }
3916
+
3917
+ export const ListDashboardsResponse: MessageFns<ListDashboardsResponse> = {
3918
+ encode(message: ListDashboardsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3919
+ if (message.status !== undefined) {
3920
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
3921
+ }
3922
+ for (const v of message.dashboards) {
3923
+ DashboardSummary.encode(v!, writer.uint32(18).fork()).join();
3924
+ }
3925
+ return writer;
3926
+ },
3927
+
3928
+ decode(input: BinaryReader | Uint8Array, length?: number): ListDashboardsResponse {
3929
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3930
+ const end = length === undefined ? reader.len : reader.pos + length;
3931
+ const message = createBaseListDashboardsResponse();
3932
+ while (reader.pos < end) {
3933
+ const tag = reader.uint32();
3934
+ switch (tag >>> 3) {
3935
+ case 1: {
3936
+ if (tag !== 10) {
3937
+ break;
3938
+ }
3939
+
3940
+ message.status = ResponseStatus.decode(reader, reader.uint32());
3941
+ continue;
3942
+ }
3943
+ case 2: {
3944
+ if (tag !== 18) {
3945
+ break;
3946
+ }
3947
+
3948
+ message.dashboards.push(DashboardSummary.decode(reader, reader.uint32()));
3949
+ continue;
3950
+ }
3951
+ }
3952
+ if ((tag & 7) === 4 || tag === 0) {
3953
+ break;
3954
+ }
3955
+ reader.skip(tag & 7);
3956
+ }
3957
+ return message;
3958
+ },
3959
+
3960
+ fromJSON(object: any): ListDashboardsResponse {
3961
+ return {
3962
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
3963
+ dashboards: globalThis.Array.isArray(object?.dashboards)
3964
+ ? object.dashboards.map((e: any) => DashboardSummary.fromJSON(e))
3965
+ : [],
3966
+ };
3967
+ },
3968
+
3969
+ toJSON(message: ListDashboardsResponse): unknown {
3970
+ const obj: any = {};
3971
+ if (message.status !== undefined) {
3972
+ obj.status = ResponseStatus.toJSON(message.status);
3973
+ }
3974
+ if (message.dashboards?.length) {
3975
+ obj.dashboards = message.dashboards.map((e) => DashboardSummary.toJSON(e));
3976
+ }
3977
+ return obj;
3978
+ },
3979
+
3980
+ create<I extends Exact<DeepPartial<ListDashboardsResponse>, I>>(base?: I): ListDashboardsResponse {
3981
+ return ListDashboardsResponse.fromPartial(base ?? ({} as any));
3982
+ },
3983
+ fromPartial<I extends Exact<DeepPartial<ListDashboardsResponse>, I>>(object: I): ListDashboardsResponse {
3984
+ const message = createBaseListDashboardsResponse();
3985
+ message.status = (object.status !== undefined && object.status !== null)
3986
+ ? ResponseStatus.fromPartial(object.status)
3987
+ : undefined;
3988
+ message.dashboards = object.dashboards?.map((e) => DashboardSummary.fromPartial(e)) || [];
3989
+ return message;
3990
+ },
3991
+ };
3992
+
3993
+ function createBaseDashboardSummary(): DashboardSummary {
3994
+ return { id: "", name: "", description: "", widgetCount: 0, createdAt: undefined, updatedAt: undefined };
3995
+ }
3996
+
3997
+ export const DashboardSummary: MessageFns<DashboardSummary> = {
3998
+ encode(message: DashboardSummary, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3999
+ if (message.id !== "") {
4000
+ writer.uint32(10).string(message.id);
4001
+ }
4002
+ if (message.name !== "") {
4003
+ writer.uint32(18).string(message.name);
4004
+ }
4005
+ if (message.description !== "") {
4006
+ writer.uint32(26).string(message.description);
4007
+ }
4008
+ if (message.widgetCount !== 0) {
4009
+ writer.uint32(32).int32(message.widgetCount);
4010
+ }
4011
+ if (message.createdAt !== undefined) {
4012
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(42).fork()).join();
4013
+ }
4014
+ if (message.updatedAt !== undefined) {
4015
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(50).fork()).join();
4016
+ }
4017
+ return writer;
4018
+ },
4019
+
4020
+ decode(input: BinaryReader | Uint8Array, length?: number): DashboardSummary {
4021
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4022
+ const end = length === undefined ? reader.len : reader.pos + length;
4023
+ const message = createBaseDashboardSummary();
4024
+ while (reader.pos < end) {
4025
+ const tag = reader.uint32();
4026
+ switch (tag >>> 3) {
4027
+ case 1: {
4028
+ if (tag !== 10) {
4029
+ break;
4030
+ }
4031
+
4032
+ message.id = reader.string();
4033
+ continue;
4034
+ }
4035
+ case 2: {
4036
+ if (tag !== 18) {
4037
+ break;
4038
+ }
4039
+
4040
+ message.name = reader.string();
4041
+ continue;
4042
+ }
4043
+ case 3: {
4044
+ if (tag !== 26) {
4045
+ break;
4046
+ }
4047
+
4048
+ message.description = reader.string();
4049
+ continue;
4050
+ }
4051
+ case 4: {
4052
+ if (tag !== 32) {
4053
+ break;
4054
+ }
4055
+
4056
+ message.widgetCount = reader.int32();
4057
+ continue;
4058
+ }
4059
+ case 5: {
4060
+ if (tag !== 42) {
4061
+ break;
4062
+ }
4063
+
4064
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
4065
+ continue;
4066
+ }
4067
+ case 6: {
4068
+ if (tag !== 50) {
4069
+ break;
4070
+ }
4071
+
4072
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
4073
+ continue;
4074
+ }
4075
+ }
4076
+ if ((tag & 7) === 4 || tag === 0) {
4077
+ break;
4078
+ }
4079
+ reader.skip(tag & 7);
4080
+ }
4081
+ return message;
4082
+ },
4083
+
4084
+ fromJSON(object: any): DashboardSummary {
4085
+ return {
4086
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
4087
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
4088
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
4089
+ widgetCount: isSet(object.widgetCount)
4090
+ ? globalThis.Number(object.widgetCount)
4091
+ : isSet(object.widget_count)
4092
+ ? globalThis.Number(object.widget_count)
4093
+ : 0,
4094
+ createdAt: isSet(object.createdAt)
4095
+ ? fromJsonTimestamp(object.createdAt)
4096
+ : isSet(object.created_at)
4097
+ ? fromJsonTimestamp(object.created_at)
4098
+ : undefined,
4099
+ updatedAt: isSet(object.updatedAt)
4100
+ ? fromJsonTimestamp(object.updatedAt)
4101
+ : isSet(object.updated_at)
4102
+ ? fromJsonTimestamp(object.updated_at)
4103
+ : undefined,
4104
+ };
4105
+ },
4106
+
4107
+ toJSON(message: DashboardSummary): unknown {
4108
+ const obj: any = {};
4109
+ if (message.id !== "") {
4110
+ obj.id = message.id;
4111
+ }
4112
+ if (message.name !== "") {
4113
+ obj.name = message.name;
4114
+ }
4115
+ if (message.description !== "") {
4116
+ obj.description = message.description;
4117
+ }
4118
+ if (message.widgetCount !== 0) {
4119
+ obj.widgetCount = Math.round(message.widgetCount);
4120
+ }
4121
+ if (message.createdAt !== undefined) {
4122
+ obj.createdAt = message.createdAt.toISOString();
4123
+ }
4124
+ if (message.updatedAt !== undefined) {
4125
+ obj.updatedAt = message.updatedAt.toISOString();
4126
+ }
4127
+ return obj;
4128
+ },
4129
+
4130
+ create<I extends Exact<DeepPartial<DashboardSummary>, I>>(base?: I): DashboardSummary {
4131
+ return DashboardSummary.fromPartial(base ?? ({} as any));
4132
+ },
4133
+ fromPartial<I extends Exact<DeepPartial<DashboardSummary>, I>>(object: I): DashboardSummary {
4134
+ const message = createBaseDashboardSummary();
4135
+ message.id = object.id ?? "";
4136
+ message.name = object.name ?? "";
4137
+ message.description = object.description ?? "";
4138
+ message.widgetCount = object.widgetCount ?? 0;
4139
+ message.createdAt = object.createdAt ?? undefined;
4140
+ message.updatedAt = object.updatedAt ?? undefined;
4141
+ return message;
4142
+ },
4143
+ };
4144
+
4145
+ function createBaseUpdateDashboardRequest(): UpdateDashboardRequest {
4146
+ return {
4147
+ organizationId: "",
4148
+ projectId: "",
4149
+ dashboardId: "",
4150
+ name: "",
4151
+ description: "",
4152
+ defaultTimeWindow: 0,
4153
+ widgets: [],
4154
+ version: 0,
4155
+ };
4156
+ }
4157
+
4158
+ export const UpdateDashboardRequest: MessageFns<UpdateDashboardRequest> = {
4159
+ encode(message: UpdateDashboardRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4160
+ if (message.organizationId !== "") {
4161
+ writer.uint32(10).string(message.organizationId);
4162
+ }
4163
+ if (message.projectId !== "") {
4164
+ writer.uint32(18).string(message.projectId);
4165
+ }
4166
+ if (message.dashboardId !== "") {
4167
+ writer.uint32(26).string(message.dashboardId);
4168
+ }
4169
+ if (message.name !== "") {
4170
+ writer.uint32(34).string(message.name);
4171
+ }
4172
+ if (message.description !== "") {
4173
+ writer.uint32(42).string(message.description);
4174
+ }
4175
+ if (message.defaultTimeWindow !== 0) {
4176
+ writer.uint32(48).int32(message.defaultTimeWindow);
4177
+ }
4178
+ for (const v of message.widgets) {
4179
+ Widget.encode(v!, writer.uint32(58).fork()).join();
4180
+ }
4181
+ if (message.version !== 0) {
4182
+ writer.uint32(64).int64(message.version);
4183
+ }
4184
+ return writer;
4185
+ },
4186
+
4187
+ decode(input: BinaryReader | Uint8Array, length?: number): UpdateDashboardRequest {
4188
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4189
+ const end = length === undefined ? reader.len : reader.pos + length;
4190
+ const message = createBaseUpdateDashboardRequest();
4191
+ while (reader.pos < end) {
4192
+ const tag = reader.uint32();
4193
+ switch (tag >>> 3) {
4194
+ case 1: {
4195
+ if (tag !== 10) {
4196
+ break;
4197
+ }
4198
+
4199
+ message.organizationId = reader.string();
4200
+ continue;
4201
+ }
4202
+ case 2: {
4203
+ if (tag !== 18) {
4204
+ break;
4205
+ }
4206
+
4207
+ message.projectId = reader.string();
4208
+ continue;
4209
+ }
4210
+ case 3: {
4211
+ if (tag !== 26) {
4212
+ break;
4213
+ }
4214
+
4215
+ message.dashboardId = reader.string();
4216
+ continue;
4217
+ }
4218
+ case 4: {
4219
+ if (tag !== 34) {
4220
+ break;
4221
+ }
4222
+
4223
+ message.name = reader.string();
4224
+ continue;
4225
+ }
4226
+ case 5: {
4227
+ if (tag !== 42) {
4228
+ break;
4229
+ }
4230
+
4231
+ message.description = reader.string();
4232
+ continue;
4233
+ }
4234
+ case 6: {
4235
+ if (tag !== 48) {
4236
+ break;
4237
+ }
4238
+
4239
+ message.defaultTimeWindow = reader.int32() as any;
4240
+ continue;
4241
+ }
4242
+ case 7: {
4243
+ if (tag !== 58) {
4244
+ break;
4245
+ }
4246
+
4247
+ message.widgets.push(Widget.decode(reader, reader.uint32()));
4248
+ continue;
4249
+ }
4250
+ case 8: {
4251
+ if (tag !== 64) {
4252
+ break;
4253
+ }
4254
+
4255
+ message.version = longToNumber(reader.int64());
4256
+ continue;
4257
+ }
4258
+ }
4259
+ if ((tag & 7) === 4 || tag === 0) {
4260
+ break;
4261
+ }
4262
+ reader.skip(tag & 7);
4263
+ }
4264
+ return message;
4265
+ },
4266
+
4267
+ fromJSON(object: any): UpdateDashboardRequest {
4268
+ return {
4269
+ organizationId: isSet(object.organizationId)
4270
+ ? globalThis.String(object.organizationId)
4271
+ : isSet(object.organization_id)
4272
+ ? globalThis.String(object.organization_id)
4273
+ : "",
4274
+ projectId: isSet(object.projectId)
4275
+ ? globalThis.String(object.projectId)
4276
+ : isSet(object.project_id)
4277
+ ? globalThis.String(object.project_id)
4278
+ : "",
4279
+ dashboardId: isSet(object.dashboardId)
4280
+ ? globalThis.String(object.dashboardId)
4281
+ : isSet(object.dashboard_id)
4282
+ ? globalThis.String(object.dashboard_id)
4283
+ : "",
4284
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
4285
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
4286
+ defaultTimeWindow: isSet(object.defaultTimeWindow)
4287
+ ? analyticsTimeWindowFromJSON(object.defaultTimeWindow)
4288
+ : isSet(object.default_time_window)
4289
+ ? analyticsTimeWindowFromJSON(object.default_time_window)
4290
+ : 0,
4291
+ widgets: globalThis.Array.isArray(object?.widgets)
4292
+ ? object.widgets.map((e: any) => Widget.fromJSON(e))
4293
+ : [],
4294
+ version: isSet(object.version) ? globalThis.Number(object.version) : 0,
4295
+ };
4296
+ },
4297
+
4298
+ toJSON(message: UpdateDashboardRequest): unknown {
4299
+ const obj: any = {};
4300
+ if (message.organizationId !== "") {
4301
+ obj.organizationId = message.organizationId;
4302
+ }
4303
+ if (message.projectId !== "") {
4304
+ obj.projectId = message.projectId;
4305
+ }
4306
+ if (message.dashboardId !== "") {
4307
+ obj.dashboardId = message.dashboardId;
4308
+ }
4309
+ if (message.name !== "") {
4310
+ obj.name = message.name;
4311
+ }
4312
+ if (message.description !== "") {
4313
+ obj.description = message.description;
4314
+ }
4315
+ if (message.defaultTimeWindow !== 0) {
4316
+ obj.defaultTimeWindow = analyticsTimeWindowToJSON(message.defaultTimeWindow);
4317
+ }
4318
+ if (message.widgets?.length) {
4319
+ obj.widgets = message.widgets.map((e) => Widget.toJSON(e));
4320
+ }
4321
+ if (message.version !== 0) {
4322
+ obj.version = Math.round(message.version);
4323
+ }
4324
+ return obj;
4325
+ },
4326
+
4327
+ create<I extends Exact<DeepPartial<UpdateDashboardRequest>, I>>(base?: I): UpdateDashboardRequest {
4328
+ return UpdateDashboardRequest.fromPartial(base ?? ({} as any));
4329
+ },
4330
+ fromPartial<I extends Exact<DeepPartial<UpdateDashboardRequest>, I>>(object: I): UpdateDashboardRequest {
4331
+ const message = createBaseUpdateDashboardRequest();
4332
+ message.organizationId = object.organizationId ?? "";
4333
+ message.projectId = object.projectId ?? "";
4334
+ message.dashboardId = object.dashboardId ?? "";
4335
+ message.name = object.name ?? "";
4336
+ message.description = object.description ?? "";
4337
+ message.defaultTimeWindow = object.defaultTimeWindow ?? 0;
4338
+ message.widgets = object.widgets?.map((e) => Widget.fromPartial(e)) || [];
4339
+ message.version = object.version ?? 0;
4340
+ return message;
4341
+ },
4342
+ };
4343
+
4344
+ function createBaseUpdateDashboardResponse(): UpdateDashboardResponse {
4345
+ return { status: undefined, dashboard: undefined };
4346
+ }
4347
+
4348
+ export const UpdateDashboardResponse: MessageFns<UpdateDashboardResponse> = {
4349
+ encode(message: UpdateDashboardResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4350
+ if (message.status !== undefined) {
4351
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
4352
+ }
4353
+ if (message.dashboard !== undefined) {
4354
+ Dashboard.encode(message.dashboard, writer.uint32(18).fork()).join();
4355
+ }
4356
+ return writer;
4357
+ },
4358
+
4359
+ decode(input: BinaryReader | Uint8Array, length?: number): UpdateDashboardResponse {
4360
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4361
+ const end = length === undefined ? reader.len : reader.pos + length;
4362
+ const message = createBaseUpdateDashboardResponse();
4363
+ while (reader.pos < end) {
4364
+ const tag = reader.uint32();
4365
+ switch (tag >>> 3) {
4366
+ case 1: {
4367
+ if (tag !== 10) {
4368
+ break;
4369
+ }
4370
+
4371
+ message.status = ResponseStatus.decode(reader, reader.uint32());
4372
+ continue;
4373
+ }
4374
+ case 2: {
4375
+ if (tag !== 18) {
4376
+ break;
4377
+ }
4378
+
4379
+ message.dashboard = Dashboard.decode(reader, reader.uint32());
4380
+ continue;
4381
+ }
4382
+ }
4383
+ if ((tag & 7) === 4 || tag === 0) {
4384
+ break;
4385
+ }
4386
+ reader.skip(tag & 7);
4387
+ }
4388
+ return message;
4389
+ },
4390
+
4391
+ fromJSON(object: any): UpdateDashboardResponse {
4392
+ return {
4393
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
4394
+ dashboard: isSet(object.dashboard) ? Dashboard.fromJSON(object.dashboard) : undefined,
4395
+ };
4396
+ },
4397
+
4398
+ toJSON(message: UpdateDashboardResponse): unknown {
4399
+ const obj: any = {};
4400
+ if (message.status !== undefined) {
4401
+ obj.status = ResponseStatus.toJSON(message.status);
4402
+ }
4403
+ if (message.dashboard !== undefined) {
4404
+ obj.dashboard = Dashboard.toJSON(message.dashboard);
4405
+ }
4406
+ return obj;
4407
+ },
4408
+
4409
+ create<I extends Exact<DeepPartial<UpdateDashboardResponse>, I>>(base?: I): UpdateDashboardResponse {
4410
+ return UpdateDashboardResponse.fromPartial(base ?? ({} as any));
4411
+ },
4412
+ fromPartial<I extends Exact<DeepPartial<UpdateDashboardResponse>, I>>(object: I): UpdateDashboardResponse {
4413
+ const message = createBaseUpdateDashboardResponse();
4414
+ message.status = (object.status !== undefined && object.status !== null)
4415
+ ? ResponseStatus.fromPartial(object.status)
4416
+ : undefined;
4417
+ message.dashboard = (object.dashboard !== undefined && object.dashboard !== null)
4418
+ ? Dashboard.fromPartial(object.dashboard)
4419
+ : undefined;
4420
+ return message;
4421
+ },
4422
+ };
4423
+
4424
+ function createBaseDeleteDashboardRequest(): DeleteDashboardRequest {
4425
+ return { organizationId: "", projectId: "", dashboardId: "" };
4426
+ }
4427
+
4428
+ export const DeleteDashboardRequest: MessageFns<DeleteDashboardRequest> = {
4429
+ encode(message: DeleteDashboardRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4430
+ if (message.organizationId !== "") {
4431
+ writer.uint32(10).string(message.organizationId);
4432
+ }
4433
+ if (message.projectId !== "") {
4434
+ writer.uint32(18).string(message.projectId);
4435
+ }
4436
+ if (message.dashboardId !== "") {
4437
+ writer.uint32(26).string(message.dashboardId);
4438
+ }
4439
+ return writer;
4440
+ },
4441
+
4442
+ decode(input: BinaryReader | Uint8Array, length?: number): DeleteDashboardRequest {
4443
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4444
+ const end = length === undefined ? reader.len : reader.pos + length;
4445
+ const message = createBaseDeleteDashboardRequest();
4446
+ while (reader.pos < end) {
4447
+ const tag = reader.uint32();
4448
+ switch (tag >>> 3) {
4449
+ case 1: {
4450
+ if (tag !== 10) {
4451
+ break;
4452
+ }
4453
+
4454
+ message.organizationId = reader.string();
4455
+ continue;
4456
+ }
4457
+ case 2: {
4458
+ if (tag !== 18) {
4459
+ break;
4460
+ }
4461
+
4462
+ message.projectId = reader.string();
4463
+ continue;
4464
+ }
4465
+ case 3: {
4466
+ if (tag !== 26) {
4467
+ break;
4468
+ }
4469
+
4470
+ message.dashboardId = reader.string();
4471
+ continue;
4472
+ }
4473
+ }
4474
+ if ((tag & 7) === 4 || tag === 0) {
4475
+ break;
4476
+ }
4477
+ reader.skip(tag & 7);
4478
+ }
4479
+ return message;
4480
+ },
4481
+
4482
+ fromJSON(object: any): DeleteDashboardRequest {
4483
+ return {
4484
+ organizationId: isSet(object.organizationId)
4485
+ ? globalThis.String(object.organizationId)
4486
+ : isSet(object.organization_id)
4487
+ ? globalThis.String(object.organization_id)
4488
+ : "",
4489
+ projectId: isSet(object.projectId)
4490
+ ? globalThis.String(object.projectId)
4491
+ : isSet(object.project_id)
4492
+ ? globalThis.String(object.project_id)
4493
+ : "",
4494
+ dashboardId: isSet(object.dashboardId)
4495
+ ? globalThis.String(object.dashboardId)
4496
+ : isSet(object.dashboard_id)
4497
+ ? globalThis.String(object.dashboard_id)
4498
+ : "",
4499
+ };
4500
+ },
4501
+
4502
+ toJSON(message: DeleteDashboardRequest): unknown {
4503
+ const obj: any = {};
4504
+ if (message.organizationId !== "") {
4505
+ obj.organizationId = message.organizationId;
4506
+ }
4507
+ if (message.projectId !== "") {
4508
+ obj.projectId = message.projectId;
4509
+ }
4510
+ if (message.dashboardId !== "") {
4511
+ obj.dashboardId = message.dashboardId;
4512
+ }
4513
+ return obj;
4514
+ },
4515
+
4516
+ create<I extends Exact<DeepPartial<DeleteDashboardRequest>, I>>(base?: I): DeleteDashboardRequest {
4517
+ return DeleteDashboardRequest.fromPartial(base ?? ({} as any));
4518
+ },
4519
+ fromPartial<I extends Exact<DeepPartial<DeleteDashboardRequest>, I>>(object: I): DeleteDashboardRequest {
4520
+ const message = createBaseDeleteDashboardRequest();
4521
+ message.organizationId = object.organizationId ?? "";
4522
+ message.projectId = object.projectId ?? "";
4523
+ message.dashboardId = object.dashboardId ?? "";
4524
+ return message;
4525
+ },
4526
+ };
4527
+
4528
+ function createBaseDeleteDashboardResponse(): DeleteDashboardResponse {
4529
+ return { status: undefined };
4530
+ }
4531
+
4532
+ export const DeleteDashboardResponse: MessageFns<DeleteDashboardResponse> = {
4533
+ encode(message: DeleteDashboardResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4534
+ if (message.status !== undefined) {
4535
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
4536
+ }
4537
+ return writer;
4538
+ },
4539
+
4540
+ decode(input: BinaryReader | Uint8Array, length?: number): DeleteDashboardResponse {
4541
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4542
+ const end = length === undefined ? reader.len : reader.pos + length;
4543
+ const message = createBaseDeleteDashboardResponse();
4544
+ while (reader.pos < end) {
4545
+ const tag = reader.uint32();
4546
+ switch (tag >>> 3) {
4547
+ case 1: {
4548
+ if (tag !== 10) {
4549
+ break;
4550
+ }
4551
+
4552
+ message.status = ResponseStatus.decode(reader, reader.uint32());
4553
+ continue;
4554
+ }
4555
+ }
4556
+ if ((tag & 7) === 4 || tag === 0) {
4557
+ break;
4558
+ }
4559
+ reader.skip(tag & 7);
4560
+ }
4561
+ return message;
4562
+ },
4563
+
4564
+ fromJSON(object: any): DeleteDashboardResponse {
4565
+ return { status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined };
4566
+ },
4567
+
4568
+ toJSON(message: DeleteDashboardResponse): unknown {
4569
+ const obj: any = {};
4570
+ if (message.status !== undefined) {
4571
+ obj.status = ResponseStatus.toJSON(message.status);
4572
+ }
4573
+ return obj;
4574
+ },
4575
+
4576
+ create<I extends Exact<DeepPartial<DeleteDashboardResponse>, I>>(base?: I): DeleteDashboardResponse {
4577
+ return DeleteDashboardResponse.fromPartial(base ?? ({} as any));
4578
+ },
4579
+ fromPartial<I extends Exact<DeepPartial<DeleteDashboardResponse>, I>>(object: I): DeleteDashboardResponse {
4580
+ const message = createBaseDeleteDashboardResponse();
4581
+ message.status = (object.status !== undefined && object.status !== null)
4582
+ ? ResponseStatus.fromPartial(object.status)
4583
+ : undefined;
4584
+ return message;
4585
+ },
4586
+ };
4587
+
4588
+ function createBaseStreamDashboardDataRequest(): StreamDashboardDataRequest {
4589
+ return { organizationId: "", projectId: "", dashboardId: "", widgetIds: [], timeRange: undefined };
4590
+ }
4591
+
4592
+ export const StreamDashboardDataRequest: MessageFns<StreamDashboardDataRequest> = {
4593
+ encode(message: StreamDashboardDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4594
+ if (message.organizationId !== "") {
4595
+ writer.uint32(10).string(message.organizationId);
4596
+ }
4597
+ if (message.projectId !== "") {
4598
+ writer.uint32(18).string(message.projectId);
4599
+ }
4600
+ if (message.dashboardId !== "") {
4601
+ writer.uint32(26).string(message.dashboardId);
4602
+ }
4603
+ for (const v of message.widgetIds) {
4604
+ writer.uint32(34).string(v!);
4605
+ }
4606
+ if (message.timeRange !== undefined) {
4607
+ TimeRange.encode(message.timeRange, writer.uint32(42).fork()).join();
4608
+ }
4609
+ return writer;
4610
+ },
4611
+
4612
+ decode(input: BinaryReader | Uint8Array, length?: number): StreamDashboardDataRequest {
4613
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4614
+ const end = length === undefined ? reader.len : reader.pos + length;
4615
+ const message = createBaseStreamDashboardDataRequest();
4616
+ while (reader.pos < end) {
4617
+ const tag = reader.uint32();
4618
+ switch (tag >>> 3) {
4619
+ case 1: {
4620
+ if (tag !== 10) {
4621
+ break;
4622
+ }
4623
+
4624
+ message.organizationId = reader.string();
4625
+ continue;
4626
+ }
4627
+ case 2: {
4628
+ if (tag !== 18) {
4629
+ break;
4630
+ }
4631
+
4632
+ message.projectId = reader.string();
4633
+ continue;
4634
+ }
4635
+ case 3: {
4636
+ if (tag !== 26) {
4637
+ break;
4638
+ }
4639
+
4640
+ message.dashboardId = reader.string();
4641
+ continue;
4642
+ }
4643
+ case 4: {
4644
+ if (tag !== 34) {
4645
+ break;
4646
+ }
4647
+
4648
+ message.widgetIds.push(reader.string());
4649
+ continue;
4650
+ }
4651
+ case 5: {
4652
+ if (tag !== 42) {
4653
+ break;
4654
+ }
4655
+
4656
+ message.timeRange = TimeRange.decode(reader, reader.uint32());
4657
+ continue;
4658
+ }
4659
+ }
4660
+ if ((tag & 7) === 4 || tag === 0) {
4661
+ break;
4662
+ }
4663
+ reader.skip(tag & 7);
4664
+ }
4665
+ return message;
4666
+ },
4667
+
4668
+ fromJSON(object: any): StreamDashboardDataRequest {
4669
+ return {
4670
+ organizationId: isSet(object.organizationId)
4671
+ ? globalThis.String(object.organizationId)
4672
+ : isSet(object.organization_id)
4673
+ ? globalThis.String(object.organization_id)
4674
+ : "",
4675
+ projectId: isSet(object.projectId)
4676
+ ? globalThis.String(object.projectId)
4677
+ : isSet(object.project_id)
4678
+ ? globalThis.String(object.project_id)
4679
+ : "",
4680
+ dashboardId: isSet(object.dashboardId)
4681
+ ? globalThis.String(object.dashboardId)
4682
+ : isSet(object.dashboard_id)
4683
+ ? globalThis.String(object.dashboard_id)
4684
+ : "",
4685
+ widgetIds: globalThis.Array.isArray(object?.widgetIds)
4686
+ ? object.widgetIds.map((e: any) => globalThis.String(e))
4687
+ : globalThis.Array.isArray(object?.widget_ids)
4688
+ ? object.widget_ids.map((e: any) => globalThis.String(e))
4689
+ : [],
4690
+ timeRange: isSet(object.timeRange)
4691
+ ? TimeRange.fromJSON(object.timeRange)
4692
+ : isSet(object.time_range)
4693
+ ? TimeRange.fromJSON(object.time_range)
4694
+ : undefined,
4695
+ };
4696
+ },
4697
+
4698
+ toJSON(message: StreamDashboardDataRequest): unknown {
4699
+ const obj: any = {};
4700
+ if (message.organizationId !== "") {
4701
+ obj.organizationId = message.organizationId;
4702
+ }
4703
+ if (message.projectId !== "") {
4704
+ obj.projectId = message.projectId;
4705
+ }
4706
+ if (message.dashboardId !== "") {
4707
+ obj.dashboardId = message.dashboardId;
4708
+ }
4709
+ if (message.widgetIds?.length) {
4710
+ obj.widgetIds = message.widgetIds;
4711
+ }
4712
+ if (message.timeRange !== undefined) {
4713
+ obj.timeRange = TimeRange.toJSON(message.timeRange);
4714
+ }
4715
+ return obj;
4716
+ },
4717
+
4718
+ create<I extends Exact<DeepPartial<StreamDashboardDataRequest>, I>>(base?: I): StreamDashboardDataRequest {
4719
+ return StreamDashboardDataRequest.fromPartial(base ?? ({} as any));
4720
+ },
4721
+ fromPartial<I extends Exact<DeepPartial<StreamDashboardDataRequest>, I>>(object: I): StreamDashboardDataRequest {
4722
+ const message = createBaseStreamDashboardDataRequest();
4723
+ message.organizationId = object.organizationId ?? "";
4724
+ message.projectId = object.projectId ?? "";
4725
+ message.dashboardId = object.dashboardId ?? "";
4726
+ message.widgetIds = object.widgetIds?.map((e) => e) || [];
4727
+ message.timeRange = (object.timeRange !== undefined && object.timeRange !== null)
4728
+ ? TimeRange.fromPartial(object.timeRange)
4729
+ : undefined;
4730
+ return message;
4731
+ },
4732
+ };
4733
+
4734
+ function createBaseDashboardDataEnvelope(): DashboardDataEnvelope {
4735
+ return { widgetId: "", queryIndex: 0, snapshot: undefined, update: undefined, error: undefined };
4736
+ }
4737
+
4738
+ export const DashboardDataEnvelope: MessageFns<DashboardDataEnvelope> = {
4739
+ encode(message: DashboardDataEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4740
+ if (message.widgetId !== "") {
4741
+ writer.uint32(10).string(message.widgetId);
4742
+ }
4743
+ if (message.queryIndex !== 0) {
4744
+ writer.uint32(16).int32(message.queryIndex);
4745
+ }
4746
+ if (message.snapshot !== undefined) {
4747
+ QuerySnapshot.encode(message.snapshot, writer.uint32(26).fork()).join();
4748
+ }
4749
+ if (message.update !== undefined) {
4750
+ QuerySeriesUpdate.encode(message.update, writer.uint32(34).fork()).join();
4751
+ }
4752
+ if (message.error !== undefined) {
4753
+ WidgetQueryError.encode(message.error, writer.uint32(42).fork()).join();
4754
+ }
4755
+ return writer;
4756
+ },
4757
+
4758
+ decode(input: BinaryReader | Uint8Array, length?: number): DashboardDataEnvelope {
4759
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4760
+ const end = length === undefined ? reader.len : reader.pos + length;
4761
+ const message = createBaseDashboardDataEnvelope();
4762
+ while (reader.pos < end) {
4763
+ const tag = reader.uint32();
4764
+ switch (tag >>> 3) {
4765
+ case 1: {
4766
+ if (tag !== 10) {
4767
+ break;
4768
+ }
4769
+
4770
+ message.widgetId = reader.string();
4771
+ continue;
4772
+ }
4773
+ case 2: {
4774
+ if (tag !== 16) {
4775
+ break;
4776
+ }
4777
+
4778
+ message.queryIndex = reader.int32();
4779
+ continue;
4780
+ }
4781
+ case 3: {
4782
+ if (tag !== 26) {
4783
+ break;
4784
+ }
4785
+
4786
+ message.snapshot = QuerySnapshot.decode(reader, reader.uint32());
4787
+ continue;
4788
+ }
4789
+ case 4: {
4790
+ if (tag !== 34) {
4791
+ break;
4792
+ }
4793
+
4794
+ message.update = QuerySeriesUpdate.decode(reader, reader.uint32());
4795
+ continue;
4796
+ }
4797
+ case 5: {
4798
+ if (tag !== 42) {
4799
+ break;
4800
+ }
4801
+
4802
+ message.error = WidgetQueryError.decode(reader, reader.uint32());
4803
+ continue;
4804
+ }
4805
+ }
4806
+ if ((tag & 7) === 4 || tag === 0) {
4807
+ break;
4808
+ }
4809
+ reader.skip(tag & 7);
4810
+ }
4811
+ return message;
4812
+ },
4813
+
4814
+ fromJSON(object: any): DashboardDataEnvelope {
4815
+ return {
4816
+ widgetId: isSet(object.widgetId)
4817
+ ? globalThis.String(object.widgetId)
4818
+ : isSet(object.widget_id)
4819
+ ? globalThis.String(object.widget_id)
4820
+ : "",
4821
+ queryIndex: isSet(object.queryIndex)
4822
+ ? globalThis.Number(object.queryIndex)
4823
+ : isSet(object.query_index)
4824
+ ? globalThis.Number(object.query_index)
4825
+ : 0,
4826
+ snapshot: isSet(object.snapshot) ? QuerySnapshot.fromJSON(object.snapshot) : undefined,
4827
+ update: isSet(object.update) ? QuerySeriesUpdate.fromJSON(object.update) : undefined,
4828
+ error: isSet(object.error) ? WidgetQueryError.fromJSON(object.error) : undefined,
4829
+ };
4830
+ },
4831
+
4832
+ toJSON(message: DashboardDataEnvelope): unknown {
4833
+ const obj: any = {};
4834
+ if (message.widgetId !== "") {
4835
+ obj.widgetId = message.widgetId;
4836
+ }
4837
+ if (message.queryIndex !== 0) {
4838
+ obj.queryIndex = Math.round(message.queryIndex);
4839
+ }
4840
+ if (message.snapshot !== undefined) {
4841
+ obj.snapshot = QuerySnapshot.toJSON(message.snapshot);
4842
+ }
4843
+ if (message.update !== undefined) {
4844
+ obj.update = QuerySeriesUpdate.toJSON(message.update);
4845
+ }
4846
+ if (message.error !== undefined) {
4847
+ obj.error = WidgetQueryError.toJSON(message.error);
4848
+ }
4849
+ return obj;
4850
+ },
4851
+
4852
+ create<I extends Exact<DeepPartial<DashboardDataEnvelope>, I>>(base?: I): DashboardDataEnvelope {
4853
+ return DashboardDataEnvelope.fromPartial(base ?? ({} as any));
4854
+ },
4855
+ fromPartial<I extends Exact<DeepPartial<DashboardDataEnvelope>, I>>(object: I): DashboardDataEnvelope {
4856
+ const message = createBaseDashboardDataEnvelope();
4857
+ message.widgetId = object.widgetId ?? "";
4858
+ message.queryIndex = object.queryIndex ?? 0;
4859
+ message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
4860
+ ? QuerySnapshot.fromPartial(object.snapshot)
4861
+ : undefined;
4862
+ message.update = (object.update !== undefined && object.update !== null)
4863
+ ? QuerySeriesUpdate.fromPartial(object.update)
4864
+ : undefined;
4865
+ message.error = (object.error !== undefined && object.error !== null)
4866
+ ? WidgetQueryError.fromPartial(object.error)
4867
+ : undefined;
4868
+ return message;
4869
+ },
4870
+ };
4871
+
4872
+ function createBaseWidgetQueryError(): WidgetQueryError {
4873
+ return { message: "" };
4874
+ }
4875
+
4876
+ export const WidgetQueryError: MessageFns<WidgetQueryError> = {
4877
+ encode(message: WidgetQueryError, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4878
+ if (message.message !== "") {
4879
+ writer.uint32(10).string(message.message);
4880
+ }
4881
+ return writer;
4882
+ },
4883
+
4884
+ decode(input: BinaryReader | Uint8Array, length?: number): WidgetQueryError {
4885
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4886
+ const end = length === undefined ? reader.len : reader.pos + length;
4887
+ const message = createBaseWidgetQueryError();
4888
+ while (reader.pos < end) {
4889
+ const tag = reader.uint32();
4890
+ switch (tag >>> 3) {
4891
+ case 1: {
4892
+ if (tag !== 10) {
4893
+ break;
4894
+ }
4895
+
4896
+ message.message = reader.string();
4897
+ continue;
4898
+ }
4899
+ }
4900
+ if ((tag & 7) === 4 || tag === 0) {
4901
+ break;
4902
+ }
4903
+ reader.skip(tag & 7);
4904
+ }
4905
+ return message;
4906
+ },
4907
+
4908
+ fromJSON(object: any): WidgetQueryError {
4909
+ return { message: isSet(object.message) ? globalThis.String(object.message) : "" };
4910
+ },
4911
+
4912
+ toJSON(message: WidgetQueryError): unknown {
4913
+ const obj: any = {};
4914
+ if (message.message !== "") {
4915
+ obj.message = message.message;
4916
+ }
4917
+ return obj;
4918
+ },
4919
+
4920
+ create<I extends Exact<DeepPartial<WidgetQueryError>, I>>(base?: I): WidgetQueryError {
4921
+ return WidgetQueryError.fromPartial(base ?? ({} as any));
4922
+ },
4923
+ fromPartial<I extends Exact<DeepPartial<WidgetQueryError>, I>>(object: I): WidgetQueryError {
4924
+ const message = createBaseWidgetQueryError();
4925
+ message.message = object.message ?? "";
4926
+ return message;
4927
+ },
4928
+ };
4929
+
4930
+ /**
4931
+ * MetricGatewayService is the web surface of telemetry.api.v1 MetricService — the types
4932
+ * are domain-isolated copies converted in gateways/internal/convert. It covers the
4933
+ * metric catalog, ad-hoc queries, and Postgres-backed dashboards that compose those
4934
+ * queries. Every streaming RPC emits a snapshot first, then live updates.
4935
+ *
4936
+ * StreamQuery executes one MetricQuery — the same message a dashboard widget
4937
+ * stores — so the metrics explorer, the widget editor preview, and a saved
4938
+ * dashboard all run through one query path.
4939
+ */
4940
+ export interface MetricGatewayService {
4941
+ StreamMetrics(request: StreamMetricsRequest, metadata?: Metadata): Observable<MetricCatalogEnvelope>;
4942
+ StreamMetricAttributes(
4943
+ request: StreamMetricAttributesRequest,
4944
+ metadata?: Metadata,
4945
+ ): Observable<MetricAttributeEnvelope>;
4946
+ /**
4947
+ * Ad-hoc query execution: snapshot, then live bucket updates while the
4948
+ * stream stays open (relative ranges only; absolute ranges complete after
4949
+ * the snapshot). Query failures abort the stream with a gRPC status.
4950
+ */
4951
+ StreamQuery(request: StreamQueryRequest, metadata?: Metadata): Observable<QueryDataEnvelope>;
4952
+ CreateDashboard(request: CreateDashboardRequest, metadata?: Metadata): Promise<CreateDashboardResponse>;
4953
+ GetDashboard(request: GetDashboardRequest, metadata?: Metadata): Promise<GetDashboardResponse>;
4954
+ ListDashboards(request: ListDashboardsRequest, metadata?: Metadata): Promise<ListDashboardsResponse>;
4955
+ UpdateDashboard(request: UpdateDashboardRequest, metadata?: Metadata): Promise<UpdateDashboardResponse>;
4956
+ DeleteDashboard(request: DeleteDashboardRequest, metadata?: Metadata): Promise<DeleteDashboardResponse>;
4957
+ /**
4958
+ * One stream per dashboard view: every widget query runs server-side and
4959
+ * all results multiplex onto this stream tagged with widget_id. Per-widget
4960
+ * failures are in-band and retried; the stream ends only on terminal
4961
+ * conditions.
4962
+ */
4963
+ StreamDashboardData(request: StreamDashboardDataRequest, metadata?: Metadata): Observable<DashboardDataEnvelope>;
4964
+ }
4965
+
4966
+ export const MetricGatewayServiceServiceName = "gateway.web.v1.MetricGatewayService";
4967
+ export class MetricGatewayServiceClientImpl implements MetricGatewayService {
4968
+ private readonly rpc: Rpc;
4969
+ private readonly service: string;
4970
+ constructor(rpc: Rpc, opts?: { service?: string }) {
4971
+ this.service = opts?.service || MetricGatewayServiceServiceName;
4972
+ this.rpc = rpc;
4973
+ this.StreamMetrics = this.StreamMetrics.bind(this);
4974
+ this.StreamMetricAttributes = this.StreamMetricAttributes.bind(this);
4975
+ this.StreamQuery = this.StreamQuery.bind(this);
4976
+ this.CreateDashboard = this.CreateDashboard.bind(this);
4977
+ this.GetDashboard = this.GetDashboard.bind(this);
4978
+ this.ListDashboards = this.ListDashboards.bind(this);
4979
+ this.UpdateDashboard = this.UpdateDashboard.bind(this);
4980
+ this.DeleteDashboard = this.DeleteDashboard.bind(this);
4981
+ this.StreamDashboardData = this.StreamDashboardData.bind(this);
4982
+ }
4983
+ StreamMetrics(request: StreamMetricsRequest, metadata?: Metadata): Observable<MetricCatalogEnvelope> {
4984
+ const data = StreamMetricsRequest.encode(request).finish();
4985
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamMetrics", data, metadata);
4986
+ return result.pipe(map((data) => MetricCatalogEnvelope.decode(new BinaryReader(data))));
4987
+ }
4988
+
4989
+ StreamMetricAttributes(
4990
+ request: StreamMetricAttributesRequest,
4991
+ metadata?: Metadata,
4992
+ ): Observable<MetricAttributeEnvelope> {
4993
+ const data = StreamMetricAttributesRequest.encode(request).finish();
4994
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamMetricAttributes", data, metadata);
4995
+ return result.pipe(map((data) => MetricAttributeEnvelope.decode(new BinaryReader(data))));
4996
+ }
4997
+
4998
+ StreamQuery(request: StreamQueryRequest, metadata?: Metadata): Observable<QueryDataEnvelope> {
4999
+ const data = StreamQueryRequest.encode(request).finish();
5000
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamQuery", data, metadata);
5001
+ return result.pipe(map((data) => QueryDataEnvelope.decode(new BinaryReader(data))));
5002
+ }
5003
+
5004
+ CreateDashboard(request: CreateDashboardRequest, metadata?: Metadata): Promise<CreateDashboardResponse> {
5005
+ const data = CreateDashboardRequest.encode(request).finish();
5006
+ const promise = this.rpc.request(this.service, "CreateDashboard", data, metadata);
5007
+ return promise.then((data) => CreateDashboardResponse.decode(new BinaryReader(data)));
5008
+ }
5009
+
5010
+ GetDashboard(request: GetDashboardRequest, metadata?: Metadata): Promise<GetDashboardResponse> {
5011
+ const data = GetDashboardRequest.encode(request).finish();
5012
+ const promise = this.rpc.request(this.service, "GetDashboard", data, metadata);
5013
+ return promise.then((data) => GetDashboardResponse.decode(new BinaryReader(data)));
5014
+ }
5015
+
5016
+ ListDashboards(request: ListDashboardsRequest, metadata?: Metadata): Promise<ListDashboardsResponse> {
5017
+ const data = ListDashboardsRequest.encode(request).finish();
5018
+ const promise = this.rpc.request(this.service, "ListDashboards", data, metadata);
5019
+ return promise.then((data) => ListDashboardsResponse.decode(new BinaryReader(data)));
5020
+ }
5021
+
5022
+ UpdateDashboard(request: UpdateDashboardRequest, metadata?: Metadata): Promise<UpdateDashboardResponse> {
5023
+ const data = UpdateDashboardRequest.encode(request).finish();
5024
+ const promise = this.rpc.request(this.service, "UpdateDashboard", data, metadata);
5025
+ return promise.then((data) => UpdateDashboardResponse.decode(new BinaryReader(data)));
5026
+ }
5027
+
5028
+ DeleteDashboard(request: DeleteDashboardRequest, metadata?: Metadata): Promise<DeleteDashboardResponse> {
5029
+ const data = DeleteDashboardRequest.encode(request).finish();
5030
+ const promise = this.rpc.request(this.service, "DeleteDashboard", data, metadata);
5031
+ return promise.then((data) => DeleteDashboardResponse.decode(new BinaryReader(data)));
5032
+ }
5033
+
5034
+ StreamDashboardData(request: StreamDashboardDataRequest, metadata?: Metadata): Observable<DashboardDataEnvelope> {
5035
+ const data = StreamDashboardDataRequest.encode(request).finish();
5036
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamDashboardData", data, metadata);
5037
+ return result.pipe(map((data) => DashboardDataEnvelope.decode(new BinaryReader(data))));
2638
5038
  }
2639
5039
  }
2640
5040