Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update deno dependences #692

Merged
merged 9 commits into from
Sep 9, 2023
Merged
124 changes: 24 additions & 100 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ readme = "README.md"
authors = ["Santiago Carmuega <[email protected]>"]

[features]
default = ["deno"]
deno = ["deno_runtime"]
sink-file-rotate = ["file-rotate"]
sink-webhook = ["reqwest"]
Expand Down Expand Up @@ -72,7 +71,6 @@ google-cloud-pubsub = { version = "0.16.0", optional = true }
google-cloud-googleapis = { version = "0.10.0", optional = true }
google-cloud-default = { version = "0.4.0", optional = true, features = ["pubsub"] }
r2d2_redis = { version = "0.14.0", optional = true }
deno_core = { version = "0.208.0", optional = true }
deno_runtime = { version = "0.126.0", optional = true }
jsonwebtoken = { version = "8.3.0", optional = true }
file-rotate = { version = "0.7.5", optional = true }
Expand Down
15 changes: 7 additions & 8 deletions src/filters/deno/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! A mapper with custom logic from using the Deno runtime

use deno_runtime::deno_core;
use deno_runtime::deno_core::{op, ModuleSpecifier, OpState};
use deno_runtime::deno_core::{self, op2, ModuleSpecifier, OpState};
use deno_runtime::permissions::PermissionsContainer;
use deno_runtime::worker::{MainWorker as DenoWorker, WorkerOptions};
use gasket::framework::*;
Expand All @@ -17,18 +16,18 @@ pub type WrappedRuntime = DenoWorker;

deno_core::extension!(deno_filter, ops = [op_pop_record, op_put_record]);

#[op]
fn op_pop_record(state: &mut OpState) -> Result<serde_json::Value, deno_core::error::AnyError> {
#[op2]
#[serde]
pub fn op_pop_record(state: &mut OpState) -> Result<serde_json::Value, deno_core::error::AnyError> {
let r: Record = state.take();
let j = serde_json::Value::from(r);

Ok(j)
}

#[op]
fn op_put_record(
#[op2]
pub fn op_put_record(
state: &mut OpState,
value: serde_json::Value,
#[serde] value: serde_json::Value,
) -> Result<(), deno_core::error::AnyError> {
match value {
serde_json::Value::Null => (),
Expand Down
3 changes: 1 addition & 2 deletions src/sinks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ use serde::Deserialize;

use crate::framework::*;

//pub mod assert;
mod assert;
mod common;
mod noop;
mod stdout;
mod terminal;
mod assert;

#[cfg(feature = "sink-file-rotate")]
mod file_rotate;
Expand Down
Loading