@aiquants/daily-report 0.12.4 → 0.13.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.
@@ -103,6 +103,18 @@ export const statusUpdateMessageSchema = z.object({
103
103
  recipientRawUserId: z.number().optional(),
104
104
  })
105
105
 
106
+ /**
107
+ * 親日報の区分 (sourceType)。受信側の可視性フィルタ専用。
108
+ *
109
+ * ❗ `.optional()` は必須。SSE の実体は永続 Redis Stream (MAXLEN 保持) であり、このフィールドを
110
+ * 載せる前に publish された**旧エントリが配備をまたいで残る**。必須にすると共有リーダーの
111
+ * 再生と再接続クライアントの catch-up が fail-closed で全て捨てられ、更新が永久に届かなくなる。
112
+ *
113
+ * `recipientRawUserId` と異なりクライアントへ**除去せず転送する**。フィルタを通過した時点で
114
+ * その区分は当該閲覧者に可視であり、`sourceType` は一覧・詳細で既に開示済みのため漏洩しない。
115
+ */
116
+ const sseSourceTypeSchema = z.string().optional()
117
+
106
118
  export const commentAddMessageSchema = z.object({
107
119
  type: z.literal("comment-add"),
108
120
  reportHubId: z.number(),
@@ -111,6 +123,7 @@ export const commentAddMessageSchema = z.object({
111
123
  // 下書き日報のコメントは所有者以外に見えてはならない (本文の全員配信を防ぐ)。
112
124
  // サーバーサイドフィルタ専用で、SSE ルートがフィルタ後に除去する
113
125
  recipientRawUserId: z.number().optional(),
126
+ sourceType: sseSourceTypeSchema,
114
127
  })
115
128
 
116
129
  export const commentDeleteMessageSchema = z.object({
@@ -120,6 +133,7 @@ export const commentDeleteMessageSchema = z.object({
120
133
  clientTempId: z.string(),
121
134
  // comment-add と同じ理由の宛先フィルタ
122
135
  recipientRawUserId: z.number().optional(),
136
+ sourceType: sseSourceTypeSchema,
123
137
  })
124
138
 
125
139
  export const reportCreateMessageSchema = z.object({
@@ -150,6 +164,7 @@ export const reportDeleteMessageSchema = z.object({
150
164
  type: z.literal("report-delete"),
151
165
  reportHubId: z.number(),
152
166
  clientTempId: z.string(),
167
+ sourceType: sseSourceTypeSchema,
153
168
  })
154
169
 
155
170
  // --- Discriminated Union ---