-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: changed logic to compute deadline
Removed the yarn.lock file to reset dependencies.
- Loading branch information
1 parent
d7577a7
commit 7fef8f5
Showing
14 changed files
with
516 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { LOG_LEVEL } from "@ubiquity-dao/ubiquibot-logger"; | ||
import { LogLevel } from "@ubiquity-os/ubiquity-os-logger"; | ||
|
||
export {}; | ||
|
||
declare global { | ||
namespace NodeJS { | ||
interface ProcessEnv { | ||
LOG_LEVEL?: LOG_LEVEL; | ||
LOG_LEVEL?: LogLevel; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,24 @@ | ||
import express from "express"; | ||
import { validateAndDecodeSchemas } from "../../../src/helpers/validator"; | ||
import { run } from "../../../src/run"; | ||
import { PluginInputs } from "../../../src/types/plugin-input"; | ||
import { serve } from "@hono/node-server"; | ||
import { createPlugin } from "@ubiquity-os/ubiquity-os-kernel"; | ||
import { LOG_LEVEL } from "@ubiquity-os/ubiquity-os-logger"; | ||
import manifest from "../../../manifest.json"; | ||
import { run } from "../../../src/run"; | ||
import { Env, envSchema, PluginSettings, pluginSettingsSchema, SupportedEvents } from "../../../src/types/plugin-input"; | ||
|
||
const app = express(); | ||
const port = 4000; | ||
|
||
app.use(express.json()); | ||
|
||
app.post("/", async (req, res) => { | ||
try { | ||
const inputs = req.body; | ||
const { decodedSettings } = validateAndDecodeSchemas(inputs.settings, process.env); | ||
inputs.settings = decodedSettings; | ||
const result = await run(inputs); | ||
res.json(result); | ||
} catch (error) { | ||
console.error("Error running plugin:", error); | ||
res.status(500).send("Internal Server Error"); | ||
createPlugin<PluginSettings, Env, SupportedEvents>( | ||
async (context) => { | ||
const result = await run(context); | ||
console.log(JSON.stringify(result)); | ||
return result; | ||
}, | ||
//@ts-expect-error err | ||
manifest, | ||
{ | ||
envSchema: envSchema, | ||
settingsSchema: pluginSettingsSchema, | ||
logLevel: LOG_LEVEL.DEBUG, | ||
} | ||
}); | ||
|
||
app.get("/manifest.json", (req, res) => { | ||
res.json(manifest); | ||
}); | ||
|
||
app.listen(port, () => { | ||
console.log(`Server is running at http://localhost:${port}`); | ||
).then((server) => { | ||
console.log("Server starting..."); | ||
return serve(server); | ||
}); |
Oops, something went wrong.