@openmarket/rooms-client 0.9.0 → 0.10.0
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/shared/rooms-protocol.d.ts +11 -0
- package/dist/social-client.d.ts +34 -0
- package/dist/social-client.js +28 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +2 -2
- package/package.json +1 -1
- package/src/shared/rooms-protocol.ts +11 -0
- package/src/social-client.ts +53 -0
- package/src/version.ts +2 -2
|
@@ -836,6 +836,12 @@ export interface RoomSpace {
|
|
|
836
836
|
createdAt: string | number | Date;
|
|
837
837
|
joined?: boolean | undefined;
|
|
838
838
|
iconUrl?: string | null | undefined;
|
|
839
|
+
/** Archived channels in this server (sidebar Archive row; absent on
|
|
840
|
+
* stores that predate the count). */
|
|
841
|
+
archivedRoomCount?: number | undefined;
|
|
842
|
+
/** Archived docs twin: keeps the Archive row reachable when only docs
|
|
843
|
+
* are archived. */
|
|
844
|
+
archivedDocCount?: number | undefined;
|
|
839
845
|
}
|
|
840
846
|
export interface RoomSpacesPayload {
|
|
841
847
|
requestId?: string;
|
|
@@ -876,6 +882,9 @@ export interface RoomUpdatedPayload {
|
|
|
876
882
|
room: string;
|
|
877
883
|
meta?: RoomMeta | undefined;
|
|
878
884
|
archived?: boolean | undefined;
|
|
885
|
+
/** Rides WITH archived on hard deletion: old clients evict on archived,
|
|
886
|
+
* new clients word the eviction honestly. */
|
|
887
|
+
deleted?: boolean | undefined;
|
|
879
888
|
}
|
|
880
889
|
/** Server settings changed (rename / icon / archive). */
|
|
881
890
|
export interface SpaceUpdatedPayload {
|
|
@@ -883,6 +892,8 @@ export interface SpaceUpdatedPayload {
|
|
|
883
892
|
name?: string | undefined;
|
|
884
893
|
iconUrl?: string | null | undefined;
|
|
885
894
|
archived?: boolean | undefined;
|
|
895
|
+
/** Rides WITH archived on hard deletion (see RoomUpdatedPayload). */
|
|
896
|
+
deleted?: boolean | undefined;
|
|
886
897
|
}
|
|
887
898
|
export interface RoomSpaceJoinedPayload {
|
|
888
899
|
requestId?: string;
|
package/dist/social-client.d.ts
CHANGED
|
@@ -171,6 +171,13 @@ export interface RoomSpaceSummary {
|
|
|
171
171
|
iconUrl?: string | null;
|
|
172
172
|
/** Creation time — the stable server-rail sort key. */
|
|
173
173
|
createdAt?: string | number | null;
|
|
174
|
+
/** Archived channels in this server; with archivedDocCount it drives
|
|
175
|
+
* the sidebar's Archive row (rendered only when the sum > 0). Absent
|
|
176
|
+
* on stores that predate the counts. */
|
|
177
|
+
archivedRoomCount?: number | undefined;
|
|
178
|
+
/** Archived docs in this server: the row must stay reachable when only
|
|
179
|
+
* docs are archived, since they have no other retrieval surface. */
|
|
180
|
+
archivedDocCount?: number | undefined;
|
|
174
181
|
}
|
|
175
182
|
export declare function listRoomSpacesViaChat(config: RoomSocialConfig): Promise<RoomSpaceSummary[]>;
|
|
176
183
|
export interface RoomSpaceMember {
|
|
@@ -355,6 +362,33 @@ export declare function updateRoomSpace(config: RoomSocialConfig, spaceId: strin
|
|
|
355
362
|
export declare function archiveRoomSpace(config: RoomSocialConfig, spaceId: string): Promise<{
|
|
356
363
|
archived?: boolean;
|
|
357
364
|
}>;
|
|
365
|
+
/** Un-archive a channel back onto the active sidebar (manage-room). The
|
|
366
|
+
* wire verb is /restore, the store-wide grammar shared with docs; the
|
|
367
|
+
* receipt carries `restored`, not the archive shape's `archived`. */
|
|
368
|
+
export declare function unarchiveRoomChannel(config: RoomSocialConfig, room: string): Promise<{
|
|
369
|
+
roomId?: string;
|
|
370
|
+
restored?: boolean;
|
|
371
|
+
}>;
|
|
372
|
+
/** PERMANENTLY delete a channel and every row keyed to it (manage-room).
|
|
373
|
+
* The bare DELETE verb on /rooms/:id is the legacy ARCHIVE shape; purge is
|
|
374
|
+
* the explicit destruction verb and there is no undo. */
|
|
375
|
+
export declare function purgeRoomChannel(config: RoomSocialConfig, room: string): Promise<{
|
|
376
|
+
roomId?: string;
|
|
377
|
+
deleted?: boolean;
|
|
378
|
+
}>;
|
|
379
|
+
/** PERMANENTLY delete a server: every channel, message, member, role,
|
|
380
|
+
* invite, and the entire docs family (owner only; no undo). */
|
|
381
|
+
export declare function purgeRoomSpace(config: RoomSocialConfig, spaceId: string): Promise<{
|
|
382
|
+
spaceId?: string;
|
|
383
|
+
deleted?: boolean;
|
|
384
|
+
}>;
|
|
385
|
+
/** A server's archived channels, for the Archive panel. */
|
|
386
|
+
export declare function listArchivedRoomChannels(config: RoomSocialConfig, spaceId: string): Promise<Array<{
|
|
387
|
+
roomId: string;
|
|
388
|
+
name?: string;
|
|
389
|
+
title?: string;
|
|
390
|
+
archivedAt?: string;
|
|
391
|
+
}>>;
|
|
358
392
|
/** Full channel roster (paged): role + lastSeen for every membership row. */
|
|
359
393
|
export declare function listRoomChannelMembers(config: RoomSocialConfig, roomId: string, options?: {
|
|
360
394
|
offset?: number;
|
package/dist/social-client.js
CHANGED
|
@@ -567,6 +567,34 @@ export async function updateRoomSpace(config, spaceId, input) {
|
|
|
567
567
|
export async function archiveRoomSpace(config, spaceId) {
|
|
568
568
|
return socialRequest(config, `/spaces/${encodeURIComponent(spaceId)}`, { method: "DELETE" });
|
|
569
569
|
}
|
|
570
|
+
/** Un-archive a channel back onto the active sidebar (manage-room). The
|
|
571
|
+
* wire verb is /restore, the store-wide grammar shared with docs; the
|
|
572
|
+
* receipt carries `restored`, not the archive shape's `archived`. */
|
|
573
|
+
export async function unarchiveRoomChannel(config, room) {
|
|
574
|
+
return socialRequest(config, `/rooms/${encodeURIComponent(cleanRoomId(room))}/restore`, {
|
|
575
|
+
method: "POST",
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
/** PERMANENTLY delete a channel and every row keyed to it (manage-room).
|
|
579
|
+
* The bare DELETE verb on /rooms/:id is the legacy ARCHIVE shape; purge is
|
|
580
|
+
* the explicit destruction verb and there is no undo. */
|
|
581
|
+
export async function purgeRoomChannel(config, room) {
|
|
582
|
+
return socialRequest(config, `/rooms/${encodeURIComponent(cleanRoomId(room))}/purge`, {
|
|
583
|
+
method: "POST",
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
/** PERMANENTLY delete a server: every channel, message, member, role,
|
|
587
|
+
* invite, and the entire docs family (owner only; no undo). */
|
|
588
|
+
export async function purgeRoomSpace(config, spaceId) {
|
|
589
|
+
return socialRequest(config, `/spaces/${encodeURIComponent(spaceId)}/purge`, {
|
|
590
|
+
method: "POST",
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
/** A server's archived channels, for the Archive panel. */
|
|
594
|
+
export async function listArchivedRoomChannels(config, spaceId) {
|
|
595
|
+
const result = await socialRequest(config, `/spaces/${encodeURIComponent(spaceId)}/rooms/archived`, { method: "GET" });
|
|
596
|
+
return result.rooms ?? [];
|
|
597
|
+
}
|
|
570
598
|
/** Full channel roster (paged): role + lastSeen for every membership row. */
|
|
571
599
|
export async function listRoomChannelMembers(config, roomId, options = {}) {
|
|
572
600
|
const params = new URLSearchParams();
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.9.
|
|
2
|
-
export declare const RUNNER_VERSION = "0.9.
|
|
1
|
+
export declare const VERSION = "0.9.1";
|
|
2
|
+
export declare const RUNNER_VERSION = "0.9.1";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "0.9.
|
|
2
|
-
export const RUNNER_VERSION = "0.9.
|
|
1
|
+
export const VERSION = "0.9.1";
|
|
2
|
+
export const RUNNER_VERSION = "0.9.1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmarket/rooms-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "OM Rooms protocol client: wire types, WebSocket + REST clients, and chat view-models. Browser-safe (no node:/bun: imports).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -961,6 +961,12 @@ export interface RoomSpace {
|
|
|
961
961
|
createdAt: string | number | Date;
|
|
962
962
|
joined?: boolean | undefined;
|
|
963
963
|
iconUrl?: string | null | undefined;
|
|
964
|
+
/** Archived channels in this server (sidebar Archive row; absent on
|
|
965
|
+
* stores that predate the count). */
|
|
966
|
+
archivedRoomCount?: number | undefined;
|
|
967
|
+
/** Archived docs twin: keeps the Archive row reachable when only docs
|
|
968
|
+
* are archived. */
|
|
969
|
+
archivedDocCount?: number | undefined;
|
|
964
970
|
}
|
|
965
971
|
|
|
966
972
|
export interface RoomSpacesPayload {
|
|
@@ -1004,6 +1010,9 @@ export interface RoomUpdatedPayload {
|
|
|
1004
1010
|
room: string;
|
|
1005
1011
|
meta?: RoomMeta | undefined;
|
|
1006
1012
|
archived?: boolean | undefined;
|
|
1013
|
+
/** Rides WITH archived on hard deletion: old clients evict on archived,
|
|
1014
|
+
* new clients word the eviction honestly. */
|
|
1015
|
+
deleted?: boolean | undefined;
|
|
1007
1016
|
}
|
|
1008
1017
|
|
|
1009
1018
|
/** Server settings changed (rename / icon / archive). */
|
|
@@ -1012,6 +1021,8 @@ export interface SpaceUpdatedPayload {
|
|
|
1012
1021
|
name?: string | undefined;
|
|
1013
1022
|
iconUrl?: string | null | undefined;
|
|
1014
1023
|
archived?: boolean | undefined;
|
|
1024
|
+
/** Rides WITH archived on hard deletion (see RoomUpdatedPayload). */
|
|
1025
|
+
deleted?: boolean | undefined;
|
|
1015
1026
|
}
|
|
1016
1027
|
|
|
1017
1028
|
export interface RoomSpaceJoinedPayload {
|
package/src/social-client.ts
CHANGED
|
@@ -671,6 +671,13 @@ export interface RoomSpaceSummary {
|
|
|
671
671
|
iconUrl?: string | null;
|
|
672
672
|
/** Creation time — the stable server-rail sort key. */
|
|
673
673
|
createdAt?: string | number | null;
|
|
674
|
+
/** Archived channels in this server; with archivedDocCount it drives
|
|
675
|
+
* the sidebar's Archive row (rendered only when the sum > 0). Absent
|
|
676
|
+
* on stores that predate the counts. */
|
|
677
|
+
archivedRoomCount?: number | undefined;
|
|
678
|
+
/** Archived docs in this server: the row must stay reachable when only
|
|
679
|
+
* docs are archived, since they have no other retrieval surface. */
|
|
680
|
+
archivedDocCount?: number | undefined;
|
|
674
681
|
}
|
|
675
682
|
|
|
676
683
|
export async function listRoomSpacesViaChat(config: RoomSocialConfig): Promise<RoomSpaceSummary[]> {
|
|
@@ -1179,6 +1186,52 @@ export async function archiveRoomSpace(
|
|
|
1179
1186
|
return socialRequest(config, `/spaces/${encodeURIComponent(spaceId)}`, { method: "DELETE" });
|
|
1180
1187
|
}
|
|
1181
1188
|
|
|
1189
|
+
/** Un-archive a channel back onto the active sidebar (manage-room). The
|
|
1190
|
+
* wire verb is /restore, the store-wide grammar shared with docs; the
|
|
1191
|
+
* receipt carries `restored`, not the archive shape's `archived`. */
|
|
1192
|
+
export async function unarchiveRoomChannel(
|
|
1193
|
+
config: RoomSocialConfig,
|
|
1194
|
+
room: string,
|
|
1195
|
+
): Promise<{ roomId?: string; restored?: boolean }> {
|
|
1196
|
+
return socialRequest(config, `/rooms/${encodeURIComponent(cleanRoomId(room))}/restore`, {
|
|
1197
|
+
method: "POST",
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
/** PERMANENTLY delete a channel and every row keyed to it (manage-room).
|
|
1202
|
+
* The bare DELETE verb on /rooms/:id is the legacy ARCHIVE shape; purge is
|
|
1203
|
+
* the explicit destruction verb and there is no undo. */
|
|
1204
|
+
export async function purgeRoomChannel(
|
|
1205
|
+
config: RoomSocialConfig,
|
|
1206
|
+
room: string,
|
|
1207
|
+
): Promise<{ roomId?: string; deleted?: boolean }> {
|
|
1208
|
+
return socialRequest(config, `/rooms/${encodeURIComponent(cleanRoomId(room))}/purge`, {
|
|
1209
|
+
method: "POST",
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
/** PERMANENTLY delete a server: every channel, message, member, role,
|
|
1214
|
+
* invite, and the entire docs family (owner only; no undo). */
|
|
1215
|
+
export async function purgeRoomSpace(
|
|
1216
|
+
config: RoomSocialConfig,
|
|
1217
|
+
spaceId: string,
|
|
1218
|
+
): Promise<{ spaceId?: string; deleted?: boolean }> {
|
|
1219
|
+
return socialRequest(config, `/spaces/${encodeURIComponent(spaceId)}/purge`, {
|
|
1220
|
+
method: "POST",
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
/** A server's archived channels, for the Archive panel. */
|
|
1225
|
+
export async function listArchivedRoomChannels(
|
|
1226
|
+
config: RoomSocialConfig,
|
|
1227
|
+
spaceId: string,
|
|
1228
|
+
): Promise<Array<{ roomId: string; name?: string; title?: string; archivedAt?: string }>> {
|
|
1229
|
+
const result = await socialRequest<{
|
|
1230
|
+
rooms?: Array<{ roomId: string; name?: string; title?: string; archivedAt?: string }>;
|
|
1231
|
+
}>(config, `/spaces/${encodeURIComponent(spaceId)}/rooms/archived`, { method: "GET" });
|
|
1232
|
+
return result.rooms ?? [];
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1182
1235
|
/** Full channel roster (paged): role + lastSeen for every membership row. */
|
|
1183
1236
|
export async function listRoomChannelMembers(
|
|
1184
1237
|
config: RoomSocialConfig,
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "0.9.
|
|
2
|
-
export const RUNNER_VERSION = "0.9.
|
|
1
|
+
export const VERSION = "0.9.1";
|
|
2
|
+
export const RUNNER_VERSION = "0.9.1";
|