Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
benfdking committed Jun 25, 2024
1 parent 25bd81a commit 3df8f81
Show file tree
Hide file tree
Showing 35 changed files with 5,021 additions and 3,002 deletions.
196 changes: 196 additions & 0 deletions js/packages/proto/src/generated/quary/service/v1/dashboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v1.178.0
// protoc unknown
// source: quary/service/v1/dashboard.proto

/* eslint-disable */
import * as _m0 from "protobufjs/minimal";
import { DashboardItem } from "./dashboard_file";

export const protobufPackage = "quary.service.v1";

export interface Dashboard {
name: string;
title?: string | undefined;
description?:
| string
| undefined;
/**
* Tags are used to group different parts of the project together. For example, you could tag all models that are
* related to a specific department with the same tag.
*/
tags: string[];
items: DashboardItem[];
filePath: string;
}

function createBaseDashboard(): Dashboard {
return { name: "", title: undefined, description: undefined, tags: [], items: [], filePath: "" };
}

export const Dashboard = {
encode(message: Dashboard, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
if (message.title !== undefined) {
writer.uint32(18).string(message.title);
}
if (message.description !== undefined) {
writer.uint32(26).string(message.description);
}
for (const v of message.tags) {
writer.uint32(34).string(v!);
}
for (const v of message.items) {
DashboardItem.encode(v!, writer.uint32(42).fork()).ldelim();
}
if (message.filePath !== "") {
writer.uint32(50).string(message.filePath);
}
return writer;
},

decode(input: _m0.Reader | Uint8Array, length?: number): Dashboard {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseDashboard();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}

message.name = reader.string();
continue;
case 2:
if (tag !== 18) {
break;
}

message.title = reader.string();
continue;
case 3:
if (tag !== 26) {
break;
}

message.description = reader.string();
continue;
case 4:
if (tag !== 34) {
break;
}

message.tags.push(reader.string());
continue;
case 5:
if (tag !== 42) {
break;
}

message.items.push(DashboardItem.decode(reader, reader.uint32()));
continue;
case 6:
if (tag !== 50) {
break;
}

message.filePath = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},

fromJSON(object: any): Dashboard {
return {
name: isSet(object.name) ? gt.String(object.name) : "",
title: isSet(object.title) ? gt.String(object.title) : undefined,
description: isSet(object.description) ? gt.String(object.description) : undefined,
tags: gt.Array.isArray(object?.tags) ? object.tags.map((e: any) => gt.String(e)) : [],
items: gt.Array.isArray(object?.items) ? object.items.map((e: any) => DashboardItem.fromJSON(e)) : [],
filePath: isSet(object.filePath) ? gt.String(object.filePath) : "",
};
},

toJSON(message: Dashboard): unknown {
const obj: any = {};
if (message.name !== "") {
obj.name = message.name;
}
if (message.title !== undefined) {
obj.title = message.title;
}
if (message.description !== undefined) {
obj.description = message.description;
}
if (message.tags?.length) {
obj.tags = message.tags;
}
if (message.items?.length) {
obj.items = message.items.map((e) => DashboardItem.toJSON(e));
}
if (message.filePath !== "") {
obj.filePath = message.filePath;
}
return obj;
},

create<I extends Exact<DeepPartial<Dashboard>, I>>(base?: I): Dashboard {
return Dashboard.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Dashboard>, I>>(object: I): Dashboard {
const message = createBaseDashboard();
message.name = object.name ?? "";
message.title = object.title ?? undefined;
message.description = object.description ?? undefined;
message.tags = object.tags?.map((e) => e) || [];
message.items = object.items?.map((e) => DashboardItem.fromPartial(e)) || [];
message.filePath = object.filePath ?? "";
return message;
},
};

declare const self: any | undefined;
declare const window: any | undefined;
declare const global: any | undefined;
const gt: any = (() => {
if (typeof globalThis !== "undefined") {
return globalThis;
}
if (typeof self !== "undefined") {
return self;
}
if (typeof window !== "undefined") {
return window;
}
if (typeof global !== "undefined") {
return global;
}
throw "Unable to locate global object";
})();

type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;

export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;

type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };

function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
28 changes: 25 additions & 3 deletions js/packages/proto/src/generated/quary/service/v1/dashboard_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ export const protobufPackage = "quary.service.v1";
export interface DashboardFile {
name: string;
title?: string | undefined;
description?: string | undefined;
description?:
| string
| undefined;
/**
* Tags are used to group different parts of the project together. For example, you could tag all models that are
* related to a specific department with the same tag.
*/
tags: string[];
items: DashboardItem[];
}

Expand All @@ -33,7 +40,7 @@ export interface DashboardChartReference {
}

function createBaseDashboardFile(): DashboardFile {
return { name: "", title: undefined, description: undefined, items: [] };
return { name: "", title: undefined, description: undefined, tags: [], items: [] };
}

export const DashboardFile = {
Expand All @@ -47,8 +54,11 @@ export const DashboardFile = {
if (message.description !== undefined) {
writer.uint32(26).string(message.description);
}
for (const v of message.tags) {
writer.uint32(34).string(v!);
}
for (const v of message.items) {
DashboardItem.encode(v!, writer.uint32(34).fork()).ldelim();
DashboardItem.encode(v!, writer.uint32(42).fork()).ldelim();
}
return writer;
},
Expand Down Expand Up @@ -86,6 +96,13 @@ export const DashboardFile = {
break;
}

message.tags.push(reader.string());
continue;
case 5:
if (tag !== 42) {
break;
}

message.items.push(DashboardItem.decode(reader, reader.uint32()));
continue;
}
Expand All @@ -102,6 +119,7 @@ export const DashboardFile = {
name: isSet(object.name) ? gt.String(object.name) : "",
title: isSet(object.title) ? gt.String(object.title) : undefined,
description: isSet(object.description) ? gt.String(object.description) : undefined,
tags: gt.Array.isArray(object?.tags) ? object.tags.map((e: any) => gt.String(e)) : [],
items: gt.Array.isArray(object?.items) ? object.items.map((e: any) => DashboardItem.fromJSON(e)) : [],
};
},
Expand All @@ -117,6 +135,9 @@ export const DashboardFile = {
if (message.description !== undefined) {
obj.description = message.description;
}
if (message.tags?.length) {
obj.tags = message.tags;
}
if (message.items?.length) {
obj.items = message.items.map((e) => DashboardItem.toJSON(e));
}
Expand All @@ -131,6 +152,7 @@ export const DashboardFile = {
message.name = object.name ?? "";
message.title = object.title ?? undefined;
message.description = object.description ?? undefined;
message.tags = object.tags?.map((e) => e) || [];
message.items = object.items?.map((e) => DashboardItem.fromPartial(e)) || [];
return message;
},
Expand Down
26 changes: 13 additions & 13 deletions js/packages/proto/src/generated/quary/service/v1/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as _m0 from "protobufjs/minimal";
import { Chart } from "./chart";
import { ConnectionConfig } from "./connection_config";
import { DashboardFile } from "./dashboard_file";
import { Dashboard } from "./dashboard";
import { ProjectFile } from "./project_file";
import { Model, Seed, Snapshot, Source, Test } from "./types";

Expand All @@ -21,7 +21,7 @@ export interface Project {
sources: { [key: string]: Source };
snapshots: { [key: string]: Snapshot };
charts: { [key: string]: Chart };
dashboards: { [key: string]: DashboardFile };
dashboards: { [key: string]: Dashboard };
projectFiles: { [key: string]: ProjectFile };
connectionConfig: ConnectionConfig | undefined;
}
Expand Down Expand Up @@ -58,7 +58,7 @@ export interface Project_ChartsEntry {

export interface Project_DashboardsEntry {
key: string;
value: DashboardFile | undefined;
value: Dashboard | undefined;
}

export interface Project_ProjectFilesEntry {
Expand Down Expand Up @@ -254,8 +254,8 @@ export const Project = {
}, {})
: {},
dashboards: isObject(object.dashboards)
? Object.entries(object.dashboards).reduce<{ [key: string]: DashboardFile }>((acc, [key, value]) => {
acc[key] = DashboardFile.fromJSON(value);
? Object.entries(object.dashboards).reduce<{ [key: string]: Dashboard }>((acc, [key, value]) => {
acc[key] = Dashboard.fromJSON(value);
return acc;
}, {})
: {},
Expand Down Expand Up @@ -330,7 +330,7 @@ export const Project = {
if (entries.length > 0) {
obj.dashboards = {};
entries.forEach(([k, v]) => {
obj.dashboards[k] = DashboardFile.toJSON(v);
obj.dashboards[k] = Dashboard.toJSON(v);
});
}
}
Expand Down Expand Up @@ -393,10 +393,10 @@ export const Project = {
}
return acc;
}, {});
message.dashboards = Object.entries(object.dashboards ?? {}).reduce<{ [key: string]: DashboardFile }>(
message.dashboards = Object.entries(object.dashboards ?? {}).reduce<{ [key: string]: Dashboard }>(
(acc, [key, value]) => {
if (value !== undefined) {
acc[key] = DashboardFile.fromPartial(value);
acc[key] = Dashboard.fromPartial(value);
}
return acc;
},
Expand Down Expand Up @@ -876,7 +876,7 @@ export const Project_DashboardsEntry = {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
DashboardFile.encode(message.value, writer.uint32(18).fork()).ldelim();
Dashboard.encode(message.value, writer.uint32(18).fork()).ldelim();
}
return writer;
},
Expand All @@ -900,7 +900,7 @@ export const Project_DashboardsEntry = {
break;
}

message.value = DashboardFile.decode(reader, reader.uint32());
message.value = Dashboard.decode(reader, reader.uint32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
Expand All @@ -914,7 +914,7 @@ export const Project_DashboardsEntry = {
fromJSON(object: any): Project_DashboardsEntry {
return {
key: isSet(object.key) ? gt.String(object.key) : "",
value: isSet(object.value) ? DashboardFile.fromJSON(object.value) : undefined,
value: isSet(object.value) ? Dashboard.fromJSON(object.value) : undefined,
};
},

Expand All @@ -924,7 +924,7 @@ export const Project_DashboardsEntry = {
obj.key = message.key;
}
if (message.value !== undefined) {
obj.value = DashboardFile.toJSON(message.value);
obj.value = Dashboard.toJSON(message.value);
}
return obj;
},
Expand All @@ -936,7 +936,7 @@ export const Project_DashboardsEntry = {
const message = createBaseProject_DashboardsEntry();
message.key = object.key ?? "";
message.value = (object.value !== undefined && object.value !== null)
? DashboardFile.fromPartial(object.value)
? Dashboard.fromPartial(object.value)
: undefined;
return message;
},
Expand Down
Loading

0 comments on commit 3df8f81

Please sign in to comment.