@phpsandbox/sdk 0.0.60 → 0.0.63
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 +45 -15
- package/dist/browser/phpsandbox-sdk.esm.min.js +24 -24
- package/dist/browser/phpsandbox-sdk.iife.js +45 -15
- package/dist/browser/phpsandbox-sdk.iife.min.js +24 -24
- package/dist/composer.d.ts +3 -2
- package/dist/composer.js +3 -1
- package/dist/index.d.ts +62 -2
- package/dist/index.js +32 -4
- package/package.json +1 -1
|
@@ -33,8 +33,9 @@ var PHPSandbox = (() => {
|
|
|
33
33
|
BeaconConnectionError: () => BeaconConnectionError,
|
|
34
34
|
BeaconError: () => BeaconError,
|
|
35
35
|
BeaconTimeoutError: () => BeaconTimeoutError,
|
|
36
|
-
Client: () =>
|
|
36
|
+
Client: () => Client2,
|
|
37
37
|
CommandError: () => CommandError,
|
|
38
|
+
ComposerCredentials: () => ComposerCredentials,
|
|
38
39
|
DeployStreamErrorSchema: () => DeployStreamErrorSchema,
|
|
39
40
|
DeployStreamEventSchema: () => DeployStreamEventSchema,
|
|
40
41
|
DeployStreamLogEventSchema: () => DeployStreamLogEventSchema,
|
|
@@ -76,9 +77,10 @@ var PHPSandbox = (() => {
|
|
|
76
77
|
LspConnection: () => LspConnection,
|
|
77
78
|
Navigator: () => Navigator,
|
|
78
79
|
NotebookApi: () => NotebookApi,
|
|
80
|
+
NotebookComposerCredentialApi: () => NotebookComposerCredentialApi,
|
|
79
81
|
NotebookDeploymentApi: () => NotebookDeploymentApi,
|
|
80
82
|
NotebookInitError: () => NotebookInitError,
|
|
81
|
-
NotebookInstance: () =>
|
|
83
|
+
NotebookInstance: () => NotebookInstance2,
|
|
82
84
|
NotebookMail: () => NotebookMail,
|
|
83
85
|
NotebookMailApi: () => NotebookMailApi,
|
|
84
86
|
NotebookPreview: () => NotebookPreview,
|
|
@@ -743,8 +745,9 @@ var PHPSandbox = (() => {
|
|
|
743
745
|
|
|
744
746
|
// src/composer.ts
|
|
745
747
|
var Composer = class {
|
|
746
|
-
constructor(okra) {
|
|
748
|
+
constructor(okra, client) {
|
|
747
749
|
this.okra = okra;
|
|
750
|
+
this.credentials = new ComposerCredentials(client, okra.data.id);
|
|
748
751
|
}
|
|
749
752
|
invoke(command, args = {}, options = {}) {
|
|
750
753
|
return this.okra.invoke("composer.invoke", { command, args, options });
|
|
@@ -19928,13 +19931,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19928
19931
|
constructor(client) {
|
|
19929
19932
|
this.client = client;
|
|
19930
19933
|
this.secrets = new NotebookSecretApi(client);
|
|
19934
|
+
this.composerCredentials = new NotebookComposerCredentialApi(client);
|
|
19931
19935
|
this.preview = new NotebookPreviewApi(client);
|
|
19932
19936
|
this.mail = new NotebookMailApi(client);
|
|
19933
19937
|
this.deployment = new NotebookDeploymentApi(client);
|
|
19934
19938
|
}
|
|
19935
19939
|
async create(template, input = {}, init = true) {
|
|
19936
19940
|
const response = await this.client.post("/notebook", { template, ...input });
|
|
19937
|
-
const instance = new
|
|
19941
|
+
const instance = new NotebookInstance2(response.data, this.client);
|
|
19938
19942
|
if (!init) {
|
|
19939
19943
|
return instance;
|
|
19940
19944
|
}
|
|
@@ -19942,18 +19946,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19942
19946
|
}
|
|
19943
19947
|
async get(id) {
|
|
19944
19948
|
const response = await this.client.get(`/notebook/${id}`);
|
|
19945
|
-
return new
|
|
19949
|
+
return new NotebookInstance2(response.data, this.client);
|
|
19946
19950
|
}
|
|
19947
19951
|
async update(id, input = {}) {
|
|
19948
19952
|
const response = await this.client.put(`/notebook/${id}`, input);
|
|
19949
|
-
return new
|
|
19953
|
+
return new NotebookInstance2(response.data, this.client);
|
|
19950
19954
|
}
|
|
19951
19955
|
async delete(id) {
|
|
19952
19956
|
await this.client.delete(`/notebook/${id}`);
|
|
19953
19957
|
}
|
|
19954
19958
|
async fork(id, input = {}) {
|
|
19955
19959
|
const response = await this.client.post(`/notebook/${id}/fork`, input);
|
|
19956
|
-
return
|
|
19960
|
+
return new NotebookInstance2(response.data, this.client);
|
|
19957
19961
|
}
|
|
19958
19962
|
async gitCredentials(id) {
|
|
19959
19963
|
const response = await this.client.post(`/notebook/${id}/git/credentials`);
|
|
@@ -19961,10 +19965,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19961
19965
|
}
|
|
19962
19966
|
async open(id) {
|
|
19963
19967
|
const response = await this.client.get(`/notebook/${id}`);
|
|
19964
|
-
return new
|
|
19968
|
+
return new NotebookInstance2(response.data, this.client);
|
|
19965
19969
|
}
|
|
19966
19970
|
openFromData(data) {
|
|
19967
|
-
return this.init(new
|
|
19971
|
+
return this.init(new NotebookInstance2(data, this.client));
|
|
19968
19972
|
}
|
|
19969
19973
|
async init(instance) {
|
|
19970
19974
|
await instance.ready();
|
|
@@ -19979,7 +19983,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19979
19983
|
baseUrl.hash = "";
|
|
19980
19984
|
return baseUrl.toString();
|
|
19981
19985
|
}
|
|
19982
|
-
var
|
|
19986
|
+
var Client2 = class {
|
|
19983
19987
|
constructor(token, url2 = "https://api.phpsandbox.io/v1", options = {}) {
|
|
19984
19988
|
this.fetch = globalThis.fetch;
|
|
19985
19989
|
this.deployments = new DeploymentApi(this);
|
|
@@ -20059,7 +20063,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20059
20063
|
return { data: body === "" ? void 0 : JSON.parse(body) };
|
|
20060
20064
|
}
|
|
20061
20065
|
};
|
|
20062
|
-
var PHPSandbox = class extends
|
|
20066
|
+
var PHPSandbox = class extends Client2 {
|
|
20063
20067
|
};
|
|
20064
20068
|
var NotebookSecretApi = class {
|
|
20065
20069
|
constructor(client) {
|
|
@@ -20090,6 +20094,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20090
20094
|
await this.client.delete(`/notebook/${id}/secrets/${encodeURIComponent(name)}${query ? `?${query}` : ""}`);
|
|
20091
20095
|
}
|
|
20092
20096
|
};
|
|
20097
|
+
var NotebookComposerCredentialApi = class {
|
|
20098
|
+
constructor(client) {
|
|
20099
|
+
this.client = client;
|
|
20100
|
+
}
|
|
20101
|
+
async set(id, input) {
|
|
20102
|
+
const response = await this.client.put(`/notebook/${id}/composer/credentials`, input);
|
|
20103
|
+
return response.data;
|
|
20104
|
+
}
|
|
20105
|
+
async remove(id, type, url2) {
|
|
20106
|
+
const params = new URLSearchParams({ type });
|
|
20107
|
+
if (url2) params.set("url", url2);
|
|
20108
|
+
await this.client.delete(`/notebook/${id}/composer/credentials?${params.toString()}`);
|
|
20109
|
+
}
|
|
20110
|
+
};
|
|
20093
20111
|
var NotebookPreviewApi = class {
|
|
20094
20112
|
constructor(client) {
|
|
20095
20113
|
this.client = client;
|
|
@@ -20144,7 +20162,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20144
20162
|
}
|
|
20145
20163
|
};
|
|
20146
20164
|
var _initPromise, _NotebookInstance_instances, init_fn;
|
|
20147
|
-
var
|
|
20165
|
+
var NotebookInstance2 = class {
|
|
20148
20166
|
constructor(data, client) {
|
|
20149
20167
|
this.data = data;
|
|
20150
20168
|
this.client = client;
|
|
@@ -20164,7 +20182,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20164
20182
|
this.terminal = new Terminal(this);
|
|
20165
20183
|
this.auth = new Auth(this);
|
|
20166
20184
|
this.lsp = new Lsp(this);
|
|
20167
|
-
this.composer = new Composer(this);
|
|
20185
|
+
this.composer = new Composer(this, client);
|
|
20168
20186
|
this.log = new Log(this);
|
|
20169
20187
|
this.repl = new Repl(this);
|
|
20170
20188
|
this.container = new Container(this);
|
|
@@ -20306,8 +20324,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20306
20324
|
this.disposables.push(disposable);
|
|
20307
20325
|
return disposable;
|
|
20308
20326
|
}
|
|
20309
|
-
update() {
|
|
20310
|
-
return this.
|
|
20327
|
+
update(input) {
|
|
20328
|
+
return this.client.notebook.update(this.data.id, input);
|
|
20311
20329
|
}
|
|
20312
20330
|
onDidInitialize(handler) {
|
|
20313
20331
|
return this.listen("notebook.initialized", handler);
|
|
@@ -20368,6 +20386,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20368
20386
|
return this.client.notebook.secrets.delete(this.notebookId, name, options);
|
|
20369
20387
|
}
|
|
20370
20388
|
};
|
|
20389
|
+
var ComposerCredentials = class {
|
|
20390
|
+
constructor(client, notebookId) {
|
|
20391
|
+
this.client = client;
|
|
20392
|
+
this.notebookId = notebookId;
|
|
20393
|
+
}
|
|
20394
|
+
set(input) {
|
|
20395
|
+
return this.client.notebook.composerCredentials.set(this.notebookId, input);
|
|
20396
|
+
}
|
|
20397
|
+
remove(type, url2) {
|
|
20398
|
+
return this.client.notebook.composerCredentials.remove(this.notebookId, type, url2);
|
|
20399
|
+
}
|
|
20400
|
+
};
|
|
20371
20401
|
var NotebookPreview = class {
|
|
20372
20402
|
constructor(client, notebookId) {
|
|
20373
20403
|
this.client = client;
|