firefly-compiler 0.4.71 → 0.4.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,7 @@ extend self: HttpClient {
22
22
  headers: List[Pair[String, String]]
23
23
  body: FetchResponse => T
24
24
  ): T {
25
- self.fetch("GET", url, headers.toMap(), None, FetchOptions(), body)
25
+ self.fetch("GET", url, headers, None, FetchOptions(), body)
26
26
  }
27
27
 
28
28
  post[T](
@@ -31,7 +31,7 @@ extend self: HttpClient {
31
31
  payload: Buffer
32
32
  body: FetchResponse => T
33
33
  ): T {
34
- self.fetch("POST", url, headers.toMap(), Some(payload), FetchOptions(), body)
34
+ self.fetch("POST", url, headers, Some(payload), FetchOptions(), body)
35
35
  }
36
36
 
37
37
  put[T](
@@ -40,7 +40,7 @@ extend self: HttpClient {
40
40
  payload: Buffer
41
41
  body: FetchResponse => T
42
42
  ): T {
43
- self.fetch("PUT", url, headers.toMap(), Some(payload), FetchOptions(), body)
43
+ self.fetch("PUT", url, headers, Some(payload), FetchOptions(), body)
44
44
  }
45
45
 
46
46
  delete[T](
@@ -48,13 +48,13 @@ extend self: HttpClient {
48
48
  headers: List[Pair[String, String]]
49
49
  body: FetchResponse => T
50
50
  ): T {
51
- self.fetch("DELETE", url, headers.toMap(), None, FetchOptions(), body)
51
+ self.fetch("DELETE", url, headers, None, FetchOptions(), body)
52
52
  }
53
53
 
54
54
  fetch[T](
55
55
  method: String
56
56
  url: String
57
- headers: Map[String, String] = Map.new()
57
+ headers: List[Pair[String, String]] = []
58
58
  payload: Option[Buffer] = None
59
59
  options: FetchOptions = FetchOptions()
60
60
  body: FetchResponse => T
@@ -66,13 +66,13 @@ extend self: HttpClient {
66
66
  options.method = method_;
67
67
  headers_.forEach(pair => {options.headers[pair.first_] = pair.second_});
68
68
  if(body_.value_) options.body = body_.value_;
69
- if(redirect_.RedirectError) options.redirect = "error";
70
- else if(redirect_.RedirectManual) options.redirect = "manual";
71
- if(referrer_.value_) options.referrer = referrer_.value_;
72
- if(integrity_.value_) options.integrity = integrity_.value_;
73
- if(mode_.value_) options.mode = mode_.value_;
74
- if(credentials_.value_) options.credentials = credentials_.value_;
75
- if(cache_.value_) options.cache = cache_.value_;
69
+ if(options_.redirect_.RedirectError) options.redirect = "error";
70
+ else if(options_.redirect_.RedirectManual) options.redirect = "manual";
71
+ if(options_.referrer_.value_) options.referrer = options_.referrer_.value_;
72
+ if(options_.integrity_.value_) options.integrity = options_.integrity_.value_;
73
+ if(options_.mode_.value_) options.mode = options_.mode_.value_;
74
+ if(options_.credentials_.value_) options.credentials = options_.credentials_.value_;
75
+ if(options_.cache_.value_) options.cache = options_.cache_.value_;
76
76
  fetchResponse.response = await self_.fetch(url_, options);
77
77
  const result = await body_(fetchResponse, $task);
78
78
  if(!statusChecked && !fetchResponse.response.ok) {
@@ -136,42 +136,42 @@ throw new Error('Function internalCheck is missing on this target in async conte
136
136
  }
137
137
 
138
138
  export function HttpClient_get(self_, url_, headers_, body_) {
139
- return ff_core_HttpClient.HttpClient_fetch(self_, "GET", url_, ff_core_List.List_toMap(headers_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Option.None(), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_)
139
+ return ff_core_HttpClient.HttpClient_fetch(self_, "GET", url_, headers_, ff_core_Option.None(), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_)
140
140
  }
141
141
 
142
142
  export function HttpClient_post(self_, url_, headers_, payload_, body_) {
143
- return ff_core_HttpClient.HttpClient_fetch(self_, "POST", url_, ff_core_List.List_toMap(headers_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Option.Some(payload_), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_)
143
+ return ff_core_HttpClient.HttpClient_fetch(self_, "POST", url_, headers_, ff_core_Option.Some(payload_), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_)
144
144
  }
145
145
 
146
146
  export function HttpClient_put(self_, url_, headers_, payload_, body_) {
147
- return ff_core_HttpClient.HttpClient_fetch(self_, "PUT", url_, ff_core_List.List_toMap(headers_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Option.Some(payload_), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_)
147
+ return ff_core_HttpClient.HttpClient_fetch(self_, "PUT", url_, headers_, ff_core_Option.Some(payload_), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_)
148
148
  }
149
149
 
150
150
  export function HttpClient_delete(self_, url_, headers_, body_) {
151
- return ff_core_HttpClient.HttpClient_fetch(self_, "DELETE", url_, ff_core_List.List_toMap(headers_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Option.None(), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_)
151
+ return ff_core_HttpClient.HttpClient_fetch(self_, "DELETE", url_, headers_, ff_core_Option.None(), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_)
152
152
  }
153
153
 
154
- export function HttpClient_fetch(self_, method_, url_, headers_ = ff_core_Map.new_(), payload_ = ff_core_Option.None(), options_ = ff_core_HttpClient.FetchOptions(), body_) {
154
+ export function HttpClient_fetch(self_, method_, url_, headers_ = [], payload_ = ff_core_Option.None(), options_ = ff_core_HttpClient.FetchOptions(), body_) {
155
155
  throw new Error('Function HttpClient_fetch is missing on this target in sync context.');
156
156
  }
157
157
 
158
158
  export async function HttpClient_get$(self_, url_, headers_, body_, $task) {
159
- return (await ff_core_HttpClient.HttpClient_fetch$(self_, "GET", url_, ff_core_List.List_toMap(headers_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Option.None(), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_, $task))
159
+ return (await ff_core_HttpClient.HttpClient_fetch$(self_, "GET", url_, headers_, ff_core_Option.None(), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_, $task))
160
160
  }
161
161
 
162
162
  export async function HttpClient_post$(self_, url_, headers_, payload_, body_, $task) {
163
- return (await ff_core_HttpClient.HttpClient_fetch$(self_, "POST", url_, ff_core_List.List_toMap(headers_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Option.Some(payload_), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_, $task))
163
+ return (await ff_core_HttpClient.HttpClient_fetch$(self_, "POST", url_, headers_, ff_core_Option.Some(payload_), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_, $task))
164
164
  }
165
165
 
166
166
  export async function HttpClient_put$(self_, url_, headers_, payload_, body_, $task) {
167
- return (await ff_core_HttpClient.HttpClient_fetch$(self_, "PUT", url_, ff_core_List.List_toMap(headers_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Option.Some(payload_), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_, $task))
167
+ return (await ff_core_HttpClient.HttpClient_fetch$(self_, "PUT", url_, headers_, ff_core_Option.Some(payload_), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_, $task))
168
168
  }
169
169
 
170
170
  export async function HttpClient_delete$(self_, url_, headers_, body_, $task) {
171
- return (await ff_core_HttpClient.HttpClient_fetch$(self_, "DELETE", url_, ff_core_List.List_toMap(headers_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Option.None(), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_, $task))
171
+ return (await ff_core_HttpClient.HttpClient_fetch$(self_, "DELETE", url_, headers_, ff_core_Option.None(), ff_core_HttpClient.FetchOptions(ff_core_HttpClient.RedirectFollow(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None(), ff_core_Option.None()), body_, $task))
172
172
  }
173
173
 
174
- export async function HttpClient_fetch$(self_, method_, url_, headers_ = ff_core_Map.new_(), payload_ = ff_core_Option.None(), options_ = ff_core_HttpClient.FetchOptions(), body_, $task) {
174
+ export async function HttpClient_fetch$(self_, method_, url_, headers_ = [], payload_ = ff_core_Option.None(), options_ = ff_core_HttpClient.FetchOptions(), body_, $task) {
175
175
 
176
176
  const fetchResponse = {response: null, statusChecked: false};
177
177
  try {
@@ -179,13 +179,13 @@ export async function HttpClient_fetch$(self_, method_, url_, headers_ = ff_core
179
179
  options.method = method_;
180
180
  headers_.forEach(pair => {options.headers[pair.first_] = pair.second_});
181
181
  if(body_.value_) options.body = body_.value_;
182
- if(redirect_.RedirectError) options.redirect = "error";
183
- else if(redirect_.RedirectManual) options.redirect = "manual";
184
- if(referrer_.value_) options.referrer = referrer_.value_;
185
- if(integrity_.value_) options.integrity = integrity_.value_;
186
- if(mode_.value_) options.mode = mode_.value_;
187
- if(credentials_.value_) options.credentials = credentials_.value_;
188
- if(cache_.value_) options.cache = cache_.value_;
182
+ if(options_.redirect_.RedirectError) options.redirect = "error";
183
+ else if(options_.redirect_.RedirectManual) options.redirect = "manual";
184
+ if(options_.referrer_.value_) options.referrer = options_.referrer_.value_;
185
+ if(options_.integrity_.value_) options.integrity = options_.integrity_.value_;
186
+ if(options_.mode_.value_) options.mode = options_.mode_.value_;
187
+ if(options_.credentials_.value_) options.credentials = options_.credentials_.value_;
188
+ if(options_.cache_.value_) options.cache = options_.cache_.value_;
189
189
  fetchResponse.response = await self_.fetch(url_, options);
190
190
  const result = await body_(fetchResponse, $task);
191
191
  if(!statusChecked && !fetchResponse.response.ok) {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "Firefly compiler",
5
5
  "author": "Firefly team",
6
6
  "license": "MIT",
7
- "version": "0.4.71",
7
+ "version": "0.4.73",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"
package/rpc/Rpc.ff CHANGED
@@ -62,7 +62,7 @@ newClient(
62
62
  httpClient.fetch(
63
63
  method = method
64
64
  url = prefix + name
65
- headers = Map.new()
65
+ headers = []
66
66
  payload = Some(buffer)
67
67
  options = FetchOptions()
68
68
  ) {_.readBuffer()}
@@ -4,7 +4,7 @@
4
4
  "description": "Firefly language support",
5
5
  "author": "Firefly team",
6
6
  "license": "MIT",
7
- "version": "0.4.71",
7
+ "version": "0.4.73",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"