freestyle-sandboxes 0.0.76 → 0.0.78

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.mjs CHANGED
@@ -61,6 +61,12 @@ const handleExecOnEphemeralDevServer = (options) => {
61
61
  url: "/ephemeral/v1/dev-servers/exec"
62
62
  });
63
63
  };
64
+ const handleWriteFileFromEphemeralDevServer = (options) => {
65
+ return (options?.client ?? client).put({
66
+ ...options,
67
+ url: "/ephemeral/v1/dev-servers/files/{*filepath}"
68
+ });
69
+ };
64
70
  const handleReadFileFromEphemeralDevServer = (options) => {
65
71
  return (options?.client ?? client).post({
66
72
  ...options,
@@ -369,6 +375,20 @@ Message: ${response.error?.message}`
369
375
  }
370
376
  throw new Error(response.error.message);
371
377
  }
378
+ async verifyDomainVerificationRequest(id) {
379
+ const response = await handleVerifyDomain({
380
+ client: this.client,
381
+ body: {
382
+ id
383
+ }
384
+ });
385
+ if (response.data) {
386
+ return response.data;
387
+ }
388
+ throw new Error(
389
+ `Failed to verify domain verification request with ID ${id}: ${response.error.message}`
390
+ );
391
+ }
372
392
  /**
373
393
  * Verify a domain. Note, this requires the domain verification token to be already set up.
374
394
  * @param domain The domain to verify.
@@ -492,14 +512,16 @@ ${response.error.message}`);
492
512
  async createGitRepository({
493
513
  name,
494
514
  public: pub = false,
495
- source
515
+ source,
516
+ import: _import
496
517
  }) {
497
518
  const response = await handleCreateRepo({
498
519
  client: this.client,
499
520
  body: {
500
521
  name,
501
522
  public: pub,
502
- source
523
+ source,
524
+ import: _import
503
525
  }
504
526
  });
505
527
  if (response.data) {
@@ -993,17 +1015,20 @@ ${response.error.message}`);
993
1015
  },
994
1016
  async writeFile(path, content, encoding = "utf-8") {
995
1017
  const contentStr = typeof content === "string" ? content : Buffer.from(content).toString(encoding);
996
- await client.put({
997
- url: `/ephemeral/v1/dev-servers/files/${path}`,
1018
+ const response2 = await handleWriteFileFromEphemeralDevServer({
1019
+ client,
1020
+ path: {
1021
+ filepath: path
1022
+ },
998
1023
  body: {
999
1024
  devServer: devServerInstance,
1000
1025
  content: contentStr,
1001
1026
  encoding
1002
1027
  }
1003
1028
  });
1004
- if (response.error) {
1029
+ if (response2.error) {
1005
1030
  throw new Error(
1006
- `Failed to write file: ${JSON.stringify(response.error)}`
1031
+ `Failed to write file: ${JSON.stringify(response2.error)}`
1007
1032
  );
1008
1033
  }
1009
1034
  }
@@ -1,4 +1,4 @@
1
- import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-BVXmFV7d.js';
1
+ import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-DkFlXKTr.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type AgentAction = {
@@ -1,4 +1,4 @@
1
- import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-BVXmFV7d.js';
1
+ import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-DkFlXKTr.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type AgentAction = {
@@ -1,4 +1,4 @@
1
- import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-BVXmFV7d.js';
1
+ import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-DkFlXKTr.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type AgentAction = {
@@ -1,4 +1,4 @@
1
- import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-BVXmFV7d.js';
1
+ import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-DkFlXKTr.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  type AgentAction = {
@@ -5,7 +5,7 @@ import { Transform } from 'stream';
5
5
  import { EventEmitter } from 'events';
6
6
  import { ServerResponse, IncomingMessage } from 'http';
7
7
  import { WorkerOptions } from 'worker_threads';
8
- import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-BVXmFV7d.js';
8
+ import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-DkFlXKTr.js';
9
9
  import 'node:http';
10
10
 
11
11
  // Type definitions for pino-std-serializers 2.4
@@ -5,7 +5,7 @@ import { Transform } from 'stream';
5
5
  import { EventEmitter } from 'events';
6
6
  import { ServerResponse, IncomingMessage } from 'http';
7
7
  import { WorkerOptions } from 'worker_threads';
8
- import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-BVXmFV7d.js';
8
+ import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-DkFlXKTr.js';
9
9
  import 'node:http';
10
10
 
11
11
  // Type definitions for pino-std-serializers 2.4
@@ -5,7 +5,7 @@ import { Transform } from 'stream';
5
5
  import { EventEmitter } from 'events';
6
6
  import { ServerResponse, IncomingMessage } from 'http';
7
7
  import { WorkerOptions } from 'worker_threads';
8
- import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-BVXmFV7d.js';
8
+ import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-DkFlXKTr.js';
9
9
  import 'node:http';
10
10
 
11
11
  // Type definitions for pino-std-serializers 2.4
@@ -5,7 +5,7 @@ import { Transform } from 'stream';
5
5
  import { EventEmitter } from 'events';
6
6
  import { ServerResponse, IncomingMessage } from 'http';
7
7
  import { WorkerOptions } from 'worker_threads';
8
- import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-BVXmFV7d.js';
8
+ import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-DkFlXKTr.js';
9
9
  import 'node:http';
10
10
 
11
11
  // Type definitions for pino-std-serializers 2.4