@sublay/js 7.1.1 → 7.3.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 (49) hide show
  1. package/dist/index.d.mts +426 -27
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.js +251 -16
  4. package/dist/index.mjs +251 -16
  5. package/dist/interfaces/Event.d.ts +66 -0
  6. package/dist/interfaces/SpaceReputation.d.ts +62 -0
  7. package/dist/interfaces/User.d.ts +7 -0
  8. package/dist/modules/chat/getMessage.d.ts +2 -1
  9. package/dist/modules/chat/listMembers.d.ts +2 -1
  10. package/dist/modules/chat/listMessages.d.ts +2 -1
  11. package/dist/modules/chat/listReactions.d.ts +2 -1
  12. package/dist/modules/chat/sendMessage.d.ts +2 -1
  13. package/dist/modules/comments/fetchComment.d.ts +2 -1
  14. package/dist/modules/comments/fetchManyComments.d.ts +13 -2
  15. package/dist/modules/comments/fetchReactions.d.ts +2 -1
  16. package/dist/modules/entities/fetchEntity.d.ts +2 -1
  17. package/dist/modules/entities/fetchManyEntities.d.ts +7 -2
  18. package/dist/modules/entities/fetchReactions.d.ts +2 -1
  19. package/dist/modules/events/addHost.d.ts +8 -0
  20. package/dist/modules/events/addInvite.d.ts +8 -0
  21. package/dist/modules/events/cancelEvent.d.ts +6 -0
  22. package/dist/modules/events/createEvent.d.ts +49 -0
  23. package/dist/modules/events/deleteEvent.d.ts +5 -0
  24. package/dist/modules/events/fetchEvent.d.ts +8 -0
  25. package/dist/modules/events/fetchEventRsvps.d.ts +19 -0
  26. package/dist/modules/events/fetchInvitees.d.ts +12 -0
  27. package/dist/modules/events/fetchManyEvents.d.ts +42 -0
  28. package/dist/modules/events/index.d.ts +14 -0
  29. package/dist/modules/events/removeHost.d.ts +8 -0
  30. package/dist/modules/events/removeInvite.d.ts +8 -0
  31. package/dist/modules/events/setRsvp.d.ts +7 -0
  32. package/dist/modules/events/updateEvent.d.ts +43 -0
  33. package/dist/modules/events/withdrawRsvp.d.ts +6 -0
  34. package/dist/modules/reports/fetchModeratedReports.d.ts +2 -1
  35. package/dist/modules/search/askContent.d.ts +2 -1
  36. package/dist/modules/search/searchContent.d.ts +2 -1
  37. package/dist/modules/spaces/createSpace.d.ts +14 -0
  38. package/dist/modules/spaces/fetchSpaceMembers.d.ts +2 -1
  39. package/dist/modules/spaces/fetchSpaceTeam.d.ts +2 -1
  40. package/dist/modules/spaces/updateSpace.d.ts +8 -0
  41. package/dist/modules/storage/uploadImage.d.ts +2 -1
  42. package/dist/modules/users/fetchConnectionsByUserId.d.ts +2 -1
  43. package/dist/modules/users/fetchFollowersByUserId.d.ts +2 -1
  44. package/dist/modules/users/fetchFollowingByUserId.d.ts +2 -1
  45. package/dist/modules/users/fetchUserByForeignId.d.ts +2 -1
  46. package/dist/modules/users/fetchUserById.d.ts +2 -1
  47. package/dist/modules/users/fetchUserByUsername.d.ts +2 -1
  48. package/dist/modules/users/fetchUserSuggestions.d.ts +2 -1
  49. package/package.json +3 -3
package/dist/index.d.mts CHANGED
@@ -127,6 +127,13 @@ type UserFull = {
127
127
  metadata: Record<string, any>;
128
128
  secureMetadata: Record<string, any>;
129
129
  reputation: number;
130
+ /**
131
+ * Space-scoped reputation, present only when the request opted in via
132
+ * `spaceReputationId` (and the project has the reputation bundle). It is the
133
+ * user's reputation within the requested space context — see
134
+ * {@link SpaceReputationContextParams} / {@link SpaceReputationUserParams}.
135
+ */
136
+ spaceReputation?: number;
130
137
  isVerified: boolean;
131
138
  isActive: boolean;
132
139
  lastActive: string;
@@ -293,25 +300,88 @@ declare namespace Auth {
293
300
  export { Auth_changePassword as changePassword, Auth_confirmAccountDeletion as confirmAccountDeletion, Auth_requestAccountDeletion as requestAccountDeletion, Auth_requestNewAccessToken as requestNewAccessToken, Auth_requestPasswordReset as requestPasswordReset, Auth_resetPassword as resetPassword, Auth_sendVerificationEmail as sendVerificationEmail, Auth_signIn as signIn, Auth_signOut as signOut, Auth_signUp as signUp, Auth_verifyEmail as verifyEmail, Auth_verifyExternalUser as verifyExternalUser };
294
301
  }
295
302
 
296
- interface FetchUserByIdProps {
303
+ /**
304
+ * Shared optional params for opting a request into space-scoped reputation
305
+ * enrichment. When set, users embedded in the response carry a
306
+ * `spaceReputation` field (see {@link import("./User").UserFull}).
307
+ *
308
+ * Two variants exist because the server accepts a different value set per
309
+ * endpoint class:
310
+ * - {@link SpaceReputationContextParams} — context endpoints (entities,
311
+ * comments, chat, spaces, search, reports). Accept `<uuid> | "none" |
312
+ * "context"`.
313
+ * - {@link SpaceReputationUserParams} — user-direct endpoints (the `users`
314
+ * module). Accept `<uuid> | "none"` only; `"context"` is rejected by the
315
+ * server (400).
316
+ *
317
+ * Both classes share the same param names and types — only the accepted
318
+ * `spaceReputationId` value set (documented in JSDoc) differs.
319
+ */
320
+ /**
321
+ * Space-reputation params for **context** endpoints.
322
+ */
323
+ interface SpaceReputationContextParams {
324
+ /**
325
+ * Opt into space-scoped reputation enrichment. Accepted forms:
326
+ * - a space `<uuid>` — reputation within that specific space;
327
+ * - `"none"` — no space context (global reputation only);
328
+ * - `"context"` — derive the space from each record's own context
329
+ * (e.g. a feed enriches each row's author with reputation in that row's
330
+ * space).
331
+ *
332
+ * Plain `string` — a `string | "none" | "context"` union adds no safety
333
+ * since a uuid is already a string.
334
+ */
335
+ spaceReputationId?: string;
336
+ /**
337
+ * Whether to include descendant spaces when computing space-scoped
338
+ * reputation. Only honored with an explicit space `<uuid>` (ignored for
339
+ * `"none"` / `"context"`).
340
+ */
341
+ spaceReputationDescendants?: boolean;
342
+ }
343
+ /**
344
+ * Space-reputation params for **user-direct** endpoints (the `users` module).
345
+ */
346
+ interface SpaceReputationUserParams {
347
+ /**
348
+ * Opt into space-scoped reputation enrichment. Accepted forms:
349
+ * - a space `<uuid>` — reputation within that specific space;
350
+ * - `"none"` — no space context (global reputation only).
351
+ *
352
+ * `"context"` is **rejected by the server (400)** on user-direct endpoints —
353
+ * 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
+ */
358
+ spaceReputationId?: string;
359
+ /**
360
+ * Whether to include descendant spaces when computing space-scoped
361
+ * reputation. Only honored with an explicit space `<uuid>`.
362
+ */
363
+ spaceReputationDescendants?: boolean;
364
+ }
365
+
366
+ interface FetchUserByIdProps extends SpaceReputationUserParams {
297
367
  userId: string;
298
368
  include?: string;
299
369
  }
300
370
  declare function fetchUserById(client: SublayHttpClient, data: FetchUserByIdProps): Promise<User>;
301
371
 
302
- interface FetchUserByForeignIdProps {
372
+ interface FetchUserByForeignIdProps extends SpaceReputationUserParams {
303
373
  foreignId: string;
304
374
  include?: string;
305
375
  }
306
376
  declare function fetchUserByForeignId(client: SublayHttpClient, data: FetchUserByForeignIdProps): Promise<User>;
307
377
 
308
- interface FetchUserByUsernameProps {
378
+ interface FetchUserByUsernameProps extends SpaceReputationUserParams {
309
379
  username: string;
310
380
  include?: string;
311
381
  }
312
382
  declare function fetchUserByUsername(client: SublayHttpClient, data: FetchUserByUsernameProps): Promise<User>;
313
383
 
314
- interface FetchUserSuggestionsProps {
384
+ interface FetchUserSuggestionsProps extends SpaceReputationUserParams {
315
385
  query: string;
316
386
  }
317
387
  declare function fetchUserSuggestions(client: SublayHttpClient, data: FetchUserSuggestionsProps): Promise<User[]>;
@@ -447,7 +517,7 @@ interface PaginatedResponse<T> {
447
517
  pagination: PaginationMetadata;
448
518
  }
449
519
 
450
- interface FetchFollowersByUserIdProps {
520
+ interface FetchFollowersByUserIdProps extends SpaceReputationUserParams {
451
521
  userId: string;
452
522
  page?: number;
453
523
  limit?: number;
@@ -462,7 +532,7 @@ interface FollowersCountResponse$1 {
462
532
  }
463
533
  declare function fetchFollowersCountByUserId(client: SublayHttpClient, data: FetchFollowersCountByUserIdProps): Promise<FollowersCountResponse$1>;
464
534
 
465
- interface FetchFollowingByUserIdProps {
535
+ interface FetchFollowingByUserIdProps extends SpaceReputationUserParams {
466
536
  userId: string;
467
537
  page?: number;
468
538
  limit?: number;
@@ -536,7 +606,7 @@ interface ConnectionStatusDeclined {
536
606
  }
537
607
  type ConnectionStatusResponse = ConnectionStatusNone | ConnectionStatusPending | ConnectionStatusConnected | ConnectionStatusDeclined;
538
608
 
539
- interface FetchConnectionsByUserIdProps {
609
+ interface FetchConnectionsByUserIdProps extends SpaceReputationUserParams {
540
610
  userId: string;
541
611
  page?: number;
542
612
  limit?: number;
@@ -868,7 +938,7 @@ interface CreateEntityProps {
868
938
  }
869
939
  declare function createEntity(client: SublayHttpClient, data: CreateEntityProps): Promise<Entity>;
870
940
 
871
- interface FetchEntityProps {
941
+ interface FetchEntityProps extends SpaceReputationContextParams {
872
942
  entityId: string;
873
943
  include?: string;
874
944
  }
@@ -917,10 +987,14 @@ interface LocationFilters {
917
987
  longitude: string;
918
988
  radius: string;
919
989
  }
920
- interface FetchManyEntitiesProps {
990
+ interface FetchManyEntitiesProps extends SpaceReputationContextParams {
921
991
  sourceId?: string;
922
992
  spaceId?: string;
923
- sortBy?: "new" | "hot" | "top" | "controversial" | (string & {});
993
+ sortBy?: "createdAt" | "hot" | "top" | "controversial"
994
+ /** @deprecated Use "createdAt" instead. "new" is a directional alias removed
995
+ * in v8; the server still accepts it (identical behavior) but responds with
996
+ * deprecation headers. */
997
+ | "new" | (string & {});
924
998
  sortDir?: "asc" | "desc";
925
999
  sortType?: "auto" | "numeric" | "text" | "boolean" | "timestamp";
926
1000
  sortByReaction?: "upvote" | "downvote" | "like" | "love" | "wow" | "sad" | "angry" | "funny";
@@ -993,7 +1067,7 @@ interface RemoveEntityReactionProps {
993
1067
  }
994
1068
  declare function removeReaction$1(client: SublayHttpClient, data: RemoveEntityReactionProps): Promise<Entity>;
995
1069
 
996
- interface FetchEntityReactionsProps {
1070
+ interface FetchEntityReactionsProps extends SpaceReputationContextParams {
997
1071
  entityId: string;
998
1072
  reactionType?: ReactionType;
999
1073
  page?: number;
@@ -1041,6 +1115,299 @@ declare namespace Entities {
1041
1115
  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 };
1042
1116
  }
1043
1117
 
1118
+ type EventType = "online" | "physical" | "hybrid";
1119
+ type EventVisibility = "public" | "members" | "invite";
1120
+ type EventStatus = "active" | "cancelled";
1121
+ type RsvpStatus = "going" | "maybe" | "not_going";
1122
+ interface RsvpCounts {
1123
+ going: number;
1124
+ maybe: number;
1125
+ not_going: number;
1126
+ }
1127
+ interface Event {
1128
+ id: string;
1129
+ shortId: string;
1130
+ projectId: string;
1131
+ userId: string | null;
1132
+ user?: User | null;
1133
+ title: string;
1134
+ description: string | null;
1135
+ startTime: string;
1136
+ endTime: string | null;
1137
+ timezone: string | null;
1138
+ type: EventType;
1139
+ url: string | null;
1140
+ venueName: string | null;
1141
+ address: string | null;
1142
+ location: {
1143
+ type: "Point";
1144
+ coordinates: [number, number];
1145
+ } | null;
1146
+ spaceId: string | null;
1147
+ space?: Space | null;
1148
+ visibility: EventVisibility;
1149
+ status: EventStatus;
1150
+ allowMaybe: boolean;
1151
+ guestListVisible: boolean;
1152
+ capacity: number | null;
1153
+ hostIds: string[];
1154
+ coverImageId: string | null;
1155
+ files?: File$1[];
1156
+ rsvpCounts: RsvpCounts;
1157
+ userRsvp?: RsvpStatus | null;
1158
+ metadata: Record<string, any>;
1159
+ createdAt: string;
1160
+ updatedAt: string;
1161
+ deletedAt: string | null;
1162
+ }
1163
+ interface EventRsvp {
1164
+ id: string;
1165
+ eventId: string;
1166
+ userId: string;
1167
+ user?: User | null;
1168
+ status: RsvpStatus;
1169
+ createdAt: string;
1170
+ updatedAt: string;
1171
+ }
1172
+ interface EventInvite {
1173
+ id: string;
1174
+ eventId: string;
1175
+ userId: string;
1176
+ user?: User | null;
1177
+ invitedAt: string;
1178
+ createdAt: string;
1179
+ updatedAt: string;
1180
+ }
1181
+
1182
+ /** A single cover image plus its processing options (stored as Event.coverImageId). */
1183
+ interface EventCoverUpload {
1184
+ file: Blob | File;
1185
+ /** Image-processing config (must include `mode`) — see {@link ImageOptions}. */
1186
+ options: ImageOptions;
1187
+ }
1188
+ /** A gallery image set plus shared processing options (Files with eventId + position). */
1189
+ interface EventGalleryUpload {
1190
+ files: (Blob | File)[];
1191
+ /** Image-processing config applied to every gallery image — see {@link ImageOptions}. */
1192
+ options: ImageOptions;
1193
+ }
1194
+ interface CreateEventProps {
1195
+ title: string;
1196
+ description?: string;
1197
+ startTime: string;
1198
+ endTime?: string;
1199
+ timezone?: string;
1200
+ type: EventType;
1201
+ url?: string;
1202
+ venueName?: string;
1203
+ address?: string;
1204
+ location?: {
1205
+ latitude: number;
1206
+ longitude: number;
1207
+ };
1208
+ spaceId?: string;
1209
+ visibility?: EventVisibility;
1210
+ capacity?: number;
1211
+ allowMaybe?: boolean;
1212
+ guestListVisible?: boolean;
1213
+ /** Additional host user IDs (the logged-in user is auto-added as a host). */
1214
+ hostIds?: string[];
1215
+ metadata?: Record<string, any>;
1216
+ /**
1217
+ * Inline cover image (single). When present the request is sent as
1218
+ * `multipart/form-data`. Requires the `files-images` bundle.
1219
+ */
1220
+ cover?: EventCoverUpload;
1221
+ /**
1222
+ * Inline gallery images (multi). When present the request is sent as
1223
+ * `multipart/form-data`. Requires the `files-images` bundle.
1224
+ */
1225
+ gallery?: EventGalleryUpload;
1226
+ }
1227
+ declare function createEvent(client: SublayHttpClient, data: CreateEventProps): Promise<Event>;
1228
+
1229
+ interface FetchEventProps {
1230
+ eventId: string;
1231
+ /** Comma-separated associations to expand, e.g. "user,space,files,userRsvp". */
1232
+ include?: string;
1233
+ }
1234
+ declare function fetchEvent(client: SublayHttpClient, data: FetchEventProps): Promise<Event>;
1235
+
1236
+ interface EventTextFilters {
1237
+ hasTitle?: "true" | "false";
1238
+ includes?: string | string[];
1239
+ doesNotInclude?: string | string[];
1240
+ }
1241
+ interface EventDescriptionFilters {
1242
+ hasDescription?: "true" | "false";
1243
+ includes?: string | string[];
1244
+ doesNotInclude?: string | string[];
1245
+ }
1246
+ interface EventLocationFilters {
1247
+ latitude: string;
1248
+ longitude: string;
1249
+ radius: string;
1250
+ }
1251
+ interface FetchManyEventsProps {
1252
+ page?: number;
1253
+ limit?: number;
1254
+ sortBy?: "startTime" | "going";
1255
+ sortDir?: "asc" | "desc";
1256
+ timeWindow?: "upcoming" | "ongoing" | "past";
1257
+ startsAfter?: string;
1258
+ startsBefore?: string;
1259
+ spaceId?: string;
1260
+ hostId?: string;
1261
+ type?: EventType;
1262
+ status?: EventStatus;
1263
+ /**
1264
+ * Comma-separated RSVP statuses the logged-in user RSVP'd with, e.g.
1265
+ * "going,maybe". Filters to events the caller has that RSVP on.
1266
+ */
1267
+ myRsvp?: string;
1268
+ locationFilters?: EventLocationFilters;
1269
+ titleFilters?: EventTextFilters;
1270
+ descriptionFilters?: EventDescriptionFilters;
1271
+ /** Comma-separated associations to expand, e.g. "user,space,files,userRsvp". */
1272
+ include?: string;
1273
+ }
1274
+ declare function fetchManyEvents(client: SublayHttpClient, data?: FetchManyEventsProps): Promise<PaginatedResponse<Event>>;
1275
+
1276
+ interface UpdateEventProps {
1277
+ eventId: string;
1278
+ title?: string;
1279
+ description?: string;
1280
+ startTime?: string;
1281
+ endTime?: string;
1282
+ timezone?: string;
1283
+ type?: EventType;
1284
+ url?: string;
1285
+ venueName?: string;
1286
+ address?: string;
1287
+ location?: {
1288
+ latitude: number;
1289
+ longitude: number;
1290
+ };
1291
+ visibility?: EventVisibility;
1292
+ capacity?: number;
1293
+ allowMaybe?: boolean;
1294
+ guestListVisible?: boolean;
1295
+ metadata?: Record<string, any>;
1296
+ /**
1297
+ * File IDs of existing event images to REMOVE (gallery photos and/or the
1298
+ * current cover). Combine with `gallery` (append) + `cover` (replace) to fully
1299
+ * curate the image set in one update. Sent in the JSON body, or — when an
1300
+ * image file is also attached — as a JSON-string field the server parses.
1301
+ */
1302
+ removeImageIds?: string[];
1303
+ /**
1304
+ * New cover image (single) — REPLACES the existing cover. When present the
1305
+ * request is sent as `multipart/form-data`. Requires the `files-images` bundle.
1306
+ */
1307
+ cover?: EventCoverUpload;
1308
+ /**
1309
+ * Gallery images (multi) — APPENDED to the event's existing images. When
1310
+ * present the request is sent as `multipart/form-data`. Requires the
1311
+ * `files-images` bundle.
1312
+ */
1313
+ gallery?: EventGalleryUpload;
1314
+ }
1315
+ declare function updateEvent(client: SublayHttpClient, data: UpdateEventProps): Promise<Event>;
1316
+
1317
+ interface CancelEventProps {
1318
+ eventId: string;
1319
+ }
1320
+ declare function cancelEvent(client: SublayHttpClient, data: CancelEventProps): Promise<Event>;
1321
+
1322
+ interface DeleteEventProps {
1323
+ eventId: string;
1324
+ }
1325
+ declare function deleteEvent(client: SublayHttpClient, data: DeleteEventProps): Promise<void>;
1326
+
1327
+ interface SetRsvpProps {
1328
+ eventId: string;
1329
+ status: RsvpStatus;
1330
+ }
1331
+ declare function setRsvp(client: SublayHttpClient, data: SetRsvpProps): Promise<Event>;
1332
+
1333
+ interface WithdrawRsvpProps {
1334
+ eventId: string;
1335
+ }
1336
+ declare function withdrawRsvp(client: SublayHttpClient, data: WithdrawRsvpProps): Promise<Event>;
1337
+
1338
+ interface AddHostProps {
1339
+ eventId: string;
1340
+ /** The user to grant host on the event. */
1341
+ userId: string;
1342
+ }
1343
+ declare function addHost(client: SublayHttpClient, data: AddHostProps): Promise<Event>;
1344
+
1345
+ interface RemoveHostProps {
1346
+ eventId: string;
1347
+ /** The host to remove. Rejected if it would leave the event with no hosts. */
1348
+ userId: string;
1349
+ }
1350
+ declare function removeHost(client: SublayHttpClient, data: RemoveHostProps): Promise<Event>;
1351
+
1352
+ interface AddInviteProps {
1353
+ eventId: string;
1354
+ /** The user to invite (userId only — never a foreignId). Idempotent. */
1355
+ userId: string;
1356
+ }
1357
+ declare function addInvite(client: SublayHttpClient, data: AddInviteProps): Promise<Event>;
1358
+
1359
+ interface RemoveInviteProps {
1360
+ eventId: string;
1361
+ /** The invitee to remove. Also drops their RSVP and revokes access. */
1362
+ userId: string;
1363
+ }
1364
+ declare function removeInvite(client: SublayHttpClient, data: RemoveInviteProps): Promise<Event>;
1365
+
1366
+ interface FetchInviteesProps {
1367
+ eventId: string;
1368
+ page?: number;
1369
+ limit?: number;
1370
+ }
1371
+ /**
1372
+ * Host-only invitee (guest) list. Non-hosts get 403.
1373
+ */
1374
+ declare function fetchInvitees(client: SublayHttpClient, data: FetchInviteesProps): Promise<PaginatedResponse<EventInvite>>;
1375
+
1376
+ interface FetchEventRsvpsProps {
1377
+ eventId: string;
1378
+ page?: number;
1379
+ limit?: number;
1380
+ /**
1381
+ * Comma-separated RSVP statuses to filter by, e.g. "going,maybe". When
1382
+ * omitted, all statuses are returned.
1383
+ */
1384
+ status?: string;
1385
+ }
1386
+ /**
1387
+ * Named RSVP (guest) list. Visible to hosts always, or to any viewer when the
1388
+ * event's `guestListVisible` is true; otherwise 403. RSVP counts themselves are
1389
+ * public via the event's `rsvpCounts`.
1390
+ */
1391
+ declare function fetchEventRsvps(client: SublayHttpClient, data: FetchEventRsvpsProps): Promise<PaginatedResponse<EventRsvp>>;
1392
+
1393
+ declare const Events_addHost: typeof addHost;
1394
+ declare const Events_addInvite: typeof addInvite;
1395
+ declare const Events_cancelEvent: typeof cancelEvent;
1396
+ declare const Events_createEvent: typeof createEvent;
1397
+ declare const Events_deleteEvent: typeof deleteEvent;
1398
+ declare const Events_fetchEvent: typeof fetchEvent;
1399
+ declare const Events_fetchEventRsvps: typeof fetchEventRsvps;
1400
+ declare const Events_fetchInvitees: typeof fetchInvitees;
1401
+ declare const Events_fetchManyEvents: typeof fetchManyEvents;
1402
+ declare const Events_removeHost: typeof removeHost;
1403
+ declare const Events_removeInvite: typeof removeInvite;
1404
+ declare const Events_setRsvp: typeof setRsvp;
1405
+ declare const Events_updateEvent: typeof updateEvent;
1406
+ declare const Events_withdrawRsvp: typeof withdrawRsvp;
1407
+ declare namespace Events {
1408
+ 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 };
1409
+ }
1410
+
1044
1411
  interface GifData {
1045
1412
  id: string;
1046
1413
  url: string;
@@ -1093,7 +1460,7 @@ interface CreateCommentProps {
1093
1460
  }
1094
1461
  declare function createComment(client: SublayHttpClient, data: CreateCommentProps): Promise<Comment>;
1095
1462
 
1096
- interface FetchCommentProps {
1463
+ interface FetchCommentProps extends SpaceReputationContextParams {
1097
1464
  commentId: string;
1098
1465
  include?: string;
1099
1466
  }
@@ -1116,13 +1483,23 @@ interface DeleteCommentProps {
1116
1483
  }
1117
1484
  declare function deleteComment(client: SublayHttpClient, data: DeleteCommentProps): Promise<void>;
1118
1485
 
1119
- interface FetchManyCommentsProps {
1486
+ interface FetchManyCommentsProps extends SpaceReputationContextParams {
1120
1487
  entityId?: string;
1121
1488
  userId?: string;
1122
1489
  parentId?: string;
1123
1490
  page?: number;
1124
1491
  limit?: number;
1125
- sortBy?: "new" | "old" | "top" | "controversial";
1492
+ sortBy?: "createdAt" | "top" | "controversial"
1493
+ /** @deprecated Use "createdAt" instead. "new" is a directional alias for
1494
+ * createdAt DESC, removed in v8; the server still accepts it (identical
1495
+ * behavior) but responds with deprecation headers. */
1496
+ | "new"
1497
+ /** @deprecated Use "createdAt" with sortDir:"asc" instead. "old" is a
1498
+ * directional alias for createdAt ASC, removed in v8; the server still
1499
+ * accepts it (identical behavior) but responds with deprecation headers. */
1500
+ | "old";
1501
+ /** Sort direction for `sortBy: "createdAt"`. Defaults to "desc". */
1502
+ sortDir?: "asc" | "desc";
1126
1503
  include?: string;
1127
1504
  sourceId?: string;
1128
1505
  }
@@ -1139,7 +1516,7 @@ interface RemoveCommentReactionProps {
1139
1516
  }
1140
1517
  declare function removeReaction(client: SublayHttpClient, data: RemoveCommentReactionProps): Promise<Comment>;
1141
1518
 
1142
- interface FetchCommentReactionsProps {
1519
+ interface FetchCommentReactionsProps extends SpaceReputationContextParams {
1143
1520
  commentId: string;
1144
1521
  reactionType?: ReactionType;
1145
1522
  page?: number;
@@ -1174,6 +1551,12 @@ declare namespace Comments {
1174
1551
  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 };
1175
1552
  }
1176
1553
 
1554
+ /** A file plus the image-processing options the server requires alongside it. */
1555
+ interface SpaceImageUpload {
1556
+ file: Blob | File;
1557
+ /** Image-processing config (must include `mode`) — see {@link ImageOptions}. */
1558
+ options: ImageOptions;
1559
+ }
1177
1560
  interface CreateSpaceProps {
1178
1561
  name: string;
1179
1562
  slug?: string;
@@ -1183,6 +1566,13 @@ interface CreateSpaceProps {
1183
1566
  requireJoinApproval?: boolean;
1184
1567
  parentSpaceId?: string;
1185
1568
  metadata?: Record<string, any>;
1569
+ /**
1570
+ * Avatar image. When present the request is sent as `multipart/form-data` and
1571
+ * the server processes the image per `options`.
1572
+ */
1573
+ avatarFile?: SpaceImageUpload;
1574
+ /** Banner image; same contract as {@link CreateSpaceProps.avatarFile}. */
1575
+ bannerFile?: SpaceImageUpload;
1186
1576
  }
1187
1577
  declare function createSpace(client: SublayHttpClient, data: CreateSpaceProps): Promise<Space>;
1188
1578
 
@@ -1250,6 +1640,13 @@ interface UpdateSpaceProps {
1250
1640
  readingPermission?: ReadingPermission;
1251
1641
  postingPermission?: PostingPermission;
1252
1642
  metadata?: Record<string, any>;
1643
+ /**
1644
+ * New avatar image. When present the request is sent as `multipart/form-data`
1645
+ * and the server processes the image per `options`, replacing the old avatar.
1646
+ */
1647
+ avatarFile?: SpaceImageUpload;
1648
+ /** New banner image; same contract as {@link UpdateSpaceProps.avatarFile}. */
1649
+ bannerFile?: SpaceImageUpload;
1253
1650
  }
1254
1651
  declare function updateSpace(client: SublayHttpClient, data: UpdateSpaceProps): Promise<Space>;
1255
1652
 
@@ -1305,7 +1702,7 @@ interface SpaceTeamResponse {
1305
1702
  data: SpaceMemberWithUser[];
1306
1703
  }
1307
1704
 
1308
- interface FetchSpaceMembersProps {
1705
+ interface FetchSpaceMembersProps extends SpaceReputationContextParams {
1309
1706
  spaceId: string;
1310
1707
  page?: number;
1311
1708
  limit?: number;
@@ -1314,7 +1711,7 @@ interface FetchSpaceMembersProps {
1314
1711
  }
1315
1712
  declare function fetchSpaceMembers(client: SublayHttpClient, data: FetchSpaceMembersProps): Promise<SpaceMembersResponse>;
1316
1713
 
1317
- interface FetchSpaceTeamProps {
1714
+ interface FetchSpaceTeamProps extends SpaceReputationContextParams {
1318
1715
  spaceId: string;
1319
1716
  }
1320
1717
  declare function fetchSpaceTeam(client: SublayHttpClient, data: FetchSpaceTeamProps): Promise<SpaceTeamResponse>;
@@ -2113,7 +2510,7 @@ interface CreateReportProps {
2113
2510
  }
2114
2511
  declare function createReport(client: SublayHttpClient, data: CreateReportProps): Promise<CreateReportResponse>;
2115
2512
 
2116
- interface FetchModeratedReportsProps {
2513
+ interface FetchModeratedReportsProps extends SpaceReputationContextParams {
2117
2514
  spaceId?: string;
2118
2515
  targetType?: ReportTargetType;
2119
2516
  status?: ReportStatus;
@@ -2129,7 +2526,7 @@ declare namespace Reports {
2129
2526
  export { Reports_createReport as createReport, Reports_fetchModeratedReports as fetchModeratedReports };
2130
2527
  }
2131
2528
 
2132
- interface SearchContentProps {
2529
+ interface SearchContentProps extends SpaceReputationContextParams {
2133
2530
  query: string;
2134
2531
  sourceTypes?: ("entity" | "comment" | "message")[];
2135
2532
  spaceId?: string;
@@ -2163,7 +2560,7 @@ interface SpaceSearchResult {
2163
2560
  }
2164
2561
  declare function searchSpaces(client: SublayHttpClient, data: SearchSpacesProps): Promise<SpaceSearchResult[]>;
2165
2562
 
2166
- interface AskContentProps {
2563
+ interface AskContentProps extends SpaceReputationContextParams {
2167
2564
  query: string;
2168
2565
  sourceTypes?: ("entity" | "comment" | "message")[];
2169
2566
  spaceId?: string;
@@ -2254,10 +2651,11 @@ interface UploadImageProps {
2254
2651
  imageOptions: ImageOptions;
2255
2652
  /** Storage path segments, e.g. ["spaces", spaceId, "banner"]. */
2256
2653
  pathParts?: string[];
2257
- /** Only one of entityId/commentId/spaceId may be set. */
2654
+ /** Only one of entityId/commentId/spaceId/eventId may be set. */
2258
2655
  entityId?: string;
2259
2656
  commentId?: string;
2260
2657
  spaceId?: string;
2658
+ eventId?: string;
2261
2659
  }
2262
2660
  declare function uploadImage(client: SublayHttpClient, data: UploadImageProps): Promise<UploadImageResponse>;
2263
2661
 
@@ -2473,7 +2871,7 @@ interface UnreadCountResponse {
2473
2871
  }
2474
2872
  declare function getUnreadCount(client: SublayHttpClient): Promise<UnreadCountResponse>;
2475
2873
 
2476
- interface ListMembersProps {
2874
+ interface ListMembersProps extends SpaceReputationContextParams {
2477
2875
  conversationId: string;
2478
2876
  page?: number;
2479
2877
  limit?: number;
@@ -2520,7 +2918,7 @@ interface MessageFilters {
2520
2918
  */
2521
2919
  hasReplies?: boolean;
2522
2920
  }
2523
- interface ListMessagesProps {
2921
+ interface ListMessagesProps extends SpaceReputationContextParams {
2524
2922
  conversationId: string;
2525
2923
  /** Restrict to replies of this message (thread view). */
2526
2924
  parentId?: string;
@@ -2550,7 +2948,7 @@ interface ListMessagesResponse {
2550
2948
  }
2551
2949
  declare function listMessages(client: SublayHttpClient, data: ListMessagesProps): Promise<ListMessagesResponse>;
2552
2950
 
2553
- interface SendMessageProps {
2951
+ interface SendMessageProps extends SpaceReputationContextParams {
2554
2952
  conversationId: string;
2555
2953
  content?: string;
2556
2954
  gif?: GifData | null;
@@ -2568,7 +2966,7 @@ interface SendMessageProps {
2568
2966
  }
2569
2967
  declare function sendMessage(client: SublayHttpClient, data: SendMessageProps): Promise<ChatMessage>;
2570
2968
 
2571
- interface GetMessageProps {
2969
+ interface GetMessageProps extends SpaceReputationContextParams {
2572
2970
  conversationId: string;
2573
2971
  messageId: string;
2574
2972
  }
@@ -2612,7 +3010,7 @@ interface ToggleReactionResponse {
2612
3010
  }
2613
3011
  declare function toggleReaction(client: SublayHttpClient, data: ToggleReactionProps): Promise<ToggleReactionResponse>;
2614
3012
 
2615
- interface ListReactionsProps {
3013
+ interface ListReactionsProps extends SpaceReputationContextParams {
2616
3014
  conversationId: string;
2617
3015
  messageId: string;
2618
3016
  /** The reaction emoji to list reactors for (required). */
@@ -2748,6 +3146,7 @@ declare class SublayClient {
2748
3146
  auth: BoundModule<typeof Auth>;
2749
3147
  users: BoundModule<typeof Users>;
2750
3148
  entities: BoundModule<typeof Entities>;
3149
+ events: BoundModule<typeof Events>;
2751
3150
  comments: BoundModule<typeof Comments>;
2752
3151
  spaces: BoundModule<typeof Spaces>;
2753
3152
  collections: BoundModule<typeof Collections>;
@@ -2773,4 +3172,4 @@ declare class SublayClient {
2773
3172
  clearTokens(): void;
2774
3173
  }
2775
3174
 
2776
- export { type AuthTokens, type BulkDeleteProps, type BulkDeleteResult, type ClientConfig, type DbFilter, type DbFilterOperator, type DeleteResult, type PaginatedResponse, type PaginationMetadata, SublayClient, type TableAccessor, type TableQuery, type TableRow };
3175
+ export { type AuthTokens, type BulkDeleteProps, type BulkDeleteResult, type ClientConfig, type DbFilter, type DbFilterOperator, type DeleteResult, type PaginatedResponse, type PaginationMetadata, type SpaceReputationContextParams, type SpaceReputationUserParams, SublayClient, type TableAccessor, type TableQuery, type TableRow };
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>;
@@ -48,4 +50,5 @@ export declare class SublayClient {
48
50
  }
49
51
  export type { ClientConfig, AuthTokens } from "./core/client";
50
52
  export type { PaginatedResponse, PaginationMetadata, } from "./interfaces/IPaginatedResponse";
53
+ export type { SpaceReputationContextParams, SpaceReputationUserParams, } from "./interfaces/SpaceReputation";
51
54
  export type { TableAccessor, TableRow, TableQuery, DbFilter, DbFilterOperator, BulkDeleteProps, DeleteResult, BulkDeleteResult, } from "./interfaces/Table";