Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"private": true,
"scripts": {
"gen": "cd proto && bunx buf generate && bunx grpc_tools_node_protoc --js_out=import_style=commonjs,binary:../src/gen auth/v1/auth.proto event/v1/event.proto payment/v1/payment.proto query/v1/query.proto",
"gen": "cd proto && bunx buf generate && bunx grpc_tools_node_protoc --js_out=import_style=commonjs,binary:../src/gen auth/v1/auth.proto event/v1/event.proto payment/v1/payment.proto query/v1/query.proto data/v1/data.proto",
"dev:backend": "bun --watch src/server.ts",
"test": "vitest",
"test:ui": "vitest --ui",
Expand Down
2 changes: 1 addition & 1 deletion proto
Submodule proto updated 1 files
+59 −0 data/v1/data.proto
44 changes: 44 additions & 0 deletions src/gen/data/v1/data_grpc_pb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// GENERATED CODE -- DO NOT EDIT!

'use strict';
var grpc = require('@grpc/grpc-js');
var data_v1_data_pb = require('../../data/v1/data_pb.js');

function serialize_data_v1_QueryRequest(arg) {
if (!(arg instanceof data_v1_data_pb.QueryRequest)) {
throw new Error('Expected argument of type data.v1.QueryRequest');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_data_v1_QueryRequest(buffer_arg) {
return data_v1_data_pb.QueryRequest.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_data_v1_QueryResponse(arg) {
if (!(arg instanceof data_v1_data_pb.QueryResponse)) {
throw new Error('Expected argument of type data.v1.QueryResponse');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_data_v1_QueryResponse(buffer_arg) {
return data_v1_data_pb.QueryResponse.deserializeBinary(new Uint8Array(buffer_arg));
}


var DataQueryServiceService = exports.DataQueryServiceService = {
query: {
path: '/data.v1.DataQueryService/Query',
requestStream: false,
responseStream: false,
requestType: data_v1_data_pb.QueryRequest,
responseType: data_v1_data_pb.QueryResponse,
requestSerialize: serialize_data_v1_QueryRequest,
requestDeserialize: deserialize_data_v1_QueryRequest,
responseSerialize: serialize_data_v1_QueryResponse,
responseDeserialize: deserialize_data_v1_QueryResponse,
},
};

exports.DataQueryServiceClient = grpc.makeGenericClientConstructor(DataQueryServiceService, 'DataQueryService');
204 changes: 204 additions & 0 deletions src/gen/data/v1/data_pb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
// package: data.v1
// file: data/v1/data.proto

import * as jspb from "google-protobuf";

export class FilterCondition extends jspb.Message {
getField(): string;
setField(value: string): void;

getOperator(): OperatorMap[keyof OperatorMap];
setOperator(value: OperatorMap[keyof OperatorMap]): void;

getValue(): string;
setValue(value: string): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): FilterCondition.AsObject;
static toObject(includeInstance: boolean, msg: FilterCondition): FilterCondition.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: FilterCondition, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): FilterCondition;
static deserializeBinaryFromReader(message: FilterCondition, reader: jspb.BinaryReader): FilterCondition;
}

export namespace FilterCondition {
export type AsObject = {
field: string,
operator: OperatorMap[keyof OperatorMap],
value: string,
}
}

export class FilterGroup extends jspb.Message {
getLogical(): LogicalOperatorMap[keyof LogicalOperatorMap];
setLogical(value: LogicalOperatorMap[keyof LogicalOperatorMap]): void;

clearConditionsList(): void;
getConditionsList(): Array<FilterCondition>;
setConditionsList(value: Array<FilterCondition>): void;
addConditions(value?: FilterCondition, index?: number): FilterCondition;

clearGroupsList(): void;
getGroupsList(): Array<FilterGroup>;
setGroupsList(value: Array<FilterGroup>): void;
addGroups(value?: FilterGroup, index?: number): FilterGroup;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): FilterGroup.AsObject;
static toObject(includeInstance: boolean, msg: FilterGroup): FilterGroup.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: FilterGroup, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): FilterGroup;
static deserializeBinaryFromReader(message: FilterGroup, reader: jspb.BinaryReader): FilterGroup;
}

export namespace FilterGroup {
export type AsObject = {
logical: LogicalOperatorMap[keyof LogicalOperatorMap],
conditionsList: Array<FilterCondition.AsObject>,
groupsList: Array<FilterGroup.AsObject>,
}
}

export class OrderBy extends jspb.Message {
getField(): string;
setField(value: string): void;

getDescending(): boolean;
setDescending(value: boolean): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): OrderBy.AsObject;
static toObject(includeInstance: boolean, msg: OrderBy): OrderBy.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: OrderBy, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): OrderBy;
static deserializeBinaryFromReader(message: OrderBy, reader: jspb.BinaryReader): OrderBy;
}

export namespace OrderBy {
export type AsObject = {
field: string,
descending: boolean,
}
}

export class QueryRequest extends jspb.Message {
getTable(): string;
setTable(value: string): void;

hasWhere(): boolean;
clearWhere(): void;
getWhere(): FilterGroup | undefined;
setWhere(value?: FilterGroup): void;

clearOrderByList(): void;
getOrderByList(): Array<OrderBy>;
setOrderByList(value: Array<OrderBy>): void;
addOrderBy(value?: OrderBy, index?: number): OrderBy;

getLimit(): number;
setLimit(value: number): void;

getOffset(): number;
setOffset(value: number): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): QueryRequest.AsObject;
static toObject(includeInstance: boolean, msg: QueryRequest): QueryRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: QueryRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): QueryRequest;
static deserializeBinaryFromReader(message: QueryRequest, reader: jspb.BinaryReader): QueryRequest;
}

export namespace QueryRequest {
export type AsObject = {
table: string,
where?: FilterGroup.AsObject,
orderByList: Array<OrderBy.AsObject>,
limit: number,
offset: number,
}
}

export class QueryResponse extends jspb.Message {
clearColumnsList(): void;
getColumnsList(): Array<string>;
setColumnsList(value: Array<string>): void;
addColumns(value: string, index?: number): string;

clearRowsList(): void;
getRowsList(): Array<Row>;
setRowsList(value: Array<Row>): void;
addRows(value?: Row, index?: number): Row;

getTotal(): number;
setTotal(value: number): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): QueryResponse.AsObject;
static toObject(includeInstance: boolean, msg: QueryResponse): QueryResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: QueryResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): QueryResponse;
static deserializeBinaryFromReader(message: QueryResponse, reader: jspb.BinaryReader): QueryResponse;
}

export namespace QueryResponse {
export type AsObject = {
columnsList: Array<string>,
rowsList: Array<Row.AsObject>,
total: number,
}
}

export class Row extends jspb.Message {
clearValuesList(): void;
getValuesList(): Array<string>;
setValuesList(value: Array<string>): void;
addValues(value: string, index?: number): string;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Row.AsObject;
static toObject(includeInstance: boolean, msg: Row): Row.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: Row, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): Row;
static deserializeBinaryFromReader(message: Row, reader: jspb.BinaryReader): Row;
}

export namespace Row {
export type AsObject = {
valuesList: Array<string>,
}
}

export interface OperatorMap {
OPERATOR_UNSPECIFIED: 0;
EQ: 1;
GT: 2;
GTE: 3;
LT: 4;
LTE: 5;
NEQ: 6;
CONTAINS: 7;
}

export const Operator: OperatorMap;

export interface LogicalOperatorMap {
LOGICAL_OPERATOR_UNSPECIFIED: 0;
AND: 1;
OR: 2;
}

export const LogicalOperator: LogicalOperatorMap;

Loading
Loading