@sublay/js 7.4.2 → 7.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -241,6 +241,15 @@ interface ChangePasswordResponse {
241
241
  }
242
242
  declare function changePassword(client: SublayHttpClient, data: ChangePasswordProps): Promise<ChangePasswordResponse>;
243
243
 
244
+ interface SetPasswordProps {
245
+ newPassword: string;
246
+ }
247
+ interface SetPasswordResponse {
248
+ success: boolean;
249
+ message: string;
250
+ }
251
+ declare function setPassword(client: SublayHttpClient, data: SetPasswordProps): Promise<SetPasswordResponse>;
252
+
244
253
  interface VerifyEmailProps {
245
254
  token: string;
246
255
  }
@@ -291,13 +300,14 @@ declare const Auth_requestNewAccessToken: typeof requestNewAccessToken;
291
300
  declare const Auth_requestPasswordReset: typeof requestPasswordReset;
292
301
  declare const Auth_resetPassword: typeof resetPassword;
293
302
  declare const Auth_sendVerificationEmail: typeof sendVerificationEmail;
303
+ declare const Auth_setPassword: typeof setPassword;
294
304
  declare const Auth_signIn: typeof signIn;
295
305
  declare const Auth_signOut: typeof signOut;
296
306
  declare const Auth_signUp: typeof signUp;
297
307
  declare const Auth_verifyEmail: typeof verifyEmail;
298
308
  declare const Auth_verifyExternalUser: typeof verifyExternalUser;
299
309
  declare namespace Auth {
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 };
310
+ 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_setPassword as setPassword, Auth_signIn as signIn, Auth_signOut as signOut, Auth_signUp as signUp, Auth_verifyEmail as verifyEmail, Auth_verifyExternalUser as verifyExternalUser };
301
311
  }
302
312
 
303
313
  /**
@@ -798,6 +808,8 @@ interface Space {
798
808
  postingPermission: PostingPermission;
799
809
  visibility: SpaceVisibility;
800
810
  requireJoinApproval: boolean;
811
+ nsfw: boolean;
812
+ nsfwEffective: boolean;
801
813
  parentSpaceId: string | null;
802
814
  depth: number;
803
815
  metadata: Record<string, any>;
@@ -960,6 +972,8 @@ interface Entity {
960
972
  coordinates: [number, number];
961
973
  } | null;
962
974
  metadata: Record<string, any>;
975
+ nsfw: boolean;
976
+ nsfwEffective: boolean;
963
977
  topComment: TopComment | null;
964
978
  isSaved?: boolean;
965
979
  isDraft: boolean | null;
@@ -987,6 +1001,7 @@ interface CreateEntityProps {
987
1001
  longitude: number;
988
1002
  };
989
1003
  metadata?: Record<string, any>;
1004
+ nsfw?: boolean;
990
1005
  isDraft?: boolean;
991
1006
  /** Create the entity without attributing it to the logged-in user (authorless). */
992
1007
  excludeUserId?: boolean;
@@ -1069,6 +1084,7 @@ interface FetchManyEntitiesProps extends SpaceReputationContextParams {
1069
1084
  };
1070
1085
  attachmentsFilters?: AttachmentsFilters;
1071
1086
  locationFilters?: LocationFilters;
1087
+ nsfwFilter?: "include-all" | "exclude" | "only";
1072
1088
  }
1073
1089
  declare function fetchManyEntities(client: SublayHttpClient, data: FetchManyEntitiesProps): Promise<PaginatedResponse<Entity>>;
1074
1090
 
@@ -1084,6 +1100,7 @@ interface UpdateEntityProps {
1084
1100
  longitude: number;
1085
1101
  };
1086
1102
  metadata?: Record<string, any>;
1103
+ nsfw?: boolean;
1087
1104
  }
1088
1105
  declare function updateEntity(client: SublayHttpClient, data: UpdateEntityProps): Promise<Entity>;
1089
1106
 
@@ -1622,6 +1639,7 @@ interface CreateSpaceProps {
1622
1639
  requireJoinApproval?: boolean;
1623
1640
  parentSpaceId?: string;
1624
1641
  metadata?: Record<string, any>;
1642
+ nsfw?: boolean;
1625
1643
  /**
1626
1644
  * Avatar image. When present the request is sent as `multipart/form-data` and
1627
1645
  * the server processes the image per `options`.
@@ -1642,6 +1660,7 @@ interface FetchManySpacesProps {
1642
1660
  searchAny?: string;
1643
1661
  memberOf?: "true";
1644
1662
  parentSpaceId?: string | "null";
1663
+ nsfwFilter?: "include-all" | "exclude" | "only";
1645
1664
  include?: string;
1646
1665
  }
1647
1666
  declare function fetchManySpaces(client: SublayHttpClient, data: FetchManySpacesProps): Promise<PaginatedResponse<Space>>;
@@ -1697,6 +1716,7 @@ interface UpdateSpaceProps {
1697
1716
  postingPermission?: PostingPermission;
1698
1717
  visibility?: SpaceVisibility;
1699
1718
  metadata?: Record<string, any>;
1719
+ nsfw?: boolean;
1700
1720
  /**
1701
1721
  * New avatar image. When present the request is sent as `multipart/form-data`
1702
1722
  * and the server processes the image per `options`, replacing the old avatar.
@@ -1921,6 +1941,22 @@ interface ModerationResponse {
1921
1941
  }
1922
1942
  declare function moderateSpaceEntity(client: SublayHttpClient, data: ModerateSpaceEntityProps): Promise<ModerationResponse>;
1923
1943
 
1944
+ interface SetSpaceEntityNsfwProps {
1945
+ spaceId: string;
1946
+ entityId: string;
1947
+ nsfw: boolean;
1948
+ }
1949
+ interface SetSpaceEntityNsfwResponse {
1950
+ message: string;
1951
+ nsfw: boolean;
1952
+ }
1953
+ /**
1954
+ * Space-moderator endpoint to set the NSFW flag on an entity within their space
1955
+ * (including other users' entities). Near-copy of `moderateSpaceEntity`, but it
1956
+ * writes the entity's own `nsfw` (the NSFW axis), not `moderationStatus`.
1957
+ */
1958
+ declare function setSpaceEntityNsfw(client: SublayHttpClient, data: SetSpaceEntityNsfwProps): Promise<SetSpaceEntityNsfwResponse>;
1959
+
1924
1960
  interface ModerateSpaceCommentProps {
1925
1961
  spaceId: string;
1926
1962
  commentId: string;
@@ -1981,7 +2017,8 @@ interface ConversationMember {
1981
2017
  userId: string;
1982
2018
  role: ConversationMemberRole | null;
1983
2019
  lastReadAt: string | null;
1984
- mutedUntil: string | null;
2020
+ mutedUntil?: string | null;
2021
+ mutedForever?: boolean;
1985
2022
  isActive: boolean;
1986
2023
  leftAt: string | null;
1987
2024
  createdAt: string;
@@ -2080,13 +2117,14 @@ declare const Spaces_moderateSpaceChatMessage: typeof moderateSpaceChatMessage;
2080
2117
  declare const Spaces_moderateSpaceComment: typeof moderateSpaceComment;
2081
2118
  declare const Spaces_moderateSpaceEntity: typeof moderateSpaceEntity;
2082
2119
  declare const Spaces_reorderRules: typeof reorderRules;
2120
+ declare const Spaces_setSpaceEntityNsfw: typeof setSpaceEntityNsfw;
2083
2121
  declare const Spaces_unbanMember: typeof unbanMember;
2084
2122
  declare const Spaces_updateDigestConfig: typeof updateDigestConfig;
2085
2123
  declare const Spaces_updateMemberRole: typeof updateMemberRole;
2086
2124
  declare const Spaces_updateRule: typeof updateRule;
2087
2125
  declare const Spaces_updateSpace: typeof updateSpace;
2088
2126
  declare namespace Spaces {
2089
- export { Spaces_approveMembership as approveMembership, Spaces_banMember as banMember, Spaces_checkMyMembership as checkMyMembership, Spaces_checkSlugAvailability as checkSlugAvailability, Spaces_createRule as createRule, Spaces_createSpace as createSpace, Spaces_declineMembership as declineMembership, Spaces_deleteRule as deleteRule, Spaces_deleteSpace as deleteSpace, Spaces_fetchChildSpaces as fetchChildSpaces, Spaces_fetchDigestConfig as fetchDigestConfig, Spaces_fetchManyRules as fetchManyRules, Spaces_fetchManySpaces as fetchManySpaces, Spaces_fetchMutualSpaces as fetchMutualSpaces, Spaces_fetchRule as fetchRule, Spaces_fetchSpace as fetchSpace, Spaces_fetchSpaceBreadcrumb as fetchSpaceBreadcrumb, Spaces_fetchSpaceByShortId as fetchSpaceByShortId, Spaces_fetchSpaceBySlug as fetchSpaceBySlug, Spaces_fetchSpaceMembers as fetchSpaceMembers, Spaces_fetchSpaceTeam as fetchSpaceTeam, Spaces_fetchUserSpaces as fetchUserSpaces, Spaces_getSpaceConversation as getSpaceConversation, Spaces_handleCommentReport as handleCommentReport, Spaces_handleEntityReport as handleEntityReport, Spaces_handleSpaceChatReport as handleSpaceChatReport, Spaces_joinSpace as joinSpace, Spaces_leaveSpace as leaveSpace, Spaces_moderateSpaceChatMessage as moderateSpaceChatMessage, Spaces_moderateSpaceComment as moderateSpaceComment, Spaces_moderateSpaceEntity as moderateSpaceEntity, Spaces_reorderRules as reorderRules, Spaces_unbanMember as unbanMember, Spaces_updateDigestConfig as updateDigestConfig, Spaces_updateMemberRole as updateMemberRole, Spaces_updateRule as updateRule, Spaces_updateSpace as updateSpace };
2127
+ export { Spaces_approveMembership as approveMembership, Spaces_banMember as banMember, Spaces_checkMyMembership as checkMyMembership, Spaces_checkSlugAvailability as checkSlugAvailability, Spaces_createRule as createRule, Spaces_createSpace as createSpace, Spaces_declineMembership as declineMembership, Spaces_deleteRule as deleteRule, Spaces_deleteSpace as deleteSpace, Spaces_fetchChildSpaces as fetchChildSpaces, Spaces_fetchDigestConfig as fetchDigestConfig, Spaces_fetchManyRules as fetchManyRules, Spaces_fetchManySpaces as fetchManySpaces, Spaces_fetchMutualSpaces as fetchMutualSpaces, Spaces_fetchRule as fetchRule, Spaces_fetchSpace as fetchSpace, Spaces_fetchSpaceBreadcrumb as fetchSpaceBreadcrumb, Spaces_fetchSpaceByShortId as fetchSpaceByShortId, Spaces_fetchSpaceBySlug as fetchSpaceBySlug, Spaces_fetchSpaceMembers as fetchSpaceMembers, Spaces_fetchSpaceTeam as fetchSpaceTeam, Spaces_fetchUserSpaces as fetchUserSpaces, Spaces_getSpaceConversation as getSpaceConversation, Spaces_handleCommentReport as handleCommentReport, Spaces_handleEntityReport as handleEntityReport, Spaces_handleSpaceChatReport as handleSpaceChatReport, Spaces_joinSpace as joinSpace, Spaces_leaveSpace as leaveSpace, Spaces_moderateSpaceChatMessage as moderateSpaceChatMessage, Spaces_moderateSpaceComment as moderateSpaceComment, Spaces_moderateSpaceEntity as moderateSpaceEntity, Spaces_reorderRules as reorderRules, Spaces_setSpaceEntityNsfw as setSpaceEntityNsfw, Spaces_unbanMember as unbanMember, Spaces_updateDigestConfig as updateDigestConfig, Spaces_updateMemberRole as updateMemberRole, Spaces_updateRule as updateRule, Spaces_updateSpace as updateSpace };
2090
2128
  }
2091
2129
 
2092
2130
  interface Collection {
@@ -2890,6 +2928,7 @@ interface OAuthIdentity {
2890
2928
  }
2891
2929
  interface ListIdentitiesResponse {
2892
2930
  identities: OAuthIdentity[];
2931
+ hasPassword: boolean;
2893
2932
  }
2894
2933
 
2895
2934
  /** List the current user's linked OAuth identities (authenticated). */
@@ -3145,6 +3184,48 @@ declare function markAsRead(client: SublayHttpClient, data: MarkAsReadProps): Pr
3145
3184
  message: string;
3146
3185
  }>;
3147
3186
 
3187
+ /**
3188
+ * Every push event type — the full app-notification type set plus the chat
3189
+ * `message` event (push-only). Mirrors the server's `PUSH_EVENT_TYPES` exactly
3190
+ * (server `src/constants/push/pushEvents.ts`); these are the only names a
3191
+ * `disabledTypes` set may contain.
3192
+ */
3193
+ declare const PUSH_EVENT_TYPES: readonly ["entity-comment", "comment-reply", "entity-mention", "comment-mention", "entity-reaction", "comment-reaction", "entity-reaction-milestone-specific", "entity-reaction-milestone-total", "comment-reaction-milestone-specific", "comment-reaction-milestone-total", "new-follow", "connection-request", "connection-accepted", "space-membership-approved", "event-invite", "event-updated", "event-cancelled", "message"];
3194
+ type PushEventType = (typeof PUSH_EVENT_TYPES)[number];
3195
+ /**
3196
+ * The four conversation-mute duration choices. Send the CHOICE, never a raw
3197
+ * timestamp — the server resolves it and represents "forever" via the explicit
3198
+ * `mutedForever` signal on the returned member. Mirrors the server's
3199
+ * `MUTE_DURATIONS` (server `src/helpers/push/muteDuration.ts`).
3200
+ */
3201
+ declare const MUTE_DURATIONS: readonly ["8h", "24h", "1w", "forever"];
3202
+ type MuteDuration = (typeof MUTE_DURATIONS)[number];
3203
+ /** Response of read/update notification preferences. */
3204
+ interface NotificationPreferences {
3205
+ disabledTypes: PushEventType[];
3206
+ }
3207
+
3208
+ interface MuteConversationProps {
3209
+ conversationId: string;
3210
+ /**
3211
+ * The duration CHOICE (`8h` / `24h` / `1w` / `forever`), or `null` to clear
3212
+ * the mute. Never a raw timestamp — the server resolves it and represents
3213
+ * "forever" via the returned member's explicit `mutedForever` signal.
3214
+ */
3215
+ duration: MuteDuration | null;
3216
+ }
3217
+ interface MuteConversationResponse {
3218
+ currentMember: ConversationMember;
3219
+ }
3220
+ /**
3221
+ * Set / clear the logged-in user's conversation mute.
3222
+ *
3223
+ * Mirrors `POST /:projectId/chat/conversations/:conversationId/mute`. The actor
3224
+ * is derived from the user token (Rule A) — a user only mutes their own
3225
+ * membership, so there is no `userId` param.
3226
+ */
3227
+ declare function muteConversation(client: SublayHttpClient, data: MuteConversationProps): Promise<MuteConversationResponse>;
3228
+
3148
3229
  interface ReportMessageProps {
3149
3230
  conversationId: string;
3150
3231
  messageId: string;
@@ -3173,13 +3254,45 @@ declare const Chat_listMembers: typeof listMembers;
3173
3254
  declare const Chat_listMessages: typeof listMessages;
3174
3255
  declare const Chat_listReactions: typeof listReactions;
3175
3256
  declare const Chat_markAsRead: typeof markAsRead;
3257
+ declare const Chat_muteConversation: typeof muteConversation;
3176
3258
  declare const Chat_removeMember: typeof removeMember;
3177
3259
  declare const Chat_reportMessage: typeof reportMessage;
3178
3260
  declare const Chat_sendMessage: typeof sendMessage;
3179
3261
  declare const Chat_toggleReaction: typeof toggleReaction;
3180
3262
  declare const Chat_updateConversation: typeof updateConversation;
3181
3263
  declare namespace Chat {
3182
- export { Chat_addMember as addMember, Chat_changeMemberRole as changeMemberRole, Chat_createDirectConversation as createDirectConversation, Chat_createGroupConversation as createGroupConversation, Chat_deleteConversation as deleteConversation, Chat_deleteMessage as deleteMessage, Chat_editMessage as editMessage, Chat_getConversation as getConversation, Chat_getMessage as getMessage, Chat_getUnreadCount as getUnreadCount, Chat_leaveConversation as leaveConversation, Chat_listConversations as listConversations, Chat_listMembers as listMembers, Chat_listMessages as listMessages, Chat_listReactions as listReactions, Chat_markAsRead as markAsRead, Chat_removeMember as removeMember, Chat_reportMessage as reportMessage, Chat_sendMessage as sendMessage, Chat_toggleReaction as toggleReaction, Chat_updateConversation as updateConversation };
3264
+ export { Chat_addMember as addMember, Chat_changeMemberRole as changeMemberRole, Chat_createDirectConversation as createDirectConversation, Chat_createGroupConversation as createGroupConversation, Chat_deleteConversation as deleteConversation, Chat_deleteMessage as deleteMessage, Chat_editMessage as editMessage, Chat_getConversation as getConversation, Chat_getMessage as getMessage, Chat_getUnreadCount as getUnreadCount, Chat_leaveConversation as leaveConversation, Chat_listConversations as listConversations, Chat_listMembers as listMembers, Chat_listMessages as listMessages, Chat_listReactions as listReactions, Chat_markAsRead as markAsRead, Chat_muteConversation as muteConversation, Chat_removeMember as removeMember, Chat_reportMessage as reportMessage, Chat_sendMessage as sendMessage, Chat_toggleReaction as toggleReaction, Chat_updateConversation as updateConversation };
3265
+ }
3266
+
3267
+ /**
3268
+ * Read the logged-in user's push notification preferences (the set of event
3269
+ * types disabled for push). Returns an empty `disabledTypes` (all-on) when no
3270
+ * preference row exists.
3271
+ *
3272
+ * Mirrors `GET /:projectId/push-notifications/preferences`. The actor is derived
3273
+ * from the user token (Rule A) — no `userId` param.
3274
+ */
3275
+ declare function getNotificationPreferences(client: SublayHttpClient): Promise<NotificationPreferences>;
3276
+
3277
+ interface UpdateNotificationPreferencesProps {
3278
+ /**
3279
+ * The set of push event types the user has opted OUT of. Server-exact type
3280
+ * names only (unknown names are rejected server-side); duplicates collapse.
3281
+ */
3282
+ disabledTypes: PushEventType[];
3283
+ }
3284
+ /**
3285
+ * Upsert the logged-in user's push notification preferences.
3286
+ *
3287
+ * Mirrors `PUT /:projectId/push-notifications/preferences`. The actor is derived
3288
+ * from the user token (Rule A) — no `userId` param.
3289
+ */
3290
+ declare function updateNotificationPreferences(client: SublayHttpClient, data: UpdateNotificationPreferencesProps): Promise<NotificationPreferences>;
3291
+
3292
+ declare const Push_getNotificationPreferences: typeof getNotificationPreferences;
3293
+ declare const Push_updateNotificationPreferences: typeof updateNotificationPreferences;
3294
+ declare namespace Push {
3295
+ export { Push_getNotificationPreferences as getNotificationPreferences, Push_updateNotificationPreferences as updateNotificationPreferences };
3183
3296
  }
3184
3297
 
3185
3298
  /**
@@ -3263,6 +3376,7 @@ declare class SublayClient {
3263
3376
  storage: BoundModule<typeof Storage>;
3264
3377
  oauth: BoundModule<typeof OAuth>;
3265
3378
  chat: BoundModule<typeof Chat>;
3379
+ push: BoundModule<typeof Push>;
3266
3380
  private constructor();
3267
3381
  static init(config: ClientConfig): Promise<SublayClient>;
3268
3382
  /**
@@ -3277,4 +3391,4 @@ declare class SublayClient {
3277
3391
  clearTokens(): void;
3278
3392
  }
3279
3393
 
3280
- 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, type UserSearchParams };
3394
+ export { type AuthTokens, type BulkDeleteProps, type BulkDeleteResult, type ClientConfig, type DbFilter, type DbFilterOperator, type DeleteResult, MUTE_DURATIONS, type MuteConversationProps, type MuteConversationResponse, type MuteDuration, type NotificationPreferences, PUSH_EVENT_TYPES, type PaginatedResponse, type PaginationMetadata, type PushEventType, type SpaceReputationContextParams, type SpaceReputationUserParams, SublayClient, type TableAccessor, type TableQuery, type TableRow, type UpdateNotificationPreferencesProps, type UserSearchParams };
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ import * as Search from "./modules/search";
14
14
  import * as Storage from "./modules/storage";
15
15
  import * as OAuth from "./modules/oauth";
16
16
  import * as Chat from "./modules/chat";
17
+ import * as Push from "./modules/push";
17
18
  import { TableAccessor, TableRow } from "./interfaces/Table";
18
19
  type BoundModule<T extends Record<string, (client: SublayHttpClient, ...args: any[]) => any>> = {
19
20
  [K in keyof T]: (...args: Parameters<T[K]> extends [any, ...infer R] ? R : never) => ReturnType<T[K]>;
@@ -35,6 +36,7 @@ export declare class SublayClient {
35
36
  storage: BoundModule<typeof Storage>;
36
37
  oauth: BoundModule<typeof OAuth>;
37
38
  chat: BoundModule<typeof Chat>;
39
+ push: BoundModule<typeof Push>;
38
40
  private constructor();
39
41
  static init(config: ClientConfig): Promise<SublayClient>;
40
42
  /**
@@ -52,4 +54,8 @@ export type { ClientConfig, AuthTokens } from "./core/client";
52
54
  export type { PaginatedResponse, PaginationMetadata, } from "./interfaces/IPaginatedResponse";
53
55
  export type { SpaceReputationContextParams, SpaceReputationUserParams, } from "./interfaces/SpaceReputation";
54
56
  export type { UserSearchParams } from "./interfaces/UserSearch";
57
+ export { PUSH_EVENT_TYPES, MUTE_DURATIONS } from "./interfaces/Push";
58
+ export type { PushEventType, MuteDuration, NotificationPreferences, } from "./interfaces/Push";
59
+ export type { UpdateNotificationPreferencesProps } from "./modules/push/updateNotificationPreferences";
60
+ export type { MuteConversationProps, MuteConversationResponse, } from "./modules/chat/muteConversation";
55
61
  export type { TableAccessor, TableRow, TableQuery, DbFilter, DbFilterOperator, BulkDeleteProps, DeleteResult, BulkDeleteResult, } from "./interfaces/Table";
package/dist/index.js CHANGED
@@ -30,6 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ MUTE_DURATIONS: () => MUTE_DURATIONS,
34
+ PUSH_EVENT_TYPES: () => PUSH_EVENT_TYPES,
33
35
  SublayClient: () => SublayClient
34
36
  });
35
37
  module.exports = __toCommonJS(index_exports);
@@ -175,6 +177,7 @@ __export(auth_exports, {
175
177
  requestPasswordReset: () => requestPasswordReset,
176
178
  resetPassword: () => resetPassword,
177
179
  sendVerificationEmail: () => sendVerificationEmail,
180
+ setPassword: () => setPassword,
178
181
  signIn: () => signIn,
179
182
  signOut: () => signOut,
180
183
  signUp: () => signUp,
@@ -268,6 +271,15 @@ async function changePassword(client, data) {
268
271
  return response.data;
269
272
  }
270
273
 
274
+ // src/modules/auth/setPassword.ts
275
+ async function setPassword(client, data) {
276
+ const response = await client.projectInstance.post(
277
+ "/auth/set-password",
278
+ data
279
+ );
280
+ return response.data;
281
+ }
282
+
271
283
  // src/modules/auth/verifyEmail.ts
272
284
  async function verifyEmail(client, data) {
273
285
  await client.projectInstance.post("/auth/verify-email", data);
@@ -1208,6 +1220,7 @@ __export(spaces_exports, {
1208
1220
  moderateSpaceComment: () => moderateSpaceComment,
1209
1221
  moderateSpaceEntity: () => moderateSpaceEntity,
1210
1222
  reorderRules: () => reorderRules,
1223
+ setSpaceEntityNsfw: () => setSpaceEntityNsfw,
1211
1224
  unbanMember: () => unbanMember,
1212
1225
  updateDigestConfig: () => updateDigestConfig,
1213
1226
  updateMemberRole: () => updateMemberRole,
@@ -1560,6 +1573,16 @@ async function moderateSpaceEntity(client, data) {
1560
1573
  return response.data;
1561
1574
  }
1562
1575
 
1576
+ // src/modules/spaces/setSpaceEntityNsfw.ts
1577
+ async function setSpaceEntityNsfw(client, data) {
1578
+ const { spaceId, entityId, ...body } = data;
1579
+ const response = await client.projectInstance.patch(
1580
+ `/spaces/${spaceId}/entities/${entityId}/nsfw`,
1581
+ body
1582
+ );
1583
+ return response.data;
1584
+ }
1585
+
1563
1586
  // src/modules/spaces/moderateSpaceComment.ts
1564
1587
  async function moderateSpaceComment(client, data) {
1565
1588
  const { spaceId, commentId, ...body } = data;
@@ -2172,6 +2195,7 @@ __export(chat_exports, {
2172
2195
  listMessages: () => listMessages,
2173
2196
  listReactions: () => listReactions,
2174
2197
  markAsRead: () => markAsRead,
2198
+ muteConversation: () => muteConversation,
2175
2199
  removeMember: () => removeMember,
2176
2200
  reportMessage: () => reportMessage,
2177
2201
  sendMessage: () => sendMessage,
@@ -2453,6 +2477,16 @@ async function markAsRead(client, data) {
2453
2477
  return response.data;
2454
2478
  }
2455
2479
 
2480
+ // src/modules/chat/muteConversation.ts
2481
+ async function muteConversation(client, data) {
2482
+ const { conversationId, duration } = data;
2483
+ const response = await client.projectInstance.post(
2484
+ `/chat/conversations/${conversationId}/mute`,
2485
+ { duration }
2486
+ );
2487
+ return response.data;
2488
+ }
2489
+
2456
2490
  // src/modules/chat/reportMessage.ts
2457
2491
  async function reportMessage(client, data) {
2458
2492
  const { conversationId, messageId, ...body } = data;
@@ -2463,6 +2497,31 @@ async function reportMessage(client, data) {
2463
2497
  return response.data;
2464
2498
  }
2465
2499
 
2500
+ // src/modules/push/index.ts
2501
+ var push_exports = {};
2502
+ __export(push_exports, {
2503
+ getNotificationPreferences: () => getNotificationPreferences,
2504
+ updateNotificationPreferences: () => updateNotificationPreferences
2505
+ });
2506
+
2507
+ // src/modules/push/getNotificationPreferences.ts
2508
+ async function getNotificationPreferences(client) {
2509
+ const response = await client.projectInstance.get(
2510
+ `/push-notifications/preferences`
2511
+ );
2512
+ return response.data;
2513
+ }
2514
+
2515
+ // src/modules/push/updateNotificationPreferences.ts
2516
+ async function updateNotificationPreferences(client, data) {
2517
+ const { disabledTypes } = data;
2518
+ const response = await client.projectInstance.put(
2519
+ `/push-notifications/preferences`,
2520
+ { disabledTypes }
2521
+ );
2522
+ return response.data;
2523
+ }
2524
+
2466
2525
  // src/modules/tables/find.ts
2467
2526
  async function find(client, tableName, query = {}) {
2468
2527
  const { filters, includeDeleted, ...rest } = query;
@@ -2552,6 +2611,29 @@ function createTableAccessor(client, tableName) {
2552
2611
  };
2553
2612
  }
2554
2613
 
2614
+ // src/interfaces/Push.ts
2615
+ var PUSH_EVENT_TYPES = [
2616
+ "entity-comment",
2617
+ "comment-reply",
2618
+ "entity-mention",
2619
+ "comment-mention",
2620
+ "entity-reaction",
2621
+ "comment-reaction",
2622
+ "entity-reaction-milestone-specific",
2623
+ "entity-reaction-milestone-total",
2624
+ "comment-reaction-milestone-specific",
2625
+ "comment-reaction-milestone-total",
2626
+ "new-follow",
2627
+ "connection-request",
2628
+ "connection-accepted",
2629
+ "space-membership-approved",
2630
+ "event-invite",
2631
+ "event-updated",
2632
+ "event-cancelled",
2633
+ "message"
2634
+ ];
2635
+ var MUTE_DURATIONS = ["8h", "24h", "1w", "forever"];
2636
+
2555
2637
  // src/index.ts
2556
2638
  var SublayClient = class _SublayClient {
2557
2639
  http;
@@ -2570,6 +2652,7 @@ var SublayClient = class _SublayClient {
2570
2652
  storage;
2571
2653
  oauth;
2572
2654
  chat;
2655
+ push;
2573
2656
  constructor(http) {
2574
2657
  this.http = http;
2575
2658
  this.auth = bindModule(auth_exports, this.http);
@@ -2587,6 +2670,7 @@ var SublayClient = class _SublayClient {
2587
2670
  this.storage = bindModule(storage_exports, this.http);
2588
2671
  this.oauth = bindModule(oauth_exports, this.http);
2589
2672
  this.chat = bindModule(chat_exports, this.http);
2673
+ this.push = bindModule(push_exports, this.http);
2590
2674
  }
2591
2675
  static async init(config) {
2592
2676
  const http = new SublayHttpClient(config);
@@ -2618,5 +2702,7 @@ function bindModule(module2, client) {
2618
2702
  }
2619
2703
  // Annotate the CommonJS export names for ESM import in node:
2620
2704
  0 && (module.exports = {
2705
+ MUTE_DURATIONS,
2706
+ PUSH_EVENT_TYPES,
2621
2707
  SublayClient
2622
2708
  });
package/dist/index.mjs CHANGED
@@ -145,6 +145,7 @@ __export(auth_exports, {
145
145
  requestPasswordReset: () => requestPasswordReset,
146
146
  resetPassword: () => resetPassword,
147
147
  sendVerificationEmail: () => sendVerificationEmail,
148
+ setPassword: () => setPassword,
148
149
  signIn: () => signIn,
149
150
  signOut: () => signOut,
150
151
  signUp: () => signUp,
@@ -238,6 +239,15 @@ async function changePassword(client, data) {
238
239
  return response.data;
239
240
  }
240
241
 
242
+ // src/modules/auth/setPassword.ts
243
+ async function setPassword(client, data) {
244
+ const response = await client.projectInstance.post(
245
+ "/auth/set-password",
246
+ data
247
+ );
248
+ return response.data;
249
+ }
250
+
241
251
  // src/modules/auth/verifyEmail.ts
242
252
  async function verifyEmail(client, data) {
243
253
  await client.projectInstance.post("/auth/verify-email", data);
@@ -1178,6 +1188,7 @@ __export(spaces_exports, {
1178
1188
  moderateSpaceComment: () => moderateSpaceComment,
1179
1189
  moderateSpaceEntity: () => moderateSpaceEntity,
1180
1190
  reorderRules: () => reorderRules,
1191
+ setSpaceEntityNsfw: () => setSpaceEntityNsfw,
1181
1192
  unbanMember: () => unbanMember,
1182
1193
  updateDigestConfig: () => updateDigestConfig,
1183
1194
  updateMemberRole: () => updateMemberRole,
@@ -1530,6 +1541,16 @@ async function moderateSpaceEntity(client, data) {
1530
1541
  return response.data;
1531
1542
  }
1532
1543
 
1544
+ // src/modules/spaces/setSpaceEntityNsfw.ts
1545
+ async function setSpaceEntityNsfw(client, data) {
1546
+ const { spaceId, entityId, ...body } = data;
1547
+ const response = await client.projectInstance.patch(
1548
+ `/spaces/${spaceId}/entities/${entityId}/nsfw`,
1549
+ body
1550
+ );
1551
+ return response.data;
1552
+ }
1553
+
1533
1554
  // src/modules/spaces/moderateSpaceComment.ts
1534
1555
  async function moderateSpaceComment(client, data) {
1535
1556
  const { spaceId, commentId, ...body } = data;
@@ -2142,6 +2163,7 @@ __export(chat_exports, {
2142
2163
  listMessages: () => listMessages,
2143
2164
  listReactions: () => listReactions,
2144
2165
  markAsRead: () => markAsRead,
2166
+ muteConversation: () => muteConversation,
2145
2167
  removeMember: () => removeMember,
2146
2168
  reportMessage: () => reportMessage,
2147
2169
  sendMessage: () => sendMessage,
@@ -2423,6 +2445,16 @@ async function markAsRead(client, data) {
2423
2445
  return response.data;
2424
2446
  }
2425
2447
 
2448
+ // src/modules/chat/muteConversation.ts
2449
+ async function muteConversation(client, data) {
2450
+ const { conversationId, duration } = data;
2451
+ const response = await client.projectInstance.post(
2452
+ `/chat/conversations/${conversationId}/mute`,
2453
+ { duration }
2454
+ );
2455
+ return response.data;
2456
+ }
2457
+
2426
2458
  // src/modules/chat/reportMessage.ts
2427
2459
  async function reportMessage(client, data) {
2428
2460
  const { conversationId, messageId, ...body } = data;
@@ -2433,6 +2465,31 @@ async function reportMessage(client, data) {
2433
2465
  return response.data;
2434
2466
  }
2435
2467
 
2468
+ // src/modules/push/index.ts
2469
+ var push_exports = {};
2470
+ __export(push_exports, {
2471
+ getNotificationPreferences: () => getNotificationPreferences,
2472
+ updateNotificationPreferences: () => updateNotificationPreferences
2473
+ });
2474
+
2475
+ // src/modules/push/getNotificationPreferences.ts
2476
+ async function getNotificationPreferences(client) {
2477
+ const response = await client.projectInstance.get(
2478
+ `/push-notifications/preferences`
2479
+ );
2480
+ return response.data;
2481
+ }
2482
+
2483
+ // src/modules/push/updateNotificationPreferences.ts
2484
+ async function updateNotificationPreferences(client, data) {
2485
+ const { disabledTypes } = data;
2486
+ const response = await client.projectInstance.put(
2487
+ `/push-notifications/preferences`,
2488
+ { disabledTypes }
2489
+ );
2490
+ return response.data;
2491
+ }
2492
+
2436
2493
  // src/modules/tables/find.ts
2437
2494
  async function find(client, tableName, query = {}) {
2438
2495
  const { filters, includeDeleted, ...rest } = query;
@@ -2522,6 +2579,29 @@ function createTableAccessor(client, tableName) {
2522
2579
  };
2523
2580
  }
2524
2581
 
2582
+ // src/interfaces/Push.ts
2583
+ var PUSH_EVENT_TYPES = [
2584
+ "entity-comment",
2585
+ "comment-reply",
2586
+ "entity-mention",
2587
+ "comment-mention",
2588
+ "entity-reaction",
2589
+ "comment-reaction",
2590
+ "entity-reaction-milestone-specific",
2591
+ "entity-reaction-milestone-total",
2592
+ "comment-reaction-milestone-specific",
2593
+ "comment-reaction-milestone-total",
2594
+ "new-follow",
2595
+ "connection-request",
2596
+ "connection-accepted",
2597
+ "space-membership-approved",
2598
+ "event-invite",
2599
+ "event-updated",
2600
+ "event-cancelled",
2601
+ "message"
2602
+ ];
2603
+ var MUTE_DURATIONS = ["8h", "24h", "1w", "forever"];
2604
+
2525
2605
  // src/index.ts
2526
2606
  var SublayClient = class _SublayClient {
2527
2607
  http;
@@ -2540,6 +2620,7 @@ var SublayClient = class _SublayClient {
2540
2620
  storage;
2541
2621
  oauth;
2542
2622
  chat;
2623
+ push;
2543
2624
  constructor(http) {
2544
2625
  this.http = http;
2545
2626
  this.auth = bindModule(auth_exports, this.http);
@@ -2557,6 +2638,7 @@ var SublayClient = class _SublayClient {
2557
2638
  this.storage = bindModule(storage_exports, this.http);
2558
2639
  this.oauth = bindModule(oauth_exports, this.http);
2559
2640
  this.chat = bindModule(chat_exports, this.http);
2641
+ this.push = bindModule(push_exports, this.http);
2560
2642
  }
2561
2643
  static async init(config) {
2562
2644
  const http = new SublayHttpClient(config);
@@ -2587,5 +2669,7 @@ function bindModule(module, client) {
2587
2669
  return bound;
2588
2670
  }
2589
2671
  export {
2672
+ MUTE_DURATIONS,
2673
+ PUSH_EVENT_TYPES,
2590
2674
  SublayClient
2591
2675
  };
@@ -7,7 +7,8 @@ export interface ConversationMember {
7
7
  userId: string;
8
8
  role: ConversationMemberRole | null;
9
9
  lastReadAt: string | null;
10
- mutedUntil: string | null;
10
+ mutedUntil?: string | null;
11
+ mutedForever?: boolean;
11
12
  isActive: boolean;
12
13
  leftAt: string | null;
13
14
  createdAt: string;
@@ -39,6 +39,8 @@ export interface Entity {
39
39
  coordinates: [number, number];
40
40
  } | null;
41
41
  metadata: Record<string, any>;
42
+ nsfw: boolean;
43
+ nsfwEffective: boolean;
42
44
  topComment: TopComment | null;
43
45
  isSaved?: boolean;
44
46
  isDraft: boolean | null;
@@ -10,4 +10,5 @@ export interface OAuthIdentity {
10
10
  }
11
11
  export interface ListIdentitiesResponse {
12
12
  identities: OAuthIdentity[];
13
+ hasPassword: boolean;
13
14
  }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Every push event type — the full app-notification type set plus the chat
3
+ * `message` event (push-only). Mirrors the server's `PUSH_EVENT_TYPES` exactly
4
+ * (server `src/constants/push/pushEvents.ts`); these are the only names a
5
+ * `disabledTypes` set may contain.
6
+ */
7
+ export declare const PUSH_EVENT_TYPES: readonly ["entity-comment", "comment-reply", "entity-mention", "comment-mention", "entity-reaction", "comment-reaction", "entity-reaction-milestone-specific", "entity-reaction-milestone-total", "comment-reaction-milestone-specific", "comment-reaction-milestone-total", "new-follow", "connection-request", "connection-accepted", "space-membership-approved", "event-invite", "event-updated", "event-cancelled", "message"];
8
+ export type PushEventType = (typeof PUSH_EVENT_TYPES)[number];
9
+ /**
10
+ * The four conversation-mute duration choices. Send the CHOICE, never a raw
11
+ * timestamp — the server resolves it and represents "forever" via the explicit
12
+ * `mutedForever` signal on the returned member. Mirrors the server's
13
+ * `MUTE_DURATIONS` (server `src/helpers/push/muteDuration.ts`).
14
+ */
15
+ export declare const MUTE_DURATIONS: readonly ["8h", "24h", "1w", "forever"];
16
+ export type MuteDuration = (typeof MUTE_DURATIONS)[number];
17
+ /** Response of read/update notification preferences. */
18
+ export interface NotificationPreferences {
19
+ disabledTypes: PushEventType[];
20
+ }
@@ -40,6 +40,8 @@ export interface Space {
40
40
  postingPermission: PostingPermission;
41
41
  visibility: SpaceVisibility;
42
42
  requireJoinApproval: boolean;
43
+ nsfw: boolean;
44
+ nsfwEffective: boolean;
43
45
  parentSpaceId: string | null;
44
46
  depth: number;
45
47
  metadata: Record<string, any>;
@@ -6,6 +6,7 @@ export { verifyExternalUser } from "./verifyExternalUser";
6
6
  export { requestPasswordReset } from "./requestPasswordReset";
7
7
  export { resetPassword } from "./resetPassword";
8
8
  export { changePassword } from "./changePassword";
9
+ export { setPassword } from "./setPassword";
9
10
  export { verifyEmail } from "./verifyEmail";
10
11
  export { sendVerificationEmail } from "./sendVerificationEmail";
11
12
  export { requestAccountDeletion } from "./requestAccountDeletion";
@@ -0,0 +1,9 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ export interface SetPasswordProps {
3
+ newPassword: string;
4
+ }
5
+ export interface SetPasswordResponse {
6
+ success: boolean;
7
+ message: string;
8
+ }
9
+ export declare function setPassword(client: SublayHttpClient, data: SetPasswordProps): Promise<SetPasswordResponse>;
@@ -18,4 +18,5 @@ export { deleteMessage } from "./deleteMessage";
18
18
  export { toggleReaction } from "./toggleReaction";
19
19
  export { listReactions } from "./listReactions";
20
20
  export { markAsRead } from "./markAsRead";
21
+ export { muteConversation } from "./muteConversation";
21
22
  export { reportMessage } from "./reportMessage";
@@ -0,0 +1,23 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { ConversationMember } from "../../interfaces/ConversationMember";
3
+ import { MuteDuration } from "../../interfaces/Push";
4
+ export interface MuteConversationProps {
5
+ conversationId: string;
6
+ /**
7
+ * The duration CHOICE (`8h` / `24h` / `1w` / `forever`), or `null` to clear
8
+ * the mute. Never a raw timestamp — the server resolves it and represents
9
+ * "forever" via the returned member's explicit `mutedForever` signal.
10
+ */
11
+ duration: MuteDuration | null;
12
+ }
13
+ export interface MuteConversationResponse {
14
+ currentMember: ConversationMember;
15
+ }
16
+ /**
17
+ * Set / clear the logged-in user's conversation mute.
18
+ *
19
+ * Mirrors `POST /:projectId/chat/conversations/:conversationId/mute`. The actor
20
+ * is derived from the user token (Rule A) — a user only mutes their own
21
+ * membership, so there is no `userId` param.
22
+ */
23
+ export declare function muteConversation(client: SublayHttpClient, data: MuteConversationProps): Promise<MuteConversationResponse>;
@@ -15,6 +15,7 @@ export interface CreateEntityProps {
15
15
  longitude: number;
16
16
  };
17
17
  metadata?: Record<string, any>;
18
+ nsfw?: boolean;
18
19
  isDraft?: boolean;
19
20
  /** Create the entity without attributing it to the logged-in user (authorless). */
20
21
  excludeUserId?: boolean;
@@ -59,5 +59,6 @@ export interface FetchManyEntitiesProps extends SpaceReputationContextParams {
59
59
  };
60
60
  attachmentsFilters?: AttachmentsFilters;
61
61
  locationFilters?: LocationFilters;
62
+ nsfwFilter?: "include-all" | "exclude" | "only";
62
63
  }
63
64
  export declare function fetchManyEntities(client: SublayHttpClient, data: FetchManyEntitiesProps): Promise<PaginatedResponse<Entity>>;
@@ -13,5 +13,6 @@ export interface UpdateEntityProps {
13
13
  longitude: number;
14
14
  };
15
15
  metadata?: Record<string, any>;
16
+ nsfw?: boolean;
16
17
  }
17
18
  export declare function updateEntity(client: SublayHttpClient, data: UpdateEntityProps): Promise<Entity>;
@@ -0,0 +1,11 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { NotificationPreferences } from "../../interfaces/Push";
3
+ /**
4
+ * Read the logged-in user's push notification preferences (the set of event
5
+ * types disabled for push). Returns an empty `disabledTypes` (all-on) when no
6
+ * preference row exists.
7
+ *
8
+ * Mirrors `GET /:projectId/push-notifications/preferences`. The actor is derived
9
+ * from the user token (Rule A) — no `userId` param.
10
+ */
11
+ export declare function getNotificationPreferences(client: SublayHttpClient): Promise<NotificationPreferences>;
@@ -0,0 +1,2 @@
1
+ export { getNotificationPreferences } from "./getNotificationPreferences";
2
+ export { updateNotificationPreferences } from "./updateNotificationPreferences";
@@ -0,0 +1,16 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ import { NotificationPreferences, PushEventType } from "../../interfaces/Push";
3
+ export interface UpdateNotificationPreferencesProps {
4
+ /**
5
+ * The set of push event types the user has opted OUT of. Server-exact type
6
+ * names only (unknown names are rejected server-side); duplicates collapse.
7
+ */
8
+ disabledTypes: PushEventType[];
9
+ }
10
+ /**
11
+ * Upsert the logged-in user's push notification preferences.
12
+ *
13
+ * Mirrors `PUT /:projectId/push-notifications/preferences`. The actor is derived
14
+ * from the user token (Rule A) — no `userId` param.
15
+ */
16
+ export declare function updateNotificationPreferences(client: SublayHttpClient, data: UpdateNotificationPreferencesProps): Promise<NotificationPreferences>;
@@ -17,6 +17,7 @@ export interface CreateSpaceProps {
17
17
  requireJoinApproval?: boolean;
18
18
  parentSpaceId?: string;
19
19
  metadata?: Record<string, any>;
20
+ nsfw?: boolean;
20
21
  /**
21
22
  * Avatar image. When present the request is sent as `multipart/form-data` and
22
23
  * the server processes the image per `options`.
@@ -11,6 +11,7 @@ export interface FetchManySpacesProps {
11
11
  searchAny?: string;
12
12
  memberOf?: "true";
13
13
  parentSpaceId?: string | "null";
14
+ nsfwFilter?: "include-all" | "exclude" | "only";
14
15
  include?: string;
15
16
  }
16
17
  export declare function fetchManySpaces(client: SublayHttpClient, data: FetchManySpacesProps): Promise<PaginatedResponse<Space>>;
@@ -29,6 +29,7 @@ export { reorderRules } from "./reorderRules";
29
29
  export { handleEntityReport } from "./handleEntityReport";
30
30
  export { handleCommentReport } from "./handleCommentReport";
31
31
  export { moderateSpaceEntity } from "./moderateSpaceEntity";
32
+ export { setSpaceEntityNsfw } from "./setSpaceEntityNsfw";
32
33
  export { moderateSpaceComment } from "./moderateSpaceComment";
33
34
  export { fetchDigestConfig } from "./fetchDigestConfig";
34
35
  export { updateDigestConfig } from "./updateDigestConfig";
@@ -0,0 +1,16 @@
1
+ import { SublayHttpClient } from "../../core/client";
2
+ export interface SetSpaceEntityNsfwProps {
3
+ spaceId: string;
4
+ entityId: string;
5
+ nsfw: boolean;
6
+ }
7
+ export interface SetSpaceEntityNsfwResponse {
8
+ message: string;
9
+ nsfw: boolean;
10
+ }
11
+ /**
12
+ * Space-moderator endpoint to set the NSFW flag on an entity within their space
13
+ * (including other users' entities). Near-copy of `moderateSpaceEntity`, but it
14
+ * writes the entity's own `nsfw` (the NSFW axis), not `moderationStatus`.
15
+ */
16
+ export declare function setSpaceEntityNsfw(client: SublayHttpClient, data: SetSpaceEntityNsfwProps): Promise<SetSpaceEntityNsfwResponse>;
@@ -10,6 +10,7 @@ export interface UpdateSpaceProps {
10
10
  postingPermission?: PostingPermission;
11
11
  visibility?: SpaceVisibility;
12
12
  metadata?: Record<string, any>;
13
+ nsfw?: boolean;
13
14
  /**
14
15
  * New avatar image. When present the request is sent as `multipart/form-data`
15
16
  * and the server processes the image per `options`, replacing the old avatar.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sublay/js",
3
- "version": "7.4.2",
3
+ "version": "7.5.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [