@phpsandbox/sdk 0.3.3 → 0.3.5
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 +19 -0
- package/dist/beacon/index.js +4 -2
- package/dist/beacon/navigator.js +0 -1
- package/dist/beacon/types.d.ts +1 -1
- package/dist/browser/phpsandbox-sdk.esm.js +345 -287
- package/dist/browser/phpsandbox-sdk.esm.min.js +9 -9
- package/dist/browser/phpsandbox-sdk.iife.js +345 -287
- package/dist/browser/phpsandbox-sdk.iife.min.js +9 -9
- package/dist/composer.js +8 -4
- package/dist/errors/index.d.ts +2 -2
- package/dist/errors/index.js +1 -3
- package/dist/feedback.js +2 -1
- package/dist/filesystem.js +32 -15
- package/dist/identity.d.ts +13 -0
- package/dist/identity.js +6 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +17 -8
- package/dist/integrations/sandbox.js +1 -1
- package/dist/lsp.d.ts +2 -2
- package/dist/lsp.js +2 -2
- package/dist/publication/instance.js +1 -0
- package/dist/publication/notebook.js +7 -5
- package/dist/publication/resources.js +2 -1
- package/dist/publication/stream.js +36 -19
- package/dist/runtime/rest.js +2 -1
- package/dist/runtime.js +1 -1
- package/dist/schemas/publications.js +53 -59
- package/dist/servers.d.ts +31 -1
- package/dist/servers.js +34 -3
- package/dist/shell.js +5 -2
- package/dist/socket/index.js +25 -13
- package/dist/telemetry.js +8 -3
- package/dist/terminal.js +3 -4
- package/dist/utils/promise.js +1 -1
- package/dist/utils/websocket.js +2 -2
- package/package.json +44 -33
- package/dist/auth.d.ts +0 -11
- package/dist/auth.js +0 -12
package/README.md
CHANGED
|
@@ -55,6 +55,25 @@ PHPSandbox.rest('token', 'https://api.phpsandbox.io/v1', {
|
|
|
55
55
|
});
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
## Server invitations
|
|
59
|
+
|
|
60
|
+
Server administrators can invite someone by email and inspect the shared invitation state:
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
const server = await client.servers.get('SERVER_ID');
|
|
64
|
+
const invitation = await server.share({ email: 'person@example.com', requestId: crypto.randomUUID() });
|
|
65
|
+
const invitations = await server.invitations();
|
|
66
|
+
|
|
67
|
+
// The recipient uses their own workspace credential and the proof from their invitation link.
|
|
68
|
+
await recipientClient.servers.acceptInvitation(invitation.id, invitationProof);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Keep the same `requestId` when retrying creation. Use `client.servers.inspectInvitation()`, `acceptInvitation()` and `declineInvitation()` to respond, and `server.resendInvitation()` or `cancelInvitation()` to manage pending invitations. An `accepting` status means access confirmation is still in progress; retry acceptance with the same recipient workspace.
|
|
72
|
+
|
|
73
|
+
For an immediate grant to an existing workspace, use `server.share({ organizationId: 'WORKSPACE_ID', requestId })`.
|
|
74
|
+
|
|
75
|
+
Invitation operations use the same API base URL and credential as all other operations. No additional endpoint configuration is required.
|
|
76
|
+
|
|
58
77
|
## Notebook Lifecycle
|
|
59
78
|
|
|
60
79
|
```ts
|
package/dist/beacon/index.js
CHANGED
|
@@ -454,7 +454,9 @@ export class Beacon {
|
|
|
454
454
|
* Let's wait for 2 seconds for page to finish rendering.
|
|
455
455
|
* Errors, that might occur during this time will be captured.
|
|
456
456
|
*/
|
|
457
|
-
|
|
457
|
+
if (waitSeconds) {
|
|
458
|
+
await this.wait(waitSeconds);
|
|
459
|
+
}
|
|
458
460
|
// Now request debug capture from the beacon (without navigation)
|
|
459
461
|
const timeoutMs = (request.options?.timeout || 30000) + 5000; // Add 5s buffer
|
|
460
462
|
return this.sendAndWaitFor('debug', 'debugResult', request, timeoutMs);
|
|
@@ -488,7 +490,7 @@ export class Beacon {
|
|
|
488
490
|
this.readyPromise = this.waitForBeaconReady();
|
|
489
491
|
}
|
|
490
492
|
}
|
|
491
|
-
catch
|
|
493
|
+
catch {
|
|
492
494
|
throw new BeaconConnectionError(`Invalid URL: ${url}`);
|
|
493
495
|
}
|
|
494
496
|
}
|
package/dist/beacon/navigator.js
CHANGED
package/dist/beacon/types.d.ts
CHANGED
|
@@ -91,7 +91,7 @@ export interface ScreenshotRequest {
|
|
|
91
91
|
maxWidth?: number;
|
|
92
92
|
maxHeight?: number;
|
|
93
93
|
};
|
|
94
|
-
type?:
|
|
94
|
+
type?: string;
|
|
95
95
|
quality?: number;
|
|
96
96
|
/**
|
|
97
97
|
* Wait budget for page media/resources while rendering the DOM screenshot.
|