freestyle-sandboxes 0.0.7 → 0.0.8

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/dist/index.cjs CHANGED
@@ -46,7 +46,8 @@ class FreestyleSandboxes {
46
46
  this.client = clientFetch.createClient({
47
47
  baseUrl: options.baseUrl ?? "https://api.freestyle.sh",
48
48
  headers: {
49
- Authorization: `Bearer ${options.apiKey}`
49
+ Authorization: `Bearer ${options.apiKey}`,
50
+ ...options.headers
50
51
  }
51
52
  });
52
53
  }
package/dist/index.d.cts CHANGED
@@ -12,6 +12,10 @@ declare class FreestyleSandboxes {
12
12
  * The API key to use for requests.
13
13
  */
14
14
  apiKey: string;
15
+ /**
16
+ * Custom Headers to be sent with each request.
17
+ */
18
+ headers?: Record<string, string>;
15
19
  });
16
20
  /**
17
21
  * Execute a script in a sandbox.
package/dist/index.d.mts CHANGED
@@ -12,6 +12,10 @@ declare class FreestyleSandboxes {
12
12
  * The API key to use for requests.
13
13
  */
14
14
  apiKey: string;
15
+ /**
16
+ * Custom Headers to be sent with each request.
17
+ */
18
+ headers?: Record<string, string>;
15
19
  });
16
20
  /**
17
21
  * Execute a script in a sandbox.
package/dist/index.mjs CHANGED
@@ -44,7 +44,8 @@ class FreestyleSandboxes {
44
44
  this.client = createClient({
45
45
  baseUrl: options.baseUrl ?? "https://api.freestyle.sh",
46
46
  headers: {
47
- Authorization: `Bearer ${options.apiKey}`
47
+ Authorization: `Bearer ${options.apiKey}`,
48
+ ...options.headers
48
49
  }
49
50
  });
50
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freestyle-sandboxes",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
package/src/index.ts CHANGED
@@ -11,11 +11,16 @@ export class FreestyleSandboxes {
11
11
  * The API key to use for requests.
12
12
  */
13
13
  apiKey: string;
14
+ /**
15
+ * Custom Headers to be sent with each request.
16
+ */
17
+ headers?: Record<string, string>;
14
18
  }) {
15
19
  this.client = createClient({
16
20
  baseUrl: options.baseUrl ?? "https://api.freestyle.sh",
17
21
  headers: {
18
22
  Authorization: `Bearer ${options.apiKey}`,
23
+ ...options.headers,
19
24
  },
20
25
  });
21
26
  }