@paneui/core 0.0.10 → 0.0.12
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/dist/client.d.ts +58 -0
- package/dist/client.js +45 -0
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -81,6 +81,37 @@ export interface PatchArtifactMetadataRequest {
|
|
|
81
81
|
* `null` to clear it. */
|
|
82
82
|
icon_attachment_id?: string | null;
|
|
83
83
|
}
|
|
84
|
+
/** One identity-share grant as returned by the grants endpoints. */
|
|
85
|
+
export interface PaneGrant {
|
|
86
|
+
id: string;
|
|
87
|
+
/** Set once the invitee logs in and the grant binds; null while pending. */
|
|
88
|
+
human_id: string | null;
|
|
89
|
+
/** The invited email, or null for a grant created directly against a human. */
|
|
90
|
+
invite_email: string | null;
|
|
91
|
+
/** "participant" (read + emit) | "viewer" (read-only). */
|
|
92
|
+
role: string;
|
|
93
|
+
/** ISO timestamp the grant was bound to a human, or null while pending. */
|
|
94
|
+
accepted_at: string | null;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The pane-id (`/p/:paneId`) access mode. Governs ONLY the pane-id path; token
|
|
98
|
+
* (`/s/<token>`) links are unaffected and keep working in every mode.
|
|
99
|
+
* - "invite_only" — only invited emails (after login) may open /p.
|
|
100
|
+
* - "link" — anyone with the /p URL opens it read-only, no login.
|
|
101
|
+
* - "public" — anyone opens it read-only, no login (discovery TBD).
|
|
102
|
+
*/
|
|
103
|
+
export type AccessMode = "invite_only" | "link" | "public";
|
|
104
|
+
/** Response from GET /v1/panes/:id/grants. */
|
|
105
|
+
export interface PaneGrantsList {
|
|
106
|
+
pane_id: string;
|
|
107
|
+
access_mode: AccessMode;
|
|
108
|
+
items: PaneGrant[];
|
|
109
|
+
}
|
|
110
|
+
/** Response from PATCH /v1/panes/:id/visibility. */
|
|
111
|
+
export interface PaneVisibility {
|
|
112
|
+
pane_id: string;
|
|
113
|
+
access_mode: AccessMode;
|
|
114
|
+
}
|
|
84
115
|
/**
|
|
85
116
|
* An error thrown by the typed operations when the relay returns a non-2xx
|
|
86
117
|
* response (or the request fails outright). Carries the HTTP status and the
|
|
@@ -393,6 +424,33 @@ export declare class PaneClient {
|
|
|
393
424
|
* actively kicked in v1; new HTTP and WS connections are refused.
|
|
394
425
|
*/
|
|
395
426
|
revokeParticipant(paneId: string, participantId: string): Promise<void>;
|
|
427
|
+
/**
|
|
428
|
+
* GET /v1/panes/:id/grants — list the pane's identity-share grants plus
|
|
429
|
+
* its current `access_mode`. Owner/agent-scope only.
|
|
430
|
+
*/
|
|
431
|
+
listGrants(paneId: string): Promise<PaneGrantsList>;
|
|
432
|
+
/**
|
|
433
|
+
* POST /v1/panes/:id/grants — invite a human by email. Upserts by email,
|
|
434
|
+
* so re-inviting the same address adjusts the role in place. Role defaults
|
|
435
|
+
* to "participant" (read + emit); pass "viewer" for read-only.
|
|
436
|
+
*/
|
|
437
|
+
createGrant(paneId: string, opts: {
|
|
438
|
+
email: string;
|
|
439
|
+
role?: "participant" | "viewer";
|
|
440
|
+
}): Promise<PaneGrant>;
|
|
441
|
+
/**
|
|
442
|
+
* DELETE /v1/panes/:id/grants/:grantId — revoke one grant. Idempotent: a
|
|
443
|
+
* missing/already-removed grant returns 204.
|
|
444
|
+
*/
|
|
445
|
+
revokeGrant(paneId: string, grantId: string): Promise<void>;
|
|
446
|
+
/**
|
|
447
|
+
* PATCH /v1/panes/:id/visibility — set the pane's /p access mode.
|
|
448
|
+
* - "invite_only" — only invited emails (after login) may open /p.
|
|
449
|
+
* - "link" — anyone with the /p URL opens it READ-ONLY, no login.
|
|
450
|
+
* - "public" — anyone opens it READ-ONLY, no login (discovery TBD).
|
|
451
|
+
* Token (`/s/<token>`) links are independent of this and keep working.
|
|
452
|
+
*/
|
|
453
|
+
setPaneVisibility(paneId: string, accessMode: AccessMode): Promise<PaneVisibility>;
|
|
396
454
|
/**
|
|
397
455
|
* DELETE /v1/panes/:id — close/delete a pane. Idempotent on the relay
|
|
398
456
|
* side (an already-closed pane still returns 204 with no body).
|
package/dist/client.js
CHANGED
|
@@ -593,6 +593,51 @@ export class PaneClient {
|
|
|
593
593
|
if (!r.ok)
|
|
594
594
|
this.fail(r);
|
|
595
595
|
}
|
|
596
|
+
/**
|
|
597
|
+
* GET /v1/panes/:id/grants — list the pane's identity-share grants plus
|
|
598
|
+
* its current `access_mode`. Owner/agent-scope only.
|
|
599
|
+
*/
|
|
600
|
+
async listGrants(paneId) {
|
|
601
|
+
const r = await this.call("GET", `/v1/panes/${encodeURIComponent(paneId)}/grants`);
|
|
602
|
+
if (!r.ok)
|
|
603
|
+
this.fail(r);
|
|
604
|
+
return this.asObject(r);
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* POST /v1/panes/:id/grants — invite a human by email. Upserts by email,
|
|
608
|
+
* so re-inviting the same address adjusts the role in place. Role defaults
|
|
609
|
+
* to "participant" (read + emit); pass "viewer" for read-only.
|
|
610
|
+
*/
|
|
611
|
+
async createGrant(paneId, opts) {
|
|
612
|
+
const r = await this.call("POST", `/v1/panes/${encodeURIComponent(paneId)}/grants`, opts.role
|
|
613
|
+
? { email: opts.email, role: opts.role }
|
|
614
|
+
: { email: opts.email });
|
|
615
|
+
if (!r.ok)
|
|
616
|
+
this.fail(r);
|
|
617
|
+
return this.asObject(r);
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* DELETE /v1/panes/:id/grants/:grantId — revoke one grant. Idempotent: a
|
|
621
|
+
* missing/already-removed grant returns 204.
|
|
622
|
+
*/
|
|
623
|
+
async revokeGrant(paneId, grantId) {
|
|
624
|
+
const r = await this.call("DELETE", `/v1/panes/${encodeURIComponent(paneId)}/grants/${encodeURIComponent(grantId)}`);
|
|
625
|
+
if (!r.ok)
|
|
626
|
+
this.fail(r);
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* PATCH /v1/panes/:id/visibility — set the pane's /p access mode.
|
|
630
|
+
* - "invite_only" — only invited emails (after login) may open /p.
|
|
631
|
+
* - "link" — anyone with the /p URL opens it READ-ONLY, no login.
|
|
632
|
+
* - "public" — anyone opens it READ-ONLY, no login (discovery TBD).
|
|
633
|
+
* Token (`/s/<token>`) links are independent of this and keep working.
|
|
634
|
+
*/
|
|
635
|
+
async setPaneVisibility(paneId, accessMode) {
|
|
636
|
+
const r = await this.call("PATCH", `/v1/panes/${encodeURIComponent(paneId)}/visibility`, { access_mode: accessMode });
|
|
637
|
+
if (!r.ok)
|
|
638
|
+
this.fail(r);
|
|
639
|
+
return this.asObject(r);
|
|
640
|
+
}
|
|
596
641
|
/**
|
|
597
642
|
* DELETE /v1/panes/:id — close/delete a pane. Idempotent on the relay
|
|
598
643
|
* side (an already-closed pane still returns 204 with no body).
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { PaneClient, PaneApiError } from "./client.js";
|
|
2
|
-
export type { ClientOptions, RelayResponse, CreateArtifactRequest, CreateArtifactVersionRequest, PatchArtifactMetadataRequest, AttachmentRef, UploadBlobOptions, PresignBlobOptions, AttachmentTokenMintResponse, ListBlobsOptions, AttachmentTokenAuditEntry, AttachmentTokenListResponse, QueryResponse, } from "./client.js";
|
|
2
|
+
export type { ClientOptions, RelayResponse, CreateArtifactRequest, CreateArtifactVersionRequest, PatchArtifactMetadataRequest, AttachmentRef, UploadBlobOptions, PresignBlobOptions, AttachmentTokenMintResponse, ListBlobsOptions, AttachmentTokenAuditEntry, AttachmentTokenListResponse, QueryResponse, PaneGrant, PaneGrantsList, PaneVisibility, AccessMode, } from "./client.js";
|
|
3
3
|
export { openStream } from "./stream.js";
|
|
4
4
|
export type { OpenStreamOptions, StreamHandlers, StreamHandle, } from "./stream.js";
|
|
5
5
|
export { registerAgent } from "./register.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paneui/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Pane relay client: typed HTTP + WebSocket operations against a Pane relay. Framework-free.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -53,6 +53,6 @@
|
|
|
53
53
|
"@types/node": "^25.9.1",
|
|
54
54
|
"@types/ws": "^8.18.1",
|
|
55
55
|
"typescript": "^6.0.3",
|
|
56
|
-
"vitest": "^4.1.
|
|
56
|
+
"vitest": "^4.1.8"
|
|
57
57
|
}
|
|
58
58
|
}
|