@aiquants/daily-report 0.18.0 → 0.18.2
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 +2 -2
- package/dist/client.d.mts +6 -3
- package/dist/client.d.ts +6 -3
- package/dist/client.js +5 -5
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +5 -5
- package/dist/client.mjs.map +1 -1
- package/dist/server.d.mts +17 -7
- package/dist/server.d.ts +17 -7
- package/dist/server.js +10 -10
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +10 -10
- package/dist/server.mjs.map +1 -1
- package/dist/styles/daily-report.standalone.css +1 -1
- package/package.json +6 -4
- package/src/client/components/daily-report-list.tsx +199 -80
- package/src/client/components/daily-report-resize-panels.spec.tsx +305 -0
- package/src/client/hooks/use-responsive-layout.ts +34 -27
- package/src/server/handlers.ts +218 -176
- package/src/server/handlers.unauthorized-cookie.spec.ts +187 -0
- package/src/server/ports.ts +6 -1
- package/src/server/service.spec.ts +1 -1
- package/src/server/test-helpers/handlers-config.ts +16 -3
- package/src/server.spec.ts +7 -7
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ export const dailyReportServer = createDailyReportServer({
|
|
|
86
86
|
userTable: Users, // { id, displayName }
|
|
87
87
|
resolveUserId: async (externalId) => {/* External ID (e.g., OAuth sub) -> internal numeric ID */},
|
|
88
88
|
encodeUserId: (id) => encodeId(id), // Internal ID obfuscation (e.g. sqids)
|
|
89
|
-
authenticate: authenticateInLoader, // (
|
|
89
|
+
authenticate: authenticateInLoader, // DailyReportAuthenticate (overloaded): string mode => { user, cookie? } / null mode => { user?, cookie? }
|
|
90
90
|
redis: redisProvider as unknown as DailyReportRedisProvider, // Optional (disables SSE/epoch)
|
|
91
91
|
externalSources: [ // Optional: ingest legacy daily report tables from external systems
|
|
92
92
|
{ sourceType: "legacy", table: LegacyReport, idColumn: LegacyReport.reportId, mapRow: mapLegacyRow },
|
|
@@ -113,7 +113,7 @@ export const loader = (args) => dailyReportServer.sse.loader(args)
|
|
|
113
113
|
|
|
114
114
|
### DI ports
|
|
115
115
|
|
|
116
|
-
- `authenticate(request, { failureRedirect })` — Session verification
|
|
116
|
+
- `authenticate(request, { failureRedirect })` — Session verification, declared as the overloaded `DailyReportAuthenticate`. With `failureRedirect: string` the implementation must throw a redirect on unauthenticated requests, so a normal return always carries `user` (typed as required — leaving it optional would force callers to write an unreachable `!user` guard). With `failureRedirect: null` it must not redirect and resolves without `user` instead; forward the returned `cookie` on unauthenticated responses too, otherwise a destroyed session lingers in the browser.
|
|
117
117
|
- `resolveUserId(externalId)` — External ID → internal numeric ID (`null` = unregistered). In-process caching can be disabled with `disableUserIdCache` (useful for testing).
|
|
118
118
|
- `encodeUserId(id)` — Obfuscates IDs sent to the client. Inject app-level implementation to preserve existing ID namespaces.
|
|
119
119
|
- `redis` — `getClient()` (get/incr/xAdd/xRange/xRevRange) + `createClient()` (blocking xRead). Structurally matches a `node-redis` v5 client. If omitted, SSE publishing is skipped (with a warning) and epoch is disabled.
|
package/dist/client.d.mts
CHANGED
|
@@ -139,6 +139,10 @@ declare const DailyReportEditForm: ({ report, onCancel, onPublishSuccess }: Dail
|
|
|
139
139
|
*/
|
|
140
140
|
declare const DailyReportIdsStreamStatus: () => react.JSX.Element | null;
|
|
141
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Props for the DailyReportList component.
|
|
144
|
+
* DailyReportList コンポーネントのプロパティ型定義。
|
|
145
|
+
*/
|
|
142
146
|
type DailyReportListProps = {
|
|
143
147
|
dailyReportItems: DailyReportItem[];
|
|
144
148
|
autoMarkRead?: boolean;
|
|
@@ -146,11 +150,10 @@ type DailyReportListProps = {
|
|
|
146
150
|
onSelectItem: (reportHubId: number | null) => void;
|
|
147
151
|
userId?: string | null;
|
|
148
152
|
/**
|
|
153
|
+
* Shared slot to preserve scroll position across unmounted tab switches.
|
|
149
154
|
* タブ切替 (アンマウント) をまたいでスクロール位置を持ち回る共有スロット。
|
|
150
|
-
* 値は VirtualScroll
|
|
155
|
+
* 値は VirtualScroll の論理座標 (inset 非依存。onScroll が配信する座標系)。
|
|
151
156
|
* マウント時に一度だけ読み、スクロールのたびに書き戻す。
|
|
152
|
-
* ❗ 値をレンダー時に読んで props へ焼き込む方式は禁止: 非制御タブでは親が
|
|
153
|
-
* 再レンダーされず、復帰マウントに古い値が渡る (実測で再現した実害バグ)
|
|
154
157
|
*/
|
|
155
158
|
scrollOffsetRef?: RefObject<number>;
|
|
156
159
|
};
|
package/dist/client.d.ts
CHANGED
|
@@ -139,6 +139,10 @@ declare const DailyReportEditForm: ({ report, onCancel, onPublishSuccess }: Dail
|
|
|
139
139
|
*/
|
|
140
140
|
declare const DailyReportIdsStreamStatus: () => react.JSX.Element | null;
|
|
141
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Props for the DailyReportList component.
|
|
144
|
+
* DailyReportList コンポーネントのプロパティ型定義。
|
|
145
|
+
*/
|
|
142
146
|
type DailyReportListProps = {
|
|
143
147
|
dailyReportItems: DailyReportItem[];
|
|
144
148
|
autoMarkRead?: boolean;
|
|
@@ -146,11 +150,10 @@ type DailyReportListProps = {
|
|
|
146
150
|
onSelectItem: (reportHubId: number | null) => void;
|
|
147
151
|
userId?: string | null;
|
|
148
152
|
/**
|
|
153
|
+
* Shared slot to preserve scroll position across unmounted tab switches.
|
|
149
154
|
* タブ切替 (アンマウント) をまたいでスクロール位置を持ち回る共有スロット。
|
|
150
|
-
* 値は VirtualScroll
|
|
155
|
+
* 値は VirtualScroll の論理座標 (inset 非依存。onScroll が配信する座標系)。
|
|
151
156
|
* マウント時に一度だけ読み、スクロールのたびに書き戻す。
|
|
152
|
-
* ❗ 値をレンダー時に読んで props へ焼き込む方式は禁止: 非制御タブでは親が
|
|
153
|
-
* 再レンダーされず、復帰マウントに古い値が渡る (実測で再現した実害バグ)
|
|
154
157
|
*/
|
|
155
158
|
scrollOffsetRef?: RefObject<number>;
|
|
156
159
|
};
|