@phpsandbox/sdk 0.0.30 → 0.0.32
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/README.md +5 -0
- package/dist/browser/phpsandbox-sdk.esm.js +9 -2
- package/dist/browser/phpsandbox-sdk.esm.js.map +2 -2
- package/dist/browser/phpsandbox-sdk.esm.min.js +2 -2
- package/dist/browser/phpsandbox-sdk.esm.min.js.map +3 -3
- package/dist/browser/phpsandbox-sdk.iife.js +9 -2
- package/dist/browser/phpsandbox-sdk.iife.js.map +2 -2
- package/dist/browser/phpsandbox-sdk.iife.min.js +2 -2
- package/dist/browser/phpsandbox-sdk.iife.min.js.map +3 -3
- package/dist/services.d.ts +14 -7
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +7 -2
- package/dist/services.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -148,9 +148,14 @@ console.log(result.output);
|
|
|
148
148
|
### Services
|
|
149
149
|
|
|
150
150
|
```ts
|
|
151
|
+
import { notebookBuiltinServices } from '@phpsandbox/sdk';
|
|
152
|
+
|
|
151
153
|
const services = await notebook.services.list();
|
|
152
154
|
|
|
155
|
+
console.log(notebookBuiltinServices); // ['redis']
|
|
156
|
+
|
|
153
157
|
await notebook.services.run('redis');
|
|
158
|
+
await notebook.services.run('queue', 'php artisan queue:work');
|
|
154
159
|
|
|
155
160
|
const snapshot = await notebook.services.logs('redis', { tail: 50 });
|
|
156
161
|
console.log(snapshot);
|
|
@@ -1027,6 +1027,8 @@ var Shell = class {
|
|
|
1027
1027
|
};
|
|
1028
1028
|
|
|
1029
1029
|
// src/services.ts
|
|
1030
|
+
var notebookBuiltinServices = ["redis"];
|
|
1031
|
+
var notebookKnownServices = ["start", "nginx", ...notebookBuiltinServices];
|
|
1030
1032
|
var Services = class {
|
|
1031
1033
|
constructor(okra) {
|
|
1032
1034
|
this.okra = okra;
|
|
@@ -1034,8 +1036,11 @@ var Services = class {
|
|
|
1034
1036
|
list() {
|
|
1035
1037
|
return this.okra.invoke("service.list");
|
|
1036
1038
|
}
|
|
1037
|
-
run(name) {
|
|
1038
|
-
return this.okra.invoke("service.run", {
|
|
1039
|
+
run(name, command) {
|
|
1040
|
+
return this.okra.invoke("service.run", {
|
|
1041
|
+
name,
|
|
1042
|
+
command
|
|
1043
|
+
});
|
|
1039
1044
|
}
|
|
1040
1045
|
stop(name) {
|
|
1041
1046
|
return this.okra.invoke("service.stop", { name });
|
|
@@ -5144,6 +5149,8 @@ export {
|
|
|
5144
5149
|
Transport,
|
|
5145
5150
|
createBeacon,
|
|
5146
5151
|
isBeaconSupported,
|
|
5152
|
+
notebookBuiltinServices,
|
|
5153
|
+
notebookKnownServices,
|
|
5147
5154
|
once,
|
|
5148
5155
|
timeout
|
|
5149
5156
|
};
|