memi-board 0.4.0 → 0.4.4

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,10 +1,7 @@
1
1
  import { ModerationResult } from '../types';
2
2
  /**
3
- * 글쓰기 전 블로킹 검열. 로컬 비속어 필터를 먼저 돌리고, 통과하면 Firebase AI Logic(Gemini)으로 재검사한다.
4
- * 검열 API 장애 시 동작은 moderation.onError 옵션을 따른다 (기본 'allow' — 검열 장애로 정상 글쓰기가 막히지 않도록).
5
- *
6
- * 알려진 한계: 이 검열은 클라이언트에서만 실행되므로, Firestore에 직접 쓰기하면 우회할 수 있다.
7
- * (서버가 없는 아키텍처의 근본적 한계 — README의 Security Model 참고)
3
+ * 글쓰기 전 블로킹 검열. 로컬 비속어 필터 → Firebase AI Logic(Gemini).
4
+ * App Check limited-use 토큰 사용.
8
5
  */
9
6
  export declare function useMemiBoardModeration(): {
10
7
  checkText: (text: string) => Promise<ModerationResult>;
@@ -23,6 +23,8 @@ export declare function useMemiBoardPosts(): {
23
23
  getPosts: (opts?: {
24
24
  pageSize?: number;
25
25
  cursor?: QueryDocumentSnapshot<DocumentData>;
26
+ /** 지정 시 해당 카테고리 글만 (boardSettings 의 category id) */
27
+ category?: string;
26
28
  }) => Promise<{
27
29
  posts: PostModel[];
28
30
  cursor: QueryDocumentSnapshot<DocumentData> | undefined;
@@ -1,12 +1,18 @@
1
1
  import { BoardCategory } from '../types';
2
+ /** 설정 문서가 없을 때 UI·시드에 쓰는 기본 카테고리. */
3
+ export declare const DEFAULT_CATEGORIES: BoardCategory[];
2
4
  /**
3
- * 게시판 설정({prefix}Settings/config) — 지금은 카테고리 옵션만 다룬다.
4
- * 문서가 없으면 기본 카테고리를 그대로 보여주고, 관리자가 게시판을 방문하는 순간
5
- * 그 기본값으로 문서를 한 번 만들어 둔다(이후엔 Firebase 콘솔/향후 관리 UI에서 직접 수정).
6
- * 일반 사용자는 절대 이 문서를 쓰지 않는다(생성 실패해도 조용히 무시 — 기본값으로 계속 동작).
5
+ * 게시판 설정({prefix}Settings/config) — 카테고리 옵션 목록.
6
+ *
7
+ * - 읽기: 전체 공개 (useDocument 실시간)
8
+ * - 문서 없음: DEFAULT 로 보여 주고, 로그인 사용자가 처음 쓰거나 추가할 때 시드 생성
9
+ * - 카테고리 추가: 로그인 사용자 (글쓰기 폼에서 즉시 추가)
7
10
  */
8
11
  export declare function useMemiBoardSettings(): {
9
12
  categories: import('vue').ComputedRef<BoardCategory[]>;
10
13
  categoryLabel: (id: string | undefined) => string | undefined;
11
14
  settingsPending: import('vue').Ref<boolean, boolean>;
15
+ ensureSettings: () => Promise<void>;
16
+ addCategory: (label: string) => Promise<string>;
17
+ DEFAULT_CATEGORIES: BoardCategory[];
12
18
  };
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ export { useMemiBoardComments } from './composables/useMemiBoardComments';
8
8
  export type { AddCommentInput } from './composables/useMemiBoardComments';
9
9
  export { useMemiBoardModeration } from './composables/useMemiBoardModeration';
10
10
  export { useMemiBoardStorage } from './composables/useMemiBoardStorage';
11
- export { useMemiBoardSettings } from './composables/useMemiBoardSettings';
11
+ export { useMemiBoardSettings, DEFAULT_CATEGORIES } from './composables/useMemiBoardSettings';
12
12
  export { versionHistory } from './data/versionHistory';
13
13
  export type { VersionHistoryEntry } from './data/versionHistory';
14
14
  export { formatDate } from './utils/formatDate';