@aiquants/daily-report 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/README.md +225 -50
- package/dist/client.d.mts +45 -16
- package/dist/client.d.ts +45 -16
- package/dist/client.js +4 -4
- package/dist/client.mjs +4 -4
- package/dist/{comment-adapter-BLfjD6P0.d.ts → comment-adapter-ChA4KOE1.d.mts} +71 -26
- package/dist/{comment-adapter-7TduiLiu.d.mts → comment-adapter-DqBqtqfA.d.ts} +71 -26
- package/dist/index.d.mts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/logger-BaxnzF-0.d.mts +17 -0
- package/dist/logger-BaxnzF-0.d.ts +17 -0
- package/dist/server.d.mts +252 -9
- package/dist/server.d.ts +252 -9
- package/dist/server.js +11 -4
- package/dist/server.mjs +11 -4
- package/dist/{sse-schema-DVIUaiAG.d.mts → sse-schema-getLS62T.d.mts} +1 -1
- package/dist/{sse-schema-DVIUaiAG.d.ts → sse-schema-getLS62T.d.ts} +1 -1
- package/dist/styles/daily-report.standalone.css +1 -1
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as DailyReportDetail,
|
|
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
|
-
} |
|
|
28
|
+
} | {
|
|
34
29
|
readonly intent: "create";
|
|
30
|
+
readonly clientTempId: ClientTempId;
|
|
35
31
|
readonly businessDate: string;
|
|
36
|
-
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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
|
|
72
|
+
type ActionResult = {
|
|
61
73
|
readonly status: "OK";
|
|
62
|
-
readonly 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
|
-
|
|
74
|
-
readonly
|
|
75
|
-
|
|
76
|
-
readonly
|
|
77
|
-
|
|
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
|
-
}
|
|
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
|
};
|
|
@@ -124,4 +169,4 @@ type UIComment = {
|
|
|
124
169
|
isLegacy: boolean;
|
|
125
170
|
};
|
|
126
171
|
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
|
|
172
|
+
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,
|
|
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
|
-
} |
|
|
28
|
+
} | {
|
|
34
29
|
readonly intent: "create";
|
|
30
|
+
readonly clientTempId: ClientTempId;
|
|
35
31
|
readonly businessDate: string;
|
|
36
|
-
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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
|
|
72
|
+
type ActionResult = {
|
|
61
73
|
readonly status: "OK";
|
|
62
|
-
readonly 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
|
-
|
|
74
|
-
readonly
|
|
75
|
-
|
|
76
|
-
readonly
|
|
77
|
-
|
|
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
|
-
}
|
|
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
|
};
|
|
@@ -124,4 +169,4 @@ type UIComment = {
|
|
|
124
169
|
isLegacy: boolean;
|
|
125
170
|
};
|
|
126
171
|
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
|
|
172
|
+
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,21 @@
|
|
|
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,
|
|
2
|
-
export {
|
|
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-ChA4KOE1.mjs";
|
|
2
|
+
export { D as DAILY_REPORT_SEARCH_COMBINES, a as DailyReportLogger, b as DailyReportSearchCombine, c as DailyReportSearchHit } from "./logger-BaxnzF-0.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";
|
|
8
11
|
readonly action: "action";
|
|
9
12
|
}>;
|
|
10
13
|
declare const DAILY_REPORT_API_QUERY_PARAMS: Readonly<{
|
|
11
14
|
readonly businessDate: "businessDate";
|
|
12
15
|
readonly reportHubId: "reportHubId";
|
|
16
|
+
readonly searchQuery: "q";
|
|
17
|
+
readonly searchCombine: "combine";
|
|
18
|
+
readonly reportIds: "ids";
|
|
13
19
|
readonly forceRefresh: "forceRefresh";
|
|
14
20
|
readonly cursorReportHubId: "cursor_report_hub_id";
|
|
15
21
|
readonly cursorBusinessDate: "cursor_business_date";
|
|
@@ -44,4 +50,4 @@ declare const parseDailyReportAttachmentQuery: (params: URLSearchParams) => Dail
|
|
|
44
50
|
type BusinessDateInput = string | Date | null | undefined;
|
|
45
51
|
declare const normalizeBusinessDateKey: (value: BusinessDateInput) => string | null;
|
|
46
52
|
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 };
|
|
53
|
+
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,21 @@
|
|
|
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,
|
|
2
|
-
export {
|
|
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-DqBqtqfA.js";
|
|
2
|
+
export { D as DAILY_REPORT_SEARCH_COMBINES, a as DailyReportLogger, b as DailyReportSearchCombine, c as DailyReportSearchHit } from "./logger-BaxnzF-0.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";
|
|
8
11
|
readonly action: "action";
|
|
9
12
|
}>;
|
|
10
13
|
declare const DAILY_REPORT_API_QUERY_PARAMS: Readonly<{
|
|
11
14
|
readonly businessDate: "businessDate";
|
|
12
15
|
readonly reportHubId: "reportHubId";
|
|
16
|
+
readonly searchQuery: "q";
|
|
17
|
+
readonly searchCombine: "combine";
|
|
18
|
+
readonly reportIds: "ids";
|
|
13
19
|
readonly forceRefresh: "forceRefresh";
|
|
14
20
|
readonly cursorReportHubId: "cursor_report_hub_id";
|
|
15
21
|
readonly cursorBusinessDate: "cursor_business_date";
|
|
@@ -44,4 +50,4 @@ declare const parseDailyReportAttachmentQuery: (params: URLSearchParams) => Dail
|
|
|
44
50
|
type BusinessDateInput = string | Date | null | undefined;
|
|
45
51
|
declare const normalizeBusinessDateKey: (value: BusinessDateInput) => string | null;
|
|
46
52
|
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 };
|
|
53
|
+
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 b=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ae=Object.prototype.hasOwnProperty;var ie=(e,n)=>{for(var r in n)b(e,r,{get:n[r],enumerable:!0})},se=(e,n,r,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of oe(n))!ae.call(e,s)&&s!==r&&b(e,s,{get:()=>n[s],enumerable:!(a=re(n,s))||a.enumerable});return e};var le=e=>se(b({},"__esModule",{value:!0}),e);var be={};ie(be,{DAILY_REPORT_ACTION_FIELDS:()=>p,DAILY_REPORT_ACTION_INTENTS:()=>B,DAILY_REPORT_API_ENDPOINTS:()=>V,DAILY_REPORT_API_QUERY_PARAMS:()=>F,DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS:()=>M,DAILY_REPORT_CLIENT_TEMP_ID_PATTERN:()=>m,DAILY_REPORT_SEARCH_COMBINES:()=>ne,DAILY_REPORT_SSE_CURSOR_PARAM:()=>H,DAILY_REPORT_SSE_HEARTBEAT_MS:()=>w,DAILY_REPORT_SSE_TERMINAL_EVENTS:()=>k,buildDailyReportAttachmentUrl:()=>Z,commentAddMessageSchema:()=>x,commentDeleteMessageSchema:()=>_,connectedMessageSchema:()=>S,dailyReportDetailSchema:()=>d,dailyReportExternalCommentSchema:()=>D,dailyReportInterviewerSchema:()=>h,dailyReportLabelDefSchema:()=>f,dailyReportPostedCommentSchema:()=>c,dailyReportSseMessageSchema:()=>U,encodeDailyReportActionCommand:()=>$,isDailyReportAttachmentThumbnailVariant:()=>I,isDailyReportSseStreamId:()=>j,isIdsStreamChunkLine:()=>K,mergeComments:()=>te,normalizeBusinessDateKey:()=>X,parseDailyReportActionResult:()=>z,parseDailyReportAttachmentQuery:()=>G,reportCreateMessageSchema:()=>C,reportDeleteMessageSchema:()=>P,reportPublishMessageSchema:()=>O,reportUpdateMessageSchema:()=>E,statusUpdateMessageSchema:()=>A});module.exports=le(be);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 L=require("zod");var i=L.z.number().int().positive().max(Number.MAX_SAFE_INTEGER);var t=require("zod");var k=["auth-required","forbidden","resync-required"],w=15e3,H="lastEventId",pe=/^\d{1,15}-\d{1,15}$/,j=e=>pe.test(e),h=t.z.object({name:t.z.string().nullish(),affiliation:t.z.string().nullish()}),D=t.z.object({name:t.z.string().nullish(),text:t.z.string().nullish(),color:t.z.string().nullish()}),f=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(h),subject:t.z.string().nullish(),content:t.z.string().nullish(),externalComments:t.z.array(D),isRead:t.z.boolean(),isStarred:t.z.boolean(),labels:t.z.array(f),postedComments:t.z.array(c),attachments:t.z.array(de).default([])}),u=t.z.string().regex(m),S=t.z.object({type:t.z.literal("connected")}),A=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}),U=t.z.discriminatedUnion("type",[S,A,x,_,C,E,O,P]);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}},ue=()=>{let e=i,n=o.z.string().regex(m),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:d}),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:d.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:c}),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")})}},N=null,me=()=>(N===null&&(N=ue()),N),z=(e,n)=>{let r=me()[e].safeParse(n);return r.success?{result:r.data}:{mismatch:Y(r.error)}};var v="ids-stream",ce=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"},K=e=>ce(e)==="chunk";var V=Object.freeze({businessDate:"business-date",idsStream:v,report:"report",search:"search",reports:"reports",action:"action"}),F=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 M=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),I=e=>Object.hasOwn(M,e);var W="download",Q="thumbnail",q="1",Z=(e,n,r)=>{let a=`${e}/attachment/${encodeURIComponent(n)}`;switch(r.kind){case"inline":return a;case"download":return`${a}?${new URLSearchParams({[W]:q})}`;case"thumbnail":return`${a}?${new URLSearchParams({[Q]:r.variant})}`}},G=e=>{let n=e.getAll(Q),r=e.getAll(W);if(n.length>0&&r.length>0)return{kind:"invalid",reason:"conflict"};if(n.length>0){let[a]=n;return n.length===1&&I(a)?{kind:"thumbnail",variant:a}:{kind:"invalid",reason:"thumbnail_variant"}}return r.length>0?r.length===1&&r[0]===q?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var ye=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var J=e=>e<10?`0${e}`:`${e}`,Re=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}`},ge=e=>{let n=ye.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 g=new Date(0);return g.setUTCFullYear(y,l-1,R),g.getUTCFullYear()!==y||g.getUTCMonth()!==l-1||g.getUTCDate()!==R?null:`${r}-${a}-${s}`};var X=e=>e==null?null:e instanceof Date?Re(e):ge(e);var Ie=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 ${Ie(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]};var ne=["intersection","union"];var $e=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100});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
|
|
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 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}$/,K=e=>v.test(e),D=t.object({name:t.string().nullish(),affiliation:t.string().nullish()}),f=t.object({name:t.string().nullish(),text:t.string().nullish(),color:t.string().nullish()}),S=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)}),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(D),subject:t.string().nullish(),content:t.string().nullish(),externalComments:t.array(f),isRead:t.boolean(),isStarred:t.boolean(),labels:t.array(S),postedComments:t.array(y),attachments:t.array(V).default([])}),u=t.string().regex(c),A=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()}),I=t.string().optional(),x=t.object({type:t.literal("comment-add"),reportHubId:a,comment:y,clientTempId:u,recipientRawUserId:a.optional(),sourceType:I}),_=t.object({type:t.literal("comment-delete"),reportHubId:a,commentId:a,clientTempId:u,recipientRawUserId:a.optional(),sourceType:I}),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:I}),F=t.discriminatedUnion("type",[A,T,x,_,C,E,O,P]);var N=e=>e.issues.map(n=>`${n.path.length===0?"(root)":n.path.join(".")}: ${n.code}`).join("; ");var W=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}},q=()=>{let e=a,n=o.string().regex(c),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:d}),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:d.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")})}},b=null,Z=()=>(b===null&&(b=q()),b),G=(e,n)=>{let r=Z()[e].safeParse(n);return r.success?{result:r.data}:{mismatch:N(r.error)}};var M="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:M,report:"report",search:"search",reports:"reports",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 L=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),h=e=>Object.hasOwn(L,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&&h(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 j=e=>e<10?`0${e}`:`${e}`,ae=e=>{if(Number.isNaN(e.getTime()))return null;let n=e.getFullYear(),r=j(e.getMonth()+1),i=j(e.getDate());return`${n}-${r}-${i}`},ie=e=>{let n=oe.exec(e);if(n===null)return null;let[,r,,i,p]=n,m=Number(r),s=Number(i),R=Number(p);if(m<1)return null;let g=new Date(0);return g.setUTCFullYear(m,s-1,R),g.getUTCFullYear()!==m||g.getUTCMonth()!==s-1||g.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,U=(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 U("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})),m=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,...m]};var de=["intersection","union"];var we=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100});export{l as DAILY_REPORT_ACTION_FIELDS,W as DAILY_REPORT_ACTION_INTENTS,ee as DAILY_REPORT_API_ENDPOINTS,te as DAILY_REPORT_API_QUERY_PARAMS,L as DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS,c as DAILY_REPORT_CLIENT_TEMP_ID_PATTERN,de as DAILY_REPORT_SEARCH_COMBINES,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,A as connectedMessageSchema,d as dailyReportDetailSchema,f as dailyReportExternalCommentSchema,D as dailyReportInterviewerSchema,S as dailyReportLabelDefSchema,y as dailyReportPostedCommentSchema,F as dailyReportSseMessageSchema,Q as encodeDailyReportActionCommand,h as isDailyReportAttachmentThumbnailVariant,K as isDailyReportSseStreamId,X as isIdsStreamChunkLine,pe as mergeComments,se as normalizeBusinessDateKey,G as parseDailyReportActionResult,re as parseDailyReportAttachmentQuery,C as reportCreateMessageSchema,P as reportDeleteMessageSchema,O as reportPublishMessageSchema,E as reportUpdateMessageSchema,T as statusUpdateMessageSchema};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const DAILY_REPORT_SEARCH_COMBINES: readonly [
|
|
2
|
+
"intersection",
|
|
3
|
+
"union"
|
|
4
|
+
];
|
|
5
|
+
type DailyReportSearchCombine = (typeof DAILY_REPORT_SEARCH_COMBINES)[number];
|
|
6
|
+
type DailyReportSearchHit = {
|
|
7
|
+
readonly reportHubId: number;
|
|
8
|
+
readonly businessDate: string | null;
|
|
9
|
+
readonly sourceType: string;
|
|
10
|
+
};
|
|
11
|
+
interface DailyReportLogger {
|
|
12
|
+
debug(message?: unknown, ...optionalParams: unknown[]): void;
|
|
13
|
+
info(message?: unknown, ...optionalParams: unknown[]): void;
|
|
14
|
+
warn(message?: unknown, ...optionalParams: unknown[]): void;
|
|
15
|
+
error(message?: unknown, ...optionalParams: unknown[]): void;
|
|
16
|
+
}
|
|
17
|
+
export { DAILY_REPORT_SEARCH_COMBINES as D, type DailyReportLogger as a, type DailyReportSearchCombine as b, type DailyReportSearchHit as c };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const DAILY_REPORT_SEARCH_COMBINES: readonly [
|
|
2
|
+
"intersection",
|
|
3
|
+
"union"
|
|
4
|
+
];
|
|
5
|
+
type DailyReportSearchCombine = (typeof DAILY_REPORT_SEARCH_COMBINES)[number];
|
|
6
|
+
type DailyReportSearchHit = {
|
|
7
|
+
readonly reportHubId: number;
|
|
8
|
+
readonly businessDate: string | null;
|
|
9
|
+
readonly sourceType: string;
|
|
10
|
+
};
|
|
11
|
+
interface DailyReportLogger {
|
|
12
|
+
debug(message?: unknown, ...optionalParams: unknown[]): void;
|
|
13
|
+
info(message?: unknown, ...optionalParams: unknown[]): void;
|
|
14
|
+
warn(message?: unknown, ...optionalParams: unknown[]): void;
|
|
15
|
+
error(message?: unknown, ...optionalParams: unknown[]): void;
|
|
16
|
+
}
|
|
17
|
+
export { DAILY_REPORT_SEARCH_COMBINES as D, type DailyReportLogger as a, type DailyReportSearchCombine as b, type DailyReportSearchHit as c };
|