Skip to content

Commit 2a83cc2

Browse files
committed
update: moon info 0.6.33+b989ba000
1 parent df3d415 commit 2a83cc2

7 files changed

Lines changed: 92 additions & 96 deletions

File tree

src/cookie_test.mbt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ test "parse_cookie_multiple_with_attributes" {
6464
}
6565
None => fail("Expected c2")
6666
}
67-
match cookies.get("SameSite") {
68-
Some(item) => assert_eq(item.value, "Strict")
69-
None => fail("Expected SameSite cookie")
70-
}
7167
}
7268

7369
///|

src/cors/pkg.generated.mbti

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import(
66
)
77

88
// Values
9-
fn append_cors_headers(@mocket.MocketEvent, origin? : String, methods? : String, allow_headers? : String, expose_headers? : String, credentials? : Bool) -> Unit
9+
pub fn append_cors_headers(@mocket.MocketEvent, origin? : String, methods? : String, allow_headers? : String, expose_headers? : String, credentials? : Bool) -> Unit
1010

11-
fn append_cors_preflight_headers(@mocket.MocketEvent, origin? : String, methods? : String, allow_headers? : String, credentials? : Bool, max_age? : Int) -> Unit
11+
pub fn append_cors_preflight_headers(@mocket.MocketEvent, origin? : String, methods? : String, allow_headers? : String, credentials? : Bool, max_age? : Int) -> Unit
1212

13-
fn handle_cors(origin? : String, methods? : String, allow_headers? : String, expose_headers? : String, credentials? : Bool, max_age? : Int) -> async (@mocket.MocketEvent, async () -> &@mocket.Responder noraise) -> &@mocket.Responder noraise
13+
pub fn handle_cors(origin? : String, methods? : String, allow_headers? : String, expose_headers? : String, credentials? : Bool, max_age? : Int) -> async (@mocket.MocketEvent, async () -> &@mocket.Responder noraise) -> &@mocket.Responder noraise
1414

15-
fn is_preflight_request(@mocket.MocketEvent) -> Bool
15+
pub fn is_preflight_request(@mocket.MocketEvent) -> Bool
1616

1717
// Errors
1818

src/examples/responder/pkg.generated.mbti

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import(
1111

1212
// Types and methods
1313
type Person
14-
impl ToJson for Person
15-
impl @json.FromJson for Person
14+
pub impl ToJson for Person
15+
pub impl @json.FromJson for Person
1616

1717
// Type aliases
1818

src/examples/route/pkg.generated.mbti

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import(
66
)
77

88
// Values
9-
async fn logger_middleware(@mocket.MocketEvent, async () -> &@mocket.Responder noraise) -> &@mocket.Responder noraise
9+
pub async fn logger_middleware(@mocket.MocketEvent, async () -> &@mocket.Responder noraise) -> &@mocket.Responder noraise
1010

1111
// Errors
1212

src/examples/static_assets/pkg.generated.mbti

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import(
66
)
77

88
// Values
9-
async fn logger_middleware(@mocket.MocketEvent, async () -> &@mocket.Responder noraise) -> &@mocket.Responder noraise
9+
pub async fn logger_middleware(@mocket.MocketEvent, async () -> &@mocket.Responder noraise) -> &@mocket.Responder noraise
1010

1111
// Errors
1212

src/pkg.generated.mbti

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -7,61 +7,61 @@ import(
77
)
88

99
// Values
10-
fn __ws_emit(@native.CStr, @native.CStr, @native.CStr) -> Unit
10+
pub fn __ws_emit(@native.CStr, @native.CStr, @native.CStr) -> Unit
1111

12-
fn async_run(async () -> Unit noraise) -> Unit
12+
pub fn async_run(async () -> Unit noraise) -> Unit
1313

14-
fn cookie_to_string(Array[CookieItem]) -> String
14+
pub fn cookie_to_string(Array[CookieItem]) -> String
1515

16-
async fn execute_middlewares(Array[(String, async (MocketEvent, async () -> &Responder noraise) -> &Responder noraise)], MocketEvent, async (MocketEvent) -> &Responder noraise) -> &Responder noraise
16+
pub async fn execute_middlewares(Array[(String, async (MocketEvent, async () -> &Responder noraise) -> &Responder noraise)], MocketEvent, async (MocketEvent) -> &Responder noraise) -> &Responder noraise
1717

18-
fn form_encode(Map[String, String]) -> String
18+
pub fn form_encode(Map[String, String]) -> String
1919

20-
async fn handle_not_found(MocketEvent) -> &Responder noraise
20+
pub async fn handle_not_found(MocketEvent) -> &Responder noraise
2121

22-
fn html(&Show) -> &Responder
22+
pub fn html(&Show) -> &Responder
2323

24-
fn new(base_path? : String) -> Mocket
24+
pub fn new(base_path? : String) -> Mocket
2525

26-
fn parse_cookie(StringView) -> Map[String, CookieItem]
26+
pub fn parse_cookie(StringView) -> Map[String, CookieItem]
2727

28-
fn parse_form_data(BytesView) -> Map[String, String]
28+
pub fn parse_form_data(BytesView) -> Map[String, String]
2929

30-
fn parse_multipart(BytesView, String) -> Map[String, MultipartFormValue]
30+
pub fn parse_multipart(BytesView, String) -> Map[String, MultipartFormValue]
3131

32-
fn register_ws_handler(Mocket, Int) -> Unit
32+
pub fn register_ws_handler(Mocket, Int) -> Unit
3333

34-
fn serve_ffi(Mocket, port~ : Int) -> Unit
34+
pub fn serve_ffi(Mocket, port~ : Int) -> Unit
3535

36-
async fn[T, E : Error] suspend(((T) -> Unit, (E) -> Unit) -> Unit) -> T raise E
36+
pub async fn[T, E : Error] suspend(((T) -> Unit, (E) -> Unit) -> Unit) -> T raise E
3737

38-
fn text(&Show) -> &Responder
38+
pub fn text(&Show) -> &Responder
3939

40-
fn url_decode(BytesView) -> String
40+
pub fn url_decode(BytesView) -> String
4141

42-
fn url_encode(String) -> String
42+
pub fn url_encode(String) -> String
4343

44-
fn ws_pong(String) -> Unit
44+
pub fn ws_pong(String) -> Unit
4545

46-
fn ws_publish(String, String) -> Unit
46+
pub fn ws_publish(String, String) -> Unit
4747

48-
fn ws_send(String, String) -> Unit
48+
pub fn ws_send(String, String) -> Unit
4949

50-
fn ws_send_bytes(String, Bytes) -> Unit
50+
pub fn ws_send_bytes(String, Bytes) -> Unit
5151

52-
fn ws_subscribe(String, String) -> Unit
52+
pub fn ws_subscribe(String, String) -> Unit
5353

54-
fn ws_unsubscribe(String, String) -> Unit
54+
pub fn ws_unsubscribe(String, String) -> Unit
5555

5656
// Errors
5757
pub suberror ExecError
58-
impl Show for ExecError
58+
pub impl Show for ExecError
5959

6060
pub suberror IOError
61-
impl Show for IOError
61+
pub impl Show for IOError
6262

6363
pub suberror NetworkError
64-
impl Show for NetworkError
64+
pub impl Show for NetworkError
6565

6666
// Types and methods
6767
pub(all) struct CookieItem {
@@ -74,40 +74,40 @@ pub(all) struct CookieItem {
7474
http_only : Bool?
7575
same_site : SameSiteOption?
7676
}
77-
impl Eq for CookieItem
78-
impl Show for CookieItem
77+
pub impl Eq for CookieItem
78+
pub impl Show for CookieItem
7979

8080
type Html
81-
impl Responder for Html
81+
pub impl Responder for Html
8282

8383
pub(all) struct HttpRequest {
8484
http_method : String
8585
url : String
8686
headers : Map[StringView, StringView]
8787
mut raw_body : Bytes
8888
}
89-
fn[T : BodyReader] HttpRequest::body(Self) -> T raise
90-
fn HttpRequest::get_cookie(Self, String) -> CookieItem?
91-
impl Responder for HttpRequest
89+
pub fn[T : BodyReader] HttpRequest::body(Self) -> T raise
90+
pub fn HttpRequest::get_cookie(Self, String) -> CookieItem?
91+
pub impl Responder for HttpRequest
9292

9393
#external
9494
pub type HttpRequestInternal
95-
fn HttpRequestInternal::on_complete(Self, FuncRef[() -> Unit]) -> Unit
96-
fn HttpRequestInternal::on_headers(Self, FuncRef[(@native.CStr) -> Unit]) -> Unit
95+
pub fn HttpRequestInternal::on_complete(Self, FuncRef[() -> Unit]) -> Unit
96+
pub fn HttpRequestInternal::on_headers(Self, FuncRef[(@native.CStr) -> Unit]) -> Unit
9797

9898
pub(all) struct HttpResponse {
9999
mut status_code : StatusCode
100100
headers : Map[StringView, StringView]
101101
cookies : Map[String, CookieItem]
102102
mut raw_body : Bytes
103103
}
104-
fn HttpResponse::body(Self, &Responder) -> Self
105-
fn HttpResponse::delete_cookie(Self, String) -> Unit
106-
fn HttpResponse::json(Self, &ToJson) -> Self
107-
fn HttpResponse::new(StatusCode, headers? : Map[StringView, StringView], cookies? : Map[String, CookieItem], raw_body? : Bytes) -> Self
108-
fn HttpResponse::set_cookie(Self, String, String, max_age? : Int, path? : String, domain? : String, secure? : Bool, http_only? : Bool, same_site? : SameSiteOption) -> Unit
109-
fn HttpResponse::to_responder(Self) -> &Responder
110-
impl Responder for HttpResponse
104+
pub fn HttpResponse::body(Self, &Responder) -> Self
105+
pub fn HttpResponse::delete_cookie(Self, String) -> Unit
106+
pub fn HttpResponse::json(Self, &ToJson) -> Self
107+
pub fn HttpResponse::new(StatusCode, headers? : Map[StringView, StringView], cookies? : Map[String, CookieItem], raw_body? : Bytes) -> Self
108+
pub fn HttpResponse::set_cookie(Self, String, String, max_age? : Int, path? : String, domain? : String, secure? : Bool, http_only? : Bool, same_site? : SameSiteOption) -> Unit
109+
pub fn HttpResponse::to_responder(Self) -> &Responder
110+
pub impl Responder for HttpResponse
111111

112112
#external
113113
pub type HttpResponseInternal
@@ -128,22 +128,22 @@ pub(all) struct Mocket {
128128
ws_channels : Map[String, Map[String, Unit]]
129129
ws_client_port : Map[String, Int]
130130
}
131-
fn Mocket::all(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
132-
fn Mocket::connect(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
133-
fn Mocket::delete(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
134-
fn Mocket::get(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
135-
fn Mocket::group(Self, String, (Self) -> Unit) -> Unit
136-
fn Mocket::head(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
137-
fn Mocket::on(Self, String, String, async (MocketEvent) -> &Responder noraise) -> Unit
138-
fn Mocket::options(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
139-
fn Mocket::patch(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
140-
fn Mocket::post(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
141-
fn Mocket::put(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
142-
fn Mocket::serve(Self, port~ : Int) -> Unit
143-
fn Mocket::static_assets(Self, String, &ServeStaticProvider) -> Unit
144-
fn Mocket::trace(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
145-
fn Mocket::use_middleware(Self, async (MocketEvent, async () -> &Responder noraise) -> &Responder noraise, base_path? : String) -> Unit
146-
fn Mocket::ws(Self, String, (WebSocketEvent) -> Unit) -> Unit
131+
pub fn Mocket::all(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
132+
pub fn Mocket::connect(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
133+
pub fn Mocket::delete(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
134+
pub fn Mocket::get(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
135+
pub fn Mocket::group(Self, String, (Self) -> Unit) -> Unit
136+
pub fn Mocket::head(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
137+
pub fn Mocket::on(Self, String, String, async (MocketEvent) -> &Responder noraise) -> Unit
138+
pub fn Mocket::options(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
139+
pub fn Mocket::patch(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
140+
pub fn Mocket::post(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
141+
pub fn Mocket::put(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
142+
pub fn Mocket::serve(Self, port~ : Int) -> Unit
143+
pub fn Mocket::static_assets(Self, String, &ServeStaticProvider) -> Unit
144+
pub fn Mocket::trace(Self, String, async (MocketEvent) -> &Responder noraise) -> Unit
145+
pub fn Mocket::use_middleware(Self, async (MocketEvent, async () -> &Responder noraise) -> &Responder noraise, base_path? : String) -> Unit
146+
pub fn Mocket::ws(Self, String, (WebSocketEvent) -> Unit) -> Unit
147147

148148
pub(all) struct MocketEvent {
149149
req : HttpRequest
@@ -162,9 +162,9 @@ pub(all) enum SameSiteOption {
162162
Strict
163163
SameSiteNone
164164
}
165-
impl Eq for SameSiteOption
166-
impl Show for SameSiteOption
167-
impl ToJson for SameSiteOption
165+
pub impl Eq for SameSiteOption
166+
pub impl Show for SameSiteOption
167+
pub impl ToJson for SameSiteOption
168168

169169
pub(all) struct StaticAssetMeta {
170170
asset_type : String?
@@ -174,7 +174,7 @@ pub(all) struct StaticAssetMeta {
174174
size : Int64?
175175
encoding : String?
176176
}
177-
fn StaticAssetMeta::new(asset_type? : String, etag? : String, mtime? : Int64, path? : String, size? : Int64, encoding? : String) -> Self
177+
pub fn StaticAssetMeta::new(asset_type? : String, etag? : String, mtime? : Int64, path? : String, size? : Int64, encoding? : String) -> Self
178178

179179
pub(all) enum StatusCode {
180180
Continue
@@ -241,10 +241,10 @@ pub(all) enum StatusCode {
241241
NetworkAuthenticationRequired
242242
Custom(Int)
243243
}
244-
fn StatusCode::from_int(Int) -> Self
245-
fn StatusCode::to_int(Self) -> Int
246-
impl Show for StatusCode
247-
impl ToJson for StatusCode
244+
pub fn StatusCode::from_int(Int) -> Self
245+
pub fn StatusCode::to_int(Self) -> Int
246+
pub impl Show for StatusCode
247+
pub impl ToJson for StatusCode
248248

249249
pub enum WebSocketAggregatedMessage {
250250
Text(String)
@@ -262,13 +262,13 @@ pub(all) struct WebSocketPeer {
262262
connection_id : String
263263
mut subscribed_channels : Array[String]
264264
}
265-
fn WebSocketPeer::binary(Self, Bytes) -> Unit
266-
fn WebSocketPeer::pong(Self) -> Unit
267-
fn WebSocketPeer::publish(String, String) -> Unit
268-
fn WebSocketPeer::subscribe(Self, String) -> Unit
269-
fn WebSocketPeer::text(Self, String) -> Unit
270-
fn WebSocketPeer::to_string(Self) -> String
271-
fn WebSocketPeer::unsubscribe(Self, String) -> Unit
265+
pub fn WebSocketPeer::binary(Self, Bytes) -> Unit
266+
pub fn WebSocketPeer::pong(Self) -> Unit
267+
pub fn WebSocketPeer::publish(String, String) -> Unit
268+
pub fn WebSocketPeer::subscribe(Self, String) -> Unit
269+
pub fn WebSocketPeer::text(Self, String) -> Unit
270+
pub fn WebSocketPeer::to_string(Self) -> String
271+
pub fn WebSocketPeer::unsubscribe(Self, String) -> Unit
272272

273273
// Type aliases
274274
pub type HttpHandler = async (MocketEvent) -> &Responder noraise
@@ -281,21 +281,21 @@ pub type WebSocketHandler = (WebSocketEvent) -> Unit
281281
pub(open) trait BodyReader {
282282
from_request(HttpRequest) -> Self raise
283283
}
284-
impl BodyReader for String
285-
impl BodyReader for FixedArray[Byte]
286-
impl BodyReader for Bytes
287-
impl BodyReader for Array[Byte]
288-
impl BodyReader for Json
284+
pub impl BodyReader for String
285+
pub impl BodyReader for FixedArray[Byte]
286+
pub impl BodyReader for Bytes
287+
pub impl BodyReader for Array[Byte]
288+
pub impl BodyReader for Json
289289

290290
pub(open) trait Responder {
291291
options(Self, HttpResponse) -> Unit
292292
output(Self, @buffer.Buffer) -> Unit
293293
}
294-
impl Responder for String
295-
impl Responder for Bytes
296-
impl Responder for Json
297-
impl Responder for &ToJson
298-
impl Responder for StringView
294+
pub impl Responder for String
295+
pub impl Responder for Bytes
296+
pub impl Responder for Json
297+
pub impl Responder for &ToJson
298+
pub impl Responder for StringView
299299

300300
pub(open) trait ServeStaticProvider {
301301
get_meta(Self, String) -> StaticAssetMeta?

src/static_file/pkg.generated.mbti

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import(
66
)
77

88
// Values
9-
fn new(String) -> StaticFileProvider
9+
pub fn new(String) -> StaticFileProvider
1010

1111
// Errors
1212

1313
// Types and methods
1414
pub struct StaticFileProvider {
1515
path : String
1616
}
17-
impl @mocket.ServeStaticProvider for StaticFileProvider
17+
pub impl @mocket.ServeStaticProvider for StaticFileProvider
1818

1919
// Type aliases
2020

0 commit comments

Comments
 (0)