@medipha/feed 0.2.6 → 0.2.8

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.
@@ -1,4 +1,4 @@
1
- export declare const FEED_ERROR_CODES: readonly ["FEED_UNAUTHORIZED", "FEED_ERP_UNAVAILABLE", "FEED_POST_NOT_FOUND", "FEED_COMMENT_NOT_FOUND", "FEED_POST_FORBIDDEN", "FEED_FORBIDDEN", "FEED_POST_STATUS_INVALID", "FEED_POST_LOCKED", "FEED_POST_ALREADY_SHARED", "FEED_COMMENTS_LOCKED", "FEED_CATEGORY_NOT_FOUND", "FEED_CATEGORY_INVALID", "FEED_CATEGORY_IN_USE", "FEED_EVENT_NOT_FOUND", "FEED_EVENT_INVALID", "FEED_BANNER_INVALID", "FEED_POST_EMPTY", "FEED_COMMENT_EMPTY", "FEED_MENTION_INVALID", "FEED_MEDIA_LIMIT_EXCEEDED", "FEED_MEDIA_INVALID", "FEED_MEDIA_KIND_INVALID", "FEED_MEDIA_UPLOAD_FAILED", "FEED_LINK_PREVIEW_URL_INVALID"];
1
+ export declare const FEED_ERROR_CODES: readonly ["FEED_UNAUTHORIZED", "FEED_ERP_UNAVAILABLE", "FEED_POST_NOT_FOUND", "FEED_COMMENT_NOT_FOUND", "FEED_POST_FORBIDDEN", "FEED_FORBIDDEN", "FEED_POST_STATUS_INVALID", "FEED_POST_LOCKED", "FEED_POST_ALREADY_SHARED", "FEED_COMMENTS_LOCKED", "FEED_EVENT_NOT_FOUND", "FEED_EVENT_INVALID", "FEED_BANNER_INVALID", "FEED_POST_EMPTY", "FEED_COMMENT_EMPTY", "FEED_MENTION_INVALID", "FEED_MEDIA_LIMIT_EXCEEDED", "FEED_MEDIA_INVALID", "FEED_MEDIA_KIND_INVALID", "FEED_MEDIA_UPLOAD_FAILED", "FEED_LINK_PREVIEW_URL_INVALID"];
2
2
  export type FeedErrorCode = (typeof FEED_ERROR_CODES)[number];
3
3
  export declare class FeedApiError extends Error {
4
4
  readonly status: number;
@@ -1,17 +1,13 @@
1
1
  import { FeedApiConfig } from './http';
2
- import { CursorPage, DepartmentEngagement, FeedBirthday, FeedEvent, FeedBanner, BannerInput, EventInput, FeedCategory, FeedComment, FeedBranch, FeedDepartment, UserSearchFilter, FeedMe, FeedMedia, FeedMention, FeedPost, FeedUser, LinkPreview, ManageCounts, OffsetPage, PostStatus, ReactionSummary, ReactorPage, ReactionType, ReportGroupBy, ReportsOverview, ReportsTimeseriesPoint, ShareChannel, ShareResult, TopPostSort, TopUser, TrendingHashtag } from './types';
2
+ import { CursorPage, DepartmentEngagement, FeedBirthday, FeedEvent, FeedBanner, BannerInput, EventInput, FeedComment, FeedBranch, FeedDepartment, UserSearchFilter, FeedMe, FeedMedia, FeedMention, FeedPost, FeedUser, LinkPreview, ManageCounts, OffsetPage, PostStatus, ReactionSummary, ReactorPage, ReactionType, ReportGroupBy, ReportsOverview, ReportsTimeseriesPoint, ShareChannel, ShareResult, TopPostSort, TopUser, TrendingHashtag } from './types';
3
3
  export interface CursorParams {
4
4
  cursor?: string | null;
5
5
  limit?: number;
6
6
  }
7
7
  export interface ListFeedPostsParams extends CursorParams {
8
8
  q?: string;
9
- categoryId?: string;
10
9
  departmentId?: string;
11
10
  hashtag?: string;
12
- /** Inclusive day bounds (YYYY-MM-DD) on created_at. */
13
- from?: string;
14
- to?: string;
15
11
  /** Reels: only posts with at least one image or video. */
16
12
  hasMedia?: boolean;
17
13
  /** Highlights: only the posts a manager pinned, newest pin first. */
@@ -25,32 +21,22 @@ export interface CreatePostInput {
25
21
  clientPostId: string;
26
22
  content: string;
27
23
  mediaIds: string[];
28
- categoryId?: string | null;
29
24
  submit: boolean;
30
25
  }
31
26
  export interface UpdatePostInput {
32
27
  content: string;
33
28
  mediaIds: string[];
34
- categoryId?: string | null;
35
29
  }
36
30
  export interface ListManagePostsParams {
37
31
  q?: string;
38
32
  status?: PostStatus;
39
33
  authorId?: string;
40
34
  departmentId?: string;
41
- categoryId?: string;
42
35
  from?: string;
43
36
  to?: string;
44
37
  page?: number;
45
38
  pageSize?: number;
46
39
  }
47
- export interface CategoryInput {
48
- name: string;
49
- icon?: string | null;
50
- color?: string | null;
51
- sortOrder?: number;
52
- hidden?: boolean;
53
- }
54
40
  export interface CreateCommentInput {
55
41
  clientCommentId: string;
56
42
  content: string;
@@ -72,7 +58,6 @@ export declare function createFeedApi(config: FeedApiConfig): {
72
58
  listBranches: (signal?: AbortSignal) => Promise<FeedBranch[]>;
73
59
  listDepartments: (q?: string, signal?: AbortSignal) => Promise<FeedDepartment[]>;
74
60
  listFeedPosts: (params?: ListFeedPostsParams, signal?: AbortSignal) => Promise<CursorPage<FeedPost>>;
75
- listCategories: (signal?: AbortSignal) => Promise<FeedCategory[]>;
76
61
  listMentions: (params?: CursorParams, signal?: AbortSignal) => Promise<CursorPage<FeedMention>>;
77
62
  listTodayBirthdays: (signal?: AbortSignal) => Promise<FeedBirthday[]>;
78
63
  getRightBanner: (signal?: AbortSignal) => Promise<FeedBanner>;
@@ -92,11 +77,6 @@ export declare function createFeedApi(config: FeedApiConfig): {
92
77
  unpinPost: (postId: string) => Promise<FeedPost>;
93
78
  pinComment: (commentId: string) => Promise<FeedComment>;
94
79
  unpinComment: (commentId: string) => Promise<FeedComment>;
95
- /** Every category including hidden ones; managers only. */
96
- listManageCategories: (signal?: AbortSignal) => Promise<FeedCategory[]>;
97
- deleteCategory: (categoryId: string) => Promise<void>;
98
- createCategory: (input: CategoryInput) => Promise<FeedCategory>;
99
- updateCategory: (categoryId: string, input: Partial<CategoryInput>) => Promise<FeedCategory>;
100
80
  setRightBanner: (input: BannerInput) => Promise<FeedBanner>;
101
81
  clearRightBanner: () => Promise<void>;
102
82
  /** Every event, newest first; managers only. */
@@ -1,7 +1,7 @@
1
1
  export { createFeedApi } from './feed-api';
2
2
  export { MEDIA_MAX_MB, type MediaLimitKind } from './media-limits';
3
3
  export { hasFormatting, MAX_INDENT, parseBlocks, parseInline, stripFormatting, TEXT_COLORS, TEXT_SIZES, type FormatBlock, type TextColor, type TextSize, type InlineNode, type InlineStyle, } from './formatting';
4
- export type { CategoryInput, CreateCommentInput, CreatePostInput, CursorParams, DateRangeParams, ReportFilterParams, FeedApi, ListFeedPostsParams, ListManagePostsParams, ListMyPostsParams, MyPostsStatus, UpdatePostInput, } from './feed-api';
4
+ export type { CreateCommentInput, CreatePostInput, CursorParams, DateRangeParams, ReportFilterParams, FeedApi, ListFeedPostsParams, ListManagePostsParams, ListMyPostsParams, MyPostsStatus, UpdatePostInput, } from './feed-api';
5
5
  export { createFeedRequest } from './http';
6
6
  export type { FeedApiConfig, FeedRequest, FeedRequestOptions, HttpMethod } from './http';
7
7
  export { FEED_ERROR_CODES, FeedApiError, isFeedApiError } from './errors';
@@ -13,4 +13,4 @@ export type { RichSegment } from './content';
13
13
  export { serializeQuery } from './query-string';
14
14
  export type { QueryParams, QueryValue } from './query-string';
15
15
  export { REACTION_TYPES } from './types';
16
- export type { CursorPage, DepartmentEngagement, FeedBirthday, FeedEvent, FeedBanner, BannerInput, EventInput, FeedCategory, FeedComment, FeedBranch, FeedDepartment, UserSearchFilter, FeedMe, FeedMedia, FeedMention, FeedPost, FeedUser, LinkPreview, LinkPreviewKind, ManageCounts, MediaKind, OffsetPage, PostStatus, ReactionSummary, FeedReactor, ReactorPage, ReactionType, ReportGroupBy, ReportsOverview, ReportsTimeseriesPoint, ShareChannel, ShareResult, TopPostSort, TopUser, TrendingHashtag, } from './types';
16
+ export type { CursorPage, DepartmentEngagement, FeedBirthday, FeedEvent, FeedBanner, BannerInput, EventInput, FeedComment, FeedBranch, FeedDepartment, UserSearchFilter, FeedMe, FeedMedia, FeedMention, FeedPost, FeedUser, LinkPreview, LinkPreviewKind, ManageCounts, MediaKind, OffsetPage, PostStatus, ReactionSummary, FeedReactor, ReactorPage, ReactionType, ReportGroupBy, ReportsOverview, ReportsTimeseriesPoint, ShareChannel, ShareResult, TopPostSort, TopUser, TrendingHashtag, } from './types';
@@ -39,16 +39,6 @@ export interface UserSearchFilter {
39
39
  departmentId?: string;
40
40
  branchId?: string;
41
41
  }
42
- export interface FeedCategory {
43
- id: string;
44
- name: string;
45
- icon: string | null;
46
- color: string | null;
47
- sortOrder: number;
48
- hidden: boolean;
49
- postCount: number;
50
- newCount: number;
51
- }
52
42
  export interface FeedMedia {
53
43
  id: string;
54
44
  kind: MediaKind;
@@ -73,7 +63,6 @@ export interface FeedPost extends ReactionSummary {
73
63
  content: string;
74
64
  mentionedUsers: FeedUser[];
75
65
  media: FeedMedia[];
76
- category?: Pick<FeedCategory, 'id' | 'name' | 'color'> | null;
77
66
  hashtags?: string[];
78
67
  status: PostStatus;
79
68
  pinnedAt?: string | null;
@@ -1,9 +1,6 @@
1
- import { FeedCategory, FeedPost } from '../../core';
2
- export type ComposerIntent = 'text' | 'question';
1
+ import { FeedPost } from '../../core';
3
2
  interface ComposerFormProps {
4
- categories?: FeedCategory[];
5
3
  initialPost?: FeedPost;
6
- intent?: ComposerIntent;
7
4
  onDirtyChange?: (dirty: boolean) => void;
8
5
  onSaved: (post: FeedPost) => void;
9
6
  /** Bigger editing area (the modal is zoomed). */
@@ -1,8 +1,7 @@
1
- import { FeedCategory, FeedPost } from '../../core';
1
+ import { FeedPost } from '../../core';
2
2
  interface CreatePostButtonProps {
3
- categories: FeedCategory[];
4
3
  onSaved: (post: FeedPost) => void;
5
4
  }
6
5
  /** Opens the composer modal; renders nothing for users without the post permission. */
7
- export declare function CreatePostButton({ categories, onSaved }: CreatePostButtonProps): import('react/jsx-runtime').JSX.Element | null;
6
+ export declare function CreatePostButton({ onSaved }: CreatePostButtonProps): import('react/jsx-runtime').JSX.Element | null;
8
7
  export {};
@@ -1,12 +1,9 @@
1
- import { FeedCategory, FeedPost } from '../../core';
2
- import { ComposerIntent } from './composer-form';
1
+ import { FeedPost } from '../../core';
3
2
  interface CreatePostModalProps {
4
3
  open: boolean;
5
- categories: FeedCategory[];
6
- intent: ComposerIntent;
7
4
  initialPost?: FeedPost;
8
5
  onClose: () => void;
9
6
  onSaved: (post: FeedPost) => void;
10
7
  }
11
- export declare function CreatePostModal({ open, categories, intent, initialPost, onClose, onSaved, }: CreatePostModalProps): import('react/jsx-runtime').JSX.Element;
8
+ export declare function CreatePostModal({ open, initialPost, onClose, onSaved }: CreatePostModalProps): import('react/jsx-runtime').JSX.Element;
12
9
  export {};
@@ -6,9 +6,8 @@ interface MediaPickerButtonsProps {
6
6
  variant?: 'label' | 'icon';
7
7
  onUploadStart: () => void;
8
8
  onUploaded: (media: FeedMedia | null) => void;
9
- onQuestion?: () => void;
10
9
  }
11
- export declare function MediaPickerButtons({ count, disabled, variant, onUploadStart, onUploaded, onQuestion, }: MediaPickerButtonsProps): import('react/jsx-runtime').JSX.Element;
10
+ export declare function MediaPickerButtons({ count, disabled, variant, onUploadStart, onUploaded, }: MediaPickerButtonsProps): import('react/jsx-runtime').JSX.Element;
12
11
  interface AttachedMediaProps {
13
12
  media: FeedMedia[];
14
13
  uploadingCount: number;
@@ -1,11 +1,7 @@
1
1
  export interface FeedFilters {
2
2
  q: string | null;
3
- categoryId: string | null;
4
3
  departmentId: string | null;
5
4
  hashtag: string | null;
6
- /** Inclusive day range (YYYY-MM-DD) picked on the sidebar calendar. */
7
- from: string | null;
8
- to: string | null;
9
5
  }
10
6
  export declare function readFeedFilters(searchParams: URLSearchParams): FeedFilters;
11
7
  export declare function buildFeedSearch(filters: Partial<FeedFilters>): string;
@@ -1,2 +1,2 @@
1
- /** "Cấu hình" section: a tab per setting page, so more settings can be added beside categories. */
1
+ /** "Cấu hình" section: a tab per setting page, so more settings can be added beside the banner. */
2
2
  export declare function SettingsPage(): import('react/jsx-runtime').JSX.Element;