@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
@@ -1,5 +1,6 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { Space, ReadingPermission, PostingPermission } from "../../interfaces/Space";
3
+ import type { SpaceImageUpload } from "./createSpace";
3
4
  export interface UpdateSpaceProps {
4
5
  spaceId: string;
5
6
  name?: string;
@@ -8,5 +9,12 @@ export interface UpdateSpaceProps {
8
9
  readingPermission?: ReadingPermission;
9
10
  postingPermission?: PostingPermission;
10
11
  metadata?: Record<string, any>;
12
+ /**
13
+ * New avatar image. When present the request is sent as `multipart/form-data`
14
+ * and the server processes the image per `options`, replacing the old avatar.
15
+ */
16
+ avatarFile?: SpaceImageUpload;
17
+ /** New banner image; same contract as {@link UpdateSpaceProps.avatarFile}. */
18
+ bannerFile?: SpaceImageUpload;
11
19
  }
12
20
  export declare function updateSpace(client: SublayHttpClient, data: UpdateSpaceProps): Promise<Space>;
@@ -33,9 +33,10 @@ export interface UploadImageProps {
33
33
  imageOptions: ImageOptions;
34
34
  /** Storage path segments, e.g. ["spaces", spaceId, "banner"]. */
35
35
  pathParts?: string[];
36
- /** Only one of entityId/commentId/spaceId may be set. */
36
+ /** Only one of entityId/commentId/spaceId/eventId may be set. */
37
37
  entityId?: string;
38
38
  commentId?: string;
39
39
  spaceId?: string;
40
+ eventId?: string;
40
41
  }
41
42
  export declare function uploadImage(client: SublayHttpClient, data: UploadImageProps): Promise<UploadImageResponse>;
@@ -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 FetchConnectionsByUserIdProps {
4
+ import { SpaceReputationUserParams } from "../../interfaces/SpaceReputation";
5
+ export interface FetchConnectionsByUserIdProps extends SpaceReputationUserParams {
5
6
  userId: string;
6
7
  page?: number;
7
8
  limit?: number;
@@ -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 FetchFollowersByUserIdProps {
4
+ import { SpaceReputationUserParams } from "../../interfaces/SpaceReputation";
5
+ export interface FetchFollowersByUserIdProps extends SpaceReputationUserParams {
5
6
  userId: string;
6
7
  page?: number;
7
8
  limit?: number;
@@ -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 FetchFollowingByUserIdProps {
4
+ import { SpaceReputationUserParams } from "../../interfaces/SpaceReputation";
5
+ export interface FetchFollowingByUserIdProps extends SpaceReputationUserParams {
5
6
  userId: string;
6
7
  page?: number;
7
8
  limit?: number;
@@ -1,6 +1,7 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { User } from "../../interfaces/User";
3
- export interface FetchUserByForeignIdProps {
3
+ import { SpaceReputationUserParams } from "../../interfaces/SpaceReputation";
4
+ export interface FetchUserByForeignIdProps extends SpaceReputationUserParams {
4
5
  foreignId: string;
5
6
  include?: string;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { User } from "../../interfaces/User";
3
- export interface FetchUserByIdProps {
3
+ import { SpaceReputationUserParams } from "../../interfaces/SpaceReputation";
4
+ export interface FetchUserByIdProps extends SpaceReputationUserParams {
4
5
  userId: string;
5
6
  include?: string;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { User } from "../../interfaces/User";
3
- export interface FetchUserByUsernameProps {
3
+ import { SpaceReputationUserParams } from "../../interfaces/SpaceReputation";
4
+ export interface FetchUserByUsernameProps extends SpaceReputationUserParams {
4
5
  username: string;
5
6
  include?: string;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  import { SublayHttpClient } from "../../core/client";
2
2
  import { User } from "../../interfaces/User";
3
- export interface FetchUserSuggestionsProps {
3
+ import { SpaceReputationUserParams } from "../../interfaces/SpaceReputation";
4
+ export interface FetchUserSuggestionsProps extends SpaceReputationUserParams {
4
5
  query: string;
5
6
  }
6
7
  export declare function fetchUserSuggestions(client: SublayHttpClient, data: FetchUserSuggestionsProps): Promise<User[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sublay/js",
3
- "version": "7.1.1",
3
+ "version": "7.3.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -36,8 +36,8 @@
36
36
  "test": "jest",
37
37
  "version:patch": "pnpm version patch --no-git-tag-version --no-git-checks",
38
38
  "version:minor": "pnpm version minor --no-git-tag-version --no-git-checks",
39
- "publish-beta": "pnpm publish --tag beta --no-git-checks",
40
- "publish-prod": "pnpm publish --no-git-checks",
39
+ "publish-beta": "pnpm test && pnpm publish --tag beta --no-git-checks",
40
+ "publish-prod": "pnpm test && pnpm publish --no-git-checks",
41
41
  "publish-beta:patch": "pnpm version:patch && pnpm publish-beta",
42
42
  "publish-beta:minor": "pnpm version:minor && pnpm publish-beta",
43
43
  "publish-prod:patch": "pnpm version:patch && pnpm publish-prod",