File tree Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 11# @taskless/loader
22
3+ ## 0.0.35
4+
5+ ### Patch Changes
6+
7+ - Adds additional properties to the sandbox
8+
39## 0.0.34
410
511### Patch Changes
Original file line number Diff line number Diff line change 11{
22 "name" : " @taskless/loader" ,
33 "description" : " Taskless Loader - Take control of your third party APIs" ,
4- "version" : " 0.0.34 " ,
4+ "version" : " 0.0.35 " ,
55 "author" : " Taskless" ,
66 "license" : " Apache-2.0" ,
77 "repository" : " taskless/loader-js" ,
Original file line number Diff line number Diff line change 11import process from "node:process" ;
2- import { type Pack } from "@~/types.js" ;
2+ import { type PluginInput , type Pack } from "@~/types.js" ;
33
44/**
55 * Creates a JSON-friendly sandbox payload
@@ -42,12 +42,16 @@ export const createSandbox = async (
4242 url : info . request . url ,
4343 domain : new URL ( info . request . url ) . hostname ,
4444 path : new URL ( info . request . url ) . pathname ,
45+ method : info . request . method ,
4546 headers : [ ...info . request . headers . entries ( ) ] ,
4647 body : pack . permissions ?. body
4748 ? await extractBody ( info . request )
4849 : undefined ,
4950 } ,
50- chunk : info . chunk ? Buffer . from ( info . chunk ) . toString ( "base64" ) : undefined ,
51+ chunk :
52+ pack . permissions ?. body && info . chunk
53+ ? Buffer . from ( info . chunk ) . toString ( "base64" )
54+ : undefined ,
5155 response : info . response
5256 ? {
5357 status : info . response . status ,
@@ -57,6 +61,6 @@ export const createSandbox = async (
5761 : undefined ,
5862 }
5963 : undefined ,
60- environment : env ,
61- } ;
64+ environment : pack . permissions ?. environment ? env : undefined ,
65+ } satisfies PluginInput ;
6266} ;
Original file line number Diff line number Diff line change @@ -171,7 +171,10 @@ export type PluginInput<
171171 headers ?: Array < [ string , string ] > ;
172172 body ?: TResponseBody ;
173173 } ;
174+ chunk ?: string ; // base64 encoded chunk
175+ requestId : string ;
174176 context : TContext ;
177+ environment : Record < string , string | undefined > | undefined ;
175178} & Pick < Pack , "configuration" > ;
176179
177180export type PluginOutput < TContext = unknown > = {
You can’t perform that action at this time.
0 commit comments