fix: Fix a lint

chore: remove the limit on the long-running

fix: Starting sometimes.

fix: Make it so the stop of the main works

fix: Bind local and tor with package.

wip: envs

fix TS error

import config types from sdk

update package.json
This commit is contained in:
BluJ
2023-02-20 12:22:57 -07:00
committed by Aiden McClelland
parent f5430f9151
commit 5e9e26fa67
34 changed files with 1425 additions and 1195 deletions

View File

@@ -1,6 +1,5 @@
import Deno from "/deno_global.js";
import * as mainModule from "/embassy.js";
function requireParam(param) {
throw new Error(`Missing required parameter ${param}`);
}
@@ -90,7 +89,10 @@ const bindLocal = async (
externalPort = requireParam("externalPort"),
} = requireParam("options"),
) => {
return Deno.core.opAsync("bind_local", internalPort, { name, externalPort });
return Deno.core.opAsync("bind_local", internalPort, {
id: name,
externalPort,
});
};
const bindTor = async (
{
@@ -99,7 +101,10 @@ const bindTor = async (
externalPort = requireParam("externalPort"),
} = requireParam("options"),
) => {
return Deno.core.opAsync("bind_onion", internalPort, { name, externalPort });
return Deno.core.opAsync("bind_onion", internalPort, {
id: name,
externalPort,
});
};
const signalGroup = async (
@@ -180,7 +185,8 @@ const createDir = (
) => Deno.core.opAsync("create_dir", volumeId, path);
const readDir = (
{ volumeId = requireParam("volumeId"), path = requireParam("path") } = requireParam("options"),
{ volumeId = requireParam("volumeId"), path = requireParam("path") } =
requireParam("options"),
) => Deno.core.opAsync("read_dir", volumeId, path);
const removeDir = (
{ volumeId = requireParam("volumeId"), path = requireParam("path") } =
@@ -289,12 +295,15 @@ const effects = {
removeDir,
removeFile,
rename,
restart,
runCommand,
runDaemon,
runRsync,
chmod,
signalGroup,
sleep,
start,
stop,
trace,
warn,
writeFile,

View File

@@ -19,6 +19,7 @@ use serde::{Deserialize, Serialize};
use serde_json::Value;
use tokio::io::AsyncReadExt;
use tokio::sync::{mpsc, Mutex};
use tracing::instrument;
pub trait PathForVolumeId: Send + Sync {
fn path_for(
@@ -330,6 +331,7 @@ impl JsExecutionEnvironment {
]
}
#[instrument(skip(self))]
async fn execute(
self,
procedure_name: ProcedureName,
@@ -371,7 +373,6 @@ impl JsExecutionEnvironment {
Ok(())
})
.build();
let loader = std::rc::Rc::new(self.module_loader.clone());
let runtime_options = RuntimeOptions {
module_loader: Some(loader),
@@ -395,7 +396,6 @@ impl JsExecutionEnvironment {
evaluated.await??;
Ok::<_, AnyError>(())
};
let answer = tokio::select! {
Some(x) = receive_answer.recv() => x,
_ = future => {