@computesdk/workbench 3.1.5 → 3.1.7
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/bin/workbench.js +47 -0
- package/dist/bin/workbench.js.map +1 -1
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
package/dist/bin/workbench.js
CHANGED
|
@@ -1546,6 +1546,53 @@ function injectWorkbenchCommands(replServer, state) {
|
|
|
1546
1546
|
};
|
|
1547
1547
|
}
|
|
1548
1548
|
};
|
|
1549
|
+
replServer.context.server = {
|
|
1550
|
+
get start() {
|
|
1551
|
+
return async (options) => {
|
|
1552
|
+
const sandbox = state.currentSandbox;
|
|
1553
|
+
if (!sandbox) {
|
|
1554
|
+
throw new Error("No active sandbox. Run a command to auto-create one.");
|
|
1555
|
+
}
|
|
1556
|
+
return sandbox.server.start(options);
|
|
1557
|
+
};
|
|
1558
|
+
},
|
|
1559
|
+
get list() {
|
|
1560
|
+
return async () => {
|
|
1561
|
+
const sandbox = state.currentSandbox;
|
|
1562
|
+
if (!sandbox) {
|
|
1563
|
+
throw new Error("No active sandbox. Run a command to auto-create one.");
|
|
1564
|
+
}
|
|
1565
|
+
return sandbox.server.list();
|
|
1566
|
+
};
|
|
1567
|
+
},
|
|
1568
|
+
get retrieve() {
|
|
1569
|
+
return async (slug) => {
|
|
1570
|
+
const sandbox = state.currentSandbox;
|
|
1571
|
+
if (!sandbox) {
|
|
1572
|
+
throw new Error("No active sandbox. Run a command to auto-create one.");
|
|
1573
|
+
}
|
|
1574
|
+
return sandbox.server.retrieve(slug);
|
|
1575
|
+
};
|
|
1576
|
+
},
|
|
1577
|
+
get stop() {
|
|
1578
|
+
return async (slug) => {
|
|
1579
|
+
const sandbox = state.currentSandbox;
|
|
1580
|
+
if (!sandbox) {
|
|
1581
|
+
throw new Error("No active sandbox. Run a command to auto-create one.");
|
|
1582
|
+
}
|
|
1583
|
+
return sandbox.server.stop(slug);
|
|
1584
|
+
};
|
|
1585
|
+
},
|
|
1586
|
+
get restart() {
|
|
1587
|
+
return async (slug) => {
|
|
1588
|
+
const sandbox = state.currentSandbox;
|
|
1589
|
+
if (!sandbox) {
|
|
1590
|
+
throw new Error("No active sandbox. Run a command to auto-create one.");
|
|
1591
|
+
}
|
|
1592
|
+
return sandbox.server.restart(slug);
|
|
1593
|
+
};
|
|
1594
|
+
}
|
|
1595
|
+
};
|
|
1549
1596
|
replServer.context.terminal = {
|
|
1550
1597
|
get create() {
|
|
1551
1598
|
return async (options) => {
|