@aiquants/daily-report 0.34.0 → 0.36.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.
@@ -1,4 +1,4 @@
1
- import { d as DailyReportDetail, l as DailyReportPostedComment, D as DailyReportItem, i as DailyReportExternalComment } from "./sse-schema-DVIUaiAG.mjs";
1
+ import { d as DailyReportDetail, m as DailyReportPostedComment, D as DailyReportItem, j as DailyReportExternalComment } from "./sse-schema-getLS62T.js";
2
2
  declare const DAILY_REPORT_ACTION_INTENTS: readonly [
3
3
  "create",
4
4
  "update",
@@ -23,62 +23,107 @@ declare const DAILY_REPORT_ACTION_FIELDS: Readonly<{
23
23
  readonly isRead: "isRead";
24
24
  readonly commentId: "commentId";
25
25
  }>;
26
- type ActionCommandBase<ClientTempId extends string> = {
27
- readonly clientTempId: ClientTempId;
28
- readonly businessDate: string | null;
29
- readonly operationTimestamp: number | null;
30
- };
31
26
  type ActionCommand<ClientTempId extends string = string> = {
32
27
  readonly intent: "clearCache";
33
- } | (ActionCommandBase<ClientTempId> & {
28
+ } | {
34
29
  readonly intent: "create";
30
+ readonly clientTempId: ClientTempId;
35
31
  readonly businessDate: string;
36
- }) | (ActionCommandBase<ClientTempId> & {
32
+ readonly operationTimestamp: number | null;
33
+ } | {
37
34
  readonly intent: "update";
35
+ readonly clientTempId: ClientTempId;
36
+ readonly businessDate: string | null;
37
+ readonly operationTimestamp: number | null;
38
38
  readonly reportHubId: number;
39
39
  readonly changes: {
40
40
  readonly title?: string;
41
41
  readonly content?: string;
42
42
  };
43
- }) | (ActionCommandBase<ClientTempId> & {
43
+ } | {
44
44
  readonly intent: "publish" | "delete";
45
+ readonly clientTempId: ClientTempId;
46
+ readonly businessDate: string | null;
47
+ readonly operationTimestamp: number | null;
45
48
  readonly reportHubId: number;
46
- }) | (ActionCommandBase<ClientTempId> & {
49
+ } | {
47
50
  readonly intent: "toggleStar" | "toggleRead";
51
+ readonly clientTempId: ClientTempId;
52
+ readonly businessDate: string | null;
53
+ readonly operationTimestamp: number | null;
48
54
  readonly reportHubId: number;
49
55
  readonly value: boolean;
50
- }) | (ActionCommandBase<ClientTempId> & {
56
+ } | {
51
57
  readonly intent: "addComment";
58
+ readonly clientTempId: ClientTempId;
59
+ readonly businessDate: string | null;
60
+ readonly operationTimestamp: number | null;
52
61
  readonly reportHubId: number;
53
62
  readonly content: string;
54
- }) | (ActionCommandBase<ClientTempId> & {
63
+ } | {
55
64
  readonly intent: "deleteComment";
65
+ readonly clientTempId: ClientTempId;
66
+ readonly businessDate: string | null;
67
+ readonly operationTimestamp: number | null;
56
68
  readonly reportHubId: number;
57
69
  readonly commentId: number;
58
- });
70
+ };
59
71
  declare const encodeActionCommand: (command: ActionCommand) => FormData;
60
- type ActionEcho<Intent extends DailyReportActionIntent> = {
72
+ type ActionResult = {
61
73
  readonly status: "OK";
62
- readonly intent: Intent;
74
+ readonly intent: "create";
75
+ readonly reportHubId: number;
76
+ readonly clientTempId: string;
77
+ readonly report: DailyReportDetail;
78
+ } | {
79
+ readonly status: "OK";
80
+ readonly intent: "update";
81
+ readonly reportHubId: number;
82
+ readonly clientTempId: string;
83
+ } | {
84
+ readonly status: "OK";
85
+ readonly intent: "publish";
86
+ readonly reportHubId: number;
87
+ readonly clientTempId: string;
88
+ readonly report: DailyReportDetail | null;
89
+ } | {
90
+ readonly status: "OK";
91
+ readonly intent: "delete";
92
+ readonly reportHubId: number;
93
+ readonly clientTempId: string;
94
+ } | {
95
+ readonly status: "OK";
96
+ readonly intent: "toggleStar";
63
97
  readonly reportHubId: number;
64
98
  readonly clientTempId: string;
65
- };
66
- type ActionToggleFields = {
67
99
  readonly updatedStatus: {
68
100
  readonly isStarred: boolean;
69
101
  readonly isRead: boolean;
70
102
  };
71
103
  readonly operationTimestamp: number | null;
72
- };
73
- type ActionResult = (ActionEcho<"create"> & {
74
- readonly report: DailyReportDetail;
75
- }) | ActionEcho<"update"> | (ActionEcho<"publish"> & {
76
- readonly report: DailyReportDetail | null;
77
- }) | ActionEcho<"delete"> | (ActionEcho<"toggleStar"> & ActionToggleFields) | (ActionEcho<"toggleRead"> & ActionToggleFields) | (ActionEcho<"addComment"> & {
104
+ } | {
105
+ readonly status: "OK";
106
+ readonly intent: "toggleRead";
107
+ readonly reportHubId: number;
108
+ readonly clientTempId: string;
109
+ readonly updatedStatus: {
110
+ readonly isStarred: boolean;
111
+ readonly isRead: boolean;
112
+ };
113
+ readonly operationTimestamp: number | null;
114
+ } | {
115
+ readonly status: "OK";
116
+ readonly intent: "addComment";
117
+ readonly reportHubId: number;
118
+ readonly clientTempId: string;
78
119
  readonly newComment: DailyReportPostedComment;
79
- }) | (ActionEcho<"deleteComment"> & {
120
+ } | {
121
+ readonly status: "OK";
122
+ readonly intent: "deleteComment";
123
+ readonly reportHubId: number;
124
+ readonly clientTempId: string;
80
125
  readonly deletedCommentId: number;
81
- }) | {
126
+ } | {
82
127
  readonly status: "OK";
83
128
  readonly intent: "clearCache";
84
129
  };
@@ -122,6 +167,7 @@ type UIComment = {
122
167
  isMine: boolean;
123
168
  color?: string;
124
169
  isLegacy: boolean;
170
+ isAuthorUnknown: boolean;
125
171
  };
126
172
  declare const mergeComments: (legacyComments: DailyReportExternalComment[], modernComments: DailyReportPostedComment[], currentUserId: string | null | undefined, unknownAuthorName: string) => UIComment[];
127
- export { type ActionCommand as A, type DailyReportActionIntent as D, type UIComment as U, type DailyReportSseStreamAnchor as a, DAILY_REPORT_ACTION_FIELDS as b, DAILY_REPORT_ACTION_INTENTS as c, type ActionFailure as d, type ActionResult as e, type ActionResultOf as f, type DailyReportIdsStreamChunkLine as g, encodeActionCommand as h, isIdsStreamChunkLine as i, mergeComments as m, parseActionResult as p };
173
+ export { type ActionCommand as A, type DailyReportActionIntent as D, type UIComment as U, type DailyReportSseStreamAnchor as a, DAILY_REPORT_ACTION_FIELDS as b, DAILY_REPORT_ACTION_INTENTS as c, type ActionFailure as d, type ActionResult as e, type ActionResultOf as f, type ActionResultReading as g, type DailyReportIdsStreamChunkLine as h, type DailyReportIdsStreamCursor as i, encodeActionCommand as j, isIdsStreamChunkLine as k, mergeComments as m, parseActionResult as p };
@@ -1,4 +1,4 @@
1
- import { d as DailyReportDetail, l as DailyReportPostedComment, D as DailyReportItem, i as DailyReportExternalComment } from "./sse-schema-DVIUaiAG.js";
1
+ import { d as DailyReportDetail, m as DailyReportPostedComment, D as DailyReportItem, j as DailyReportExternalComment } from "./sse-schema-getLS62T.mjs";
2
2
  declare const DAILY_REPORT_ACTION_INTENTS: readonly [
3
3
  "create",
4
4
  "update",
@@ -23,62 +23,107 @@ declare const DAILY_REPORT_ACTION_FIELDS: Readonly<{
23
23
  readonly isRead: "isRead";
24
24
  readonly commentId: "commentId";
25
25
  }>;
26
- type ActionCommandBase<ClientTempId extends string> = {
27
- readonly clientTempId: ClientTempId;
28
- readonly businessDate: string | null;
29
- readonly operationTimestamp: number | null;
30
- };
31
26
  type ActionCommand<ClientTempId extends string = string> = {
32
27
  readonly intent: "clearCache";
33
- } | (ActionCommandBase<ClientTempId> & {
28
+ } | {
34
29
  readonly intent: "create";
30
+ readonly clientTempId: ClientTempId;
35
31
  readonly businessDate: string;
36
- }) | (ActionCommandBase<ClientTempId> & {
32
+ readonly operationTimestamp: number | null;
33
+ } | {
37
34
  readonly intent: "update";
35
+ readonly clientTempId: ClientTempId;
36
+ readonly businessDate: string | null;
37
+ readonly operationTimestamp: number | null;
38
38
  readonly reportHubId: number;
39
39
  readonly changes: {
40
40
  readonly title?: string;
41
41
  readonly content?: string;
42
42
  };
43
- }) | (ActionCommandBase<ClientTempId> & {
43
+ } | {
44
44
  readonly intent: "publish" | "delete";
45
+ readonly clientTempId: ClientTempId;
46
+ readonly businessDate: string | null;
47
+ readonly operationTimestamp: number | null;
45
48
  readonly reportHubId: number;
46
- }) | (ActionCommandBase<ClientTempId> & {
49
+ } | {
47
50
  readonly intent: "toggleStar" | "toggleRead";
51
+ readonly clientTempId: ClientTempId;
52
+ readonly businessDate: string | null;
53
+ readonly operationTimestamp: number | null;
48
54
  readonly reportHubId: number;
49
55
  readonly value: boolean;
50
- }) | (ActionCommandBase<ClientTempId> & {
56
+ } | {
51
57
  readonly intent: "addComment";
58
+ readonly clientTempId: ClientTempId;
59
+ readonly businessDate: string | null;
60
+ readonly operationTimestamp: number | null;
52
61
  readonly reportHubId: number;
53
62
  readonly content: string;
54
- }) | (ActionCommandBase<ClientTempId> & {
63
+ } | {
55
64
  readonly intent: "deleteComment";
65
+ readonly clientTempId: ClientTempId;
66
+ readonly businessDate: string | null;
67
+ readonly operationTimestamp: number | null;
56
68
  readonly reportHubId: number;
57
69
  readonly commentId: number;
58
- });
70
+ };
59
71
  declare const encodeActionCommand: (command: ActionCommand) => FormData;
60
- type ActionEcho<Intent extends DailyReportActionIntent> = {
72
+ type ActionResult = {
61
73
  readonly status: "OK";
62
- readonly intent: Intent;
74
+ readonly intent: "create";
75
+ readonly reportHubId: number;
76
+ readonly clientTempId: string;
77
+ readonly report: DailyReportDetail;
78
+ } | {
79
+ readonly status: "OK";
80
+ readonly intent: "update";
81
+ readonly reportHubId: number;
82
+ readonly clientTempId: string;
83
+ } | {
84
+ readonly status: "OK";
85
+ readonly intent: "publish";
86
+ readonly reportHubId: number;
87
+ readonly clientTempId: string;
88
+ readonly report: DailyReportDetail | null;
89
+ } | {
90
+ readonly status: "OK";
91
+ readonly intent: "delete";
92
+ readonly reportHubId: number;
93
+ readonly clientTempId: string;
94
+ } | {
95
+ readonly status: "OK";
96
+ readonly intent: "toggleStar";
63
97
  readonly reportHubId: number;
64
98
  readonly clientTempId: string;
65
- };
66
- type ActionToggleFields = {
67
99
  readonly updatedStatus: {
68
100
  readonly isStarred: boolean;
69
101
  readonly isRead: boolean;
70
102
  };
71
103
  readonly operationTimestamp: number | null;
72
- };
73
- type ActionResult = (ActionEcho<"create"> & {
74
- readonly report: DailyReportDetail;
75
- }) | ActionEcho<"update"> | (ActionEcho<"publish"> & {
76
- readonly report: DailyReportDetail | null;
77
- }) | ActionEcho<"delete"> | (ActionEcho<"toggleStar"> & ActionToggleFields) | (ActionEcho<"toggleRead"> & ActionToggleFields) | (ActionEcho<"addComment"> & {
104
+ } | {
105
+ readonly status: "OK";
106
+ readonly intent: "toggleRead";
107
+ readonly reportHubId: number;
108
+ readonly clientTempId: string;
109
+ readonly updatedStatus: {
110
+ readonly isStarred: boolean;
111
+ readonly isRead: boolean;
112
+ };
113
+ readonly operationTimestamp: number | null;
114
+ } | {
115
+ readonly status: "OK";
116
+ readonly intent: "addComment";
117
+ readonly reportHubId: number;
118
+ readonly clientTempId: string;
78
119
  readonly newComment: DailyReportPostedComment;
79
- }) | (ActionEcho<"deleteComment"> & {
120
+ } | {
121
+ readonly status: "OK";
122
+ readonly intent: "deleteComment";
123
+ readonly reportHubId: number;
124
+ readonly clientTempId: string;
80
125
  readonly deletedCommentId: number;
81
- }) | {
126
+ } | {
82
127
  readonly status: "OK";
83
128
  readonly intent: "clearCache";
84
129
  };
@@ -122,6 +167,7 @@ type UIComment = {
122
167
  isMine: boolean;
123
168
  color?: string;
124
169
  isLegacy: boolean;
170
+ isAuthorUnknown: boolean;
125
171
  };
126
172
  declare const mergeComments: (legacyComments: DailyReportExternalComment[], modernComments: DailyReportPostedComment[], currentUserId: string | null | undefined, unknownAuthorName: string) => UIComment[];
127
- export { type ActionCommand as A, type DailyReportActionIntent as D, type UIComment as U, type DailyReportSseStreamAnchor as a, DAILY_REPORT_ACTION_FIELDS as b, DAILY_REPORT_ACTION_INTENTS as c, type ActionFailure as d, type ActionResult as e, type ActionResultOf as f, type DailyReportIdsStreamChunkLine as g, encodeActionCommand as h, isIdsStreamChunkLine as i, mergeComments as m, parseActionResult as p };
173
+ export { type ActionCommand as A, type DailyReportActionIntent as D, type UIComment as U, type DailyReportSseStreamAnchor as a, DAILY_REPORT_ACTION_FIELDS as b, DAILY_REPORT_ACTION_INTENTS as c, type ActionFailure as d, type ActionResult as e, type ActionResultOf as f, type ActionResultReading as g, type DailyReportIdsStreamChunkLine as h, type DailyReportIdsStreamCursor as i, encodeActionCommand as j, isIdsStreamChunkLine as k, mergeComments as m, parseActionResult as p };
package/dist/index.d.mts CHANGED
@@ -1,15 +1,22 @@
1
- export { b as DAILY_REPORT_ACTION_FIELDS, c as DAILY_REPORT_ACTION_INTENTS, A as DailyReportActionCommand, d as DailyReportActionFailure, D as DailyReportActionIntent, e as DailyReportActionResult, f as DailyReportActionResultOf, g as DailyReportIdsStreamChunkLine, a as DailyReportSseStreamAnchor, h as encodeDailyReportActionCommand, i as isIdsStreamChunkLine, m as mergeComments, p as parseDailyReportActionResult } from "./comment-adapter-7TduiLiu.mjs";
2
- export { e as DAILY_REPORT_SSE_CURSOR_PARAM, f as DAILY_REPORT_SSE_HEARTBEAT_MS, g as DAILY_REPORT_SSE_TERMINAL_EVENTS, h as DailyReportAttachmentSummary, d as DailyReportDetail, i as DailyReportExternalComment, j as DailyReportInterviewer, D as DailyReportItem, k as DailyReportLabelDef, l as DailyReportPostedComment, c as DailyReportSseMessage, a as DailyReportUser, m as commentAddMessageSchema, n as commentDeleteMessageSchema, o as connectedMessageSchema, p as dailyReportDetailSchema, q as dailyReportExternalCommentSchema, r as dailyReportInterviewerSchema, s as dailyReportLabelDefSchema, t as dailyReportPostedCommentSchema, u as dailyReportSseMessageSchema, v as isDailyReportSseStreamId, w as reportCreateMessageSchema, x as reportDeleteMessageSchema, y as reportPublishMessageSchema, z as reportUpdateMessageSchema, A as statusUpdateMessageSchema } from "./sse-schema-DVIUaiAG.mjs";
1
+ export { b as DAILY_REPORT_ACTION_FIELDS, c as DAILY_REPORT_ACTION_INTENTS, A as DailyReportActionCommand, d as DailyReportActionFailure, D as DailyReportActionIntent, e as DailyReportActionResult, f as DailyReportActionResultOf, g as DailyReportActionResultReading, h as DailyReportIdsStreamChunkLine, i as DailyReportIdsStreamCursor, a as DailyReportSseStreamAnchor, U as DailyReportUIComment, j as encodeDailyReportActionCommand, k as isIdsStreamChunkLine, m as mergeComments, p as parseDailyReportActionResult } from "./comment-adapter-pzx3O8_h.mjs";
2
+ export { D as DAILY_REPORT_SEARCH_COMBINES, a as DailyReportLogger, b as DailyReportSearchCombine, c as DailyReportSearchFieldMarks, d as DailyReportSearchHit, e as DailyReportSearchMarksAnswer, f as DailyReportSearchReportMarks } from "./search-marks-wire-DCFuK5yr.mjs";
3
+ export { e as DAILY_REPORT_SSE_CURSOR_PARAM, f as DAILY_REPORT_SSE_HEARTBEAT_MS, g as DAILY_REPORT_SSE_TERMINAL_EVENTS, h as DailyReportAttachmentState, i as DailyReportAttachmentSummary, d as DailyReportDetail, j as DailyReportExternalComment, k as DailyReportInterviewer, D as DailyReportItem, l as DailyReportLabelDef, m as DailyReportPostedComment, c as DailyReportSseMessage, b as DailyReportSseTerminalEvent, a as DailyReportUser, n as commentAddMessageSchema, o as commentDeleteMessageSchema, p as connectedMessageSchema, q as dailyReportDetailSchema, r as dailyReportExternalCommentSchema, s as dailyReportInterviewerSchema, t as dailyReportLabelDefSchema, u as dailyReportPostedCommentSchema, v as dailyReportSseMessageSchema, w as isDailyReportSseStreamId, x as reportCreateMessageSchema, y as reportDeleteMessageSchema, z as reportPublishMessageSchema, A as reportUpdateMessageSchema, B as statusUpdateMessageSchema } from "./sse-schema-getLS62T.mjs";
3
4
  import "zod";
4
5
  declare const DAILY_REPORT_API_ENDPOINTS: Readonly<{
5
6
  readonly businessDate: "business-date";
6
7
  readonly idsStream: "ids-stream";
7
8
  readonly report: "report";
9
+ readonly search: "search";
10
+ readonly reports: "reports";
11
+ readonly searchMarks: "search-marks";
8
12
  readonly action: "action";
9
13
  }>;
10
14
  declare const DAILY_REPORT_API_QUERY_PARAMS: Readonly<{
11
15
  readonly businessDate: "businessDate";
12
16
  readonly reportHubId: "reportHubId";
17
+ readonly searchQuery: "q";
18
+ readonly searchCombine: "combine";
19
+ readonly reportIds: "ids";
13
20
  readonly forceRefresh: "forceRefresh";
14
21
  readonly cursorReportHubId: "cursor_report_hub_id";
15
22
  readonly cursorBusinessDate: "cursor_business_date";
@@ -44,4 +51,4 @@ declare const parseDailyReportAttachmentQuery: (params: URLSearchParams) => Dail
44
51
  type BusinessDateInput = string | Date | null | undefined;
45
52
  declare const normalizeBusinessDateKey: (value: BusinessDateInput) => string | null;
46
53
  declare const DAILY_REPORT_CLIENT_TEMP_ID_PATTERN: RegExp;
47
- export { DAILY_REPORT_API_ENDPOINTS, DAILY_REPORT_API_QUERY_PARAMS, DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS, DAILY_REPORT_CLIENT_TEMP_ID_PATTERN, type DailyReportAttachmentDeliveryRequest, type DailyReportAttachmentInvalidQuery, type DailyReportAttachmentThumbnailBox, type DailyReportAttachmentThumbnailVariant, buildDailyReportAttachmentUrl, isDailyReportAttachmentThumbnailVariant, normalizeBusinessDateKey, parseDailyReportAttachmentQuery };
54
+ export { DAILY_REPORT_API_ENDPOINTS, DAILY_REPORT_API_QUERY_PARAMS, DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS, DAILY_REPORT_CLIENT_TEMP_ID_PATTERN, type DailyReportAttachmentDeliveryRequest, type DailyReportAttachmentInvalidQuery, type DailyReportAttachmentThumbnailBox, type DailyReportAttachmentThumbnailVariant, type BusinessDateInput as DailyReportBusinessDateInput, buildDailyReportAttachmentUrl, isDailyReportAttachmentThumbnailVariant, normalizeBusinessDateKey, parseDailyReportAttachmentQuery };
package/dist/index.d.ts CHANGED
@@ -1,15 +1,22 @@
1
- export { b as DAILY_REPORT_ACTION_FIELDS, c as DAILY_REPORT_ACTION_INTENTS, A as DailyReportActionCommand, d as DailyReportActionFailure, D as DailyReportActionIntent, e as DailyReportActionResult, f as DailyReportActionResultOf, g as DailyReportIdsStreamChunkLine, a as DailyReportSseStreamAnchor, h as encodeDailyReportActionCommand, i as isIdsStreamChunkLine, m as mergeComments, p as parseDailyReportActionResult } from "./comment-adapter-BLfjD6P0.js";
2
- export { e as DAILY_REPORT_SSE_CURSOR_PARAM, f as DAILY_REPORT_SSE_HEARTBEAT_MS, g as DAILY_REPORT_SSE_TERMINAL_EVENTS, h as DailyReportAttachmentSummary, d as DailyReportDetail, i as DailyReportExternalComment, j as DailyReportInterviewer, D as DailyReportItem, k as DailyReportLabelDef, l as DailyReportPostedComment, c as DailyReportSseMessage, a as DailyReportUser, m as commentAddMessageSchema, n as commentDeleteMessageSchema, o as connectedMessageSchema, p as dailyReportDetailSchema, q as dailyReportExternalCommentSchema, r as dailyReportInterviewerSchema, s as dailyReportLabelDefSchema, t as dailyReportPostedCommentSchema, u as dailyReportSseMessageSchema, v as isDailyReportSseStreamId, w as reportCreateMessageSchema, x as reportDeleteMessageSchema, y as reportPublishMessageSchema, z as reportUpdateMessageSchema, A as statusUpdateMessageSchema } from "./sse-schema-DVIUaiAG.js";
1
+ export { b as DAILY_REPORT_ACTION_FIELDS, c as DAILY_REPORT_ACTION_INTENTS, A as DailyReportActionCommand, d as DailyReportActionFailure, D as DailyReportActionIntent, e as DailyReportActionResult, f as DailyReportActionResultOf, g as DailyReportActionResultReading, h as DailyReportIdsStreamChunkLine, i as DailyReportIdsStreamCursor, a as DailyReportSseStreamAnchor, U as DailyReportUIComment, j as encodeDailyReportActionCommand, k as isIdsStreamChunkLine, m as mergeComments, p as parseDailyReportActionResult } from "./comment-adapter-BvGGQkBE.js";
2
+ export { D as DAILY_REPORT_SEARCH_COMBINES, a as DailyReportLogger, b as DailyReportSearchCombine, c as DailyReportSearchFieldMarks, d as DailyReportSearchHit, e as DailyReportSearchMarksAnswer, f as DailyReportSearchReportMarks } from "./search-marks-wire-DCFuK5yr.js";
3
+ export { e as DAILY_REPORT_SSE_CURSOR_PARAM, f as DAILY_REPORT_SSE_HEARTBEAT_MS, g as DAILY_REPORT_SSE_TERMINAL_EVENTS, h as DailyReportAttachmentState, i as DailyReportAttachmentSummary, d as DailyReportDetail, j as DailyReportExternalComment, k as DailyReportInterviewer, D as DailyReportItem, l as DailyReportLabelDef, m as DailyReportPostedComment, c as DailyReportSseMessage, b as DailyReportSseTerminalEvent, a as DailyReportUser, n as commentAddMessageSchema, o as commentDeleteMessageSchema, p as connectedMessageSchema, q as dailyReportDetailSchema, r as dailyReportExternalCommentSchema, s as dailyReportInterviewerSchema, t as dailyReportLabelDefSchema, u as dailyReportPostedCommentSchema, v as dailyReportSseMessageSchema, w as isDailyReportSseStreamId, x as reportCreateMessageSchema, y as reportDeleteMessageSchema, z as reportPublishMessageSchema, A as reportUpdateMessageSchema, B as statusUpdateMessageSchema } from "./sse-schema-getLS62T.js";
3
4
  import "zod";
4
5
  declare const DAILY_REPORT_API_ENDPOINTS: Readonly<{
5
6
  readonly businessDate: "business-date";
6
7
  readonly idsStream: "ids-stream";
7
8
  readonly report: "report";
9
+ readonly search: "search";
10
+ readonly reports: "reports";
11
+ readonly searchMarks: "search-marks";
8
12
  readonly action: "action";
9
13
  }>;
10
14
  declare const DAILY_REPORT_API_QUERY_PARAMS: Readonly<{
11
15
  readonly businessDate: "businessDate";
12
16
  readonly reportHubId: "reportHubId";
17
+ readonly searchQuery: "q";
18
+ readonly searchCombine: "combine";
19
+ readonly reportIds: "ids";
13
20
  readonly forceRefresh: "forceRefresh";
14
21
  readonly cursorReportHubId: "cursor_report_hub_id";
15
22
  readonly cursorBusinessDate: "cursor_business_date";
@@ -44,4 +51,4 @@ declare const parseDailyReportAttachmentQuery: (params: URLSearchParams) => Dail
44
51
  type BusinessDateInput = string | Date | null | undefined;
45
52
  declare const normalizeBusinessDateKey: (value: BusinessDateInput) => string | null;
46
53
  declare const DAILY_REPORT_CLIENT_TEMP_ID_PATTERN: RegExp;
47
- export { DAILY_REPORT_API_ENDPOINTS, DAILY_REPORT_API_QUERY_PARAMS, DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS, DAILY_REPORT_CLIENT_TEMP_ID_PATTERN, type DailyReportAttachmentDeliveryRequest, type DailyReportAttachmentInvalidQuery, type DailyReportAttachmentThumbnailBox, type DailyReportAttachmentThumbnailVariant, buildDailyReportAttachmentUrl, isDailyReportAttachmentThumbnailVariant, normalizeBusinessDateKey, parseDailyReportAttachmentQuery };
54
+ export { DAILY_REPORT_API_ENDPOINTS, DAILY_REPORT_API_QUERY_PARAMS, DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS, DAILY_REPORT_CLIENT_TEMP_ID_PATTERN, type DailyReportAttachmentDeliveryRequest, type DailyReportAttachmentInvalidQuery, type DailyReportAttachmentThumbnailBox, type DailyReportAttachmentThumbnailVariant, type BusinessDateInput as DailyReportBusinessDateInput, buildDailyReportAttachmentUrl, isDailyReportAttachmentThumbnailVariant, normalizeBusinessDateKey, parseDailyReportAttachmentQuery };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var I=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var oe=Object.prototype.hasOwnProperty;var ae=(e,n)=>{for(var r in n)I(e,r,{get:n[r],enumerable:!0})},ie=(e,n,r,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of re(n))!oe.call(e,s)&&s!==r&&I(e,s,{get:()=>n[s],enumerable:!(a=ne(n,s))||a.enumerable});return e};var se=e=>ie(I({},"__esModule",{value:!0}),e);var ge={};ae(ge,{DAILY_REPORT_ACTION_FIELDS:()=>p,DAILY_REPORT_ACTION_INTENTS:()=>B,DAILY_REPORT_API_ENDPOINTS:()=>V,DAILY_REPORT_API_QUERY_PARAMS:()=>K,DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS:()=>L,DAILY_REPORT_CLIENT_TEMP_ID_PATTERN:()=>d,DAILY_REPORT_SSE_CURSOR_PARAM:()=>H,DAILY_REPORT_SSE_HEARTBEAT_MS:()=>w,DAILY_REPORT_SSE_TERMINAL_EVENTS:()=>k,buildDailyReportAttachmentUrl:()=>Z,commentAddMessageSchema:()=>x,commentDeleteMessageSchema:()=>_,connectedMessageSchema:()=>f,dailyReportDetailSchema:()=>c,dailyReportExternalCommentSchema:()=>b,dailyReportInterviewerSchema:()=>D,dailyReportLabelDefSchema:()=>A,dailyReportPostedCommentSchema:()=>u,dailyReportSseMessageSchema:()=>j,encodeDailyReportActionCommand:()=>$,isDailyReportAttachmentThumbnailVariant:()=>g,isDailyReportSseStreamId:()=>U,isIdsStreamChunkLine:()=>F,mergeComments:()=>te,normalizeBusinessDateKey:()=>X,parseDailyReportActionResult:()=>z,parseDailyReportAttachmentQuery:()=>G,reportCreateMessageSchema:()=>C,reportDeleteMessageSchema:()=>M,reportPublishMessageSchema:()=>N,reportUpdateMessageSchema:()=>E,statusUpdateMessageSchema:()=>S});module.exports=se(ge);var o=require("zod");var d=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|-[1-9][0-9]{0,15})$/;var O=require("zod");var i=O.z.number().int().positive().max(Number.MAX_SAFE_INTEGER);var t=require("zod");var k=["auth-required","forbidden","resync-required"],w=15e3,H="lastEventId",le=/^\d{1,15}-\d{1,15}$/,U=e=>le.test(e),D=t.z.object({name:t.z.string().nullish(),affiliation:t.z.string().nullish()}),b=t.z.object({name:t.z.string().nullish(),text:t.z.string().nullish(),color:t.z.string().nullish()}),A=t.z.object({id:i,name:t.z.string().nullish(),color:t.z.string().nullish()}),u=t.z.object({id:i,userId:t.z.string().nullish(),userName:t.z.string().nullish(),content:t.z.string().nullish(),createdAt:t.z.string().nullish(),isMine:t.z.boolean()}),pe=t.z.object({id:t.z.string(),fileName:t.z.string(),fileType:t.z.string().nullable(),fileSize:t.z.number().nullable(),createdAt:t.z.string().nullable(),state:t.z.enum(["present","absent","unknown"]),hasThumbnail:t.z.boolean().default(!1)}),c=t.z.object({reportHubId:i,date:t.z.string().nullish(),createdAt:t.z.string().nullish(),author:t.z.string().nullish(),userId:t.z.string().nullish(),sourceType:t.z.string().nullish(),employeeName:t.z.string().nullish(),updatedBy:t.z.string().nullish(),updatedAt:t.z.string().nullish(),category:t.z.string().nullish(),creationCategory:t.z.string().nullish(),visitTimeFrom:t.z.string().nullish(),visitTimeTo:t.z.string().nullish(),customerName:t.z.string().nullish(),interviewers:t.z.array(D),subject:t.z.string().nullish(),content:t.z.string().nullish(),externalComments:t.z.array(b),isRead:t.z.boolean(),isStarred:t.z.boolean(),labels:t.z.array(A),postedComments:t.z.array(u),attachments:t.z.array(pe).default([])}),m=t.z.string().regex(d),f=t.z.object({type:t.z.literal("connected")}),S=t.z.object({type:t.z.literal("status-update"),reportHubId:i,statusType:t.z.enum(["star","read"]),value:t.z.boolean(),clientTempId:m,recipientRawUserId:i.optional()}),T=t.z.string().optional(),x=t.z.object({type:t.z.literal("comment-add"),reportHubId:i,comment:u,clientTempId:m,recipientRawUserId:i.optional(),sourceType:T}),_=t.z.object({type:t.z.literal("comment-delete"),reportHubId:i,commentId:i,clientTempId:m,recipientRawUserId:i.optional(),sourceType:T}),C=t.z.object({type:t.z.literal("report-create"),reportHubId:i,report:c,clientTempId:m,recipientRawUserId:i.optional()}),E=t.z.object({type:t.z.literal("report-update"),reportHubId:i,report:c,clientTempId:m,recipientRawUserId:i.optional()}),N=t.z.object({type:t.z.literal("report-publish"),reportHubId:i,report:c,clientTempId:m,recipientRawUserId:i.optional()}),M=t.z.object({type:t.z.literal("report-delete"),reportHubId:i,clientTempId:m,sourceType:T}),j=t.z.discriminatedUnion("type",[f,S,x,_,C,E,N,M]);var Y=e=>e.issues.map(n=>`${n.path.length===0?"(root)":n.path.join(".")}: ${n.code}`).join("; ");var B=Object.freeze(["create","update","publish","delete","toggleStar","toggleRead","addComment","deleteComment","clearCache"]);var p=Object.freeze({intent:"intent",clientTempId:"clientTempId",businessDate:"businessDate",operationTimestamp:"operationTimestamp",reportHubId:"reportHubId",title:"title",content:"content",isStarred:"isStarred",isRead:"isRead",commentId:"commentId"}),$=e=>{let n=new FormData;if(n.append(p.intent,e.intent),e.intent==="clearCache"||(n.append(p.clientTempId,e.clientTempId),e.businessDate!==null&&n.append(p.businessDate,e.businessDate),e.operationTimestamp!==null&&n.append(p.operationTimestamp,String(e.operationTimestamp)),e.intent==="create"))return n;switch(n.append(p.reportHubId,String(e.reportHubId)),e.intent){case"update":return e.changes.title!==void 0&&n.append(p.title,e.changes.title),e.changes.content!==void 0&&n.append(p.content,e.changes.content),n;case"publish":case"delete":return n;case"toggleStar":return n.append(p.isStarred,String(e.value)),n;case"toggleRead":return n.append(p.isRead,String(e.value)),n;case"addComment":return n.append(p.content,e.content),n;case"deleteComment":return n.append(p.commentId,String(e.commentId)),n}},ce=()=>{let e=i,n=o.z.string().regex(d),r=o.z.literal("OK"),a=o.z.object({isStarred:o.z.boolean(),isRead:o.z.boolean()}),s=o.z.number().int().nonnegative().nullable();return{create:o.z.object({status:r,intent:o.z.literal("create"),reportHubId:e,clientTempId:n,report:c}),update:o.z.object({status:r,intent:o.z.literal("update"),reportHubId:e,clientTempId:n}),publish:o.z.object({status:r,intent:o.z.literal("publish"),reportHubId:e,clientTempId:n,report:c.nullable()}),delete:o.z.object({status:r,intent:o.z.literal("delete"),reportHubId:e,clientTempId:n}),toggleStar:o.z.object({status:r,intent:o.z.literal("toggleStar"),reportHubId:e,clientTempId:n,updatedStatus:a,operationTimestamp:s}),toggleRead:o.z.object({status:r,intent:o.z.literal("toggleRead"),reportHubId:e,clientTempId:n,updatedStatus:a,operationTimestamp:s}),addComment:o.z.object({status:r,intent:o.z.literal("addComment"),reportHubId:e,clientTempId:n,newComment:u}),deleteComment:o.z.object({status:r,intent:o.z.literal("deleteComment"),reportHubId:e,clientTempId:n,deletedCommentId:i}),clearCache:o.z.object({status:r,intent:o.z.literal("clearCache")})}},P=null,me=()=>(P===null&&(P=ce()),P),z=(e,n)=>{let r=me()[e].safeParse(n);return r.success?{result:r.data}:{mismatch:Y(r.error)}};var v="ids-stream",de=e=>{if(typeof e!="object"||e===null)return"unknown";let n=e;return typeof n.kind=="string"?n.kind==="chunk"?"chunk":n.kind==="error"?"error":"unknown":Array.isArray(n.items)?"chunk":typeof n.error=="string"?"error":"unknown"},F=e=>de(e)==="chunk";var V=Object.freeze({businessDate:"business-date",idsStream:v,report:"report",action:"action"}),K=Object.freeze({businessDate:"businessDate",reportHubId:"reportHubId",forceRefresh:"forceRefresh",cursorReportHubId:"cursor_report_hub_id",cursorBusinessDate:"cursor_business_date",cursorSnapshot:"cursor_snapshot"});var L=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),g=e=>Object.hasOwn(L,e);var Q="download",q="thumbnail",W="1",Z=(e,n,r)=>{let a=`${e}/attachment/${encodeURIComponent(n)}`;switch(r.kind){case"inline":return a;case"download":return`${a}?${new URLSearchParams({[Q]:W})}`;case"thumbnail":return`${a}?${new URLSearchParams({[q]:r.variant})}`}},G=e=>{let n=e.getAll(q),r=e.getAll(Q);if(n.length>0&&r.length>0)return{kind:"invalid",reason:"conflict"};if(n.length>0){let[a]=n;return n.length===1&&g(a)?{kind:"thumbnail",variant:a}:{kind:"invalid",reason:"thumbnail_variant"}}return r.length>0?r.length===1&&r[0]===W?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var ue=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var J=e=>e<10?`0${e}`:`${e}`,ye=e=>{if(Number.isNaN(e.getTime()))return null;let n=e.getFullYear(),r=J(e.getMonth()+1),a=J(e.getDate());return`${n}-${r}-${a}`},Re=e=>{let n=ue.exec(e);if(n===null)return null;let[,r,,a,s]=n,y=Number(r),l=Number(a),R=Number(s);if(y<1)return null;let h=new Date(0);return h.setUTCFullYear(y,l-1,R),h.getUTCFullYear()!==y||h.getUTCMonth()!==l-1||h.getUTCDate()!==R?null:`${r}-${a}-${s}`};var X=e=>e==null?null:e instanceof Date?ye(e):Re(e);var he=e=>typeof e=="string"?JSON.stringify(e):typeof e=="number"||typeof e=="boolean"||e===null||e===void 0?String(e):Array.isArray(e)?"array":typeof e,ee=(e,n,r)=>new RangeError(`[daily-report] ${e} must be ${n}; got ${he(r)}`);var te=(e,n,r,a)=>{if(typeof a!="string"||a.trim()==="")throw ee("mergeComments: unknownAuthorName","a non-blank string",a);let s=e.map((l,R)=>({id:`legacy-${R}`,authorName:l.name||a,content:l.text||"",isMine:!1,color:l.color||void 0,isLegacy:!0})),y=n.map(l=>({id:l.id,authorName:l.userName||a,content:l.content??"",createdAt:l.createdAt??"",isMine:r?l.userId===r:l.isMine,isLegacy:!1}));return[...s,...y]};0&&(module.exports={DAILY_REPORT_ACTION_FIELDS,DAILY_REPORT_ACTION_INTENTS,DAILY_REPORT_API_ENDPOINTS,DAILY_REPORT_API_QUERY_PARAMS,DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS,DAILY_REPORT_CLIENT_TEMP_ID_PATTERN,DAILY_REPORT_SSE_CURSOR_PARAM,DAILY_REPORT_SSE_HEARTBEAT_MS,DAILY_REPORT_SSE_TERMINAL_EVENTS,buildDailyReportAttachmentUrl,commentAddMessageSchema,commentDeleteMessageSchema,connectedMessageSchema,dailyReportDetailSchema,dailyReportExternalCommentSchema,dailyReportInterviewerSchema,dailyReportLabelDefSchema,dailyReportPostedCommentSchema,dailyReportSseMessageSchema,encodeDailyReportActionCommand,isDailyReportAttachmentThumbnailVariant,isDailyReportSseStreamId,isIdsStreamChunkLine,mergeComments,normalizeBusinessDateKey,parseDailyReportActionResult,parseDailyReportAttachmentQuery,reportCreateMessageSchema,reportDeleteMessageSchema,reportPublishMessageSchema,reportUpdateMessageSchema,statusUpdateMessageSchema});
1
+ "use strict";var D=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ae=Object.prototype.hasOwnProperty;var ie=(e,r)=>{for(var n in r)D(e,n,{get:r[n],enumerable:!0})},se=(e,r,n,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of oe(r))!ae.call(e,l)&&l!==n&&D(e,l,{get:()=>r[l],enumerable:!(a=ne(r,l))||a.enumerable});return e};var le=e=>se(D({},"__esModule",{value:!0}),e);var Se={};ie(Se,{DAILY_REPORT_ACTION_FIELDS:()=>p,DAILY_REPORT_ACTION_INTENTS:()=>B,DAILY_REPORT_API_ENDPOINTS:()=>F,DAILY_REPORT_API_QUERY_PARAMS:()=>V,DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS:()=>N,DAILY_REPORT_CLIENT_TEMP_ID_PATTERN:()=>m,DAILY_REPORT_SEARCH_COMBINES:()=>re,DAILY_REPORT_SSE_CURSOR_PARAM:()=>H,DAILY_REPORT_SSE_HEARTBEAT_MS:()=>k,DAILY_REPORT_SSE_TERMINAL_EVENTS:()=>L,buildDailyReportAttachmentUrl:()=>G,commentAddMessageSchema:()=>x,commentDeleteMessageSchema:()=>_,connectedMessageSchema:()=>A,dailyReportDetailSchema:()=>d,dailyReportExternalCommentSchema:()=>b,dailyReportInterviewerSchema:()=>I,dailyReportLabelDefSchema:()=>S,dailyReportPostedCommentSchema:()=>c,dailyReportSseMessageSchema:()=>Y,encodeDailyReportActionCommand:()=>$,isDailyReportAttachmentThumbnailVariant:()=>g,isDailyReportSseStreamId:()=>U,isIdsStreamChunkLine:()=>W,mergeComments:()=>te,normalizeBusinessDateKey:()=>J,parseDailyReportActionResult:()=>v,parseDailyReportAttachmentQuery:()=>X,reportCreateMessageSchema:()=>C,reportDeleteMessageSchema:()=>P,reportPublishMessageSchema:()=>O,reportUpdateMessageSchema:()=>E,statusUpdateMessageSchema:()=>f});module.exports=le(Se);var o=require("zod");var m=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|-[1-9][0-9]{0,15})$/;var w=require("zod");var i=w.z.number().int().positive().max(Number.MAX_SAFE_INTEGER);var t=require("zod");var L=["auth-required","forbidden","resync-required"],k=15e3,H="lastEventId",pe=/^\d{1,15}-\d{1,15}$/,U=e=>pe.test(e),I=t.z.object({name:t.z.string().nullish(),affiliation:t.z.string().nullish()}),b=t.z.object({name:t.z.string().nullish(),text:t.z.string().nullish(),color:t.z.string().nullish()}),S=t.z.object({id:i,name:t.z.string().nullish(),color:t.z.string().nullish()}),c=t.z.object({id:i,userId:t.z.string().nullish(),userName:t.z.string().nullish(),content:t.z.string().nullish(),createdAt:t.z.string().nullish(),isMine:t.z.boolean()}),de=t.z.object({id:t.z.string(),fileName:t.z.string(),fileType:t.z.string().nullable(),fileSize:t.z.number().nullable(),createdAt:t.z.string().nullable(),state:t.z.enum(["present","absent","unknown"]),hasThumbnail:t.z.boolean().default(!1)}),d=t.z.object({reportHubId:i,date:t.z.string().nullish(),createdAt:t.z.string().nullish(),author:t.z.string().nullish(),userId:t.z.string().nullish(),sourceType:t.z.string().nullish(),employeeName:t.z.string().nullish(),updatedBy:t.z.string().nullish(),updatedAt:t.z.string().nullish(),category:t.z.string().nullish(),creationCategory:t.z.string().nullish(),visitTimeFrom:t.z.string().nullish(),visitTimeTo:t.z.string().nullish(),customerName:t.z.string().nullish(),interviewers:t.z.array(I),subject:t.z.string().nullish(),content:t.z.string().nullish(),externalComments:t.z.array(b),isRead:t.z.boolean(),isStarred:t.z.boolean(),labels:t.z.array(S),postedComments:t.z.array(c),attachments:t.z.array(de).default([])}),u=t.z.string().regex(m),A=t.z.object({type:t.z.literal("connected")}),f=t.z.object({type:t.z.literal("status-update"),reportHubId:i,statusType:t.z.enum(["star","read"]),value:t.z.boolean(),clientTempId:u,recipientRawUserId:i.optional()}),T=t.z.string().optional(),x=t.z.object({type:t.z.literal("comment-add"),reportHubId:i,comment:c,clientTempId:u,recipientRawUserId:i.optional(),sourceType:T}),_=t.z.object({type:t.z.literal("comment-delete"),reportHubId:i,commentId:i,clientTempId:u,recipientRawUserId:i.optional(),sourceType:T}),C=t.z.object({type:t.z.literal("report-create"),reportHubId:i,report:d,clientTempId:u,recipientRawUserId:i.optional()}),E=t.z.object({type:t.z.literal("report-update"),reportHubId:i,report:d,clientTempId:u,recipientRawUserId:i.optional()}),O=t.z.object({type:t.z.literal("report-publish"),reportHubId:i,report:d,clientTempId:u,recipientRawUserId:i.optional()}),P=t.z.object({type:t.z.literal("report-delete"),reportHubId:i,clientTempId:u,sourceType:T}),Y=t.z.discriminatedUnion("type",[A,f,x,_,C,E,O,P]);var j=e=>e.issues.map(r=>`${r.path.length===0?"(root)":r.path.join(".")}: ${r.code}`).join("; ");var B=Object.freeze(["create","update","publish","delete","toggleStar","toggleRead","addComment","deleteComment","clearCache"]);var p=Object.freeze({intent:"intent",clientTempId:"clientTempId",businessDate:"businessDate",operationTimestamp:"operationTimestamp",reportHubId:"reportHubId",title:"title",content:"content",isStarred:"isStarred",isRead:"isRead",commentId:"commentId"}),$=e=>{let r=new FormData;if(r.append(p.intent,e.intent),e.intent==="clearCache"||(r.append(p.clientTempId,e.clientTempId),e.businessDate!==null&&r.append(p.businessDate,e.businessDate),e.operationTimestamp!==null&&r.append(p.operationTimestamp,String(e.operationTimestamp)),e.intent==="create"))return r;switch(r.append(p.reportHubId,String(e.reportHubId)),e.intent){case"update":return e.changes.title!==void 0&&r.append(p.title,e.changes.title),e.changes.content!==void 0&&r.append(p.content,e.changes.content),r;case"publish":case"delete":return r;case"toggleStar":return r.append(p.isStarred,String(e.value)),r;case"toggleRead":return r.append(p.isRead,String(e.value)),r;case"addComment":return r.append(p.content,e.content),r;case"deleteComment":return r.append(p.commentId,String(e.commentId)),r}},ue=()=>{let e=i,r=o.z.string().regex(m),n=o.z.literal("OK"),a=o.z.object({isStarred:o.z.boolean(),isRead:o.z.boolean()}),l=o.z.number().int().nonnegative().nullable();return{create:o.z.object({status:n,intent:o.z.literal("create"),reportHubId:e,clientTempId:r,report:d}),update:o.z.object({status:n,intent:o.z.literal("update"),reportHubId:e,clientTempId:r}),publish:o.z.object({status:n,intent:o.z.literal("publish"),reportHubId:e,clientTempId:r,report:d.nullable()}),delete:o.z.object({status:n,intent:o.z.literal("delete"),reportHubId:e,clientTempId:r}),toggleStar:o.z.object({status:n,intent:o.z.literal("toggleStar"),reportHubId:e,clientTempId:r,updatedStatus:a,operationTimestamp:l}),toggleRead:o.z.object({status:n,intent:o.z.literal("toggleRead"),reportHubId:e,clientTempId:r,updatedStatus:a,operationTimestamp:l}),addComment:o.z.object({status:n,intent:o.z.literal("addComment"),reportHubId:e,clientTempId:r,newComment:c}),deleteComment:o.z.object({status:n,intent:o.z.literal("deleteComment"),reportHubId:e,clientTempId:r,deletedCommentId:i}),clearCache:o.z.object({status:n,intent:o.z.literal("clearCache")})}},M=null,me=()=>(M===null&&(M=ue()),M),v=(e,r)=>{let n=me()[e].safeParse(r);return n.success?{result:n.data}:{mismatch:j(n.error)}};var z="ids-stream",ce=e=>{if(typeof e!="object"||e===null)return"unknown";let r=e;return typeof r.kind=="string"?r.kind==="chunk"?"chunk":r.kind==="error"?"error":"unknown":Array.isArray(r.items)?"chunk":typeof r.error=="string"?"error":"unknown"},W=e=>ce(e)==="chunk";var F=Object.freeze({businessDate:"business-date",idsStream:z,report:"report",search:"search",reports:"reports",searchMarks:"search-marks",action:"action"}),V=Object.freeze({businessDate:"businessDate",reportHubId:"reportHubId",searchQuery:"q",searchCombine:"combine",reportIds:"ids",forceRefresh:"forceRefresh",cursorReportHubId:"cursor_report_hub_id",cursorBusinessDate:"cursor_business_date",cursorSnapshot:"cursor_snapshot"});var N=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),g=e=>Object.hasOwn(N,e);var K="download",Q="thumbnail",q="1",G=(e,r,n)=>{let a=`${e}/attachment/${encodeURIComponent(r)}`;switch(n.kind){case"inline":return a;case"download":return`${a}?${new URLSearchParams({[K]:q})}`;case"thumbnail":return`${a}?${new URLSearchParams({[Q]:n.variant})}`}},X=e=>{let r=e.getAll(Q),n=e.getAll(K);if(r.length>0&&n.length>0)return{kind:"invalid",reason:"conflict"};if(r.length>0){let[a]=r;return r.length===1&&g(a)?{kind:"thumbnail",variant:a}:{kind:"invalid",reason:"thumbnail_variant"}}return n.length>0?n.length===1&&n[0]===q?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var ye=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var Z=e=>e<10?`0${e}`:`${e}`,Re=e=>{if(Number.isNaN(e.getTime()))return null;let r=e.getFullYear(),n=Z(e.getMonth()+1),a=Z(e.getDate());return`${r}-${n}-${a}`},he=e=>{let r=ye.exec(e);if(r===null)return null;let[,n,,a,l]=r,y=Number(n),s=Number(a),R=Number(l);if(y<1)return null;let h=new Date(0);return h.setUTCFullYear(y,s-1,R),h.getUTCFullYear()!==y||h.getUTCMonth()!==s-1||h.getUTCDate()!==R?null:`${n}-${a}-${l}`};var J=e=>e==null?null:e instanceof Date?Re(e):he(e);var ge=e=>typeof e=="string"?JSON.stringify(e):typeof e=="number"||typeof e=="boolean"||e===null||e===void 0?String(e):Array.isArray(e)?"array":typeof e,ee=(e,r,n)=>new RangeError(`[daily-report] ${e} must be ${r}; got ${ge(n)}`);var De="legacy-",Ie=e=>`${De}${e}`,te=(e,r,n,a)=>{if(typeof a!="string"||a.trim()==="")throw ee("mergeComments: unknownAuthorName","a non-blank string",a);let l=e.map((s,R)=>({id:Ie(R),authorName:s.name||a,content:s.text||"",isMine:!1,color:s.color||void 0,isLegacy:!0,isAuthorUnknown:!s.name})),y=r.map(s=>({id:s.id,authorName:s.userName||a,content:s.content??"",createdAt:s.createdAt??"",isMine:n?s.userId===n:s.isMine,isLegacy:!1,isAuthorUnknown:!s.userName}));return[...l,...y]};var re=["intersection","union"];var We=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100}),be=2;var Fe=2*(1+be);0&&(module.exports={DAILY_REPORT_ACTION_FIELDS,DAILY_REPORT_ACTION_INTENTS,DAILY_REPORT_API_ENDPOINTS,DAILY_REPORT_API_QUERY_PARAMS,DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS,DAILY_REPORT_CLIENT_TEMP_ID_PATTERN,DAILY_REPORT_SEARCH_COMBINES,DAILY_REPORT_SSE_CURSOR_PARAM,DAILY_REPORT_SSE_HEARTBEAT_MS,DAILY_REPORT_SSE_TERMINAL_EVENTS,buildDailyReportAttachmentUrl,commentAddMessageSchema,commentDeleteMessageSchema,connectedMessageSchema,dailyReportDetailSchema,dailyReportExternalCommentSchema,dailyReportInterviewerSchema,dailyReportLabelDefSchema,dailyReportPostedCommentSchema,dailyReportSseMessageSchema,encodeDailyReportActionCommand,isDailyReportAttachmentThumbnailVariant,isDailyReportSseStreamId,isIdsStreamChunkLine,mergeComments,normalizeBusinessDateKey,parseDailyReportActionResult,parseDailyReportAttachmentQuery,reportCreateMessageSchema,reportDeleteMessageSchema,reportPublishMessageSchema,reportUpdateMessageSchema,statusUpdateMessageSchema});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{z as o}from"zod";var u=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|-[1-9][0-9]{0,15})$/;import{z as Y}from"zod";var a=Y.number().int().positive().max(Number.MAX_SAFE_INTEGER);import{z as t}from"zod";var B=["auth-required","forbidden","resync-required"],$=15e3,z="lastEventId",v=/^\d{1,15}-\d{1,15}$/,F=e=>v.test(e),b=t.object({name:t.string().nullish(),affiliation:t.string().nullish()}),A=t.object({name:t.string().nullish(),text:t.string().nullish(),color:t.string().nullish()}),f=t.object({id:a,name:t.string().nullish(),color:t.string().nullish()}),y=t.object({id:a,userId:t.string().nullish(),userName:t.string().nullish(),content:t.string().nullish(),createdAt:t.string().nullish(),isMine:t.boolean()}),V=t.object({id:t.string(),fileName:t.string(),fileType:t.string().nullable(),fileSize:t.number().nullable(),createdAt:t.string().nullable(),state:t.enum(["present","absent","unknown"]),hasThumbnail:t.boolean().default(!1)}),c=t.object({reportHubId:a,date:t.string().nullish(),createdAt:t.string().nullish(),author:t.string().nullish(),userId:t.string().nullish(),sourceType:t.string().nullish(),employeeName:t.string().nullish(),updatedBy:t.string().nullish(),updatedAt:t.string().nullish(),category:t.string().nullish(),creationCategory:t.string().nullish(),visitTimeFrom:t.string().nullish(),visitTimeTo:t.string().nullish(),customerName:t.string().nullish(),interviewers:t.array(b),subject:t.string().nullish(),content:t.string().nullish(),externalComments:t.array(A),isRead:t.boolean(),isStarred:t.boolean(),labels:t.array(f),postedComments:t.array(y),attachments:t.array(V).default([])}),m=t.string().regex(u),S=t.object({type:t.literal("connected")}),T=t.object({type:t.literal("status-update"),reportHubId:a,statusType:t.enum(["star","read"]),value:t.boolean(),clientTempId:m,recipientRawUserId:a.optional()}),g=t.string().optional(),x=t.object({type:t.literal("comment-add"),reportHubId:a,comment:y,clientTempId:m,recipientRawUserId:a.optional(),sourceType:g}),_=t.object({type:t.literal("comment-delete"),reportHubId:a,commentId:a,clientTempId:m,recipientRawUserId:a.optional(),sourceType:g}),C=t.object({type:t.literal("report-create"),reportHubId:a,report:c,clientTempId:m,recipientRawUserId:a.optional()}),E=t.object({type:t.literal("report-update"),reportHubId:a,report:c,clientTempId:m,recipientRawUserId:a.optional()}),N=t.object({type:t.literal("report-publish"),reportHubId:a,report:c,clientTempId:m,recipientRawUserId:a.optional()}),M=t.object({type:t.literal("report-delete"),reportHubId:a,clientTempId:m,sourceType:g}),K=t.discriminatedUnion("type",[S,T,x,_,C,E,N,M]);var P=e=>e.issues.map(n=>`${n.path.length===0?"(root)":n.path.join(".")}: ${n.code}`).join("; ");var Q=Object.freeze(["create","update","publish","delete","toggleStar","toggleRead","addComment","deleteComment","clearCache"]);var l=Object.freeze({intent:"intent",clientTempId:"clientTempId",businessDate:"businessDate",operationTimestamp:"operationTimestamp",reportHubId:"reportHubId",title:"title",content:"content",isStarred:"isStarred",isRead:"isRead",commentId:"commentId"}),q=e=>{let n=new FormData;if(n.append(l.intent,e.intent),e.intent==="clearCache"||(n.append(l.clientTempId,e.clientTempId),e.businessDate!==null&&n.append(l.businessDate,e.businessDate),e.operationTimestamp!==null&&n.append(l.operationTimestamp,String(e.operationTimestamp)),e.intent==="create"))return n;switch(n.append(l.reportHubId,String(e.reportHubId)),e.intent){case"update":return e.changes.title!==void 0&&n.append(l.title,e.changes.title),e.changes.content!==void 0&&n.append(l.content,e.changes.content),n;case"publish":case"delete":return n;case"toggleStar":return n.append(l.isStarred,String(e.value)),n;case"toggleRead":return n.append(l.isRead,String(e.value)),n;case"addComment":return n.append(l.content,e.content),n;case"deleteComment":return n.append(l.commentId,String(e.commentId)),n}},W=()=>{let e=a,n=o.string().regex(u),r=o.literal("OK"),i=o.object({isStarred:o.boolean(),isRead:o.boolean()}),p=o.number().int().nonnegative().nullable();return{create:o.object({status:r,intent:o.literal("create"),reportHubId:e,clientTempId:n,report:c}),update:o.object({status:r,intent:o.literal("update"),reportHubId:e,clientTempId:n}),publish:o.object({status:r,intent:o.literal("publish"),reportHubId:e,clientTempId:n,report:c.nullable()}),delete:o.object({status:r,intent:o.literal("delete"),reportHubId:e,clientTempId:n}),toggleStar:o.object({status:r,intent:o.literal("toggleStar"),reportHubId:e,clientTempId:n,updatedStatus:i,operationTimestamp:p}),toggleRead:o.object({status:r,intent:o.literal("toggleRead"),reportHubId:e,clientTempId:n,updatedStatus:i,operationTimestamp:p}),addComment:o.object({status:r,intent:o.literal("addComment"),reportHubId:e,clientTempId:n,newComment:y}),deleteComment:o.object({status:r,intent:o.literal("deleteComment"),reportHubId:e,clientTempId:n,deletedCommentId:a}),clearCache:o.object({status:r,intent:o.literal("clearCache")})}},I=null,Z=()=>(I===null&&(I=W()),I),G=(e,n)=>{let r=Z()[e].safeParse(n);return r.success?{result:r.data}:{mismatch:P(r.error)}};var L="ids-stream",J=e=>{if(typeof e!="object"||e===null)return"unknown";let n=e;return typeof n.kind=="string"?n.kind==="chunk"?"chunk":n.kind==="error"?"error":"unknown":Array.isArray(n.items)?"chunk":typeof n.error=="string"?"error":"unknown"},X=e=>J(e)==="chunk";var ee=Object.freeze({businessDate:"business-date",idsStream:L,report:"report",action:"action"}),te=Object.freeze({businessDate:"businessDate",reportHubId:"reportHubId",forceRefresh:"forceRefresh",cursorReportHubId:"cursor_report_hub_id",cursorBusinessDate:"cursor_business_date",cursorSnapshot:"cursor_snapshot"});var O=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),D=e=>Object.hasOwn(O,e);var k="download",w="thumbnail",H="1",ne=(e,n,r)=>{let i=`${e}/attachment/${encodeURIComponent(n)}`;switch(r.kind){case"inline":return i;case"download":return`${i}?${new URLSearchParams({[k]:H})}`;case"thumbnail":return`${i}?${new URLSearchParams({[w]:r.variant})}`}},re=e=>{let n=e.getAll(w),r=e.getAll(k);if(n.length>0&&r.length>0)return{kind:"invalid",reason:"conflict"};if(n.length>0){let[i]=n;return n.length===1&&D(i)?{kind:"thumbnail",variant:i}:{kind:"invalid",reason:"thumbnail_variant"}}return r.length>0?r.length===1&&r[0]===H?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var oe=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var U=e=>e<10?`0${e}`:`${e}`,ae=e=>{if(Number.isNaN(e.getTime()))return null;let n=e.getFullYear(),r=U(e.getMonth()+1),i=U(e.getDate());return`${n}-${r}-${i}`},ie=e=>{let n=oe.exec(e);if(n===null)return null;let[,r,,i,p]=n,d=Number(r),s=Number(i),R=Number(p);if(d<1)return null;let h=new Date(0);return h.setUTCFullYear(d,s-1,R),h.getUTCFullYear()!==d||h.getUTCMonth()!==s-1||h.getUTCDate()!==R?null:`${r}-${i}-${p}`};var se=e=>e==null?null:e instanceof Date?ae(e):ie(e);var le=e=>typeof e=="string"?JSON.stringify(e):typeof e=="number"||typeof e=="boolean"||e===null||e===void 0?String(e):Array.isArray(e)?"array":typeof e,j=(e,n,r)=>new RangeError(`[daily-report] ${e} must be ${n}; got ${le(r)}`);var pe=(e,n,r,i)=>{if(typeof i!="string"||i.trim()==="")throw j("mergeComments: unknownAuthorName","a non-blank string",i);let p=e.map((s,R)=>({id:`legacy-${R}`,authorName:s.name||i,content:s.text||"",isMine:!1,color:s.color||void 0,isLegacy:!0})),d=n.map(s=>({id:s.id,authorName:s.userName||i,content:s.content??"",createdAt:s.createdAt??"",isMine:r?s.userId===r:s.isMine,isLegacy:!1}));return[...p,...d]};export{l as DAILY_REPORT_ACTION_FIELDS,Q as DAILY_REPORT_ACTION_INTENTS,ee as DAILY_REPORT_API_ENDPOINTS,te as DAILY_REPORT_API_QUERY_PARAMS,O as DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS,u as DAILY_REPORT_CLIENT_TEMP_ID_PATTERN,z as DAILY_REPORT_SSE_CURSOR_PARAM,$ as DAILY_REPORT_SSE_HEARTBEAT_MS,B as DAILY_REPORT_SSE_TERMINAL_EVENTS,ne as buildDailyReportAttachmentUrl,x as commentAddMessageSchema,_ as commentDeleteMessageSchema,S as connectedMessageSchema,c as dailyReportDetailSchema,A as dailyReportExternalCommentSchema,b as dailyReportInterviewerSchema,f as dailyReportLabelDefSchema,y as dailyReportPostedCommentSchema,K as dailyReportSseMessageSchema,q as encodeDailyReportActionCommand,D as isDailyReportAttachmentThumbnailVariant,F as isDailyReportSseStreamId,X as isIdsStreamChunkLine,pe as mergeComments,se as normalizeBusinessDateKey,G as parseDailyReportActionResult,re as parseDailyReportAttachmentQuery,C as reportCreateMessageSchema,M as reportDeleteMessageSchema,N as reportPublishMessageSchema,E as reportUpdateMessageSchema,T as statusUpdateMessageSchema};
1
+ import{z as o}from"zod";var c=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|-[1-9][0-9]{0,15})$/;import{z as j}from"zod";var a=j.number().int().positive().max(Number.MAX_SAFE_INTEGER);import{z as t}from"zod";var B=["auth-required","forbidden","resync-required"],$=15e3,v="lastEventId",z=/^\d{1,15}-\d{1,15}$/,W=e=>z.test(e),b=t.object({name:t.string().nullish(),affiliation:t.string().nullish()}),S=t.object({name:t.string().nullish(),text:t.string().nullish(),color:t.string().nullish()}),A=t.object({id:a,name:t.string().nullish(),color:t.string().nullish()}),y=t.object({id:a,userId:t.string().nullish(),userName:t.string().nullish(),content:t.string().nullish(),createdAt:t.string().nullish(),isMine:t.boolean()}),F=t.object({id:t.string(),fileName:t.string(),fileType:t.string().nullable(),fileSize:t.number().nullable(),createdAt:t.string().nullable(),state:t.enum(["present","absent","unknown"]),hasThumbnail:t.boolean().default(!1)}),d=t.object({reportHubId:a,date:t.string().nullish(),createdAt:t.string().nullish(),author:t.string().nullish(),userId:t.string().nullish(),sourceType:t.string().nullish(),employeeName:t.string().nullish(),updatedBy:t.string().nullish(),updatedAt:t.string().nullish(),category:t.string().nullish(),creationCategory:t.string().nullish(),visitTimeFrom:t.string().nullish(),visitTimeTo:t.string().nullish(),customerName:t.string().nullish(),interviewers:t.array(b),subject:t.string().nullish(),content:t.string().nullish(),externalComments:t.array(S),isRead:t.boolean(),isStarred:t.boolean(),labels:t.array(A),postedComments:t.array(y),attachments:t.array(F).default([])}),u=t.string().regex(c),f=t.object({type:t.literal("connected")}),T=t.object({type:t.literal("status-update"),reportHubId:a,statusType:t.enum(["star","read"]),value:t.boolean(),clientTempId:u,recipientRawUserId:a.optional()}),g=t.string().optional(),x=t.object({type:t.literal("comment-add"),reportHubId:a,comment:y,clientTempId:u,recipientRawUserId:a.optional(),sourceType:g}),_=t.object({type:t.literal("comment-delete"),reportHubId:a,commentId:a,clientTempId:u,recipientRawUserId:a.optional(),sourceType:g}),C=t.object({type:t.literal("report-create"),reportHubId:a,report:d,clientTempId:u,recipientRawUserId:a.optional()}),E=t.object({type:t.literal("report-update"),reportHubId:a,report:d,clientTempId:u,recipientRawUserId:a.optional()}),O=t.object({type:t.literal("report-publish"),reportHubId:a,report:d,clientTempId:u,recipientRawUserId:a.optional()}),P=t.object({type:t.literal("report-delete"),reportHubId:a,clientTempId:u,sourceType:g}),V=t.discriminatedUnion("type",[f,T,x,_,C,E,O,P]);var M=e=>e.issues.map(r=>`${r.path.length===0?"(root)":r.path.join(".")}: ${r.code}`).join("; ");var K=Object.freeze(["create","update","publish","delete","toggleStar","toggleRead","addComment","deleteComment","clearCache"]);var l=Object.freeze({intent:"intent",clientTempId:"clientTempId",businessDate:"businessDate",operationTimestamp:"operationTimestamp",reportHubId:"reportHubId",title:"title",content:"content",isStarred:"isStarred",isRead:"isRead",commentId:"commentId"}),Q=e=>{let r=new FormData;if(r.append(l.intent,e.intent),e.intent==="clearCache"||(r.append(l.clientTempId,e.clientTempId),e.businessDate!==null&&r.append(l.businessDate,e.businessDate),e.operationTimestamp!==null&&r.append(l.operationTimestamp,String(e.operationTimestamp)),e.intent==="create"))return r;switch(r.append(l.reportHubId,String(e.reportHubId)),e.intent){case"update":return e.changes.title!==void 0&&r.append(l.title,e.changes.title),e.changes.content!==void 0&&r.append(l.content,e.changes.content),r;case"publish":case"delete":return r;case"toggleStar":return r.append(l.isStarred,String(e.value)),r;case"toggleRead":return r.append(l.isRead,String(e.value)),r;case"addComment":return r.append(l.content,e.content),r;case"deleteComment":return r.append(l.commentId,String(e.commentId)),r}},q=()=>{let e=a,r=o.string().regex(c),n=o.literal("OK"),i=o.object({isStarred:o.boolean(),isRead:o.boolean()}),p=o.number().int().nonnegative().nullable();return{create:o.object({status:n,intent:o.literal("create"),reportHubId:e,clientTempId:r,report:d}),update:o.object({status:n,intent:o.literal("update"),reportHubId:e,clientTempId:r}),publish:o.object({status:n,intent:o.literal("publish"),reportHubId:e,clientTempId:r,report:d.nullable()}),delete:o.object({status:n,intent:o.literal("delete"),reportHubId:e,clientTempId:r}),toggleStar:o.object({status:n,intent:o.literal("toggleStar"),reportHubId:e,clientTempId:r,updatedStatus:i,operationTimestamp:p}),toggleRead:o.object({status:n,intent:o.literal("toggleRead"),reportHubId:e,clientTempId:r,updatedStatus:i,operationTimestamp:p}),addComment:o.object({status:n,intent:o.literal("addComment"),reportHubId:e,clientTempId:r,newComment:y}),deleteComment:o.object({status:n,intent:o.literal("deleteComment"),reportHubId:e,clientTempId:r,deletedCommentId:a}),clearCache:o.object({status:n,intent:o.literal("clearCache")})}},D=null,G=()=>(D===null&&(D=q()),D),X=(e,r)=>{let n=G()[e].safeParse(r);return n.success?{result:n.data}:{mismatch:M(n.error)}};var N="ids-stream",Z=e=>{if(typeof e!="object"||e===null)return"unknown";let r=e;return typeof r.kind=="string"?r.kind==="chunk"?"chunk":r.kind==="error"?"error":"unknown":Array.isArray(r.items)?"chunk":typeof r.error=="string"?"error":"unknown"},J=e=>Z(e)==="chunk";var ee=Object.freeze({businessDate:"business-date",idsStream:N,report:"report",search:"search",reports:"reports",searchMarks:"search-marks",action:"action"}),te=Object.freeze({businessDate:"businessDate",reportHubId:"reportHubId",searchQuery:"q",searchCombine:"combine",reportIds:"ids",forceRefresh:"forceRefresh",cursorReportHubId:"cursor_report_hub_id",cursorBusinessDate:"cursor_business_date",cursorSnapshot:"cursor_snapshot"});var w=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),I=e=>Object.hasOwn(w,e);var L="download",k="thumbnail",H="1",re=(e,r,n)=>{let i=`${e}/attachment/${encodeURIComponent(r)}`;switch(n.kind){case"inline":return i;case"download":return`${i}?${new URLSearchParams({[L]:H})}`;case"thumbnail":return`${i}?${new URLSearchParams({[k]:n.variant})}`}},ne=e=>{let r=e.getAll(k),n=e.getAll(L);if(r.length>0&&n.length>0)return{kind:"invalid",reason:"conflict"};if(r.length>0){let[i]=r;return r.length===1&&I(i)?{kind:"thumbnail",variant:i}:{kind:"invalid",reason:"thumbnail_variant"}}return n.length>0?n.length===1&&n[0]===H?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var oe=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var U=e=>e<10?`0${e}`:`${e}`,ae=e=>{if(Number.isNaN(e.getTime()))return null;let r=e.getFullYear(),n=U(e.getMonth()+1),i=U(e.getDate());return`${r}-${n}-${i}`},ie=e=>{let r=oe.exec(e);if(r===null)return null;let[,n,,i,p]=r,m=Number(n),s=Number(i),R=Number(p);if(m<1)return null;let h=new Date(0);return h.setUTCFullYear(m,s-1,R),h.getUTCFullYear()!==m||h.getUTCMonth()!==s-1||h.getUTCDate()!==R?null:`${n}-${i}-${p}`};var se=e=>e==null?null:e instanceof Date?ae(e):ie(e);var le=e=>typeof e=="string"?JSON.stringify(e):typeof e=="number"||typeof e=="boolean"||e===null||e===void 0?String(e):Array.isArray(e)?"array":typeof e,Y=(e,r,n)=>new RangeError(`[daily-report] ${e} must be ${r}; got ${le(n)}`);var pe="legacy-",de=e=>`${pe}${e}`,ue=(e,r,n,i)=>{if(typeof i!="string"||i.trim()==="")throw Y("mergeComments: unknownAuthorName","a non-blank string",i);let p=e.map((s,R)=>({id:de(R),authorName:s.name||i,content:s.text||"",isMine:!1,color:s.color||void 0,isLegacy:!0,isAuthorUnknown:!s.name})),m=r.map(s=>({id:s.id,authorName:s.userName||i,content:s.content??"",createdAt:s.createdAt??"",isMine:n?s.userId===n:s.isMine,isLegacy:!1,isAuthorUnknown:!s.userName}));return[...p,...m]};var me=["intersection","union"];var Ye=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100}),ce=2;var je=2*(1+ce);export{l as DAILY_REPORT_ACTION_FIELDS,K as DAILY_REPORT_ACTION_INTENTS,ee as DAILY_REPORT_API_ENDPOINTS,te as DAILY_REPORT_API_QUERY_PARAMS,w as DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS,c as DAILY_REPORT_CLIENT_TEMP_ID_PATTERN,me as DAILY_REPORT_SEARCH_COMBINES,v as DAILY_REPORT_SSE_CURSOR_PARAM,$ as DAILY_REPORT_SSE_HEARTBEAT_MS,B as DAILY_REPORT_SSE_TERMINAL_EVENTS,re as buildDailyReportAttachmentUrl,x as commentAddMessageSchema,_ as commentDeleteMessageSchema,f as connectedMessageSchema,d as dailyReportDetailSchema,S as dailyReportExternalCommentSchema,b as dailyReportInterviewerSchema,A as dailyReportLabelDefSchema,y as dailyReportPostedCommentSchema,V as dailyReportSseMessageSchema,Q as encodeDailyReportActionCommand,I as isDailyReportAttachmentThumbnailVariant,W as isDailyReportSseStreamId,J as isIdsStreamChunkLine,ue as mergeComments,se as normalizeBusinessDateKey,X as parseDailyReportActionResult,ne as parseDailyReportAttachmentQuery,C as reportCreateMessageSchema,P as reportDeleteMessageSchema,O as reportPublishMessageSchema,E as reportUpdateMessageSchema,T as statusUpdateMessageSchema};
@@ -0,0 +1,35 @@
1
+ declare const DAILY_REPORT_SEARCH_COMBINES: readonly [
2
+ "intersection",
3
+ "union"
4
+ ];
5
+ type DailyReportSearchCombine = (typeof DAILY_REPORT_SEARCH_COMBINES)[number];
6
+ type DailyReportSearchAlternativeTier = 0 | 1;
7
+ type DailyReportSearchAlternative = {
8
+ readonly text: string;
9
+ readonly tier: DailyReportSearchAlternativeTier;
10
+ };
11
+ type DailyReportSearchHit = {
12
+ readonly reportHubId: number;
13
+ readonly businessDate: string | null;
14
+ readonly sourceType: string;
15
+ };
16
+ interface DailyReportLogger {
17
+ debug(message?: unknown, ...optionalParams: unknown[]): void;
18
+ info(message?: unknown, ...optionalParams: unknown[]): void;
19
+ warn(message?: unknown, ...optionalParams: unknown[]): void;
20
+ error(message?: unknown, ...optionalParams: unknown[]): void;
21
+ }
22
+ type DailyReportSearchFieldMarks = {
23
+ readonly fingerprint: number;
24
+ readonly ranges: readonly number[];
25
+ };
26
+ type DailyReportSearchReportMarks = {
27
+ readonly reportHubId: number;
28
+ readonly matchedSets: number | null;
29
+ readonly fields: Readonly<Record<string, DailyReportSearchFieldMarks>>;
30
+ };
31
+ type DailyReportSearchMarksAnswer = {
32
+ readonly wordsDigest: number;
33
+ readonly reports: readonly DailyReportSearchReportMarks[];
34
+ };
35
+ export { DAILY_REPORT_SEARCH_COMBINES as D, type DailyReportLogger as a, type DailyReportSearchCombine as b, type DailyReportSearchFieldMarks as c, type DailyReportSearchHit as d, type DailyReportSearchMarksAnswer as e, type DailyReportSearchReportMarks as f, type DailyReportSearchAlternative as g, type DailyReportSearchAlternativeTier as h };
@@ -0,0 +1,35 @@
1
+ declare const DAILY_REPORT_SEARCH_COMBINES: readonly [
2
+ "intersection",
3
+ "union"
4
+ ];
5
+ type DailyReportSearchCombine = (typeof DAILY_REPORT_SEARCH_COMBINES)[number];
6
+ type DailyReportSearchAlternativeTier = 0 | 1;
7
+ type DailyReportSearchAlternative = {
8
+ readonly text: string;
9
+ readonly tier: DailyReportSearchAlternativeTier;
10
+ };
11
+ type DailyReportSearchHit = {
12
+ readonly reportHubId: number;
13
+ readonly businessDate: string | null;
14
+ readonly sourceType: string;
15
+ };
16
+ interface DailyReportLogger {
17
+ debug(message?: unknown, ...optionalParams: unknown[]): void;
18
+ info(message?: unknown, ...optionalParams: unknown[]): void;
19
+ warn(message?: unknown, ...optionalParams: unknown[]): void;
20
+ error(message?: unknown, ...optionalParams: unknown[]): void;
21
+ }
22
+ type DailyReportSearchFieldMarks = {
23
+ readonly fingerprint: number;
24
+ readonly ranges: readonly number[];
25
+ };
26
+ type DailyReportSearchReportMarks = {
27
+ readonly reportHubId: number;
28
+ readonly matchedSets: number | null;
29
+ readonly fields: Readonly<Record<string, DailyReportSearchFieldMarks>>;
30
+ };
31
+ type DailyReportSearchMarksAnswer = {
32
+ readonly wordsDigest: number;
33
+ readonly reports: readonly DailyReportSearchReportMarks[];
34
+ };
35
+ export { DAILY_REPORT_SEARCH_COMBINES as D, type DailyReportLogger as a, type DailyReportSearchCombine as b, type DailyReportSearchFieldMarks as c, type DailyReportSearchHit as d, type DailyReportSearchMarksAnswer as e, type DailyReportSearchReportMarks as f, type DailyReportSearchAlternative as g, type DailyReportSearchAlternativeTier as h };