From 03021f7242bb4037faeb7bb9aa30b9b0ea6a8c41 Mon Sep 17 00:00:00 2001 From: Omar Zabala-Ferrera <73452461+ozabalaferrera@users.noreply.github.com> Date: Sat, 13 Jul 2024 23:40:55 -0400 Subject: [PATCH 1/3] Upgrade axum. Breaks docs. Signed-off-by: Omar Zabala-Ferrera <73452461+ozabalaferrera@users.noreply.github.com> --- Cargo.toml | 8 +++- src/binding/axum/extract.rs | 57 ++++++++++++++++------------- src/binding/axum/mod.rs | 10 +++-- src/binding/axum/response.rs | 22 ++++------- src/binding/http/builder/adapter.rs | 43 ++++++++++++++++++++++ src/binding/http/builder/mod.rs | 4 +- src/binding/http/deserializer.rs | 2 + src/binding/http/headers.rs | 2 + src/binding/http/mod.rs | 4 ++ src/binding/http/serializer.rs | 4 ++ src/message/mod.rs | 12 ++++++ 11 files changed, 123 insertions(+), 45 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bb72c950..84f15dca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ actix = ["actix-web", "actix-http", "async-trait", "bytes", "futures", "http"] reqwest = ["reqwest-lib", "async-trait", "bytes", "http", "uuid/js"] rdkafka = ["rdkafka-lib", "bytes", "futures"] warp = ["warp-lib", "bytes", "http", "hyper"] -axum = ["bytes", "http", "hyper", "axum-lib", "http-body", "async-trait"] +axum = ["bytes", "http-1-1", "hyper-1-3", "axum-lib-0-7", "http-body-1-0", "http-body-util", "async-trait"] poem = ["bytes", "http", "poem-lib", "hyper", "async-trait"] nats = ["nats-lib"] @@ -50,10 +50,15 @@ rdkafka-lib = { version = "^0.36", features = ["cmake-build"], optional = true, warp-lib = { version = "^0.3", optional = true, package = "warp" } async-trait = { version = "^0.1.33", optional = true } bytes = { version = "^1.0", optional = true } +# bytes-1-6 = { version = "^1.6", optional = true, package="bytes" } futures = { version = "^0.3", optional = true } http = { version = "0.2", optional = true } +http-1-1 = { version = "1.1", optional = true, package = "http"} axum-lib = { version = "^0.6", optional = true, package="axum"} +axum-lib-0-7 = { version = "^0.7", optional = true, package="axum"} http-body = { version = "^0.4", optional = true } +http-body-1-0 = { version = "^1.0", optional = true, package="http-body" } +http-body-util = {version = "^0.1", optional = true} poem-lib = { version = "=1.2.34", optional = true, package = "poem" } nats-lib = { version = "0.21.0", optional = true, package = "nats" } @@ -65,6 +70,7 @@ web-sys = { version = "^0.3", features = ["Window", "Location"] } [target.'cfg(not(target_os = "wasi"))'.dependencies] hyper = { version = "^0.14", optional = true } +hyper-1-3 = { version = "^1.3", optional = true, package="hyper" } [target.'cfg(all(target_arch = "wasm32", target_os = "wasi"))'.dependencies] hyper_wasi = { version = "0.15", features = ["full"], optional = true } diff --git a/src/binding/axum/extract.rs b/src/binding/axum/extract.rs index fd033794..ceb73839 100644 --- a/src/binding/axum/extract.rs +++ b/src/binding/axum/extract.rs @@ -1,45 +1,52 @@ -use axum_lib as axum; - use async_trait::async_trait; -use axum::extract::FromRequest; -use axum::http::Request; -use http::request::Parts; +use axum::body::Bytes; +use axum::extract::{FromRequest, Request}; +use axum::response::Response; +use axum_lib_0_7 as axum; use http::StatusCode; -use http_body::Body; -use hyper::body; +use http_1_1 as http; use crate::binding::http::to_event; use crate::event::Event; -type BoxError = Box; - #[async_trait] -impl FromRequest for Event +impl FromRequest for Event where - B: Body + Send + 'static, - B::Data: Send, - B::Error: Into, + Bytes: FromRequest, S: Send + Sync, { - type Rejection = (StatusCode, String); - - async fn from_request(req: Request, _state: &S) -> Result { - let (Parts { headers, .. }, req_body) = req.into_parts(); - let buf = body::to_bytes(req_body) - .await - .map_err(|e| (StatusCode::BAD_REQUEST, format!("{}", e.into())))? - .to_vec(); - - to_event(&headers, buf).map_err(|e| (StatusCode::BAD_REQUEST, format!("{}", e))) + type Rejection = Response; + + async fn from_request( + req: Request, + _state: &S, + ) -> Result { + let (parts, body) = req.into_parts(); + + let body = + axum::body::to_bytes(body, usize::MAX).await.map_err(|e| { + Response::builder() + .status(StatusCode::INTERNAL_SERVER_ERROR) + .body(axum::body::Body::from(e.to_string())) + .unwrap() + })?; + + to_event(&parts.headers, body.to_vec()).map_err(|e| { + Response::builder() + .status(StatusCode::BAD_REQUEST) + .body(axum::body::Body::from(e.to_string())) + .unwrap() + }) } } #[cfg(test)] mod tests { - use axum_lib as axum; + use axum_lib_0_7 as axum; use super::*; use axum::body::Body; + use axum::extract::FromRequest; use axum::http::{self, Request, StatusCode}; use crate::test::fixtures; @@ -80,7 +87,7 @@ mod tests { assert!(result.is_err()); let rejection = result.unwrap_err(); - let reason = rejection.0; + let reason = rejection.status(); assert_eq!(reason, StatusCode::BAD_REQUEST) } diff --git a/src/binding/axum/mod.rs b/src/binding/axum/mod.rs index cb7b8a35..6c9d7cab 100644 --- a/src/binding/axum/mod.rs +++ b/src/binding/axum/mod.rs @@ -6,13 +6,14 @@ //! To echo events: //! //! ``` -//! use axum_lib as axum; +//! # use axum_lib_0_7 as axum; //! use axum::{ //! routing::{get, post}, //! Router, //! }; //! use cloudevents::Event; //! use http::StatusCode; +//! # use http_1_1 as http; //! //! fn app() -> Router { //! Router::new() @@ -31,13 +32,14 @@ //! To create event inside request handlers and send them as responses: //! //! ``` -//! use axum_lib as axum; +//! # use axum_lib_0_7 as axum; //! use axum::{ //! routing::{get, post}, //! Router, //! }; //! use cloudevents::{Event, EventBuilder, EventBuilderV10}; //! use http::StatusCode; +//! # use http_1_1 as http; //! use serde_json::json; //! //! fn app() -> Router { @@ -77,7 +79,7 @@ pub mod response; #[cfg(test)] mod tests { - use axum_lib as axum; + use axum_lib_0_7 as axum; use axum::{ body::Body, @@ -155,7 +157,7 @@ mod tests { ); let (_, body) = resp.into_parts(); - let body = hyper::body::to_bytes(body).await.unwrap(); + let body = axum::body::to_bytes(body, usize::MAX).await.unwrap(); assert_eq!(j.to_string().as_bytes(), body); } diff --git a/src/binding/axum/response.rs b/src/binding/axum/response.rs index 3f4b9562..6a8efe64 100644 --- a/src/binding/axum/response.rs +++ b/src/binding/axum/response.rs @@ -1,27 +1,21 @@ -use axum_lib as axum; - -use axum::{ - body::{boxed, BoxBody}, - http::Response, - response::IntoResponse, -}; -use http::{header, StatusCode}; -use hyper::body::Body; - use crate::binding::http::builder::adapter::to_response; use crate::event::Event; +use axum::{body::Body, http::Response, response::IntoResponse}; +use axum_lib_0_7 as axum; +use http::{header, StatusCode}; +use http_1_1 as http; impl IntoResponse for Event { - fn into_response(self) -> Response { + fn into_response(self) -> Response { match to_response(self) { Ok(resp) => { let (parts, body) = resp.into_parts(); - Response::from_parts(parts, boxed(body)) + Response::from_parts(parts, Body::new(body)) } Err(err) => Response::builder() .status(StatusCode::INTERNAL_SERVER_ERROR) .header(header::CONTENT_TYPE, "text/plain") - .body(boxed(Body::from(err.to_string()))) + .body(Body::from(err.to_string())) .unwrap(), } } @@ -105,7 +99,7 @@ mod tests { ); let (_, body) = resp.into_parts(); - let body = hyper::body::to_bytes(body).await.unwrap(); + let body = axum::body::to_bytes(body, usize::MAX).await.unwrap(); assert_eq!(fixtures::json_data_binary(), body); } diff --git a/src/binding/http/builder/adapter.rs b/src/binding/http/builder/adapter.rs index afdd4977..2f58e614 100644 --- a/src/binding/http/builder/adapter.rs +++ b/src/binding/http/builder/adapter.rs @@ -1,15 +1,27 @@ +#[cfg(feature = "axum")] +use bytes::Bytes; use http::Response; +#[cfg(feature = "axum")] +use http_1_1 as http; +#[cfg(feature = "axum")] +use http_body_util::Full; +#[cfg(not(feature = "axum"))] use hyper::body::Body; use std::cell::Cell; use crate::binding::http::{Builder, Serializer}; use crate::message::{BinaryDeserializer, Error, Result}; use crate::Event; +#[cfg(feature = "axum")] +use std::convert::Infallible; +#[cfg(feature = "axum")] +type BoxBody = http_body_util::combinators::UnsyncBoxBody; struct Adapter { builder: Cell, } +#[cfg(not(feature = "axum"))] impl Builder> for Adapter { fn header(&mut self, key: &str, value: http::header::HeaderValue) { self.builder.set(self.builder.take().header(key, value)); @@ -27,6 +39,27 @@ impl Builder> for Adapter { } } +#[cfg(feature = "axum")] +impl Builder> for Adapter { + fn header(&mut self, key: &str, value: http::header::HeaderValue) { + self.builder.set(self.builder.take().header(key, value)); + } + + fn body(&mut self, bytes: Vec) -> Result> { + self.builder + .take() + .body(BoxBody::new(Full::from(bytes))) + .map_err(|e| crate::message::Error::Other { + source: Box::new(e), + }) + } + + fn finish(&mut self) -> Result> { + self.body(Vec::new()) + } +} + +#[cfg(not(feature = "axum"))] pub fn to_response(event: Event) -> std::result::Result, Error> { BinaryDeserializer::deserialize_binary( event, @@ -35,3 +68,13 @@ pub fn to_response(event: Event) -> std::result::Result, Error> { }), ) } + +#[cfg(feature = "axum")] +pub fn to_response(event: Event) -> std::result::Result, Error> { + BinaryDeserializer::deserialize_binary( + event, + Serializer::new(Adapter { + builder: Cell::new(http::Response::builder()), + }), + ) +} diff --git a/src/binding/http/builder/mod.rs b/src/binding/http/builder/mod.rs index 81b63813..acd145ef 100644 --- a/src/binding/http/builder/mod.rs +++ b/src/binding/http/builder/mod.rs @@ -1,7 +1,9 @@ -#[cfg(feature = "hyper")] +#[cfg(any(feature = "hyper", feature = "hyper-1-3"))] pub mod adapter; use crate::message::Result; +#[cfg(feature = "axum")] +use http_1_1 as http; pub trait Builder { fn header(&mut self, key: &str, value: http::header::HeaderValue); diff --git a/src/binding/http/deserializer.rs b/src/binding/http/deserializer.rs index 21a1c809..a8e2223a 100644 --- a/src/binding/http/deserializer.rs +++ b/src/binding/http/deserializer.rs @@ -8,6 +8,8 @@ use crate::{ Result, StructuredDeserializer, StructuredSerializer, }, }; +#[cfg(feature = "axum")] +use http_1_1 as http; use std::convert::TryFrom; pub struct Deserializer<'a, T: Headers<'a>> { diff --git a/src/binding/http/headers.rs b/src/binding/http/headers.rs index a129d87e..8b2816d7 100644 --- a/src/binding/http/headers.rs +++ b/src/binding/http/headers.rs @@ -1,4 +1,6 @@ use http::header::{AsHeaderName, HeaderMap, HeaderName, HeaderValue}; +#[cfg(feature = "axum")] +use http_1_1 as http; /// Any http library should be able to use the /// [`to_event`](super::to_event) function with an implementation of diff --git a/src/binding/http/mod.rs b/src/binding/http/mod.rs index 52b0e03e..a459920a 100644 --- a/src/binding/http/mod.rs +++ b/src/binding/http/mod.rs @@ -13,6 +13,8 @@ mod serializer; pub use builder::Builder; use core::convert::TryFrom; use http::Response; +#[cfg(feature = "axum")] +use http_1_1 as http; pub use serializer::Serializer; use std::convert::TryInto; use std::fmt::Debug; @@ -52,6 +54,8 @@ mod tests { use crate::Event; use core::convert::TryFrom; use http::Response; + #[cfg(feature = "axum")] + use http_1_1 as http; #[test] fn test_response_to_event() { diff --git a/src/binding/http/serializer.rs b/src/binding/http/serializer.rs index 30ca8e11..4f38cf8d 100644 --- a/src/binding/http/serializer.rs +++ b/src/binding/http/serializer.rs @@ -12,6 +12,8 @@ use crate::message::{ }; use crate::Event; use http::Request; +#[cfg(feature = "axum")] +use http_1_1 as http; use std::convert::TryFrom; use std::fmt::Debug; @@ -131,6 +133,8 @@ mod tests { use crate::test::fixtures; use bytes::Bytes; use http::Request; + #[cfg(feature = "axum")] + use http_1_1 as http; use std::convert::TryFrom; #[test] diff --git a/src/message/mod.rs b/src/message/mod.rs index 14660574..4cd9bb49 100644 --- a/src/message/mod.rs +++ b/src/message/mod.rs @@ -2,6 +2,18 @@ //! //! Note: these APIs should be considered unstable and subject to changes. +#[cfg(all( + feature = "axum", + any( + feature = "http-binding", + feature = "actix", + feature = "reqwest", + feature = "warp", + feature = "poem" + ) +))] +compile_error!("feature `axum` cannot be used with features `http-binding`, `actix`, `reqwest`, `warp`, or `poem`"); + mod deserializer; mod encoding; mod error; From e8f71dc5419a5969c767756723c23729fc8027ea Mon Sep 17 00:00:00 2001 From: Omar Zabala-Ferrera <73452461+ozabalaferrera@users.noreply.github.com> Date: Sun, 14 Jul 2024 23:02:42 -0400 Subject: [PATCH 2/3] Upgrade several dependencies. delegate-attr, base64, snafu, bitflags, hostname, and serde_yaml. Signed-off-by: Omar Zabala-Ferrera <73452461+ozabalaferrera@users.noreply.github.com> --- .github/workflows/rust_tests.yml | 4 +- Cargo.toml | 55 +- README.md | 2 +- example-projects/actix-web-example/Cargo.toml | 4 +- example-projects/axum-example/Cargo.toml | 10 +- example-projects/axum-example/src/main.rs | 9 +- example-projects/nats-example/Cargo.toml | 2 +- example-projects/poem-example/Cargo.toml | 4 +- .../reqwest-wasm-example/Cargo.toml | 2 +- .../reqwest-wasm-example/package-lock.json | 961 +++++++++--------- .../reqwest-wasm-example/package.json | 2 +- example-projects/wasi-example/Cargo.toml | 4 +- example-projects/wasi-example/src/main.rs | 12 +- src/binding/actix/server_request.rs | 3 +- src/binding/actix/server_response.rs | 3 +- src/binding/axum/extract.rs | 24 +- src/binding/axum/mod.rs | 8 +- src/binding/axum/response.rs | 4 +- src/binding/http/builder/adapter.rs | 38 - src/binding/http/builder/mod.rs | 6 +- src/binding/http/deserializer.rs | 4 +- src/binding/http/headers.rs | 4 +- src/binding/http/mod.rs | 8 +- src/binding/http/serializer.rs | 8 +- src/binding/http_0_2/builder/adapter.rs | 44 + src/binding/http_0_2/builder/mod.rs | 11 + src/binding/http_0_2/deserializer.rs | 101 ++ src/binding/http_0_2/headers.rs | 22 + src/binding/http_0_2/mod.rs | 73 ++ src/binding/http_0_2/serializer.rs | 159 +++ src/binding/mod.rs | 12 +- src/binding/poem/extractor.rs | 10 +- src/binding/poem/response.rs | 31 +- src/binding/reqwest/client_request.rs | 11 +- src/binding/reqwest/client_response.rs | 10 +- src/binding/warp/filter.rs | 2 +- src/binding/warp/mod.rs | 1 + src/binding/warp/reply.rs | 6 +- src/event/format.rs | 5 +- src/event/mod.rs | 35 +- src/event/v03/attributes.rs | 9 +- src/event/v03/format.rs | 3 +- src/event/v10/attributes.rs | 8 +- src/event/v10/format.rs | 5 +- src/lib.rs | 2 +- src/message/mod.rs | 12 - src/message/types.rs | 9 +- src/test/fixtures/mod.rs | 2 +- src/test/fixtures/v03.rs | 5 +- src/test/fixtures/v10.rs | 13 +- 50 files changed, 1081 insertions(+), 701 deletions(-) create mode 100644 src/binding/http_0_2/builder/adapter.rs create mode 100644 src/binding/http_0_2/builder/mod.rs create mode 100644 src/binding/http_0_2/deserializer.rs create mode 100644 src/binding/http_0_2/headers.rs create mode 100644 src/binding/http_0_2/mod.rs create mode 100644 src/binding/http_0_2/serializer.rs diff --git a/.github/workflows/rust_tests.yml b/.github/workflows/rust_tests.yml index de8bd8f2..128ca0ee 100644 --- a/.github/workflows/rust_tests.yml +++ b/.github/workflows/rust_tests.yml @@ -104,14 +104,14 @@ jobs: with: command: build toolchain: ${{ matrix.toolchain }} - args: --target ${{ matrix.target }} --features "http-binding hyper hyper_wasi" + args: --target ${{ matrix.target }} --features "http-0-2-binding hyper-0-14 hyper_wasi" - uses: actions-rs/cargo@v1 name: "Test" if: matrix.target == 'wasm32-wasi' with: command: test toolchain: ${{ matrix.toolchain }} - args: --target ${{ matrix.target }} --features "http-binding hyper hyper_wasi" + args: --target ${{ matrix.target }} --features "http-0-2-binding hyper-0-14 hyper_wasi" env: CARGO_TARGET_WASM32_WASI_RUNNER: wasmedge # Build examples diff --git a/Cargo.toml b/Cargo.toml index 84f15dca..008e1108 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cloudevents-sdk" -version = "0.7.0" +version = "0.8.0" authors = ["Francesco Guardiani "] license-file = "LICENSE" edition = "2018" @@ -23,63 +23,60 @@ name = "cloudevents" [features] http-binding = ["async-trait", "bytes", "futures", "http"] -actix = ["actix-web", "actix-http", "async-trait", "bytes", "futures", "http"] +http-0-2-binding = ["async-trait", "bytes", "futures", "http-0-2"] +actix = ["actix-web", "actix-http", "async-trait", "bytes", "futures", "http-0-2"] reqwest = ["reqwest-lib", "async-trait", "bytes", "http", "uuid/js"] rdkafka = ["rdkafka-lib", "bytes", "futures"] -warp = ["warp-lib", "bytes", "http", "hyper"] -axum = ["bytes", "http-1-1", "hyper-1-3", "axum-lib-0-7", "http-body-1-0", "http-body-util", "async-trait"] -poem = ["bytes", "http", "poem-lib", "hyper", "async-trait"] +warp = ["warp-lib", "bytes", "http-0-2", "http-body-util", "hyper-0-14"] +axum = ["bytes", "http", "hyper", "axum-lib", "http-body-util", "async-trait"] +poem = ["bytes", "http", "poem-lib", "hyper", "async-trait", "http-body-util", "futures"] nats = ["nats-lib"] [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" chrono = { version = "^0.4", features = ["serde"] } -delegate-attr = "^0.2" -base64 = "^0.12" -url = { version = "^2.1", features = ["serde"] } -snafu = "^0.6" -bitflags = "^1.2" +delegate-attr = "^0.3" +base64 = "^0.22" +url = { version = "^2.5", features = ["serde"] } +snafu = "^0.8" +bitflags = "^2.6" uuid = { version = "1", features = ["v4"] } # runtime optional deps actix-web = { version = "4", optional = true } actix-http = { version = "3", optional = true } -reqwest-lib = { version = "^0.11", default-features = false, features = ["rustls-tls"], optional = true, package = "reqwest" } +reqwest-lib = { version = "^0.12", default-features = false, features = ["rustls-tls"], optional = true, package = "reqwest" } rdkafka-lib = { version = "^0.36", features = ["cmake-build"], optional = true, package = "rdkafka" } warp-lib = { version = "^0.3", optional = true, package = "warp" } -async-trait = { version = "^0.1.33", optional = true } +async-trait = { version = "^0.1", optional = true } bytes = { version = "^1.0", optional = true } -# bytes-1-6 = { version = "^1.6", optional = true, package="bytes" } -futures = { version = "^0.3", optional = true } -http = { version = "0.2", optional = true } -http-1-1 = { version = "1.1", optional = true, package = "http"} -axum-lib = { version = "^0.6", optional = true, package="axum"} -axum-lib-0-7 = { version = "^0.7", optional = true, package="axum"} -http-body = { version = "^0.4", optional = true } -http-body-1-0 = { version = "^1.0", optional = true, package="http-body" } +futures = { version = "^0.3", optional = true, features = ["compat"]} +http = { version = "1.1", optional = true} +http-0-2 = { version = "0.2", optional = true, package = "http"} +axum-lib = { version = "^0.7", optional = true, package="axum"} http-body-util = {version = "^0.1", optional = true} -poem-lib = { version = "=1.2.34", optional = true, package = "poem" } -nats-lib = { version = "0.21.0", optional = true, package = "nats" } +poem-lib = { version = "^3.1", optional = true, package = "poem" } +nats-lib = { version = "0.25.0", optional = true, package = "nats" } [target."cfg(not(target_arch = \"wasm32\"))".dependencies] -hostname = "^0.3" +hostname = "^0.4" [target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies] web-sys = { version = "^0.3", features = ["Window", "Location"] } [target.'cfg(not(target_os = "wasi"))'.dependencies] -hyper = { version = "^0.14", optional = true } -hyper-1-3 = { version = "^1.3", optional = true, package="hyper" } +hyper = { version = "^1.4", optional = true, package="hyper" } +hyper-0-14 = { version = "^0.14", optional = true, package = "hyper"} [target.'cfg(all(target_arch = "wasm32", target_os = "wasi"))'.dependencies] hyper_wasi = { version = "0.15", features = ["full"], optional = true } [dev-dependencies] -rstest = "0.6" +rstest = "0.23" claims = "0.7.1" version-sync = "0.9.2" -serde_yaml = "0.8" +serde_yaml = "^0.9" rmp-serde = "1" # runtime dev-deps @@ -87,14 +84,14 @@ rmp-serde = "1" url = { version = "^2.1", features = ["serde"] } serde_json = { version = "^1.0" } chrono = { version = "^0.4", features = ["serde"] } -mockito = "0.25.1" +mockito = "0.31.1" mime = "0.3" [target.'cfg(not(target_os = "wasi"))'.dev-dependencies] actix-rt = { version = "^2" } tokio = { version = "^1.0", features = ["full"] } -tower = { version = "0.4", features = ["util"] } +tower = { version = "0.5", features = ["util"] } [target.'cfg(all(target_arch = "wasm32", target_os = "wasi"))'.dev-dependencies] tokio_wasi = { version = "1", features = [ diff --git a/README.md b/README.md index 904163f2..3c8d06f0 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ enabling your Protocol Binding of choice: ```toml [dependencies] -cloudevents-sdk = { version = "0.7.0" } +cloudevents-sdk = { version = "0.8.0" } ``` Now you can start creating events: diff --git a/example-projects/actix-web-example/Cargo.toml b/example-projects/actix-web-example/Cargo.toml index 7d65f903..99af967c 100644 --- a/example-projects/actix-web-example/Cargo.toml +++ b/example-projects/actix-web-example/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] cloudevents-sdk = { path = "../..", features = ["actix"] } actix-web = "4" -actix-cors = "0.6.0-beta.8" +actix-cors = "^0.7" serde_json = "^1.0" url = { version = "^2.1" } -env_logger = "0.7.1" +env_logger = "^0.11" diff --git a/example-projects/axum-example/Cargo.toml b/example-projects/axum-example/Cargo.toml index a369f240..c1dc625e 100644 --- a/example-projects/axum-example/Cargo.toml +++ b/example-projects/axum-example/Cargo.toml @@ -6,16 +6,16 @@ edition = "2021" [dependencies] cloudevents-sdk = { path = "../..", features = ["axum"] } -axum = "^0.6" -http = "^0.2" +axum = "^0.7" +http = "^1.1" tokio = { version = "^1", features = ["full"] } tracing = "^0.1" -tracing-subscriber = "^0.2" -tower-http = { version = "^0.1", features = ["trace"] } +tracing-subscriber = "^0.3" +tower-http = { version = "^0.5", features = ["trace"] } [dev-dependencies] tower = { version = "^0.4", features = ["util"] } serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" chrono = { version = "^0.4", features = ["serde"] } -hyper = { version = "^0.14" } +hyper = { version = "^1.4" } diff --git a/example-projects/axum-example/src/main.rs b/example-projects/axum-example/src/main.rs index 27a7b9a6..0c0c229e 100644 --- a/example-projects/axum-example/src/main.rs +++ b/example-projects/axum-example/src/main.rs @@ -4,7 +4,6 @@ use axum::{ }; use cloudevents::Event; use http::StatusCode; -use std::net::SocketAddr; use tower_http::trace::TraceLayer; fn echo_app() -> Router { @@ -27,12 +26,8 @@ async fn main() { } tracing_subscriber::fmt::init(); let service = echo_app(); - let addr = SocketAddr::from(([127, 0, 0, 1], 8080)); - tracing::debug!("listening on {}", addr); - axum::Server::bind(&addr) - .serve(service.into_make_service()) - .await - .unwrap(); + let listener = tokio::net::TcpListener::bind("0.0.0.0:8080").await.unwrap(); + axum::serve(listener, service).await.unwrap(); } #[cfg(test)] diff --git a/example-projects/nats-example/Cargo.toml b/example-projects/nats-example/Cargo.toml index c038d779..cdf4ed72 100644 --- a/example-projects/nats-example/Cargo.toml +++ b/example-projects/nats-example/Cargo.toml @@ -9,4 +9,4 @@ edition = "2021" [dependencies] cloudevents-sdk = { path = "../..", features = ["nats"] } serde_json = "^1.0" -nats = "0.21.0" \ No newline at end of file +nats = "^0.25" \ No newline at end of file diff --git a/example-projects/poem-example/Cargo.toml b/example-projects/poem-example/Cargo.toml index da367296..7b7acf49 100644 --- a/example-projects/poem-example/Cargo.toml +++ b/example-projects/poem-example/Cargo.toml @@ -7,8 +7,8 @@ edition = "2021" cloudevents-sdk = { path = "../..", features = ["poem"] } tokio = { version = "1.13", features = ["macros", "rt-multi-thread"] } tracing = "0.1" -poem = { version = "1" } -tracing-subscriber = "0.2" +poem = { version = "^3.0" } +tracing-subscriber = "0.3" serde_json = "1.0" [dev-dependencies] diff --git a/example-projects/reqwest-wasm-example/Cargo.toml b/example-projects/reqwest-wasm-example/Cargo.toml index b35fb037..1be202c9 100644 --- a/example-projects/reqwest-wasm-example/Cargo.toml +++ b/example-projects/reqwest-wasm-example/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" crate-type = ["cdylib"] [dependencies] -reqwest = "^0.11" +reqwest = "^0.12" uuid = "1" cloudevents-sdk = { path = "../..", features = ["reqwest"] } url = { version = "^2.1" } diff --git a/example-projects/reqwest-wasm-example/package-lock.json b/example-projects/reqwest-wasm-example/package-lock.json index e0e9a8a7..f439e8ea 100644 --- a/example-projects/reqwest-wasm-example/package-lock.json +++ b/example-projects/reqwest-wasm-example/package-lock.json @@ -15,7 +15,7 @@ "html-webpack-plugin": "^5.5.0", "style-loader": "^2.0.0", "text-encoding": "^0.7.0", - "webpack": "^5.76.0", + "webpack": "^5.95.0", "webpack-cli": "^4.8.0", "webpack-dev-server": "^5.0.4" } @@ -47,14 +47,14 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -70,22 +70,22 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { @@ -95,13 +95,13 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@leichtgewicht/ip-codec": { @@ -167,30 +167,10 @@ "@types/node": "*" } }, - "node_modules/@types/eslint": { - "version": "8.4.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.10.tgz", - "integrity": "sha512-Sl/HOqN8NKPmhWo2VBEPm0nvHnu2LL3v9vKo8MEq0EtbJ4eVzGPl41VNPvn5E1i5poMk4/XD8UriLHpJvEP/Nw==", - "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", - "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", - "dev": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { - "version": "0.0.51", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", - "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "node_modules/@types/express": { @@ -344,148 +324,148 @@ } }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", - "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dev": true, "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" } }, "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", - "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", "dev": true }, "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", - "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", "dev": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", - "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", "dev": true }, "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", - "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", "dev": true, "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", - "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", "dev": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", - "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.12.1" } }, "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", - "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", "dev": true, "dependencies": { "@xtuc/ieee754": "^1.2.0" } }, "node_modules/@webassemblyjs/leb128": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", - "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", "dev": true, "dependencies": { "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/utf8": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", - "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", "dev": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", - "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/helper-wasm-section": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-opt": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", - "@webassemblyjs/wast-printer": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", - "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", - "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", - "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", - "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -551,9 +531,9 @@ } }, "node_modules/acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -562,10 +542,10 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peerDependencies": { "acorn": "^8" @@ -868,9 +848,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, "dependencies": { "bytes": "3.1.2", @@ -881,7 +861,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -959,9 +939,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", - "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", + "version": "4.24.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", + "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", "dev": true, "funding": [ { @@ -971,13 +951,17 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "caniuse-lite": "^1.0.30001400", - "electron-to-chromium": "^1.4.251", - "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.9" + "caniuse-lite": "^1.0.30001669", + "electron-to-chromium": "^1.5.41", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" @@ -1067,9 +1051,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001441", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz", - "integrity": "sha512-OyxRR4Vof59I3yGWXws6i908EtGbMzVUi3ganaZQHmydk1iwDhRnvaPG2WaR0KcqrDFKrxVZHULT396LEPhXfg==", + "version": "1.0.30001675", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001675.tgz", + "integrity": "sha512-/wV1bQwPrkLiQMjaJF5yUMVM/VdRPOCU8QZ+PmG6uW6DvYSrNY1bpwHI/3mOcUosLaJCzYDi5o91IQB51ft6cg==", "dev": true, "funding": [ { @@ -1079,6 +1063,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ] }, @@ -1331,9 +1319,9 @@ } }, "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", "dev": true, "engines": { "node": ">= 0.6" @@ -1710,9 +1698,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.284", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz", - "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==", + "version": "1.5.49", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.49.tgz", + "integrity": "sha512-ZXfs1Of8fDb6z7WEYZjXpgIRF6MEu8JdeGA0A40aZq6OQbS+eJpnnV49epZRna2DU/YsEjSQuGtQPPtvt6J65A==", "dev": true }, "node_modules/emoji-regex": { @@ -1731,18 +1719,18 @@ } }, "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "dev": true, "engines": { "node": ">= 0.8" } }, "node_modules/enhanced-resolve": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", - "integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -1795,15 +1783,15 @@ } }, "node_modules/es-module-lexer": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", - "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", "dev": true }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "engines": { "node": ">=6" @@ -1960,37 +1948,37 @@ } }, "node_modules/express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "dev": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -2209,13 +2197,13 @@ } }, "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dev": true, "dependencies": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -2454,9 +2442,9 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "node_modules/handle-thing": { @@ -3371,10 +3359,13 @@ } }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", - "dev": true + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/merge-stream": { "version": "2.0.0", @@ -3721,9 +3712,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.8.tgz", - "integrity": "sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==", + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", "dev": true }, "node_modules/normalize-path": { @@ -3801,10 +3792,13 @@ } }, "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", "dev": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4054,15 +4048,15 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", "dev": true }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, "node_modules/picomatch": { @@ -4244,12 +4238,12 @@ } }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dev": true, "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -4552,9 +4546,9 @@ "dev": true }, "node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.8", @@ -4604,9 +4598,9 @@ } }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, "dependencies": { "debug": "2.6.9", @@ -4636,6 +4630,15 @@ "node": ">= 0.8" } }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -4652,9 +4655,9 @@ } }, "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "dependencies": { "randombytes": "^2.1.0" @@ -4706,15 +4709,15 @@ "dev": true }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dev": true, "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" @@ -5344,13 +5347,13 @@ } }, "node_modules/terser": { - "version": "5.16.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz", - "integrity": "sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==", + "version": "5.36.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", + "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", "dev": true, "dependencies": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -5362,16 +5365,16 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz", - "integrity": "sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ==", + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.14", + "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.0", - "terser": "^5.14.1" + "serialize-javascript": "^6.0.1", + "terser": "^5.26.0" }, "engines": { "node": ">= 10.13.0" @@ -5585,9 +5588,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", + "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", "dev": true, "funding": [ { @@ -5597,14 +5600,18 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.2.0", + "picocolors": "^1.1.0" }, "bin": { - "browserslist-lint": "cli.js" + "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" @@ -5936,34 +5943,33 @@ } }, "node_modules/webpack": { - "version": "5.76.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.0.tgz", - "integrity": "sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA==", + "version": "5.95.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", + "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", "dev": true, "dependencies": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^0.0.51", - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/wasm-edit": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.7.6", - "browserslist": "^4.14.5", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.10.0", - "es-module-lexer": "^0.9.0", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.0", + "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.1.3", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { @@ -6500,14 +6506,14 @@ } }, "@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "requires": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" } }, "@jridgewell/resolve-uri": { @@ -6517,19 +6523,19 @@ "dev": true }, "@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true }, "@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "requires": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "@jridgewell/sourcemap-codec": { @@ -6539,13 +6545,13 @@ "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@leichtgewicht/ip-codec": { @@ -6604,30 +6610,10 @@ "@types/node": "*" } }, - "@types/eslint": { - "version": "8.4.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.10.tgz", - "integrity": "sha512-Sl/HOqN8NKPmhWo2VBEPm0nvHnu2LL3v9vKo8MEq0EtbJ4eVzGPl41VNPvn5E1i5poMk4/XD8UriLHpJvEP/Nw==", - "dev": true, - "requires": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "@types/eslint-scope": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", - "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", - "dev": true, - "requires": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "@types/estree": { - "version": "0.0.51", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", - "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "@types/express": { @@ -6781,148 +6767,148 @@ } }, "@webassemblyjs/ast": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", - "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dev": true, "requires": { - "@webassemblyjs/helper-numbers": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" } }, "@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", - "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", "dev": true }, "@webassemblyjs/helper-api-error": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", - "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", "dev": true }, "@webassemblyjs/helper-buffer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", - "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", "dev": true }, "@webassemblyjs/helper-numbers": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", - "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", "dev": true, "requires": { - "@webassemblyjs/floating-point-hex-parser": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", "@xtuc/long": "4.2.2" } }, "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", - "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", "dev": true }, "@webassemblyjs/helper-wasm-section": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", - "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.12.1" } }, "@webassemblyjs/ieee754": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", - "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", "dev": true, "requires": { "@xtuc/ieee754": "^1.2.0" } }, "@webassemblyjs/leb128": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", - "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", "dev": true, "requires": { "@xtuc/long": "4.2.2" } }, "@webassemblyjs/utf8": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", - "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", "dev": true }, "@webassemblyjs/wasm-edit": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", - "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/helper-wasm-section": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-opt": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", - "@webassemblyjs/wast-printer": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "@webassemblyjs/wasm-gen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", - "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "@webassemblyjs/wasm-opt": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", - "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "@webassemblyjs/wasm-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", - "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "@webassemblyjs/wast-printer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", - "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -6972,15 +6958,15 @@ } }, "acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true }, - "acorn-import-assertions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "requires": {} }, @@ -7207,9 +7193,9 @@ } }, "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, "requires": { "bytes": "3.1.2", @@ -7220,7 +7206,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -7281,15 +7267,15 @@ } }, "browserslist": { - "version": "4.21.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", - "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", + "version": "4.24.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", + "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001400", - "electron-to-chromium": "^1.4.251", - "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.9" + "caniuse-lite": "^1.0.30001669", + "electron-to-chromium": "^1.5.41", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.1" } }, "buffer-from": { @@ -7355,9 +7341,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001441", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz", - "integrity": "sha512-OyxRR4Vof59I3yGWXws6i908EtGbMzVUi3ganaZQHmydk1iwDhRnvaPG2WaR0KcqrDFKrxVZHULT396LEPhXfg==", + "version": "1.0.30001675", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001675.tgz", + "integrity": "sha512-/wV1bQwPrkLiQMjaJF5yUMVM/VdRPOCU8QZ+PmG6uW6DvYSrNY1bpwHI/3mOcUosLaJCzYDi5o91IQB51ft6cg==", "dev": true }, "chalk": { @@ -7551,9 +7537,9 @@ "dev": true }, "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", "dev": true }, "cookie-signature": { @@ -7828,9 +7814,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.4.284", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz", - "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==", + "version": "1.5.49", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.49.tgz", + "integrity": "sha512-ZXfs1Of8fDb6z7WEYZjXpgIRF6MEu8JdeGA0A40aZq6OQbS+eJpnnV49epZRna2DU/YsEjSQuGtQPPtvt6J65A==", "dev": true }, "emoji-regex": { @@ -7846,15 +7832,15 @@ "dev": true }, "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "dev": true }, "enhanced-resolve": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", - "integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "requires": { "graceful-fs": "^4.2.4", @@ -7889,15 +7875,15 @@ "dev": true }, "es-module-lexer": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", - "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", "dev": true }, "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true }, "escape-html": { @@ -8019,37 +8005,37 @@ } }, "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "dev": true, "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -8221,13 +8207,13 @@ } }, "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dev": true, "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -8383,9 +8369,9 @@ } }, "graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "handle-thing": { @@ -9045,9 +9031,9 @@ } }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", "dev": true }, "merge-stream": { @@ -9324,9 +9310,9 @@ "dev": true }, "node-releases": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.8.tgz", - "integrity": "sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==", + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", "dev": true }, "normalize-path": { @@ -9388,9 +9374,9 @@ } }, "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", "dev": true }, "object-visit": { @@ -9574,15 +9560,15 @@ } }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", "dev": true }, "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, "picomatch": { @@ -9703,12 +9689,12 @@ "dev": true }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dev": true, "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "randombytes": { @@ -9942,9 +9928,9 @@ "dev": true }, "schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, "requires": { "@types/json-schema": "^7.0.8", @@ -9978,9 +9964,9 @@ } }, "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, "requires": { "debug": "2.6.9", @@ -10004,6 +9990,12 @@ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -10019,9 +10011,9 @@ } }, "serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -10069,15 +10061,15 @@ } }, "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dev": true, "requires": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" } }, "set-function-length": { @@ -10576,13 +10568,13 @@ "dev": true }, "terser": { - "version": "5.16.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz", - "integrity": "sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==", + "version": "5.36.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", + "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", "dev": true, "requires": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -10596,16 +10588,16 @@ } }, "terser-webpack-plugin": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz", - "integrity": "sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ==", + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", "dev": true, "requires": { - "@jridgewell/trace-mapping": "^0.3.14", + "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.0", - "terser": "^5.14.1" + "serialize-javascript": "^6.0.1", + "terser": "^5.26.0" } }, "text-encoding": { @@ -10757,13 +10749,13 @@ "optional": true }, "update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", + "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", "dev": true, "requires": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.2.0", + "picocolors": "^1.1.0" } }, "uri-js": { @@ -11039,34 +11031,33 @@ } }, "webpack": { - "version": "5.76.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.0.tgz", - "integrity": "sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA==", + "version": "5.95.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", + "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", "dev": true, "requires": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^0.0.51", - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/wasm-edit": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.7.6", - "browserslist": "^4.14.5", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.10.0", - "es-module-lexer": "^0.9.0", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.0", + "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.1.3", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "dependencies": { diff --git a/example-projects/reqwest-wasm-example/package.json b/example-projects/reqwest-wasm-example/package.json index 000e1e93..db37b473 100644 --- a/example-projects/reqwest-wasm-example/package.json +++ b/example-projects/reqwest-wasm-example/package.json @@ -9,7 +9,7 @@ "html-webpack-plugin": "^5.5.0", "style-loader": "^2.0.0", "text-encoding": "^0.7.0", - "webpack": "^5.76.0", + "webpack": "^5.95.0", "webpack-cli": "^4.8.0", "webpack-dev-server": "^5.0.4" }, diff --git a/example-projects/wasi-example/Cargo.toml b/example-projects/wasi-example/Cargo.toml index 91e863cf..5adf096a 100644 --- a/example-projects/wasi-example/Cargo.toml +++ b/example-projects/wasi-example/Cargo.toml @@ -5,11 +5,11 @@ edition = "2021" [dependencies] anyhow = "1.0" -cloudevents-sdk = { path = "../..", features = ["http-binding", "hyper_wasi", "hyper" ] } +cloudevents-sdk = { path = "../..", features = ["http-0-2-binding", "hyper_wasi", "hyper-0-14" ] } hyper_wasi = { version = "0.15", features = ["full"] } log = "0.4.21" tokio_wasi = { version = "1", features = ["io-util", "fs", "net", "time", "rt", "macros"] } -serde_json = " 1.0.116" +serde_json = "^1.0" [dev-dependencies] bytes = "1.6.0" diff --git a/example-projects/wasi-example/src/main.rs b/example-projects/wasi-example/src/main.rs index 6e3fbdfa..09ec48d8 100644 --- a/example-projects/wasi-example/src/main.rs +++ b/example-projects/wasi-example/src/main.rs @@ -1,5 +1,5 @@ -use cloudevents::binding::http::builder::adapter::to_response; -use cloudevents::binding::http::to_event; +use cloudevents::binding::http_0_2::builder::adapter::to_response; +use cloudevents::binding::http_0_2::to_event; use hyper::service::{make_service_fn, service_fn}; use hyper::Server; @@ -23,7 +23,9 @@ async fn main() -> Result<(), Box> { } Ok(()) } -async fn handle_request(req: Request) -> Result, anyhow::Error> { +async fn handle_request( + req: Request, +) -> Result, anyhow::Error> { match (req.method(), req.uri().path()) { (&Method::POST, "/") => { let headers = req.headers().clone(); @@ -34,7 +36,9 @@ async fn handle_request(req: Request) -> Result, anyhow::Er to_response(_respevt).map_err(|err| err.into()) } - (&Method::GET, "/health/readiness") => Ok(Response::new(Body::from(""))), + (&Method::GET, "/health/readiness") => { + Ok(Response::new(Body::from(""))) + } (&Method::GET, "/health/liveness") => Ok(Response::new(Body::from(""))), _ => { let mut not_found = Response::default(); diff --git a/src/binding/actix/server_request.rs b/src/binding/actix/server_request.rs index 67f4b128..60e168c2 100644 --- a/src/binding/actix/server_request.rs +++ b/src/binding/actix/server_request.rs @@ -1,4 +1,4 @@ -use crate::binding::http::{to_event, Headers}; +use crate::binding::http_0_2::{to_event, Headers}; use crate::Event; use actix_web::dev::Payload; use actix_web::web::BytesMut; @@ -6,6 +6,7 @@ use actix_web::{web, HttpRequest}; use async_trait::async_trait; use futures::{future::LocalBoxFuture, FutureExt, StreamExt}; use http::header::{AsHeaderName, HeaderName, HeaderValue}; +use http_0_2 as http; /// Implement Headers for the actix HeaderMap impl<'a> Headers<'a> for actix_http::header::HeaderMap { diff --git a/src/binding/actix/server_response.rs b/src/binding/actix/server_response.rs index 9f7a36c2..11c30930 100644 --- a/src/binding/actix/server_response.rs +++ b/src/binding/actix/server_response.rs @@ -1,8 +1,9 @@ -use crate::binding::http::{Builder, Serializer}; +use crate::binding::http_0_2::{Builder, Serializer}; use crate::message::{BinaryDeserializer, Result}; use crate::Event; use actix_web::http::StatusCode; use actix_web::{HttpRequest, HttpResponse, HttpResponseBuilder}; +use http_0_2 as http; impl Builder for HttpResponseBuilder { fn header(&mut self, key: &str, value: http::header::HeaderValue) { diff --git a/src/binding/axum/extract.rs b/src/binding/axum/extract.rs index ceb73839..549df0a4 100644 --- a/src/binding/axum/extract.rs +++ b/src/binding/axum/extract.rs @@ -2,9 +2,9 @@ use async_trait::async_trait; use axum::body::Bytes; use axum::extract::{FromRequest, Request}; use axum::response::Response; -use axum_lib_0_7 as axum; +use axum_lib as axum; +use http; use http::StatusCode; -use http_1_1 as http; use crate::binding::http::to_event; use crate::event::Event; @@ -17,19 +17,15 @@ where { type Rejection = Response; - async fn from_request( - req: Request, - _state: &S, - ) -> Result { + async fn from_request(req: Request, _state: &S) -> Result { let (parts, body) = req.into_parts(); - let body = - axum::body::to_bytes(body, usize::MAX).await.map_err(|e| { - Response::builder() - .status(StatusCode::INTERNAL_SERVER_ERROR) - .body(axum::body::Body::from(e.to_string())) - .unwrap() - })?; + let body = axum::body::to_bytes(body, usize::MAX).await.map_err(|e| { + Response::builder() + .status(StatusCode::INTERNAL_SERVER_ERROR) + .body(axum::body::Body::from(e.to_string())) + .unwrap() + })?; to_event(&parts.headers, body.to_vec()).map_err(|e| { Response::builder() @@ -42,8 +38,6 @@ where #[cfg(test)] mod tests { - use axum_lib_0_7 as axum; - use super::*; use axum::body::Body; use axum::extract::FromRequest; diff --git a/src/binding/axum/mod.rs b/src/binding/axum/mod.rs index 6c9d7cab..5e90caca 100644 --- a/src/binding/axum/mod.rs +++ b/src/binding/axum/mod.rs @@ -6,14 +6,13 @@ //! To echo events: //! //! ``` -//! # use axum_lib_0_7 as axum; +//! use axum_lib as axum; //! use axum::{ //! routing::{get, post}, //! Router, //! }; //! use cloudevents::Event; //! use http::StatusCode; -//! # use http_1_1 as http; //! //! fn app() -> Router { //! Router::new() @@ -32,14 +31,13 @@ //! To create event inside request handlers and send them as responses: //! //! ``` -//! # use axum_lib_0_7 as axum; +//! use axum_lib as axum; //! use axum::{ //! routing::{get, post}, //! Router, //! }; //! use cloudevents::{Event, EventBuilder, EventBuilderV10}; //! use http::StatusCode; -//! # use http_1_1 as http; //! use serde_json::json; //! //! fn app() -> Router { @@ -79,7 +77,7 @@ pub mod response; #[cfg(test)] mod tests { - use axum_lib_0_7 as axum; + use axum_lib as axum; use axum::{ body::Body, diff --git a/src/binding/axum/response.rs b/src/binding/axum/response.rs index 6a8efe64..3e9d3a4c 100644 --- a/src/binding/axum/response.rs +++ b/src/binding/axum/response.rs @@ -1,9 +1,9 @@ use crate::binding::http::builder::adapter::to_response; use crate::event::Event; use axum::{body::Body, http::Response, response::IntoResponse}; -use axum_lib_0_7 as axum; +use axum_lib as axum; +use http; use http::{header, StatusCode}; -use http_1_1 as http; impl IntoResponse for Event { fn into_response(self) -> Response { diff --git a/src/binding/http/builder/adapter.rs b/src/binding/http/builder/adapter.rs index 2f58e614..aab26952 100644 --- a/src/binding/http/builder/adapter.rs +++ b/src/binding/http/builder/adapter.rs @@ -1,45 +1,18 @@ -#[cfg(feature = "axum")] use bytes::Bytes; use http::Response; -#[cfg(feature = "axum")] -use http_1_1 as http; -#[cfg(feature = "axum")] use http_body_util::Full; -#[cfg(not(feature = "axum"))] -use hyper::body::Body; use std::cell::Cell; use crate::binding::http::{Builder, Serializer}; use crate::message::{BinaryDeserializer, Error, Result}; use crate::Event; -#[cfg(feature = "axum")] use std::convert::Infallible; -#[cfg(feature = "axum")] type BoxBody = http_body_util::combinators::UnsyncBoxBody; struct Adapter { builder: Cell, } -#[cfg(not(feature = "axum"))] -impl Builder> for Adapter { - fn header(&mut self, key: &str, value: http::header::HeaderValue) { - self.builder.set(self.builder.take().header(key, value)); - } - fn body(&mut self, bytes: Vec) -> Result> { - self.builder - .take() - .body(Body::from(bytes)) - .map_err(|e| crate::message::Error::Other { - source: Box::new(e), - }) - } - fn finish(&mut self) -> Result> { - self.body(Vec::new()) - } -} - -#[cfg(feature = "axum")] impl Builder> for Adapter { fn header(&mut self, key: &str, value: http::header::HeaderValue) { self.builder.set(self.builder.take().header(key, value)); @@ -59,17 +32,6 @@ impl Builder> for Adapter { } } -#[cfg(not(feature = "axum"))] -pub fn to_response(event: Event) -> std::result::Result, Error> { - BinaryDeserializer::deserialize_binary( - event, - Serializer::new(Adapter { - builder: Cell::new(http::Response::builder()), - }), - ) -} - -#[cfg(feature = "axum")] pub fn to_response(event: Event) -> std::result::Result, Error> { BinaryDeserializer::deserialize_binary( event, diff --git a/src/binding/http/builder/mod.rs b/src/binding/http/builder/mod.rs index acd145ef..b486fb72 100644 --- a/src/binding/http/builder/mod.rs +++ b/src/binding/http/builder/mod.rs @@ -1,9 +1,9 @@ -#[cfg(any(feature = "hyper", feature = "hyper-1-3"))] +#[cfg(feature = "hyper")] pub mod adapter; use crate::message::Result; -#[cfg(feature = "axum")] -use http_1_1 as http; + +use http; pub trait Builder { fn header(&mut self, key: &str, value: http::header::HeaderValue); diff --git a/src/binding/http/deserializer.rs b/src/binding/http/deserializer.rs index a8e2223a..782184f9 100644 --- a/src/binding/http/deserializer.rs +++ b/src/binding/http/deserializer.rs @@ -8,8 +8,8 @@ use crate::{ Result, StructuredDeserializer, StructuredSerializer, }, }; -#[cfg(feature = "axum")] -use http_1_1 as http; + +use http; use std::convert::TryFrom; pub struct Deserializer<'a, T: Headers<'a>> { diff --git a/src/binding/http/headers.rs b/src/binding/http/headers.rs index 8b2816d7..e8f850fa 100644 --- a/src/binding/http/headers.rs +++ b/src/binding/http/headers.rs @@ -1,6 +1,6 @@ use http::header::{AsHeaderName, HeaderMap, HeaderName, HeaderValue}; -#[cfg(feature = "axum")] -use http_1_1 as http; + +use http; /// Any http library should be able to use the /// [`to_event`](super::to_event) function with an implementation of diff --git a/src/binding/http/mod.rs b/src/binding/http/mod.rs index a459920a..7437fd00 100644 --- a/src/binding/http/mod.rs +++ b/src/binding/http/mod.rs @@ -13,8 +13,8 @@ mod serializer; pub use builder::Builder; use core::convert::TryFrom; use http::Response; -#[cfg(feature = "axum")] -use http_1_1 as http; + +use http; pub use serializer::Serializer; use std::convert::TryInto; use std::fmt::Debug; @@ -54,8 +54,8 @@ mod tests { use crate::Event; use core::convert::TryFrom; use http::Response; - #[cfg(feature = "axum")] - use http_1_1 as http; + + use http; #[test] fn test_response_to_event() { diff --git a/src/binding/http/serializer.rs b/src/binding/http/serializer.rs index 4f38cf8d..3f63b5bf 100644 --- a/src/binding/http/serializer.rs +++ b/src/binding/http/serializer.rs @@ -12,8 +12,8 @@ use crate::message::{ }; use crate::Event; use http::Request; -#[cfg(feature = "axum")] -use http_1_1 as http; + +use http; use std::convert::TryFrom; use std::fmt::Debug; @@ -133,8 +133,8 @@ mod tests { use crate::test::fixtures; use bytes::Bytes; use http::Request; - #[cfg(feature = "axum")] - use http_1_1 as http; + + use http; use std::convert::TryFrom; #[test] diff --git a/src/binding/http_0_2/builder/adapter.rs b/src/binding/http_0_2/builder/adapter.rs new file mode 100644 index 00000000..da12a6fa --- /dev/null +++ b/src/binding/http_0_2/builder/adapter.rs @@ -0,0 +1,44 @@ +use http::Response; +use http_0_2 as http; +use hyper::body::Body; +use std::cell::Cell; + +#[cfg(not(target_os = "wasi"))] +use hyper_0_14 as hyper; + +#[cfg(target_os = "wasi")] +use hyper; + +use crate::binding::http_0_2::{Builder, Serializer}; +use crate::message::{BinaryDeserializer, Error, Result}; +use crate::Event; + +struct Adapter { + builder: Cell, +} + +impl Builder> for Adapter { + fn header(&mut self, key: &str, value: http::header::HeaderValue) { + self.builder.set(self.builder.take().header(key, value)); + } + fn body(&mut self, bytes: Vec) -> Result> { + self.builder + .take() + .body(Body::from(bytes)) + .map_err(|e| crate::message::Error::Other { + source: Box::new(e), + }) + } + fn finish(&mut self) -> Result> { + self.body(Vec::new()) + } +} + +pub fn to_response(event: Event) -> std::result::Result, Error> { + BinaryDeserializer::deserialize_binary( + event, + Serializer::new(Adapter { + builder: Cell::new(http::Response::builder()), + }), + ) +} diff --git a/src/binding/http_0_2/builder/mod.rs b/src/binding/http_0_2/builder/mod.rs new file mode 100644 index 00000000..91e71031 --- /dev/null +++ b/src/binding/http_0_2/builder/mod.rs @@ -0,0 +1,11 @@ +#[cfg(feature = "hyper-0-14")] +pub mod adapter; + +use crate::message::Result; +use http_0_2 as http; + +pub trait Builder { + fn header(&mut self, key: &str, value: http::header::HeaderValue); + fn body(&mut self, bytes: Vec) -> Result; + fn finish(&mut self) -> Result; +} diff --git a/src/binding/http_0_2/deserializer.rs b/src/binding/http_0_2/deserializer.rs new file mode 100644 index 00000000..414137b2 --- /dev/null +++ b/src/binding/http_0_2/deserializer.rs @@ -0,0 +1,101 @@ +use super::{Headers, SPEC_VERSION_HEADER}; +use crate::{ + binding::CLOUDEVENTS_JSON_HEADER, + event::SpecVersion, + header_value_to_str, message, + message::{ + BinaryDeserializer, BinarySerializer, Encoding, MessageAttributeValue, MessageDeserializer, + Result, StructuredDeserializer, StructuredSerializer, + }, +}; +use http_0_2 as http; +use std::convert::TryFrom; + +pub struct Deserializer<'a, T: Headers<'a>> { + headers: &'a T, + body: Vec, +} + +impl<'a, T: Headers<'a>> Deserializer<'a, T> { + pub fn new(headers: &'a T, body: Vec) -> Deserializer<'a, T> { + Deserializer { headers, body } + } +} + +impl<'a, T: Headers<'a>> BinaryDeserializer for Deserializer<'a, T> { + fn deserialize_binary>(self, mut visitor: V) -> Result { + if self.encoding() != Encoding::BINARY { + return Err(message::Error::WrongEncoding {}); + } + + let spec_version = SpecVersion::try_from( + self.headers + .get(SPEC_VERSION_HEADER) + .map(|a| header_value_to_str!(a)) + .unwrap()?, + )?; + + let attributes = spec_version.attribute_names(); + + visitor = visitor.set_spec_version(spec_version)?; + + for (hn, hv) in self.headers.iter().filter(|(hn, _)| { + let key = hn.as_str(); + SPEC_VERSION_HEADER.ne(key) && key.starts_with("ce-") + }) { + let name = &hn.as_str()["ce-".len()..]; + + if attributes.contains(&name) { + visitor = visitor.set_attribute( + name, + MessageAttributeValue::String(String::from(header_value_to_str!(hv)?)), + )? + } else { + visitor = visitor.set_extension( + name, + MessageAttributeValue::String(String::from(header_value_to_str!(hv)?)), + )? + } + } + + if let Some(hv) = self.headers.get(http::header::CONTENT_TYPE) { + visitor = visitor.set_attribute( + "datacontenttype", + MessageAttributeValue::String(String::from(header_value_to_str!(hv)?)), + )? + } + + if !self.body.is_empty() { + visitor.end_with_data(self.body) + } else { + visitor.end() + } + } +} + +impl<'a, T: Headers<'a>> StructuredDeserializer for Deserializer<'a, T> { + fn deserialize_structured>(self, visitor: V) -> Result { + if self.encoding() != Encoding::STRUCTURED { + return Err(message::Error::WrongEncoding {}); + } + visitor.set_structured_event(self.body) + } +} + +impl<'a, T: Headers<'a>> MessageDeserializer for Deserializer<'a, T> { + fn encoding(&self) -> Encoding { + if self + .headers + .get(http::header::CONTENT_TYPE) + .and_then(|v| v.to_str().ok()) + .filter(|&v| v.starts_with(CLOUDEVENTS_JSON_HEADER)) + .is_some() + { + Encoding::STRUCTURED + } else if self.headers.get(SPEC_VERSION_HEADER).is_some() { + Encoding::BINARY + } else { + Encoding::UNKNOWN + } + } +} diff --git a/src/binding/http_0_2/headers.rs b/src/binding/http_0_2/headers.rs new file mode 100644 index 00000000..31136a51 --- /dev/null +++ b/src/binding/http_0_2/headers.rs @@ -0,0 +1,22 @@ +use http::header::{AsHeaderName, HeaderMap, HeaderName, HeaderValue}; +use http_0_2 as http; + +/// Any http library should be able to use the +/// [`to_event`](super::to_event) function with an implementation of +/// this trait. +pub trait Headers<'a> { + type Iterator: Iterator; + fn get(&self, name: K) -> Option<&HeaderValue>; + fn iter(&'a self) -> Self::Iterator; +} + +/// Implemention for the HeaderMap used by warp/reqwest +impl<'a> Headers<'a> for HeaderMap { + type Iterator = http::header::Iter<'a, HeaderValue>; + fn get(&self, name: K) -> Option<&HeaderValue> { + self.get(name) + } + fn iter(&'a self) -> Self::Iterator { + self.iter() + } +} diff --git a/src/binding/http_0_2/mod.rs b/src/binding/http_0_2/mod.rs new file mode 100644 index 00000000..7984d19a --- /dev/null +++ b/src/binding/http_0_2/mod.rs @@ -0,0 +1,73 @@ +pub mod builder; +pub mod deserializer; +mod headers; + +use crate::{ + message::{Error, MessageDeserializer}, + Event, +}; +use deserializer::Deserializer; +pub use headers::Headers; +mod serializer; + +pub use builder::Builder; +use core::convert::TryFrom; +use http::Response; +use http_0_2 as http; +pub use serializer::Serializer; +use std::convert::TryInto; +use std::fmt::Debug; + +pub static SPEC_VERSION_HEADER: &str = "ce-specversion"; + +/// Turn a pile of HTTP headers and a body into a CloudEvent +pub fn to_event<'a, T: Headers<'a>>( + headers: &'a T, + body: Vec, +) -> std::result::Result { + MessageDeserializer::into_event(Deserializer::new(headers, body)) +} + +pub fn header_prefix(name: &str) -> String { + super::header_prefix("ce-", name) +} + +impl TryFrom> for Event +where + T: TryInto>, + >>::Error: Debug, +{ + type Error = crate::message::Error; + + fn try_from(response: Response) -> Result { + let headers = response.headers().to_owned(); + let body = T::try_into(response.into_body()).unwrap(); + + to_event(&headers, body) + } +} + +#[cfg(test)] +mod tests { + use crate::test::fixtures; + use crate::Event; + use core::convert::TryFrom; + use http::Response; + use http_0_2 as http; + + #[test] + fn test_response_to_event() { + let event = fixtures::v10::minimal_string_extension(); + + let response = Response::builder() + .header("ce-id", fixtures::id()) + .header("ce-source", fixtures::source()) + .header("ce-type", fixtures::ty()) + .header("ce-specversion", "1.0") + .header("ce-someint", "10") + .body(Vec::new()) + .unwrap(); + + assert_eq!(event, Event::try_from(response).unwrap()); + } +} diff --git a/src/binding/http_0_2/serializer.rs b/src/binding/http_0_2/serializer.rs new file mode 100644 index 00000000..730be732 --- /dev/null +++ b/src/binding/http_0_2/serializer.rs @@ -0,0 +1,159 @@ +use std::{cell::RefCell, rc::Rc}; + +use crate::binding::http_0_2::builder::Builder; +use crate::binding::{ + http_0_2::{header_prefix, SPEC_VERSION_HEADER}, + CLOUDEVENTS_JSON_HEADER, +}; +use crate::event::SpecVersion; +use crate::message::BinaryDeserializer; +use crate::message::{ + BinarySerializer, Error, MessageAttributeValue, Result, StructuredSerializer, +}; +use crate::Event; +use http::Request; +use http_0_2 as http; +use std::convert::TryFrom; +use std::fmt::Debug; + +macro_rules! str_to_header_value { + ($header_value:expr) => { + http::header::HeaderValue::from_str(&$header_value.to_string()).map_err(|e| { + crate::message::Error::Other { + source: Box::new(e), + } + }) + }; +} + +pub struct Serializer { + builder: Rc>>, +} + +impl Serializer { + pub fn new + 'static>(delegate: B) -> Serializer { + let builder = Rc::new(RefCell::new(delegate)); + Serializer { builder } + } +} + +impl BinarySerializer for Serializer { + fn set_spec_version(self, spec_version: SpecVersion) -> Result { + self.builder + .borrow_mut() + .header(SPEC_VERSION_HEADER, str_to_header_value!(spec_version)?); + Ok(self) + } + + fn set_attribute(self, name: &str, value: MessageAttributeValue) -> Result { + self.builder + .borrow_mut() + .header(&header_prefix(name), str_to_header_value!(value)?); + Ok(self) + } + + fn set_extension(self, name: &str, value: MessageAttributeValue) -> Result { + self.builder + .borrow_mut() + .header(&header_prefix(name), str_to_header_value!(value)?); + Ok(self) + } + + fn end_with_data(self, bytes: Vec) -> Result { + self.builder.borrow_mut().body(bytes) + } + + fn end(self) -> Result { + self.builder.borrow_mut().finish() + } +} + +impl StructuredSerializer for Serializer { + fn set_structured_event(self, bytes: Vec) -> Result { + let mut builder = self.builder.borrow_mut(); + builder.header( + http::header::CONTENT_TYPE.as_str(), + http::HeaderValue::from_static(CLOUDEVENTS_JSON_HEADER), + ); + builder.body(bytes) + } +} + +impl BinarySerializer>> for http::request::Builder +where + T: TryFrom>, + >>::Error: Debug, +{ + fn set_spec_version(mut self, sv: SpecVersion) -> Result { + self = self.header(SPEC_VERSION_HEADER, &sv.to_string()); + Ok(self) + } + + fn set_attribute(mut self, name: &str, value: MessageAttributeValue) -> Result { + let key = &header_prefix(name); + self = self.header(key, &value.to_string()); + Ok(self) + } + + fn set_extension(mut self, name: &str, value: MessageAttributeValue) -> Result { + let key = &header_prefix(name); + self = self.header(key, &value.to_string()); + Ok(self) + } + + fn end_with_data(self, bytes: Vec) -> Result>> { + let body = T::try_from(bytes).unwrap(); + self.body(Some(body)).map_err(|e| Error::Other { + source: Box::new(e), + }) + } + + fn end(self) -> Result>> { + self.body(None).map_err(|e| Error::Other { + source: Box::new(e), + }) + } +} + +impl TryFrom for Request> +where + T: TryFrom>, + >>::Error: Debug, +{ + type Error = crate::message::Error; + + fn try_from(event: Event) -> Result { + BinaryDeserializer::deserialize_binary(event, http::request::Builder::new()) + } +} + +#[cfg(test)] +mod tests { + use crate::test::fixtures; + use bytes::Bytes; + use http::Request; + use http_0_2 as http; + use std::convert::TryFrom; + + #[test] + fn test_event_to_http_request() { + let event = fixtures::v10::minimal_string_extension(); + let request: Request>> = Request::try_from(event).unwrap(); + + assert_eq!(request.headers()["ce-id"], "0001"); + assert_eq!(request.headers()["ce-type"], "test_event.test_application"); + } + + #[test] + fn test_event_to_bytes_body() { + let event = fixtures::v10::full_binary_json_data_string_extension(); + let request: Request>> = Request::try_from(event).unwrap(); + + assert_eq!(request.headers()["ce-id"], "0001"); + assert_eq!(request.headers()["ce-type"], "test_event.test_application"); + assert_eq!( + request.body().as_ref().unwrap(), + &Bytes::from(fixtures::json_data().to_string()) + ); + } +} diff --git a/src/binding/mod.rs b/src/binding/mod.rs index 13332123..e42aaa64 100644 --- a/src/binding/mod.rs +++ b/src/binding/mod.rs @@ -11,8 +11,6 @@ pub mod axum; docsrs, doc(cfg(any( feature = "http-binding", - feature = "actix", - feature = "warp", feature = "reqwest", feature = "axum", feature = "poem" @@ -20,13 +18,19 @@ pub mod axum; )] #[cfg(any( feature = "http-binding", - feature = "actix", - feature = "warp", feature = "reqwest", feature = "axum", feature = "poem" ))] pub mod http; + +#[cfg_attr( + docsrs, + doc(cfg(any(feature = "http-0-2-binding", feature = "actix", feature = "warp",))) +)] +#[cfg(any(feature = "http-0-2-binding", feature = "actix", feature = "warp",))] +pub mod http_0_2; + #[cfg_attr(docsrs, doc(cfg(feature = "nats")))] #[cfg(feature = "nats")] pub mod nats; diff --git a/src/binding/poem/extractor.rs b/src/binding/poem/extractor.rs index c2717549..dbd380ae 100644 --- a/src/binding/poem/extractor.rs +++ b/src/binding/poem/extractor.rs @@ -1,18 +1,16 @@ -use async_trait::async_trait; +use crate::binding::http::to_event; +use crate::Event; + use poem_lib::error::ResponseError; use poem_lib::http::StatusCode; use poem_lib::{FromRequest, Request, RequestBody, Result}; -use crate::binding::http::to_event; -use crate::Event; - impl ResponseError for crate::message::Error { fn status(&self) -> StatusCode { StatusCode::BAD_REQUEST } } -#[async_trait] impl<'a> FromRequest<'a> for Event { async fn from_request(req: &'a Request, body: &mut RequestBody) -> Result { Ok(to_event(req.headers(), body.take()?.into_vec().await?)?) @@ -57,7 +55,7 @@ mod tests { let (req, mut body) = req.split(); let resp = Event::from_request(&req, &mut body).await.err().unwrap(); - assert_eq!(resp.as_response().status(), StatusCode::BAD_REQUEST); + assert_eq!(resp.status(), StatusCode::BAD_REQUEST); assert_eq!(resp.to_string(), "Invalid specversion BAD SPECIFICATION"); } diff --git a/src/binding/poem/response.rs b/src/binding/poem/response.rs index 20560b20..978dc441 100644 --- a/src/binding/poem/response.rs +++ b/src/binding/poem/response.rs @@ -1,14 +1,33 @@ +use crate::{AttributesReader, Data, Event}; + +use bytes::Bytes; use poem_lib::http::StatusCode; use poem_lib::{IntoResponse, Response}; -use crate::binding::http::builder::adapter::to_response; -use crate::Event; - impl IntoResponse for Event { fn into_response(self) -> Response { - match to_response(self) { - Ok(resp) => resp.into(), - Err(err) => (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()).into(), + let mut builder = Response::builder().status(StatusCode::OK); + + if let Some(dct) = self.datacontenttype() { + builder = builder.content_type(dct); + } + + for (key, value) in self.iter() { + builder = builder.header(format!("ce-{key}").as_str(), value.to_string()); + } + + match self.data { + Some(data) => match data { + Data::Binary(v) => builder.body(Bytes::copy_from_slice(v.as_slice())), + Data::String(s) => builder.body(s.clone()), + Data::Json(j) => match serde_json::to_string(&j) { + Ok(s) => builder.body(s), + Err(e) => Response::builder() + .status(StatusCode::INTERNAL_SERVER_ERROR) + .body(e.to_string()), + }, + }, + None => builder.finish(), } } } diff --git a/src/binding/reqwest/client_request.rs b/src/binding/reqwest/client_request.rs index d417a68f..28ebb073 100644 --- a/src/binding/reqwest/client_request.rs +++ b/src/binding/reqwest/client_request.rs @@ -114,7 +114,7 @@ mod private { #[cfg(test)] mod tests { use super::*; - use mockito::{mock, Matcher}; + use mockito::Matcher; use reqwest_lib as reqwest; use crate::message::StructuredDeserializer; @@ -123,7 +123,7 @@ mod tests { #[tokio::test] async fn test_request() { let url = mockito::server_url(); - let m = mock("POST", "/") + let m = mockito::mock("POST", "/") .match_header("ce-specversion", "1.0") .match_header("ce-id", "0001") .match_header("ce-type", "test_event.test_application") @@ -149,7 +149,7 @@ mod tests { #[tokio::test] async fn test_request_with_full_data() { let url = mockito::server_url(); - let m = mock("POST", "/") + let m = mockito::mock("POST", "/") .match_header("ce-specversion", "1.0") .match_header("ce-id", "0001") .with_header("ce-type", "test_event.test_application") @@ -183,7 +183,7 @@ mod tests { let input = fixtures::v10::full_json_data_string_extension(); let url = mockito::server_url(); - let m = mock("POST", "/") + let m = mockito::mock("POST", "/") .match_header("content-type", "application/cloudevents+json") .match_body(Matcher::Exact(serde_json::to_string(&input).unwrap())) .create(); @@ -204,8 +204,9 @@ mod tests { #[tokio::test] async fn test_batched_request() { let input = vec![fixtures::v10::full_json_data_string_extension()]; + let url = mockito::server_url(); - let m = mock("POST", "/") + let m = mockito::mock("POST", "/") .match_header("content-type", "application/cloudevents-batch+json") .match_body(Matcher::Exact(serde_json::to_string(&input).unwrap())) .create(); diff --git a/src/binding/reqwest/client_response.rs b/src/binding/reqwest/client_response.rs index 4304d967..e2d3e3ee 100644 --- a/src/binding/reqwest/client_response.rs +++ b/src/binding/reqwest/client_response.rs @@ -4,6 +4,7 @@ use crate::binding; use crate::message::{Error, Result}; use crate::Event; use async_trait::async_trait; +use http; use http::header; use reqwest::Response; @@ -68,7 +69,6 @@ mod private { #[cfg(test)] mod tests { use super::*; - use mockito::mock; use reqwest_lib as reqwest; use std::vec; @@ -77,7 +77,7 @@ mod tests { #[tokio::test] async fn test_response() { let url = mockito::server_url(); - let _m = mock("GET", "/") + let _m = mockito::mock("GET", "/") .with_status(200) .with_header("ce-specversion", "1.0") .with_header("ce-id", "0001") @@ -104,7 +104,7 @@ mod tests { #[tokio::test] async fn test_response_with_full_data() { let url = mockito::server_url(); - let _m = mock("GET", "/") + let _m = mockito::mock("GET", "/") .with_status(200) .with_header("ce-specversion", "1.0") .with_header("ce-id", "0001") @@ -139,7 +139,7 @@ mod tests { let expected = fixtures::v10::full_json_data_string_extension(); let url = mockito::server_url(); - let _m = mock("GET", "/") + let _m = mockito::mock("GET", "/") .with_status(200) .with_header( "content-type", @@ -166,7 +166,7 @@ mod tests { let expected = vec![fixtures::v10::full_json_data_string_extension()]; let url = mockito::server_url(); - let _m = mock("GET", "/") + let _m = mockito::mock("GET", "/") .with_status(200) .with_header( "content-type", diff --git a/src/binding/warp/filter.rs b/src/binding/warp/filter.rs index 1ddb6862..05f83817 100644 --- a/src/binding/warp/filter.rs +++ b/src/binding/warp/filter.rs @@ -1,6 +1,6 @@ use warp_lib as warp; -use crate::binding::http; +use crate::binding::http_0_2 as http; use crate::Event; use warp::http::HeaderMap; diff --git a/src/binding/warp/mod.rs b/src/binding/warp/mod.rs index 05e53f0b..dd90151a 100644 --- a/src/binding/warp/mod.rs +++ b/src/binding/warp/mod.rs @@ -24,6 +24,7 @@ //! //! ``` //! # use warp_lib as warp; +//! # use http_0_2 as http; //! use cloudevents::{Event, EventBuilder, EventBuilderV10}; //! use http::StatusCode; //! use serde_json::json; diff --git a/src/binding/warp/reply.rs b/src/binding/warp/reply.rs index c95b4f69..eebd4967 100644 --- a/src/binding/warp/reply.rs +++ b/src/binding/warp/reply.rs @@ -1,11 +1,12 @@ use warp_lib as warp; -use crate::binding::http::builder::adapter::to_response; +use crate::binding::http_0_2::builder::adapter::to_response; use crate::Event; use http::StatusCode; +use http_0_2 as http; +use hyper_0_14 as hyper; use warp::reply::Response; - /// /// # Serializes [`crate::Event`] as a http response /// @@ -32,6 +33,7 @@ pub fn from_event(event: Event) -> Response { #[cfg(test)] mod tests { use crate::test::fixtures; + use hyper_0_14 as hyper; #[test] fn test_response() { diff --git a/src/event/format.rs b/src/event/format.rs index feea08a8..60440c3c 100644 --- a/src/event/format.rs +++ b/src/event/format.rs @@ -3,6 +3,7 @@ use super::{ EventFormatSerializerV03, EventFormatSerializerV10, }; use crate::event::{AttributesReader, ExtensionValue}; +use base64::prelude::*; use serde::de::{Error, IntoDeserializer}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde_json::{Map, Value}; @@ -58,7 +59,9 @@ pub fn parse_data_string(v: Value) -> Result { pub fn parse_data_base64(v: Value) -> Result, E> { parse_field!(v, String, E).and_then(|s| { - base64::decode(s).map_err(|e| E::custom(format_args!("decode error `{}`", e))) + BASE64_STANDARD + .decode(s) + .map_err(|e| E::custom(format_args!("decode error `{}`", e))) }) } diff --git a/src/event/mod.rs b/src/event/mod.rs index 157a8b22..56f71e60 100644 --- a/src/event/mod.rs +++ b/src/event/mod.rs @@ -84,26 +84,29 @@ pub struct Event { #[delegate(self.attributes)] impl AttributesReader for Event { - fn id(&self) -> &str; - fn source(&self) -> &UriReference; - fn specversion(&self) -> SpecVersion; - fn ty(&self) -> &str; - fn datacontenttype(&self) -> Option<&str>; - fn dataschema(&self) -> Option<&Url>; - fn subject(&self) -> Option<&str>; - fn time(&self) -> Option<&DateTime>; + fn id(&self) -> &str {} + fn source(&self) -> &UriReference {} + fn specversion(&self) -> SpecVersion {} + fn ty(&self) -> &str {} + fn datacontenttype(&self) -> Option<&str> {} + fn dataschema(&self) -> Option<&Url> {} + fn subject(&self) -> Option<&str> {} + fn time(&self) -> Option<&DateTime> {} } #[delegate(self.attributes)] impl AttributesWriter for Event { - fn set_id(&mut self, id: impl Into) -> String; - fn set_source(&mut self, source: impl Into) -> UriReference; - fn set_type(&mut self, ty: impl Into) -> String; - fn set_subject(&mut self, subject: Option>) -> Option; - fn set_time(&mut self, time: Option>>) -> Option>; - fn set_datacontenttype(&mut self, datacontenttype: Option>) - -> Option; - fn set_dataschema(&mut self, dataschema: Option>) -> Option; + fn set_id(&mut self, id: impl Into) -> String {} + fn set_source(&mut self, source: impl Into) -> UriReference {} + fn set_type(&mut self, ty: impl Into) -> String {} + fn set_subject(&mut self, subject: Option>) -> Option {} + fn set_time(&mut self, time: Option>>) -> Option> {} + fn set_datacontenttype( + &mut self, + datacontenttype: Option>, + ) -> Option { + } + fn set_dataschema(&mut self, dataschema: Option>) -> Option {} } impl Default for Event { diff --git a/src/event/v03/attributes.rs b/src/event/v03/attributes.rs index 78500cf6..4e509268 100644 --- a/src/event/v03/attributes.rs +++ b/src/event/v03/attributes.rs @@ -221,7 +221,7 @@ impl crate::event::message::AttributesDeserializer for super::Attributes { mod tests { use super::*; use crate::test::fixtures; - use chrono::NaiveDateTime; + use chrono::DateTime; #[test] fn iter_v03_test() { @@ -243,13 +243,10 @@ mod tests { datacontenttype: None, schemaurl: None, subject: None, - time: Some(DateTime::::from_utc( - NaiveDateTime::from_timestamp(61, 0), - Utc, - )), + time: DateTime::from_timestamp(61, 0), }; let b = &mut a.into_iter(); - let time = DateTime::::from_utc(NaiveDateTime::from_timestamp(61, 0), Utc); + let time = DateTime::from_timestamp(61, 0).unwrap(); assert_eq!( ("specversion", AttributeValue::SpecVersion(SpecVersion::V03)), diff --git a/src/event/v03/format.rs b/src/event/v03/format.rs index aa553dea..0d1a986a 100644 --- a/src/event/v03/format.rs +++ b/src/event/v03/format.rs @@ -4,6 +4,7 @@ use crate::event::format::{ parse_data_base64, parse_data_base64_json, parse_data_json, parse_data_string, }; use crate::event::{Data, ExtensionValue}; +use base64::prelude::*; use chrono::{DateTime, Utc}; use serde::de::IntoDeserializer; use serde::ser::SerializeMap; @@ -102,7 +103,7 @@ impl crate::event::format::EventFormatSerializer state.serialize_entry("data", j)?, Some(Data::String(s)) => state.serialize_entry("data", s)?, Some(Data::Binary(v)) => { - state.serialize_entry("data", &base64::encode(v))?; + state.serialize_entry("data", &BASE64_STANDARD.encode(v))?; state.serialize_entry("datacontentencoding", "base64")?; } _ => (), diff --git a/src/event/v10/attributes.rs b/src/event/v10/attributes.rs index 95492959..49f4041f 100644 --- a/src/event/v10/attributes.rs +++ b/src/event/v10/attributes.rs @@ -222,7 +222,6 @@ impl AttributesConverter for Attributes { mod tests { use super::*; use crate::test::fixtures; - use chrono::NaiveDateTime; #[test] fn iter_v10_test() { @@ -244,13 +243,10 @@ mod tests { datacontenttype: None, dataschema: None, subject: None, - time: Some(DateTime::::from_utc( - NaiveDateTime::from_timestamp(61, 0), - Utc, - )), + time: DateTime::from_timestamp(61, 0), }; let b = &mut a.into_iter(); - let time = DateTime::::from_utc(NaiveDateTime::from_timestamp(61, 0), Utc); + let time = DateTime::from_timestamp(61, 0).unwrap(); assert_eq!( ("specversion", AttributeValue::SpecVersion(SpecVersion::V10)), diff --git a/src/event/v10/format.rs b/src/event/v10/format.rs index f7874a18..f54682ba 100644 --- a/src/event/v10/format.rs +++ b/src/event/v10/format.rs @@ -4,6 +4,7 @@ use crate::event::format::{ parse_data_base64, parse_data_base64_json, parse_data_json, parse_data_string, }; use crate::event::{Data, ExtensionValue}; +use base64::prelude::*; use chrono::{DateTime, Utc}; use serde::de::IntoDeserializer; use serde::ser::SerializeMap; @@ -102,7 +103,9 @@ impl crate::event::format::EventFormatSerializer state.serialize_entry("data", j)?, Some(Data::String(s)) => state.serialize_entry("data", s)?, - Some(Data::Binary(v)) => state.serialize_entry("data_base64", &base64::encode(v))?, + Some(Data::Binary(v)) => { + state.serialize_entry("data_base64", &BASE64_STANDARD.encode(v))? + } _ => (), }; for (k, v) in extensions { diff --git a/src/lib.rs b/src/lib.rs index c8f2e262..d0a5dcc6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,7 +54,7 @@ //! [Extractors]: https://actix.rs/docs/extractors/ //! [Responders]: https://actix.rs/docs/handlers/ -#![doc(html_root_url = "https://docs.rs/cloudevents-sdk/0.7.0")] +#![doc(html_root_url = "https://docs.rs/cloudevents-sdk/0.8.0")] #![deny(rustdoc::broken_intra_doc_links)] #![cfg_attr(docsrs, feature(doc_cfg))] // Show feature gate in doc diff --git a/src/message/mod.rs b/src/message/mod.rs index 4cd9bb49..14660574 100644 --- a/src/message/mod.rs +++ b/src/message/mod.rs @@ -2,18 +2,6 @@ //! //! Note: these APIs should be considered unstable and subject to changes. -#[cfg(all( - feature = "axum", - any( - feature = "http-binding", - feature = "actix", - feature = "reqwest", - feature = "warp", - feature = "poem" - ) -))] -compile_error!("feature `axum` cannot be used with features `http-binding`, `actix`, `reqwest`, `warp`, or `poem`"); - mod deserializer; mod encoding; mod error; diff --git a/src/message/types.rs b/src/message/types.rs index 3dda352d..af8e5a13 100644 --- a/src/message/types.rs +++ b/src/message/types.rs @@ -1,4 +1,5 @@ use crate::event::{ExtensionValue, UriReference}; +use base64::prelude::*; use chrono::{DateTime, Utc}; use std::convert::TryInto; use std::fmt; @@ -46,10 +47,14 @@ impl fmt::Display for MessageAttributeValue { MessageAttributeValue::Boolean(b) => write!(f, "{}", b), MessageAttributeValue::Integer(i) => write!(f, "{}", i), MessageAttributeValue::String(s) => write!(f, "{}", s), - MessageAttributeValue::Binary(v) => write!(f, "{}", base64::encode(v)), + MessageAttributeValue::Binary(v) => { + write!(f, "{}", BASE64_STANDARD.encode(v)) + } MessageAttributeValue::Uri(u) => write!(f, "{}", u), MessageAttributeValue::UriRef(u) => write!(f, "{}", u), - MessageAttributeValue::DateTime(d) => write!(f, "{}", d.to_rfc3339()), + MessageAttributeValue::DateTime(d) => { + write!(f, "{}", d.to_rfc3339()) + } } } } diff --git a/src/test/fixtures/mod.rs b/src/test/fixtures/mod.rs index d34c9a4e..dfef3b61 100644 --- a/src/test/fixtures/mod.rs +++ b/src/test/fixtures/mod.rs @@ -45,7 +45,7 @@ pub fn subject() -> String { } pub fn time() -> DateTime { - Utc.ymd(2020, 3, 16).and_hms(11, 50, 00) + Utc.with_ymd_and_hms(2020, 3, 16, 11, 50, 00).unwrap() } pub fn string_extension() -> (String, String) { diff --git a/src/test/fixtures/v03.rs b/src/test/fixtures/v03.rs index 38de5b1a..bfe08e1c 100644 --- a/src/test/fixtures/v03.rs +++ b/src/test/fixtures/v03.rs @@ -1,5 +1,6 @@ use crate::test::fixtures::*; use crate::{Event, EventBuilder, EventBuilderV03}; +use base64::prelude::*; use serde_json::{json, Value}; use url::Url; @@ -120,7 +121,7 @@ pub fn full_json_base64_data_json() -> Value { "datacontenttype": json_datacontenttype(), "schemaurl": dataschema(), "datacontentencoding": "base64", - "data": base64::encode(json_data_binary()) + "data": BASE64_STANDARD.encode(json_data_binary()) }) } @@ -199,6 +200,6 @@ pub fn full_xml_base64_data_json() -> Value { int_ext_name: int_ext_value, "datacontenttype": xml_datacontenttype(), "datacontentencoding": "base64", - "data": base64::encode(Vec::from(xml_data())) + "data": BASE64_STANDARD.encode(Vec::from(xml_data())) }) } diff --git a/src/test/fixtures/v10.rs b/src/test/fixtures/v10.rs index 56f926eb..5b41737a 100644 --- a/src/test/fixtures/v10.rs +++ b/src/test/fixtures/v10.rs @@ -1,5 +1,6 @@ use crate::test::fixtures::*; use crate::{Event, EventBuilder, EventBuilderV10}; +use base64::prelude::*; use serde_json::{json, Value}; use url::Url; @@ -166,7 +167,7 @@ pub fn full_json_base64_data_json() -> Value { int_ext_name: int_ext_value, "datacontenttype": json_datacontenttype(), "dataschema": dataschema(), - "data_base64": base64::encode(json_data_binary()) + "data_base64": BASE64_STANDARD.encode(json_data_binary()) }) } @@ -175,7 +176,7 @@ pub fn full_non_json_base64_data() -> Value { Value::Object(mut m) => { m.insert( "data_base64".to_string(), - Value::String(base64::encode(b"hello world")), + Value::String(BASE64_STANDARD.encode(b"hello world")), ); Value::Object(m) } @@ -187,7 +188,11 @@ pub fn full_non_json_data() -> Event { let mut event = full_json_data(); let value = full_non_json_base64_data(); if let Value::Object(m) = value { - event.set_data_unchecked(base64::decode(m["data_base64"].as_str().unwrap()).unwrap()); + event.set_data_unchecked( + BASE64_STANDARD + .decode(m["data_base64"].as_str().unwrap()) + .unwrap(), + ); } event } @@ -266,6 +271,6 @@ pub fn full_xml_base64_data_json() -> Value { bool_ext_name: bool_ext_value, int_ext_name: int_ext_value, "datacontenttype": xml_datacontenttype(), - "data_base64": base64::encode(Vec::from(xml_data())) + "data_base64": BASE64_STANDARD.encode(Vec::from(xml_data())) }) } From b545fbc0af4ea32e751d182cd88dddb1f3b97485 Mon Sep 17 00:00:00 2001 From: Omar Zabala-Ferrera <73452461+ozabalaferrera@users.noreply.github.com> Date: Thu, 7 Nov 2024 21:35:14 -0500 Subject: [PATCH 3/3] Change target wasm32-wasi to wasm32-wasip1. Signed-off-by: Omar Zabala-Ferrera <73452461+ozabalaferrera@users.noreply.github.com> --- .github/workflows/rust_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust_tests.yml b/.github/workflows/rust_tests.yml index 128ca0ee..a7a2f830 100644 --- a/.github/workflows/rust_tests.yml +++ b/.github/workflows/rust_tests.yml @@ -22,7 +22,7 @@ jobs: - x86_64-unknown-linux-gnu - x86_64-unknown-linux-musl - wasm32-unknown-unknown - - wasm32-wasi + - wasm32-wasip1 steps: - uses: actions/checkout@v2