@aiquants/daily-report 0.37.0 → 0.38.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 +43 -0
- package/README.md +83 -26
- package/dist/client.d.mts +33 -4
- package/dist/client.d.ts +33 -4
- package/dist/client.js +6 -6
- package/dist/client.mjs +6 -6
- package/dist/{comment-adapter-_h3W1duG.d.mts → comment-adapter-BsbOiHmX.d.mts} +1 -1
- package/dist/{comment-adapter-DOUwSlKf.d.ts → comment-adapter-CldlCy1v.d.ts} +1 -1
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/search-filters-wire-5MWi6GWu.d.mts +12 -0
- package/dist/search-filters-wire-5MWi6GWu.d.ts +12 -0
- package/dist/server.d.mts +78 -22
- package/dist/server.d.ts +78 -22
- package/dist/server.js +9 -9
- package/dist/server.mjs +9 -9
- package/dist/styles/daily-report.standalone.css +1 -1
- package/package.json +1 -1
- package/dist/{sse-schema-getLS62T.d.mts → sse-schema-byewDmZK.d.mts} +52 -52
- package/dist/{sse-schema-getLS62T.d.ts → sse-schema-byewDmZK.d.ts} +52 -52
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as DailyReportDetail, m as DailyReportPostedComment, D as DailyReportItem, j as DailyReportExternalComment } from "./sse-schema-
|
|
1
|
+
import { d as DailyReportDetail, m as DailyReportPostedComment, D as DailyReportItem, j as DailyReportExternalComment } from "./sse-schema-byewDmZK.mjs";
|
|
2
2
|
declare const DAILY_REPORT_ACTION_INTENTS: readonly [
|
|
3
3
|
"create",
|
|
4
4
|
"update",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as DailyReportDetail, m as DailyReportPostedComment, D as DailyReportItem, j as DailyReportExternalComment } from "./sse-schema-
|
|
1
|
+
import { d as DailyReportDetail, m as DailyReportPostedComment, D as DailyReportItem, j as DailyReportExternalComment } from "./sse-schema-byewDmZK.js";
|
|
2
2
|
declare const DAILY_REPORT_ACTION_INTENTS: readonly [
|
|
3
3
|
"create",
|
|
4
4
|
"update",
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
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-BsbOiHmX.mjs";
|
|
2
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-CZRU4q3h.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-
|
|
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-byewDmZK.mjs";
|
|
4
4
|
import "zod";
|
|
5
5
|
declare const DAILY_REPORT_API_ENDPOINTS: Readonly<{
|
|
6
6
|
readonly businessDate: "business-date";
|
|
@@ -9,6 +9,7 @@ declare const DAILY_REPORT_API_ENDPOINTS: Readonly<{
|
|
|
9
9
|
readonly search: "search";
|
|
10
10
|
readonly reports: "reports";
|
|
11
11
|
readonly searchMarks: "search-marks";
|
|
12
|
+
readonly searchFacets: "search-facets";
|
|
12
13
|
readonly action: "action";
|
|
13
14
|
}>;
|
|
14
15
|
declare const DAILY_REPORT_API_QUERY_PARAMS: Readonly<{
|
|
@@ -16,6 +17,9 @@ declare const DAILY_REPORT_API_QUERY_PARAMS: Readonly<{
|
|
|
16
17
|
readonly reportHubId: "reportHubId";
|
|
17
18
|
readonly searchQuery: "q";
|
|
18
19
|
readonly searchCombine: "combine";
|
|
20
|
+
readonly searchAuthor: "author";
|
|
21
|
+
readonly searchSourceType: "sourceType";
|
|
22
|
+
readonly searchCustomer: "customer";
|
|
19
23
|
readonly reportIds: "ids";
|
|
20
24
|
readonly forceRefresh: "forceRefresh";
|
|
21
25
|
readonly cursorReportHubId: "cursor_report_hub_id";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
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-CldlCy1v.js";
|
|
2
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-CZRU4q3h.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-
|
|
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-byewDmZK.js";
|
|
4
4
|
import "zod";
|
|
5
5
|
declare const DAILY_REPORT_API_ENDPOINTS: Readonly<{
|
|
6
6
|
readonly businessDate: "business-date";
|
|
@@ -9,6 +9,7 @@ declare const DAILY_REPORT_API_ENDPOINTS: Readonly<{
|
|
|
9
9
|
readonly search: "search";
|
|
10
10
|
readonly reports: "reports";
|
|
11
11
|
readonly searchMarks: "search-marks";
|
|
12
|
+
readonly searchFacets: "search-facets";
|
|
12
13
|
readonly action: "action";
|
|
13
14
|
}>;
|
|
14
15
|
declare const DAILY_REPORT_API_QUERY_PARAMS: Readonly<{
|
|
@@ -16,6 +17,9 @@ declare const DAILY_REPORT_API_QUERY_PARAMS: Readonly<{
|
|
|
16
17
|
readonly reportHubId: "reportHubId";
|
|
17
18
|
readonly searchQuery: "q";
|
|
18
19
|
readonly searchCombine: "combine";
|
|
20
|
+
readonly searchAuthor: "author";
|
|
21
|
+
readonly searchSourceType: "sourceType";
|
|
22
|
+
readonly searchCustomer: "customer";
|
|
19
23
|
readonly reportIds: "ids";
|
|
20
24
|
readonly forceRefresh: "forceRefresh";
|
|
21
25
|
readonly cursorReportHubId: "cursor_report_hub_id";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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 Ae={};ie(Ae,{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:()=>M,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:()=>S,dailyReportDetailSchema:()=>d,dailyReportExternalCommentSchema:()=>b,dailyReportInterviewerSchema:()=>I,dailyReportLabelDefSchema:()=>A,dailyReportPostedCommentSchema:()=>c,dailyReportSseMessageSchema:()=>Y,encodeDailyReportActionCommand:()=>$,isDailyReportAttachmentThumbnailVariant:()=>g,isDailyReportSseStreamId:()=>U,isIdsStreamChunkLine:()=>W,mergeComments:()=>te,normalizeBusinessDateKey:()=>J,parseDailyReportActionResult:()=>v,parseDailyReportAttachmentQuery:()=>X,reportCreateMessageSchema:()=>E,reportDeleteMessageSchema:()=>P,reportPublishMessageSchema:()=>O,reportUpdateMessageSchema:()=>C,statusUpdateMessageSchema:()=>f});module.exports=le(Ae);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 N=require("zod");var i=N.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()}),A=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(A),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")}),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}),E=t.z.object({type:t.z.literal("report-create"),reportHubId:i,report:d,clientTempId:u,recipientRawUserId:i.optional()}),C=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",[S,f,x,_,E,C,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")})}},w=null,me=()=>(w===null&&(w=ue()),w),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 M=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),g=e=>Object.hasOwn(M,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=Object.freeze({word:0,reading:1});var Ve=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});
|
|
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 Ae={};ie(Ae,{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:()=>M,DAILY_REPORT_CLIENT_TEMP_ID_PATTERN:()=>c,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:()=>S,dailyReportDetailSchema:()=>d,dailyReportExternalCommentSchema:()=>b,dailyReportInterviewerSchema:()=>I,dailyReportLabelDefSchema:()=>A,dailyReportPostedCommentSchema:()=>m,dailyReportSseMessageSchema:()=>Y,encodeDailyReportActionCommand:()=>$,isDailyReportAttachmentThumbnailVariant:()=>g,isDailyReportSseStreamId:()=>U,isIdsStreamChunkLine:()=>W,mergeComments:()=>te,normalizeBusinessDateKey:()=>J,parseDailyReportActionResult:()=>v,parseDailyReportAttachmentQuery:()=>X,reportCreateMessageSchema:()=>E,reportDeleteMessageSchema:()=>P,reportPublishMessageSchema:()=>O,reportUpdateMessageSchema:()=>C,statusUpdateMessageSchema:()=>f});module.exports=le(Ae);var o=require("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})$/;var N=require("zod");var i=N.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()}),A=t.z.object({id:i,name:t.z.string().nullish(),color:t.z.string().nullish()}),m=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(A),postedComments:t.z.array(m),attachments:t.z.array(de).default([])}),u=t.z.string().regex(c),S=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:m,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}),E=t.z.object({type:t.z.literal("report-create"),reportHubId:i,report:d,clientTempId:u,recipientRawUserId:i.optional()}),C=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",[S,f,x,_,E,C,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(c),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:m}),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")})}},w=null,ce=()=>(w===null&&(w=ue()),w),v=(e,r)=>{let n=ce()[e].safeParse(r);return n.success?{result:n.data}:{mismatch:j(n.error)}};var z="ids-stream",me=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=>me(e)==="chunk";var F=Object.freeze({businessDate:"business-date",idsStream:z,report:"report",search:"search",reports:"reports",searchMarks:"search-marks",searchFacets:"search-facets",action:"action"}),V=Object.freeze({businessDate:"businessDate",reportHubId:"reportHubId",searchQuery:"q",searchCombine:"combine",searchAuthor:"author",searchSourceType:"sourceType",searchCustomer:"customer",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})}),g=e=>Object.hasOwn(M,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=Object.freeze({word:0,reading:1});var Ve=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
|
|
1
|
+
import{z as o}from"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})$/;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()}),A=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()}),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(A),isRead:t.boolean(),isStarred:t.boolean(),labels:t.array(S),postedComments:t.array(y),attachments:t.array(F).default([])}),u=t.string().regex(m),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}),E=t.object({type:t.literal("report-create"),reportHubId:a,report:d,clientTempId:u,recipientRawUserId:a.optional()}),C=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,_,E,C,O,P]);var w=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(m),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:w(n.error)}};var M="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:M,report:"report",search:"search",reports:"reports",searchMarks:"search-marks",searchFacets:"search-facets",action:"action"}),te=Object.freeze({businessDate:"businessDate",reportHubId:"reportHubId",searchQuery:"q",searchCombine:"combine",searchAuthor:"author",searchSourceType:"sourceType",searchCustomer:"customer",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})}),I=e=>Object.hasOwn(N,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,c=Number(n),s=Number(i),R=Number(p);if(c<1)return null;let h=new Date(0);return h.setUTCFullYear(c,s-1,R),h.getUTCFullYear()!==c||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})),c=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,...c]};var ce=["intersection","union"];var Ye=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100}),me=2;var je=Object.freeze({word:0,reading:1});var Be=2*(1+me);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,N as DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS,m as DAILY_REPORT_CLIENT_TEMP_ID_PATTERN,ce 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,A as dailyReportExternalCommentSchema,b as dailyReportInterviewerSchema,S 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,E as reportCreateMessageSchema,P as reportDeleteMessageSchema,O as reportPublishMessageSchema,C as reportUpdateMessageSchema,T as statusUpdateMessageSchema};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const DAILY_REPORT_SEARCH_FILTER_FACETS: readonly [
|
|
2
|
+
"author",
|
|
3
|
+
"sourceType",
|
|
4
|
+
"customer"
|
|
5
|
+
];
|
|
6
|
+
type DailyReportSearchFilterFacet = (typeof DAILY_REPORT_SEARCH_FILTER_FACETS)[number];
|
|
7
|
+
type DailyReportSearchFacets = {
|
|
8
|
+
readonly sourceTypes: readonly string[];
|
|
9
|
+
readonly authors: readonly string[];
|
|
10
|
+
readonly customers: readonly string[];
|
|
11
|
+
};
|
|
12
|
+
export { type DailyReportSearchFilterFacet as D, DAILY_REPORT_SEARCH_FILTER_FACETS as a, type DailyReportSearchFacets as b };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const DAILY_REPORT_SEARCH_FILTER_FACETS: readonly [
|
|
2
|
+
"author",
|
|
3
|
+
"sourceType",
|
|
4
|
+
"customer"
|
|
5
|
+
];
|
|
6
|
+
type DailyReportSearchFilterFacet = (typeof DAILY_REPORT_SEARCH_FILTER_FACETS)[number];
|
|
7
|
+
type DailyReportSearchFacets = {
|
|
8
|
+
readonly sourceTypes: readonly string[];
|
|
9
|
+
readonly authors: readonly string[];
|
|
10
|
+
readonly customers: readonly string[];
|
|
11
|
+
};
|
|
12
|
+
export { type DailyReportSearchFilterFacet as D, DAILY_REPORT_SEARCH_FILTER_FACETS as a, type DailyReportSearchFacets as b };
|
package/dist/server.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { c as DailyReportSseMessage, k as DailyReportInterviewer, j as DailyReportExternalComment, D as DailyReportItem, d as DailyReportDetail, i as DailyReportAttachmentSummary, m as DailyReportPostedComment } from "./sse-schema-
|
|
1
|
+
import { c as DailyReportSseMessage, k as DailyReportInterviewer, j as DailyReportExternalComment, D as DailyReportItem, d as DailyReportDetail, i as DailyReportAttachmentSummary, m as DailyReportPostedComment } from "./sse-schema-byewDmZK.mjs";
|
|
2
2
|
import * as drizzle_orm_mssql_core from "drizzle-orm/mssql-core";
|
|
3
3
|
import { AnyMsSqlColumn } from "drizzle-orm/mssql-core";
|
|
4
4
|
import { a as DailyReportLogger, b as DailyReportSearchCombine, g as DailyReportSearchAlternative, d as DailyReportSearchHit, e as DailyReportSearchMarksAnswer } from "./search-marks-wire-CZRU4q3h.mjs";
|
|
5
5
|
export { h as DailyReportSearchAlternativeTier } from "./search-marks-wire-CZRU4q3h.mjs";
|
|
6
6
|
import { TransactionRetryOptions } from "@aiquants/mssql";
|
|
7
|
+
import { b as DailyReportSearchFacets } from "./search-filters-wire-5MWi6GWu.mjs";
|
|
7
8
|
import { SQL } from "drizzle-orm";
|
|
8
9
|
import "zod";
|
|
9
10
|
type RedisStreamMessage = {
|
|
@@ -195,6 +196,38 @@ type DailyReportExternalSource = {
|
|
|
195
196
|
mapRow: (row: Record<string, unknown>) => ExternalReportFields;
|
|
196
197
|
};
|
|
197
198
|
declare const transformJsonArray: <TRaw, TResult>(payload: string | null, label: string, mapper: (raw: TRaw) => TResult | null, logger?: DailyReportLogger) => TResult[];
|
|
199
|
+
type VisibleSourceTypeSet = ReadonlySet<string> | null;
|
|
200
|
+
declare class DailyReportViewerScope {
|
|
201
|
+
#private;
|
|
202
|
+
private constructor();
|
|
203
|
+
get visible(): VisibleSourceTypeSet;
|
|
204
|
+
get commentable(): VisibleSourceTypeSet;
|
|
205
|
+
static restrictTo(input: readonly string[] | DailyReportVisibilityDimensions): DailyReportViewerScope;
|
|
206
|
+
static unrestricted(auditReason: string): DailyReportViewerScope;
|
|
207
|
+
}
|
|
208
|
+
type DailyReportSearchWord = {
|
|
209
|
+
readonly alternatives: readonly DailyReportSearchAlternative[];
|
|
210
|
+
};
|
|
211
|
+
type DailyReportSearchSet = {
|
|
212
|
+
readonly words: readonly DailyReportSearchWord[];
|
|
213
|
+
};
|
|
214
|
+
type DailyReportSearchPlan = {
|
|
215
|
+
readonly combine: DailyReportSearchCombine;
|
|
216
|
+
readonly sets: readonly DailyReportSearchSet[];
|
|
217
|
+
};
|
|
218
|
+
type DailyReportSearchNameFilter = readonly [
|
|
219
|
+
string,
|
|
220
|
+
...string[]
|
|
221
|
+
];
|
|
222
|
+
type DailyReportSearchFilters = {
|
|
223
|
+
readonly sourceTypes: ReadonlySet<string> | null;
|
|
224
|
+
readonly authors: DailyReportSearchNameFilter | null;
|
|
225
|
+
readonly customers: DailyReportSearchNameFilter | null;
|
|
226
|
+
};
|
|
227
|
+
type DailyReportSearchCriteria = {
|
|
228
|
+
readonly plan: DailyReportSearchPlan | null;
|
|
229
|
+
readonly filters: DailyReportSearchFilters;
|
|
230
|
+
};
|
|
198
231
|
declare const CLIENT_TEMP_ID_BRAND: unique symbol;
|
|
199
232
|
type DailyReportClientTempId = string & {
|
|
200
233
|
readonly [CLIENT_TEMP_ID_BRAND]: true;
|
|
@@ -1490,6 +1523,8 @@ type DailyReportSearchDocumentTable = {
|
|
|
1490
1523
|
normalizerVersion: AnyMsSqlColumn;
|
|
1491
1524
|
indexedAt: AnyMsSqlColumn;
|
|
1492
1525
|
rowVersion: AnyMsSqlColumn;
|
|
1526
|
+
authorName: AnyMsSqlColumn;
|
|
1527
|
+
customerName: AnyMsSqlColumn;
|
|
1493
1528
|
};
|
|
1494
1529
|
type DailyReportSearchCommentTable = {
|
|
1495
1530
|
hubId: AnyMsSqlColumn;
|
|
@@ -1608,6 +1643,44 @@ declare function defineDailyReportSearchSchema<S extends string>(schemaName: S):
|
|
|
1608
1643
|
identity: undefined;
|
|
1609
1644
|
generated: undefined;
|
|
1610
1645
|
}, {}>;
|
|
1646
|
+
authorName: drizzle_orm_mssql_core.MsSqlColumn<{
|
|
1647
|
+
name: string;
|
|
1648
|
+
tableName: "DailyReportSearchDocument";
|
|
1649
|
+
dataType: "string";
|
|
1650
|
+
data: string;
|
|
1651
|
+
driverParam: string | number;
|
|
1652
|
+
notNull: false;
|
|
1653
|
+
hasDefault: false;
|
|
1654
|
+
isPrimaryKey: false;
|
|
1655
|
+
isAutoincrement: false;
|
|
1656
|
+
hasRuntimeDefault: false;
|
|
1657
|
+
enumValues: [
|
|
1658
|
+
string,
|
|
1659
|
+
...string[]
|
|
1660
|
+
];
|
|
1661
|
+
baseColumn: never;
|
|
1662
|
+
identity: undefined;
|
|
1663
|
+
generated: undefined;
|
|
1664
|
+
}, {}>;
|
|
1665
|
+
customerName: drizzle_orm_mssql_core.MsSqlColumn<{
|
|
1666
|
+
name: string;
|
|
1667
|
+
tableName: "DailyReportSearchDocument";
|
|
1668
|
+
dataType: "string";
|
|
1669
|
+
data: string;
|
|
1670
|
+
driverParam: string | number;
|
|
1671
|
+
notNull: false;
|
|
1672
|
+
hasDefault: false;
|
|
1673
|
+
isPrimaryKey: false;
|
|
1674
|
+
isAutoincrement: false;
|
|
1675
|
+
hasRuntimeDefault: false;
|
|
1676
|
+
enumValues: [
|
|
1677
|
+
string,
|
|
1678
|
+
...string[]
|
|
1679
|
+
];
|
|
1680
|
+
baseColumn: never;
|
|
1681
|
+
identity: undefined;
|
|
1682
|
+
generated: undefined;
|
|
1683
|
+
}, {}>;
|
|
1611
1684
|
};
|
|
1612
1685
|
dialect: "mssql";
|
|
1613
1686
|
}>;
|
|
@@ -1712,25 +1785,6 @@ type DailyReportSearchReconcileOptions = {
|
|
|
1712
1785
|
readonly signal?: AbortSignal;
|
|
1713
1786
|
readonly onProgress?: (progress: DailyReportSearchReconcileProgress) => void;
|
|
1714
1787
|
};
|
|
1715
|
-
type DailyReportSearchWord = {
|
|
1716
|
-
readonly alternatives: readonly DailyReportSearchAlternative[];
|
|
1717
|
-
};
|
|
1718
|
-
type DailyReportSearchSet = {
|
|
1719
|
-
readonly words: readonly DailyReportSearchWord[];
|
|
1720
|
-
};
|
|
1721
|
-
type DailyReportSearchPlan = {
|
|
1722
|
-
readonly combine: DailyReportSearchCombine;
|
|
1723
|
-
readonly sets: readonly DailyReportSearchSet[];
|
|
1724
|
-
};
|
|
1725
|
-
type VisibleSourceTypeSet = ReadonlySet<string> | null;
|
|
1726
|
-
declare class DailyReportViewerScope {
|
|
1727
|
-
#private;
|
|
1728
|
-
private constructor();
|
|
1729
|
-
get visible(): VisibleSourceTypeSet;
|
|
1730
|
-
get commentable(): VisibleSourceTypeSet;
|
|
1731
|
-
static restrictTo(input: readonly string[] | DailyReportVisibilityDimensions): DailyReportViewerScope;
|
|
1732
|
-
static unrestricted(auditReason: string): DailyReportViewerScope;
|
|
1733
|
-
}
|
|
1734
1788
|
type DailyReportHubRow = {
|
|
1735
1789
|
id: number;
|
|
1736
1790
|
sourceType: string;
|
|
@@ -1843,6 +1897,7 @@ declare function createDailyReportService(config: DailyReportServiceConfig): {
|
|
|
1843
1897
|
concurrency: number;
|
|
1844
1898
|
rateLimitPerMinute: number;
|
|
1845
1899
|
} | null;
|
|
1900
|
+
searchFilterSourceTypes: readonly string[];
|
|
1846
1901
|
clearCache: () => Promise<void>;
|
|
1847
1902
|
invalidateHubReadCaches: (hubIds: readonly number[], businessDates: readonly string[]) => Promise<void>;
|
|
1848
1903
|
getUserIdByExternalId: (externalId: string) => Promise<number | null>;
|
|
@@ -1857,10 +1912,11 @@ declare function createDailyReportService(config: DailyReportServiceConfig): {
|
|
|
1857
1912
|
getDailyReportDetailByIdByExternalId: (scope: DailyReportViewerScope, reportHubId: number, externalId: string, options?: SqlResultCacheQueryOptions) => Promise<DailyReportDetail | null>;
|
|
1858
1913
|
getDailyReportDetailsByIdsByExternalId: (scope: DailyReportViewerScope, reportHubIds: readonly number[], externalId: string) => Promise<DailyReportDetail[]>;
|
|
1859
1914
|
getDraftLabelId: () => Promise<number | null>;
|
|
1860
|
-
searchDailyReports: (scope: DailyReportViewerScope, userId: number,
|
|
1915
|
+
searchDailyReports: (scope: DailyReportViewerScope, userId: number, criteria: DailyReportSearchCriteria) => Promise<DailyReportSearchHit[]>;
|
|
1861
1916
|
markDailyReportSearchHits: (scope: DailyReportViewerScope, userId: number, plan: DailyReportSearchPlan, reportHubIds: readonly number[], options: {
|
|
1862
1917
|
readonly signal: AbortSignal;
|
|
1863
1918
|
}) => Promise<DailyReportSearchMarksAnswer>;
|
|
1919
|
+
listDailyReportSearchFacets: (scope: DailyReportViewerScope, userId: number) => Promise<DailyReportSearchFacets>;
|
|
1864
1920
|
reconcileSearchIndex: (options: DailyReportSearchReconcileOptions) => Promise<DailyReportSearchReconcileSummary>;
|
|
1865
1921
|
getAttachmentsByHubIds: (hubIds: number[]) => Promise<Map<number, DailyReportAttachmentSummary[]>>;
|
|
1866
1922
|
getAttachmentForUser: (scope: DailyReportViewerScope, attachmentId: number, userId: number) => Promise<{
|
|
@@ -2064,4 +2120,4 @@ type DailyReportServer = DailyReportHandlers & {
|
|
|
2064
2120
|
knownSourceTypes: readonly string[];
|
|
2065
2121
|
};
|
|
2066
2122
|
declare function createDailyReportServer(config: DailyReportServerConfig): DailyReportServer;
|
|
2067
|
-
export { DAILY_REPORT_ATTACHMENT_THUMBNAIL_MAX_OUTPUT_BYTES, DAILY_REPORT_ATTACHMENT_THUMBNAIL_OUTPUT_MEDIA_TYPES, DAILY_REPORT_SHARP_THUMBNAIL_DECODE_BUDGET_BYTES, DAILY_REPORT_SHARP_THUMBNAIL_DECODE_WORK_MODEL, DAILY_REPORT_SHARP_THUMBNAIL_WORKING_SET_MODEL, DAILY_REPORT_SSE_CATCH_UP_BATCH, DAILY_REPORT_SSE_VISIBILITY_REFRESH_MS, type DailyReportAttachmentBytes, type DailyReportAttachmentDelivery, type DailyReportAttachmentError, type DailyReportAttachmentFailure, type DailyReportAttachmentTable, type DailyReportAttachmentThumbnail, type AttachmentThumbnailDelivery as DailyReportAttachmentThumbnailDelivery, type DailyReportAttachmentThumbnailError, type DailyReportAttachmentThumbnailFailure, type DailyReportAttachmentThumbnailOutputMediaType, type DailyReportAttachmentThumbnailRenderer, type DailyReportAttachmentThumbnailSourceFormat, type DailyReportAttachmentThumbnailsConfig, type DailyReportAttachmentsConfig, type DailyReportAuthResult, type DailyReportAuthenticate, type DailyReportClientTempId, type DailyReportCommentTable, type DailyReportDb, type DeleteChain as DailyReportDbDeleteChain, type InsertChain as DailyReportDbInsertChain, type Rows as DailyReportDbRows, type SelectChain as DailyReportDbSelectChain, type UpdateChain as DailyReportDbUpdateChain, type DailyReportEncodeUserId, type EpochStore as DailyReportEpochStore, type DailyReportExternalSource, type DailyReportHandlers, type DailyReportHandlersConfig, type DailyReportHubLabelTable, type DailyReportHubRow, type DailyReportHubTable, type DailyReportIdCodec, type DailyReportIdsSource, type DailyReportInternalRow, type DailyReportInternalTable, type DailyReportLabelTable, type DailyReportReadAttachment, type DailyReportRedisBlockingClient, type DailyReportRedisClient, type DailyReportRedisProvider, type RedisStreamMessage as DailyReportRedisStreamMessage, type DailyReportResolveUserId, type DailyReportResolveVisibleSourceTypes, type ResourceRouteArgs as DailyReportResourceRouteArgs, DailyReportSearchAlternative, type DailyReportSearchCommentTable, type DailyReportSearchConfig, type DailyReportSearchDocumentTable, type DailyReportSearchPlan, type DailyReportSearchReconcileOptions, type DailyReportSearchReconcileProgress, type DailyReportSearchReconcileSummary, type DailyReportSearchSet, type DailyReportSearchSourceTextReader, type DailyReportSearchSqlExecutor, type DailyReportSearchTables, type DailyReportSearchWord, type DailyReportServer, type DailyReportServerConfig, type DailyReportService, type DailyReportServiceConfig, type SharpHeaderLike as DailyReportSharpHeaderLike, type SharpPipelineLike as DailyReportSharpPipelineLike, type SqlResultCacheMissAdmission as DailyReportSqlResultCacheMissAdmission, type SqlResultCacheQueryOptions as DailyReportSqlResultCacheQueryOptions, type DailyReportSseEntryMessage, DailyReportSseReader, type DailyReportSseReaderConfig, type DailyReportSseReaderPort, type DailyReportTables, type DailyReportUserStatusRow, type DailyReportUserStatusTable, type DailyReportUserTable, DailyReportViewerScope, type DailyReportVisibilityDimensions, type DailyReportVisibilityResolveContext, type DailyReportVisibilityResolveReason, type VisibleSourceTypeSet as DailyReportVisibleSourceTypeSet, type DailyReportVisibleSourceTypes, type ExternalReportFields, type SharpLike, SqlResultCache, type StreamEntry, createDailyReportHandlers, createDailyReportServer, createDailyReportService, createEpochStore, createSharpThumbnailRenderer, defineDailyReportSchema, defineDailyReportSearchSchema, isStreamIdLte, parseClientTempId, predictSharpThumbnailWorkingSetBytes, readSseStreamEntry as readDailyReportSseStreamEntry, transformJsonArray };
|
|
2123
|
+
export { DAILY_REPORT_ATTACHMENT_THUMBNAIL_MAX_OUTPUT_BYTES, DAILY_REPORT_ATTACHMENT_THUMBNAIL_OUTPUT_MEDIA_TYPES, DAILY_REPORT_SHARP_THUMBNAIL_DECODE_BUDGET_BYTES, DAILY_REPORT_SHARP_THUMBNAIL_DECODE_WORK_MODEL, DAILY_REPORT_SHARP_THUMBNAIL_WORKING_SET_MODEL, DAILY_REPORT_SSE_CATCH_UP_BATCH, DAILY_REPORT_SSE_VISIBILITY_REFRESH_MS, type DailyReportAttachmentBytes, type DailyReportAttachmentDelivery, type DailyReportAttachmentError, type DailyReportAttachmentFailure, type DailyReportAttachmentTable, type DailyReportAttachmentThumbnail, type AttachmentThumbnailDelivery as DailyReportAttachmentThumbnailDelivery, type DailyReportAttachmentThumbnailError, type DailyReportAttachmentThumbnailFailure, type DailyReportAttachmentThumbnailOutputMediaType, type DailyReportAttachmentThumbnailRenderer, type DailyReportAttachmentThumbnailSourceFormat, type DailyReportAttachmentThumbnailsConfig, type DailyReportAttachmentsConfig, type DailyReportAuthResult, type DailyReportAuthenticate, type DailyReportClientTempId, type DailyReportCommentTable, type DailyReportDb, type DeleteChain as DailyReportDbDeleteChain, type InsertChain as DailyReportDbInsertChain, type Rows as DailyReportDbRows, type SelectChain as DailyReportDbSelectChain, type UpdateChain as DailyReportDbUpdateChain, type DailyReportEncodeUserId, type EpochStore as DailyReportEpochStore, type DailyReportExternalSource, type DailyReportHandlers, type DailyReportHandlersConfig, type DailyReportHubLabelTable, type DailyReportHubRow, type DailyReportHubTable, type DailyReportIdCodec, type DailyReportIdsSource, type DailyReportInternalRow, type DailyReportInternalTable, type DailyReportLabelTable, type DailyReportReadAttachment, type DailyReportRedisBlockingClient, type DailyReportRedisClient, type DailyReportRedisProvider, type RedisStreamMessage as DailyReportRedisStreamMessage, type DailyReportResolveUserId, type DailyReportResolveVisibleSourceTypes, type ResourceRouteArgs as DailyReportResourceRouteArgs, DailyReportSearchAlternative, type DailyReportSearchCommentTable, type DailyReportSearchConfig, type DailyReportSearchCriteria, type DailyReportSearchDocumentTable, DailyReportSearchFacets, type DailyReportSearchFilters, type DailyReportSearchNameFilter, type DailyReportSearchPlan, type DailyReportSearchReconcileOptions, type DailyReportSearchReconcileProgress, type DailyReportSearchReconcileSummary, type DailyReportSearchSet, type DailyReportSearchSourceTextReader, type DailyReportSearchSqlExecutor, type DailyReportSearchTables, type DailyReportSearchWord, type DailyReportServer, type DailyReportServerConfig, type DailyReportService, type DailyReportServiceConfig, type SharpHeaderLike as DailyReportSharpHeaderLike, type SharpPipelineLike as DailyReportSharpPipelineLike, type SqlResultCacheMissAdmission as DailyReportSqlResultCacheMissAdmission, type SqlResultCacheQueryOptions as DailyReportSqlResultCacheQueryOptions, type DailyReportSseEntryMessage, DailyReportSseReader, type DailyReportSseReaderConfig, type DailyReportSseReaderPort, type DailyReportTables, type DailyReportUserStatusRow, type DailyReportUserStatusTable, type DailyReportUserTable, DailyReportViewerScope, type DailyReportVisibilityDimensions, type DailyReportVisibilityResolveContext, type DailyReportVisibilityResolveReason, type VisibleSourceTypeSet as DailyReportVisibleSourceTypeSet, type DailyReportVisibleSourceTypes, type ExternalReportFields, type SharpLike, SqlResultCache, type StreamEntry, createDailyReportHandlers, createDailyReportServer, createDailyReportService, createEpochStore, createSharpThumbnailRenderer, defineDailyReportSchema, defineDailyReportSearchSchema, isStreamIdLte, parseClientTempId, predictSharpThumbnailWorkingSetBytes, readSseStreamEntry as readDailyReportSseStreamEntry, transformJsonArray };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { c as DailyReportSseMessage, k as DailyReportInterviewer, j as DailyReportExternalComment, D as DailyReportItem, d as DailyReportDetail, i as DailyReportAttachmentSummary, m as DailyReportPostedComment } from "./sse-schema-
|
|
1
|
+
import { c as DailyReportSseMessage, k as DailyReportInterviewer, j as DailyReportExternalComment, D as DailyReportItem, d as DailyReportDetail, i as DailyReportAttachmentSummary, m as DailyReportPostedComment } from "./sse-schema-byewDmZK.js";
|
|
2
2
|
import * as drizzle_orm_mssql_core from "drizzle-orm/mssql-core";
|
|
3
3
|
import { AnyMsSqlColumn } from "drizzle-orm/mssql-core";
|
|
4
4
|
import { a as DailyReportLogger, b as DailyReportSearchCombine, g as DailyReportSearchAlternative, d as DailyReportSearchHit, e as DailyReportSearchMarksAnswer } from "./search-marks-wire-CZRU4q3h.js";
|
|
5
5
|
export { h as DailyReportSearchAlternativeTier } from "./search-marks-wire-CZRU4q3h.js";
|
|
6
6
|
import { TransactionRetryOptions } from "@aiquants/mssql";
|
|
7
|
+
import { b as DailyReportSearchFacets } from "./search-filters-wire-5MWi6GWu.js";
|
|
7
8
|
import { SQL } from "drizzle-orm";
|
|
8
9
|
import "zod";
|
|
9
10
|
type RedisStreamMessage = {
|
|
@@ -195,6 +196,38 @@ type DailyReportExternalSource = {
|
|
|
195
196
|
mapRow: (row: Record<string, unknown>) => ExternalReportFields;
|
|
196
197
|
};
|
|
197
198
|
declare const transformJsonArray: <TRaw, TResult>(payload: string | null, label: string, mapper: (raw: TRaw) => TResult | null, logger?: DailyReportLogger) => TResult[];
|
|
199
|
+
type VisibleSourceTypeSet = ReadonlySet<string> | null;
|
|
200
|
+
declare class DailyReportViewerScope {
|
|
201
|
+
#private;
|
|
202
|
+
private constructor();
|
|
203
|
+
get visible(): VisibleSourceTypeSet;
|
|
204
|
+
get commentable(): VisibleSourceTypeSet;
|
|
205
|
+
static restrictTo(input: readonly string[] | DailyReportVisibilityDimensions): DailyReportViewerScope;
|
|
206
|
+
static unrestricted(auditReason: string): DailyReportViewerScope;
|
|
207
|
+
}
|
|
208
|
+
type DailyReportSearchWord = {
|
|
209
|
+
readonly alternatives: readonly DailyReportSearchAlternative[];
|
|
210
|
+
};
|
|
211
|
+
type DailyReportSearchSet = {
|
|
212
|
+
readonly words: readonly DailyReportSearchWord[];
|
|
213
|
+
};
|
|
214
|
+
type DailyReportSearchPlan = {
|
|
215
|
+
readonly combine: DailyReportSearchCombine;
|
|
216
|
+
readonly sets: readonly DailyReportSearchSet[];
|
|
217
|
+
};
|
|
218
|
+
type DailyReportSearchNameFilter = readonly [
|
|
219
|
+
string,
|
|
220
|
+
...string[]
|
|
221
|
+
];
|
|
222
|
+
type DailyReportSearchFilters = {
|
|
223
|
+
readonly sourceTypes: ReadonlySet<string> | null;
|
|
224
|
+
readonly authors: DailyReportSearchNameFilter | null;
|
|
225
|
+
readonly customers: DailyReportSearchNameFilter | null;
|
|
226
|
+
};
|
|
227
|
+
type DailyReportSearchCriteria = {
|
|
228
|
+
readonly plan: DailyReportSearchPlan | null;
|
|
229
|
+
readonly filters: DailyReportSearchFilters;
|
|
230
|
+
};
|
|
198
231
|
declare const CLIENT_TEMP_ID_BRAND: unique symbol;
|
|
199
232
|
type DailyReportClientTempId = string & {
|
|
200
233
|
readonly [CLIENT_TEMP_ID_BRAND]: true;
|
|
@@ -1490,6 +1523,8 @@ type DailyReportSearchDocumentTable = {
|
|
|
1490
1523
|
normalizerVersion: AnyMsSqlColumn;
|
|
1491
1524
|
indexedAt: AnyMsSqlColumn;
|
|
1492
1525
|
rowVersion: AnyMsSqlColumn;
|
|
1526
|
+
authorName: AnyMsSqlColumn;
|
|
1527
|
+
customerName: AnyMsSqlColumn;
|
|
1493
1528
|
};
|
|
1494
1529
|
type DailyReportSearchCommentTable = {
|
|
1495
1530
|
hubId: AnyMsSqlColumn;
|
|
@@ -1608,6 +1643,44 @@ declare function defineDailyReportSearchSchema<S extends string>(schemaName: S):
|
|
|
1608
1643
|
identity: undefined;
|
|
1609
1644
|
generated: undefined;
|
|
1610
1645
|
}, {}>;
|
|
1646
|
+
authorName: drizzle_orm_mssql_core.MsSqlColumn<{
|
|
1647
|
+
name: string;
|
|
1648
|
+
tableName: "DailyReportSearchDocument";
|
|
1649
|
+
dataType: "string";
|
|
1650
|
+
data: string;
|
|
1651
|
+
driverParam: string | number;
|
|
1652
|
+
notNull: false;
|
|
1653
|
+
hasDefault: false;
|
|
1654
|
+
isPrimaryKey: false;
|
|
1655
|
+
isAutoincrement: false;
|
|
1656
|
+
hasRuntimeDefault: false;
|
|
1657
|
+
enumValues: [
|
|
1658
|
+
string,
|
|
1659
|
+
...string[]
|
|
1660
|
+
];
|
|
1661
|
+
baseColumn: never;
|
|
1662
|
+
identity: undefined;
|
|
1663
|
+
generated: undefined;
|
|
1664
|
+
}, {}>;
|
|
1665
|
+
customerName: drizzle_orm_mssql_core.MsSqlColumn<{
|
|
1666
|
+
name: string;
|
|
1667
|
+
tableName: "DailyReportSearchDocument";
|
|
1668
|
+
dataType: "string";
|
|
1669
|
+
data: string;
|
|
1670
|
+
driverParam: string | number;
|
|
1671
|
+
notNull: false;
|
|
1672
|
+
hasDefault: false;
|
|
1673
|
+
isPrimaryKey: false;
|
|
1674
|
+
isAutoincrement: false;
|
|
1675
|
+
hasRuntimeDefault: false;
|
|
1676
|
+
enumValues: [
|
|
1677
|
+
string,
|
|
1678
|
+
...string[]
|
|
1679
|
+
];
|
|
1680
|
+
baseColumn: never;
|
|
1681
|
+
identity: undefined;
|
|
1682
|
+
generated: undefined;
|
|
1683
|
+
}, {}>;
|
|
1611
1684
|
};
|
|
1612
1685
|
dialect: "mssql";
|
|
1613
1686
|
}>;
|
|
@@ -1712,25 +1785,6 @@ type DailyReportSearchReconcileOptions = {
|
|
|
1712
1785
|
readonly signal?: AbortSignal;
|
|
1713
1786
|
readonly onProgress?: (progress: DailyReportSearchReconcileProgress) => void;
|
|
1714
1787
|
};
|
|
1715
|
-
type DailyReportSearchWord = {
|
|
1716
|
-
readonly alternatives: readonly DailyReportSearchAlternative[];
|
|
1717
|
-
};
|
|
1718
|
-
type DailyReportSearchSet = {
|
|
1719
|
-
readonly words: readonly DailyReportSearchWord[];
|
|
1720
|
-
};
|
|
1721
|
-
type DailyReportSearchPlan = {
|
|
1722
|
-
readonly combine: DailyReportSearchCombine;
|
|
1723
|
-
readonly sets: readonly DailyReportSearchSet[];
|
|
1724
|
-
};
|
|
1725
|
-
type VisibleSourceTypeSet = ReadonlySet<string> | null;
|
|
1726
|
-
declare class DailyReportViewerScope {
|
|
1727
|
-
#private;
|
|
1728
|
-
private constructor();
|
|
1729
|
-
get visible(): VisibleSourceTypeSet;
|
|
1730
|
-
get commentable(): VisibleSourceTypeSet;
|
|
1731
|
-
static restrictTo(input: readonly string[] | DailyReportVisibilityDimensions): DailyReportViewerScope;
|
|
1732
|
-
static unrestricted(auditReason: string): DailyReportViewerScope;
|
|
1733
|
-
}
|
|
1734
1788
|
type DailyReportHubRow = {
|
|
1735
1789
|
id: number;
|
|
1736
1790
|
sourceType: string;
|
|
@@ -1843,6 +1897,7 @@ declare function createDailyReportService(config: DailyReportServiceConfig): {
|
|
|
1843
1897
|
concurrency: number;
|
|
1844
1898
|
rateLimitPerMinute: number;
|
|
1845
1899
|
} | null;
|
|
1900
|
+
searchFilterSourceTypes: readonly string[];
|
|
1846
1901
|
clearCache: () => Promise<void>;
|
|
1847
1902
|
invalidateHubReadCaches: (hubIds: readonly number[], businessDates: readonly string[]) => Promise<void>;
|
|
1848
1903
|
getUserIdByExternalId: (externalId: string) => Promise<number | null>;
|
|
@@ -1857,10 +1912,11 @@ declare function createDailyReportService(config: DailyReportServiceConfig): {
|
|
|
1857
1912
|
getDailyReportDetailByIdByExternalId: (scope: DailyReportViewerScope, reportHubId: number, externalId: string, options?: SqlResultCacheQueryOptions) => Promise<DailyReportDetail | null>;
|
|
1858
1913
|
getDailyReportDetailsByIdsByExternalId: (scope: DailyReportViewerScope, reportHubIds: readonly number[], externalId: string) => Promise<DailyReportDetail[]>;
|
|
1859
1914
|
getDraftLabelId: () => Promise<number | null>;
|
|
1860
|
-
searchDailyReports: (scope: DailyReportViewerScope, userId: number,
|
|
1915
|
+
searchDailyReports: (scope: DailyReportViewerScope, userId: number, criteria: DailyReportSearchCriteria) => Promise<DailyReportSearchHit[]>;
|
|
1861
1916
|
markDailyReportSearchHits: (scope: DailyReportViewerScope, userId: number, plan: DailyReportSearchPlan, reportHubIds: readonly number[], options: {
|
|
1862
1917
|
readonly signal: AbortSignal;
|
|
1863
1918
|
}) => Promise<DailyReportSearchMarksAnswer>;
|
|
1919
|
+
listDailyReportSearchFacets: (scope: DailyReportViewerScope, userId: number) => Promise<DailyReportSearchFacets>;
|
|
1864
1920
|
reconcileSearchIndex: (options: DailyReportSearchReconcileOptions) => Promise<DailyReportSearchReconcileSummary>;
|
|
1865
1921
|
getAttachmentsByHubIds: (hubIds: number[]) => Promise<Map<number, DailyReportAttachmentSummary[]>>;
|
|
1866
1922
|
getAttachmentForUser: (scope: DailyReportViewerScope, attachmentId: number, userId: number) => Promise<{
|
|
@@ -2064,4 +2120,4 @@ type DailyReportServer = DailyReportHandlers & {
|
|
|
2064
2120
|
knownSourceTypes: readonly string[];
|
|
2065
2121
|
};
|
|
2066
2122
|
declare function createDailyReportServer(config: DailyReportServerConfig): DailyReportServer;
|
|
2067
|
-
export { DAILY_REPORT_ATTACHMENT_THUMBNAIL_MAX_OUTPUT_BYTES, DAILY_REPORT_ATTACHMENT_THUMBNAIL_OUTPUT_MEDIA_TYPES, DAILY_REPORT_SHARP_THUMBNAIL_DECODE_BUDGET_BYTES, DAILY_REPORT_SHARP_THUMBNAIL_DECODE_WORK_MODEL, DAILY_REPORT_SHARP_THUMBNAIL_WORKING_SET_MODEL, DAILY_REPORT_SSE_CATCH_UP_BATCH, DAILY_REPORT_SSE_VISIBILITY_REFRESH_MS, type DailyReportAttachmentBytes, type DailyReportAttachmentDelivery, type DailyReportAttachmentError, type DailyReportAttachmentFailure, type DailyReportAttachmentTable, type DailyReportAttachmentThumbnail, type AttachmentThumbnailDelivery as DailyReportAttachmentThumbnailDelivery, type DailyReportAttachmentThumbnailError, type DailyReportAttachmentThumbnailFailure, type DailyReportAttachmentThumbnailOutputMediaType, type DailyReportAttachmentThumbnailRenderer, type DailyReportAttachmentThumbnailSourceFormat, type DailyReportAttachmentThumbnailsConfig, type DailyReportAttachmentsConfig, type DailyReportAuthResult, type DailyReportAuthenticate, type DailyReportClientTempId, type DailyReportCommentTable, type DailyReportDb, type DeleteChain as DailyReportDbDeleteChain, type InsertChain as DailyReportDbInsertChain, type Rows as DailyReportDbRows, type SelectChain as DailyReportDbSelectChain, type UpdateChain as DailyReportDbUpdateChain, type DailyReportEncodeUserId, type EpochStore as DailyReportEpochStore, type DailyReportExternalSource, type DailyReportHandlers, type DailyReportHandlersConfig, type DailyReportHubLabelTable, type DailyReportHubRow, type DailyReportHubTable, type DailyReportIdCodec, type DailyReportIdsSource, type DailyReportInternalRow, type DailyReportInternalTable, type DailyReportLabelTable, type DailyReportReadAttachment, type DailyReportRedisBlockingClient, type DailyReportRedisClient, type DailyReportRedisProvider, type RedisStreamMessage as DailyReportRedisStreamMessage, type DailyReportResolveUserId, type DailyReportResolveVisibleSourceTypes, type ResourceRouteArgs as DailyReportResourceRouteArgs, DailyReportSearchAlternative, type DailyReportSearchCommentTable, type DailyReportSearchConfig, type DailyReportSearchDocumentTable, type DailyReportSearchPlan, type DailyReportSearchReconcileOptions, type DailyReportSearchReconcileProgress, type DailyReportSearchReconcileSummary, type DailyReportSearchSet, type DailyReportSearchSourceTextReader, type DailyReportSearchSqlExecutor, type DailyReportSearchTables, type DailyReportSearchWord, type DailyReportServer, type DailyReportServerConfig, type DailyReportService, type DailyReportServiceConfig, type SharpHeaderLike as DailyReportSharpHeaderLike, type SharpPipelineLike as DailyReportSharpPipelineLike, type SqlResultCacheMissAdmission as DailyReportSqlResultCacheMissAdmission, type SqlResultCacheQueryOptions as DailyReportSqlResultCacheQueryOptions, type DailyReportSseEntryMessage, DailyReportSseReader, type DailyReportSseReaderConfig, type DailyReportSseReaderPort, type DailyReportTables, type DailyReportUserStatusRow, type DailyReportUserStatusTable, type DailyReportUserTable, DailyReportViewerScope, type DailyReportVisibilityDimensions, type DailyReportVisibilityResolveContext, type DailyReportVisibilityResolveReason, type VisibleSourceTypeSet as DailyReportVisibleSourceTypeSet, type DailyReportVisibleSourceTypes, type ExternalReportFields, type SharpLike, SqlResultCache, type StreamEntry, createDailyReportHandlers, createDailyReportServer, createDailyReportService, createEpochStore, createSharpThumbnailRenderer, defineDailyReportSchema, defineDailyReportSearchSchema, isStreamIdLte, parseClientTempId, predictSharpThumbnailWorkingSetBytes, readSseStreamEntry as readDailyReportSseStreamEntry, transformJsonArray };
|
|
2123
|
+
export { DAILY_REPORT_ATTACHMENT_THUMBNAIL_MAX_OUTPUT_BYTES, DAILY_REPORT_ATTACHMENT_THUMBNAIL_OUTPUT_MEDIA_TYPES, DAILY_REPORT_SHARP_THUMBNAIL_DECODE_BUDGET_BYTES, DAILY_REPORT_SHARP_THUMBNAIL_DECODE_WORK_MODEL, DAILY_REPORT_SHARP_THUMBNAIL_WORKING_SET_MODEL, DAILY_REPORT_SSE_CATCH_UP_BATCH, DAILY_REPORT_SSE_VISIBILITY_REFRESH_MS, type DailyReportAttachmentBytes, type DailyReportAttachmentDelivery, type DailyReportAttachmentError, type DailyReportAttachmentFailure, type DailyReportAttachmentTable, type DailyReportAttachmentThumbnail, type AttachmentThumbnailDelivery as DailyReportAttachmentThumbnailDelivery, type DailyReportAttachmentThumbnailError, type DailyReportAttachmentThumbnailFailure, type DailyReportAttachmentThumbnailOutputMediaType, type DailyReportAttachmentThumbnailRenderer, type DailyReportAttachmentThumbnailSourceFormat, type DailyReportAttachmentThumbnailsConfig, type DailyReportAttachmentsConfig, type DailyReportAuthResult, type DailyReportAuthenticate, type DailyReportClientTempId, type DailyReportCommentTable, type DailyReportDb, type DeleteChain as DailyReportDbDeleteChain, type InsertChain as DailyReportDbInsertChain, type Rows as DailyReportDbRows, type SelectChain as DailyReportDbSelectChain, type UpdateChain as DailyReportDbUpdateChain, type DailyReportEncodeUserId, type EpochStore as DailyReportEpochStore, type DailyReportExternalSource, type DailyReportHandlers, type DailyReportHandlersConfig, type DailyReportHubLabelTable, type DailyReportHubRow, type DailyReportHubTable, type DailyReportIdCodec, type DailyReportIdsSource, type DailyReportInternalRow, type DailyReportInternalTable, type DailyReportLabelTable, type DailyReportReadAttachment, type DailyReportRedisBlockingClient, type DailyReportRedisClient, type DailyReportRedisProvider, type RedisStreamMessage as DailyReportRedisStreamMessage, type DailyReportResolveUserId, type DailyReportResolveVisibleSourceTypes, type ResourceRouteArgs as DailyReportResourceRouteArgs, DailyReportSearchAlternative, type DailyReportSearchCommentTable, type DailyReportSearchConfig, type DailyReportSearchCriteria, type DailyReportSearchDocumentTable, DailyReportSearchFacets, type DailyReportSearchFilters, type DailyReportSearchNameFilter, type DailyReportSearchPlan, type DailyReportSearchReconcileOptions, type DailyReportSearchReconcileProgress, type DailyReportSearchReconcileSummary, type DailyReportSearchSet, type DailyReportSearchSourceTextReader, type DailyReportSearchSqlExecutor, type DailyReportSearchTables, type DailyReportSearchWord, type DailyReportServer, type DailyReportServerConfig, type DailyReportService, type DailyReportServiceConfig, type SharpHeaderLike as DailyReportSharpHeaderLike, type SharpPipelineLike as DailyReportSharpPipelineLike, type SqlResultCacheMissAdmission as DailyReportSqlResultCacheMissAdmission, type SqlResultCacheQueryOptions as DailyReportSqlResultCacheQueryOptions, type DailyReportSseEntryMessage, DailyReportSseReader, type DailyReportSseReaderConfig, type DailyReportSseReaderPort, type DailyReportTables, type DailyReportUserStatusRow, type DailyReportUserStatusTable, type DailyReportUserTable, DailyReportViewerScope, type DailyReportVisibilityDimensions, type DailyReportVisibilityResolveContext, type DailyReportVisibilityResolveReason, type VisibleSourceTypeSet as DailyReportVisibleSourceTypeSet, type DailyReportVisibleSourceTypes, type ExternalReportFields, type SharpLike, SqlResultCache, type StreamEntry, createDailyReportHandlers, createDailyReportServer, createDailyReportService, createEpochStore, createSharpThumbnailRenderer, defineDailyReportSchema, defineDailyReportSearchSchema, isStreamIdLte, parseClientTempId, predictSharpThumbnailWorkingSetBytes, readSseStreamEntry as readDailyReportSseStreamEntry, transformJsonArray };
|