@aiquants/daily-report 0.7.0 → 0.9.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.
- package/README.md +13 -6
- package/dist/client.d.mts +438 -26
- package/dist/client.d.ts +438 -26
- package/dist/client.js +5 -4
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +5 -4
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.mts +115 -3
- package/dist/index.d.ts +115 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.mts +15 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.js +9 -6
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +9 -6
- package/dist/server.mjs.map +1 -1
- package/dist/{sse-schema-Df49KA7B.d.mts → sse-schema-BiUnufrI.d.mts} +12 -0
- package/dist/{sse-schema-RHckD7TS.d.ts → sse-schema-YZh7Pz7i.d.ts} +12 -0
- package/dist/styles/daily-report.standalone.css +1 -1
- package/package.json +3 -3
- package/src/client/components/daily-report-comment-item.tsx +6 -1
- package/src/client/components/daily-report-detail-list.tsx +65 -34
- package/src/client/components/daily-report-edit-form.tsx +6 -0
- package/src/client/components/daily-report-ids-stream-status.spec.tsx +93 -0
- package/src/client/components/daily-report-ids-stream-status.tsx +67 -0
- package/src/client/components/daily-report-list.tsx +88 -55
- package/src/client/components/daily-report-page.spec.tsx +119 -0
- package/src/client/components/daily-report-page.tsx +62 -69
- package/src/client/components/daily-report-resolved-content.tsx +36 -10
- package/src/client/components/report-views.spec.tsx +37 -2
- package/src/client/config-context.tsx +18 -0
- package/src/client/contexts/daily-report-action-context.spec.tsx +278 -0
- package/src/client/contexts/daily-report-action-context.tsx +203 -65
- package/src/client/contexts/daily-report-error-context.spec.tsx +66 -0
- package/src/client/contexts/daily-report-error-context.tsx +98 -0
- package/src/client/hooks/use-animated-number.spec.ts +103 -0
- package/src/client/hooks/use-animated-number.ts +69 -0
- package/src/client/hooks/use-daily-report.spec.ts +50 -2
- package/src/client/hooks/use-daily-report.ts +30 -1
- package/src/client/route-helpers.spec.ts +100 -0
- package/src/client/route-helpers.ts +20 -41
- package/src/client/streaming/daily-report-ids-stream-client.spec.ts +704 -0
- package/src/client/streaming/daily-report-ids-stream-client.ts +677 -0
- package/src/client/streaming/daily-report-ids-stream-session.spec.ts +360 -0
- package/src/client/streaming/daily-report-ids-stream-session.ts +280 -0
- package/src/client.ts +5 -0
- package/src/index.ts +1 -0
- package/src/server/handlers.action.spec.ts +44 -0
- package/src/server/handlers.ids-stream.spec.ts +414 -0
- package/src/server/handlers.ts +324 -8
- package/src/server/service.spec.ts +83 -7
- package/src/server/service.ts +100 -3
- package/src/server/test-helpers/handlers-config.ts +48 -1
- package/src/server.spec.ts +49 -0
- package/src/server.ts +7 -0
- package/src/shared/business-date.spec.ts +22 -1
- package/src/shared/business-date.ts +20 -0
- package/src/shared/comment-adapter.spec.ts +38 -0
- package/src/shared/comment-adapter.ts +9 -7
- package/src/shared/ids-stream.spec.ts +65 -0
- package/src/shared/ids-stream.ts +139 -0
- package/src/shared/sse-schema.ts +5 -0
- package/src/shared/text-utils.spec.ts +42 -0
- package/src/shared/text-utils.ts +8 -0
package/README.md
CHANGED
|
@@ -62,7 +62,8 @@ The standalone build bundles every JSX utility (and maps the shadcn tokens), but
|
|
|
62
62
|
|
|
63
63
|
## Required database schema
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
Seven tables: `DailyReportHub` (core/cross-source), `DailyReportInternal` (in-app content), `DailyReportComment`, `DailyReportLabel`, `DailyReportHub_Label`, `DailyReportUserStatus` (read status & stars), and the optional `DailyReportAttachment` (attachment metadata — omit it and the attachment feature degrades gracefully: `attachments` stays an empty array and the attachment endpoint returns 404 for every token).
|
|
66
|
+
Attachment delivery additionally requires the `attachmentIdCodec` and `readAttachment` DI ports on `createDailyReportServer` (see `DailyReportServerConfig`); the factory then exposes `dailyReportServer.attachment.loader`, which the host app must mount on its own byte-serving route (e.g. `daily_report.api.attachment.$token` — a route separate from the `:endpoint` JSON router, whose fixed `Content-Type: application/json` + CSP headers are incompatible with byte delivery).
|
|
66
67
|
|
|
67
68
|
Existing apps can inject their own drizzle models (structural typing — see `DailyReportTables`). Greenfield projects can generate definitions:
|
|
68
69
|
|
|
@@ -126,16 +127,15 @@ export const loader = (args) => dailyReportServer.sse.loader(args)
|
|
|
126
127
|
import { createDailyReportClientLoader, DailyReportPage, dailyReportShouldRevalidate } from "@aiquants/daily-report/client"
|
|
127
128
|
|
|
128
129
|
export const shouldRevalidate = dailyReportShouldRevalidate
|
|
129
|
-
export const clientLoader = createDailyReportClientLoader() //
|
|
130
|
+
export const clientLoader = createDailyReportClientLoader() // Bootstraps the module-resident ids NDJSON stream session
|
|
130
131
|
|
|
131
132
|
export default function Route() {
|
|
132
|
-
const { user, userId
|
|
133
|
+
const { user, userId } = useLoaderData<typeof clientLoader>()
|
|
133
134
|
return (
|
|
134
135
|
<YourAppLayout>
|
|
135
136
|
<DailyReportPage
|
|
136
137
|
user={user}
|
|
137
138
|
userId={userId}
|
|
138
|
-
dailyReportIds={dailyReportIds}
|
|
139
139
|
config={{
|
|
140
140
|
renderHeader: ({ title, annotation }) => <YourHeader title={title} annotation={annotation} />,
|
|
141
141
|
showDevControls: import.meta.env.DEV, // Toggle SSE subscriptions, etc.
|
|
@@ -153,9 +153,16 @@ export default function Route() {
|
|
|
153
153
|
|
|
154
154
|
`DailyReportPage` is layout-agnostic (header rendering via `renderHeader` slot, error boundaries/footer control managed by the app). For fine-grained usage, `DailyReportActionProvider`, `DailyReportResolvedContent`, `useDailyReportDetail`, etc. can be imported individually.
|
|
155
155
|
|
|
156
|
+
The report id list is **not** part of the loader data: a module-resident NDJSON stream session (`GET {apiBasePath}/ids-stream`, resilient client with cursor resume + exponential backoff) supplies it.
|
|
157
|
+
`createDailyReportClientLoader` warms an existing session (`primeDailyReportIdsStreamSession`) and then bootstraps (`bootstrapDailyReportIdsStreamSession`): when no session exists it is **created at loader time** so the stream fetch runs in parallel with hydration (the dominant cold-load optimization); when one exists, the obfuscated user id is reconciled (a different user destroys and recreates the session before render).
|
|
158
|
+
If your app overrides `config.apiBasePath`, pass the same value to `createDailyReportClientLoader({ apiBasePath })` — forgetting it costs one wrong-path request on the very first load, self-healed by the page-mount `ensureDailyReportIdsStreamSession`.
|
|
159
|
+
`DailyReportPage` subscribes via `useDailyReportIdsStream`, rendering the list as soon as the first chunk arrives (on cache misses the server races a fast `TOP 200` first page against the cached full query, so first paint does not wait for the full id scan).
|
|
160
|
+
There is no `dailyReportIds` prop and no deferred `/ids` JSON fetch (the old `ids` endpoint was removed).
|
|
161
|
+
|
|
156
162
|
### Field Labels (`fieldLabels`)
|
|
157
163
|
|
|
158
|
-
Card and detail headings (`id` / `businessDate` / `author` / `visitTime` / `createdAt` / `updatedAt` / `updatedBy` / `category` / `categoryInfo` / `creationCategory` / `customer` / `subject` / `content` / `interviewers` / `comments` / `
|
|
164
|
+
Card and detail headings (`id` / `businessDate` / `author` / `visitTime` / `createdAt` / `updatedAt` / `updatedBy` / `category` / `categoryInfo` / `creationCategory` / `customer` / `subject` / `content` / `interviewers` / `comments` / `attachments` / `attachmentMissing` / `attachmentDownload` / `tabArticle` / `tabRelations` / `relationsEmpty` — all 21 keys of `DailyReportFieldLabels`) are fully dependency-injected.
|
|
165
|
+
**The package includes neutral English defaults** (`Business date` / `Customer` / `Content`, etc.), and consuming applications override headings via `fieldLabels`. This ensures the package itself carries no domain-specific wording. Partial overrides merge deeply over defaults (`DailyReportConfigProvider` performs a 1-level deep merge).
|
|
159
166
|
|
|
160
167
|
### External Source Badge Configuration (`sourceTypeConfigs`)
|
|
161
168
|
|
|
@@ -226,7 +233,7 @@ export default defineConfig({
|
|
|
226
233
|
## API Surface (Summary)
|
|
227
234
|
|
|
228
235
|
- **server**: `createDailyReportServer` / `createDailyReportService` / `createDailyReportHandlers` / `defineDailyReportSchema` / `DailyReportSseReader` / `SqlResultCache` / `transformJsonArray` / `jsonResponseWithETag` / `generateETag` / `isStreamIdLte`
|
|
229
|
-
- **client**: `DailyReportPage` / `DailyReportResolvedContent` / `DailyReportList` / `DailyReportDetailList` / `DailyReportActionProvider` / `useDailyReportActionContext` / `useDailyReportDetail` / `useDailyReportPrefetch` / `useDailyReportComments` / `useDailyReportSseConnection` / `DailyReportConfigProvider` / `createDailyReportClientLoader` / `dailyReportShouldRevalidate`
|
|
236
|
+
- **client**: `DailyReportPage` / `DailyReportResolvedContent` / `DailyReportList` / `DailyReportDetailList` / `DailyReportActionProvider` / `useDailyReportActionContext` / `useDailyReportDetail` / `useDailyReportPrefetch` / `useDailyReportComments` / `useDailyReportSseConnection` / `useDailyReportIdsStream` / `DailyReportIdsStreamStatus` / `DailyReportIdsStreamClient` / `DailyReportConfigProvider` / `createDailyReportClientLoader` / `dailyReportShouldRevalidate`
|
|
230
237
|
- **shared**: `DailyReportItem` / `DailyReportDetail` / `DailyReportUser` / `dailyReportSseMessageSchema` (8 discriminated union types) / `normalizeBusinessDateKey` / `mergeComments`
|
|
231
238
|
|
|
232
239
|
MIT
|
package/dist/client.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, Context, RefObject } from 'react';
|
|
3
3
|
import { ScrollBarThumbOverlayRenderProps, ScrollPaneInertiaOptions, ScrollBarTapCircleOptions } from '@aiquants/virtualscroll';
|
|
4
4
|
import { D as DailyReportAttachmentSummary, a as DailyReportItem, b as DailyReportDetail, c as DailyReportUser } from './types-Ct1ggzy-.mjs';
|
|
5
|
-
import { U as UIComment, D as DailyReportSseMessage } from './sse-schema-
|
|
5
|
+
import { U as UIComment, D as DailyReportSseMessage } from './sse-schema-BiUnufrI.mjs';
|
|
6
6
|
import { ShouldRevalidateFunction } from 'react-router';
|
|
7
7
|
import 'zod';
|
|
8
8
|
|
|
@@ -107,10 +107,14 @@ type DailyReportEditFormProps = {
|
|
|
107
107
|
};
|
|
108
108
|
declare const DailyReportEditForm: ({ report, onCancel, onPublishSuccess }: DailyReportEditFormProps) => react.JSX.Element;
|
|
109
109
|
|
|
110
|
+
/**
|
|
111
|
+
* Renders the streaming progress / recovery badge for the ids stream.
|
|
112
|
+
* ids ストリームの進捗・復旧バッジを描画するコンポーネント。
|
|
113
|
+
*/
|
|
114
|
+
declare const DailyReportIdsStreamStatus: () => react.JSX.Element | null;
|
|
115
|
+
|
|
110
116
|
type DailyReportListProps = {
|
|
111
117
|
dailyReportItems: DailyReportItem[];
|
|
112
|
-
initialSelectedBusinessDate?: string | null;
|
|
113
|
-
initialSelectedReportHubId?: number | null;
|
|
114
118
|
autoMarkRead?: boolean;
|
|
115
119
|
selectedReportHubId: number | null;
|
|
116
120
|
onSelectItem: (reportHubId: number | null) => void;
|
|
@@ -122,7 +126,7 @@ type DailyReportListProps = {
|
|
|
122
126
|
* Daily report list cards with key metadata and preview content via virtual scrolling.
|
|
123
127
|
* 主なメタデータと内容プレビューを仮想スクロール表示する日報リスト。
|
|
124
128
|
*/
|
|
125
|
-
declare const DailyReportList: ({ dailyReportItems,
|
|
129
|
+
declare const DailyReportList: ({ dailyReportItems, autoMarkRead, selectedReportHubId, onSelectItem, userId, initialScrollOffset, onScrollOffsetChange }: DailyReportListProps) => react.JSX.Element;
|
|
126
130
|
|
|
127
131
|
/** ヘッダー描画スロットに渡される引数。 */
|
|
128
132
|
type DailyReportHeaderProps = {
|
|
@@ -161,6 +165,18 @@ type DailyReportFieldLabels = {
|
|
|
161
165
|
tabRelations: string;
|
|
162
166
|
relationsEmpty: string;
|
|
163
167
|
};
|
|
168
|
+
/**
|
|
169
|
+
* Mutation-failure notification payload (for a host-supplied error surface).
|
|
170
|
+
* ミューテーション失敗の通知情報 (ホストが独自の通知 UI を出すための口)。
|
|
171
|
+
*/
|
|
172
|
+
type DailyReportErrorInfo = {
|
|
173
|
+
/** 失敗した操作の種別 (create / update / publish / delete / addComment / deleteComment / toggleStar / toggleRead)。 */
|
|
174
|
+
operation: string;
|
|
175
|
+
/** 表示用のメッセージ (パッケージ内蔵バナー用)。 */
|
|
176
|
+
message: string;
|
|
177
|
+
/** 元例外 (診断用)。 */
|
|
178
|
+
cause?: unknown;
|
|
179
|
+
};
|
|
164
180
|
/** データソースごとのバッジ表示設定。 */
|
|
165
181
|
type SourceTypeConfig = {
|
|
166
182
|
label: string;
|
|
@@ -186,6 +202,11 @@ type DailyReportClientConfig = {
|
|
|
186
202
|
renderHeader: (props: DailyReportHeaderProps) => ReactNode;
|
|
187
203
|
/** 開発向けコントロール (SSE 購読トグル等) を表示するか。 */
|
|
188
204
|
showDevControls: boolean;
|
|
205
|
+
/**
|
|
206
|
+
* ミューテーション失敗時の通知ポート。未指定ならパッケージ内蔵の role="alert"
|
|
207
|
+
* バナーで表示する。ホストが独自トースト等を持つ場合はここへ委譲する。
|
|
208
|
+
*/
|
|
209
|
+
onError?: (info: DailyReportErrorInfo) => void;
|
|
189
210
|
};
|
|
190
211
|
/**
|
|
191
212
|
* Partial client-config override. `fieldLabels` may itself be partially overridden.
|
|
@@ -219,13 +240,15 @@ declare const useDailyReportConfig: () => DailyReportClientConfig;
|
|
|
219
240
|
declare const resolveSourceTypeConfig: (sourceType?: string | null, sourceTypeConfigs?: Record<string, SourceTypeConfig>) => SourceTypeConfig | undefined;
|
|
220
241
|
|
|
221
242
|
/**
|
|
222
|
-
* Error display
|
|
223
|
-
*
|
|
243
|
+
* Error display when the ids stream terminally failed before any data arrived.
|
|
244
|
+
* データ未受信のまま ID ストリームが力尽きたときのエラー表示コンポーネント。
|
|
245
|
+
*
|
|
246
|
+
* 再試行はストリームセッションの retry へ直結する (受信済みカーソルから再開)。
|
|
224
247
|
*/
|
|
225
248
|
declare const DailyReportLoadError: () => react.JSX.Element;
|
|
226
249
|
/**
|
|
227
|
-
*
|
|
228
|
-
*
|
|
250
|
+
* Loading screen shown only until the first stream chunk arrives.
|
|
251
|
+
* 最初のストリームチャンクが届くまでの間だけ表示するローディング画面。
|
|
229
252
|
*/
|
|
230
253
|
declare const DailyReportLoading: () => react.JSX.Element;
|
|
231
254
|
type DailyReportPageProps = {
|
|
@@ -233,8 +256,6 @@ type DailyReportPageProps = {
|
|
|
233
256
|
user?: DailyReportUser;
|
|
234
257
|
/** 難読化済みの内部ユーザー ID (未登録ユーザーは null)。 */
|
|
235
258
|
userId?: string | null;
|
|
236
|
-
/** clientLoader で defer した日報 ID 一覧 (Promise) または解決済み配列。 */
|
|
237
|
-
dailyReportIds?: Promise<DailyReportItem[]> | DailyReportItem[] | null;
|
|
238
259
|
/** クライアント設定の部分上書き (ヘッダー描画・パス・ラベル名・フィールドラベルなど)。 */
|
|
239
260
|
config?: DailyReportClientConfigInput;
|
|
240
261
|
};
|
|
@@ -245,14 +266,15 @@ type DailyReportPageProps = {
|
|
|
245
266
|
declare const DailyReportPage: ({ config, ...rest }: DailyReportPageProps) => react.JSX.Element;
|
|
246
267
|
|
|
247
268
|
type DailyReportResolvedContentProps = {
|
|
248
|
-
dailyReportItems: DailyReportItem[];
|
|
249
269
|
userId?: string | null;
|
|
250
270
|
};
|
|
251
271
|
/**
|
|
252
|
-
* Displays
|
|
253
|
-
*
|
|
272
|
+
* Displays streamed daily reports with layout and tabbed virtual scroll views.
|
|
273
|
+
* レイアウトとタブ付き仮想スクロールでストリーム受信済み日報を表示するコンポーネント。
|
|
274
|
+
*
|
|
275
|
+
* アイテムは Action Context (ストリームチャンクをマージ済み) から読む。
|
|
254
276
|
*/
|
|
255
|
-
declare const DailyReportResolvedContent: ({
|
|
277
|
+
declare const DailyReportResolvedContent: ({ userId }: DailyReportResolvedContentProps) => react.JSX.Element;
|
|
256
278
|
|
|
257
279
|
type UnreadIndicatorProps = {
|
|
258
280
|
className?: string;
|
|
@@ -343,6 +365,35 @@ declare const DailyReportActionProvider: ({ children, user, initialItems, userId
|
|
|
343
365
|
userId?: string | null;
|
|
344
366
|
}) => react.JSX.Element;
|
|
345
367
|
|
|
368
|
+
type DailyReportErrorSurface = {
|
|
369
|
+
/** ミューテーション失敗を通知する。 */
|
|
370
|
+
notifyError: (info: DailyReportErrorInfo) => void;
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* Returns the error-surface API (safe no-op outside the provider).
|
|
374
|
+
* 通知 API を返す処理 (Provider 外では no-op)。
|
|
375
|
+
*/
|
|
376
|
+
declare const useDailyReportErrorSurface: () => DailyReportErrorSurface;
|
|
377
|
+
/**
|
|
378
|
+
* Provides the mutation error surface and renders the default alert banner.
|
|
379
|
+
* ミューテーション通知シームを供給し、既定のアラートバナーを描画するプロバイダー。
|
|
380
|
+
*
|
|
381
|
+
* `config.onError` があればホストへ委譲し、内蔵バナーは描画しない (二重表示防止)。
|
|
382
|
+
*/
|
|
383
|
+
declare const DailyReportErrorProvider: ({ children }: {
|
|
384
|
+
children: ReactNode;
|
|
385
|
+
}) => react.JSX.Element;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Animates numeric changes with ease-out cubic.
|
|
389
|
+
* 数値変化をイーズアウト 3 次で補間するフック。
|
|
390
|
+
*
|
|
391
|
+
* @param value Target value. 目標値。
|
|
392
|
+
* @param durationMs Animation duration. アニメーション時間 (既定 250ms)。
|
|
393
|
+
* @returns Displayed (interpolated) value. 表示用の補間値。
|
|
394
|
+
*/
|
|
395
|
+
declare const useAnimatedNumber: (value: number, durationMs?: number) => number;
|
|
396
|
+
|
|
346
397
|
type CacheEntry<T> = {
|
|
347
398
|
data: T;
|
|
348
399
|
expiresAt: number;
|
|
@@ -451,7 +502,21 @@ declare const registerRecentDeletion: (cId: number) => Map<number, number>;
|
|
|
451
502
|
* 解除関数を返す。
|
|
452
503
|
*/
|
|
453
504
|
declare const subscribeCacheReady: (reportHubId: number, callback: () => void) => (() => void);
|
|
454
|
-
declare const applyDailyReportServerUpdates: (
|
|
505
|
+
declare const applyDailyReportServerUpdates: (_reportHubId: number, report: DailyReportDetail) => void;
|
|
506
|
+
/**
|
|
507
|
+
* Applies a broadcast (cross-user SSE) report while preserving the viewer's own per-viewer state.
|
|
508
|
+
* 全ユーザー放送 (SSE) の report を、受信者自身の per-viewer 状態を保持したまま反映する処理。
|
|
509
|
+
*
|
|
510
|
+
* SSE の report-create/update/publish が運ぶ isRead/isStarred は**操作した本人の状態**。
|
|
511
|
+
* そのまま書くと受信者の既読/スター表示が他人の状態で上書きされる。共有フィールドだけを
|
|
512
|
+
* 取り込み、per-viewer フィールドは受信者のキャッシュ値を保持する。ローカルに無い日報は
|
|
513
|
+
* 種まきしない (送信者の per-viewer 値で汚すより、次のフェッチが受信者視点の正しい値を
|
|
514
|
+
* 取るのに任せるほうが安全)。
|
|
515
|
+
*
|
|
516
|
+
* ❗ 信頼できる経路 (自分の HTTP 応答・recipient フィルタ済みの自分宛 status-update) は
|
|
517
|
+
* {@link applyDailyReportServerUpdates} を使うこと — そちらは値をそのまま書く。
|
|
518
|
+
*/
|
|
519
|
+
declare const applyBroadcastReportUpdate: (report: DailyReportDetail) => void;
|
|
455
520
|
type DailyReportDetailResource = {
|
|
456
521
|
report: DailyReportDetail | null;
|
|
457
522
|
error: Error | null;
|
|
@@ -538,13 +603,17 @@ declare const useDynamicViewportHeight: (containerRef: RefObject<HTMLDivElement
|
|
|
538
603
|
*/
|
|
539
604
|
declare const dailyReportShouldRevalidate: ShouldRevalidateFunction;
|
|
540
605
|
/**
|
|
541
|
-
*
|
|
542
|
-
*
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
*
|
|
547
|
-
*
|
|
606
|
+
* Creates a React Router clientLoader that bootstraps the ids stream session.
|
|
607
|
+
* ID ストリームセッションを起動する React Router clientLoader を生成する処理。
|
|
608
|
+
*
|
|
609
|
+
* ID 一覧は Promise で返さず、モジュール常駐のストリームセッションが供給する
|
|
610
|
+
* (ページ側は `useDailyReportIdsStream` で購読する)。ローダー時点でセッションを
|
|
611
|
+
* 生成することが**コールドロードの最重要最適化** — ページマウントの effect まで
|
|
612
|
+
* 遅らせると、ストリームの開始が「ハイドレーション完了 + effect flush」の後ろに
|
|
613
|
+
* 直列化される。再訪 (セッション既存) は serverLoader を待たずに鮮度確認を先行させる。
|
|
614
|
+
*
|
|
615
|
+
* `config.apiBasePath` を上書きするアプリは同じ値を `options.apiBasePath` にも渡すこと
|
|
616
|
+
* (渡し忘れは初回 1 回だけ誤パス生成 → ページマウントの ensure が自己修復する)。
|
|
548
617
|
*
|
|
549
618
|
* 返す関数へ `hydrate = true as const` を付与済み (初期ハイドレーションでも実行される)。
|
|
550
619
|
*/
|
|
@@ -553,12 +622,355 @@ declare const createDailyReportClientLoader: <TServerData extends Record<string,
|
|
|
553
622
|
}) => {
|
|
554
623
|
(args: {
|
|
555
624
|
serverLoader: () => Promise<unknown>;
|
|
556
|
-
}): Promise<TServerData
|
|
557
|
-
dailyReportIds: Promise<DailyReportItem[]>;
|
|
558
|
-
}>;
|
|
625
|
+
}): Promise<TServerData>;
|
|
559
626
|
hydrate: true;
|
|
560
627
|
};
|
|
561
628
|
|
|
629
|
+
/** ストリームのライフサイクル局面。 */
|
|
630
|
+
type DailyReportIdsStreamPhase = "idle" | "streaming" | "retrying" | "complete" | "failed" | "auth-required";
|
|
631
|
+
/** publish されるスナップショット。publish 間で参照が安定している。 */
|
|
632
|
+
type DailyReportIdsStreamState = {
|
|
633
|
+
/** 受信済みアイテム (reportHubId で重複排除済み)。 */
|
|
634
|
+
items: DailyReportItem[];
|
|
635
|
+
/** 一意アイテム件数 (`items.length` と同値。表示用の別名)。 */
|
|
636
|
+
loadedCount: number;
|
|
637
|
+
/** サーバー申告の全体件数。先頭行未着なら null。 */
|
|
638
|
+
totalCount: number | null;
|
|
639
|
+
/** ライフサイクル局面。 */
|
|
640
|
+
phase: DailyReportIdsStreamPhase;
|
|
641
|
+
/** complete 後のバックグラウンド再検証が走っているか。 */
|
|
642
|
+
isRevalidating: boolean;
|
|
643
|
+
/** 一度でも完走したか (再検証中の UI 判定に使う)。 */
|
|
644
|
+
hasCompletedOnce: boolean;
|
|
645
|
+
/**
|
|
646
|
+
* 直近の「実際の完走」時刻 (未完走は null)。鮮度判定 (SWR 窓) の唯一の根拠。
|
|
647
|
+
* 完走の publish でのみ更新される — 再検証の諦めなど phase が complete のままの
|
|
648
|
+
* publish で更新すると、古いデータが新鮮扱いされ再検証が永久に走らなくなる。
|
|
649
|
+
*/
|
|
650
|
+
completedAt: number | null;
|
|
651
|
+
/** 直近の失敗 (成功で null に戻る)。 */
|
|
652
|
+
error: Error | null;
|
|
653
|
+
};
|
|
654
|
+
/** テスト注入用の依存一式。 */
|
|
655
|
+
type DailyReportIdsStreamClientOptions = {
|
|
656
|
+
/** API ベースパス (既定 `/daily_report/api`)。 */
|
|
657
|
+
apiBasePath?: string;
|
|
658
|
+
/** fetch 実装 (既定 globalThis.fetch)。 */
|
|
659
|
+
fetchFn?: (input: string, init: {
|
|
660
|
+
signal: AbortSignal;
|
|
661
|
+
headers: Record<string, string>;
|
|
662
|
+
cache: RequestCache;
|
|
663
|
+
}) => Promise<Response>;
|
|
664
|
+
/** タイマー実装 (既定 setTimeout / clearTimeout)。 */
|
|
665
|
+
setTimeoutFn?: (handler: () => void, ms: number) => ReturnType<typeof setTimeout>;
|
|
666
|
+
clearTimeoutFn?: (id: ReturnType<typeof setTimeout>) => void;
|
|
667
|
+
/**
|
|
668
|
+
* 1 回の read が無音でいられる上限 (ms)。0 以下で無効。
|
|
669
|
+
* これを超えたら接続を half-open とみなして中断し、retryable として
|
|
670
|
+
* カーソル再開へ倒す。サーバーのハートビート間隔より必ず長く取る
|
|
671
|
+
* (生きているが遅いだけの全量クエリ待ちを誤って切らないため)。
|
|
672
|
+
*/
|
|
673
|
+
readStallTimeoutMs?: number;
|
|
674
|
+
/** 警告ロガー (既定 console.warn)。 */
|
|
675
|
+
warn?: (...args: unknown[]) => void;
|
|
676
|
+
/**
|
|
677
|
+
* チャンク由来 publish の合体窓 (ms)。0 で無効 (毎チャンク即時 publish)。
|
|
678
|
+
* 高速回線ではネットワーク read が密集し、publish ごとに全件ソート + 全行再レンダーが
|
|
679
|
+
* 走るため、先頭は即時 (初回描画優先)・後続は窓内で合体するスロットルを掛ける。
|
|
680
|
+
* 完走 publish と外部ミューテーション (ユーザー操作の即時フィードバック) は対象外。
|
|
681
|
+
*/
|
|
682
|
+
publishCoalesceMs?: number;
|
|
683
|
+
};
|
|
684
|
+
/**
|
|
685
|
+
* NDJSON ids stream client with dedupe, cursor resume, and exponential backoff.
|
|
686
|
+
* 重複排除・カーソル再開・指数バックオフを備えた NDJSON ids ストリームクライアント。
|
|
687
|
+
*/
|
|
688
|
+
declare class DailyReportIdsStreamClient {
|
|
689
|
+
private readonly apiBasePath;
|
|
690
|
+
private readonly fetchFn;
|
|
691
|
+
private readonly setTimeoutFn;
|
|
692
|
+
private readonly clearTimeoutFn;
|
|
693
|
+
private readonly warn;
|
|
694
|
+
/** 1 回の read が無音でいられる上限 (ms)。0 以下で無効。 */
|
|
695
|
+
private readonly readStallTimeoutMs;
|
|
696
|
+
/** reportHubId → アイテム。挿入順を保ち、再開の重複到着を吸収する。 */
|
|
697
|
+
private readonly itemMap;
|
|
698
|
+
private readonly listeners;
|
|
699
|
+
private state;
|
|
700
|
+
private lastCursor;
|
|
701
|
+
private consecutiveFailures;
|
|
702
|
+
private started;
|
|
703
|
+
private disposed;
|
|
704
|
+
/** 実行中ループの世代。refresh/dispose で進め、旧ループの続行を無効化する。 */
|
|
705
|
+
private loopGeneration;
|
|
706
|
+
private activeAbortController;
|
|
707
|
+
/**
|
|
708
|
+
* 先頭 (cursor 無し) から始まった走査で観測した ID の集合。
|
|
709
|
+
* 完走時にこの集合へ含まれない Map エントリを剪定し、サーバー側で削除された
|
|
710
|
+
* 日報がモジュール常駐データに永久残留するのを防ぐ。途中失敗のカーソル再開は
|
|
711
|
+
* 同じ走査の続きなので集合を引き継ぐ (全区間の和 = サーバーの全量)。
|
|
712
|
+
*/
|
|
713
|
+
private activeSeenIds;
|
|
714
|
+
/**
|
|
715
|
+
* 外部削除のトゥームストーン。サーバーは配列全体を先に確定させてから送出するため、
|
|
716
|
+
* 走査中に届いた削除の後、同じ削除前スナップショットの後続チャンクが同 ID を
|
|
717
|
+
* 再配送してくる。これを吸収せずに素通しすると、削除済み日報が Map へ戻り
|
|
718
|
+
* 完走剪定も免れてしまう (観測集合に再記録されるため)。新しい走査の開始
|
|
719
|
+
* (削除コミット後のスナップショット) でクリアする。
|
|
720
|
+
*/
|
|
721
|
+
private readonly externalRemovalTombstones;
|
|
722
|
+
/**
|
|
723
|
+
* 走行中の再検証中に届いた明示的キャッシュバイパス要求の持ち越しフラグ。
|
|
724
|
+
* 走行中の再検証は中断しない方針のため、要求を黙って捨てず完走後に連結実行する。
|
|
725
|
+
*/
|
|
726
|
+
private pendingForceRefresh;
|
|
727
|
+
private wakeRetryWait;
|
|
728
|
+
private readonly handleOnline;
|
|
729
|
+
/** チャンク由来 publish の合体窓 (ms)。 */
|
|
730
|
+
private readonly publishCoalesceMs;
|
|
731
|
+
/** 合体窓のトレーリングタイマー。 */
|
|
732
|
+
private publishCoalesceTimer;
|
|
733
|
+
/** 直近のアイテム publish 時刻 (leading edge 判定用)。 */
|
|
734
|
+
private lastItemsPublishAt;
|
|
735
|
+
constructor(options?: DailyReportIdsStreamClientOptions);
|
|
736
|
+
/**
|
|
737
|
+
* Returns the current snapshot (stable reference between publishes).
|
|
738
|
+
* 現在のスナップショットを返す処理 (publish 間で参照が安定)。
|
|
739
|
+
*/
|
|
740
|
+
getState(): DailyReportIdsStreamState;
|
|
741
|
+
/**
|
|
742
|
+
* Subscribes to snapshot updates.
|
|
743
|
+
* スナップショット更新の購読を登録する処理。
|
|
744
|
+
*
|
|
745
|
+
* @param listener Change callback. 変更通知コールバック。
|
|
746
|
+
* @returns Unsubscribe function. 購読解除関数。
|
|
747
|
+
*/
|
|
748
|
+
subscribe(listener: () => void): () => void;
|
|
749
|
+
/**
|
|
750
|
+
* Starts the initial stream (idempotent).
|
|
751
|
+
* 初回ストリーミングを開始する処理 (冪等)。
|
|
752
|
+
*/
|
|
753
|
+
start(): void;
|
|
754
|
+
/**
|
|
755
|
+
* Restarts after a terminal failure (no-op unless phase is "failed").
|
|
756
|
+
* failed からの手動再開処理 (failed 以外では何もしない)。
|
|
757
|
+
*
|
|
758
|
+
* 受信済みデータと再開カーソルは保持したまま続きから読む。
|
|
759
|
+
*/
|
|
760
|
+
retry(): void;
|
|
761
|
+
/**
|
|
762
|
+
* Revalidates a completed stream in the background (SWR-style).
|
|
763
|
+
* 完走済みストリームをバックグラウンドで再検証する処理 (SWR)。
|
|
764
|
+
*
|
|
765
|
+
* カーソルを捨てて先頭から読み直し、Map の重複排除で差分を上書き吸収し、
|
|
766
|
+
* 完走時に「今回の走査で観測されなかった行」を剪定する (サーバー側削除の反映)。
|
|
767
|
+
* failed のときはカーソルを保持した再開に切り替える (forceRefresh 指定は失わない)。
|
|
768
|
+
* streaming/retrying 中は何もしない。
|
|
769
|
+
*
|
|
770
|
+
* @param options.forceRefresh サーバー側 SqlResultCache をバイパスするか。
|
|
771
|
+
*/
|
|
772
|
+
refresh(options?: {
|
|
773
|
+
forceRefresh?: boolean;
|
|
774
|
+
}): void;
|
|
775
|
+
/**
|
|
776
|
+
* Applies an externally-known upsert (SSE / local mutation) to the resident data.
|
|
777
|
+
* 外部由来 (SSE / ローカル操作) の upsert を常駐データへ反映する処理。
|
|
778
|
+
*
|
|
779
|
+
* これを欠くと、マウント中に作成された日報がストリームセッションに存在せず、
|
|
780
|
+
* 鮮度窓内の再訪 (再検証なし) で一覧から消える。アクティブな走査中は観測集合にも
|
|
781
|
+
* 刻み、完走時の剪定で「生きていると分かっている行」を誤って落とさないようにする。
|
|
782
|
+
*/
|
|
783
|
+
applyExternalUpsert(item: DailyReportItem): void;
|
|
784
|
+
/**
|
|
785
|
+
* Applies an externally-known removal (SSE report-delete / stale valve) to the resident data.
|
|
786
|
+
* 外部由来 (SSE report-delete / stale 安全弁) の削除を常駐データへ反映する処理。
|
|
787
|
+
*
|
|
788
|
+
* 走査中の後続チャンク (削除前スナップショット) による同一行の再配送は、
|
|
789
|
+
* クライアント側トゥームストーンが次の新しい走査までブロックする。
|
|
790
|
+
*/
|
|
791
|
+
applyExternalRemoval(reportHubId: number): void;
|
|
792
|
+
/**
|
|
793
|
+
* Aborts everything and detaches listeners (terminal).
|
|
794
|
+
* すべてを中断しリスナーを外す終了処理 (以後再利用不可)。
|
|
795
|
+
*/
|
|
796
|
+
dispose(): void;
|
|
797
|
+
/**
|
|
798
|
+
* Connection-retry loop: stream → classify → backoff → resume.
|
|
799
|
+
* 接続リトライループ。ストリーム → 結果分類 → バックオフ → カーソル再開。
|
|
800
|
+
*/
|
|
801
|
+
private runStreamLoop;
|
|
802
|
+
/**
|
|
803
|
+
* Prunes map entries not observed by the completed full scan.
|
|
804
|
+
* 完走した全量走査で観測されなかった Map エントリを剪定する処理。
|
|
805
|
+
*
|
|
806
|
+
* サーバー側で削除された日報の残留 (再訪時の亡霊復活・loadedCount > totalCount) を防ぐ。
|
|
807
|
+
* 観測集合が無い場合 (理論上到達しない防御) は何も消さない。
|
|
808
|
+
*/
|
|
809
|
+
private pruneUnseenItems;
|
|
810
|
+
/**
|
|
811
|
+
* Runs one streaming attempt and classifies its outcome.
|
|
812
|
+
* 1 回のストリーミング試行を実行し、結末を分類する処理。
|
|
813
|
+
*/
|
|
814
|
+
private streamOnce;
|
|
815
|
+
/**
|
|
816
|
+
* Reads one chunk, racing the read against a stall watchdog.
|
|
817
|
+
* 1 チャンクを読む処理。読み取りを stall ウォッチドッグと競争させる。
|
|
818
|
+
*
|
|
819
|
+
* サーバーが無音のまま接続を half-open で放置しても (NAT/プロキシのアイドル切断・
|
|
820
|
+
* VPN 断・スリープ)、`reader.read()` は永久に保留したままになる。これを検知するため
|
|
821
|
+
* read とタイマーを競争させ、無音が上限を超えたら番兵を返す。生きているが遅いだけの
|
|
822
|
+
* 全量クエリ待ちはサーバーのハートビート (空行) が read を解決するので誤検知しない。
|
|
823
|
+
* `readStallTimeoutMs <= 0` のときは素の read (タイマーを張らない・テスト用)。
|
|
824
|
+
*
|
|
825
|
+
* @returns 読み取り結果、または stall を表す番兵。read の reject はそのまま伝播する。
|
|
826
|
+
*/
|
|
827
|
+
private readWithStallGuard;
|
|
828
|
+
/**
|
|
829
|
+
* Merges chunk items into the dedupe map.
|
|
830
|
+
* チャンクのアイテム群を重複排除 Map へ取り込む処理。
|
|
831
|
+
*
|
|
832
|
+
* @returns True when anything was added or changed. 追加または内容変化があれば true。
|
|
833
|
+
*/
|
|
834
|
+
private absorbChunkItems;
|
|
835
|
+
/** アイテム配列を再スナップショットして即時 publish する。 */
|
|
836
|
+
private publishItems;
|
|
837
|
+
/**
|
|
838
|
+
* チャンク由来のアイテム publish をスロットルする (leading edge 即時 + trailing 合体)。
|
|
839
|
+
* 最初のチャンクは即時に描画へ届け、窓内に密集した後続チャンクは 1 回の publish
|
|
840
|
+
* (= 1 回の全件ソートと再レンダー) へ合体する。合体窓 0 は無効 (常に即時)。
|
|
841
|
+
*/
|
|
842
|
+
private schedulePublishItems;
|
|
843
|
+
/** 保留中のトレーリング publish を破棄する (完走 publish が全量を運ぶ場合など)。 */
|
|
844
|
+
private cancelScheduledPublishItems;
|
|
845
|
+
/** 部分状態をマージした新スナップショットを作り、購読者へ通知する。 */
|
|
846
|
+
private publish;
|
|
847
|
+
/** 再開カーソル付きのストリーム URL を構築する。 */
|
|
848
|
+
private buildStreamUrl;
|
|
849
|
+
/**
|
|
850
|
+
* バックオフ待機。online イベント・dispose・後続ループの開始で早期解除される。
|
|
851
|
+
*
|
|
852
|
+
* タイマー ID は待機ごとのローカルに閉じ、共有スロット (wakeRetryWait) は
|
|
853
|
+
* 「まだ自分を指しているときだけ」外す。単一スロットへ素朴に書くと、
|
|
854
|
+
* 追い越された旧待機の finish が新しいループのタイマーを消してしまい、
|
|
855
|
+
* 再検証が永久に固まる (実測済みの競合)。
|
|
856
|
+
*/
|
|
857
|
+
private waitBeforeRetry;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Full-document reload indirection (mockable seam for auth-expiry tests).
|
|
862
|
+
* ドキュメント全体を再読込する間接層 (認証切れテストで差し替え可能にする継ぎ目)。
|
|
863
|
+
*/
|
|
864
|
+
declare const reloadDocument: () => void;
|
|
865
|
+
/**
|
|
866
|
+
* Ensures a stream session for the given user, creating/refreshing as needed.
|
|
867
|
+
* 指定ユーザーのストリームセッションを確立する処理 (必要に応じ生成/再検証)。
|
|
868
|
+
*
|
|
869
|
+
* - ユーザーまたは API パスが変わっていれば作り直す (別ユーザーのデータを見せない)。
|
|
870
|
+
* - failed なら自動 retry (再訪 = ユーザーの再試行意思とみなす)。
|
|
871
|
+
* - 完走から {@link REVALIDATE_AFTER_MS} 経過していればバックグラウンド再検証。
|
|
872
|
+
*
|
|
873
|
+
* SSR では何もしない。clientLoader とページマウントの両方から呼ばれ、冪等。
|
|
874
|
+
*
|
|
875
|
+
* @param options.apiBasePath API ベースパス (config の apiBasePath)。
|
|
876
|
+
* @param options.userKey 難読化ユーザー ID (未登録ユーザーは null)。
|
|
877
|
+
*/
|
|
878
|
+
declare const ensureDailyReportIdsStreamSession: (options: {
|
|
879
|
+
apiBasePath?: string;
|
|
880
|
+
userKey: string | null;
|
|
881
|
+
}) => void;
|
|
882
|
+
/**
|
|
883
|
+
* Bootstraps the session from the clientLoader: create when absent, else reconcile.
|
|
884
|
+
* clientLoader からのセッション起動処理。不在なら生成、既存なら照合と鮮度確認。
|
|
885
|
+
*
|
|
886
|
+
* コールドロードの最重要ゲート対策: 生成をページマウントの effect まで遅らせると、
|
|
887
|
+
* ストリームの最初のバイト要求が「serverLoader 完了 → ハイドレーション → effect flush」
|
|
888
|
+
* の後ろに直列化される。ローダー時点で生成すればハイドレーションと並行してフェッチが走る。
|
|
889
|
+
*
|
|
890
|
+
* パス契約: 生成時のパスは factory オプション (未指定は既定値へ正規化)。
|
|
891
|
+
* `config.apiBasePath` だけを上書きした利用者では初回のみ誤パスで生成されるが、
|
|
892
|
+
* ページマウント側の ensure がパス不一致を検知して作り直す (自己修復・初回 1 回きり)。
|
|
893
|
+
* **既存セッションのパスはここでは照合しない** — 照合すると、factory 未指定 ×
|
|
894
|
+
* config 上書きの組み合わせでナビゲーションごとにセッションが破棄されるスラッシングになる。
|
|
895
|
+
*
|
|
896
|
+
* @param options.apiBasePath 生成時に使う API ベースパス (未指定は既定値)。
|
|
897
|
+
* @param options.userKey 難読化ユーザー ID (未登録ユーザーは null)。
|
|
898
|
+
*/
|
|
899
|
+
declare const bootstrapDailyReportIdsStreamSession: (options: {
|
|
900
|
+
apiBasePath?: string;
|
|
901
|
+
userKey: string | null;
|
|
902
|
+
}) => void;
|
|
903
|
+
/**
|
|
904
|
+
* Kicks a freshness check for an existing session before the user is known.
|
|
905
|
+
* ユーザー確定前に既存セッションの鮮度確認だけを先行させる処理。
|
|
906
|
+
*
|
|
907
|
+
* clientLoader が serverLoader を await する前に呼び、再訪 (支配的経路) の
|
|
908
|
+
* 再検証開始を数十〜数百 ms 前倒しする。セッションが無ければ何もしない
|
|
909
|
+
* (誰のデータを読むべきか分からないため)。直後の reconcile が userKey を照合し、
|
|
910
|
+
* ユーザーが変わっていればセッションごと破棄されるので先行は安全。
|
|
911
|
+
* 走行中の再検証は中断しない (runFreshnessCheck の isRevalidating ガード)。
|
|
912
|
+
*/
|
|
913
|
+
declare const primeDailyReportIdsStreamSession: () => void;
|
|
914
|
+
/**
|
|
915
|
+
* Relays an externally-known item upsert into the resident stream data.
|
|
916
|
+
* 外部由来のアイテム upsert を常駐ストリームデータへ中継する処理。
|
|
917
|
+
*
|
|
918
|
+
* プロバイダーの作成/公開系ミューテーション (ローカル操作と SSE) から呼ばれる。
|
|
919
|
+
* これを欠くと、鮮度窓内の再訪で「作成したばかりの日報が消える」。
|
|
920
|
+
*/
|
|
921
|
+
declare const upsertDailyReportIdsStreamItem: (item: DailyReportItem) => void;
|
|
922
|
+
/**
|
|
923
|
+
* Relays an externally-known item removal into the resident stream data.
|
|
924
|
+
* 外部由来のアイテム削除を常駐ストリームデータへ中継する処理。
|
|
925
|
+
*
|
|
926
|
+
* report-delete SSE・ローカル削除・stale 安全弁から呼ばれる。
|
|
927
|
+
* これを欠くと、鮮度窓内の再訪で「削除したはずの日報が蘇る」。
|
|
928
|
+
*/
|
|
929
|
+
declare const removeDailyReportIdsStreamItem: (reportHubId: number) => void;
|
|
930
|
+
/**
|
|
931
|
+
* Restarts a failed stream (UI retry button entry point).
|
|
932
|
+
* failed ストリームを再開する処理 (UI の再試行ボタン入口)。
|
|
933
|
+
*/
|
|
934
|
+
declare const retryDailyReportIdsStream: () => void;
|
|
935
|
+
/**
|
|
936
|
+
* Re-validates the stream, optionally bypassing the server-side cache.
|
|
937
|
+
* ストリームを再検証する処理 (サーバーキャッシュのバイパス指定可)。
|
|
938
|
+
*
|
|
939
|
+
* 開発向けリロード/キャッシュクリアボタンから呼ばれる。
|
|
940
|
+
*
|
|
941
|
+
* @param options.forceRefresh サーバー側 SqlResultCache をバイパスするか。
|
|
942
|
+
*/
|
|
943
|
+
declare const refreshDailyReportIdsStream: (options?: {
|
|
944
|
+
forceRefresh?: boolean;
|
|
945
|
+
}) => void;
|
|
946
|
+
/**
|
|
947
|
+
* Returns the current session's owner key (undefined when no session exists).
|
|
948
|
+
* 現行セッションの持ち主 (userKey) を返す処理 (セッション不在時は undefined)。
|
|
949
|
+
*
|
|
950
|
+
* 遅延解決するミューテーション継続の門番に使う。POST /action の待機中にリロード無しの
|
|
951
|
+
* ユーザー切替が起きると、切替時の三重遮断 (セッション破棄 + 詳細キャッシュ破棄 +
|
|
952
|
+
* プロバイダーリマウント) の**後**に旧ユーザーの継続が解決し、モジュール常駐状態
|
|
953
|
+
* (新ユーザーのセッション・詳細キャッシュ) へ旧ユーザーのデータを注入してしまう。
|
|
954
|
+
* 継続側は開始時点の userKey とこの値を比較し、不一致 (undefined 含む) なら
|
|
955
|
+
* モジュール常駐状態への書き込みを放棄する (fail-closed)。
|
|
956
|
+
*/
|
|
957
|
+
declare const getDailyReportIdsStreamSessionUserKey: () => string | null | undefined;
|
|
958
|
+
/**
|
|
959
|
+
* React binding for the module-resident ids stream session.
|
|
960
|
+
* モジュール常駐 ids ストリームセッションの React バインディング。
|
|
961
|
+
*
|
|
962
|
+
* セッションが後から生成されても再購読なしで追従する (リスナーはセッションではなく
|
|
963
|
+
* モジュールに属する)。スナップショット参照は publish 単位で安定している。
|
|
964
|
+
*
|
|
965
|
+
* @returns Current stream state. 現在のストリーム状態。
|
|
966
|
+
*/
|
|
967
|
+
declare const useDailyReportIdsStream: () => DailyReportIdsStreamState;
|
|
968
|
+
/**
|
|
969
|
+
* Destroys the session (test isolation helper).
|
|
970
|
+
* セッションを破棄するテスト用ヘルパー。
|
|
971
|
+
*/
|
|
972
|
+
declare const resetDailyReportIdsStreamSessionForTesting: () => void;
|
|
973
|
+
|
|
562
974
|
/**
|
|
563
975
|
* Shared constants for Daily Report data fetching parameters.
|
|
564
976
|
* 日報データ取得で利用する共通パラメーター。
|
|
@@ -622,4 +1034,4 @@ declare const TAP_SCROLL_CIRCLE_OPTIONS: ScrollBarTapCircleOptions;
|
|
|
622
1034
|
*/
|
|
623
1035
|
declare const CONTENT_DRAG_POINTER_INPUTS: readonly ["pen", "touch"];
|
|
624
1036
|
|
|
625
|
-
export { BusinessDayThumbOverlay, CONTENT_DRAG_POINTER_INPUTS, DAILY_REPORT_FETCH_DEBOUNCE_MS, DEFAULT_ITEM_HEIGHT, DailyReportActionProvider, DailyReportAttachmentIndicator, DailyReportAttachmentList, DailyReportCache, type DailyReportClientConfig, type DailyReportClientConfigInput, DailyReportCommentForm, DailyReportCommentItem, DailyReportCommentList, DailyReportConfigProvider, DailyReportDetailList, type DailyReportDetailResource, DailyReportEditForm, type DailyReportFieldLabels, type DailyReportHeaderProps, DailyReportList, DailyReportLoadError, DailyReportLoading, DailyReportPage, type DailyReportPageProps, DailyReportResolvedContent, EMPTY_DETAIL, EMPTY_ITEM, FAST_SCROLL_INERTIA_OPTIONS, FAST_SCROLL_WHEEL_MULTIPLIER, ITEM_CONTAINER_HEIGHT, ITEM_VERTICAL_PADDING, MAX_PREVIEW_LINES, PREFETCH_LOOKAHEAD, PREFETCH_MAX_DATES, SCROLL_BAR_WIDTH, type SourceTypeConfig, TAP_SCROLL_CIRCLE_OPTIONS, UnreadIndicator, VIRTUAL_SCROLL_OVERSCAN_COUNT, WHEEL_RESET_TIMEOUT_MS, acquireMutationLock, applyDailyReportServerUpdates, clearDailyReportCache, createDailyReportClientLoader, dailyReportShouldRevalidate, defaultDailyReportClientConfig, defaultDailyReportFieldLabels, deleteDailyReportCache,
|
|
1037
|
+
export { BusinessDayThumbOverlay, CONTENT_DRAG_POINTER_INPUTS, DAILY_REPORT_FETCH_DEBOUNCE_MS, DEFAULT_ITEM_HEIGHT, type DailyReportActionContextType, DailyReportActionProvider, DailyReportAttachmentIndicator, DailyReportAttachmentList, DailyReportCache, type DailyReportClientConfig, type DailyReportClientConfigInput, DailyReportCommentForm, DailyReportCommentItem, DailyReportCommentList, DailyReportConfigProvider, DailyReportDetailList, type DailyReportDetailResource, DailyReportEditForm, type DailyReportErrorInfo, DailyReportErrorProvider, type DailyReportFieldLabels, type DailyReportHeaderProps, DailyReportIdsStreamClient, type DailyReportIdsStreamClientOptions, type DailyReportIdsStreamPhase, type DailyReportIdsStreamState, DailyReportIdsStreamStatus, DailyReportList, DailyReportLoadError, DailyReportLoading, DailyReportPage, type DailyReportPageProps, DailyReportResolvedContent, EMPTY_DETAIL, EMPTY_ITEM, FAST_SCROLL_INERTIA_OPTIONS, FAST_SCROLL_WHEEL_MULTIPLIER, ITEM_CONTAINER_HEIGHT, ITEM_VERTICAL_PADDING, MAX_PREVIEW_LINES, PREFETCH_LOOKAHEAD, PREFETCH_MAX_DATES, SCROLL_BAR_WIDTH, type SourceTypeConfig, TAP_SCROLL_CIRCLE_OPTIONS, UnreadIndicator, VIRTUAL_SCROLL_OVERSCAN_COUNT, WHEEL_RESET_TIMEOUT_MS, acquireMutationLock, applyBroadcastReportUpdate, applyDailyReportServerUpdates, bootstrapDailyReportIdsStreamSession, clearDailyReportCache, createDailyReportClientLoader, dailyReportShouldRevalidate, defaultDailyReportClientConfig, defaultDailyReportFieldLabels, deleteDailyReportCache, ensureDailyReportIdsStreamSession, getCachedReport, getDailyReportIdsStreamSessionUserKey, primeDailyReportIdsStreamSession, refreshDailyReportIdsStream, registerRecentDeletion, releaseMutationLock, reloadDocument, removeDailyReportIdsStreamItem, resetDailyReportIdsStreamSessionForTesting, resolveSourceTypeConfig, retryDailyReportIdsStream, subscribeCacheReady, updateDailyReportCache, upsertDailyReportIdsStreamItem, useAnimatedNumber, useDailyReportActionContext, useDailyReportComments, useDailyReportConfig, useDailyReportDetail, useDailyReportErrorSurface, useDailyReportIdsStream, useDailyReportPrefetch, useDailyReportSseConnection, useDynamicViewportHeight, writeCache };
|