@sublay/js 7.4.0 → 7.4.2

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
@@ -555,7 +555,21 @@ interface PaginatedResponse<T> {
555
555
  pagination: PaginationMetadata;
556
556
  }
557
557
 
558
- interface FetchFollowersByUserIdProps extends SpaceReputationUserParams {
558
+ /**
559
+ * Shared optional params for text-searching a list of users
560
+ * (followers / following / connections).
561
+ *
562
+ * - `query` — free-text search term. When omitted, no filtering is applied.
563
+ * - `searchFields` — narrows which user field the term matches against. When
564
+ * omitted, the term matches either `username` OR `name` (case-insensitive
565
+ * substring). `"username"` / `"name"` restrict the match to that one field.
566
+ */
567
+ interface UserSearchParams {
568
+ query?: string;
569
+ searchFields?: "username" | "name";
570
+ }
571
+
572
+ interface FetchFollowersByUserIdProps extends SpaceReputationUserParams, UserSearchParams {
559
573
  userId: string;
560
574
  page?: number;
561
575
  limit?: number;
@@ -570,7 +584,7 @@ interface FollowersCountResponse$1 {
570
584
  }
571
585
  declare function fetchFollowersCountByUserId(client: SublayHttpClient, data: FetchFollowersCountByUserIdProps): Promise<FollowersCountResponse$1>;
572
586
 
573
- interface FetchFollowingByUserIdProps extends SpaceReputationUserParams {
587
+ interface FetchFollowingByUserIdProps extends SpaceReputationUserParams, UserSearchParams {
574
588
  userId: string;
575
589
  page?: number;
576
590
  limit?: number;
@@ -644,7 +658,7 @@ interface ConnectionStatusDeclined {
644
658
  }
645
659
  type ConnectionStatusResponse = ConnectionStatusNone | ConnectionStatusPending | ConnectionStatusConnected | ConnectionStatusDeclined;
646
660
 
647
- interface FetchConnectionsByUserIdProps extends SpaceReputationUserParams {
661
+ interface FetchConnectionsByUserIdProps extends SpaceReputationUserParams, UserSearchParams {
648
662
  userId: string;
649
663
  page?: number;
650
664
  limit?: number;
@@ -746,6 +760,7 @@ interface SpaceMention {
746
760
 
747
761
  type ReadingPermission = "anyone" | "members";
748
762
  type PostingPermission = "anyone" | "members" | "admins";
763
+ type SpaceVisibility = "public" | "unlisted" | "private";
749
764
  type SpaceMemberRole = "admin" | "moderator" | "member";
750
765
  type SpaceMemberStatus = "pending" | "active" | "banned" | "rejected";
751
766
  interface SpaceMemberPermissions {
@@ -764,6 +779,7 @@ interface SpacePreview {
764
779
  slug: string | null;
765
780
  avatarFileId: string | null;
766
781
  readingPermission?: ReadingPermission;
782
+ visibility?: SpaceVisibility;
767
783
  parentSpaceId?: string | null;
768
784
  depth?: number;
769
785
  avatarFile?: File$1;
@@ -780,6 +796,7 @@ interface Space {
780
796
  userId: string;
781
797
  readingPermission: ReadingPermission;
782
798
  postingPermission: PostingPermission;
799
+ visibility: SpaceVisibility;
783
800
  requireJoinApproval: boolean;
784
801
  parentSpaceId: string | null;
785
802
  depth: number;
@@ -1601,6 +1618,7 @@ interface CreateSpaceProps {
1601
1618
  description?: string;
1602
1619
  readingPermission?: ReadingPermission;
1603
1620
  postingPermission?: PostingPermission;
1621
+ visibility?: SpaceVisibility;
1604
1622
  requireJoinApproval?: boolean;
1605
1623
  parentSpaceId?: string;
1606
1624
  metadata?: Record<string, any>;
@@ -1677,6 +1695,7 @@ interface UpdateSpaceProps {
1677
1695
  description?: string;
1678
1696
  readingPermission?: ReadingPermission;
1679
1697
  postingPermission?: PostingPermission;
1698
+ visibility?: SpaceVisibility;
1680
1699
  metadata?: Record<string, any>;
1681
1700
  /**
1682
1701
  * New avatar image. When present the request is sent as `multipart/form-data`
@@ -2148,13 +2167,13 @@ declare namespace Collections {
2148
2167
  export { Collections_addEntityToCollection as addEntityToCollection, Collections_createNewCollection as createNewCollection, Collections_deleteCollection as deleteCollection, Collections_fetchCollectionEntities as fetchCollectionEntities, Collections_fetchRootCollection as fetchRootCollection, Collections_fetchSubCollections as fetchSubCollections, Collections_removeEntityFromCollection as removeEntityFromCollection, Collections_updateCollection as updateCollection };
2149
2168
  }
2150
2169
 
2151
- interface FetchFollowingProps {
2170
+ interface FetchFollowingProps extends UserSearchParams {
2152
2171
  page?: number;
2153
2172
  limit?: number;
2154
2173
  }
2155
2174
  declare function fetchFollowing(client: SublayHttpClient, data: FetchFollowingProps): Promise<PaginatedResponse<FollowListItem>>;
2156
2175
 
2157
- interface FetchFollowersProps {
2176
+ interface FetchFollowersProps extends UserSearchParams {
2158
2177
  page?: number;
2159
2178
  limit?: number;
2160
2179
  }
@@ -2184,7 +2203,7 @@ declare namespace Follows {
2184
2203
  export { Follows_deleteFollow as deleteFollow, Follows_fetchFollowers as fetchFollowers, Follows_fetchFollowersCount as fetchFollowersCount, Follows_fetchFollowing as fetchFollowing, Follows_fetchFollowingCount as fetchFollowingCount };
2185
2204
  }
2186
2205
 
2187
- interface FetchConnectionsProps {
2206
+ interface FetchConnectionsProps extends UserSearchParams {
2188
2207
  page?: number;
2189
2208
  limit?: number;
2190
2209
  }
@@ -3258,4 +3277,4 @@ declare class SublayClient {
3258
3277
  clearTokens(): void;
3259
3278
  }
3260
3279
 
3261
- 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -51,4 +51,5 @@ export declare class SublayClient {
51
51
  export type { ClientConfig, AuthTokens } from "./core/client";
52
52
  export type { PaginatedResponse, PaginationMetadata, } from "./interfaces/IPaginatedResponse";
53
53
  export type { SpaceReputationContextParams, SpaceReputationUserParams, } from "./interfaces/SpaceReputation";
54
+ export type { UserSearchParams } from "./interfaces/UserSearch";
54
55
  export type { TableAccessor, TableRow, TableQuery, DbFilter, DbFilterOperator, BulkDeleteProps, DeleteResult, BulkDeleteResult, } from "./interfaces/Table";
@@ -2,6 +2,7 @@ import { PaginatedResponse } from "./IPaginatedResponse";
2
2
  import { File } from "./File";
3
3
  export type ReadingPermission = "anyone" | "members";
4
4
  export type PostingPermission = "anyone" | "members" | "admins";
5
+ export type SpaceVisibility = "public" | "unlisted" | "private";
5
6
  export type SpaceMemberRole = "admin" | "moderator" | "member";
6
7
  export type SpaceMemberStatus = "pending" | "active" | "banned" | "rejected";
7
8
  export interface SpaceMemberPermissions {
@@ -20,6 +21,7 @@ export interface SpacePreview {
20
21
  slug: string | null;
21
22
  avatarFileId: string | null;
22
23
  readingPermission?: ReadingPermission;
24
+ visibility?: SpaceVisibility;
23
25
  parentSpaceId?: string | null;
24
26
  depth?: number;
25
27
  avatarFile?: File;
@@ -36,6 +38,7 @@ export interface Space {
36
38
  userId: string;
37
39
  readingPermission: ReadingPermission;
38
40
  postingPermission: PostingPermission;
41
+ visibility: SpaceVisibility;
39
42
  requireJoinApproval: boolean;
40
43
  parentSpaceId: string | null;
41
44
  depth: number;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Shared optional params for text-searching a list of users
3
+ * (followers / following / connections).
4
+ *
5
+ * - `query` — free-text search term. When omitted, no filtering is applied.
6
+ * - `searchFields` — narrows which user field the term matches against. When
7
+ * omitted, the term matches either `username` OR `name` (case-insensitive
8
+ * substring). `"username"` / `"name"` restrict the match to that one field.
9
+ */
10
+ export interface UserSearchParams {
11
+ query?: string;
12
+ searchFields?: "username" | "name";
13
+ }
@@ -1,7 +1,8 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { EstablishedConnection } from "../../interfaces/Connection";
3
3
  import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
- export interface FetchConnectionsProps {
4
+ import { UserSearchParams } from "../../interfaces/UserSearch";
5
+ export interface FetchConnectionsProps extends UserSearchParams {
5
6
  page?: number;
6
7
  limit?: number;
7
8
  }
@@ -1,7 +1,8 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { FollowListItem } from "../../interfaces/Follow";
3
3
  import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
- export interface FetchFollowersProps {
4
+ import { UserSearchParams } from "../../interfaces/UserSearch";
5
+ export interface FetchFollowersProps extends UserSearchParams {
5
6
  page?: number;
6
7
  limit?: number;
7
8
  }
@@ -1,7 +1,8 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { FollowListItem } from "../../interfaces/Follow";
3
3
  import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
- export interface FetchFollowingProps {
4
+ import { UserSearchParams } from "../../interfaces/UserSearch";
5
+ export interface FetchFollowingProps extends UserSearchParams {
5
6
  page?: number;
6
7
  limit?: number;
7
8
  }
@@ -1,5 +1,5 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
- import { Space, ReadingPermission, PostingPermission } from "../../interfaces/Space";
2
+ import { Space, ReadingPermission, PostingPermission, SpaceVisibility } from "../../interfaces/Space";
3
3
  import { ImageOptions } from "../../interfaces/ImageProcessing";
4
4
  /** A file plus the image-processing options the server requires alongside it. */
5
5
  export interface SpaceImageUpload {
@@ -13,6 +13,7 @@ export interface CreateSpaceProps {
13
13
  description?: string;
14
14
  readingPermission?: ReadingPermission;
15
15
  postingPermission?: PostingPermission;
16
+ visibility?: SpaceVisibility;
16
17
  requireJoinApproval?: boolean;
17
18
  parentSpaceId?: string;
18
19
  metadata?: Record<string, any>;
@@ -1,5 +1,5 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
- import { Space, ReadingPermission, PostingPermission } from "../../interfaces/Space";
2
+ import { Space, ReadingPermission, PostingPermission, SpaceVisibility } from "../../interfaces/Space";
3
3
  import type { SpaceImageUpload } from "./createSpace";
4
4
  export interface UpdateSpaceProps {
5
5
  spaceId: string;
@@ -8,6 +8,7 @@ export interface UpdateSpaceProps {
8
8
  description?: string;
9
9
  readingPermission?: ReadingPermission;
10
10
  postingPermission?: PostingPermission;
11
+ visibility?: SpaceVisibility;
11
12
  metadata?: Record<string, any>;
12
13
  /**
13
14
  * New avatar image. When present the request is sent as `multipart/form-data`
@@ -2,7 +2,8 @@ import { SublayHttpClient } from "../../core/client";
2
2
  import { EstablishedConnection } from "../../interfaces/Connection";
3
3
  import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
4
  import { SpaceReputationUserParams } from "../../interfaces/SpaceReputation";
5
- export interface FetchConnectionsByUserIdProps extends SpaceReputationUserParams {
5
+ import { UserSearchParams } from "../../interfaces/UserSearch";
6
+ export interface FetchConnectionsByUserIdProps extends SpaceReputationUserParams, UserSearchParams {
6
7
  userId: string;
7
8
  page?: number;
8
9
  limit?: number;
@@ -2,7 +2,8 @@ import { SublayHttpClient } from "../../core/client";
2
2
  import { FollowListItem } from "../../interfaces/Follow";
3
3
  import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
4
  import { SpaceReputationUserParams } from "../../interfaces/SpaceReputation";
5
- export interface FetchFollowersByUserIdProps extends SpaceReputationUserParams {
5
+ import { UserSearchParams } from "../../interfaces/UserSearch";
6
+ export interface FetchFollowersByUserIdProps extends SpaceReputationUserParams, UserSearchParams {
6
7
  userId: string;
7
8
  page?: number;
8
9
  limit?: number;
@@ -2,7 +2,8 @@ import { SublayHttpClient } from "../../core/client";
2
2
  import { FollowListItem } from "../../interfaces/Follow";
3
3
  import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
4
4
  import { SpaceReputationUserParams } from "../../interfaces/SpaceReputation";
5
- export interface FetchFollowingByUserIdProps extends SpaceReputationUserParams {
5
+ import { UserSearchParams } from "../../interfaces/UserSearch";
6
+ export interface FetchFollowingByUserIdProps extends SpaceReputationUserParams, UserSearchParams {
6
7
  userId: string;
7
8
  page?: number;
8
9
  limit?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sublay/js",
3
- "version": "7.4.0",
3
+ "version": "7.4.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [