@phpsandbox/sdk 0.0.17 → 0.0.19
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/browser/phpsandbox-sdk.esm.js +23 -8
- 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 +23 -8
- 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/git.d.ts +19 -1
- package/dist/git.d.ts.map +1 -1
- package/dist/git.js +8 -2
- package/dist/git.js.map +1 -1
- package/dist/index.d.ts +18 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -3781,8 +3781,11 @@ var Git = class {
|
|
|
3781
3781
|
constructor(okra) {
|
|
3782
3782
|
this.okra = okra;
|
|
3783
3783
|
}
|
|
3784
|
-
checkpoint(author, message, branch = "main") {
|
|
3785
|
-
return this.okra.invoke("git.checkpoint", { author, message, branch });
|
|
3784
|
+
checkpoint(author, message, branch = "main", allowEmpty = false) {
|
|
3785
|
+
return this.okra.invoke("git.checkpoint", { author, message, branch, allowEmpty });
|
|
3786
|
+
}
|
|
3787
|
+
checkout(branch, create = true) {
|
|
3788
|
+
return this.okra.invoke("git.checkout", { branch, create });
|
|
3786
3789
|
}
|
|
3787
3790
|
sync(url, author, ref = "main", token, direction = "both", force = false) {
|
|
3788
3791
|
return this.okra.invoke("git.sync", { url, author, ref, token, direction, force });
|
|
@@ -3793,6 +3796,9 @@ var Git = class {
|
|
|
3793
3796
|
restore(ref) {
|
|
3794
3797
|
return this.okra.invoke("git.restore", { ref });
|
|
3795
3798
|
}
|
|
3799
|
+
status() {
|
|
3800
|
+
return this.okra.invoke("git.status", {});
|
|
3801
|
+
}
|
|
3796
3802
|
};
|
|
3797
3803
|
|
|
3798
3804
|
// src/beacon/index.ts
|
|
@@ -4518,9 +4524,11 @@ function isBeaconSupported() {
|
|
|
4518
4524
|
|
|
4519
4525
|
// src/index.ts
|
|
4520
4526
|
var NotebookInitError = class extends Error {
|
|
4521
|
-
constructor(message) {
|
|
4527
|
+
constructor(message, data = {}) {
|
|
4522
4528
|
super(message);
|
|
4523
4529
|
this.message = message;
|
|
4530
|
+
this.data = data;
|
|
4531
|
+
this.name = "NotebookInitError";
|
|
4524
4532
|
}
|
|
4525
4533
|
};
|
|
4526
4534
|
var ApiError = class extends Error {
|
|
@@ -4547,6 +4555,10 @@ var NotebookApi = class {
|
|
|
4547
4555
|
const response = await this.client.get(`/notebook/${id}`);
|
|
4548
4556
|
return new NotebookInstance(response.data, this.client);
|
|
4549
4557
|
}
|
|
4558
|
+
async update(id, input = {}) {
|
|
4559
|
+
const response = await this.client.put(`/notebook/${id}`, input);
|
|
4560
|
+
return new NotebookInstance(response.data, this.client);
|
|
4561
|
+
}
|
|
4550
4562
|
async delete(id) {
|
|
4551
4563
|
await this.client.delete(`/notebook/${id}`);
|
|
4552
4564
|
}
|
|
@@ -4590,6 +4602,9 @@ var Client = class {
|
|
|
4590
4602
|
delete(path) {
|
|
4591
4603
|
return this.makeRequest("DELETE", path);
|
|
4592
4604
|
}
|
|
4605
|
+
put(path, body) {
|
|
4606
|
+
return this.makeRequest("PUT", path, { body: body ? JSON.stringify(body) : void 0 });
|
|
4607
|
+
}
|
|
4593
4608
|
async makeRequest(method, path, init) {
|
|
4594
4609
|
const response = await this.fetch(
|
|
4595
4610
|
new Request(new URL(`v1/${path.replace(/^\//, "")}`, this.baseUrl), {
|
|
@@ -4662,7 +4677,9 @@ var NotebookInstance = class {
|
|
|
4662
4677
|
return this.invoke("ping");
|
|
4663
4678
|
}
|
|
4664
4679
|
listen(event, handler) {
|
|
4665
|
-
|
|
4680
|
+
const disposable = this.emitter.listen(event, handler);
|
|
4681
|
+
this.disposables.push(disposable);
|
|
4682
|
+
return disposable;
|
|
4666
4683
|
}
|
|
4667
4684
|
dispose() {
|
|
4668
4685
|
this.disposables.forEach((d) => d.dispose());
|
|
@@ -4720,9 +4737,7 @@ var NotebookInstance = class {
|
|
|
4720
4737
|
return this.invoke("notebook.update");
|
|
4721
4738
|
}
|
|
4722
4739
|
onDidInitialize(handler) {
|
|
4723
|
-
|
|
4724
|
-
this.disposables.push(disposable);
|
|
4725
|
-
return disposable;
|
|
4740
|
+
return this.listen("notebook.initialized", handler);
|
|
4726
4741
|
}
|
|
4727
4742
|
async reconnect() {
|
|
4728
4743
|
const whenConnected = this.whenConnected();
|
|
@@ -4745,7 +4760,7 @@ init_fn = function() {
|
|
|
4745
4760
|
this.onDidInitialize((result) => {
|
|
4746
4761
|
this.initialized = result;
|
|
4747
4762
|
if (result.type === "error") {
|
|
4748
|
-
reject(new NotebookInitError(result.message));
|
|
4763
|
+
reject(new NotebookInitError(result.message, result.data));
|
|
4749
4764
|
}
|
|
4750
4765
|
resolve(result);
|
|
4751
4766
|
});
|