feat: add cron

This commit is contained in:
TrèsAbhi committed 2024-06-28 20:08:50 -05:00
1 parent ffaa368f81
commit ed17366365
10 files changed
+87 -21

No files matched your search

-2
View File
@@ -5,7 +5,6 @@ export async function commitAssets(
message: string,
changes: FileChange[],
production: boolean,
verbose = true,
) {
console.log(`Committing ${message}...`);
@@ -17,6 +16,5 @@ export async function commitAssets(
production ? 'main' : 'dev',
`${message} - ${new Date().toDateString()}`,
changes,
verbose,
);
}
-1
View File
@@ -14,7 +14,6 @@ export default async function commitMultipleFiles(
branch: string,
message: string,
changes: FileChange[],
verbose = false,
) {
const latestCommitSha = (
await octokit.git.getRef({
+6
View File
@@ -0,0 +1,6 @@
import { lookup } from './lookup';
export async function decode(proto: string, data: Uint8Array) {
const Message = await lookup(proto);
return Message.decode(data).toJSON();
}
+6
View File
@@ -0,0 +1,6 @@
import { lookup } from './lookup';
export async function encode(proto: string, data: any) {
const Message = await lookup(proto);
return Message.encode(Message.create(data)).finish();
}
+6
View File
@@ -0,0 +1,6 @@
import { encode } from './encode';
export async function encodeToBase64(proto: string, data: any) {
const array = await encode(proto, data);
return Buffer.from(array).toString('base64');
}
+10
View File
@@ -0,0 +1,10 @@
import { Root } from 'protobufjs';
export async function lookup(proto: string) {
const root = await new Root().load(
`src/protos/${proto.split('.')[0]}.proto`,
{ keepCase: true },
);
return root.lookupType(proto);
}