@phpsandbox/sdk 0.1.12 → 0.1.14

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.
Files changed (38) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +7 -18
  3. package/dist/browser/phpsandbox-sdk.esm.js +7 -3
  4. package/dist/browser/phpsandbox-sdk.esm.min.js +7 -7
  5. package/dist/browser/phpsandbox-sdk.iife.js +7 -3
  6. package/dist/browser/phpsandbox-sdk.iife.min.js +7 -7
  7. package/dist/index.d.ts +21 -5
  8. package/dist/index.js +5 -2
  9. package/dist/{integrations.d.ts → integrations/account.d.ts} +1 -1
  10. package/dist/integrations/index.d.ts +2 -0
  11. package/dist/integrations/index.js +2 -0
  12. package/dist/{sandbox-integrations.d.ts → integrations/sandbox.d.ts} +2 -2
  13. package/dist/{sandbox-integrations.js → integrations/sandbox.js} +1 -1
  14. package/dist/log.d.ts +1 -1
  15. package/dist/log.js +1 -1
  16. package/dist/metrics.d.ts +1 -1
  17. package/dist/metrics.js +1 -1
  18. package/dist/ports.d.ts +1 -1
  19. package/dist/ports.js +1 -1
  20. package/dist/runtime.d.ts +1 -1
  21. package/dist/runtime.js +1 -1
  22. package/package.json +5 -9
  23. package/docs/api-summary.md +0 -181
  24. package/docs/cdn-usage.md +0 -68
  25. package/docs/getting-started.md +0 -169
  26. package/examples/README.md +0 -203
  27. package/examples/basic.ts +0 -15
  28. package/examples/get.ts +0 -22
  29. package/examples/git-merge-smoke.ts +0 -395
  30. package/examples/laravel-load-test.ts +0 -2800
  31. package/examples/notebook-readonly-smoke.ts +0 -806
  32. package/examples/publication-provider-label.ts +0 -11
  33. package/examples/publish-cloudflare-container.ts +0 -65
  34. package/examples/publish-laravel-cloud.ts +0 -123
  35. package/examples/publish-ssh-agent.ts +0 -211
  36. /package/dist/{integrations.js → integrations/account.js} +0 -0
  37. /package/dist/{runtime-telemetry.d.ts → telemetry.d.ts} +0 -0
  38. /package/dist/{runtime-telemetry.js → telemetry.js} +0 -0
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) PHPSandbox
3
+ Copyright (c) Xeviant LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -22,14 +22,10 @@ if (!token) throw new Error('Missing PHPSANDBOX_TOKEN');
22
22
 
23
23
  const client = PHPSandbox.realtime(token);
24
24
  const notebook = await client.notebook.create('standard');
25
-
26
25
  await notebook.files.write('hello.php', '<?php echo "Hello from PHPSandbox";');
27
26
  const result = await notebook.exec('php', ['hello.php']);
28
- if (result.exitCode !== 0) throw new Error(result.stderr || result.output);
29
27
  console.log(result.stdout.trim());
30
-
31
28
  await notebook.destroy();
32
- notebook.dispose();
33
29
  ```
34
30
 
35
31
  ## Authentication
@@ -97,6 +93,9 @@ Each `NotebookInstance` exposes service clients:
97
93
  - `notebook.files` (`Filesystem`)
98
94
  - `notebook.terminals` (`Terminals`)
99
95
  - `notebook.runtime` (lifecycle, configuration, logs, metrics, and ports)
96
+ - `notebook.config` (`Config`)
97
+ - `notebook.secrets` (runtime secrets)
98
+ - `notebook.preview` (preview access and sessions)
100
99
  - `notebook.composer` (`Composer`)
101
100
  - `notebook.git` (`Git`)
102
101
  - `notebook.integrations` (`SandboxIntegrationApi`)
@@ -301,21 +300,21 @@ await notebook.mail.disable();
301
300
  ### Feedback
302
301
 
303
302
  ```ts
304
- await sandbox.feedback.configure({
303
+ await notebook.feedback.configure({
305
304
  widget: {
306
305
  targets: ['preview', 'publication'],
307
306
  types: ['bug', 'suggestion', 'question'],
308
307
  },
309
308
  });
310
309
 
311
- const feedback = await sandbox.feedback.submit({
310
+ const feedback = await notebook.feedback.submit({
312
311
  type: 'bug',
313
312
  message: 'Saving the profile failed.',
314
313
  author: { externalId: 'customer-42', email: 'ada@example.com' },
315
314
  context: { url: 'https://app.example.com/profile', path: '/profile' },
316
315
  });
317
316
 
318
- await sandbox.feedback.update(feedback.id, { status: 'resolved' });
317
+ await notebook.feedback.update(feedback.id, { status: 'resolved' });
319
318
  ```
320
319
 
321
320
  The server-side SDK uses the same PHPSandbox API token as the rest of the sandbox. Set `widget: null` to remove the optional popout without disabling API ingestion.
@@ -362,20 +361,10 @@ try {
362
361
  }
363
362
  ```
364
363
 
365
- ## Browser/CDN Usage
366
-
367
- See [Browser usage](docs/cdn-usage.md) for ESM and script-tag examples.
368
-
369
- ## More Docs
370
-
371
- - Getting started walkthrough: [Getting started](docs/getting-started.md)
372
- - API overview: [API overview](docs/api-summary.md)
373
- - Examples: [Examples](examples/README.md)
374
-
375
364
  ## Support
376
365
 
377
366
  - Issues: https://github.com/phpsandbox/sdk/issues
378
- - Product docs: https://docs.phpsandbox.io
367
+ - Product docs: https://phpsandbox.io/docs
379
368
 
380
369
  ## License
381
370
 
@@ -1038,7 +1038,7 @@ var Composer = class {
1038
1038
  }
1039
1039
  };
1040
1040
 
1041
- // src/runtime-telemetry.ts
1041
+ // src/telemetry.ts
1042
1042
  var RuntimeTelemetry = class {
1043
1043
  constructor(okra) {
1044
1044
  this.okra = okra;
@@ -19733,7 +19733,7 @@ var Feedback = class {
19733
19733
  }
19734
19734
  };
19735
19735
 
19736
- // src/integrations.ts
19736
+ // src/integrations/account.ts
19737
19737
  var IntegrationApi = class {
19738
19738
  constructor(client) {
19739
19739
  this.client = client;
@@ -19780,7 +19780,7 @@ function integrationId(integration) {
19780
19780
  return typeof integration === "string" ? integration : integration.id;
19781
19781
  }
19782
19782
 
19783
- // src/sandbox-integrations.ts
19783
+ // src/integrations/sandbox.ts
19784
19784
  var SandboxIntegrationApi = class {
19785
19785
  constructor(notebookId, client) {
19786
19786
  this.notebookId = notebookId;
@@ -19855,6 +19855,10 @@ var NotebookApi = class {
19855
19855
  constructor(client) {
19856
19856
  this.client = client;
19857
19857
  }
19858
+ async inspectImport(input) {
19859
+ const response = await this.client.post("/notebook/imports/inspect", input);
19860
+ return response.data;
19861
+ }
19858
19862
  async create(template, input = {}) {
19859
19863
  const response = await this.client.post("/notebook", { template, ...input });
19860
19864
  return new NotebookInstance(response.data, this.client);