@phpsandbox/sdk 0.0.36 → 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.
@@ -333,6 +333,8 @@ var PHPSandbox = (() => {
333
333
  NotebookApi: () => NotebookApi,
334
334
  NotebookInitError: () => NotebookInitError,
335
335
  NotebookInstance: () => NotebookInstance,
336
+ NotebookMail: () => NotebookMail,
337
+ NotebookMailApi: () => NotebookMailApi,
336
338
  NotebookPreviewAuth: () => NotebookPreviewAuth,
337
339
  NotebookPreviewAuthApi: () => NotebookPreviewAuthApi,
338
340
  NotebookSecretApi: () => NotebookSecretApi,
@@ -5019,6 +5021,7 @@ var PHPSandbox = (() => {
5019
5021
  this.client = client;
5020
5022
  this.secrets = new NotebookSecretApi(client);
5021
5023
  this.previewAuth = new NotebookPreviewAuthApi(client);
5024
+ this.mail = new NotebookMailApi(client);
5022
5025
  }
5023
5026
  async create(template, input = {}, init = true) {
5024
5027
  const response = await this.client.post("/notebook", { template, ...input });
@@ -5141,6 +5144,35 @@ var PHPSandbox = (() => {
5141
5144
  await this.client.delete(`/notebook/${id}/preview-auth`);
5142
5145
  }
5143
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
+ };
5144
5176
  var _initPromise, _NotebookInstance_instances, init_fn;
5145
5177
  var NotebookInstance = class {
5146
5178
  constructor(data, client) {
@@ -5172,6 +5204,7 @@ var PHPSandbox = (() => {
5172
5204
  this.services = new Services(this);
5173
5205
  this.secrets = new NotebookSecrets(client, this.data.id);
5174
5206
  this.previewAuth = new NotebookPreviewAuth(client, this.data.id);
5207
+ this.mail = new NotebookMail(client, this.data.id);
5175
5208
  }
5176
5209
  async ready() {
5177
5210
  const terminalError = this.socket.getTerminalError();
@@ -5360,6 +5393,40 @@ var PHPSandbox = (() => {
5360
5393
  return this.client.notebook.previewAuth.delete(this.notebookId);
5361
5394
  }
5362
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
+ }
5363
5430
  return __toCommonJS(index_exports);
5364
5431
  })();
5365
5432
  /*! Bundled license information: