Skip to content

Commit 474261f

Browse files
Merge pull request #106 from codesandbox/fix-wrong-names
fix: Fix wrong method names
2 parents 3ad4f10 + a8cb000 commit 474261f

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codesandbox/sdk",
3-
"version": "1.1.2",
3+
"version": "1.1.5",
44
"description": "The CodeSandbox SDK",
55
"author": "CodeSandbox",
66
"license": "MIT",

src/sessions/WebSocketSession/commands.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ export type ShellRunOpts = {
1010
name?: string;
1111
env?: Record<string, string>;
1212
cwd?: string;
13+
/**
14+
* Run the command in the global session instead of the current session. This makes
15+
* any environment variables available to all users of the Sandbox.
16+
*/
17+
asGlobalSession?: boolean;
1318
};
1419

1520
export type CommandStatus =
@@ -60,7 +65,7 @@ export class Commands {
6065
this.pitcherClient.workspacePath,
6166
opts?.dimensions ?? DEFAULT_SHELL_SIZE,
6267
commandWithEnv,
63-
"TERMINAL",
68+
opts?.asGlobalSession ? "COMMAND" : "TERMINAL",
6469
true
6570
);
6671

src/sessions/WebSocketSession/tasks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ export class Tasks {
3333
/**
3434
* Gets all tasks that are available in the current sandbox.
3535
*/
36-
getTasks(): Task[] {
36+
getAll(): Task[] {
3737
return this.tasks;
3838
}
3939

4040
/**
4141
* Gets a task by its ID.
4242
*/
43-
getTask(taskId: string): Task | undefined {
43+
get(taskId: string): Task | undefined {
4444
return this.tasks.find((task) => task.id === taskId);
4545
}
4646
}

0 commit comments

Comments
 (0)