@phpsandbox/sdk 0.6.0-canary.5 → 0.6.0-canary.6

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 CHANGED
@@ -563,3 +563,23 @@ for await (const event of readPublicationStream(response)) {
563
563
  ```
564
564
 
565
565
  `readPublicationStream` also accepts a `ReadableStream<Uint8Array>`. By default, it rejects EOF without a final result (including empty streams). Use `{ requireResult: false }` only when deliberately consuming a stream fragment. It validates recognized event payloads, throws for server error events, and ignores unknown event names and heartbeat comments. Ending iteration early cancels the stream; aborting the fetch interrupts a pending read. Disconnecting observation does not cancel the server-side deployment. `PublicationRun.events()` uses this same parser.
566
+
567
+ ### App access
568
+
569
+ Configure preview access and inherited access for apps published through the managed edge:
570
+
571
+ ```ts
572
+ await notebook.preview.configure({ mode: 'password', password: 'a-long-private-password' });
573
+ await notebook.preview.configure({
574
+ mode: 'email',
575
+ allowedEmails: ['person@example.com', '*@company.test'],
576
+ });
577
+ await notebook.preview.configure({ mode: 'external', authorizationUrl: 'https://auth.example.com/access' });
578
+ await notebook.preview.configure({ mode: 'public' });
579
+ ```
580
+
581
+ Email mode presents email and code forms on the app's domain. Supply between 1 and 100 exact email addresses or domain rules such as `*@company.test`. Domain rules match that exact domain, excluding subdomains. The platform sends and verifies the codes; no custom verification service or callback configuration is required. Protected mode changes rotate the access version, invalidating previous grants and pending codes. `preview.get()` includes the current mode and email rules.
582
+
583
+ External mode redirects visitors to the configured HTTPS URL with the app URL in `returnTo`. Your service decides whether to grant access, obtains an access URL through the authenticated API, and returns the visitor using that opaque URL. Keep API credentials on your server and validate return targets. `preview.get(url)` returns both a clean `url` and a credentialed `accessUrl`; open `accessUrl` without reconstructing it.
584
+
585
+ **Breaking change:** Use `configure({ mode: 'password', password })` instead of `setPassword()` and `configure({ mode: 'public' })` instead of `disable()`; the two older methods and `SetNotebookPreviewInput` have been removed. Access responses now require `mode`, with email rules or an authorization URL required for the corresponding mode. Publication password updates also require `password`.
@@ -15234,7 +15234,7 @@ var PublicationReleaseStatusSchema = external_exports.enum(["created", "ready",
15234
15234
  var PublicationSizeSchema = external_exports.enum(["nano", "small", "medium", "large", "lite", "basic", "standard-1", "standard-2"]);
15235
15235
  var PublicationRegionSchema = external_exports.enum(["ENAM", "WNAM", "EEUR", "WEUR", "APAC", "SAM", "ME", "OC", "AFR"]);
15236
15236
  var PublicationJurisdictionSchema = external_exports.enum(["eu", "fedramp"]);
15237
- var PublicationProtectionModeSchema = external_exports.enum(["none", "password"]);
15237
+ var PublicationProtectionModeSchema = external_exports.enum(["none", "password", "email", "external"]);
15238
15238
  var PublicationLogStreamSchema = external_exports.enum(["build", "runtime"]);
15239
15239
  var PublishStreamLogStreamSchema = external_exports.enum(["build", "publish", "runtime"]);
15240
15240
  var PublicationEventPayloadSchema = external_exports.preprocess(
@@ -21404,12 +21404,12 @@ var NotebookPreview = class {
21404
21404
  const response = await this.client.get(`/notebook/${this.notebookId}/preview${query}`);
21405
21405
  return response.data;
21406
21406
  }
21407
- async setPassword(input) {
21408
- const response = await this.client.put(`/notebook/${this.notebookId}/preview`, input);
21409
- return response.data;
21410
- }
21411
- async disable() {
21412
- await this.client.delete(`/notebook/${this.notebookId}/preview`);
21407
+ async configure(input) {
21408
+ if (input.mode === "public") {
21409
+ await this.client.delete(`/notebook/${this.notebookId}/preview`);
21410
+ return;
21411
+ }
21412
+ await this.client.put(`/notebook/${this.notebookId}/preview`, input);
21413
21413
  }
21414
21414
  async createSession(input) {
21415
21415
  const response = await this.client.post(`/notebook/${this.notebookId}/preview/session`, input);