freestyle 0.1.47 → 0.1.49
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.
- package/README.md +51 -0
- package/index.cjs +1791 -1475
- package/index.d.cts +3943 -2379
- package/index.d.mts +3943 -2379
- package/index.mjs +1791 -1475
- package/package.json +1 -1
- package/index.js +0 -391
package/README.md
CHANGED
|
@@ -163,4 +163,55 @@ for (let i = 0; i < 10; i++) {
|
|
|
163
163
|
`,
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
+
|
|
167
|
+
// Restrict outbound requests and attach headers for matching domains.
|
|
168
|
+
await freestyle.serverless.runs.create({
|
|
169
|
+
code: `export default async () => {
|
|
170
|
+
const res = await fetch("https://api.freestyle.sh/some-path");
|
|
171
|
+
return await res.text();
|
|
172
|
+
}`,
|
|
173
|
+
egress: {
|
|
174
|
+
allow: {
|
|
175
|
+
domains: {
|
|
176
|
+
"api.freestyle.sh": [
|
|
177
|
+
{
|
|
178
|
+
transform: [
|
|
179
|
+
{
|
|
180
|
+
headers: {
|
|
181
|
+
"X-Freestyle-Admin-Key": "abc",
|
|
182
|
+
"X-Freestyle-User-Id": "123",
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
"*": [],
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
// The same egress config shape is supported for deployments.
|
|
195
|
+
await freestyle.serverless.deployments.create({
|
|
196
|
+
code: "export default () => new Response('ok')",
|
|
197
|
+
egress: {
|
|
198
|
+
allow: {
|
|
199
|
+
domains: {
|
|
200
|
+
"api.freestyle.sh": [
|
|
201
|
+
{
|
|
202
|
+
transform: [
|
|
203
|
+
{
|
|
204
|
+
headers: {
|
|
205
|
+
"X-Freestyle-Admin-Key": "abc",
|
|
206
|
+
"X-Freestyle-User-Id": "123",
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
"*": [],
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
});
|
|
166
217
|
```
|