@phpsandbox/sdk 0.0.35 → 0.0.37
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 +17 -0
- package/dist/browser/phpsandbox-sdk.esm.js +102 -0
- 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 +102 -0
- 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/index.d.ts +78 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -333,6 +333,10 @@ var PHPSandbox = (() => {
|
|
|
333
333
|
NotebookApi: () => NotebookApi,
|
|
334
334
|
NotebookInitError: () => NotebookInitError,
|
|
335
335
|
NotebookInstance: () => NotebookInstance,
|
|
336
|
+
NotebookMail: () => NotebookMail,
|
|
337
|
+
NotebookMailApi: () => NotebookMailApi,
|
|
338
|
+
NotebookPreviewAuth: () => NotebookPreviewAuth,
|
|
339
|
+
NotebookPreviewAuthApi: () => NotebookPreviewAuthApi,
|
|
336
340
|
NotebookSecretApi: () => NotebookSecretApi,
|
|
337
341
|
NotebookSecrets: () => NotebookSecrets,
|
|
338
342
|
NotebookState: () => NotebookState,
|
|
@@ -5016,6 +5020,8 @@ var PHPSandbox = (() => {
|
|
|
5016
5020
|
constructor(client) {
|
|
5017
5021
|
this.client = client;
|
|
5018
5022
|
this.secrets = new NotebookSecretApi(client);
|
|
5023
|
+
this.previewAuth = new NotebookPreviewAuthApi(client);
|
|
5024
|
+
this.mail = new NotebookMailApi(client);
|
|
5019
5025
|
}
|
|
5020
5026
|
async create(template, input = {}, init = true) {
|
|
5021
5027
|
const response = await this.client.post("/notebook", { template, ...input });
|
|
@@ -5122,6 +5128,51 @@ var PHPSandbox = (() => {
|
|
|
5122
5128
|
await this.client.delete(`/notebook/${id}/secrets/${encodeURIComponent(name)}`);
|
|
5123
5129
|
}
|
|
5124
5130
|
};
|
|
5131
|
+
var NotebookPreviewAuthApi = class {
|
|
5132
|
+
constructor(client) {
|
|
5133
|
+
this.client = client;
|
|
5134
|
+
}
|
|
5135
|
+
async get(id) {
|
|
5136
|
+
const response = await this.client.get(`/notebook/${id}/preview-auth`);
|
|
5137
|
+
return response.data;
|
|
5138
|
+
}
|
|
5139
|
+
async set(id, input) {
|
|
5140
|
+
const response = await this.client.put(`/notebook/${id}/preview-auth`, input);
|
|
5141
|
+
return response.data;
|
|
5142
|
+
}
|
|
5143
|
+
async delete(id) {
|
|
5144
|
+
await this.client.delete(`/notebook/${id}/preview-auth`);
|
|
5145
|
+
}
|
|
5146
|
+
};
|
|
5147
|
+
var NotebookMailApi = class {
|
|
5148
|
+
constructor(client) {
|
|
5149
|
+
this.client = client;
|
|
5150
|
+
}
|
|
5151
|
+
async status(id) {
|
|
5152
|
+
const response = await this.client.get(`/notebook/${id}/mail`);
|
|
5153
|
+
return response.data;
|
|
5154
|
+
}
|
|
5155
|
+
async enable(id) {
|
|
5156
|
+
const response = await this.client.put(`/notebook/${id}/mail`);
|
|
5157
|
+
return response.data;
|
|
5158
|
+
}
|
|
5159
|
+
async disable(id) {
|
|
5160
|
+
await this.client.delete(`/notebook/${id}/mail`);
|
|
5161
|
+
}
|
|
5162
|
+
async list(id, options = {}) {
|
|
5163
|
+
const response = await this.client.get(
|
|
5164
|
+
`/notebook/${id}/mails${formatQueryString(options)}`
|
|
5165
|
+
);
|
|
5166
|
+
return response.data;
|
|
5167
|
+
}
|
|
5168
|
+
async get(id, hash) {
|
|
5169
|
+
const response = await this.client.get(`/notebook/${id}/mails/${encodeURIComponent(hash)}`);
|
|
5170
|
+
return response.data;
|
|
5171
|
+
}
|
|
5172
|
+
async delete(id, hash) {
|
|
5173
|
+
await this.client.delete(`/notebook/${id}/mails/${encodeURIComponent(hash)}`);
|
|
5174
|
+
}
|
|
5175
|
+
};
|
|
5125
5176
|
var _initPromise, _NotebookInstance_instances, init_fn;
|
|
5126
5177
|
var NotebookInstance = class {
|
|
5127
5178
|
constructor(data, client) {
|
|
@@ -5152,6 +5203,8 @@ var PHPSandbox = (() => {
|
|
|
5152
5203
|
this.git = new Git(this);
|
|
5153
5204
|
this.services = new Services(this);
|
|
5154
5205
|
this.secrets = new NotebookSecrets(client, this.data.id);
|
|
5206
|
+
this.previewAuth = new NotebookPreviewAuth(client, this.data.id);
|
|
5207
|
+
this.mail = new NotebookMail(client, this.data.id);
|
|
5155
5208
|
}
|
|
5156
5209
|
async ready() {
|
|
5157
5210
|
const terminalError = this.socket.getTerminalError();
|
|
@@ -5325,6 +5378,55 @@ var PHPSandbox = (() => {
|
|
|
5325
5378
|
return this.client.notebook.secrets.delete(this.notebookId, name);
|
|
5326
5379
|
}
|
|
5327
5380
|
};
|
|
5381
|
+
var NotebookPreviewAuth = class {
|
|
5382
|
+
constructor(client, notebookId) {
|
|
5383
|
+
this.client = client;
|
|
5384
|
+
this.notebookId = notebookId;
|
|
5385
|
+
}
|
|
5386
|
+
get() {
|
|
5387
|
+
return this.client.notebook.previewAuth.get(this.notebookId);
|
|
5388
|
+
}
|
|
5389
|
+
set(input) {
|
|
5390
|
+
return this.client.notebook.previewAuth.set(this.notebookId, input);
|
|
5391
|
+
}
|
|
5392
|
+
disable() {
|
|
5393
|
+
return this.client.notebook.previewAuth.delete(this.notebookId);
|
|
5394
|
+
}
|
|
5395
|
+
};
|
|
5396
|
+
var NotebookMail = class {
|
|
5397
|
+
constructor(client, notebookId) {
|
|
5398
|
+
this.client = client;
|
|
5399
|
+
this.notebookId = notebookId;
|
|
5400
|
+
}
|
|
5401
|
+
status() {
|
|
5402
|
+
return this.client.notebook.mail.status(this.notebookId);
|
|
5403
|
+
}
|
|
5404
|
+
enable() {
|
|
5405
|
+
return this.client.notebook.mail.enable(this.notebookId);
|
|
5406
|
+
}
|
|
5407
|
+
disable() {
|
|
5408
|
+
return this.client.notebook.mail.disable(this.notebookId);
|
|
5409
|
+
}
|
|
5410
|
+
list(options = {}) {
|
|
5411
|
+
return this.client.notebook.mail.list(this.notebookId, options);
|
|
5412
|
+
}
|
|
5413
|
+
get(hash) {
|
|
5414
|
+
return this.client.notebook.mail.get(this.notebookId, hash);
|
|
5415
|
+
}
|
|
5416
|
+
delete(hash) {
|
|
5417
|
+
return this.client.notebook.mail.delete(this.notebookId, hash);
|
|
5418
|
+
}
|
|
5419
|
+
};
|
|
5420
|
+
function formatQueryString(params) {
|
|
5421
|
+
const searchParams = new URLSearchParams();
|
|
5422
|
+
for (const [key, value] of Object.entries(params)) {
|
|
5423
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
5424
|
+
searchParams.set(key, String(value));
|
|
5425
|
+
}
|
|
5426
|
+
}
|
|
5427
|
+
const query = searchParams.toString();
|
|
5428
|
+
return query === "" ? "" : `?${query}`;
|
|
5429
|
+
}
|
|
5328
5430
|
return __toCommonJS(index_exports);
|
|
5329
5431
|
})();
|
|
5330
5432
|
/*! Bundled license information:
|