@nemphi/sdk 0.2.4643 → 0.2.4682

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/index.d.ts CHANGED
@@ -1478,6 +1478,19 @@ export type LiveDocumentPlace = {
1478
1478
  folder_id?: string;
1479
1479
  };
1480
1480
  /** A tag on a document: put there by a person (`manual`) or by Clef (`auto`). */
1481
+ /** One kept version of a live document; `state` only when one version is read. */
1482
+ export interface LiveDocumentVersion {
1483
+ id: string;
1484
+ seq: number;
1485
+ /** A name given by hand; null for a version known by its time. */
1486
+ name: string | null;
1487
+ /** Kept on its own while people edited. */
1488
+ auto: boolean;
1489
+ author_name: string;
1490
+ created_at: string;
1491
+ /** The whole Yjs state as one base64 update. */
1492
+ state?: string;
1493
+ }
1481
1494
  export interface LiveDocumentTag {
1482
1495
  id: string;
1483
1496
  name: string;
@@ -1496,14 +1509,16 @@ export interface LiveDocument {
1496
1509
  tags: LiveDocumentTag[];
1497
1510
  created_at: string;
1498
1511
  updated_at: string;
1512
+ /** When it went to the trash; null while it is on a shelf. */
1513
+ trashed_at: string | null;
1499
1514
  }
1500
1515
  /**
1501
1516
  * Which documents `listLiveDocuments` answers: one shelf (the caller's
1502
- * own, other members' shared with them, or the team space), one folder or
1503
- * the shelf's top level, one tag.
1517
+ * own, other members' shared with them, or the team space) or the trash,
1518
+ * one folder or the shelf's top level, one tag.
1504
1519
  */
1505
1520
  export interface LiveDocumentFilter {
1506
- view?: LiveDocumentSpace | "shared";
1521
+ view?: LiveDocumentSpace | "shared" | "trash";
1507
1522
  folder_id?: string;
1508
1523
  top_level?: boolean;
1509
1524
  tag?: string;
@@ -1544,6 +1559,8 @@ export interface LiveDocumentState {
1544
1559
  kind: LiveDocumentKind;
1545
1560
  state: string;
1546
1561
  seq: number;
1562
+ /** Set while the document is in the trash, where it opens read-only. */
1563
+ trashed_at: string | null;
1547
1564
  }
1548
1565
  /**
1549
1566
  * A picture stored with a live document. `id` is the bytes' hash and
@@ -8099,6 +8116,17 @@ export interface NemphiClient {
8099
8116
  createLiveDocument(title: string, kind?: LiveDocumentKind, place?: LiveDocumentPlace): Promise<LiveDocument>;
8100
8117
  /** Files a document in a folder (empty: the top level) or moves it to another space. */
8101
8118
  moveLiveDocument(id: string, place: LiveDocumentPlace): Promise<LiveDocument>;
8119
+ renameLiveDocument(id: string, title: string): Promise<LiveDocument>;
8120
+ /** A copy of the document's content as a new document of the caller's own. */
8121
+ copyLiveDocument(id: string, title?: string): Promise<LiveDocument>;
8122
+ /** Moves a document to the trash; it opens read-only until restored. */
8123
+ trashLiveDocument(id: string): Promise<LiveDocument>;
8124
+ restoreLiveDocument(id: string): Promise<LiveDocument>;
8125
+ /** Deletes a trashed document for good. */
8126
+ deleteLiveDocument(id: string): Promise<{
8127
+ id: string;
8128
+ deleted: boolean;
8129
+ }>;
8102
8130
  listLiveDocumentShares(id: string): Promise<LiveDocumentShares>;
8103
8131
  shareLiveDocument(id: string, userId: string): Promise<LiveDocumentShares>;
8104
8132
  unshareLiveDocument(id: string, userId: string): Promise<LiveDocumentShares>;
@@ -8125,6 +8153,16 @@ export interface NemphiClient {
8125
8153
  pushLiveDocumentUpdate(id: string, update: string): Promise<{
8126
8154
  seq: number;
8127
8155
  }>;
8156
+ /** A document's version history, newest first, without the states. */
8157
+ listLiveDocumentVersions(id: string): Promise<{
8158
+ versions: LiveDocumentVersion[];
8159
+ }>;
8160
+ /** Keeps the document as it is now as a version, named when `name` is not empty. */
8161
+ createLiveDocumentVersion(id: string, name: string): Promise<LiveDocumentVersion>;
8162
+ /** One version with its state. */
8163
+ getLiveDocumentVersion(id: string, versionId: string): Promise<LiveDocumentVersion>;
8164
+ /** Names a version; an empty name takes the name off. */
8165
+ renameLiveDocumentVersion(id: string, versionId: string, name: string): Promise<void>;
8128
8166
  /** Stores a PNG, JPEG, WebP or GIF (10 MiB at most) with a live document. */
8129
8167
  uploadLiveDocumentAsset(id: string, file: Blob, opts?: {
8130
8168
  filename?: string;