@sublay/js 7.2.0 → 7.4.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.
Files changed (32) hide show
  1. package/dist/core/spaceReputationParams.d.ts +57 -0
  2. package/dist/index.d.mts +425 -10
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +605 -35
  5. package/dist/index.mjs +605 -35
  6. package/dist/interfaces/Event.d.ts +66 -0
  7. package/dist/interfaces/SpaceReputation.d.ts +44 -6
  8. package/dist/modules/comments/fetchManyComments.d.ts +11 -1
  9. package/dist/modules/entities/fetchManyEntities.d.ts +5 -1
  10. package/dist/modules/events/addHost.d.ts +8 -0
  11. package/dist/modules/events/addInvite.d.ts +8 -0
  12. package/dist/modules/events/cancelEvent.d.ts +6 -0
  13. package/dist/modules/events/createEvent.d.ts +49 -0
  14. package/dist/modules/events/deleteEvent.d.ts +5 -0
  15. package/dist/modules/events/fetchEvent.d.ts +8 -0
  16. package/dist/modules/events/fetchEventRsvps.d.ts +19 -0
  17. package/dist/modules/events/fetchInvitees.d.ts +12 -0
  18. package/dist/modules/events/fetchManyEvents.d.ts +42 -0
  19. package/dist/modules/events/index.d.ts +14 -0
  20. package/dist/modules/events/removeHost.d.ts +8 -0
  21. package/dist/modules/events/removeInvite.d.ts +8 -0
  22. package/dist/modules/events/setRsvp.d.ts +7 -0
  23. package/dist/modules/events/updateEvent.d.ts +43 -0
  24. package/dist/modules/events/withdrawRsvp.d.ts +6 -0
  25. package/dist/modules/search/askContent.d.ts +6 -0
  26. package/dist/modules/search/index.d.ts +1 -0
  27. package/dist/modules/search/matchUsers.d.ts +36 -0
  28. package/dist/modules/search/searchContent.d.ts +6 -0
  29. package/dist/modules/spaces/createSpace.d.ts +14 -0
  30. package/dist/modules/spaces/updateSpace.d.ts +8 -0
  31. package/dist/modules/storage/uploadImage.d.ts +2 -1
  32. package/package.json +3 -3
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Input accepted by {@link buildSpaceReputationParams}: either the new
3
+ * `spaceReputation` object or the deprecated flat props.
4
+ *
5
+ * The flat inputs accept `null` (in addition to `undefined`) so the helper's
6
+ * contract matches `@sublay/core` and `@sublay/node` exactly; `null` is treated
7
+ * as unset. js-sdk never persists these params, so the `null` tolerance is not
8
+ * strictly required here, but matching the sibling helpers is harmless and
9
+ * consistent.
10
+ */
11
+ export interface BuildSpaceReputationParamsInput {
12
+ spaceReputation?: {
13
+ spaceId: string | "none" | "context";
14
+ includeDescendants?: boolean;
15
+ };
16
+ /**
17
+ * @deprecated Pass `spaceReputation` instead. Accepted for back-compat.
18
+ */
19
+ spaceReputationId?: string | null;
20
+ /**
21
+ * @deprecated Pass `spaceReputation` instead. Accepted for back-compat.
22
+ */
23
+ spaceReputationDescendants?: boolean | null;
24
+ }
25
+ /**
26
+ * Flat output handed to the query-string serializer (axios `params` or the
27
+ * `askContent` `URLSearchParams`). Both keys are omitted when unset — never
28
+ * bracketed, never nested.
29
+ */
30
+ export interface SpaceReputationFlatParams {
31
+ spaceReputationId?: string;
32
+ spaceReputationDescendants?: boolean;
33
+ }
34
+ /**
35
+ * Normalize the `spaceReputation` object or the deprecated flat props down to
36
+ * the flat query params the server understands
37
+ * (`spaceReputationId` / `spaceReputationDescendants`).
38
+ *
39
+ * **Critical:** this is the only thing that prevents the nested
40
+ * `spaceReputation` object from reaching a query-string serializer. Axios would
41
+ * bracket-encode it (`spaceReputation[spaceId]=…`) and the `askContent`
42
+ * `URLSearchParams` path would stringify it to `[object Object]`; the server
43
+ * ignores both — silently no-opping the new (primary) form. Every
44
+ * reputation-consuming module must route the object through here and merge only
45
+ * the flat output.
46
+ *
47
+ * Rules (mirrors the `@sublay/core` / `@sublay/node` helper contract):
48
+ * - **Object wins when present.** "Present" means the `spaceReputation` key was
49
+ * supplied at all (`spaceReputation !== undefined`) — even `{}` or a partial
50
+ * object suppresses the flat props.
51
+ * - When **both** the object and a flat prop are supplied, the object wins and a
52
+ * one-time dev-only `console.warn` fires (never throws).
53
+ * - The flat inputs tolerate `null` (treated as unset → param omitted).
54
+ * - Output keys are omitted when unset; the result is always the two flat keys,
55
+ * never a bracketed/nested object.
56
+ */
57
+ export declare function buildSpaceReputationParams(input: BuildSpaceReputationParamsInput): SpaceReputationFlatParams;
package/dist/index.d.mts CHANGED
@@ -322,18 +322,37 @@ declare namespace Auth {
322
322
  */
323
323
  interface SpaceReputationContextParams {
324
324
  /**
325
+ * Opt into space-scoped reputation enrichment. The primary form: an object
326
+ * describing the space and whether to include descendants.
327
+ *
328
+ * - `spaceId` — a space `<uuid>` (reputation within that specific space),
329
+ * `"none"` (no space context — global reputation only), or `"context"`
330
+ * (derive the space from each record's own context, e.g. a feed enriches
331
+ * each row's author with reputation in that row's space).
332
+ * - `includeDescendants` — whether to include descendant spaces when
333
+ * computing space-scoped reputation. Only honored with an explicit space
334
+ * `<uuid>` (ignored for `"none"` / `"context"`).
335
+ */
336
+ spaceReputation?: {
337
+ spaceId: string | "none" | "context";
338
+ includeDescendants?: boolean;
339
+ };
340
+ /**
341
+ * @deprecated Pass the `spaceReputation` object instead. Retained for
342
+ * back-compat; removal is a later major version.
343
+ *
325
344
  * Opt into space-scoped reputation enrichment. Accepted forms:
326
345
  * - a space `<uuid>` — reputation within that specific space;
327
346
  * - `"none"` — no space context (global reputation only);
328
347
  * - `"context"` — derive the space from each record's own context
329
348
  * (e.g. a feed enriches each row's author with reputation in that row's
330
349
  * space).
331
- *
332
- * Plain `string` — a `string | "none" | "context"` union adds no safety
333
- * since a uuid is already a string.
334
350
  */
335
351
  spaceReputationId?: string;
336
352
  /**
353
+ * @deprecated Pass the `spaceReputation` object (`includeDescendants`)
354
+ * instead. Retained for back-compat; removal is a later major version.
355
+ *
337
356
  * Whether to include descendant spaces when computing space-scoped
338
357
  * reputation. Only honored with an explicit space `<uuid>` (ignored for
339
358
  * `"none"` / `"context"`).
@@ -345,18 +364,37 @@ interface SpaceReputationContextParams {
345
364
  */
346
365
  interface SpaceReputationUserParams {
347
366
  /**
367
+ * Opt into space-scoped reputation enrichment. The primary form: an object
368
+ * describing the space and whether to include descendants.
369
+ *
370
+ * - `spaceId` — a space `<uuid>` (reputation within that specific space) or
371
+ * `"none"` (no space context — global reputation only). `"context"` is
372
+ * **rejected by the server (400)** on user-direct endpoints — there is no
373
+ * per-record context to derive a space from.
374
+ * - `includeDescendants` — whether to include descendant spaces when
375
+ * computing space-scoped reputation. Only honored with an explicit space
376
+ * `<uuid>`.
377
+ */
378
+ spaceReputation?: {
379
+ spaceId: string | "none";
380
+ includeDescendants?: boolean;
381
+ };
382
+ /**
383
+ * @deprecated Pass the `spaceReputation` object instead. Retained for
384
+ * back-compat; removal is a later major version.
385
+ *
348
386
  * Opt into space-scoped reputation enrichment. Accepted forms:
349
387
  * - a space `<uuid>` — reputation within that specific space;
350
388
  * - `"none"` — no space context (global reputation only).
351
389
  *
352
390
  * `"context"` is **rejected by the server (400)** on user-direct endpoints —
353
391
  * there is no per-record context to derive a space from.
354
- *
355
- * Plain `string` — a `string | "none"` union adds no safety since a uuid is
356
- * already a string.
357
392
  */
358
393
  spaceReputationId?: string;
359
394
  /**
395
+ * @deprecated Pass the `spaceReputation` object (`includeDescendants`)
396
+ * instead. Retained for back-compat; removal is a later major version.
397
+ *
360
398
  * Whether to include descendant spaces when computing space-scoped
361
399
  * reputation. Only honored with an explicit space `<uuid>`.
362
400
  */
@@ -990,7 +1028,11 @@ interface LocationFilters {
990
1028
  interface FetchManyEntitiesProps extends SpaceReputationContextParams {
991
1029
  sourceId?: string;
992
1030
  spaceId?: string;
993
- sortBy?: "new" | "hot" | "top" | "controversial" | (string & {});
1031
+ sortBy?: "createdAt" | "hot" | "top" | "controversial"
1032
+ /** @deprecated Use "createdAt" instead. "new" is a directional alias removed
1033
+ * in v8; the server still accepts it (identical behavior) but responds with
1034
+ * deprecation headers. */
1035
+ | "new" | (string & {});
994
1036
  sortDir?: "asc" | "desc";
995
1037
  sortType?: "auto" | "numeric" | "text" | "boolean" | "timestamp";
996
1038
  sortByReaction?: "upvote" | "downvote" | "like" | "love" | "wow" | "sad" | "angry" | "funny";
@@ -1111,6 +1153,299 @@ declare namespace Entities {
1111
1153
  export { addReaction$1 as addReaction, Entities_createEntity as createEntity, Entities_deleteEntity as deleteEntity, Entities_fetchDrafts as fetchDrafts, Entities_fetchEntity as fetchEntity, Entities_fetchEntityByForeignId as fetchEntityByForeignId, Entities_fetchEntityByShortId as fetchEntityByShortId, Entities_fetchManyEntities as fetchManyEntities, fetchReactions$1 as fetchReactions, Entities_fetchTopComment as fetchTopComment, getUserReaction$1 as getUserReaction, Entities_isEntitySaved as isEntitySaved, Entities_publishDraft as publishDraft, removeReaction$1 as removeReaction, Entities_updateEntity as updateEntity };
1112
1154
  }
1113
1155
 
1156
+ type EventType = "online" | "physical" | "hybrid";
1157
+ type EventVisibility = "public" | "members" | "invite";
1158
+ type EventStatus = "active" | "cancelled";
1159
+ type RsvpStatus = "going" | "maybe" | "not_going";
1160
+ interface RsvpCounts {
1161
+ going: number;
1162
+ maybe: number;
1163
+ not_going: number;
1164
+ }
1165
+ interface Event {
1166
+ id: string;
1167
+ shortId: string;
1168
+ projectId: string;
1169
+ userId: string | null;
1170
+ user?: User | null;
1171
+ title: string;
1172
+ description: string | null;
1173
+ startTime: string;
1174
+ endTime: string | null;
1175
+ timezone: string | null;
1176
+ type: EventType;
1177
+ url: string | null;
1178
+ venueName: string | null;
1179
+ address: string | null;
1180
+ location: {
1181
+ type: "Point";
1182
+ coordinates: [number, number];
1183
+ } | null;
1184
+ spaceId: string | null;
1185
+ space?: Space | null;
1186
+ visibility: EventVisibility;
1187
+ status: EventStatus;
1188
+ allowMaybe: boolean;
1189
+ guestListVisible: boolean;
1190
+ capacity: number | null;
1191
+ hostIds: string[];
1192
+ coverImageId: string | null;
1193
+ files?: File$1[];
1194
+ rsvpCounts: RsvpCounts;
1195
+ userRsvp?: RsvpStatus | null;
1196
+ metadata: Record<string, any>;
1197
+ createdAt: string;
1198
+ updatedAt: string;
1199
+ deletedAt: string | null;
1200
+ }
1201
+ interface EventRsvp {
1202
+ id: string;
1203
+ eventId: string;
1204
+ userId: string;
1205
+ user?: User | null;
1206
+ status: RsvpStatus;
1207
+ createdAt: string;
1208
+ updatedAt: string;
1209
+ }
1210
+ interface EventInvite {
1211
+ id: string;
1212
+ eventId: string;
1213
+ userId: string;
1214
+ user?: User | null;
1215
+ invitedAt: string;
1216
+ createdAt: string;
1217
+ updatedAt: string;
1218
+ }
1219
+
1220
+ /** A single cover image plus its processing options (stored as Event.coverImageId). */
1221
+ interface EventCoverUpload {
1222
+ file: Blob | File;
1223
+ /** Image-processing config (must include `mode`) — see {@link ImageOptions}. */
1224
+ options: ImageOptions;
1225
+ }
1226
+ /** A gallery image set plus shared processing options (Files with eventId + position). */
1227
+ interface EventGalleryUpload {
1228
+ files: (Blob | File)[];
1229
+ /** Image-processing config applied to every gallery image — see {@link ImageOptions}. */
1230
+ options: ImageOptions;
1231
+ }
1232
+ interface CreateEventProps {
1233
+ title: string;
1234
+ description?: string;
1235
+ startTime: string;
1236
+ endTime?: string;
1237
+ timezone?: string;
1238
+ type: EventType;
1239
+ url?: string;
1240
+ venueName?: string;
1241
+ address?: string;
1242
+ location?: {
1243
+ latitude: number;
1244
+ longitude: number;
1245
+ };
1246
+ spaceId?: string;
1247
+ visibility?: EventVisibility;
1248
+ capacity?: number;
1249
+ allowMaybe?: boolean;
1250
+ guestListVisible?: boolean;
1251
+ /** Additional host user IDs (the logged-in user is auto-added as a host). */
1252
+ hostIds?: string[];
1253
+ metadata?: Record<string, any>;
1254
+ /**
1255
+ * Inline cover image (single). When present the request is sent as
1256
+ * `multipart/form-data`. Requires the `files-images` bundle.
1257
+ */
1258
+ cover?: EventCoverUpload;
1259
+ /**
1260
+ * Inline gallery images (multi). When present the request is sent as
1261
+ * `multipart/form-data`. Requires the `files-images` bundle.
1262
+ */
1263
+ gallery?: EventGalleryUpload;
1264
+ }
1265
+ declare function createEvent(client: SublayHttpClient, data: CreateEventProps): Promise<Event>;
1266
+
1267
+ interface FetchEventProps {
1268
+ eventId: string;
1269
+ /** Comma-separated associations to expand, e.g. "user,space,files,userRsvp". */
1270
+ include?: string;
1271
+ }
1272
+ declare function fetchEvent(client: SublayHttpClient, data: FetchEventProps): Promise<Event>;
1273
+
1274
+ interface EventTextFilters {
1275
+ hasTitle?: "true" | "false";
1276
+ includes?: string | string[];
1277
+ doesNotInclude?: string | string[];
1278
+ }
1279
+ interface EventDescriptionFilters {
1280
+ hasDescription?: "true" | "false";
1281
+ includes?: string | string[];
1282
+ doesNotInclude?: string | string[];
1283
+ }
1284
+ interface EventLocationFilters {
1285
+ latitude: string;
1286
+ longitude: string;
1287
+ radius: string;
1288
+ }
1289
+ interface FetchManyEventsProps {
1290
+ page?: number;
1291
+ limit?: number;
1292
+ sortBy?: "startTime" | "going";
1293
+ sortDir?: "asc" | "desc";
1294
+ timeWindow?: "upcoming" | "ongoing" | "past";
1295
+ startsAfter?: string;
1296
+ startsBefore?: string;
1297
+ spaceId?: string;
1298
+ hostId?: string;
1299
+ type?: EventType;
1300
+ status?: EventStatus;
1301
+ /**
1302
+ * Comma-separated RSVP statuses the logged-in user RSVP'd with, e.g.
1303
+ * "going,maybe". Filters to events the caller has that RSVP on.
1304
+ */
1305
+ myRsvp?: string;
1306
+ locationFilters?: EventLocationFilters;
1307
+ titleFilters?: EventTextFilters;
1308
+ descriptionFilters?: EventDescriptionFilters;
1309
+ /** Comma-separated associations to expand, e.g. "user,space,files,userRsvp". */
1310
+ include?: string;
1311
+ }
1312
+ declare function fetchManyEvents(client: SublayHttpClient, data?: FetchManyEventsProps): Promise<PaginatedResponse<Event>>;
1313
+
1314
+ interface UpdateEventProps {
1315
+ eventId: string;
1316
+ title?: string;
1317
+ description?: string;
1318
+ startTime?: string;
1319
+ endTime?: string;
1320
+ timezone?: string;
1321
+ type?: EventType;
1322
+ url?: string;
1323
+ venueName?: string;
1324
+ address?: string;
1325
+ location?: {
1326
+ latitude: number;
1327
+ longitude: number;
1328
+ };
1329
+ visibility?: EventVisibility;
1330
+ capacity?: number;
1331
+ allowMaybe?: boolean;
1332
+ guestListVisible?: boolean;
1333
+ metadata?: Record<string, any>;
1334
+ /**
1335
+ * File IDs of existing event images to REMOVE (gallery photos and/or the
1336
+ * current cover). Combine with `gallery` (append) + `cover` (replace) to fully
1337
+ * curate the image set in one update. Sent in the JSON body, or — when an
1338
+ * image file is also attached — as a JSON-string field the server parses.
1339
+ */
1340
+ removeImageIds?: string[];
1341
+ /**
1342
+ * New cover image (single) — REPLACES the existing cover. When present the
1343
+ * request is sent as `multipart/form-data`. Requires the `files-images` bundle.
1344
+ */
1345
+ cover?: EventCoverUpload;
1346
+ /**
1347
+ * Gallery images (multi) — APPENDED to the event's existing images. When
1348
+ * present the request is sent as `multipart/form-data`. Requires the
1349
+ * `files-images` bundle.
1350
+ */
1351
+ gallery?: EventGalleryUpload;
1352
+ }
1353
+ declare function updateEvent(client: SublayHttpClient, data: UpdateEventProps): Promise<Event>;
1354
+
1355
+ interface CancelEventProps {
1356
+ eventId: string;
1357
+ }
1358
+ declare function cancelEvent(client: SublayHttpClient, data: CancelEventProps): Promise<Event>;
1359
+
1360
+ interface DeleteEventProps {
1361
+ eventId: string;
1362
+ }
1363
+ declare function deleteEvent(client: SublayHttpClient, data: DeleteEventProps): Promise<void>;
1364
+
1365
+ interface SetRsvpProps {
1366
+ eventId: string;
1367
+ status: RsvpStatus;
1368
+ }
1369
+ declare function setRsvp(client: SublayHttpClient, data: SetRsvpProps): Promise<Event>;
1370
+
1371
+ interface WithdrawRsvpProps {
1372
+ eventId: string;
1373
+ }
1374
+ declare function withdrawRsvp(client: SublayHttpClient, data: WithdrawRsvpProps): Promise<Event>;
1375
+
1376
+ interface AddHostProps {
1377
+ eventId: string;
1378
+ /** The user to grant host on the event. */
1379
+ userId: string;
1380
+ }
1381
+ declare function addHost(client: SublayHttpClient, data: AddHostProps): Promise<Event>;
1382
+
1383
+ interface RemoveHostProps {
1384
+ eventId: string;
1385
+ /** The host to remove. Rejected if it would leave the event with no hosts. */
1386
+ userId: string;
1387
+ }
1388
+ declare function removeHost(client: SublayHttpClient, data: RemoveHostProps): Promise<Event>;
1389
+
1390
+ interface AddInviteProps {
1391
+ eventId: string;
1392
+ /** The user to invite (userId only — never a foreignId). Idempotent. */
1393
+ userId: string;
1394
+ }
1395
+ declare function addInvite(client: SublayHttpClient, data: AddInviteProps): Promise<Event>;
1396
+
1397
+ interface RemoveInviteProps {
1398
+ eventId: string;
1399
+ /** The invitee to remove. Also drops their RSVP and revokes access. */
1400
+ userId: string;
1401
+ }
1402
+ declare function removeInvite(client: SublayHttpClient, data: RemoveInviteProps): Promise<Event>;
1403
+
1404
+ interface FetchInviteesProps {
1405
+ eventId: string;
1406
+ page?: number;
1407
+ limit?: number;
1408
+ }
1409
+ /**
1410
+ * Host-only invitee (guest) list. Non-hosts get 403.
1411
+ */
1412
+ declare function fetchInvitees(client: SublayHttpClient, data: FetchInviteesProps): Promise<PaginatedResponse<EventInvite>>;
1413
+
1414
+ interface FetchEventRsvpsProps {
1415
+ eventId: string;
1416
+ page?: number;
1417
+ limit?: number;
1418
+ /**
1419
+ * Comma-separated RSVP statuses to filter by, e.g. "going,maybe". When
1420
+ * omitted, all statuses are returned.
1421
+ */
1422
+ status?: string;
1423
+ }
1424
+ /**
1425
+ * Named RSVP (guest) list. Visible to hosts always, or to any viewer when the
1426
+ * event's `guestListVisible` is true; otherwise 403. RSVP counts themselves are
1427
+ * public via the event's `rsvpCounts`.
1428
+ */
1429
+ declare function fetchEventRsvps(client: SublayHttpClient, data: FetchEventRsvpsProps): Promise<PaginatedResponse<EventRsvp>>;
1430
+
1431
+ declare const Events_addHost: typeof addHost;
1432
+ declare const Events_addInvite: typeof addInvite;
1433
+ declare const Events_cancelEvent: typeof cancelEvent;
1434
+ declare const Events_createEvent: typeof createEvent;
1435
+ declare const Events_deleteEvent: typeof deleteEvent;
1436
+ declare const Events_fetchEvent: typeof fetchEvent;
1437
+ declare const Events_fetchEventRsvps: typeof fetchEventRsvps;
1438
+ declare const Events_fetchInvitees: typeof fetchInvitees;
1439
+ declare const Events_fetchManyEvents: typeof fetchManyEvents;
1440
+ declare const Events_removeHost: typeof removeHost;
1441
+ declare const Events_removeInvite: typeof removeInvite;
1442
+ declare const Events_setRsvp: typeof setRsvp;
1443
+ declare const Events_updateEvent: typeof updateEvent;
1444
+ declare const Events_withdrawRsvp: typeof withdrawRsvp;
1445
+ declare namespace Events {
1446
+ export { Events_addHost as addHost, Events_addInvite as addInvite, Events_cancelEvent as cancelEvent, Events_createEvent as createEvent, Events_deleteEvent as deleteEvent, Events_fetchEvent as fetchEvent, Events_fetchEventRsvps as fetchEventRsvps, Events_fetchInvitees as fetchInvitees, Events_fetchManyEvents as fetchManyEvents, Events_removeHost as removeHost, Events_removeInvite as removeInvite, Events_setRsvp as setRsvp, Events_updateEvent as updateEvent, Events_withdrawRsvp as withdrawRsvp };
1447
+ }
1448
+
1114
1449
  interface GifData {
1115
1450
  id: string;
1116
1451
  url: string;
@@ -1192,7 +1527,17 @@ interface FetchManyCommentsProps extends SpaceReputationContextParams {
1192
1527
  parentId?: string;
1193
1528
  page?: number;
1194
1529
  limit?: number;
1195
- sortBy?: "new" | "old" | "top" | "controversial";
1530
+ sortBy?: "createdAt" | "top" | "controversial"
1531
+ /** @deprecated Use "createdAt" instead. "new" is a directional alias for
1532
+ * createdAt DESC, removed in v8; the server still accepts it (identical
1533
+ * behavior) but responds with deprecation headers. */
1534
+ | "new"
1535
+ /** @deprecated Use "createdAt" with sortDir:"asc" instead. "old" is a
1536
+ * directional alias for createdAt ASC, removed in v8; the server still
1537
+ * accepts it (identical behavior) but responds with deprecation headers. */
1538
+ | "old";
1539
+ /** Sort direction for `sortBy: "createdAt"`. Defaults to "desc". */
1540
+ sortDir?: "asc" | "desc";
1196
1541
  include?: string;
1197
1542
  sourceId?: string;
1198
1543
  }
@@ -1244,6 +1589,12 @@ declare namespace Comments {
1244
1589
  export { Comments_addReaction as addReaction, Comments_createComment as createComment, Comments_deleteComment as deleteComment, Comments_fetchComment as fetchComment, Comments_fetchCommentByForeignId as fetchCommentByForeignId, Comments_fetchManyComments as fetchManyComments, Comments_fetchReactions as fetchReactions, Comments_getUserReaction as getUserReaction, Comments_removeReaction as removeReaction, Comments_updateComment as updateComment };
1245
1590
  }
1246
1591
 
1592
+ /** A file plus the image-processing options the server requires alongside it. */
1593
+ interface SpaceImageUpload {
1594
+ file: Blob | File;
1595
+ /** Image-processing config (must include `mode`) — see {@link ImageOptions}. */
1596
+ options: ImageOptions;
1597
+ }
1247
1598
  interface CreateSpaceProps {
1248
1599
  name: string;
1249
1600
  slug?: string;
@@ -1253,6 +1604,13 @@ interface CreateSpaceProps {
1253
1604
  requireJoinApproval?: boolean;
1254
1605
  parentSpaceId?: string;
1255
1606
  metadata?: Record<string, any>;
1607
+ /**
1608
+ * Avatar image. When present the request is sent as `multipart/form-data` and
1609
+ * the server processes the image per `options`.
1610
+ */
1611
+ avatarFile?: SpaceImageUpload;
1612
+ /** Banner image; same contract as {@link CreateSpaceProps.avatarFile}. */
1613
+ bannerFile?: SpaceImageUpload;
1256
1614
  }
1257
1615
  declare function createSpace(client: SublayHttpClient, data: CreateSpaceProps): Promise<Space>;
1258
1616
 
@@ -1320,6 +1678,13 @@ interface UpdateSpaceProps {
1320
1678
  readingPermission?: ReadingPermission;
1321
1679
  postingPermission?: PostingPermission;
1322
1680
  metadata?: Record<string, any>;
1681
+ /**
1682
+ * New avatar image. When present the request is sent as `multipart/form-data`
1683
+ * and the server processes the image per `options`, replacing the old avatar.
1684
+ */
1685
+ avatarFile?: SpaceImageUpload;
1686
+ /** New banner image; same contract as {@link UpdateSpaceProps.avatarFile}. */
1687
+ bannerFile?: SpaceImageUpload;
1323
1688
  }
1324
1689
  declare function updateSpace(client: SublayHttpClient, data: UpdateSpaceProps): Promise<Space>;
1325
1690
 
@@ -2203,6 +2568,12 @@ interface SearchContentProps extends SpaceReputationContextParams {
2203
2568
  query: string;
2204
2569
  sourceTypes?: ("entity" | "comment" | "message")[];
2205
2570
  spaceId?: string;
2571
+ /**
2572
+ * With a `spaceId`, also search every space nested under it (children,
2573
+ * grandchildren — the whole subtree, any depth). Ignored without a `spaceId`.
2574
+ * Defaults to false (exact-space search).
2575
+ */
2576
+ includeChildSpaces?: boolean;
2206
2577
  conversationId?: string;
2207
2578
  limit?: number;
2208
2579
  }
@@ -2237,6 +2608,12 @@ interface AskContentProps extends SpaceReputationContextParams {
2237
2608
  query: string;
2238
2609
  sourceTypes?: ("entity" | "comment" | "message")[];
2239
2610
  spaceId?: string;
2611
+ /**
2612
+ * With a `spaceId`, also search every space nested under it (children,
2613
+ * grandchildren — the whole subtree, any depth). Ignored without a `spaceId`.
2614
+ * Defaults to false (exact-space search).
2615
+ */
2616
+ includeChildSpaces?: boolean;
2240
2617
  conversationId?: string;
2241
2618
  limit?: number;
2242
2619
  /** Abort the in-flight stream (e.g. when the user navigates away). */
@@ -2283,12 +2660,48 @@ type AskContentEvent = {
2283
2660
  */
2284
2661
  declare function askContent(client: SublayHttpClient, data: AskContentProps): AsyncGenerator<AskContentEvent, void, unknown>;
2285
2662
 
2663
+ interface MatchUsersProps {
2664
+ mode: "passive" | "directed";
2665
+ query?: string;
2666
+ limit?: number;
2667
+ spaceId?: string;
2668
+ includeChildSpaces?: boolean;
2669
+ includeSampleContent?: boolean;
2670
+ excludeSelf?: boolean;
2671
+ }
2672
+ interface MatchFacetRef {
2673
+ id: string;
2674
+ hotness: number;
2675
+ }
2676
+ interface SampleContent {
2677
+ sourceType: "entity" | "comment" | "message";
2678
+ recordId: string;
2679
+ content: string;
2680
+ similarity: number;
2681
+ }
2682
+ interface MatchedFacet {
2683
+ similarity: number;
2684
+ askerFacet?: MatchFacetRef;
2685
+ candidateFacet: MatchFacetRef;
2686
+ sampleContent?: SampleContent[];
2687
+ }
2688
+ interface UserMatchResult {
2689
+ user: User;
2690
+ score: number;
2691
+ matchedFacets: MatchedFacet[];
2692
+ }
2693
+ interface MatchUsersResponse {
2694
+ results: UserMatchResult[];
2695
+ }
2696
+ declare function matchUsers(client: SublayHttpClient, data: MatchUsersProps): Promise<MatchUsersResponse>;
2697
+
2286
2698
  declare const Search_askContent: typeof askContent;
2699
+ declare const Search_matchUsers: typeof matchUsers;
2287
2700
  declare const Search_searchContent: typeof searchContent;
2288
2701
  declare const Search_searchSpaces: typeof searchSpaces;
2289
2702
  declare const Search_searchUsers: typeof searchUsers;
2290
2703
  declare namespace Search {
2291
- export { Search_askContent as askContent, Search_searchContent as searchContent, Search_searchSpaces as searchSpaces, Search_searchUsers as searchUsers };
2704
+ export { Search_askContent as askContent, Search_matchUsers as matchUsers, Search_searchContent as searchContent, Search_searchSpaces as searchSpaces, Search_searchUsers as searchUsers };
2292
2705
  }
2293
2706
 
2294
2707
  interface UploadedImageVariant {
@@ -2324,10 +2737,11 @@ interface UploadImageProps {
2324
2737
  imageOptions: ImageOptions;
2325
2738
  /** Storage path segments, e.g. ["spaces", spaceId, "banner"]. */
2326
2739
  pathParts?: string[];
2327
- /** Only one of entityId/commentId/spaceId may be set. */
2740
+ /** Only one of entityId/commentId/spaceId/eventId may be set. */
2328
2741
  entityId?: string;
2329
2742
  commentId?: string;
2330
2743
  spaceId?: string;
2744
+ eventId?: string;
2331
2745
  }
2332
2746
  declare function uploadImage(client: SublayHttpClient, data: UploadImageProps): Promise<UploadImageResponse>;
2333
2747
 
@@ -2818,6 +3232,7 @@ declare class SublayClient {
2818
3232
  auth: BoundModule<typeof Auth>;
2819
3233
  users: BoundModule<typeof Users>;
2820
3234
  entities: BoundModule<typeof Entities>;
3235
+ events: BoundModule<typeof Events>;
2821
3236
  comments: BoundModule<typeof Comments>;
2822
3237
  spaces: BoundModule<typeof Spaces>;
2823
3238
  collections: BoundModule<typeof Collections>;
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { SublayHttpClient, ClientConfig, AuthTokens } from "./core/client";
2
2
  import * as Auth from "./modules/auth";
3
3
  import * as Users from "./modules/users";
4
4
  import * as Entities from "./modules/entities";
5
+ import * as Events from "./modules/events";
5
6
  import * as Comments from "./modules/comments";
6
7
  import * as Spaces from "./modules/spaces";
7
8
  import * as Collections from "./modules/collections";
@@ -22,6 +23,7 @@ export declare class SublayClient {
22
23
  auth: BoundModule<typeof Auth>;
23
24
  users: BoundModule<typeof Users>;
24
25
  entities: BoundModule<typeof Entities>;
26
+ events: BoundModule<typeof Events>;
25
27
  comments: BoundModule<typeof Comments>;
26
28
  spaces: BoundModule<typeof Spaces>;
27
29
  collections: BoundModule<typeof Collections>;