@aiquants/daily-report 0.1.1
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/LICENSE +21 -0
- package/README.md +150 -0
- package/dist/client.d.mts +449 -0
- package/dist/client.d.ts +449 -0
- package/dist/client.js +7 -0
- package/dist/client.js.map +1 -0
- package/dist/client.mjs +7 -0
- package/dist/client.mjs.map +1 -0
- package/dist/index.d.mts +42 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/logger-D3krZrNK.d.mts +29 -0
- package/dist/logger-D3krZrNK.d.ts +29 -0
- package/dist/server.d.mts +1515 -0
- package/dist/server.d.ts +1515 -0
- package/dist/server.js +10 -0
- package/dist/server.js.map +1 -0
- package/dist/server.mjs +10 -0
- package/dist/server.mjs.map +1 -0
- package/dist/sse-schema-CK7cUnEo.d.ts +1986 -0
- package/dist/sse-schema-yl5AaSsj.d.mts +1986 -0
- package/dist/types-CVhwLhSN.d.mts +76 -0
- package/dist/types-CVhwLhSN.d.ts +76 -0
- package/package.json +108 -0
- package/src/client/components/business-day-thumb-overlay.tsx +19 -0
- package/src/client/components/daily-report-comment-item.tsx +81 -0
- package/src/client/components/daily-report-comment-section.tsx +166 -0
- package/src/client/components/daily-report-detail-list.tsx +676 -0
- package/src/client/components/daily-report-edit-form.tsx +81 -0
- package/src/client/components/daily-report-list.tsx +1024 -0
- package/src/client/components/daily-report-page.tsx +147 -0
- package/src/client/components/daily-report-resolved-content.tsx +139 -0
- package/src/client/components/unread-indicator.tsx +13 -0
- package/src/client/config-context.tsx +129 -0
- package/src/client/contexts/daily-report-action-context.tsx +910 -0
- package/src/client/hooks/use-daily-report-comments.ts +73 -0
- package/src/client/hooks/use-daily-report-sse-connection.ts +86 -0
- package/src/client/hooks/use-daily-report.spec.ts +155 -0
- package/src/client/hooks/use-daily-report.ts +426 -0
- package/src/client/hooks/use-dynamic-viewport-height.ts +127 -0
- package/src/client/route-helpers.ts +76 -0
- package/src/client/ui/button.tsx +42 -0
- package/src/client/ui/cn.ts +14 -0
- package/src/client/ui/input.tsx +21 -0
- package/src/client/ui/label.tsx +16 -0
- package/src/client/ui/switch.tsx +19 -0
- package/src/client/ui/tabs.tsx +40 -0
- package/src/client/ui/textarea.tsx +19 -0
- package/src/client/utils/constants.ts +29 -0
- package/src/client.ts +21 -0
- package/src/index.ts +10 -0
- package/src/server/cache.ts +165 -0
- package/src/server/etag.ts +18 -0
- package/src/server/external-source.ts +60 -0
- package/src/server/handlers.ts +543 -0
- package/src/server/ports.ts +68 -0
- package/src/server/response.ts +37 -0
- package/src/server/schema.ts +266 -0
- package/src/server/service.spec.ts +97 -0
- package/src/server/service.ts +1308 -0
- package/src/server/sse-reader.spec.ts +55 -0
- package/src/server/sse-reader.ts +223 -0
- package/src/server.ts +83 -0
- package/src/shared/business-date.spec.ts +61 -0
- package/src/shared/business-date.ts +84 -0
- package/src/shared/comment-adapter.ts +78 -0
- package/src/shared/logger.ts +47 -0
- package/src/shared/sse-schema.ts +147 -0
- package/src/shared/text-utils.ts +57 -0
- package/src/shared/types.ts +76 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export { D as DailyReportSseMessage, U as UIComment, c as commentAddMessageSchema, a as commentDeleteMessageSchema, b as connectedMessageSchema, d as dailyReportCommentItemSchema, e as dailyReportCommentSchema, f as dailyReportDetailSchema, g as dailyReportInterviewerSchema, h as dailyReportLabelDefSchema, i as dailyReportSseMessageSchema, m as mergeComments, r as reportCreateMessageSchema, j as reportDeleteMessageSchema, k as reportPublishMessageSchema, l as reportUpdateMessageSchema, n as resolveCommentColorClass, s as statusUpdateMessageSchema } from './sse-schema-yl5AaSsj.mjs';
|
|
2
|
+
export { D as DailyReportLogger, L as LogLevel, c as createLogger } from './logger-D3krZrNK.mjs';
|
|
3
|
+
export { c as DailyReportComment, d as DailyReportCommentItem, a as DailyReportDetail, e as DailyReportInterviewer, D as DailyReportItem, f as DailyReportLabelDef, b as DailyReportUser } from './types-CVhwLhSN.mjs';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Business date normalization and formatting helper functions.
|
|
8
|
+
* 営業日の正規化とフォーマットを支援するユーティリティ群。
|
|
9
|
+
*/
|
|
10
|
+
type BusinessDateInput = string | Date | null | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Normalizes business date input into YYYY-MM-DD format string.
|
|
13
|
+
* 営業日を YYYY-MM-DD 形式の文字列へ正規化する。
|
|
14
|
+
*/
|
|
15
|
+
declare const normalizeBusinessDateKey: (value: BusinessDateInput) => string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Converts normalized business date into display format YYYY-MM-DD.
|
|
18
|
+
* 正規化済みの営業日を YYYY-MM-DD 形式の表示文字列へ変換する。
|
|
19
|
+
*/
|
|
20
|
+
declare const formatBusinessDateDisplay: (value: BusinessDateInput) => string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Parses normalized business date into Date object.
|
|
23
|
+
* 正規化した営業日を Date オブジェクトへ変換する。
|
|
24
|
+
*/
|
|
25
|
+
declare const parseBusinessDateKeyToDate: (value: BusinessDateInput) => Date | null;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Shared text helpers for daily report view components.
|
|
29
|
+
* 日報ビューコンポーネント向けの共通テキストヘルパー。
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Normalizes nullable text by trimming whitespace and applying fallback.
|
|
33
|
+
* null 許容の文字列をトリムしつつフォールバック値を適用する関数。
|
|
34
|
+
*/
|
|
35
|
+
declare const fallbackText: (value: string | null | undefined) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Formats a date string to ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss).
|
|
38
|
+
* 日付文字列を ISO 8601 形式 (YYYY-MM-DD または YYYY-MM-DDTHH:mm:ss) に整形する関数。
|
|
39
|
+
*/
|
|
40
|
+
declare const formatToIsoDate: (value: unknown) => string;
|
|
41
|
+
|
|
42
|
+
export { fallbackText, formatBusinessDateDisplay, formatToIsoDate, normalizeBusinessDateKey, parseBusinessDateKeyToDate };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export { D as DailyReportSseMessage, U as UIComment, c as commentAddMessageSchema, a as commentDeleteMessageSchema, b as connectedMessageSchema, d as dailyReportCommentItemSchema, e as dailyReportCommentSchema, f as dailyReportDetailSchema, g as dailyReportInterviewerSchema, h as dailyReportLabelDefSchema, i as dailyReportSseMessageSchema, m as mergeComments, r as reportCreateMessageSchema, j as reportDeleteMessageSchema, k as reportPublishMessageSchema, l as reportUpdateMessageSchema, n as resolveCommentColorClass, s as statusUpdateMessageSchema } from './sse-schema-CK7cUnEo.js';
|
|
2
|
+
export { D as DailyReportLogger, L as LogLevel, c as createLogger } from './logger-D3krZrNK.js';
|
|
3
|
+
export { c as DailyReportComment, d as DailyReportCommentItem, a as DailyReportDetail, e as DailyReportInterviewer, D as DailyReportItem, f as DailyReportLabelDef, b as DailyReportUser } from './types-CVhwLhSN.js';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Business date normalization and formatting helper functions.
|
|
8
|
+
* 営業日の正規化とフォーマットを支援するユーティリティ群。
|
|
9
|
+
*/
|
|
10
|
+
type BusinessDateInput = string | Date | null | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Normalizes business date input into YYYY-MM-DD format string.
|
|
13
|
+
* 営業日を YYYY-MM-DD 形式の文字列へ正規化する。
|
|
14
|
+
*/
|
|
15
|
+
declare const normalizeBusinessDateKey: (value: BusinessDateInput) => string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Converts normalized business date into display format YYYY-MM-DD.
|
|
18
|
+
* 正規化済みの営業日を YYYY-MM-DD 形式の表示文字列へ変換する。
|
|
19
|
+
*/
|
|
20
|
+
declare const formatBusinessDateDisplay: (value: BusinessDateInput) => string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Parses normalized business date into Date object.
|
|
23
|
+
* 正規化した営業日を Date オブジェクトへ変換する。
|
|
24
|
+
*/
|
|
25
|
+
declare const parseBusinessDateKeyToDate: (value: BusinessDateInput) => Date | null;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Shared text helpers for daily report view components.
|
|
29
|
+
* 日報ビューコンポーネント向けの共通テキストヘルパー。
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Normalizes nullable text by trimming whitespace and applying fallback.
|
|
33
|
+
* null 許容の文字列をトリムしつつフォールバック値を適用する関数。
|
|
34
|
+
*/
|
|
35
|
+
declare const fallbackText: (value: string | null | undefined) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Formats a date string to ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss).
|
|
38
|
+
* 日付文字列を ISO 8601 形式 (YYYY-MM-DD または YYYY-MM-DDTHH:mm:ss) に整形する関数。
|
|
39
|
+
*/
|
|
40
|
+
declare const formatToIsoDate: (value: unknown) => string;
|
|
41
|
+
|
|
42
|
+
export { fallbackText, formatBusinessDateDisplay, formatToIsoDate, normalizeBusinessDateKey, parseBusinessDateKeyToDate };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var U=(n,t)=>{for(var o in t)m(n,o,{get:t[o],enumerable:!0})},z=(n,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $(t))!j.call(n,s)&&s!==o&&m(n,s,{get:()=>t[s],enumerable:!(i=M(t,s))||i.enumerable});return n};var B=n=>z(m({},"__esModule",{value:!0}),n);var Y={};U(Y,{LogLevel:()=>g,commentAddMessageSchema:()=>x,commentDeleteMessageSchema:()=>S,connectedMessageSchema:()=>D,createLogger:()=>G,dailyReportCommentItemSchema:()=>u,dailyReportCommentSchema:()=>y,dailyReportDetailSchema:()=>a,dailyReportInterviewerSchema:()=>b,dailyReportLabelDefSchema:()=>f,dailyReportSseMessageSchema:()=>K,fallbackText:()=>W,formatBusinessDateDisplay:()=>E,formatToIsoDate:()=>T,mergeComments:()=>O,normalizeBusinessDateKey:()=>l,parseBusinessDateKeyToDate:()=>P,reportCreateMessageSchema:()=>w,reportDeleteMessageSchema:()=>C,reportPublishMessageSchema:()=>R,reportUpdateMessageSchema:()=>h,resolveCommentColorClass:()=>F,statusUpdateMessageSchema:()=>I});module.exports=B(Y);var H=/^\d{4}-\d{2}-\d{2}$/,_=/^\d{4}\/\d{2}\/\d{2}$/,p=n=>n<10?`0${n}`:`${n}`,d=n=>{if(Number.isNaN(n.getTime()))return null;let t=n.getFullYear(),o=p(n.getMonth()+1),i=p(n.getDate());return`${t}-${o}-${i}`},l=n=>{if(n==null)return null;if(n instanceof Date)return d(n);let t=n.trim();if(t==="")return null;if(H.test(t))return t;if(_.test(t))return t.replaceAll("/","-");let o=new Date(t);return d(o)},E=n=>{let t=l(n);return t||null},P=n=>{let t=l(n);if(!t)return null;let[o,i,s]=t.split("-").map(r=>Number.parseInt(r,10));return[o,i,s].some(r=>Number.isNaN(r))?null:new Date(o,i-1,s)};var O=(n,t,o)=>{let i=n.map((r,c)=>({id:`legacy-${c}`,authorName:r.name||"Unknown",content:r.text||"",isMine:!1,color:r.color||void 0,isLegacy:!0})),s=t.map(r=>({id:r.id,authorName:r.userName,content:r.content,createdAt:r.createdAt,isMine:o?r.userId===o:r.isMine,isLegacy:!1}));return[...i,...s]},F=n=>{if(!n)return"text-gray-700";let t=n.toLowerCase();return t.includes("red")||t.includes("\u8D64")?"text-red-600":t.includes("green")||t.includes("\u7DD1")?"text-green-600":t.includes("blue")||t.includes("\u9752")?"text-blue-600":t.includes("yellow")||t.includes("\u9EC4")?"text-yellow-600":t.includes("orange")||t.includes("\u6A59")?"text-orange-500":"text-gray-700"};var g=(r=>(r[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r[r.NONE=4]="NONE",r))(g||{}),G=(n,t,o=console)=>{let i=s=>typeof s=="string"?[`${t} ${s}`]:[t,s];return{debug:(s,...r)=>{n<=0&&o.debug(...i(s),...r)},info:(s,...r)=>{n<=1&&o.info(...i(s),...r)},warn:(s,...r)=>{n<=2&&o.warn(...i(s),...r)},error:(s,...r)=>{n<=3&&o.error(...i(s),...r)}}};var e=require("zod"),b=e.z.object({name:e.z.string(),affiliation:e.z.string().nullable()}),y=e.z.object({name:e.z.string().nullable(),text:e.z.string().nullable(),color:e.z.string().nullable()}),f=e.z.object({id:e.z.number(),name:e.z.string(),color:e.z.string().nullable()}),u=e.z.object({id:e.z.number(),userId:e.z.string(),userName:e.z.string(),content:e.z.string(),createdAt:e.z.string(),isMine:e.z.boolean()}),a=e.z.object({reportHubId:e.z.number(),date:e.z.string().nullable(),createdAt:e.z.string().nullable(),author:e.z.string(),userId:e.z.string(),employeeName:e.z.string().nullable(),updatedBy:e.z.string().nullable(),updatedAt:e.z.string().nullable(),category:e.z.string().nullable(),creationCategory:e.z.string().nullable(),visitTimeFrom:e.z.string().nullable(),visitTimeTo:e.z.string().nullable(),customerName:e.z.string().nullable(),interviewers:e.z.array(b),subject:e.z.string().nullable(),content:e.z.string().nullable(),comments:e.z.array(y),isRead:e.z.boolean(),isStarred:e.z.boolean(),labels:e.z.array(f),commentItems:e.z.array(u)}),D=e.z.object({type:e.z.literal("connected")}),I=e.z.object({type:e.z.literal("status-update"),reportHubId:e.z.number(),statusType:e.z.enum(["star","read"]),value:e.z.boolean(),clientTempId:e.z.string(),recipientRawUserId:e.z.number().optional()}),x=e.z.object({type:e.z.literal("comment-add"),reportHubId:e.z.number(),comment:u,clientTempId:e.z.string()}),S=e.z.object({type:e.z.literal("comment-delete"),reportHubId:e.z.number(),commentId:e.z.number(),clientTempId:e.z.string()}),w=e.z.object({type:e.z.literal("report-create"),reportHubId:e.z.number(),report:a,clientTempId:e.z.string(),recipientRawUserId:e.z.number().optional()}),h=e.z.object({type:e.z.literal("report-update"),reportHubId:e.z.number(),report:a,clientTempId:e.z.string(),recipientRawUserId:e.z.number().optional()}),R=e.z.object({type:e.z.literal("report-publish"),reportHubId:e.z.number(),report:a,clientTempId:e.z.string()}),C=e.z.object({type:e.z.literal("report-delete"),reportHubId:e.z.number(),clientTempId:e.z.string()}),K=e.z.discriminatedUnion("type",[D,I,x,S,w,h,R,C]);var W=n=>{if(!n)return"-";let t=n.trim();return t===""?"-":t},T=n=>{if(!n)return"-";if(typeof n!="string")return n instanceof Date?T(n.toISOString()):String(n);let t=n.trim();if(t==="")return"-";let o=new Date(t);if(Number.isNaN(o.getTime()))return t;let i=o.getFullYear(),s=String(o.getMonth()+1).padStart(2,"0"),r=String(o.getDate()).padStart(2,"0");if(t.includes(":")||t.includes("T")){let N=String(o.getHours()).padStart(2,"0"),k=String(o.getMinutes()).padStart(2,"0"),A=String(o.getSeconds()).padStart(2,"0");return`${i}-${s}-${r}T${N}:${k}:${A}`}return`${i}-${s}-${r}`};0&&(module.exports={LogLevel,commentAddMessageSchema,commentDeleteMessageSchema,connectedMessageSchema,createLogger,dailyReportCommentItemSchema,dailyReportCommentSchema,dailyReportDetailSchema,dailyReportInterviewerSchema,dailyReportLabelDefSchema,dailyReportSseMessageSchema,fallbackText,formatBusinessDateDisplay,formatToIsoDate,mergeComments,normalizeBusinessDateKey,parseBusinessDateKeyToDate,reportCreateMessageSchema,reportDeleteMessageSchema,reportPublishMessageSchema,reportUpdateMessageSchema,resolveCommentColorClass,statusUpdateMessageSchema});
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/shared/business-date.ts","../src/shared/comment-adapter.ts","../src/shared/logger.ts","../src/shared/sse-schema.ts","../src/shared/text-utils.ts"],"sourcesContent":["/**\n * Shared (isomorphic) entry of @aiquants/daily-report: types, SSE schemas, and pure utilities.\n * @aiquants/daily-report の共有 (isomorphic) エントリ。型・SSE スキーマ・純粋ユーティリティを公開。\n */\nexport * from \"./shared/business-date\"\nexport * from \"./shared/comment-adapter\"\nexport * from \"./shared/logger\"\nexport * from \"./shared/sse-schema\"\nexport * from \"./shared/text-utils\"\nexport * from \"./shared/types\"\n","/**\n * Business date normalization and formatting helper functions.\n * 営業日の正規化とフォーマットを支援するユーティリティ群。\n */\n\ntype BusinessDateInput = string | Date | null | undefined\n\nconst ISO_DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/\nconst SLASH_DATE_PATTERN = /^\\d{4}\\/\\d{2}\\/\\d{2}$/\n\nconst zeroPad = (value: number): string => {\n return value < 10 ? `0${value}` : `${value}`\n}\n\nconst normalizeFromDate = (value: Date): string | null => {\n if (Number.isNaN(value.getTime())) {\n return null\n }\n\n const year = value.getFullYear()\n const month = zeroPad(value.getMonth() + 1)\n const day = zeroPad(value.getDate())\n return `${year}-${month}-${day}`\n}\n\n/**\n * Normalizes business date input into YYYY-MM-DD format string.\n * 営業日を YYYY-MM-DD 形式の文字列へ正規化する。\n */\nexport const normalizeBusinessDateKey = (value: BusinessDateInput): string | null => {\n if (value === null || value === undefined) {\n return null\n }\n\n if (value instanceof Date) {\n return normalizeFromDate(value)\n }\n\n const trimmed = value.trim()\n if (trimmed === \"\") {\n return null\n }\n\n if (ISO_DATE_PATTERN.test(trimmed)) {\n return trimmed\n }\n\n if (SLASH_DATE_PATTERN.test(trimmed)) {\n return trimmed.replaceAll(\"/\", \"-\")\n }\n\n const parsed = new Date(trimmed)\n return normalizeFromDate(parsed)\n}\n\n/**\n * Converts normalized business date into display format YYYY-MM-DD.\n * 正規化済みの営業日を YYYY-MM-DD 形式の表示文字列へ変換する。\n */\nexport const formatBusinessDateDisplay = (value: BusinessDateInput): string | null => {\n const normalized = normalizeBusinessDateKey(value)\n if (!normalized) {\n return null\n }\n return normalized\n}\n\n/**\n * Parses normalized business date into Date object.\n * 正規化した営業日を Date オブジェクトへ変換する。\n */\nexport const parseBusinessDateKeyToDate = (value: BusinessDateInput): Date | null => {\n const normalized = normalizeBusinessDateKey(value)\n if (!normalized) {\n return null\n }\n\n const [year, month, day] = normalized.split(\"-\").map((part) => Number.parseInt(part, 10))\n if ([year, month, day].some((component) => Number.isNaN(component))) {\n return null\n }\n\n return new Date(year, month - 1, day)\n}\n","/**\n * Adapters merging legacy JSON comments and relational comments for the UI.\n * レガシー JSON コメントとリレーショナルコメントを UI 向けに統合するアダプタ群。\n */\nimport type { DailyReportComment, DailyReportCommentItem } from \"./types\"\n\nexport type UIComment = {\n id: string | number\n authorName: string\n content: string\n createdAt?: string\n isMine: boolean\n color?: string\n isLegacy: boolean\n}\n\n/**\n * Merges legacy JSON comments and modern relational comments into a unified UI format.\n * レガシーな JSON コメントとモダンなリレーショナルコメントを統合された UI 形式にマージする。\n */\nexport const mergeComments = (legacyComments: DailyReportComment[], modernComments: DailyReportCommentItem[], currentUserId?: string | null): UIComment[] => {\n // 1. Legacy コメントの変換\n const legacyUIComments: UIComment[] = legacyComments.map((c, index) => ({\n id: `legacy-${index}`,\n authorName: c.name || \"Unknown\",\n content: c.text || \"\",\n isMine: false,\n color: c.color || undefined,\n isLegacy: true,\n }))\n\n // 2. Modern コメントの変換\n const modernUIComments: UIComment[] = modernComments.map((c) => ({\n id: c.id,\n authorName: c.userName,\n content: c.content,\n createdAt: c.createdAt,\n isMine: currentUserId ? c.userId === currentUserId : c.isMine,\n isLegacy: false,\n }))\n\n // 3. 結合 (Legacy を先に表示)\n return [...legacyUIComments, ...modernUIComments]\n}\n\n/**\n * Resolves comment color tokens into Tailwind text classes.\n * コメント色のキーワードを Tailwind のテキストクラスに変換する関数。\n */\nexport const resolveCommentColorClass = (color: string | null | undefined): string => {\n if (!color) {\n return \"text-gray-700\"\n }\n\n const normalized = color.toLowerCase()\n\n if (normalized.includes(\"red\") || normalized.includes(\"赤\")) {\n return \"text-red-600\"\n }\n\n if (normalized.includes(\"green\") || normalized.includes(\"緑\")) {\n return \"text-green-600\"\n }\n\n if (normalized.includes(\"blue\") || normalized.includes(\"青\")) {\n return \"text-blue-600\"\n }\n\n if (normalized.includes(\"yellow\") || normalized.includes(\"黄\")) {\n return \"text-yellow-600\"\n }\n\n if (normalized.includes(\"orange\") || normalized.includes(\"橙\")) {\n return \"text-orange-500\"\n }\n\n return \"text-gray-700\"\n}\n","/**\n * Minimal level-filtered logger used internally by the daily-report package.\n * daily-report パッケージ内部で使う最小のレベルフィルタ付きロガー。\n *\n * 消費アプリのロガー実装 (console 互換の debug/info/warn/error) を注入でき、\n * 未注入時は console にフォールバックする。\n */\n\n/** 出力フィルタリング用のログレベル。 */\nexport enum LogLevel {\n DEBUG = 0,\n INFO = 1,\n WARN = 2,\n ERROR = 3,\n NONE = 4,\n}\n\n/** Console 互換のロガーインターフェース。 */\nexport interface DailyReportLogger {\n debug(message?: unknown, ...optionalParams: unknown[]): void\n info(message?: unknown, ...optionalParams: unknown[]): void\n warn(message?: unknown, ...optionalParams: unknown[]): void\n error(message?: unknown, ...optionalParams: unknown[]): void\n}\n\n/**\n * Creates a prefixed, level-filtered logger delegating to the given implementation.\n * 指定実装へ委譲するプレフィックス付き・レベルフィルタ付きロガーを生成する処理。\n */\nexport const createLogger = (level: LogLevel, prefix: string, impl: DailyReportLogger = console): DailyReportLogger => {\n // 文字列メッセージはプレフィックスを連結、それ以外は先頭引数として付加する\n const format = (message: unknown): unknown[] => (typeof message === \"string\" ? [`${prefix} ${message}`] : [prefix, message])\n return {\n debug: (message?: unknown, ...rest: unknown[]) => {\n if (level <= LogLevel.DEBUG) impl.debug(...format(message), ...rest)\n },\n info: (message?: unknown, ...rest: unknown[]) => {\n if (level <= LogLevel.INFO) impl.info(...format(message), ...rest)\n },\n warn: (message?: unknown, ...rest: unknown[]) => {\n if (level <= LogLevel.WARN) impl.warn(...format(message), ...rest)\n },\n error: (message?: unknown, ...rest: unknown[]) => {\n if (level <= LogLevel.ERROR) impl.error(...format(message), ...rest)\n },\n }\n}\n","/**\n * Zod schemas for daily-report SSE messages (client/server shared contract).\n * 日報 SSE メッセージの zod スキーマ (client / server 共有契約)。\n */\nimport { z } from \"zod\"\nimport type { DailyReportCommentItem as DeclaredComment, DailyReportDetail as DeclaredDetail } from \"./types\"\n\n// --- サブスキーマ(types.ts の型と構造的に一致させる) ---\n\nexport const dailyReportInterviewerSchema = z.object({\n name: z.string(),\n affiliation: z.string().nullable(),\n})\n\nexport const dailyReportCommentSchema = z.object({\n name: z.string().nullable(),\n text: z.string().nullable(),\n color: z.string().nullable(),\n})\n\nexport const dailyReportLabelDefSchema = z.object({\n id: z.number(),\n name: z.string(),\n color: z.string().nullable(),\n})\n\nexport const dailyReportCommentItemSchema = z.object({\n id: z.number(),\n userId: z.string(),\n userName: z.string(),\n content: z.string(),\n createdAt: z.string(),\n isMine: z.boolean(),\n})\n\nexport const dailyReportDetailSchema = z.object({\n reportHubId: z.number(),\n date: z.string().nullable(),\n createdAt: z.string().nullable(),\n author: z.string(),\n userId: z.string(),\n employeeName: z.string().nullable(),\n updatedBy: z.string().nullable(),\n updatedAt: z.string().nullable(),\n category: z.string().nullable(),\n creationCategory: z.string().nullable(),\n visitTimeFrom: z.string().nullable(),\n visitTimeTo: z.string().nullable(),\n customerName: z.string().nullable(),\n interviewers: z.array(dailyReportInterviewerSchema),\n subject: z.string().nullable(),\n content: z.string().nullable(),\n comments: z.array(dailyReportCommentSchema),\n isRead: z.boolean(),\n isStarred: z.boolean(),\n labels: z.array(dailyReportLabelDefSchema),\n commentItems: z.array(dailyReportCommentItemSchema),\n})\n\n// --- SSE メッセージスキーマ(8種) ---\n\nexport const connectedMessageSchema = z.object({\n type: z.literal(\"connected\"),\n})\n\nexport const statusUpdateMessageSchema = z.object({\n type: z.literal(\"status-update\"),\n reportHubId: z.number(),\n statusType: z.enum([\"star\", \"read\"]),\n value: z.boolean(),\n clientTempId: z.string(),\n // recipientRawUserId はサーバーサイドフィルタリング専用。\n // SSE ルートが raw JSON から取得してフィルタ後に除去する。\n // クライアントには到達しないが、サーバー側の publish で .parse() を通すため定義が必要。\n recipientRawUserId: z.number().optional(),\n})\n\nexport const commentAddMessageSchema = z.object({\n type: z.literal(\"comment-add\"),\n reportHubId: z.number(),\n comment: dailyReportCommentItemSchema,\n clientTempId: z.string(),\n})\n\nexport const commentDeleteMessageSchema = z.object({\n type: z.literal(\"comment-delete\"),\n reportHubId: z.number(),\n commentId: z.number(),\n clientTempId: z.string(),\n})\n\nexport const reportCreateMessageSchema = z.object({\n type: z.literal(\"report-create\"),\n reportHubId: z.number(),\n report: dailyReportDetailSchema,\n clientTempId: z.string(),\n recipientRawUserId: z.number().optional(),\n})\n\nexport const reportUpdateMessageSchema = z.object({\n type: z.literal(\"report-update\"),\n reportHubId: z.number(),\n report: dailyReportDetailSchema,\n clientTempId: z.string(),\n recipientRawUserId: z.number().optional(),\n})\n\nexport const reportPublishMessageSchema = z.object({\n type: z.literal(\"report-publish\"),\n reportHubId: z.number(),\n report: dailyReportDetailSchema,\n clientTempId: z.string(),\n})\n\nexport const reportDeleteMessageSchema = z.object({\n type: z.literal(\"report-delete\"),\n reportHubId: z.number(),\n clientTempId: z.string(),\n})\n\n// --- Discriminated Union ---\n\nexport const dailyReportSseMessageSchema = z.discriminatedUnion(\"type\", [\n connectedMessageSchema,\n statusUpdateMessageSchema,\n commentAddMessageSchema,\n commentDeleteMessageSchema,\n reportCreateMessageSchema,\n reportUpdateMessageSchema,\n reportPublishMessageSchema,\n reportDeleteMessageSchema,\n])\n\n// --- 型エクスポート ---\n\nexport type DailyReportSseMessage = z.infer<typeof dailyReportSseMessageSchema>\n\n// --- コンパイル時の型互換チェック ---\n// Zod推論型が既存の型定義に代入可能であることを保証する。\n// ここでエラーが出たらスキーマと types.ts がずれている。\n\ntype _AssertDetailCompat = z.infer<typeof dailyReportDetailSchema> extends DeclaredDetail ? true : never\ntype _AssertCommentCompat = z.infer<typeof dailyReportCommentItemSchema> extends DeclaredComment ? true : never\nconst _detailCheck: _AssertDetailCompat = true\nconst _commentCheck: _AssertCommentCompat = true\nvoid _detailCheck\nvoid _commentCheck\n","/**\n * Shared text helpers for daily report view components.\n * 日報ビューコンポーネント向けの共通テキストヘルパー。\n */\n\n/**\n * Normalizes nullable text by trimming whitespace and applying fallback.\n * null 許容の文字列をトリムしつつフォールバック値を適用する関数。\n */\nexport const fallbackText = (value: string | null | undefined): string => {\n if (!value) {\n return \"-\"\n }\n const trimmed = value.trim()\n return trimmed === \"\" ? \"-\" : trimmed\n}\n\n/**\n * Formats a date string to ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss).\n * 日付文字列を ISO 8601 形式 (YYYY-MM-DD または YYYY-MM-DDTHH:mm:ss) に整形する関数。\n */\nexport const formatToIsoDate = (value: unknown): string => {\n if (!value) {\n return \"-\"\n }\n if (typeof value !== \"string\") {\n // If value is not a string (e.g. Date object), try to convert it to string or handle it\n if (value instanceof Date) {\n return formatToIsoDate(value.toISOString())\n }\n return String(value)\n }\n const trimmed = value.trim()\n if (trimmed === \"\") {\n return \"-\"\n }\n\n const date = new Date(trimmed)\n if (Number.isNaN(date.getTime())) {\n return trimmed\n }\n\n const year = date.getFullYear()\n const month = String(date.getMonth() + 1).padStart(2, \"0\")\n const day = String(date.getDate()).padStart(2, \"0\")\n\n const hasTime = trimmed.includes(\":\") || trimmed.includes(\"T\")\n\n if (hasTime) {\n const hours = String(date.getHours()).padStart(2, \"0\")\n const minutes = String(date.getMinutes()).padStart(2, \"0\")\n const seconds = String(date.getSeconds()).padStart(2, \"0\")\n return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`\n }\n\n return `${year}-${month}-${day}`\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,EAAA,4BAAAC,EAAA,+BAAAC,EAAA,2BAAAC,EAAA,iBAAAC,EAAA,iCAAAC,EAA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,EACxBE,EAAQ,OAAOF,EAAK,SAAS,EAAI,CAAC,EAAE,SAAS,EAAG,GAAG,EACnDG,EAAM,OAAOH,EAAK,QAAQ,CAAC,EAAE,SAAS,EAAG,GAAG,EAIlD,GAFgBF,EAAQ,SAAS,GAAG,GAAKA,EAAQ,SAAS,GAAG,EAEhD,CACT,IAAMM,EAAQ,OAAOJ,EAAK,SAAS,CAAC,EAAE,SAAS,EAAG,GAAG,EAC/CK,EAAU,OAAOL,EAAK,WAAW,CAAC,EAAE,SAAS,EAAG,GAAG,EACnDM,EAAU,OAAON,EAAK,WAAW,CAAC,EAAE,SAAS,EAAG,GAAG,EACzD,MAAO,GAAGC,CAAI,IAAIC,CAAK,IAAIC,CAAG,IAAIC,CAAK,IAAIC,CAAO,IAAIC,CAAO,EACjE,CAEA,MAAO,GAAGL,CAAI,IAAIC,CAAK,IAAIC,CAAG,EAClC","names":["index_exports","__export","LogLevel","commentAddMessageSchema","commentDeleteMessageSchema","connectedMessageSchema","createLogger","dailyReportCommentItemSchema","dailyReportCommentSchema","dailyReportDetailSchema","dailyReportInterviewerSchema","dailyReportLabelDefSchema","dailyReportSseMessageSchema","fallbackText","formatBusinessDateDisplay","formatToIsoDate","mergeComments","normalizeBusinessDateKey","parseBusinessDateKeyToDate","reportCreateMessageSchema","reportDeleteMessageSchema","reportPublishMessageSchema","reportUpdateMessageSchema","resolveCommentColorClass","statusUpdateMessageSchema","__toCommonJS","ISO_DATE_PATTERN","SLASH_DATE_PATTERN","zeroPad","value","normalizeFromDate","year","month","day","normalizeBusinessDateKey","trimmed","parsed","formatBusinessDateDisplay","normalized","parseBusinessDateKeyToDate","part","component","mergeComments","legacyComments","modernComments","currentUserId","legacyUIComments","c","index","modernUIComments","resolveCommentColorClass","color","normalized","LogLevel","createLogger","level","prefix","impl","format","message","rest","import_zod","dailyReportInterviewerSchema","dailyReportCommentSchema","dailyReportLabelDefSchema","dailyReportCommentItemSchema","dailyReportDetailSchema","connectedMessageSchema","statusUpdateMessageSchema","commentAddMessageSchema","commentDeleteMessageSchema","reportCreateMessageSchema","reportUpdateMessageSchema","reportPublishMessageSchema","reportDeleteMessageSchema","dailyReportSseMessageSchema","fallbackText","value","trimmed","formatToIsoDate","date","year","month","day","hours","minutes","seconds"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var y=/^\d{4}-\d{2}-\d{2}$/,f=/^\d{4}\/\d{2}\/\d{2}$/,l=n=>n<10?`0${n}`:`${n}`,u=n=>{if(Number.isNaN(n.getTime()))return null;let t=n.getFullYear(),o=l(n.getMonth()+1),i=l(n.getDate());return`${t}-${o}-${i}`},c=n=>{if(n==null)return null;if(n instanceof Date)return u(n);let t=n.trim();if(t==="")return null;if(y.test(t))return t;if(f.test(t))return t.replaceAll("/","-");let o=new Date(t);return u(o)},$=n=>{let t=c(n);return t||null},j=n=>{let t=c(n);if(!t)return null;let[o,i,s]=t.split("-").map(r=>Number.parseInt(r,10));return[o,i,s].some(r=>Number.isNaN(r))?null:new Date(o,i-1,s)};var z=(n,t,o)=>{let i=n.map((r,m)=>({id:`legacy-${m}`,authorName:r.name||"Unknown",content:r.text||"",isMine:!1,color:r.color||void 0,isLegacy:!0})),s=t.map(r=>({id:r.id,authorName:r.userName,content:r.content,createdAt:r.createdAt,isMine:o?r.userId===o:r.isMine,isLegacy:!1}));return[...i,...s]},B=n=>{if(!n)return"text-gray-700";let t=n.toLowerCase();return t.includes("red")||t.includes("\u8D64")?"text-red-600":t.includes("green")||t.includes("\u7DD1")?"text-green-600":t.includes("blue")||t.includes("\u9752")?"text-blue-600":t.includes("yellow")||t.includes("\u9EC4")?"text-yellow-600":t.includes("orange")||t.includes("\u6A59")?"text-orange-500":"text-gray-700"};var D=(r=>(r[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r[r.NONE=4]="NONE",r))(D||{}),_=(n,t,o=console)=>{let i=s=>typeof s=="string"?[`${t} ${s}`]:[t,s];return{debug:(s,...r)=>{n<=0&&o.debug(...i(s),...r)},info:(s,...r)=>{n<=1&&o.info(...i(s),...r)},warn:(s,...r)=>{n<=2&&o.warn(...i(s),...r)},error:(s,...r)=>{n<=3&&o.error(...i(s),...r)}}};import{z as e}from"zod";var I=e.object({name:e.string(),affiliation:e.string().nullable()}),x=e.object({name:e.string().nullable(),text:e.string().nullable(),color:e.string().nullable()}),S=e.object({id:e.number(),name:e.string(),color:e.string().nullable()}),p=e.object({id:e.number(),userId:e.string(),userName:e.string(),content:e.string(),createdAt:e.string(),isMine:e.boolean()}),a=e.object({reportHubId:e.number(),date:e.string().nullable(),createdAt:e.string().nullable(),author:e.string(),userId:e.string(),employeeName:e.string().nullable(),updatedBy:e.string().nullable(),updatedAt:e.string().nullable(),category:e.string().nullable(),creationCategory:e.string().nullable(),visitTimeFrom:e.string().nullable(),visitTimeTo:e.string().nullable(),customerName:e.string().nullable(),interviewers:e.array(I),subject:e.string().nullable(),content:e.string().nullable(),comments:e.array(x),isRead:e.boolean(),isStarred:e.boolean(),labels:e.array(S),commentItems:e.array(p)}),w=e.object({type:e.literal("connected")}),h=e.object({type:e.literal("status-update"),reportHubId:e.number(),statusType:e.enum(["star","read"]),value:e.boolean(),clientTempId:e.string(),recipientRawUserId:e.number().optional()}),R=e.object({type:e.literal("comment-add"),reportHubId:e.number(),comment:p,clientTempId:e.string()}),C=e.object({type:e.literal("comment-delete"),reportHubId:e.number(),commentId:e.number(),clientTempId:e.string()}),T=e.object({type:e.literal("report-create"),reportHubId:e.number(),report:a,clientTempId:e.string(),recipientRawUserId:e.number().optional()}),N=e.object({type:e.literal("report-update"),reportHubId:e.number(),report:a,clientTempId:e.string(),recipientRawUserId:e.number().optional()}),k=e.object({type:e.literal("report-publish"),reportHubId:e.number(),report:a,clientTempId:e.string()}),A=e.object({type:e.literal("report-delete"),reportHubId:e.number(),clientTempId:e.string()}),O=e.discriminatedUnion("type",[w,h,R,C,T,N,k,A]);var G=n=>{if(!n)return"-";let t=n.trim();return t===""?"-":t},M=n=>{if(!n)return"-";if(typeof n!="string")return n instanceof Date?M(n.toISOString()):String(n);let t=n.trim();if(t==="")return"-";let o=new Date(t);if(Number.isNaN(o.getTime()))return t;let i=o.getFullYear(),s=String(o.getMonth()+1).padStart(2,"0"),r=String(o.getDate()).padStart(2,"0");if(t.includes(":")||t.includes("T")){let d=String(o.getHours()).padStart(2,"0"),g=String(o.getMinutes()).padStart(2,"0"),b=String(o.getSeconds()).padStart(2,"0");return`${i}-${s}-${r}T${d}:${g}:${b}`}return`${i}-${s}-${r}`};export{D as LogLevel,R as commentAddMessageSchema,C as commentDeleteMessageSchema,w as connectedMessageSchema,_ as createLogger,p as dailyReportCommentItemSchema,x as dailyReportCommentSchema,a as dailyReportDetailSchema,I as dailyReportInterviewerSchema,S as dailyReportLabelDefSchema,O as dailyReportSseMessageSchema,G as fallbackText,$ as formatBusinessDateDisplay,M as formatToIsoDate,z as mergeComments,c as normalizeBusinessDateKey,j as parseBusinessDateKeyToDate,T as reportCreateMessageSchema,A as reportDeleteMessageSchema,k as reportPublishMessageSchema,N as reportUpdateMessageSchema,B as resolveCommentColorClass,h as statusUpdateMessageSchema};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/business-date.ts","../src/shared/comment-adapter.ts","../src/shared/logger.ts","../src/shared/sse-schema.ts","../src/shared/text-utils.ts"],"sourcesContent":["/**\n * Business date normalization and formatting helper functions.\n * 営業日の正規化とフォーマットを支援するユーティリティ群。\n */\n\ntype BusinessDateInput = string | Date | null | undefined\n\nconst ISO_DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/\nconst SLASH_DATE_PATTERN = /^\\d{4}\\/\\d{2}\\/\\d{2}$/\n\nconst zeroPad = (value: number): string => {\n return value < 10 ? `0${value}` : `${value}`\n}\n\nconst normalizeFromDate = (value: Date): string | null => {\n if (Number.isNaN(value.getTime())) {\n return null\n }\n\n const year = value.getFullYear()\n const month = zeroPad(value.getMonth() + 1)\n const day = zeroPad(value.getDate())\n return `${year}-${month}-${day}`\n}\n\n/**\n * Normalizes business date input into YYYY-MM-DD format string.\n * 営業日を YYYY-MM-DD 形式の文字列へ正規化する。\n */\nexport const normalizeBusinessDateKey = (value: BusinessDateInput): string | null => {\n if (value === null || value === undefined) {\n return null\n }\n\n if (value instanceof Date) {\n return normalizeFromDate(value)\n }\n\n const trimmed = value.trim()\n if (trimmed === \"\") {\n return null\n }\n\n if (ISO_DATE_PATTERN.test(trimmed)) {\n return trimmed\n }\n\n if (SLASH_DATE_PATTERN.test(trimmed)) {\n return trimmed.replaceAll(\"/\", \"-\")\n }\n\n const parsed = new Date(trimmed)\n return normalizeFromDate(parsed)\n}\n\n/**\n * Converts normalized business date into display format YYYY-MM-DD.\n * 正規化済みの営業日を YYYY-MM-DD 形式の表示文字列へ変換する。\n */\nexport const formatBusinessDateDisplay = (value: BusinessDateInput): string | null => {\n const normalized = normalizeBusinessDateKey(value)\n if (!normalized) {\n return null\n }\n return normalized\n}\n\n/**\n * Parses normalized business date into Date object.\n * 正規化した営業日を Date オブジェクトへ変換する。\n */\nexport const parseBusinessDateKeyToDate = (value: BusinessDateInput): Date | null => {\n const normalized = normalizeBusinessDateKey(value)\n if (!normalized) {\n return null\n }\n\n const [year, month, day] = normalized.split(\"-\").map((part) => Number.parseInt(part, 10))\n if ([year, month, day].some((component) => Number.isNaN(component))) {\n return null\n }\n\n return new Date(year, month - 1, day)\n}\n","/**\n * Adapters merging legacy JSON comments and relational comments for the UI.\n * レガシー JSON コメントとリレーショナルコメントを UI 向けに統合するアダプタ群。\n */\nimport type { DailyReportComment, DailyReportCommentItem } from \"./types\"\n\nexport type UIComment = {\n id: string | number\n authorName: string\n content: string\n createdAt?: string\n isMine: boolean\n color?: string\n isLegacy: boolean\n}\n\n/**\n * Merges legacy JSON comments and modern relational comments into a unified UI format.\n * レガシーな JSON コメントとモダンなリレーショナルコメントを統合された UI 形式にマージする。\n */\nexport const mergeComments = (legacyComments: DailyReportComment[], modernComments: DailyReportCommentItem[], currentUserId?: string | null): UIComment[] => {\n // 1. Legacy コメントの変換\n const legacyUIComments: UIComment[] = legacyComments.map((c, index) => ({\n id: `legacy-${index}`,\n authorName: c.name || \"Unknown\",\n content: c.text || \"\",\n isMine: false,\n color: c.color || undefined,\n isLegacy: true,\n }))\n\n // 2. Modern コメントの変換\n const modernUIComments: UIComment[] = modernComments.map((c) => ({\n id: c.id,\n authorName: c.userName,\n content: c.content,\n createdAt: c.createdAt,\n isMine: currentUserId ? c.userId === currentUserId : c.isMine,\n isLegacy: false,\n }))\n\n // 3. 結合 (Legacy を先に表示)\n return [...legacyUIComments, ...modernUIComments]\n}\n\n/**\n * Resolves comment color tokens into Tailwind text classes.\n * コメント色のキーワードを Tailwind のテキストクラスに変換する関数。\n */\nexport const resolveCommentColorClass = (color: string | null | undefined): string => {\n if (!color) {\n return \"text-gray-700\"\n }\n\n const normalized = color.toLowerCase()\n\n if (normalized.includes(\"red\") || normalized.includes(\"赤\")) {\n return \"text-red-600\"\n }\n\n if (normalized.includes(\"green\") || normalized.includes(\"緑\")) {\n return \"text-green-600\"\n }\n\n if (normalized.includes(\"blue\") || normalized.includes(\"青\")) {\n return \"text-blue-600\"\n }\n\n if (normalized.includes(\"yellow\") || normalized.includes(\"黄\")) {\n return \"text-yellow-600\"\n }\n\n if (normalized.includes(\"orange\") || normalized.includes(\"橙\")) {\n return \"text-orange-500\"\n }\n\n return \"text-gray-700\"\n}\n","/**\n * Minimal level-filtered logger used internally by the daily-report package.\n * daily-report パッケージ内部で使う最小のレベルフィルタ付きロガー。\n *\n * 消費アプリのロガー実装 (console 互換の debug/info/warn/error) を注入でき、\n * 未注入時は console にフォールバックする。\n */\n\n/** 出力フィルタリング用のログレベル。 */\nexport enum LogLevel {\n DEBUG = 0,\n INFO = 1,\n WARN = 2,\n ERROR = 3,\n NONE = 4,\n}\n\n/** Console 互換のロガーインターフェース。 */\nexport interface DailyReportLogger {\n debug(message?: unknown, ...optionalParams: unknown[]): void\n info(message?: unknown, ...optionalParams: unknown[]): void\n warn(message?: unknown, ...optionalParams: unknown[]): void\n error(message?: unknown, ...optionalParams: unknown[]): void\n}\n\n/**\n * Creates a prefixed, level-filtered logger delegating to the given implementation.\n * 指定実装へ委譲するプレフィックス付き・レベルフィルタ付きロガーを生成する処理。\n */\nexport const createLogger = (level: LogLevel, prefix: string, impl: DailyReportLogger = console): DailyReportLogger => {\n // 文字列メッセージはプレフィックスを連結、それ以外は先頭引数として付加する\n const format = (message: unknown): unknown[] => (typeof message === \"string\" ? [`${prefix} ${message}`] : [prefix, message])\n return {\n debug: (message?: unknown, ...rest: unknown[]) => {\n if (level <= LogLevel.DEBUG) impl.debug(...format(message), ...rest)\n },\n info: (message?: unknown, ...rest: unknown[]) => {\n if (level <= LogLevel.INFO) impl.info(...format(message), ...rest)\n },\n warn: (message?: unknown, ...rest: unknown[]) => {\n if (level <= LogLevel.WARN) impl.warn(...format(message), ...rest)\n },\n error: (message?: unknown, ...rest: unknown[]) => {\n if (level <= LogLevel.ERROR) impl.error(...format(message), ...rest)\n },\n }\n}\n","/**\n * Zod schemas for daily-report SSE messages (client/server shared contract).\n * 日報 SSE メッセージの zod スキーマ (client / server 共有契約)。\n */\nimport { z } from \"zod\"\nimport type { DailyReportCommentItem as DeclaredComment, DailyReportDetail as DeclaredDetail } from \"./types\"\n\n// --- サブスキーマ(types.ts の型と構造的に一致させる) ---\n\nexport const dailyReportInterviewerSchema = z.object({\n name: z.string(),\n affiliation: z.string().nullable(),\n})\n\nexport const dailyReportCommentSchema = z.object({\n name: z.string().nullable(),\n text: z.string().nullable(),\n color: z.string().nullable(),\n})\n\nexport const dailyReportLabelDefSchema = z.object({\n id: z.number(),\n name: z.string(),\n color: z.string().nullable(),\n})\n\nexport const dailyReportCommentItemSchema = z.object({\n id: z.number(),\n userId: z.string(),\n userName: z.string(),\n content: z.string(),\n createdAt: z.string(),\n isMine: z.boolean(),\n})\n\nexport const dailyReportDetailSchema = z.object({\n reportHubId: z.number(),\n date: z.string().nullable(),\n createdAt: z.string().nullable(),\n author: z.string(),\n userId: z.string(),\n employeeName: z.string().nullable(),\n updatedBy: z.string().nullable(),\n updatedAt: z.string().nullable(),\n category: z.string().nullable(),\n creationCategory: z.string().nullable(),\n visitTimeFrom: z.string().nullable(),\n visitTimeTo: z.string().nullable(),\n customerName: z.string().nullable(),\n interviewers: z.array(dailyReportInterviewerSchema),\n subject: z.string().nullable(),\n content: z.string().nullable(),\n comments: z.array(dailyReportCommentSchema),\n isRead: z.boolean(),\n isStarred: z.boolean(),\n labels: z.array(dailyReportLabelDefSchema),\n commentItems: z.array(dailyReportCommentItemSchema),\n})\n\n// --- SSE メッセージスキーマ(8種) ---\n\nexport const connectedMessageSchema = z.object({\n type: z.literal(\"connected\"),\n})\n\nexport const statusUpdateMessageSchema = z.object({\n type: z.literal(\"status-update\"),\n reportHubId: z.number(),\n statusType: z.enum([\"star\", \"read\"]),\n value: z.boolean(),\n clientTempId: z.string(),\n // recipientRawUserId はサーバーサイドフィルタリング専用。\n // SSE ルートが raw JSON から取得してフィルタ後に除去する。\n // クライアントには到達しないが、サーバー側の publish で .parse() を通すため定義が必要。\n recipientRawUserId: z.number().optional(),\n})\n\nexport const commentAddMessageSchema = z.object({\n type: z.literal(\"comment-add\"),\n reportHubId: z.number(),\n comment: dailyReportCommentItemSchema,\n clientTempId: z.string(),\n})\n\nexport const commentDeleteMessageSchema = z.object({\n type: z.literal(\"comment-delete\"),\n reportHubId: z.number(),\n commentId: z.number(),\n clientTempId: z.string(),\n})\n\nexport const reportCreateMessageSchema = z.object({\n type: z.literal(\"report-create\"),\n reportHubId: z.number(),\n report: dailyReportDetailSchema,\n clientTempId: z.string(),\n recipientRawUserId: z.number().optional(),\n})\n\nexport const reportUpdateMessageSchema = z.object({\n type: z.literal(\"report-update\"),\n reportHubId: z.number(),\n report: dailyReportDetailSchema,\n clientTempId: z.string(),\n recipientRawUserId: z.number().optional(),\n})\n\nexport const reportPublishMessageSchema = z.object({\n type: z.literal(\"report-publish\"),\n reportHubId: z.number(),\n report: dailyReportDetailSchema,\n clientTempId: z.string(),\n})\n\nexport const reportDeleteMessageSchema = z.object({\n type: z.literal(\"report-delete\"),\n reportHubId: z.number(),\n clientTempId: z.string(),\n})\n\n// --- Discriminated Union ---\n\nexport const dailyReportSseMessageSchema = z.discriminatedUnion(\"type\", [\n connectedMessageSchema,\n statusUpdateMessageSchema,\n commentAddMessageSchema,\n commentDeleteMessageSchema,\n reportCreateMessageSchema,\n reportUpdateMessageSchema,\n reportPublishMessageSchema,\n reportDeleteMessageSchema,\n])\n\n// --- 型エクスポート ---\n\nexport type DailyReportSseMessage = z.infer<typeof dailyReportSseMessageSchema>\n\n// --- コンパイル時の型互換チェック ---\n// Zod推論型が既存の型定義に代入可能であることを保証する。\n// ここでエラーが出たらスキーマと types.ts がずれている。\n\ntype _AssertDetailCompat = z.infer<typeof dailyReportDetailSchema> extends DeclaredDetail ? true : never\ntype _AssertCommentCompat = z.infer<typeof dailyReportCommentItemSchema> extends DeclaredComment ? true : never\nconst _detailCheck: _AssertDetailCompat = true\nconst _commentCheck: _AssertCommentCompat = true\nvoid _detailCheck\nvoid _commentCheck\n","/**\n * Shared text helpers for daily report view components.\n * 日報ビューコンポーネント向けの共通テキストヘルパー。\n */\n\n/**\n * Normalizes nullable text by trimming whitespace and applying fallback.\n * null 許容の文字列をトリムしつつフォールバック値を適用する関数。\n */\nexport const fallbackText = (value: string | null | undefined): string => {\n if (!value) {\n return \"-\"\n }\n const trimmed = value.trim()\n return trimmed === \"\" ? \"-\" : trimmed\n}\n\n/**\n * Formats a date string to ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss).\n * 日付文字列を ISO 8601 形式 (YYYY-MM-DD または YYYY-MM-DDTHH:mm:ss) に整形する関数。\n */\nexport const formatToIsoDate = (value: unknown): string => {\n if (!value) {\n return \"-\"\n }\n if (typeof value !== \"string\") {\n // If value is not a string (e.g. Date object), try to convert it to string or handle it\n if (value instanceof Date) {\n return formatToIsoDate(value.toISOString())\n }\n return String(value)\n }\n const trimmed = value.trim()\n if (trimmed === \"\") {\n return \"-\"\n }\n\n const date = new Date(trimmed)\n if (Number.isNaN(date.getTime())) {\n return trimmed\n }\n\n const year = date.getFullYear()\n const month = String(date.getMonth() + 1).padStart(2, \"0\")\n const day = String(date.getDate()).padStart(2, \"0\")\n\n const hasTime = trimmed.includes(\":\") || trimmed.includes(\"T\")\n\n if (hasTime) {\n const hours = String(date.getHours()).padStart(2, \"0\")\n const minutes = String(date.getMinutes()).padStart(2, \"0\")\n const seconds = String(date.getSeconds()).padStart(2, \"0\")\n return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`\n }\n\n return `${year}-${month}-${day}`\n}\n"],"mappings":"AAOA,IAAMA,EAAmB,sBACnBC,EAAqB,wBAErBC,EAAWC,GACNA,EAAQ,GAAK,IAAIA,CAAK,GAAK,GAAGA,CAAK,GAGxCC,EAAqBD,GAA+B,CACtD,GAAI,OAAO,MAAMA,EAAM,QAAQ,CAAC,EAC5B,OAAO,KAGX,IAAME,EAAOF,EAAM,YAAY,EACzBG,EAAQJ,EAAQC,EAAM,SAAS,EAAI,CAAC,EACpCI,EAAML,EAAQC,EAAM,QAAQ,CAAC,EACnC,MAAO,GAAGE,CAAI,IAAIC,CAAK,IAAIC,CAAG,EAClC,EAMaC,EAA4BL,GAA4C,CACjF,GAAIA,GAAU,KACV,OAAO,KAGX,GAAIA,aAAiB,KACjB,OAAOC,EAAkBD,CAAK,EAGlC,IAAMM,EAAUN,EAAM,KAAK,EAC3B,GAAIM,IAAY,GACZ,OAAO,KAGX,GAAIT,EAAiB,KAAKS,CAAO,EAC7B,OAAOA,EAGX,GAAIR,EAAmB,KAAKQ,CAAO,EAC/B,OAAOA,EAAQ,WAAW,IAAK,GAAG,EAGtC,IAAMC,EAAS,IAAI,KAAKD,CAAO,EAC/B,O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GAAK,IAAMA,CAClC,EAMaC,EAAmBF,GAA2B,CACvD,GAAI,CAACA,EACD,MAAO,IAEX,GAAI,OAAOA,GAAU,SAEjB,OAAIA,aAAiB,KACVE,EAAgBF,EAAM,YAAY,CAAC,EAEvC,OAAOA,CAAK,EAEvB,IAAMC,EAAUD,EAAM,KAAK,EAC3B,GAAIC,IAAY,GACZ,MAAO,IAGX,IAAME,EAAO,IAAI,KAAKF,CAAO,EAC7B,GAAI,OAAO,MAAME,EAAK,QAAQ,CAAC,EAC3B,OAAOF,EAGX,IAAMG,EAAOD,EAAK,YAAY,EACxBE,EAAQ,OAAOF,EAAK,SAAS,EAAI,CAAC,EAAE,SAAS,EAAG,GAAG,EACnDG,EAAM,OAAOH,EAAK,QAAQ,CAAC,EAAE,SAAS,EAAG,GAAG,EAIlD,GAFgBF,EAAQ,SAAS,GAAG,GAAKA,EAAQ,SAAS,GAAG,EAEhD,CACT,IAAMM,EAAQ,OAAOJ,EAAK,SAAS,CAAC,EAAE,SAAS,EAAG,GAAG,EAC/CK,EAAU,OAAOL,EAAK,WAAW,CAAC,EAAE,SAAS,EAAG,GAAG,EACnDM,EAAU,OAAON,EAAK,WAAW,CAAC,EAAE,SAAS,EAAG,GAAG,EACzD,MAAO,GAAGC,CAAI,IAAIC,CAAK,IAAIC,CAAG,IAAIC,CAAK,IAAIC,CAAO,IAAIC,CAAO,EACjE,CAEA,MAAO,GAAGL,CAAI,IAAIC,CAAK,IAAIC,CAAG,EAClC","names":["ISO_DATE_PATTERN","SLASH_DATE_PATTERN","zeroPad","value","normalizeFromDate","year","month","day","normalizeBusinessDateKey","trimmed","parsed","formatBusinessDateDisplay","normalized","parseBusinessDateKeyToDate","part","component","mergeComments","legacyComments","modernComments","currentUserId","legacyUIComments","c","index","modernUIComments","resolveCommentColorClass","color","normalized","LogLevel","createLogger","level","prefix","impl","format","message","rest","z","dailyReportInterviewerSchema","dailyReportCommentSchema","dailyReportLabelDefSchema","dailyReportCommentItemSchema","dailyReportDetailSchema","connectedMessageSchema","statusUpdateMessageSchema","commentAddMessageSchema","commentDeleteMessageSchema","reportCreateMessageSchema","reportUpdateMessageSchema","reportPublishMessageSchema","reportDeleteMessageSchema","dailyReportSseMessageSchema","fallbackText","value","trimmed","formatToIsoDate","date","year","month","day","hours","minutes","seconds"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal level-filtered logger used internally by the daily-report package.
|
|
3
|
+
* daily-report パッケージ内部で使う最小のレベルフィルタ付きロガー。
|
|
4
|
+
*
|
|
5
|
+
* 消費アプリのロガー実装 (console 互換の debug/info/warn/error) を注入でき、
|
|
6
|
+
* 未注入時は console にフォールバックする。
|
|
7
|
+
*/
|
|
8
|
+
/** 出力フィルタリング用のログレベル。 */
|
|
9
|
+
declare enum LogLevel {
|
|
10
|
+
DEBUG = 0,
|
|
11
|
+
INFO = 1,
|
|
12
|
+
WARN = 2,
|
|
13
|
+
ERROR = 3,
|
|
14
|
+
NONE = 4
|
|
15
|
+
}
|
|
16
|
+
/** Console 互換のロガーインターフェース。 */
|
|
17
|
+
interface DailyReportLogger {
|
|
18
|
+
debug(message?: unknown, ...optionalParams: unknown[]): void;
|
|
19
|
+
info(message?: unknown, ...optionalParams: unknown[]): void;
|
|
20
|
+
warn(message?: unknown, ...optionalParams: unknown[]): void;
|
|
21
|
+
error(message?: unknown, ...optionalParams: unknown[]): void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Creates a prefixed, level-filtered logger delegating to the given implementation.
|
|
25
|
+
* 指定実装へ委譲するプレフィックス付き・レベルフィルタ付きロガーを生成する処理。
|
|
26
|
+
*/
|
|
27
|
+
declare const createLogger: (level: LogLevel, prefix: string, impl?: DailyReportLogger) => DailyReportLogger;
|
|
28
|
+
|
|
29
|
+
export { type DailyReportLogger as D, LogLevel as L, createLogger as c };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal level-filtered logger used internally by the daily-report package.
|
|
3
|
+
* daily-report パッケージ内部で使う最小のレベルフィルタ付きロガー。
|
|
4
|
+
*
|
|
5
|
+
* 消費アプリのロガー実装 (console 互換の debug/info/warn/error) を注入でき、
|
|
6
|
+
* 未注入時は console にフォールバックする。
|
|
7
|
+
*/
|
|
8
|
+
/** 出力フィルタリング用のログレベル。 */
|
|
9
|
+
declare enum LogLevel {
|
|
10
|
+
DEBUG = 0,
|
|
11
|
+
INFO = 1,
|
|
12
|
+
WARN = 2,
|
|
13
|
+
ERROR = 3,
|
|
14
|
+
NONE = 4
|
|
15
|
+
}
|
|
16
|
+
/** Console 互換のロガーインターフェース。 */
|
|
17
|
+
interface DailyReportLogger {
|
|
18
|
+
debug(message?: unknown, ...optionalParams: unknown[]): void;
|
|
19
|
+
info(message?: unknown, ...optionalParams: unknown[]): void;
|
|
20
|
+
warn(message?: unknown, ...optionalParams: unknown[]): void;
|
|
21
|
+
error(message?: unknown, ...optionalParams: unknown[]): void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Creates a prefixed, level-filtered logger delegating to the given implementation.
|
|
25
|
+
* 指定実装へ委譲するプレフィックス付き・レベルフィルタ付きロガーを生成する処理。
|
|
26
|
+
*/
|
|
27
|
+
declare const createLogger: (level: LogLevel, prefix: string, impl?: DailyReportLogger) => DailyReportLogger;
|
|
28
|
+
|
|
29
|
+
export { type DailyReportLogger as D, LogLevel as L, createLogger as c };
|