@paperkite/plugin-archive 0.1.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 (67) hide show
  1. package/README.md +81 -0
  2. package/dist/archiver.d.ts +98 -0
  3. package/dist/archiver.js +399 -0
  4. package/dist/archiver.js.map +1 -0
  5. package/dist/config.d.ts +22 -0
  6. package/dist/config.js +62 -0
  7. package/dist/config.js.map +1 -0
  8. package/dist/console/live.d.ts +24 -0
  9. package/dist/console/live.js +144 -0
  10. package/dist/console/live.js.map +1 -0
  11. package/dist/console/media.d.ts +66 -0
  12. package/dist/console/media.js +368 -0
  13. package/dist/console/media.js.map +1 -0
  14. package/dist/console/server.d.ts +12 -0
  15. package/dist/console/server.js +583 -0
  16. package/dist/console/server.js.map +1 -0
  17. package/dist/console/service.d.ts +13 -0
  18. package/dist/console/service.js +86 -0
  19. package/dist/console/service.js.map +1 -0
  20. package/dist/index.d.ts +6 -0
  21. package/dist/index.js +59 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/storage/index.d.ts +6 -0
  24. package/dist/storage/index.js +23 -0
  25. package/dist/storage/index.js.map +1 -0
  26. package/dist/storage/model.d.ts +296 -0
  27. package/dist/storage/model.js +151 -0
  28. package/dist/storage/model.js.map +1 -0
  29. package/dist/storage/postgres.d.ts +67 -0
  30. package/dist/storage/postgres.js +1021 -0
  31. package/dist/storage/postgres.js.map +1 -0
  32. package/dist/storage/sqlite.d.ts +59 -0
  33. package/dist/storage/sqlite.js +981 -0
  34. package/dist/storage/sqlite.js.map +1 -0
  35. package/package.json +68 -0
  36. package/public/_app/immutable/assets/2.Bb7uPFzV.css +1 -0
  37. package/public/_app/immutable/assets/inter-cyrillic-ext-wght-normal.BOeWTOD4.woff2 +0 -0
  38. package/public/_app/immutable/assets/inter-cyrillic-wght-normal.DqGufNeO.woff2 +0 -0
  39. package/public/_app/immutable/assets/inter-greek-ext-wght-normal.DlzME5K_.woff2 +0 -0
  40. package/public/_app/immutable/assets/inter-greek-wght-normal.CkhJZR-_.woff2 +0 -0
  41. package/public/_app/immutable/assets/inter-latin-ext-wght-normal.DO1Apj_S.woff2 +0 -0
  42. package/public/_app/immutable/assets/inter-latin-wght-normal.Dx4kXJAl.woff2 +0 -0
  43. package/public/_app/immutable/assets/inter-vietnamese-wght-normal.CBcvBZtf.woff2 +0 -0
  44. package/public/_app/immutable/assets/jetbrains-mono-cyrillic-wght-normal.D73BlboJ.woff2 +0 -0
  45. package/public/_app/immutable/assets/jetbrains-mono-greek-wght-normal.Bw9x6K1M.woff2 +0 -0
  46. package/public/_app/immutable/assets/jetbrains-mono-latin-ext-wght-normal.DBQx-q_a.woff2 +0 -0
  47. package/public/_app/immutable/assets/jetbrains-mono-latin-wght-normal.B9CIFXIH.woff2 +0 -0
  48. package/public/_app/immutable/assets/jetbrains-mono-vietnamese-wght-normal.Bt-aOZkq.woff2 +0 -0
  49. package/public/_app/immutable/assets/space-grotesk-latin-ext-wght-normal.D9tNdqV9.woff2 +0 -0
  50. package/public/_app/immutable/assets/space-grotesk-latin-wght-normal.BhU9QXUp.woff2 +0 -0
  51. package/public/_app/immutable/assets/space-grotesk-vietnamese-wght-normal.D0rl6rjA.woff2 +0 -0
  52. package/public/_app/immutable/chunks/B-p02l9b.js +1 -0
  53. package/public/_app/immutable/chunks/B2PcQfwz.js +2 -0
  54. package/public/_app/immutable/chunks/B5jq0EKW.js +1 -0
  55. package/public/_app/immutable/chunks/BE6amh18.js +1 -0
  56. package/public/_app/immutable/chunks/BthhYhDm.js +1 -0
  57. package/public/_app/immutable/chunks/CE3cE3D4.js +1 -0
  58. package/public/_app/immutable/chunks/Ca0EqmiO.js +1 -0
  59. package/public/_app/immutable/chunks/DinkGRjM.js +1 -0
  60. package/public/_app/immutable/chunks/wbPk3Yxo.js +81 -0
  61. package/public/_app/immutable/entry/app.BZWm0Bkz.js +2 -0
  62. package/public/_app/immutable/entry/start.CL3zgJlU.js +1 -0
  63. package/public/_app/immutable/nodes/0.D0U9EB0e.js +1 -0
  64. package/public/_app/immutable/nodes/1.BjfjMKKG.js +1 -0
  65. package/public/_app/immutable/nodes/2.aAvubp2j.js +5 -0
  66. package/public/_app/version.json +1 -0
  67. package/public/index.html +48 -0
@@ -0,0 +1,67 @@
1
+ import { type ArchiveContextResult, type ArchiveQuery, type ArchiveSearchResult, type ArchiveStore, type BatchResult, type BlockedUserAddResult, type BlockedUserInput, type BlockedUserState, type BlockwordAddResult, type BlockwordState, type ChatLedgerRow, type ChatRecord, type LastMessageInfo, type MediaRow, type MessageRecord, type MessageRow, type ReplyChainResult, type SenderQuery, type SenderSearchResult, type SenderSummary, type StoredMediaFile } from "./model.js";
2
+ export declare class PostgresArchiveStore implements ArchiveStore {
3
+ readonly url: string;
4
+ private readonly pool;
5
+ private readonly schemaName;
6
+ private readonly schema;
7
+ /** 屏蔽词内存缓存(小写归一);读路径条件固定为 blocked = FALSE,与词数无关。 */
8
+ private blockwords;
9
+ private blockwordsVersion;
10
+ /** 屏蔽用户内存缓存(sender_id 精确匹配)。 */
11
+ private blockedUsers;
12
+ private blockedUsersVersion;
13
+ constructor(url: string, schema?: string);
14
+ init(): Promise<void>;
15
+ /** 老库迁移:messages 补 blocked 标志列与 entities 实体列。 */
16
+ private ensureLegacyColumns;
17
+ /** blocked 标志维护的部分索引:置位只扫未屏蔽行,解锁只扫已屏蔽行。 */
18
+ private ensureBlockedIndexes;
19
+ close(): Promise<void>;
20
+ saveChat(chat: ChatRecord): Promise<boolean>;
21
+ startSyncSession(chatId: string, startDate: string, endDate: string): Promise<number>;
22
+ completeSyncSession(sessionId: number, messagesCount: number, mediaCount: number): Promise<void>;
23
+ getLastMessageInfo(chatId: string): Promise<LastMessageInfo | undefined>;
24
+ getChatUsername(chatId: string): Promise<string | undefined>;
25
+ messageIdsExist(chatId: string, messageIds: readonly number[]): Promise<ReadonlySet<number>>;
26
+ saveBatch(messages: readonly MessageRow[], media: readonly MediaRow[]): Promise<BatchResult>;
27
+ listBlockwords(): Promise<BlockwordState>;
28
+ addBlockword(word: string): Promise<BlockwordAddResult>;
29
+ removeBlockword(word: string): Promise<boolean>;
30
+ listBlockedUsers(): Promise<BlockedUserState>;
31
+ addBlockedUser(input: BlockedUserInput): Promise<BlockedUserAddResult>;
32
+ removeBlockedUser(userId: string): Promise<boolean>;
33
+ /** 增量置位:只置未屏蔽行中命中新词的行的标志。 */
34
+ private markBlockwordMatches;
35
+ /** 增量解锁:只重算已屏蔽且命中被删词的行,其余行不受影响。 */
36
+ private unmarkBlockwordMatches;
37
+ /** 增量置位:只置未屏蔽行中发送者为新用户的行的标志。 */
38
+ private markBlockedUserMatches;
39
+ /** 增量解锁:只重算已屏蔽且发送者为被删用户的行。 */
40
+ private unmarkBlockedUserMatches;
41
+ /**
42
+ * 增量解锁执行:match 命中已屏蔽行,剩余规则(holds)全不命中时解锁。
43
+ * 命中行先经子查询物化,避免 UPDATE 边扫索引边改 blocked 时漏行。
44
+ */
45
+ private runUnblock;
46
+ searchStructured(query: ArchiveQuery): Promise<ArchiveSearchResult>;
47
+ listChatLedger(limit: number): Promise<ChatLedgerRow[]>;
48
+ getMessageByRecordId(recordId: string): Promise<MessageRecord | undefined>;
49
+ searchSenders(query: SenderQuery): Promise<SenderSearchResult>;
50
+ getSenderSummary(senderId: string, chatId?: string): Promise<SenderSummary | undefined>;
51
+ getReplyChain(recordId: string): Promise<ReplyChainResult | undefined>;
52
+ resolveMessageRef(ref: {
53
+ chatId?: string;
54
+ username?: string;
55
+ code?: string;
56
+ messageId: number;
57
+ }): Promise<string | undefined>;
58
+ getMessageContext(recordId: string, beforeN: number, afterN: number, beforeOffset?: number, afterOffset?: number): Promise<ArchiveContextResult>;
59
+ private fetchGroupAttached;
60
+ private fetchGroupsAttached;
61
+ private groupRows;
62
+ getMediaFileById(id: string): Promise<StoredMediaFile | undefined>;
63
+ private attachMedia;
64
+ private fetchMediaFiles;
65
+ private fetchAlbumRows;
66
+ private table;
67
+ }