@medipha/feed 0.1.5 → 0.1.7
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/core/errors.d.ts +1 -1
- package/dist/core/feed-api.d.ts +10 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/types.d.ts +27 -0
- package/dist/features/feed/banner/banner-widget.d.ts +2 -0
- package/dist/features/feed/events/events-widget.d.ts +5 -0
- package/dist/features/feed/events/format-event-time.d.ts +4 -0
- package/dist/features/manage/banner/banner-settings-page.d.ts +2 -0
- package/dist/features/manage/events/events-admin-page.d.ts +2 -0
- package/dist/index.cjs +9 -9
- package/dist/index.js +3459 -3120
- package/dist/shared/components/image-upload-field.d.ts +14 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/features/feed/sidebar/profile-card.d.ts +0 -1
- package/dist/features/feed/widgets/feed-footer.d.ts +0 -1
- package/dist/features/feed/widgets/post-detail-modal.d.ts +0 -10
- package/dist/features/feed/widgets/top-contributors-widget.d.ts +0 -1
- package/dist/features/feed/widgets/weekly-highlight-widget.d.ts +0 -1
package/dist/core/errors.d.ts
CHANGED
|
@@ -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_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_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"];
|
|
2
2
|
export type FeedErrorCode = (typeof FEED_ERROR_CODES)[number];
|
|
3
3
|
export declare class FeedApiError extends Error {
|
|
4
4
|
readonly status: number;
|
package/dist/core/feed-api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FeedApiConfig } from './http';
|
|
2
|
-
import { CursorPage, DepartmentEngagement, FeedBirthday, 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, 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';
|
|
3
3
|
export interface CursorParams {
|
|
4
4
|
cursor?: string | null;
|
|
5
5
|
limit?: number;
|
|
@@ -75,6 +75,8 @@ export declare function createFeedApi(config: FeedApiConfig): {
|
|
|
75
75
|
listCategories: (signal?: AbortSignal) => Promise<FeedCategory[]>;
|
|
76
76
|
listMentions: (params?: CursorParams, signal?: AbortSignal) => Promise<CursorPage<FeedMention>>;
|
|
77
77
|
listTodayBirthdays: (signal?: AbortSignal) => Promise<FeedBirthday[]>;
|
|
78
|
+
getRightBanner: (signal?: AbortSignal) => Promise<FeedBanner>;
|
|
79
|
+
listLatestEvents: (signal?: AbortSignal) => Promise<FeedEvent[]>;
|
|
78
80
|
listTrendingHashtags: (signal?: AbortSignal) => Promise<TrendingHashtag[]>;
|
|
79
81
|
getPost: (postId: string, signal?: AbortSignal) => Promise<FeedPost>;
|
|
80
82
|
listMyPosts: (params?: ListMyPostsParams, signal?: AbortSignal) => Promise<CursorPage<FeedPost>>;
|
|
@@ -95,6 +97,13 @@ export declare function createFeedApi(config: FeedApiConfig): {
|
|
|
95
97
|
deleteCategory: (categoryId: string) => Promise<void>;
|
|
96
98
|
createCategory: (input: CategoryInput) => Promise<FeedCategory>;
|
|
97
99
|
updateCategory: (categoryId: string, input: Partial<CategoryInput>) => Promise<FeedCategory>;
|
|
100
|
+
setRightBanner: (input: BannerInput) => Promise<FeedBanner>;
|
|
101
|
+
clearRightBanner: () => Promise<void>;
|
|
102
|
+
/** Every event, newest first; managers only. */
|
|
103
|
+
listManageEvents: (signal?: AbortSignal) => Promise<FeedEvent[]>;
|
|
104
|
+
createEvent: (input: EventInput) => Promise<FeedEvent>;
|
|
105
|
+
updateEvent: (eventId: string, input: Partial<EventInput>) => Promise<FeedEvent>;
|
|
106
|
+
deleteEvent: (eventId: string) => Promise<void>;
|
|
98
107
|
approvePost: (postId: string) => Promise<FeedPost>;
|
|
99
108
|
/** APPROVED → PUBLISHED: the post goes live on the feed. */
|
|
100
109
|
publishPost: (postId: string) => Promise<FeedPost>;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -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, 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, 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';
|
package/dist/core/types.d.ts
CHANGED
|
@@ -206,3 +206,30 @@ export interface TopUser {
|
|
|
206
206
|
shares: number;
|
|
207
207
|
total: number;
|
|
208
208
|
}
|
|
209
|
+
export interface FeedEvent {
|
|
210
|
+
id: string;
|
|
211
|
+
title: string;
|
|
212
|
+
startsAt: string;
|
|
213
|
+
endsAt: string | null;
|
|
214
|
+
location: string | null;
|
|
215
|
+
description: string | null;
|
|
216
|
+
imageUrl: string;
|
|
217
|
+
createdAt: string;
|
|
218
|
+
}
|
|
219
|
+
export interface EventInput {
|
|
220
|
+
title: string;
|
|
221
|
+
startsAt: string;
|
|
222
|
+
endsAt?: string | null;
|
|
223
|
+
location?: string | null;
|
|
224
|
+
description?: string | null;
|
|
225
|
+
imageUrl: string;
|
|
226
|
+
}
|
|
227
|
+
/** Both fields are null while no banner is set. */
|
|
228
|
+
export interface FeedBanner {
|
|
229
|
+
imageUrl: string | null;
|
|
230
|
+
linkUrl: string | null;
|
|
231
|
+
}
|
|
232
|
+
export interface BannerInput {
|
|
233
|
+
imageUrl: string;
|
|
234
|
+
linkUrl?: string | null;
|
|
235
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function formatEventTime(startsAt: string, endsAt: string | null): string;
|
|
2
|
+
export type EventPhase = 'upcoming' | 'ongoing' | 'ended';
|
|
3
|
+
/** An event without an end is taken to last through the end of its start day. */
|
|
4
|
+
export declare function eventPhase(startsAt: string, endsAt: string | null, now?: number): EventPhase;
|