@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
@@ -0,0 +1,66 @@
1
+ import { User } from "./User";
2
+ import { Space } from "./Space";
3
+ import { File } from "./File";
4
+ export type EventType = "online" | "physical" | "hybrid";
5
+ export type EventVisibility = "public" | "members" | "invite";
6
+ export type EventStatus = "active" | "cancelled";
7
+ export type RsvpStatus = "going" | "maybe" | "not_going";
8
+ export interface RsvpCounts {
9
+ going: number;
10
+ maybe: number;
11
+ not_going: number;
12
+ }
13
+ export interface Event {
14
+ id: string;
15
+ shortId: string;
16
+ projectId: string;
17
+ userId: string | null;
18
+ user?: User | null;
19
+ title: string;
20
+ description: string | null;
21
+ startTime: string;
22
+ endTime: string | null;
23
+ timezone: string | null;
24
+ type: EventType;
25
+ url: string | null;
26
+ venueName: string | null;
27
+ address: string | null;
28
+ location: {
29
+ type: "Point";
30
+ coordinates: [number, number];
31
+ } | null;
32
+ spaceId: string | null;
33
+ space?: Space | null;
34
+ visibility: EventVisibility;
35
+ status: EventStatus;
36
+ allowMaybe: boolean;
37
+ guestListVisible: boolean;
38
+ capacity: number | null;
39
+ hostIds: string[];
40
+ coverImageId: string | null;
41
+ files?: File[];
42
+ rsvpCounts: RsvpCounts;
43
+ userRsvp?: RsvpStatus | null;
44
+ metadata: Record<string, any>;
45
+ createdAt: string;
46
+ updatedAt: string;
47
+ deletedAt: string | null;
48
+ }
49
+ export interface EventRsvp {
50
+ id: string;
51
+ eventId: string;
52
+ userId: string;
53
+ user?: User | null;
54
+ status: RsvpStatus;
55
+ createdAt: string;
56
+ updatedAt: string;
57
+ }
58
+ export interface EventInvite {
59
+ id: string;
60
+ eventId: string;
61
+ userId: string;
62
+ user?: User | null;
63
+ invitedAt: string;
64
+ createdAt: string;
65
+ updatedAt: string;
66
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Shared optional params for opting a request into space-scoped reputation
3
+ * enrichment. When set, users embedded in the response carry a
4
+ * `spaceReputation` field (see {@link import("./User").UserFull}).
5
+ *
6
+ * Two variants exist because the server accepts a different value set per
7
+ * endpoint class:
8
+ * - {@link SpaceReputationContextParams} — context endpoints (entities,
9
+ * comments, chat, spaces, search, reports). Accept `<uuid> | "none" |
10
+ * "context"`.
11
+ * - {@link SpaceReputationUserParams} — user-direct endpoints (the `users`
12
+ * module). Accept `<uuid> | "none"` only; `"context"` is rejected by the
13
+ * server (400).
14
+ *
15
+ * Both classes share the same param names and types — only the accepted
16
+ * `spaceReputationId` value set (documented in JSDoc) differs.
17
+ */
18
+ /**
19
+ * Space-reputation params for **context** endpoints.
20
+ */
21
+ export interface SpaceReputationContextParams {
22
+ /**
23
+ * Opt into space-scoped reputation enrichment. Accepted forms:
24
+ * - a space `<uuid>` — reputation within that specific space;
25
+ * - `"none"` — no space context (global reputation only);
26
+ * - `"context"` — derive the space from each record's own context
27
+ * (e.g. a feed enriches each row's author with reputation in that row's
28
+ * space).
29
+ *
30
+ * Plain `string` — a `string | "none" | "context"` union adds no safety
31
+ * since a uuid is already a string.
32
+ */
33
+ spaceReputationId?: string;
34
+ /**
35
+ * Whether to include descendant spaces when computing space-scoped
36
+ * reputation. Only honored with an explicit space `<uuid>` (ignored for
37
+ * `"none"` / `"context"`).
38
+ */
39
+ spaceReputationDescendants?: boolean;
40
+ }
41
+ /**
42
+ * Space-reputation params for **user-direct** endpoints (the `users` module).
43
+ */
44
+ export interface SpaceReputationUserParams {
45
+ /**
46
+ * Opt into space-scoped reputation enrichment. Accepted forms:
47
+ * - a space `<uuid>` — reputation within that specific space;
48
+ * - `"none"` — no space context (global reputation only).
49
+ *
50
+ * `"context"` is **rejected by the server (400)** on user-direct endpoints —
51
+ * there is no per-record context to derive a space from.
52
+ *
53
+ * Plain `string` — a `string | "none"` union adds no safety since a uuid is
54
+ * already a string.
55
+ */
56
+ spaceReputationId?: string;
57
+ /**
58
+ * Whether to include descendant spaces when computing space-scoped
59
+ * reputation. Only honored with an explicit space `<uuid>`.
60
+ */
61
+ spaceReputationDescendants?: boolean;
62
+ }
@@ -22,6 +22,13 @@ export type UserFull = {
22
22
  metadata: Record<string, any>;
23
23
  secureMetadata: Record<string, any>;
24
24
  reputation: number;
25
+ /**
26
+ * Space-scoped reputation, present only when the request opted in via
27
+ * `spaceReputationId` (and the project has the reputation bundle). It is the
28
+ * user's reputation within the requested space context — see
29
+ * {@link SpaceReputationContextParams} / {@link SpaceReputationUserParams}.
30
+ */
31
+ spaceReputation?: number;
25
32
  isVerified: boolean;
26
33
  isActive: boolean;
27
34
  lastActive: string;
@@ -1,6 +1,7 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { ChatMessage } from "../../interfaces/ChatMessage";
3
- export interface GetMessageProps {
3
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
4
+ export interface GetMessageProps extends SpaceReputationContextParams {
4
5
  conversationId: string;
5
6
  messageId: string;
6
7
  }
@@ -1,7 +1,8 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { ConversationMember } from "../../interfaces/ConversationMember";
3
3
  import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
- export interface ListMembersProps {
4
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
5
+ export interface ListMembersProps extends SpaceReputationContextParams {
5
6
  conversationId: string;
6
7
  page?: number;
7
8
  limit?: number;
@@ -1,5 +1,6 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { ChatMessage } from "../../interfaces/ChatMessage";
3
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
3
4
  export interface MessageFilters {
4
5
  /**
5
6
  * Filter to messages that have thread replies (not quotings). `true` returns
@@ -8,7 +9,7 @@ export interface MessageFilters {
8
9
  */
9
10
  hasReplies?: boolean;
10
11
  }
11
- export interface ListMessagesProps {
12
+ export interface ListMessagesProps extends SpaceReputationContextParams {
12
13
  conversationId: string;
13
14
  /** Restrict to replies of this message (thread view). */
14
15
  parentId?: string;
@@ -1,7 +1,8 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { User } from "../../interfaces/User";
3
3
  import { PaginationMetadata } from "../../interfaces/IPaginatedResponse";
4
- export interface ListReactionsProps {
4
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
5
+ export interface ListReactionsProps extends SpaceReputationContextParams {
5
6
  conversationId: string;
6
7
  messageId: string;
7
8
  /** The reaction emoji to list reactors for (required). */
@@ -2,7 +2,8 @@ import { SublayHttpClient } from "../../core/client";
2
2
  import { ChatMessage } from "../../interfaces/ChatMessage";
3
3
  import { GifData } from "../../interfaces/Comment";
4
4
  import { Mention } from "../../interfaces/Mention";
5
- export interface SendMessageProps {
5
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
6
+ export interface SendMessageProps extends SpaceReputationContextParams {
6
7
  conversationId: string;
7
8
  content?: string;
8
9
  gif?: GifData | null;
@@ -1,6 +1,7 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { Comment } from "../../interfaces/Comment";
3
- export interface FetchCommentProps {
3
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
4
+ export interface FetchCommentProps extends SpaceReputationContextParams {
4
5
  commentId: string;
5
6
  include?: string;
6
7
  }
@@ -1,13 +1,24 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { Comment } from "../../interfaces/Comment";
3
3
  import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
- export interface FetchManyCommentsProps {
4
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
5
+ export interface FetchManyCommentsProps extends SpaceReputationContextParams {
5
6
  entityId?: string;
6
7
  userId?: string;
7
8
  parentId?: string;
8
9
  page?: number;
9
10
  limit?: number;
10
- sortBy?: "new" | "old" | "top" | "controversial";
11
+ sortBy?: "createdAt" | "top" | "controversial"
12
+ /** @deprecated Use "createdAt" instead. "new" is a directional alias for
13
+ * createdAt DESC, removed in v8; the server still accepts it (identical
14
+ * behavior) but responds with deprecation headers. */
15
+ | "new"
16
+ /** @deprecated Use "createdAt" with sortDir:"asc" instead. "old" is a
17
+ * directional alias for createdAt ASC, removed in v8; the server still
18
+ * accepts it (identical behavior) but responds with deprecation headers. */
19
+ | "old";
20
+ /** Sort direction for `sortBy: "createdAt"`. Defaults to "desc". */
21
+ sortDir?: "asc" | "desc";
11
22
  include?: string;
12
23
  sourceId?: string;
13
24
  }
@@ -1,7 +1,8 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { Reaction, ReactionType } from "../../interfaces/Reaction";
3
3
  import { PaginationMetadata } from "../../interfaces/IPaginatedResponse";
4
- export interface FetchCommentReactionsProps {
4
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
5
+ export interface FetchCommentReactionsProps extends SpaceReputationContextParams {
5
6
  commentId: string;
6
7
  reactionType?: ReactionType;
7
8
  page?: number;
@@ -1,6 +1,7 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { Entity } from "../../interfaces/Entity";
3
- export interface FetchEntityProps {
3
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
4
+ export interface FetchEntityProps extends SpaceReputationContextParams {
4
5
  entityId: string;
5
6
  include?: string;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { Entity } from "../../interfaces/Entity";
3
3
  import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
4
5
  export interface KeywordsFilters {
5
6
  includes?: string[];
6
7
  doesNotInclude?: string[];
@@ -31,10 +32,14 @@ export interface LocationFilters {
31
32
  longitude: string;
32
33
  radius: string;
33
34
  }
34
- export interface FetchManyEntitiesProps {
35
+ export interface FetchManyEntitiesProps extends SpaceReputationContextParams {
35
36
  sourceId?: string;
36
37
  spaceId?: string;
37
- sortBy?: "new" | "hot" | "top" | "controversial" | (string & {});
38
+ sortBy?: "createdAt" | "hot" | "top" | "controversial"
39
+ /** @deprecated Use "createdAt" instead. "new" is a directional alias removed
40
+ * in v8; the server still accepts it (identical behavior) but responds with
41
+ * deprecation headers. */
42
+ | "new" | (string & {});
38
43
  sortDir?: "asc" | "desc";
39
44
  sortType?: "auto" | "numeric" | "text" | "boolean" | "timestamp";
40
45
  sortByReaction?: "upvote" | "downvote" | "like" | "love" | "wow" | "sad" | "angry" | "funny";
@@ -1,7 +1,8 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { Reaction, ReactionType } from "../../interfaces/Reaction";
3
3
  import { PaginationMetadata } from "../../interfaces/IPaginatedResponse";
4
- export interface FetchEntityReactionsProps {
4
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
5
+ export interface FetchEntityReactionsProps extends SpaceReputationContextParams {
5
6
  entityId: string;
6
7
  reactionType?: ReactionType;
7
8
  page?: number;
@@ -0,0 +1,8 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Event } from "../../interfaces/Event";
3
+ export interface AddHostProps {
4
+ eventId: string;
5
+ /** The user to grant host on the event. */
6
+ userId: string;
7
+ }
8
+ export declare function addHost(client: SublayHttpClient, data: AddHostProps): Promise<Event>;
@@ -0,0 +1,8 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Event } from "../../interfaces/Event";
3
+ export interface AddInviteProps {
4
+ eventId: string;
5
+ /** The user to invite (userId only — never a foreignId). Idempotent. */
6
+ userId: string;
7
+ }
8
+ export declare function addInvite(client: SublayHttpClient, data: AddInviteProps): Promise<Event>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Event } from "../../interfaces/Event";
3
+ export interface CancelEventProps {
4
+ eventId: string;
5
+ }
6
+ export declare function cancelEvent(client: SublayHttpClient, data: CancelEventProps): Promise<Event>;
@@ -0,0 +1,49 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Event, EventType, EventVisibility } from "../../interfaces/Event";
3
+ import { ImageOptions } from "../../interfaces/ImageProcessing";
4
+ /** A single cover image plus its processing options (stored as Event.coverImageId). */
5
+ export interface EventCoverUpload {
6
+ file: Blob | File;
7
+ /** Image-processing config (must include `mode`) — see {@link ImageOptions}. */
8
+ options: ImageOptions;
9
+ }
10
+ /** A gallery image set plus shared processing options (Files with eventId + position). */
11
+ export interface EventGalleryUpload {
12
+ files: (Blob | File)[];
13
+ /** Image-processing config applied to every gallery image — see {@link ImageOptions}. */
14
+ options: ImageOptions;
15
+ }
16
+ export interface CreateEventProps {
17
+ title: string;
18
+ description?: string;
19
+ startTime: string;
20
+ endTime?: string;
21
+ timezone?: string;
22
+ type: EventType;
23
+ url?: string;
24
+ venueName?: string;
25
+ address?: string;
26
+ location?: {
27
+ latitude: number;
28
+ longitude: number;
29
+ };
30
+ spaceId?: string;
31
+ visibility?: EventVisibility;
32
+ capacity?: number;
33
+ allowMaybe?: boolean;
34
+ guestListVisible?: boolean;
35
+ /** Additional host user IDs (the logged-in user is auto-added as a host). */
36
+ hostIds?: string[];
37
+ metadata?: Record<string, any>;
38
+ /**
39
+ * Inline cover image (single). When present the request is sent as
40
+ * `multipart/form-data`. Requires the `files-images` bundle.
41
+ */
42
+ cover?: EventCoverUpload;
43
+ /**
44
+ * Inline gallery images (multi). When present the request is sent as
45
+ * `multipart/form-data`. Requires the `files-images` bundle.
46
+ */
47
+ gallery?: EventGalleryUpload;
48
+ }
49
+ export declare function createEvent(client: SublayHttpClient, data: CreateEventProps): Promise<Event>;
@@ -0,0 +1,5 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ export interface DeleteEventProps {
3
+ eventId: string;
4
+ }
5
+ export declare function deleteEvent(client: SublayHttpClient, data: DeleteEventProps): Promise<void>;
@@ -0,0 +1,8 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Event } from "../../interfaces/Event";
3
+ export interface FetchEventProps {
4
+ eventId: string;
5
+ /** Comma-separated associations to expand, e.g. "user,space,files,userRsvp". */
6
+ include?: string;
7
+ }
8
+ export declare function fetchEvent(client: SublayHttpClient, data: FetchEventProps): Promise<Event>;
@@ -0,0 +1,19 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { EventRsvp } from "../../interfaces/Event";
3
+ import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
+ export interface FetchEventRsvpsProps {
5
+ eventId: string;
6
+ page?: number;
7
+ limit?: number;
8
+ /**
9
+ * Comma-separated RSVP statuses to filter by, e.g. "going,maybe". When
10
+ * omitted, all statuses are returned.
11
+ */
12
+ status?: string;
13
+ }
14
+ /**
15
+ * Named RSVP (guest) list. Visible to hosts always, or to any viewer when the
16
+ * event's `guestListVisible` is true; otherwise 403. RSVP counts themselves are
17
+ * public via the event's `rsvpCounts`.
18
+ */
19
+ export declare function fetchEventRsvps(client: SublayHttpClient, data: FetchEventRsvpsProps): Promise<PaginatedResponse<EventRsvp>>;
@@ -0,0 +1,12 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { EventInvite } from "../../interfaces/Event";
3
+ import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
+ export interface FetchInviteesProps {
5
+ eventId: string;
6
+ page?: number;
7
+ limit?: number;
8
+ }
9
+ /**
10
+ * Host-only invitee (guest) list. Non-hosts get 403.
11
+ */
12
+ export declare function fetchInvitees(client: SublayHttpClient, data: FetchInviteesProps): Promise<PaginatedResponse<EventInvite>>;
@@ -0,0 +1,42 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Event, EventType, EventStatus } from "../../interfaces/Event";
3
+ import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
+ export interface EventTextFilters {
5
+ hasTitle?: "true" | "false";
6
+ includes?: string | string[];
7
+ doesNotInclude?: string | string[];
8
+ }
9
+ export interface EventDescriptionFilters {
10
+ hasDescription?: "true" | "false";
11
+ includes?: string | string[];
12
+ doesNotInclude?: string | string[];
13
+ }
14
+ export interface EventLocationFilters {
15
+ latitude: string;
16
+ longitude: string;
17
+ radius: string;
18
+ }
19
+ export interface FetchManyEventsProps {
20
+ page?: number;
21
+ limit?: number;
22
+ sortBy?: "startTime" | "going";
23
+ sortDir?: "asc" | "desc";
24
+ timeWindow?: "upcoming" | "ongoing" | "past";
25
+ startsAfter?: string;
26
+ startsBefore?: string;
27
+ spaceId?: string;
28
+ hostId?: string;
29
+ type?: EventType;
30
+ status?: EventStatus;
31
+ /**
32
+ * Comma-separated RSVP statuses the logged-in user RSVP'd with, e.g.
33
+ * "going,maybe". Filters to events the caller has that RSVP on.
34
+ */
35
+ myRsvp?: string;
36
+ locationFilters?: EventLocationFilters;
37
+ titleFilters?: EventTextFilters;
38
+ descriptionFilters?: EventDescriptionFilters;
39
+ /** Comma-separated associations to expand, e.g. "user,space,files,userRsvp". */
40
+ include?: string;
41
+ }
42
+ export declare function fetchManyEvents(client: SublayHttpClient, data?: FetchManyEventsProps): Promise<PaginatedResponse<Event>>;
@@ -0,0 +1,14 @@
1
+ export { createEvent } from "./createEvent";
2
+ export { fetchEvent } from "./fetchEvent";
3
+ export { fetchManyEvents } from "./fetchManyEvents";
4
+ export { updateEvent } from "./updateEvent";
5
+ export { cancelEvent } from "./cancelEvent";
6
+ export { deleteEvent } from "./deleteEvent";
7
+ export { setRsvp } from "./setRsvp";
8
+ export { withdrawRsvp } from "./withdrawRsvp";
9
+ export { addHost } from "./addHost";
10
+ export { removeHost } from "./removeHost";
11
+ export { addInvite } from "./addInvite";
12
+ export { removeInvite } from "./removeInvite";
13
+ export { fetchInvitees } from "./fetchInvitees";
14
+ export { fetchEventRsvps } from "./fetchEventRsvps";
@@ -0,0 +1,8 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Event } from "../../interfaces/Event";
3
+ export interface RemoveHostProps {
4
+ eventId: string;
5
+ /** The host to remove. Rejected if it would leave the event with no hosts. */
6
+ userId: string;
7
+ }
8
+ export declare function removeHost(client: SublayHttpClient, data: RemoveHostProps): Promise<Event>;
@@ -0,0 +1,8 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Event } from "../../interfaces/Event";
3
+ export interface RemoveInviteProps {
4
+ eventId: string;
5
+ /** The invitee to remove. Also drops their RSVP and revokes access. */
6
+ userId: string;
7
+ }
8
+ export declare function removeInvite(client: SublayHttpClient, data: RemoveInviteProps): Promise<Event>;
@@ -0,0 +1,7 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Event, RsvpStatus } from "../../interfaces/Event";
3
+ export interface SetRsvpProps {
4
+ eventId: string;
5
+ status: RsvpStatus;
6
+ }
7
+ export declare function setRsvp(client: SublayHttpClient, data: SetRsvpProps): Promise<Event>;
@@ -0,0 +1,43 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Event, EventType, EventVisibility } from "../../interfaces/Event";
3
+ import type { EventCoverUpload, EventGalleryUpload } from "./createEvent";
4
+ export interface UpdateEventProps {
5
+ eventId: string;
6
+ title?: string;
7
+ description?: string;
8
+ startTime?: string;
9
+ endTime?: string;
10
+ timezone?: string;
11
+ type?: EventType;
12
+ url?: string;
13
+ venueName?: string;
14
+ address?: string;
15
+ location?: {
16
+ latitude: number;
17
+ longitude: number;
18
+ };
19
+ visibility?: EventVisibility;
20
+ capacity?: number;
21
+ allowMaybe?: boolean;
22
+ guestListVisible?: boolean;
23
+ metadata?: Record<string, any>;
24
+ /**
25
+ * File IDs of existing event images to REMOVE (gallery photos and/or the
26
+ * current cover). Combine with `gallery` (append) + `cover` (replace) to fully
27
+ * curate the image set in one update. Sent in the JSON body, or — when an
28
+ * image file is also attached — as a JSON-string field the server parses.
29
+ */
30
+ removeImageIds?: string[];
31
+ /**
32
+ * New cover image (single) — REPLACES the existing cover. When present the
33
+ * request is sent as `multipart/form-data`. Requires the `files-images` bundle.
34
+ */
35
+ cover?: EventCoverUpload;
36
+ /**
37
+ * Gallery images (multi) — APPENDED to the event's existing images. When
38
+ * present the request is sent as `multipart/form-data`. Requires the
39
+ * `files-images` bundle.
40
+ */
41
+ gallery?: EventGalleryUpload;
42
+ }
43
+ export declare function updateEvent(client: SublayHttpClient, data: UpdateEventProps): Promise<Event>;
@@ -0,0 +1,6 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { Event } from "../../interfaces/Event";
3
+ export interface WithdrawRsvpProps {
4
+ eventId: string;
5
+ }
6
+ export declare function withdrawRsvp(client: SublayHttpClient, data: WithdrawRsvpProps): Promise<Event>;
@@ -1,7 +1,8 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { Report, ReportStatus, ReportTargetType } from "../../interfaces/Report";
3
3
  import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
- export interface FetchModeratedReportsProps {
4
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
5
+ export interface FetchModeratedReportsProps extends SpaceReputationContextParams {
5
6
  spaceId?: string;
6
7
  targetType?: ReportTargetType;
7
8
  status?: ReportStatus;
@@ -1,6 +1,7 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { ContentSearchResult } from "./searchContent";
3
- export interface AskContentProps {
3
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
4
+ export interface AskContentProps extends SpaceReputationContextParams {
4
5
  query: string;
5
6
  sourceTypes?: ("entity" | "comment" | "message")[];
6
7
  spaceId?: string;
@@ -2,7 +2,8 @@ import { SublayHttpClient } from "../../core/client";
2
2
  import { Entity } from "../../interfaces/Entity";
3
3
  import { Comment } from "../../interfaces/Comment";
4
4
  import { ChatMessage } from "../../interfaces/ChatMessage";
5
- export interface SearchContentProps {
5
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
6
+ export interface SearchContentProps extends SpaceReputationContextParams {
6
7
  query: string;
7
8
  sourceTypes?: ("entity" | "comment" | "message")[];
8
9
  spaceId?: string;
@@ -1,5 +1,12 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { Space, ReadingPermission, PostingPermission } from "../../interfaces/Space";
3
+ import { ImageOptions } from "../../interfaces/ImageProcessing";
4
+ /** A file plus the image-processing options the server requires alongside it. */
5
+ export interface SpaceImageUpload {
6
+ file: Blob | File;
7
+ /** Image-processing config (must include `mode`) — see {@link ImageOptions}. */
8
+ options: ImageOptions;
9
+ }
3
10
  export interface CreateSpaceProps {
4
11
  name: string;
5
12
  slug?: string;
@@ -9,5 +16,12 @@ export interface CreateSpaceProps {
9
16
  requireJoinApproval?: boolean;
10
17
  parentSpaceId?: string;
11
18
  metadata?: Record<string, any>;
19
+ /**
20
+ * Avatar image. When present the request is sent as `multipart/form-data` and
21
+ * the server processes the image per `options`.
22
+ */
23
+ avatarFile?: SpaceImageUpload;
24
+ /** Banner image; same contract as {@link CreateSpaceProps.avatarFile}. */
25
+ bannerFile?: SpaceImageUpload;
12
26
  }
13
27
  export declare function createSpace(client: SublayHttpClient, data: CreateSpaceProps): Promise<Space>;
@@ -1,6 +1,7 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { SpaceMembersResponse } from "../../interfaces/SpaceMember";
3
- export interface FetchSpaceMembersProps {
3
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
4
+ export interface FetchSpaceMembersProps extends SpaceReputationContextParams {
4
5
  spaceId: string;
5
6
  page?: number;
6
7
  limit?: number;
@@ -1,6 +1,7 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { SpaceTeamResponse } from "../../interfaces/SpaceMember";
3
- export interface FetchSpaceTeamProps {
3
+ import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation";
4
+ export interface FetchSpaceTeamProps extends SpaceReputationContextParams {
4
5
  spaceId: string;
5
6
  }
6
7
  export declare function fetchSpaceTeam(client: SublayHttpClient, data: FetchSpaceTeamProps): Promise<SpaceTeamResponse>;