@hyperframes/share 0.0.0-stage → 0.9.22
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/LICENSE +190 -0
- package/README.md +51 -2
- package/dist/appOwnedPaths.d.mts +6 -0
- package/dist/fromReview.d.mts +15 -0
- package/dist/grantRefusal.d.mts +8 -0
- package/dist/host.d.mts +29 -0
- package/dist/hosts.d.ts +39 -0
- package/dist/index.d.mts +21 -0
- package/dist/projectLock.d.mts +17 -0
- package/dist/projectSnapshot.d.mts +20 -0
- package/dist/reviewAudience.d.mts +3 -0
- package/dist/reviewClient.d.mts +122 -0
- package/dist/reviewExport.d.mts +172 -0
- package/dist/reviewFiles.d.mts +43 -0
- package/dist/reviewLinkStates.d.mts +18 -0
- package/dist/reviewOpenCalls.d.mts +16 -0
- package/dist/reviewShare.d.mts +106 -0
- package/dist/reviewSwitch.d.mts +53 -0
- package/dist/reviewUpload.d.mts +16 -0
- package/dist/reviewVersionSentences.d.mts +2 -0
- package/dist/signedInRequest.d.mts +56 -0
- package/dist/storage.d.mts +20 -0
- package/dist/types/access.d.ts +12 -0
- package/dist/types/review.d.ts +59 -0
- package/dist/types/reviewWire.d.ts +200 -0
- package/dist/types/share.d.ts +119 -0
- package/dist/types/shareOpen.d.ts +96 -0
- package/package.json +112 -3
- package/scripts/copy-types.mjs +3 -0
- package/src/appOwnedPaths.mjs +27 -0
- package/src/fromReview.mjs +27 -0
- package/src/grantRefusal.mjs +28 -0
- package/src/host.mjs +46 -0
- package/src/hosts.d.ts +39 -0
- package/src/index.mjs +82 -0
- package/src/projectLock.mjs +120 -0
- package/src/projectSnapshot.mjs +120 -0
- package/src/reviewAudience.mjs +24 -0
- package/src/reviewClient.mjs +260 -0
- package/src/reviewExport.mjs +827 -0
- package/src/reviewFiles.mjs +98 -0
- package/src/reviewLinkStates.mjs +47 -0
- package/src/reviewOpenCalls.mjs +40 -0
- package/src/reviewShare.mjs +645 -0
- package/src/reviewSwitch.mjs +430 -0
- package/src/reviewUpload.mjs +98 -0
- package/src/reviewVersionSentences.mjs +48 -0
- package/src/signedInRequest.mjs +125 -0
- package/src/storage.mjs +116 -0
- package/src/types/access.d.ts +12 -0
- package/src/types/review.d.ts +59 -0
- package/src/types/reviewWire.d.ts +200 -0
- package/src/types/share.d.ts +119 -0
- package/src/types/shareOpen.d.ts +96 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Open in Studio from a share page (docs/sync-backed-sharing/contracts.md C1-C3, C7): the server's answers, and what
|
|
2
|
+
// Desktop's choice dialog is told.
|
|
3
|
+
|
|
4
|
+
/** C1: `GET /v1/hyperframes/reviews/{token}/open?version_id=`. */
|
|
5
|
+
export interface OpenSummaryDTO {
|
|
6
|
+
/** `project_id` is the review project, which Work on {owner}'s project names on composition calls (C5). */
|
|
7
|
+
project: { project_id: string; title: string; owner_name: string; space_name: string | null };
|
|
8
|
+
version: {
|
|
9
|
+
version_id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
has_files: boolean;
|
|
12
|
+
files?: { count: number; bytes: number } | null;
|
|
13
|
+
};
|
|
14
|
+
fallback_version: { version_id: string; label: string; published_at: string } | null;
|
|
15
|
+
composition: {
|
|
16
|
+
space_id: string;
|
|
17
|
+
composition_id: string;
|
|
18
|
+
latest_snapshot_id: string;
|
|
19
|
+
newer_than_version: boolean;
|
|
20
|
+
} | null;
|
|
21
|
+
can_get: boolean;
|
|
22
|
+
plan_space_id: string | null;
|
|
23
|
+
plan_space_name: string | null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** One signed read URL in a sync download batch. */
|
|
27
|
+
export interface SignedBlobDTO {
|
|
28
|
+
sha256: string;
|
|
29
|
+
size: number;
|
|
30
|
+
url: string;
|
|
31
|
+
expires_at: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** C2: `GET /v1/hyperframes/reviews/{token}/versions/{version_id}/files`, the snapshot's manifest and the first URLs
|
|
35
|
+
* (at most 500 files). More, or fresh ones, come from `POST` on the same path with `{continuation_token, sha256s}`,
|
|
36
|
+
* which answers exactly the sync `DownloadUrlsResponse`. */
|
|
37
|
+
export interface VersionFilesDTO {
|
|
38
|
+
version_id: string;
|
|
39
|
+
snapshot_id: string;
|
|
40
|
+
manifest_sha256: string;
|
|
41
|
+
manifest: { document: unknown; file_count: number; total_bytes: number };
|
|
42
|
+
continuation_token: string;
|
|
43
|
+
continuation_expires_at: string;
|
|
44
|
+
urls: SignedBlobDTO[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** C2's refresh: the sync download batch for the same snapshot. */
|
|
48
|
+
export interface FileUrlsDTO {
|
|
49
|
+
snapshot_id: string;
|
|
50
|
+
manifest_sha256: string;
|
|
51
|
+
continuation_token: string;
|
|
52
|
+
continuation_expires_at: string;
|
|
53
|
+
urls: SignedBlobDTO[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** The copy card: the version's files, the earlier version that has some, or nothing to copy. */
|
|
57
|
+
export type ShareCopyCard =
|
|
58
|
+
| { at: "ready"; versionId: string; label: string; files: number; bytes: number }
|
|
59
|
+
| {
|
|
60
|
+
at: "fallback";
|
|
61
|
+
label: string;
|
|
62
|
+
fallback: { versionId: string; label: string; publishedAt: string };
|
|
63
|
+
}
|
|
64
|
+
| { at: "none"; label: string };
|
|
65
|
+
|
|
66
|
+
/** The Work on {owner}'s project card (C7): `open` to Get the owner's latest sync (`newer` when it is newer than the
|
|
67
|
+
* version the page showed); `locked` when the signed-in workspace (`planSpace`) has no paid plan; `linked` when this
|
|
68
|
+
* Mac already has a folder bound to it, with its edits not sent yet (null when they could not be counted). */
|
|
69
|
+
export type ShareWorkCard =
|
|
70
|
+
| { at: "open"; newer: boolean }
|
|
71
|
+
| { at: "locked"; planSpace: string | null }
|
|
72
|
+
| { at: "linked"; unsent: number | null };
|
|
73
|
+
|
|
74
|
+
/** The one press a failed open offers beside Close; `none` when no press here can change the answer. */
|
|
75
|
+
export type ShareOpenOffer = "try_again" | "switch_account" | "sign_in" | "open_latest" | "none";
|
|
76
|
+
|
|
77
|
+
/** What the choice dialog shows for the share link main is opening; null when none is. */
|
|
78
|
+
export type ShareOpenView =
|
|
79
|
+
| { id: string; at: "loading" }
|
|
80
|
+
| { id: string; at: "failed"; sentence: string; offers: ShareOpenOffer }
|
|
81
|
+
| {
|
|
82
|
+
id: string;
|
|
83
|
+
at: "choose";
|
|
84
|
+
/** The review project (C1), kept for Work on {owner}'s project's composition calls. */
|
|
85
|
+
projectId: string;
|
|
86
|
+
title: string;
|
|
87
|
+
owner: string;
|
|
88
|
+
space: string | null;
|
|
89
|
+
versionLabel: string;
|
|
90
|
+
/** Null when the card is hidden: the project was never synced with files, or sync is off on this Mac. */
|
|
91
|
+
work: ShareWorkCard | null;
|
|
92
|
+
copy: ShareCopyCard;
|
|
93
|
+
}
|
|
94
|
+
| { id: string; at: "copying"; title: string; label: string; fraction: number | null }
|
|
95
|
+
/** Work on {owner}'s project is getting the owner's latest sync into a new linked folder. */
|
|
96
|
+
| { id: string; at: "linking"; title: string; owner: string };
|