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

4
libs/Cargo.lock generated
View File

@@ -3008,9 +3008,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.91"
version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883"
checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76"
dependencies = [
"indexmap",
"itoa",

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 => {

View File

@@ -24,7 +24,7 @@ rand = "0.8"
regex = "1.7.1"
rpc-toolkit = "0.2.1"
serde = { version = "1.0", features = ["derive", "rc"] }
serde_json = "1.0.82"
serde_json = "1.0"
sqlx = { version = "0.6.0", features = [
"chrono",
"offline",