Skip to content

Commit

Permalink
feat: updated nodejs runner structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jenspots committed Jun 20, 2024
1 parent 75ebef7 commit 863c27e
Show file tree
Hide file tree
Showing 9 changed files with 1,151 additions and 1,161 deletions.
12 changes: 6 additions & 6 deletions runners/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ In this directory, a runner and processor interface is defined for use with Node
We use `proto-ts` to generate TypeScript interfaces from the protocol buffer definitions. Run the following command to generate the source code.

```shell
protoc \
--plugin=./node_modules/.bin/protoc-gen-ts_proto \
--ts_proto_out=./src \
--ts_proto_opt=outputServices=grpc-js \
--proto-path=.. \
./index.proto
protoc \
--plugin=./node_modules/.bin/protoc-gen-ts_proto \
--ts_proto_out=./src/proto \
--ts_proto_opt=outputServices=grpc-js \
--proto_path=./../../proto \
index.proto
```
6 changes: 0 additions & 6 deletions runners/nodejs/src/index.ts

This file was deleted.

83 changes: 83 additions & 0 deletions runners/nodejs/src/proto/empty.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v1.180.0
// protoc v5.27.0
// source: empty.proto

/* eslint-disable */
import * as _m0 from "protobufjs/minimal";

export const protobufPackage = "";

/** A message that represents nothing. */
export interface Empty {}

function createBaseEmpty(): Empty {
return {};
}

export const Empty = {
encode(_: Empty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
return writer;
},

decode(input: _m0.Reader | Uint8Array, length?: number): Empty {
const reader =
input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEmpty();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},

fromJSON(_: any): Empty {
return {};
},

toJSON(_: Empty): unknown {
const obj: any = {};
return obj;
},

create<I extends Exact<DeepPartial<Empty>, I>>(base?: I): Empty {
return Empty.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Empty>, I>>(_: I): Empty {
const message = createBaseEmpty();
return message;
},
};

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 {}
? { [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;
};
Loading

0 comments on commit 863c27e

Please sign in to comment.