@aiquants/daily-report 0.43.0 → 0.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- export { a as DAILY_REPORT_ACTION_FIELDS, b as DAILY_REPORT_ACTION_INTENTS, c as DAILY_REPORT_INTERNAL_SOURCE_TYPE, A as DailyReportActionCommand, d as DailyReportActionFailure, D as DailyReportActionIntent, e as DailyReportActionResult, g as DailyReportActionResultOf, h as DailyReportActionResultReading, U as DailyReportUIComment, i as encodeDailyReportActionCommand, f as foldDailyReportSourceTypeToken, p as parseDailyReportActionResult } from "./source-types-NkQm-gNO.mjs";
2
- export { f as DAILY_REPORT_SSE_CURSOR_PARAM, g as DAILY_REPORT_SSE_HEARTBEAT_MS, h as DAILY_REPORT_SSE_TERMINAL_EVENTS, i as DailyReportAttachmentState, j as DailyReportAttachmentSummary, e as DailyReportDetail, k as DailyReportExternalComment, l as DailyReportIdsStreamChunk, m as DailyReportIdsStreamChunkLine, n as DailyReportIdsStreamCursor, o as DailyReportIdsStreamRowColumns, p as DailyReportIdsStreamRows, q as DailyReportInterviewer, D as DailyReportItem, r as DailyReportLabelDef, s as DailyReportPostedComment, d as DailyReportSseMessage, a as DailyReportSseStreamAnchor, c as DailyReportSseTerminalEvent, b as DailyReportUser, t as dailyReportDetailSchema, u as dailyReportSseMessageSchema, v as forEachIdsStreamRow, w as readIdsStreamChunkLine } from "./sse-schema-Br0b278w.mjs";
3
- export { D as DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT, a as DAILY_REPORT_SEARCH_COMBINES, b as DailyReportLogger, c as DailyReportSearchCombine, d as DailyReportSearchFieldMarks, e as DailyReportSearchHit, f as DailyReportSearchMarksAnswer, g as DailyReportSearchMarksExpectation, h as DailyReportSearchReportMarks, r as readDailyReportSearchMarksAnswer } from "./search-marks-wire-BSS2d1t6.mjs";
1
+ export { a as DAILY_REPORT_ACTION_FIELDS, b as DAILY_REPORT_ACTION_INTENTS, c as DAILY_REPORT_INTERNAL_SOURCE_TYPE, A as DailyReportActionCommand, d as DailyReportActionFailure, D as DailyReportActionIntent, e as DailyReportActionResult, g as DailyReportActionResultOf, h as DailyReportActionResultReading, U as DailyReportUIComment, i as encodeDailyReportActionCommand, f as foldDailyReportSourceTypeToken, p as parseDailyReportActionResult } from "./source-types-Hy_znWJl.mjs";
2
+ export { c as DAILY_REPORT_SSE_CURSOR_PARAM, d as DAILY_REPORT_SSE_HEARTBEAT_MS, e as DAILY_REPORT_SSE_TERMINAL_EVENTS, f as DailyReportIdsStreamChunk, g as DailyReportIdsStreamChunkLine, h as DailyReportIdsStreamCursor, i as DailyReportIdsStreamRowColumns, j as DailyReportIdsStreamRows, b as DailyReportSseMessage, D as DailyReportSseStreamAnchor, a as DailyReportSseTerminalEvent, k as dailyReportDetailSchema, l as dailyReportSseMessageSchema, m as forEachIdsStreamRow, r as readIdsStreamChunkLine } from "./sse-schema-sKBorzg9.mjs";
3
+ export { D as DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT, a as DAILY_REPORT_SEARCH_COMBINES, b as DailyReportLogger, c as DailyReportSearchCombine, d as DailyReportSearchDetailOutcome, e as DailyReportSearchDetailsAnswer, f as DailyReportSearchFieldMarks, g as DailyReportSearchHit, h as DailyReportSearchMarksAnswer, i as DailyReportSearchMarksExpectation, j as DailyReportSearchReportMarks, r as readDailyReportSearchMarksAnswer } from "./search-marks-wire-BiImBos8.mjs";
4
+ export { c as DailyReportAttachmentState, d as DailyReportAttachmentSummary, b as DailyReportDetail, e as DailyReportExternalComment, f as DailyReportInterviewer, D as DailyReportItem, g as DailyReportLabelDef, h as DailyReportPostedComment, a as DailyReportUser } from "./types-BP1kIGMo.mjs";
4
5
  import "zod/v3";
5
6
  declare const DAILY_REPORT_API_ENDPOINTS: Readonly<{
6
7
  readonly businessDate: "business-date";
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- export { a as DAILY_REPORT_ACTION_FIELDS, b as DAILY_REPORT_ACTION_INTENTS, c as DAILY_REPORT_INTERNAL_SOURCE_TYPE, A as DailyReportActionCommand, d as DailyReportActionFailure, D as DailyReportActionIntent, e as DailyReportActionResult, g as DailyReportActionResultOf, h as DailyReportActionResultReading, U as DailyReportUIComment, i as encodeDailyReportActionCommand, f as foldDailyReportSourceTypeToken, p as parseDailyReportActionResult } from "./source-types-Bu-_yfcY.js";
2
- export { f as DAILY_REPORT_SSE_CURSOR_PARAM, g as DAILY_REPORT_SSE_HEARTBEAT_MS, h as DAILY_REPORT_SSE_TERMINAL_EVENTS, i as DailyReportAttachmentState, j as DailyReportAttachmentSummary, e as DailyReportDetail, k as DailyReportExternalComment, l as DailyReportIdsStreamChunk, m as DailyReportIdsStreamChunkLine, n as DailyReportIdsStreamCursor, o as DailyReportIdsStreamRowColumns, p as DailyReportIdsStreamRows, q as DailyReportInterviewer, D as DailyReportItem, r as DailyReportLabelDef, s as DailyReportPostedComment, d as DailyReportSseMessage, a as DailyReportSseStreamAnchor, c as DailyReportSseTerminalEvent, b as DailyReportUser, t as dailyReportDetailSchema, u as dailyReportSseMessageSchema, v as forEachIdsStreamRow, w as readIdsStreamChunkLine } from "./sse-schema-Br0b278w.js";
3
- export { D as DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT, a as DAILY_REPORT_SEARCH_COMBINES, b as DailyReportLogger, c as DailyReportSearchCombine, d as DailyReportSearchFieldMarks, e as DailyReportSearchHit, f as DailyReportSearchMarksAnswer, g as DailyReportSearchMarksExpectation, h as DailyReportSearchReportMarks, r as readDailyReportSearchMarksAnswer } from "./search-marks-wire-BSS2d1t6.js";
1
+ export { a as DAILY_REPORT_ACTION_FIELDS, b as DAILY_REPORT_ACTION_INTENTS, c as DAILY_REPORT_INTERNAL_SOURCE_TYPE, A as DailyReportActionCommand, d as DailyReportActionFailure, D as DailyReportActionIntent, e as DailyReportActionResult, g as DailyReportActionResultOf, h as DailyReportActionResultReading, U as DailyReportUIComment, i as encodeDailyReportActionCommand, f as foldDailyReportSourceTypeToken, p as parseDailyReportActionResult } from "./source-types-Cg7T2dm6.js";
2
+ export { c as DAILY_REPORT_SSE_CURSOR_PARAM, d as DAILY_REPORT_SSE_HEARTBEAT_MS, e as DAILY_REPORT_SSE_TERMINAL_EVENTS, f as DailyReportIdsStreamChunk, g as DailyReportIdsStreamChunkLine, h as DailyReportIdsStreamCursor, i as DailyReportIdsStreamRowColumns, j as DailyReportIdsStreamRows, b as DailyReportSseMessage, D as DailyReportSseStreamAnchor, a as DailyReportSseTerminalEvent, k as dailyReportDetailSchema, l as dailyReportSseMessageSchema, m as forEachIdsStreamRow, r as readIdsStreamChunkLine } from "./sse-schema-BcjRPJjN.js";
3
+ export { D as DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT, a as DAILY_REPORT_SEARCH_COMBINES, b as DailyReportLogger, c as DailyReportSearchCombine, d as DailyReportSearchDetailOutcome, e as DailyReportSearchDetailsAnswer, f as DailyReportSearchFieldMarks, g as DailyReportSearchHit, h as DailyReportSearchMarksAnswer, i as DailyReportSearchMarksExpectation, j as DailyReportSearchReportMarks, r as readDailyReportSearchMarksAnswer } from "./search-marks-wire-C_vjmxwf.js";
4
+ export { c as DailyReportAttachmentState, d as DailyReportAttachmentSummary, b as DailyReportDetail, e as DailyReportExternalComment, f as DailyReportInterviewer, D as DailyReportItem, g as DailyReportLabelDef, h as DailyReportPostedComment, a as DailyReportUser } from "./types-BP1kIGMo.js";
4
5
  import "zod/v3";
5
6
  declare const DAILY_REPORT_API_ENDPOINTS: Readonly<{
6
7
  readonly businessDate: "business-date";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var W=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var nt=Object.prototype.hasOwnProperty;var ot=(e,t)=>{for(var r in t)W(e,r,{get:t[r],enumerable:!0})},at=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rt(t))!nt.call(e,o)&&o!==r&&W(e,o,{get:()=>t[o],enumerable:!(n=tt(t,o))||n.enumerable});return e};var st=e=>at(W({},"__esModule",{value:!0}),e);var Qt={};ot(Qt,{DAILY_REPORT_ACTION_FIELDS:()=>y,DAILY_REPORT_ACTION_INTENTS:()=>Ee,DAILY_REPORT_API_ENDPOINTS:()=>He,DAILY_REPORT_API_QUERY_PARAMS:()=>je,DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS:()=>G,DAILY_REPORT_CLIENT_TEMP_ID_PATTERN:()=>T,DAILY_REPORT_INTERNAL_SOURCE_TYPE:()=>Ze,DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT:()=>Ve,DAILY_REPORT_SEARCH_COMBINES:()=>Ke,DAILY_REPORT_SSE_CURSOR_PARAM:()=>be,DAILY_REPORT_SSE_HEARTBEAT_MS:()=>he,DAILY_REPORT_SSE_TERMINAL_EVENTS:()=>fe,buildDailyReportAttachmentUrl:()=>We,dailyReportDetailSchema:()=>_,dailyReportSseMessageSchema:()=>xe,encodeDailyReportActionCommand:()=>Ce,foldDailyReportSourceTypeToken:()=>Xe,forEachIdsStreamRow:()=>Le,isDailyReportAttachmentThumbnailVariant:()=>U,normalizeBusinessDateKey:()=>Ne,parseDailyReportActionResult:()=>ke,parseDailyReportAttachmentQuery:()=>Be,readDailyReportSearchMarksAnswer:()=>Qe,readIdsStreamChunkLine:()=>Pe});module.exports=st(Qt);var d=require("zod/v3");var T=/^(?:[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 ee=require("zod/v3"),f=e=>Number.isSafeInteger(e)&&e>0,m=ee.z.number().int().positive().max(Number.MAX_SAFE_INTEGER);var i=require("zod/v3");var I=Symbol("daily-report wire mismatch"),h=(e,t,r)=>(e.issues.push({...r,path:t===null?[...e.path]:[...e.path,t]}),I),oe=e=>e===null?"null":Array.isArray(e)?"array":Number.isNaN(e)?"nan":typeof e,g=(e,t)=>({code:"invalid_type",expected:e,received:oe(t)}),it=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),lt=e=>{let t=0;for(let r in e)t+=1;return t},te=(e,t,r)=>{let n={};for(let o=0;o<r;o+=1){let a=t[o];a in e&&(n[a]=e[a])}return n},x=e=>{let t=Object.keys(e),r=Object.values(e);return(n,o)=>{if(!it(n))return h(o,null,g("object",n));let a=null,u=!1,s=0;for(let l=0;l<t.length;l+=1){let c=t[l],R=n[c];R!==void 0&&(s+=1);let b=r[l](R,o,c);if(b===I){u=!0;continue}a===null&&b!==R&&(a=te(n,t,l)),a!==null&&(b!==void 0||c in n)&&(a[c]=b)}return u?I:a!==null?a:lt(n)===s?n:te(n,t,t.length)}},C=e=>(t,r,n)=>{r.path.push(n);let o=e(t,r);return r.path.pop(),o},k=e=>(t,r,n)=>{if(!Array.isArray(t))return h(r,n,g("array",t));r.path.push(n);let o=t,a=!1;for(let u=0;u<t.length;u+=1){let s=t[u],l=e(s,r,u);l===I?a=!0:l!==s&&(o===t&&(o=t.slice()),o[u]=l)}return r.path.pop(),a?I:o},p=(e,t,r)=>e==null||typeof e=="string"?e:h(t,r,g("string",e)),re=(e,t,r)=>e===null||typeof e=="string"?e:h(t,r,g("string",e)),ne=(e,t,r)=>typeof e=="string"?e:h(t,r,g("string",e)),ut=(e,t,r)=>e===null||typeof e=="number"&&!Number.isNaN(e)?e:h(t,r,g("number",e)),w=(e,t,r)=>typeof e=="boolean"?e:h(t,r,g("boolean",e)),B=(e,t,r)=>{if(typeof e=="number"&&f(e))return e;for(let{message:n,path:o,...a}of m.safeParse(e).error.issues)h(t,r,a);return I},ae={present:!0,absent:!0,unknown:!0},se=Object.keys(ae),pt=se.map(e=>`'${e}'`).join(" | "),dt=(e,t,r)=>typeof e!="string"?h(t,r,{code:"invalid_type",expected:pt,received:oe(e)}):Object.hasOwn(ae,e)?e:h(t,r,{code:"invalid_enum_value",received:e,options:[...se]}),ie=x({name:p,affiliation:p}),le=x({name:p,text:p,color:p}),ue=x({id:B,name:p,color:p}),pe=x({id:B,userId:p,userName:p,content:p,createdAt:p,isMine:w}),ct=x({id:ne,fileName:ne,fileType:re,fileSize:ut,createdAt:re,state:dt,hasThumbnail:w}),mt=x({reportHubId:B,date:p,createdAt:p,author:p,userId:p,sourceType:p,employeeName:p,updatedBy:p,updatedAt:p,category:p,creationCategory:p,visitTimeFrom:p,visitTimeTo:p,customerName:p,interviewers:k(C(ie)),subject:p,content:p,externalComments:k(C(le)),isRead:w,isStarred:w,isDraft:w,labels:k(C(ue)),postedComments:k(C(pe)),attachments:k(C(ct))}),M=(e,t)=>{let r={path:[],issues:[]},n=e(t,r);return n===I?{ok:!1,issues:r.issues}:{ok:!0,value:n}},de=e=>M(mt,e),ce=e=>M(ie,e),me=e=>M(le,e),ye=e=>M(ue,e),Re=e=>M(pe,e);var fe=["auth-required","forbidden","resync-required"],he=15e3,be="lastEventId",yt=/^\d{1,15}-\d{1,15}$/,De=e=>yt.test(e),N=e=>i.z.unknown().transform((t,r)=>{let n=e(t);if(n.ok)return n.value;for(let o of n.issues)r.addIssue({...o,fatal:!0});return i.z.NEVER}),ar=N(ce),sr=N(me),ir=N(ye),F=N(Re),_=N(de),O=i.z.string().regex(T),Se=i.z.object({type:i.z.literal("connected")}),Ie=i.z.object({type:i.z.literal("status-update"),reportHubId:m,statusType:i.z.enum(["star","read"]),value:i.z.boolean(),clientTempId:O}),z=i.z.string(),ge=i.z.object({type:i.z.literal("comment-add"),reportHubId:m,comment:F,clientTempId:O,sourceType:z}),Ae=i.z.object({type:i.z.literal("comment-delete"),reportHubId:m,commentId:m,clientTempId:O,sourceType:z}),Y={recipientRawUserId:m.optional()},Rt=Ie.extend(Y),ft=ge.extend(Y),ht=Ae.extend(Y),E={reportHubId:m,report:_,clientTempId:O},$={...Y,actorRawUserId:m},K={viewerIsActor:i.z.boolean()},bt=i.z.object({type:i.z.literal("report-create"),...E,...K}),Dt=i.z.object({type:i.z.literal("report-update"),...E,...K}),St=i.z.object({type:i.z.literal("report-publish"),...E,...K}),It=i.z.object({type:i.z.literal("report-create"),...E,...$}),gt=i.z.object({type:i.z.literal("report-update"),...E,...$}),At=i.z.object({type:i.z.literal("report-publish"),...E,...$}),Te=i.z.object({type:i.z.literal("report-delete"),reportHubId:m,clientTempId:O,sourceType:z}),xe=i.z.discriminatedUnion("type",[Se,Ie,ge,Ae,bt,Dt,St,Te]),lr=i.z.discriminatedUnion("type",[Se,Rt,ft,ht,It,gt,At,Te]);var _e=e=>e.issues.map(t=>`${t.path.length===0?"(root)":t.path.join(".")}: ${t.code}`).join("; ");var Ee=Object.freeze(["create","update","publish","delete","toggleStar","toggleRead","addComment","deleteComment","clearCache"]);var y=Object.freeze({intent:"intent",clientTempId:"clientTempId",businessDate:"businessDate",operationTimestamp:"operationTimestamp",reportHubId:"reportHubId",title:"title",content:"content",isStarred:"isStarred",isRead:"isRead",commentId:"commentId"}),Ce=e=>{let t=new FormData;if(t.append(y.intent,e.intent),e.intent==="clearCache"||(t.append(y.clientTempId,e.clientTempId),e.businessDate!==null&&t.append(y.businessDate,e.businessDate),e.operationTimestamp!==null&&t.append(y.operationTimestamp,String(e.operationTimestamp)),e.intent==="create"))return t;switch(t.append(y.reportHubId,String(e.reportHubId)),e.intent){case"update":return e.changes.title!==void 0&&t.append(y.title,e.changes.title),e.changes.content!==void 0&&t.append(y.content,e.changes.content),t;case"publish":case"delete":return t;case"toggleStar":return t.append(y.isStarred,String(e.value)),t;case"toggleRead":return t.append(y.isRead,String(e.value)),t;case"addComment":return t.append(y.content,e.content),t;case"deleteComment":return t.append(y.commentId,String(e.commentId)),t}},Tt=()=>{let e=m,t=d.z.string().regex(T),r=d.z.literal("OK"),n=d.z.object({isStarred:d.z.boolean(),isRead:d.z.boolean()}),o=d.z.number().int().nonnegative().nullable();return{create:d.z.object({status:r,intent:d.z.literal("create"),reportHubId:e,clientTempId:t,report:_}),update:d.z.object({status:r,intent:d.z.literal("update"),reportHubId:e,clientTempId:t}),publish:d.z.object({status:r,intent:d.z.literal("publish"),reportHubId:e,clientTempId:t,report:_.nullable()}),delete:d.z.object({status:r,intent:d.z.literal("delete"),reportHubId:e,clientTempId:t}),toggleStar:d.z.object({status:r,intent:d.z.literal("toggleStar"),reportHubId:e,clientTempId:t,updatedStatus:n,operationTimestamp:o}),toggleRead:d.z.object({status:r,intent:d.z.literal("toggleRead"),reportHubId:e,clientTempId:t,updatedStatus:n,operationTimestamp:o}),addComment:d.z.object({status:r,intent:d.z.literal("addComment"),reportHubId:e,clientTempId:t,newComment:F}),deleteComment:d.z.object({status:r,intent:d.z.literal("deleteComment"),reportHubId:e,clientTempId:t,deletedCommentId:m}),clearCache:d.z.object({status:r,intent:d.z.literal("clearCache")})}},V=null,xt=()=>(V===null&&(V=Tt()),V),ke=(e,t)=>{let r=xt()[e].safeParse(t);return r.success?{result:r.data}:{mismatch:_e(r.error)}};var _t=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var we=e=>e<10?`0${e}`:`${e}`,Et=e=>{if(Number.isNaN(e.getTime()))return null;let t=e.getFullYear(),r=we(e.getMonth()+1),n=we(e.getDate());return`${t}-${r}-${n}`},Me=e=>{let t=_t.exec(e);if(t===null)return null;let[,r,,n,o]=t,a=Number(r),u=Number(n),s=Number(o);if(a<1)return null;let l=new Date(0);return l.setUTCFullYear(a,u-1,s),l.getUTCFullYear()!==a||l.getUTCMonth()!==u-1||l.getUTCDate()!==s?null:`${r}-${n}-${o}`},q=e=>Me(e)===e;var Ne=e=>e==null?null:e instanceof Date?Et(e):Me(e);var Oe="ids-columns",Ct=e=>{if(typeof e!="object"||e===null)return"unknown";let{kind:t}=e;return t==="chunk"?"chunk":t==="error"?"error":"unknown"},kt=e=>typeof e=="number"&&f(e),wt=e=>{if(typeof e!="object"||e===null)return!1;let{businessDate:t,reportHubId:r}=e;return(t===null||typeof t=="string")&&typeof r=="number"},Mt=4,Nt=e=>{let t=Mt;for(;2**t<e*2;)t+=1;let r=new Float64Array(2**t),n=r.length-1,o=32-t;return a=>{let u=Math.imul(a|0,2654435761)>>>o;for(;;){let s=r[u];if(s===0)return r[u]=a,!0;if(s===a)return!1;u=u+1&n}}},Ot=/^[0-9a-f]{1,16}$/,Pt=e=>f(e.reportHubId)&&(e.businessDate===null||q(e.businessDate)),Lt=e=>typeof e=="string"&&Ot.test(e),Ht=Object.freeze({kind:"absent"}),jt=Object.freeze({kind:"value",value:null}),Yt=e=>e===void 0?Ht:e===null?jt:typeof e=="string"&&De(e)?{kind:"value",value:e}:{kind:"malformed",received:e},Pe=e=>{if(Ct(e)!=="chunk")return null;let{ids:t,dates:r,counts:n,sourceTypes:o,sources:a,isLast:u,nextCursor:s,total:l,snapshot:c,provisional:R,restarted:b,streamAnchor:Je}=e;if(typeof u!="boolean"||!(s===null||wt(s))||!(Array.isArray(t)&&Array.isArray(r)&&Array.isArray(n)&&Array.isArray(o)&&Array.isArray(a))||r.length!==n.length||a.length!==t.length)return null;for(let D of o)if(!(D===null||typeof D=="string"))return null;let et=Nt(t.length),S=0,Z=null,X=0;for(let D=0;D<r.length;D++){let A=r[D],L=n[D];if(!(A===null||typeof A=="string"&&q(A))||D>0&&A===r[D-1]||typeof L!="number"||!Number.isSafeInteger(L)||L<1)return null;let J=S+L;if(J>t.length)return null;for(;S<J;S++){let H=t[S],j=a[S];if(!(kt(H)&&et(H))||typeof j!="number"||!Number.isSafeInteger(j)||j<0||j>=o.length||S>0&&!vt(Z,X,A,H))return null;Z=A,X=H}}return S!==t.length?null:{rows:e,isLast:u,resumeCursor:s!==null&&Pt(s)?s:null,total:typeof l=="number"&&Number.isSafeInteger(l)&&l>=0?l:null,snapshot:Lt(c)?c:null,provisional:R===!0,restarted:b===!0,streamAnchor:Yt(Je)}},Le=(e,t)=>{let{ids:r,dates:n,counts:o,sourceTypes:a,sources:u}=e,s=0;for(let l=0;l<n.length;l++){let c=n[l];for(let R=s+o[l];s<R;s++){let b=a[u[s]];t(r[s],c,b===null?void 0:b)}}};var Ut=(e,t,r,n)=>e!==r?e===null?1:r===null||e>r?-1:1:n-t,vt=(e,t,r,n)=>Ut(e,t,r,n)<0;var He=Object.freeze({businessDate:"business-date",idsStream:Oe,report:"report",search:"search",reports:"reports",searchMarks:"search-marks",searchFacets:"search-facets",action:"action"}),je=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 G=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),U=e=>Object.hasOwn(G,e);var Ye="download",Ue="thumbnail",ve="1",We=(e,t,r)=>{let n=`${e}/attachment/${encodeURIComponent(t)}`;switch(r.kind){case"inline":return n;case"download":return`${n}?${new URLSearchParams({[Ye]:ve})}`;case"thumbnail":return`${n}?${new URLSearchParams({[Ue]:r.variant})}`}},Be=e=>{let t=e.getAll(Ue),r=e.getAll(Ye);if(t.length>0&&r.length>0)return{kind:"invalid",reason:"conflict"};if(t.length>0){let[n]=t;return t.length===1&&U(n)?{kind:"thumbnail",variant:n}:{kind:"invalid",reason:"thumbnail_variant"}}return r.length>0?r.length===1&&r[0]===ve?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var Q="legacy-";var Wt=/^[1-9][0-9]*$/,Bt=/^(?:0|[1-9][0-9]*)$/,Fe=e=>{if(e===null||!Wt.test(e))return null;let t=Number(e);return f(t)?t:null},v=e=>{if(e===null||!Bt.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null};var Ft=Object.freeze(["subject","content","author","employeeName","updatedBy","category","creationCategory","customerName"]),Mr=Object.freeze({field:e=>e,interviewer:(e,t)=>`interviewer:${e}:${t}`,attachment:e=>`attachment:${e}`,comment:(e,t)=>`comment:${e}:${t}`}),zt=e=>e.startsWith(Q)?v(e.slice(Q.length))!==null:Fe(e)!==null,ze=e=>{if(Ft.includes(e))return!0;let t=e.split(":");switch(t[0]){case"interviewer":return t.length===3&&v(t[1])!==null&&(t[2]==="name"||t[2]==="affiliation");case"attachment":return t.length===2&&v(t[1])!==null;case"comment":return t.length===3&&zt(t[1])&&(t[2]==="author"||t[2]==="content");default:return!1}};var Nr=String.fromCodePoint(3),Or=String.fromCodePoint(2),Pr=String.fromCodePoint(1);var Ke=["intersection","union"];var Hr=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100}),$t=2,Ve=2,$e=Object.freeze({word:0,reading:1}),qe=e=>e===$e.word||e===$e.reading;var P=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},jr=2*(1+$t);var Kt=4294967295,Ge=e=>typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=Kt,Vt=e=>{if(!Array.isArray(e)||e.length%3!==0)return null;let t=[];for(let r=0;r<e.length;r+=3){let n=e[r],o=e[r+1],a=e[r+2];if(!(typeof n=="number"&&Number.isSafeInteger(n)&&n>=0&&typeof o=="number"&&Number.isSafeInteger(o)&&n<o)||!qe(a))return null;if(r>0){let u=t[r-2];if(u>n||u===n&&t[r-1]===a)return null}t.push(n,o,a)}return t},qt=e=>{if(!(P(e)&&Ge(e.fingerprint)))return null;if(Object.hasOwn(e,"dense"))return e.dense===!0&&!Object.hasOwn(e,"ranges")?{fingerprint:e.fingerprint,dense:!0}:null;let t=Vt(e.ranges);return t===null?null:{fingerprint:e.fingerprint,ranges:t}},Gt=e=>{if(!P(e))return null;let t={};for(let[r,n]of Object.entries(e)){if(!ze(r))return null;let o=qt(n);if(o===null)return null;t[r]=o}return t},Qe=(e,t)=>{if(!(P(e)&&Ge(e.wordsDigest)&&Array.isArray(e.reports)&&Array.isArray(e.deferred)))return null;let r=new Set(t.requestedIds),n=new Set,o=2**t.setCount-1,a=[];for(let s of e.reports){if(!P(s))return null;let{reportHubId:l,matchedSets:c}=s;if(!(typeof l=="number"&&f(l)&&r.has(l))||n.has(l)||(n.add(l),t.expectsMatchedSets?!(typeof c=="number"&&Number.isInteger(c)&&c>=0&&c<=o):c!==null))return null;let R=Gt(s.fields);if(R===null)return null;a.push({reportHubId:l,matchedSets:c,fields:R})}if(a.length===0&&e.deferred.length>0)return null;let u=[];for(let s of e.deferred){if(!(typeof s=="number"&&f(s)&&r.has(s))||n.has(s))return null;n.add(s),u.push(s)}return{wordsDigest:e.wordsDigest,reports:a,deferred:u}};var Ze="Internal",Xe=e=>e.trim().toLowerCase();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_INTERNAL_SOURCE_TYPE,DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT,DAILY_REPORT_SEARCH_COMBINES,DAILY_REPORT_SSE_CURSOR_PARAM,DAILY_REPORT_SSE_HEARTBEAT_MS,DAILY_REPORT_SSE_TERMINAL_EVENTS,buildDailyReportAttachmentUrl,dailyReportDetailSchema,dailyReportSseMessageSchema,encodeDailyReportActionCommand,foldDailyReportSourceTypeToken,forEachIdsStreamRow,isDailyReportAttachmentThumbnailVariant,normalizeBusinessDateKey,parseDailyReportActionResult,parseDailyReportAttachmentQuery,readDailyReportSearchMarksAnswer,readIdsStreamChunkLine});
1
+ "use strict";var W=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var nt=Object.prototype.hasOwnProperty;var ot=(e,t)=>{for(var r in t)W(e,r,{get:t[r],enumerable:!0})},at=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rt(t))!nt.call(e,o)&&o!==r&&W(e,o,{get:()=>t[o],enumerable:!(n=tt(t,o))||n.enumerable});return e};var st=e=>at(W({},"__esModule",{value:!0}),e);var Qt={};ot(Qt,{DAILY_REPORT_ACTION_FIELDS:()=>y,DAILY_REPORT_ACTION_INTENTS:()=>Ee,DAILY_REPORT_API_ENDPOINTS:()=>He,DAILY_REPORT_API_QUERY_PARAMS:()=>je,DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS:()=>G,DAILY_REPORT_CLIENT_TEMP_ID_PATTERN:()=>T,DAILY_REPORT_INTERNAL_SOURCE_TYPE:()=>Ze,DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT:()=>Ve,DAILY_REPORT_SEARCH_COMBINES:()=>Ke,DAILY_REPORT_SSE_CURSOR_PARAM:()=>De,DAILY_REPORT_SSE_HEARTBEAT_MS:()=>he,DAILY_REPORT_SSE_TERMINAL_EVENTS:()=>fe,buildDailyReportAttachmentUrl:()=>We,dailyReportDetailSchema:()=>_,dailyReportSseMessageSchema:()=>xe,encodeDailyReportActionCommand:()=>Ce,foldDailyReportSourceTypeToken:()=>Xe,forEachIdsStreamRow:()=>Le,isDailyReportAttachmentThumbnailVariant:()=>U,normalizeBusinessDateKey:()=>Ne,parseDailyReportActionResult:()=>ke,parseDailyReportAttachmentQuery:()=>Be,readDailyReportSearchMarksAnswer:()=>Qe,readIdsStreamChunkLine:()=>Pe});module.exports=st(Qt);var d=require("zod/v3");var T=/^(?:[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 ee=require("zod/v3"),f=e=>Number.isSafeInteger(e)&&e>0,m=ee.z.number().int().positive().max(Number.MAX_SAFE_INTEGER);var i=require("zod/v3");var I=Symbol("daily-report wire mismatch"),h=(e,t,r)=>(e.issues.push({...r,path:t===null?[...e.path]:[...e.path,t]}),I),oe=e=>e===null?"null":Array.isArray(e)?"array":Number.isNaN(e)?"nan":typeof e,g=(e,t)=>({code:"invalid_type",expected:e,received:oe(t)}),it=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),lt=e=>{let t=0;for(let r in e)t+=1;return t},te=(e,t,r)=>{let n={};for(let o=0;o<r;o+=1){let a=t[o];a in e&&(n[a]=e[a])}return n},x=e=>{let t=Object.keys(e),r=Object.values(e);return(n,o)=>{if(!it(n))return h(o,null,g("object",n));let a=null,u=!1,s=0;for(let l=0;l<t.length;l+=1){let c=t[l],R=n[c];R!==void 0&&(s+=1);let D=r[l](R,o,c);if(D===I){u=!0;continue}a===null&&D!==R&&(a=te(n,t,l)),a!==null&&(D!==void 0||c in n)&&(a[c]=D)}return u?I:a!==null?a:lt(n)===s?n:te(n,t,t.length)}},C=e=>(t,r,n)=>{r.path.push(n);let o=e(t,r);return r.path.pop(),o},k=e=>(t,r,n)=>{if(!Array.isArray(t))return h(r,n,g("array",t));r.path.push(n);let o=t,a=!1;for(let u=0;u<t.length;u+=1){let s=t[u],l=e(s,r,u);l===I?a=!0:l!==s&&(o===t&&(o=t.slice()),o[u]=l)}return r.path.pop(),a?I:o},p=(e,t,r)=>e==null||typeof e=="string"?e:h(t,r,g("string",e)),re=(e,t,r)=>e===null||typeof e=="string"?e:h(t,r,g("string",e)),ne=(e,t,r)=>typeof e=="string"?e:h(t,r,g("string",e)),ut=(e,t,r)=>e===null||typeof e=="number"&&!Number.isNaN(e)?e:h(t,r,g("number",e)),w=(e,t,r)=>typeof e=="boolean"?e:h(t,r,g("boolean",e)),B=(e,t,r)=>{if(typeof e=="number"&&f(e))return e;for(let{message:n,path:o,...a}of m.safeParse(e).error.issues)h(t,r,a);return I},ae={present:!0,absent:!0,unknown:!0},se=Object.keys(ae),pt=se.map(e=>`'${e}'`).join(" | "),dt=(e,t,r)=>typeof e!="string"?h(t,r,{code:"invalid_type",expected:pt,received:oe(e)}):Object.hasOwn(ae,e)?e:h(t,r,{code:"invalid_enum_value",received:e,options:[...se]}),ie=x({name:p,affiliation:p}),le=x({name:p,text:p,color:p}),ue=x({id:B,name:p,color:p}),pe=x({id:B,userId:p,userName:p,content:p,createdAt:p,isMine:w}),ct=x({id:ne,fileName:ne,fileType:re,fileSize:ut,createdAt:re,state:dt,hasThumbnail:w}),mt=x({reportHubId:B,date:p,createdAt:p,author:p,userId:p,sourceType:p,employeeName:p,updatedBy:p,updatedAt:p,category:p,creationCategory:p,visitTimeFrom:p,visitTimeTo:p,customerName:p,interviewers:k(C(ie)),subject:p,content:p,externalComments:k(C(le)),isRead:w,isStarred:w,isDraft:w,labels:k(C(ue)),postedComments:k(C(pe)),attachments:k(C(ct))}),M=(e,t)=>{let r={path:[],issues:[]},n=e(t,r);return n===I?{ok:!1,issues:r.issues}:{ok:!0,value:n}},de=e=>M(mt,e),ce=e=>M(ie,e),me=e=>M(le,e),ye=e=>M(ue,e),Re=e=>M(pe,e);var fe=["auth-required","forbidden","resync-required"],he=15e3,De="lastEventId",yt=/^\d{1,15}-\d{1,15}$/,be=e=>yt.test(e);var N=e=>i.z.unknown().transform((t,r)=>{let n=e(t);if(n.ok)return n.value;for(let o of n.issues)r.addIssue({...o,fatal:!0});return i.z.NEVER}),ar=N(ce),sr=N(me),ir=N(ye),F=N(Re),_=N(de),O=i.z.string().regex(T),Se=i.z.object({type:i.z.literal("connected")}),Ie=i.z.object({type:i.z.literal("status-update"),reportHubId:m,statusType:i.z.enum(["star","read"]),value:i.z.boolean(),clientTempId:O}),z=i.z.string(),ge=i.z.object({type:i.z.literal("comment-add"),reportHubId:m,comment:F,clientTempId:O,sourceType:z}),Ae=i.z.object({type:i.z.literal("comment-delete"),reportHubId:m,commentId:m,clientTempId:O,sourceType:z}),Y={recipientRawUserId:m.optional()},Rt=Ie.extend(Y),ft=ge.extend(Y),ht=Ae.extend(Y),E={reportHubId:m,report:_,clientTempId:O},$={...Y,actorRawUserId:m},K={viewerIsActor:i.z.boolean()},Dt=i.z.object({type:i.z.literal("report-create"),...E,...K}),bt=i.z.object({type:i.z.literal("report-update"),...E,...K}),St=i.z.object({type:i.z.literal("report-publish"),...E,...K}),It=i.z.object({type:i.z.literal("report-create"),...E,...$}),gt=i.z.object({type:i.z.literal("report-update"),...E,...$}),At=i.z.object({type:i.z.literal("report-publish"),...E,...$}),Te=i.z.object({type:i.z.literal("report-delete"),reportHubId:m,clientTempId:O,sourceType:z}),xe=i.z.discriminatedUnion("type",[Se,Ie,ge,Ae,Dt,bt,St,Te]),lr=i.z.discriminatedUnion("type",[Se,Rt,ft,ht,It,gt,At,Te]);var _e=e=>e.issues.map(t=>`${t.path.length===0?"(root)":t.path.join(".")}: ${t.code}`).join("; ");var Ee=Object.freeze(["create","update","publish","delete","toggleStar","toggleRead","addComment","deleteComment","clearCache"]);var y=Object.freeze({intent:"intent",clientTempId:"clientTempId",businessDate:"businessDate",operationTimestamp:"operationTimestamp",reportHubId:"reportHubId",title:"title",content:"content",isStarred:"isStarred",isRead:"isRead",commentId:"commentId"}),Ce=e=>{let t=new FormData;if(t.append(y.intent,e.intent),e.intent==="clearCache"||(t.append(y.clientTempId,e.clientTempId),e.businessDate!==null&&t.append(y.businessDate,e.businessDate),e.operationTimestamp!==null&&t.append(y.operationTimestamp,String(e.operationTimestamp)),e.intent==="create"))return t;switch(t.append(y.reportHubId,String(e.reportHubId)),e.intent){case"update":return e.changes.title!==void 0&&t.append(y.title,e.changes.title),e.changes.content!==void 0&&t.append(y.content,e.changes.content),t;case"publish":case"delete":return t;case"toggleStar":return t.append(y.isStarred,String(e.value)),t;case"toggleRead":return t.append(y.isRead,String(e.value)),t;case"addComment":return t.append(y.content,e.content),t;case"deleteComment":return t.append(y.commentId,String(e.commentId)),t}},Tt=()=>{let e=m,t=d.z.string().regex(T),r=d.z.literal("OK"),n=d.z.object({isStarred:d.z.boolean(),isRead:d.z.boolean()}),o=d.z.number().int().nonnegative().nullable();return{create:d.z.object({status:r,intent:d.z.literal("create"),reportHubId:e,clientTempId:t,report:_}),update:d.z.object({status:r,intent:d.z.literal("update"),reportHubId:e,clientTempId:t}),publish:d.z.object({status:r,intent:d.z.literal("publish"),reportHubId:e,clientTempId:t,report:_.nullable()}),delete:d.z.object({status:r,intent:d.z.literal("delete"),reportHubId:e,clientTempId:t}),toggleStar:d.z.object({status:r,intent:d.z.literal("toggleStar"),reportHubId:e,clientTempId:t,updatedStatus:n,operationTimestamp:o}),toggleRead:d.z.object({status:r,intent:d.z.literal("toggleRead"),reportHubId:e,clientTempId:t,updatedStatus:n,operationTimestamp:o}),addComment:d.z.object({status:r,intent:d.z.literal("addComment"),reportHubId:e,clientTempId:t,newComment:F}),deleteComment:d.z.object({status:r,intent:d.z.literal("deleteComment"),reportHubId:e,clientTempId:t,deletedCommentId:m}),clearCache:d.z.object({status:r,intent:d.z.literal("clearCache")})}},V=null,xt=()=>(V===null&&(V=Tt()),V),ke=(e,t)=>{let r=xt()[e].safeParse(t);return r.success?{result:r.data}:{mismatch:_e(r.error)}};var _t=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var we=e=>e<10?`0${e}`:`${e}`,Et=e=>{if(Number.isNaN(e.getTime()))return null;let t=e.getFullYear(),r=we(e.getMonth()+1),n=we(e.getDate());return`${t}-${r}-${n}`},Me=e=>{let t=_t.exec(e);if(t===null)return null;let[,r,,n,o]=t,a=Number(r),u=Number(n),s=Number(o);if(a<1)return null;let l=new Date(0);return l.setUTCFullYear(a,u-1,s),l.getUTCFullYear()!==a||l.getUTCMonth()!==u-1||l.getUTCDate()!==s?null:`${r}-${n}-${o}`},q=e=>Me(e)===e;var Ne=e=>e==null?null:e instanceof Date?Et(e):Me(e);var Oe="ids-columns",Ct=e=>{if(typeof e!="object"||e===null)return"unknown";let{kind:t}=e;return t==="chunk"?"chunk":t==="error"?"error":"unknown"},kt=e=>typeof e=="number"&&f(e),wt=e=>{if(typeof e!="object"||e===null)return!1;let{businessDate:t,reportHubId:r}=e;return(t===null||typeof t=="string")&&typeof r=="number"},Mt=4,Nt=e=>{let t=Mt;for(;2**t<e*2;)t+=1;let r=new Float64Array(2**t),n=r.length-1,o=32-t;return a=>{let u=Math.imul(a|0,2654435761)>>>o;for(;;){let s=r[u];if(s===0)return r[u]=a,!0;if(s===a)return!1;u=u+1&n}}},Ot=/^[0-9a-f]{1,16}$/,Pt=e=>f(e.reportHubId)&&(e.businessDate===null||q(e.businessDate)),Lt=e=>typeof e=="string"&&Ot.test(e),Ht=Object.freeze({kind:"absent"}),jt=Object.freeze({kind:"value",value:null}),Yt=e=>e===void 0?Ht:e===null?jt:typeof e=="string"&&be(e)?{kind:"value",value:e}:{kind:"malformed",received:e},Pe=e=>{if(Ct(e)!=="chunk")return null;let{ids:t,dates:r,counts:n,sourceTypes:o,sources:a,isLast:u,nextCursor:s,total:l,snapshot:c,provisional:R,restarted:D,streamAnchor:Je}=e;if(typeof u!="boolean"||!(s===null||wt(s))||!(Array.isArray(t)&&Array.isArray(r)&&Array.isArray(n)&&Array.isArray(o)&&Array.isArray(a))||r.length!==n.length||a.length!==t.length)return null;for(let b of o)if(!(b===null||typeof b=="string"))return null;let et=Nt(t.length),S=0,Z=null,X=0;for(let b=0;b<r.length;b++){let A=r[b],L=n[b];if(!(A===null||typeof A=="string"&&q(A))||b>0&&A===r[b-1]||typeof L!="number"||!Number.isSafeInteger(L)||L<1)return null;let J=S+L;if(J>t.length)return null;for(;S<J;S++){let H=t[S],j=a[S];if(!(kt(H)&&et(H))||typeof j!="number"||!Number.isSafeInteger(j)||j<0||j>=o.length||S>0&&!vt(Z,X,A,H))return null;Z=A,X=H}}return S!==t.length?null:{rows:e,isLast:u,resumeCursor:s!==null&&Pt(s)?s:null,total:typeof l=="number"&&Number.isSafeInteger(l)&&l>=0?l:null,snapshot:Lt(c)?c:null,provisional:R===!0,restarted:D===!0,streamAnchor:Yt(Je)}},Le=(e,t)=>{let{ids:r,dates:n,counts:o,sourceTypes:a,sources:u}=e,s=0;for(let l=0;l<n.length;l++){let c=n[l];for(let R=s+o[l];s<R;s++){let D=a[u[s]];t(r[s],c,D===null?void 0:D)}}};var Ut=(e,t,r,n)=>e!==r?e===null?1:r===null||e>r?-1:1:n-t,vt=(e,t,r,n)=>Ut(e,t,r,n)<0;var He=Object.freeze({businessDate:"business-date",idsStream:Oe,report:"report",search:"search",reports:"reports",searchMarks:"search-marks",searchFacets:"search-facets",action:"action"}),je=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 G=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),U=e=>Object.hasOwn(G,e);var Ye="download",Ue="thumbnail",ve="1",We=(e,t,r)=>{let n=`${e}/attachment/${encodeURIComponent(t)}`;switch(r.kind){case"inline":return n;case"download":return`${n}?${new URLSearchParams({[Ye]:ve})}`;case"thumbnail":return`${n}?${new URLSearchParams({[Ue]:r.variant})}`}},Be=e=>{let t=e.getAll(Ue),r=e.getAll(Ye);if(t.length>0&&r.length>0)return{kind:"invalid",reason:"conflict"};if(t.length>0){let[n]=t;return t.length===1&&U(n)?{kind:"thumbnail",variant:n}:{kind:"invalid",reason:"thumbnail_variant"}}return r.length>0?r.length===1&&r[0]===ve?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var Q="legacy-";var Wt=/^[1-9][0-9]*$/,Bt=/^(?:0|[1-9][0-9]*)$/,Fe=e=>{if(e===null||!Wt.test(e))return null;let t=Number(e);return f(t)?t:null},v=e=>{if(e===null||!Bt.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null};var Ft=Object.freeze(["subject","content","author","employeeName","updatedBy","category","creationCategory","customerName"]),Mr=Object.freeze({field:e=>e,interviewer:(e,t)=>`interviewer:${e}:${t}`,attachment:e=>`attachment:${e}`,comment:(e,t)=>`comment:${e}:${t}`}),zt=e=>e.startsWith(Q)?v(e.slice(Q.length))!==null:Fe(e)!==null,ze=e=>{if(Ft.includes(e))return!0;let t=e.split(":");switch(t[0]){case"interviewer":return t.length===3&&v(t[1])!==null&&(t[2]==="name"||t[2]==="affiliation");case"attachment":return t.length===2&&v(t[1])!==null;case"comment":return t.length===3&&zt(t[1])&&(t[2]==="author"||t[2]==="content");default:return!1}};var Nr=String.fromCodePoint(3),Or=String.fromCodePoint(2),Pr=String.fromCodePoint(1);var Ke=["intersection","union"];var Hr=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100}),$t=2,Ve=2,$e=Object.freeze({word:0,reading:1}),qe=e=>e===$e.word||e===$e.reading;var P=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},jr=2*(1+$t);var Kt=4294967295,Ge=e=>typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=Kt,Vt=e=>{if(!Array.isArray(e)||e.length%3!==0)return null;let t=[];for(let r=0;r<e.length;r+=3){let n=e[r],o=e[r+1],a=e[r+2];if(!(typeof n=="number"&&Number.isSafeInteger(n)&&n>=0&&typeof o=="number"&&Number.isSafeInteger(o)&&n<o)||!qe(a))return null;if(r>0){let u=t[r-2];if(u>n||u===n&&t[r-1]===a)return null}t.push(n,o,a)}return t},qt=e=>{if(!(P(e)&&Ge(e.fingerprint)))return null;if(Object.hasOwn(e,"dense"))return e.dense===!0&&!Object.hasOwn(e,"ranges")?{fingerprint:e.fingerprint,dense:!0}:null;let t=Vt(e.ranges);return t===null?null:{fingerprint:e.fingerprint,ranges:t}},Gt=e=>{if(!P(e))return null;let t={};for(let[r,n]of Object.entries(e)){if(!ze(r))return null;let o=qt(n);if(o===null)return null;t[r]=o}return t},Qe=(e,t)=>{if(!(P(e)&&Ge(e.wordsDigest)&&Array.isArray(e.reports)&&Array.isArray(e.deferred)))return null;let r=new Set(t.requestedIds),n=new Set,o=2**t.setCount-1,a=[];for(let s of e.reports){if(!P(s))return null;let{reportHubId:l,matchedSets:c}=s;if(!(typeof l=="number"&&f(l)&&r.has(l))||n.has(l)||(n.add(l),t.expectsMatchedSets?!(typeof c=="number"&&Number.isInteger(c)&&c>=0&&c<=o):c!==null))return null;let R=Gt(s.fields);if(R===null)return null;a.push({reportHubId:l,matchedSets:c,fields:R})}if(a.length===0&&e.deferred.length>0)return null;let u=[];for(let s of e.deferred){if(!(typeof s=="number"&&f(s)&&r.has(s))||n.has(s))return null;n.add(s),u.push(s)}return{wordsDigest:e.wordsDigest,reports:a,deferred:u}};var Ze="Internal",Xe=e=>e.trim().toLowerCase();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_INTERNAL_SOURCE_TYPE,DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT,DAILY_REPORT_SEARCH_COMBINES,DAILY_REPORT_SSE_CURSOR_PARAM,DAILY_REPORT_SSE_HEARTBEAT_MS,DAILY_REPORT_SSE_TERMINAL_EVENTS,buildDailyReportAttachmentUrl,dailyReportDetailSchema,dailyReportSseMessageSchema,encodeDailyReportActionCommand,foldDailyReportSourceTypeToken,forEachIdsStreamRow,isDailyReportAttachmentThumbnailVariant,normalizeBusinessDateKey,parseDailyReportActionResult,parseDailyReportAttachmentQuery,readDailyReportSearchMarksAnswer,readIdsStreamChunkLine});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{z as d}from"zod/v3";var _=/^(?:[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 Pe}from"zod/v3";var f=e=>Number.isSafeInteger(e)&&e>0,m=Pe.number().int().positive().max(Number.MAX_SAFE_INTEGER);import{z as l}from"zod/v3";var I=Symbol("daily-report wire mismatch"),h=(e,t,r)=>(e.issues.push({...r,path:t===null?[...e.path]:[...e.path,t]}),I),te=e=>e===null?"null":Array.isArray(e)?"array":Number.isNaN(e)?"nan":typeof e,g=(e,t)=>({code:"invalid_type",expected:e,received:te(t)}),Le=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),He=e=>{let t=0;for(let r in e)t+=1;return t},X=(e,t,r)=>{let n={};for(let o=0;o<r;o+=1){let a=t[o];a in e&&(n[a]=e[a])}return n},T=e=>{let t=Object.keys(e),r=Object.values(e);return(n,o)=>{if(!Le(n))return h(o,null,g("object",n));let a=null,u=!1,s=0;for(let i=0;i<t.length;i+=1){let c=t[i],R=n[c];R!==void 0&&(s+=1);let b=r[i](R,o,c);if(b===I){u=!0;continue}a===null&&b!==R&&(a=X(n,t,i)),a!==null&&(b!==void 0||c in n)&&(a[c]=b)}return u?I:a!==null?a:He(n)===s?n:X(n,t,t.length)}},E=e=>(t,r,n)=>{r.path.push(n);let o=e(t,r);return r.path.pop(),o},C=e=>(t,r,n)=>{if(!Array.isArray(t))return h(r,n,g("array",t));r.path.push(n);let o=t,a=!1;for(let u=0;u<t.length;u+=1){let s=t[u],i=e(s,r,u);i===I?a=!0:i!==s&&(o===t&&(o=t.slice()),o[u]=i)}return r.path.pop(),a?I:o},p=(e,t,r)=>e==null||typeof e=="string"?e:h(t,r,g("string",e)),J=(e,t,r)=>e===null||typeof e=="string"?e:h(t,r,g("string",e)),ee=(e,t,r)=>typeof e=="string"?e:h(t,r,g("string",e)),je=(e,t,r)=>e===null||typeof e=="number"&&!Number.isNaN(e)?e:h(t,r,g("number",e)),k=(e,t,r)=>typeof e=="boolean"?e:h(t,r,g("boolean",e)),v=(e,t,r)=>{if(typeof e=="number"&&f(e))return e;for(let{message:n,path:o,...a}of m.safeParse(e).error.issues)h(t,r,a);return I},re={present:!0,absent:!0,unknown:!0},ne=Object.keys(re),Ye=ne.map(e=>`'${e}'`).join(" | "),Ue=(e,t,r)=>typeof e!="string"?h(t,r,{code:"invalid_type",expected:Ye,received:te(e)}):Object.hasOwn(re,e)?e:h(t,r,{code:"invalid_enum_value",received:e,options:[...ne]}),oe=T({name:p,affiliation:p}),ae=T({name:p,text:p,color:p}),se=T({id:v,name:p,color:p}),ie=T({id:v,userId:p,userName:p,content:p,createdAt:p,isMine:k}),ve=T({id:ee,fileName:ee,fileType:J,fileSize:je,createdAt:J,state:Ue,hasThumbnail:k}),We=T({reportHubId:v,date:p,createdAt:p,author:p,userId:p,sourceType:p,employeeName:p,updatedBy:p,updatedAt:p,category:p,creationCategory:p,visitTimeFrom:p,visitTimeTo:p,customerName:p,interviewers:C(E(oe)),subject:p,content:p,externalComments:C(E(ae)),isRead:k,isStarred:k,isDraft:k,labels:C(E(se)),postedComments:C(E(ie)),attachments:C(E(ve))}),w=(e,t)=>{let r={path:[],issues:[]},n=e(t,r);return n===I?{ok:!1,issues:r.issues}:{ok:!0,value:n}},le=e=>w(We,e),ue=e=>w(oe,e),pe=e=>w(ae,e),de=e=>w(se,e),ce=e=>w(ie,e);var Be=["auth-required","forbidden","resync-required"],Fe=15e3,ze="lastEventId",$e=/^\d{1,15}-\d{1,15}$/,me=e=>$e.test(e),M=e=>l.unknown().transform((t,r)=>{let n=e(t);if(n.ok)return n.value;for(let o of n.issues)r.addIssue({...o,fatal:!0});return l.NEVER}),Xt=M(ue),Jt=M(pe),er=M(de),W=M(ce),N=M(le),O=l.string().regex(_),ye=l.object({type:l.literal("connected")}),Re=l.object({type:l.literal("status-update"),reportHubId:m,statusType:l.enum(["star","read"]),value:l.boolean(),clientTempId:O}),B=l.string(),fe=l.object({type:l.literal("comment-add"),reportHubId:m,comment:W,clientTempId:O,sourceType:B}),he=l.object({type:l.literal("comment-delete"),reportHubId:m,commentId:m,clientTempId:O,sourceType:B}),Y={recipientRawUserId:m.optional()},Ke=Re.extend(Y),Ve=fe.extend(Y),qe=he.extend(Y),x={reportHubId:m,report:N,clientTempId:O},F={...Y,actorRawUserId:m},z={viewerIsActor:l.boolean()},Ge=l.object({type:l.literal("report-create"),...x,...z}),Qe=l.object({type:l.literal("report-update"),...x,...z}),Ze=l.object({type:l.literal("report-publish"),...x,...z}),Xe=l.object({type:l.literal("report-create"),...x,...F}),Je=l.object({type:l.literal("report-update"),...x,...F}),et=l.object({type:l.literal("report-publish"),...x,...F}),be=l.object({type:l.literal("report-delete"),reportHubId:m,clientTempId:O,sourceType:B}),tt=l.discriminatedUnion("type",[ye,Re,fe,he,Ge,Qe,Ze,be]),tr=l.discriminatedUnion("type",[ye,Ke,Ve,qe,Xe,Je,et,be]);var De=e=>e.issues.map(t=>`${t.path.length===0?"(root)":t.path.join(".")}: ${t.code}`).join("; ");var rt=Object.freeze(["create","update","publish","delete","toggleStar","toggleRead","addComment","deleteComment","clearCache"]);var y=Object.freeze({intent:"intent",clientTempId:"clientTempId",businessDate:"businessDate",operationTimestamp:"operationTimestamp",reportHubId:"reportHubId",title:"title",content:"content",isStarred:"isStarred",isRead:"isRead",commentId:"commentId"}),nt=e=>{let t=new FormData;if(t.append(y.intent,e.intent),e.intent==="clearCache"||(t.append(y.clientTempId,e.clientTempId),e.businessDate!==null&&t.append(y.businessDate,e.businessDate),e.operationTimestamp!==null&&t.append(y.operationTimestamp,String(e.operationTimestamp)),e.intent==="create"))return t;switch(t.append(y.reportHubId,String(e.reportHubId)),e.intent){case"update":return e.changes.title!==void 0&&t.append(y.title,e.changes.title),e.changes.content!==void 0&&t.append(y.content,e.changes.content),t;case"publish":case"delete":return t;case"toggleStar":return t.append(y.isStarred,String(e.value)),t;case"toggleRead":return t.append(y.isRead,String(e.value)),t;case"addComment":return t.append(y.content,e.content),t;case"deleteComment":return t.append(y.commentId,String(e.commentId)),t}},ot=()=>{let e=m,t=d.string().regex(_),r=d.literal("OK"),n=d.object({isStarred:d.boolean(),isRead:d.boolean()}),o=d.number().int().nonnegative().nullable();return{create:d.object({status:r,intent:d.literal("create"),reportHubId:e,clientTempId:t,report:N}),update:d.object({status:r,intent:d.literal("update"),reportHubId:e,clientTempId:t}),publish:d.object({status:r,intent:d.literal("publish"),reportHubId:e,clientTempId:t,report:N.nullable()}),delete:d.object({status:r,intent:d.literal("delete"),reportHubId:e,clientTempId:t}),toggleStar:d.object({status:r,intent:d.literal("toggleStar"),reportHubId:e,clientTempId:t,updatedStatus:n,operationTimestamp:o}),toggleRead:d.object({status:r,intent:d.literal("toggleRead"),reportHubId:e,clientTempId:t,updatedStatus:n,operationTimestamp:o}),addComment:d.object({status:r,intent:d.literal("addComment"),reportHubId:e,clientTempId:t,newComment:W}),deleteComment:d.object({status:r,intent:d.literal("deleteComment"),reportHubId:e,clientTempId:t,deletedCommentId:m}),clearCache:d.object({status:r,intent:d.literal("clearCache")})}},$=null,at=()=>($===null&&($=ot()),$),st=(e,t)=>{let r=at()[e].safeParse(t);return r.success?{result:r.data}:{mismatch:De(r.error)}};var it=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var Se=e=>e<10?`0${e}`:`${e}`,lt=e=>{if(Number.isNaN(e.getTime()))return null;let t=e.getFullYear(),r=Se(e.getMonth()+1),n=Se(e.getDate());return`${t}-${r}-${n}`},Ie=e=>{let t=it.exec(e);if(t===null)return null;let[,r,,n,o]=t,a=Number(r),u=Number(n),s=Number(o);if(a<1)return null;let i=new Date(0);return i.setUTCFullYear(a,u-1,s),i.getUTCFullYear()!==a||i.getUTCMonth()!==u-1||i.getUTCDate()!==s?null:`${r}-${n}-${o}`},K=e=>Ie(e)===e;var ut=e=>e==null?null:e instanceof Date?lt(e):Ie(e);var ge="ids-columns",pt=e=>{if(typeof e!="object"||e===null)return"unknown";let{kind:t}=e;return t==="chunk"?"chunk":t==="error"?"error":"unknown"},dt=e=>typeof e=="number"&&f(e),ct=e=>{if(typeof e!="object"||e===null)return!1;let{businessDate:t,reportHubId:r}=e;return(t===null||typeof t=="string")&&typeof r=="number"},mt=4,yt=e=>{let t=mt;for(;2**t<e*2;)t+=1;let r=new Float64Array(2**t),n=r.length-1,o=32-t;return a=>{let u=Math.imul(a|0,2654435761)>>>o;for(;;){let s=r[u];if(s===0)return r[u]=a,!0;if(s===a)return!1;u=u+1&n}}},Rt=/^[0-9a-f]{1,16}$/,ft=e=>f(e.reportHubId)&&(e.businessDate===null||K(e.businessDate)),ht=e=>typeof e=="string"&&Rt.test(e),bt=Object.freeze({kind:"absent"}),Dt=Object.freeze({kind:"value",value:null}),St=e=>e===void 0?bt:e===null?Dt:typeof e=="string"&&me(e)?{kind:"value",value:e}:{kind:"malformed",received:e},It=e=>{if(pt(e)!=="chunk")return null;let{ids:t,dates:r,counts:n,sourceTypes:o,sources:a,isLast:u,nextCursor:s,total:i,snapshot:c,provisional:R,restarted:b,streamAnchor:Ne}=e;if(typeof u!="boolean"||!(s===null||ct(s))||!(Array.isArray(t)&&Array.isArray(r)&&Array.isArray(n)&&Array.isArray(o)&&Array.isArray(a))||r.length!==n.length||a.length!==t.length)return null;for(let D of o)if(!(D===null||typeof D=="string"))return null;let Oe=yt(t.length),S=0,G=null,Q=0;for(let D=0;D<r.length;D++){let A=r[D],L=n[D];if(!(A===null||typeof A=="string"&&K(A))||D>0&&A===r[D-1]||typeof L!="number"||!Number.isSafeInteger(L)||L<1)return null;let Z=S+L;if(Z>t.length)return null;for(;S<Z;S++){let H=t[S],j=a[S];if(!(dt(H)&&Oe(H))||typeof j!="number"||!Number.isSafeInteger(j)||j<0||j>=o.length||S>0&&!Tt(G,Q,A,H))return null;G=A,Q=H}}return S!==t.length?null:{rows:e,isLast:u,resumeCursor:s!==null&&ft(s)?s:null,total:typeof i=="number"&&Number.isSafeInteger(i)&&i>=0?i:null,snapshot:ht(c)?c:null,provisional:R===!0,restarted:b===!0,streamAnchor:St(Ne)}},gt=(e,t)=>{let{ids:r,dates:n,counts:o,sourceTypes:a,sources:u}=e,s=0;for(let i=0;i<n.length;i++){let c=n[i];for(let R=s+o[i];s<R;s++){let b=a[u[s]];t(r[s],c,b===null?void 0:b)}}};var At=(e,t,r,n)=>e!==r?e===null?1:r===null||e>r?-1:1:n-t,Tt=(e,t,r,n)=>At(e,t,r,n)<0;var xt=Object.freeze({businessDate:"business-date",idsStream:ge,report:"report",search:"search",reports:"reports",searchMarks:"search-marks",searchFacets:"search-facets",action:"action"}),_t=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 Ae=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),V=e=>Object.hasOwn(Ae,e);var Te="download",xe="thumbnail",_e="1",Et=(e,t,r)=>{let n=`${e}/attachment/${encodeURIComponent(t)}`;switch(r.kind){case"inline":return n;case"download":return`${n}?${new URLSearchParams({[Te]:_e})}`;case"thumbnail":return`${n}?${new URLSearchParams({[xe]:r.variant})}`}},Ct=e=>{let t=e.getAll(xe),r=e.getAll(Te);if(t.length>0&&r.length>0)return{kind:"invalid",reason:"conflict"};if(t.length>0){let[n]=t;return t.length===1&&V(n)?{kind:"thumbnail",variant:n}:{kind:"invalid",reason:"thumbnail_variant"}}return r.length>0?r.length===1&&r[0]===_e?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var q="legacy-";var kt=/^[1-9][0-9]*$/,wt=/^(?:0|[1-9][0-9]*)$/,Ee=e=>{if(e===null||!kt.test(e))return null;let t=Number(e);return f(t)?t:null},U=e=>{if(e===null||!wt.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null};var Mt=Object.freeze(["subject","content","author","employeeName","updatedBy","category","creationCategory","customerName"]),xr=Object.freeze({field:e=>e,interviewer:(e,t)=>`interviewer:${e}:${t}`,attachment:e=>`attachment:${e}`,comment:(e,t)=>`comment:${e}:${t}`}),Nt=e=>e.startsWith(q)?U(e.slice(q.length))!==null:Ee(e)!==null,Ce=e=>{if(Mt.includes(e))return!0;let t=e.split(":");switch(t[0]){case"interviewer":return t.length===3&&U(t[1])!==null&&(t[2]==="name"||t[2]==="affiliation");case"attachment":return t.length===2&&U(t[1])!==null;case"comment":return t.length===3&&Nt(t[1])&&(t[2]==="author"||t[2]==="content");default:return!1}};var _r=String.fromCodePoint(3),Er=String.fromCodePoint(2),Cr=String.fromCodePoint(1);var Ot=["intersection","union"];var wr=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100}),Pt=2,Lt=2,ke=Object.freeze({word:0,reading:1}),we=e=>e===ke.word||e===ke.reading;var P=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Mr=2*(1+Pt);var Ht=4294967295,Me=e=>typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=Ht,jt=e=>{if(!Array.isArray(e)||e.length%3!==0)return null;let t=[];for(let r=0;r<e.length;r+=3){let n=e[r],o=e[r+1],a=e[r+2];if(!(typeof n=="number"&&Number.isSafeInteger(n)&&n>=0&&typeof o=="number"&&Number.isSafeInteger(o)&&n<o)||!we(a))return null;if(r>0){let u=t[r-2];if(u>n||u===n&&t[r-1]===a)return null}t.push(n,o,a)}return t},Yt=e=>{if(!(P(e)&&Me(e.fingerprint)))return null;if(Object.hasOwn(e,"dense"))return e.dense===!0&&!Object.hasOwn(e,"ranges")?{fingerprint:e.fingerprint,dense:!0}:null;let t=jt(e.ranges);return t===null?null:{fingerprint:e.fingerprint,ranges:t}},Ut=e=>{if(!P(e))return null;let t={};for(let[r,n]of Object.entries(e)){if(!Ce(r))return null;let o=Yt(n);if(o===null)return null;t[r]=o}return t},vt=(e,t)=>{if(!(P(e)&&Me(e.wordsDigest)&&Array.isArray(e.reports)&&Array.isArray(e.deferred)))return null;let r=new Set(t.requestedIds),n=new Set,o=2**t.setCount-1,a=[];for(let s of e.reports){if(!P(s))return null;let{reportHubId:i,matchedSets:c}=s;if(!(typeof i=="number"&&f(i)&&r.has(i))||n.has(i)||(n.add(i),t.expectsMatchedSets?!(typeof c=="number"&&Number.isInteger(c)&&c>=0&&c<=o):c!==null))return null;let R=Ut(s.fields);if(R===null)return null;a.push({reportHubId:i,matchedSets:c,fields:R})}if(a.length===0&&e.deferred.length>0)return null;let u=[];for(let s of e.deferred){if(!(typeof s=="number"&&f(s)&&r.has(s))||n.has(s))return null;n.add(s),u.push(s)}return{wordsDigest:e.wordsDigest,reports:a,deferred:u}};var Wt="Internal",Bt=e=>e.trim().toLowerCase();export{y as DAILY_REPORT_ACTION_FIELDS,rt as DAILY_REPORT_ACTION_INTENTS,xt as DAILY_REPORT_API_ENDPOINTS,_t as DAILY_REPORT_API_QUERY_PARAMS,Ae as DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS,_ as DAILY_REPORT_CLIENT_TEMP_ID_PATTERN,Wt as DAILY_REPORT_INTERNAL_SOURCE_TYPE,Lt as DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT,Ot as DAILY_REPORT_SEARCH_COMBINES,ze as DAILY_REPORT_SSE_CURSOR_PARAM,Fe as DAILY_REPORT_SSE_HEARTBEAT_MS,Be as DAILY_REPORT_SSE_TERMINAL_EVENTS,Et as buildDailyReportAttachmentUrl,N as dailyReportDetailSchema,tt as dailyReportSseMessageSchema,nt as encodeDailyReportActionCommand,Bt as foldDailyReportSourceTypeToken,gt as forEachIdsStreamRow,V as isDailyReportAttachmentThumbnailVariant,ut as normalizeBusinessDateKey,st as parseDailyReportActionResult,Ct as parseDailyReportAttachmentQuery,vt as readDailyReportSearchMarksAnswer,It as readIdsStreamChunkLine};
1
+ import{z as d}from"zod/v3";var _=/^(?:[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 Pe}from"zod/v3";var f=e=>Number.isSafeInteger(e)&&e>0,m=Pe.number().int().positive().max(Number.MAX_SAFE_INTEGER);import{z as l}from"zod/v3";var I=Symbol("daily-report wire mismatch"),h=(e,t,r)=>(e.issues.push({...r,path:t===null?[...e.path]:[...e.path,t]}),I),te=e=>e===null?"null":Array.isArray(e)?"array":Number.isNaN(e)?"nan":typeof e,g=(e,t)=>({code:"invalid_type",expected:e,received:te(t)}),Le=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),He=e=>{let t=0;for(let r in e)t+=1;return t},X=(e,t,r)=>{let n={};for(let o=0;o<r;o+=1){let a=t[o];a in e&&(n[a]=e[a])}return n},T=e=>{let t=Object.keys(e),r=Object.values(e);return(n,o)=>{if(!Le(n))return h(o,null,g("object",n));let a=null,u=!1,s=0;for(let i=0;i<t.length;i+=1){let c=t[i],R=n[c];R!==void 0&&(s+=1);let D=r[i](R,o,c);if(D===I){u=!0;continue}a===null&&D!==R&&(a=X(n,t,i)),a!==null&&(D!==void 0||c in n)&&(a[c]=D)}return u?I:a!==null?a:He(n)===s?n:X(n,t,t.length)}},E=e=>(t,r,n)=>{r.path.push(n);let o=e(t,r);return r.path.pop(),o},C=e=>(t,r,n)=>{if(!Array.isArray(t))return h(r,n,g("array",t));r.path.push(n);let o=t,a=!1;for(let u=0;u<t.length;u+=1){let s=t[u],i=e(s,r,u);i===I?a=!0:i!==s&&(o===t&&(o=t.slice()),o[u]=i)}return r.path.pop(),a?I:o},p=(e,t,r)=>e==null||typeof e=="string"?e:h(t,r,g("string",e)),J=(e,t,r)=>e===null||typeof e=="string"?e:h(t,r,g("string",e)),ee=(e,t,r)=>typeof e=="string"?e:h(t,r,g("string",e)),je=(e,t,r)=>e===null||typeof e=="number"&&!Number.isNaN(e)?e:h(t,r,g("number",e)),k=(e,t,r)=>typeof e=="boolean"?e:h(t,r,g("boolean",e)),v=(e,t,r)=>{if(typeof e=="number"&&f(e))return e;for(let{message:n,path:o,...a}of m.safeParse(e).error.issues)h(t,r,a);return I},re={present:!0,absent:!0,unknown:!0},ne=Object.keys(re),Ye=ne.map(e=>`'${e}'`).join(" | "),Ue=(e,t,r)=>typeof e!="string"?h(t,r,{code:"invalid_type",expected:Ye,received:te(e)}):Object.hasOwn(re,e)?e:h(t,r,{code:"invalid_enum_value",received:e,options:[...ne]}),oe=T({name:p,affiliation:p}),ae=T({name:p,text:p,color:p}),se=T({id:v,name:p,color:p}),ie=T({id:v,userId:p,userName:p,content:p,createdAt:p,isMine:k}),ve=T({id:ee,fileName:ee,fileType:J,fileSize:je,createdAt:J,state:Ue,hasThumbnail:k}),We=T({reportHubId:v,date:p,createdAt:p,author:p,userId:p,sourceType:p,employeeName:p,updatedBy:p,updatedAt:p,category:p,creationCategory:p,visitTimeFrom:p,visitTimeTo:p,customerName:p,interviewers:C(E(oe)),subject:p,content:p,externalComments:C(E(ae)),isRead:k,isStarred:k,isDraft:k,labels:C(E(se)),postedComments:C(E(ie)),attachments:C(E(ve))}),w=(e,t)=>{let r={path:[],issues:[]},n=e(t,r);return n===I?{ok:!1,issues:r.issues}:{ok:!0,value:n}},le=e=>w(We,e),ue=e=>w(oe,e),pe=e=>w(ae,e),de=e=>w(se,e),ce=e=>w(ie,e);var Be=["auth-required","forbidden","resync-required"],Fe=15e3,ze="lastEventId",$e=/^\d{1,15}-\d{1,15}$/,me=e=>$e.test(e);var M=e=>l.unknown().transform((t,r)=>{let n=e(t);if(n.ok)return n.value;for(let o of n.issues)r.addIssue({...o,fatal:!0});return l.NEVER}),Xt=M(ue),Jt=M(pe),er=M(de),W=M(ce),N=M(le),O=l.string().regex(_),ye=l.object({type:l.literal("connected")}),Re=l.object({type:l.literal("status-update"),reportHubId:m,statusType:l.enum(["star","read"]),value:l.boolean(),clientTempId:O}),B=l.string(),fe=l.object({type:l.literal("comment-add"),reportHubId:m,comment:W,clientTempId:O,sourceType:B}),he=l.object({type:l.literal("comment-delete"),reportHubId:m,commentId:m,clientTempId:O,sourceType:B}),Y={recipientRawUserId:m.optional()},Ke=Re.extend(Y),Ve=fe.extend(Y),qe=he.extend(Y),x={reportHubId:m,report:N,clientTempId:O},F={...Y,actorRawUserId:m},z={viewerIsActor:l.boolean()},Ge=l.object({type:l.literal("report-create"),...x,...z}),Qe=l.object({type:l.literal("report-update"),...x,...z}),Ze=l.object({type:l.literal("report-publish"),...x,...z}),Xe=l.object({type:l.literal("report-create"),...x,...F}),Je=l.object({type:l.literal("report-update"),...x,...F}),et=l.object({type:l.literal("report-publish"),...x,...F}),De=l.object({type:l.literal("report-delete"),reportHubId:m,clientTempId:O,sourceType:B}),tt=l.discriminatedUnion("type",[ye,Re,fe,he,Ge,Qe,Ze,De]),tr=l.discriminatedUnion("type",[ye,Ke,Ve,qe,Xe,Je,et,De]);var be=e=>e.issues.map(t=>`${t.path.length===0?"(root)":t.path.join(".")}: ${t.code}`).join("; ");var rt=Object.freeze(["create","update","publish","delete","toggleStar","toggleRead","addComment","deleteComment","clearCache"]);var y=Object.freeze({intent:"intent",clientTempId:"clientTempId",businessDate:"businessDate",operationTimestamp:"operationTimestamp",reportHubId:"reportHubId",title:"title",content:"content",isStarred:"isStarred",isRead:"isRead",commentId:"commentId"}),nt=e=>{let t=new FormData;if(t.append(y.intent,e.intent),e.intent==="clearCache"||(t.append(y.clientTempId,e.clientTempId),e.businessDate!==null&&t.append(y.businessDate,e.businessDate),e.operationTimestamp!==null&&t.append(y.operationTimestamp,String(e.operationTimestamp)),e.intent==="create"))return t;switch(t.append(y.reportHubId,String(e.reportHubId)),e.intent){case"update":return e.changes.title!==void 0&&t.append(y.title,e.changes.title),e.changes.content!==void 0&&t.append(y.content,e.changes.content),t;case"publish":case"delete":return t;case"toggleStar":return t.append(y.isStarred,String(e.value)),t;case"toggleRead":return t.append(y.isRead,String(e.value)),t;case"addComment":return t.append(y.content,e.content),t;case"deleteComment":return t.append(y.commentId,String(e.commentId)),t}},ot=()=>{let e=m,t=d.string().regex(_),r=d.literal("OK"),n=d.object({isStarred:d.boolean(),isRead:d.boolean()}),o=d.number().int().nonnegative().nullable();return{create:d.object({status:r,intent:d.literal("create"),reportHubId:e,clientTempId:t,report:N}),update:d.object({status:r,intent:d.literal("update"),reportHubId:e,clientTempId:t}),publish:d.object({status:r,intent:d.literal("publish"),reportHubId:e,clientTempId:t,report:N.nullable()}),delete:d.object({status:r,intent:d.literal("delete"),reportHubId:e,clientTempId:t}),toggleStar:d.object({status:r,intent:d.literal("toggleStar"),reportHubId:e,clientTempId:t,updatedStatus:n,operationTimestamp:o}),toggleRead:d.object({status:r,intent:d.literal("toggleRead"),reportHubId:e,clientTempId:t,updatedStatus:n,operationTimestamp:o}),addComment:d.object({status:r,intent:d.literal("addComment"),reportHubId:e,clientTempId:t,newComment:W}),deleteComment:d.object({status:r,intent:d.literal("deleteComment"),reportHubId:e,clientTempId:t,deletedCommentId:m}),clearCache:d.object({status:r,intent:d.literal("clearCache")})}},$=null,at=()=>($===null&&($=ot()),$),st=(e,t)=>{let r=at()[e].safeParse(t);return r.success?{result:r.data}:{mismatch:be(r.error)}};var it=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var Se=e=>e<10?`0${e}`:`${e}`,lt=e=>{if(Number.isNaN(e.getTime()))return null;let t=e.getFullYear(),r=Se(e.getMonth()+1),n=Se(e.getDate());return`${t}-${r}-${n}`},Ie=e=>{let t=it.exec(e);if(t===null)return null;let[,r,,n,o]=t,a=Number(r),u=Number(n),s=Number(o);if(a<1)return null;let i=new Date(0);return i.setUTCFullYear(a,u-1,s),i.getUTCFullYear()!==a||i.getUTCMonth()!==u-1||i.getUTCDate()!==s?null:`${r}-${n}-${o}`},K=e=>Ie(e)===e;var ut=e=>e==null?null:e instanceof Date?lt(e):Ie(e);var ge="ids-columns",pt=e=>{if(typeof e!="object"||e===null)return"unknown";let{kind:t}=e;return t==="chunk"?"chunk":t==="error"?"error":"unknown"},dt=e=>typeof e=="number"&&f(e),ct=e=>{if(typeof e!="object"||e===null)return!1;let{businessDate:t,reportHubId:r}=e;return(t===null||typeof t=="string")&&typeof r=="number"},mt=4,yt=e=>{let t=mt;for(;2**t<e*2;)t+=1;let r=new Float64Array(2**t),n=r.length-1,o=32-t;return a=>{let u=Math.imul(a|0,2654435761)>>>o;for(;;){let s=r[u];if(s===0)return r[u]=a,!0;if(s===a)return!1;u=u+1&n}}},Rt=/^[0-9a-f]{1,16}$/,ft=e=>f(e.reportHubId)&&(e.businessDate===null||K(e.businessDate)),ht=e=>typeof e=="string"&&Rt.test(e),Dt=Object.freeze({kind:"absent"}),bt=Object.freeze({kind:"value",value:null}),St=e=>e===void 0?Dt:e===null?bt:typeof e=="string"&&me(e)?{kind:"value",value:e}:{kind:"malformed",received:e},It=e=>{if(pt(e)!=="chunk")return null;let{ids:t,dates:r,counts:n,sourceTypes:o,sources:a,isLast:u,nextCursor:s,total:i,snapshot:c,provisional:R,restarted:D,streamAnchor:Ne}=e;if(typeof u!="boolean"||!(s===null||ct(s))||!(Array.isArray(t)&&Array.isArray(r)&&Array.isArray(n)&&Array.isArray(o)&&Array.isArray(a))||r.length!==n.length||a.length!==t.length)return null;for(let b of o)if(!(b===null||typeof b=="string"))return null;let Oe=yt(t.length),S=0,G=null,Q=0;for(let b=0;b<r.length;b++){let A=r[b],L=n[b];if(!(A===null||typeof A=="string"&&K(A))||b>0&&A===r[b-1]||typeof L!="number"||!Number.isSafeInteger(L)||L<1)return null;let Z=S+L;if(Z>t.length)return null;for(;S<Z;S++){let H=t[S],j=a[S];if(!(dt(H)&&Oe(H))||typeof j!="number"||!Number.isSafeInteger(j)||j<0||j>=o.length||S>0&&!Tt(G,Q,A,H))return null;G=A,Q=H}}return S!==t.length?null:{rows:e,isLast:u,resumeCursor:s!==null&&ft(s)?s:null,total:typeof i=="number"&&Number.isSafeInteger(i)&&i>=0?i:null,snapshot:ht(c)?c:null,provisional:R===!0,restarted:D===!0,streamAnchor:St(Ne)}},gt=(e,t)=>{let{ids:r,dates:n,counts:o,sourceTypes:a,sources:u}=e,s=0;for(let i=0;i<n.length;i++){let c=n[i];for(let R=s+o[i];s<R;s++){let D=a[u[s]];t(r[s],c,D===null?void 0:D)}}};var At=(e,t,r,n)=>e!==r?e===null?1:r===null||e>r?-1:1:n-t,Tt=(e,t,r,n)=>At(e,t,r,n)<0;var xt=Object.freeze({businessDate:"business-date",idsStream:ge,report:"report",search:"search",reports:"reports",searchMarks:"search-marks",searchFacets:"search-facets",action:"action"}),_t=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 Ae=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),V=e=>Object.hasOwn(Ae,e);var Te="download",xe="thumbnail",_e="1",Et=(e,t,r)=>{let n=`${e}/attachment/${encodeURIComponent(t)}`;switch(r.kind){case"inline":return n;case"download":return`${n}?${new URLSearchParams({[Te]:_e})}`;case"thumbnail":return`${n}?${new URLSearchParams({[xe]:r.variant})}`}},Ct=e=>{let t=e.getAll(xe),r=e.getAll(Te);if(t.length>0&&r.length>0)return{kind:"invalid",reason:"conflict"};if(t.length>0){let[n]=t;return t.length===1&&V(n)?{kind:"thumbnail",variant:n}:{kind:"invalid",reason:"thumbnail_variant"}}return r.length>0?r.length===1&&r[0]===_e?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var q="legacy-";var kt=/^[1-9][0-9]*$/,wt=/^(?:0|[1-9][0-9]*)$/,Ee=e=>{if(e===null||!kt.test(e))return null;let t=Number(e);return f(t)?t:null},U=e=>{if(e===null||!wt.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null};var Mt=Object.freeze(["subject","content","author","employeeName","updatedBy","category","creationCategory","customerName"]),xr=Object.freeze({field:e=>e,interviewer:(e,t)=>`interviewer:${e}:${t}`,attachment:e=>`attachment:${e}`,comment:(e,t)=>`comment:${e}:${t}`}),Nt=e=>e.startsWith(q)?U(e.slice(q.length))!==null:Ee(e)!==null,Ce=e=>{if(Mt.includes(e))return!0;let t=e.split(":");switch(t[0]){case"interviewer":return t.length===3&&U(t[1])!==null&&(t[2]==="name"||t[2]==="affiliation");case"attachment":return t.length===2&&U(t[1])!==null;case"comment":return t.length===3&&Nt(t[1])&&(t[2]==="author"||t[2]==="content");default:return!1}};var _r=String.fromCodePoint(3),Er=String.fromCodePoint(2),Cr=String.fromCodePoint(1);var Ot=["intersection","union"];var wr=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100}),Pt=2,Lt=2,ke=Object.freeze({word:0,reading:1}),we=e=>e===ke.word||e===ke.reading;var P=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Mr=2*(1+Pt);var Ht=4294967295,Me=e=>typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=Ht,jt=e=>{if(!Array.isArray(e)||e.length%3!==0)return null;let t=[];for(let r=0;r<e.length;r+=3){let n=e[r],o=e[r+1],a=e[r+2];if(!(typeof n=="number"&&Number.isSafeInteger(n)&&n>=0&&typeof o=="number"&&Number.isSafeInteger(o)&&n<o)||!we(a))return null;if(r>0){let u=t[r-2];if(u>n||u===n&&t[r-1]===a)return null}t.push(n,o,a)}return t},Yt=e=>{if(!(P(e)&&Me(e.fingerprint)))return null;if(Object.hasOwn(e,"dense"))return e.dense===!0&&!Object.hasOwn(e,"ranges")?{fingerprint:e.fingerprint,dense:!0}:null;let t=jt(e.ranges);return t===null?null:{fingerprint:e.fingerprint,ranges:t}},Ut=e=>{if(!P(e))return null;let t={};for(let[r,n]of Object.entries(e)){if(!Ce(r))return null;let o=Yt(n);if(o===null)return null;t[r]=o}return t},vt=(e,t)=>{if(!(P(e)&&Me(e.wordsDigest)&&Array.isArray(e.reports)&&Array.isArray(e.deferred)))return null;let r=new Set(t.requestedIds),n=new Set,o=2**t.setCount-1,a=[];for(let s of e.reports){if(!P(s))return null;let{reportHubId:i,matchedSets:c}=s;if(!(typeof i=="number"&&f(i)&&r.has(i))||n.has(i)||(n.add(i),t.expectsMatchedSets?!(typeof c=="number"&&Number.isInteger(c)&&c>=0&&c<=o):c!==null))return null;let R=Ut(s.fields);if(R===null)return null;a.push({reportHubId:i,matchedSets:c,fields:R})}if(a.length===0&&e.deferred.length>0)return null;let u=[];for(let s of e.deferred){if(!(typeof s=="number"&&f(s)&&r.has(s))||n.has(s))return null;n.add(s),u.push(s)}return{wordsDigest:e.wordsDigest,reports:a,deferred:u}};var Wt="Internal",Bt=e=>e.trim().toLowerCase();export{y as DAILY_REPORT_ACTION_FIELDS,rt as DAILY_REPORT_ACTION_INTENTS,xt as DAILY_REPORT_API_ENDPOINTS,_t as DAILY_REPORT_API_QUERY_PARAMS,Ae as DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS,_ as DAILY_REPORT_CLIENT_TEMP_ID_PATTERN,Wt as DAILY_REPORT_INTERNAL_SOURCE_TYPE,Lt as DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT,Ot as DAILY_REPORT_SEARCH_COMBINES,ze as DAILY_REPORT_SSE_CURSOR_PARAM,Fe as DAILY_REPORT_SSE_HEARTBEAT_MS,Be as DAILY_REPORT_SSE_TERMINAL_EVENTS,Et as buildDailyReportAttachmentUrl,N as dailyReportDetailSchema,tt as dailyReportSseMessageSchema,nt as encodeDailyReportActionCommand,Bt as foldDailyReportSourceTypeToken,gt as forEachIdsStreamRow,V as isDailyReportAttachmentThumbnailVariant,ut as normalizeBusinessDateKey,st as parseDailyReportActionResult,Ct as parseDailyReportAttachmentQuery,vt as readDailyReportSearchMarksAnswer,It as readIdsStreamChunkLine};
@@ -0,0 +1,70 @@
1
+ import * as react from "react";
2
+ import { VirtualScrollHandle } from "@aiquants/virtualscroll";
3
+ import { D as DailyReportItem } from "./types-BP1kIGMo.mjs";
4
+ type DailyReportRows = Pick<ReadonlyArray<DailyReportItem>, "length" | "at"> & Iterable<DailyReportItem>;
5
+ type ListNavigationHandle = Pick<VirtualScrollHandle, "getViewportSize" | "getScrollPosition" | "getScrollAnchor">;
6
+ type ListScrollToIndexOptions = NonNullable<Parameters<VirtualScrollHandle["scrollToIndex"]>[1]>;
7
+ type RowBoxSizing = "fixed" | "measured";
8
+ type RowUnitChange = "body" | "box" | "marks";
9
+ type RowPassUnitKind = {
10
+ readonly sizing: RowBoxSizing;
11
+ readonly change: RowUnitChange;
12
+ };
13
+ type RowPassUnitFrameEvent = {
14
+ readonly type: "unit-frame";
15
+ readonly frameTime: number;
16
+ readonly units: number;
17
+ readonly kind: RowPassUnitKind | null;
18
+ readonly cost: number | null;
19
+ readonly p50: number | null;
20
+ readonly p90: number | null;
21
+ readonly budget: number;
22
+ readonly rows: readonly number[];
23
+ };
24
+ type RowPassEvent = {
25
+ readonly type: "sync-release";
26
+ } | {
27
+ readonly type: "deferred-visible";
28
+ } | {
29
+ readonly type: "oversize-frame";
30
+ } | {
31
+ readonly type: "late-frame";
32
+ readonly frameTime: number;
33
+ } | {
34
+ readonly type: "late-forced-frame";
35
+ readonly frameTime: number;
36
+ } | RowPassUnitFrameEvent | {
37
+ readonly type: "hold-start";
38
+ readonly interval: number | null;
39
+ readonly listening: boolean;
40
+ } | {
41
+ readonly type: "key-frame";
42
+ readonly frameTime: number;
43
+ readonly busy: number;
44
+ readonly stepP50: number | null;
45
+ readonly samples: number;
46
+ readonly interval: number | null;
47
+ readonly limit: number | null;
48
+ } | {
49
+ readonly type: "hold-end";
50
+ readonly interval: number | null;
51
+ readonly stepP50: number | null;
52
+ readonly samples: number;
53
+ };
54
+ type ViewTestReadHandle = ListNavigationHandle & Pick<VirtualScrollHandle, "getRange" | "getFenwickSize">;
55
+ type InstrumentedView = {
56
+ readonly hostTestId: string;
57
+ readonly readHandle: () => ViewTestReadHandle | null;
58
+ readonly readItems: () => DailyReportRows;
59
+ readonly reveal: (index: number, options: ListScrollToIndexOptions) => void;
60
+ };
61
+ type ViewInstrumentation = {
62
+ readonly observeRowPass: (event: RowPassEvent) => void;
63
+ readonly observeReEstimate: (inMotion: boolean) => void;
64
+ readonly attach: (container: HTMLElement) => () => void;
65
+ };
66
+ type DailyReportInstrumentation = {
67
+ readonly instrumentView: (view: InstrumentedView) => ViewInstrumentation;
68
+ };
69
+ declare const DailyReportInstrumentationContext: react.Context<DailyReportInstrumentation | null>;
70
+ export { type DailyReportRows as D, type InstrumentedView as I, type ListNavigationHandle as L, type RowBoxSizing as R, type ViewInstrumentation as V, type DailyReportInstrumentation as a, DailyReportInstrumentationContext as b, type ListScrollToIndexOptions as c, type RowUnitChange as d, type ViewTestReadHandle as e, type RowPassEvent as f, type RowPassUnitFrameEvent as g, type RowPassUnitKind as h };
@@ -0,0 +1,70 @@
1
+ import * as react from "react";
2
+ import { VirtualScrollHandle } from "@aiquants/virtualscroll";
3
+ import { D as DailyReportItem } from "./types-BP1kIGMo.js";
4
+ type DailyReportRows = Pick<ReadonlyArray<DailyReportItem>, "length" | "at"> & Iterable<DailyReportItem>;
5
+ type ListNavigationHandle = Pick<VirtualScrollHandle, "getViewportSize" | "getScrollPosition" | "getScrollAnchor">;
6
+ type ListScrollToIndexOptions = NonNullable<Parameters<VirtualScrollHandle["scrollToIndex"]>[1]>;
7
+ type RowBoxSizing = "fixed" | "measured";
8
+ type RowUnitChange = "body" | "box" | "marks";
9
+ type RowPassUnitKind = {
10
+ readonly sizing: RowBoxSizing;
11
+ readonly change: RowUnitChange;
12
+ };
13
+ type RowPassUnitFrameEvent = {
14
+ readonly type: "unit-frame";
15
+ readonly frameTime: number;
16
+ readonly units: number;
17
+ readonly kind: RowPassUnitKind | null;
18
+ readonly cost: number | null;
19
+ readonly p50: number | null;
20
+ readonly p90: number | null;
21
+ readonly budget: number;
22
+ readonly rows: readonly number[];
23
+ };
24
+ type RowPassEvent = {
25
+ readonly type: "sync-release";
26
+ } | {
27
+ readonly type: "deferred-visible";
28
+ } | {
29
+ readonly type: "oversize-frame";
30
+ } | {
31
+ readonly type: "late-frame";
32
+ readonly frameTime: number;
33
+ } | {
34
+ readonly type: "late-forced-frame";
35
+ readonly frameTime: number;
36
+ } | RowPassUnitFrameEvent | {
37
+ readonly type: "hold-start";
38
+ readonly interval: number | null;
39
+ readonly listening: boolean;
40
+ } | {
41
+ readonly type: "key-frame";
42
+ readonly frameTime: number;
43
+ readonly busy: number;
44
+ readonly stepP50: number | null;
45
+ readonly samples: number;
46
+ readonly interval: number | null;
47
+ readonly limit: number | null;
48
+ } | {
49
+ readonly type: "hold-end";
50
+ readonly interval: number | null;
51
+ readonly stepP50: number | null;
52
+ readonly samples: number;
53
+ };
54
+ type ViewTestReadHandle = ListNavigationHandle & Pick<VirtualScrollHandle, "getRange" | "getFenwickSize">;
55
+ type InstrumentedView = {
56
+ readonly hostTestId: string;
57
+ readonly readHandle: () => ViewTestReadHandle | null;
58
+ readonly readItems: () => DailyReportRows;
59
+ readonly reveal: (index: number, options: ListScrollToIndexOptions) => void;
60
+ };
61
+ type ViewInstrumentation = {
62
+ readonly observeRowPass: (event: RowPassEvent) => void;
63
+ readonly observeReEstimate: (inMotion: boolean) => void;
64
+ readonly attach: (container: HTMLElement) => () => void;
65
+ };
66
+ type DailyReportInstrumentation = {
67
+ readonly instrumentView: (view: InstrumentedView) => ViewInstrumentation;
68
+ };
69
+ declare const DailyReportInstrumentationContext: react.Context<DailyReportInstrumentation | null>;
70
+ export { type DailyReportRows as D, type InstrumentedView as I, type ListNavigationHandle as L, type RowBoxSizing as R, type ViewInstrumentation as V, type DailyReportInstrumentation as a, DailyReportInstrumentationContext as b, type ListScrollToIndexOptions as c, type RowUnitChange as d, type ViewTestReadHandle as e, type RowPassEvent as f, type RowPassUnitFrameEvent as g, type RowPassUnitKind as h };
@@ -1,3 +1,4 @@
1
+ import { b as DailyReportDetail } from "./types-BP1kIGMo.mjs";
1
2
  declare const DAILY_REPORT_SEARCH_COMBINES: readonly [
2
3
  "intersection",
3
4
  "union"
@@ -20,6 +21,20 @@ interface DailyReportLogger {
20
21
  warn(message?: unknown, ...optionalParams: unknown[]): void;
21
22
  error(message?: unknown, ...optionalParams: unknown[]): void;
22
23
  }
24
+ type DailyReportSearchDetailOutcome = {
25
+ readonly reportHubId: number;
26
+ readonly outcome: "ok";
27
+ readonly report: DailyReportDetail;
28
+ } | {
29
+ readonly reportHubId: number;
30
+ readonly outcome: "not_found";
31
+ } | {
32
+ readonly reportHubId: number;
33
+ readonly outcome: "failed";
34
+ };
35
+ type DailyReportSearchDetailsAnswer = {
36
+ readonly outcomes: readonly DailyReportSearchDetailOutcome[];
37
+ };
23
38
  type DailyReportSearchFieldMarks = {
24
39
  readonly fingerprint: number;
25
40
  readonly ranges: readonly number[];
@@ -43,4 +58,4 @@ type DailyReportSearchMarksExpectation = {
43
58
  readonly expectsMatchedSets: boolean;
44
59
  };
45
60
  declare const readDailyReportSearchMarksAnswer: (payload: unknown, expected: DailyReportSearchMarksExpectation) => DailyReportSearchMarksAnswer | null;
46
- export { DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT as D, DAILY_REPORT_SEARCH_COMBINES as a, type DailyReportLogger as b, type DailyReportSearchCombine as c, type DailyReportSearchFieldMarks as d, type DailyReportSearchHit as e, type DailyReportSearchMarksAnswer as f, type DailyReportSearchMarksExpectation as g, type DailyReportSearchReportMarks as h, type DailyReportSearchAlternative as i, type DailyReportSearchAlternativeTier as j, readDailyReportSearchMarksAnswer as r };
61
+ export { DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT as D, DAILY_REPORT_SEARCH_COMBINES as a, type DailyReportLogger as b, type DailyReportSearchCombine as c, type DailyReportSearchDetailOutcome as d, type DailyReportSearchDetailsAnswer as e, type DailyReportSearchFieldMarks as f, type DailyReportSearchHit as g, type DailyReportSearchMarksAnswer as h, type DailyReportSearchMarksExpectation as i, type DailyReportSearchReportMarks as j, type DailyReportSearchAlternative as k, type DailyReportSearchAlternativeTier as l, readDailyReportSearchMarksAnswer as r };
@@ -1,3 +1,4 @@
1
+ import { b as DailyReportDetail } from "./types-BP1kIGMo.js";
1
2
  declare const DAILY_REPORT_SEARCH_COMBINES: readonly [
2
3
  "intersection",
3
4
  "union"
@@ -20,6 +21,20 @@ interface DailyReportLogger {
20
21
  warn(message?: unknown, ...optionalParams: unknown[]): void;
21
22
  error(message?: unknown, ...optionalParams: unknown[]): void;
22
23
  }
24
+ type DailyReportSearchDetailOutcome = {
25
+ readonly reportHubId: number;
26
+ readonly outcome: "ok";
27
+ readonly report: DailyReportDetail;
28
+ } | {
29
+ readonly reportHubId: number;
30
+ readonly outcome: "not_found";
31
+ } | {
32
+ readonly reportHubId: number;
33
+ readonly outcome: "failed";
34
+ };
35
+ type DailyReportSearchDetailsAnswer = {
36
+ readonly outcomes: readonly DailyReportSearchDetailOutcome[];
37
+ };
23
38
  type DailyReportSearchFieldMarks = {
24
39
  readonly fingerprint: number;
25
40
  readonly ranges: readonly number[];
@@ -43,4 +58,4 @@ type DailyReportSearchMarksExpectation = {
43
58
  readonly expectsMatchedSets: boolean;
44
59
  };
45
60
  declare const readDailyReportSearchMarksAnswer: (payload: unknown, expected: DailyReportSearchMarksExpectation) => DailyReportSearchMarksAnswer | null;
46
- export { DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT as D, DAILY_REPORT_SEARCH_COMBINES as a, type DailyReportLogger as b, type DailyReportSearchCombine as c, type DailyReportSearchFieldMarks as d, type DailyReportSearchHit as e, type DailyReportSearchMarksAnswer as f, type DailyReportSearchMarksExpectation as g, type DailyReportSearchReportMarks as h, type DailyReportSearchAlternative as i, type DailyReportSearchAlternativeTier as j, readDailyReportSearchMarksAnswer as r };
61
+ export { DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT as D, DAILY_REPORT_SEARCH_COMBINES as a, type DailyReportLogger as b, type DailyReportSearchCombine as c, type DailyReportSearchDetailOutcome as d, type DailyReportSearchDetailsAnswer as e, type DailyReportSearchFieldMarks as f, type DailyReportSearchHit as g, type DailyReportSearchMarksAnswer as h, type DailyReportSearchMarksExpectation as i, type DailyReportSearchReportMarks as j, type DailyReportSearchAlternative as k, type DailyReportSearchAlternativeTier as l, readDailyReportSearchMarksAnswer as r };
package/dist/server.d.mts CHANGED
@@ -1,9 +1,10 @@
1
- import { x as DailyReportSseStreamMessage, q as DailyReportInterviewer, k as DailyReportExternalComment, D as DailyReportItem, e as DailyReportDetail, j as DailyReportAttachmentSummary, s as DailyReportPostedComment } from "./sse-schema-Br0b278w.mjs";
2
- export { y as dailyReportSseStreamMessageSchema, z as encodeIdsStreamRows } from "./sse-schema-Br0b278w.mjs";
1
+ import { n as DailyReportSseStreamMessage } from "./sse-schema-sKBorzg9.mjs";
2
+ export { o as dailyReportSseStreamMessageSchema, p as encodeIdsStreamRows } from "./sse-schema-sKBorzg9.mjs";
3
3
  import * as drizzle_orm_mssql_core from "drizzle-orm/mssql-core";
4
4
  import { AnyMsSqlColumn } from "drizzle-orm/mssql-core";
5
- import { b as DailyReportLogger, c as DailyReportSearchCombine, i as DailyReportSearchAlternative, e as DailyReportSearchHit, f as DailyReportSearchMarksAnswer } from "./search-marks-wire-BSS2d1t6.mjs";
6
- export { j as DailyReportSearchAlternativeTier } from "./search-marks-wire-BSS2d1t6.mjs";
5
+ import { b as DailyReportLogger, c as DailyReportSearchCombine, k as DailyReportSearchAlternative, d as DailyReportSearchDetailOutcome, g as DailyReportSearchHit, h as DailyReportSearchMarksAnswer } from "./search-marks-wire-BiImBos8.mjs";
6
+ export { l as DailyReportSearchAlternativeTier } from "./search-marks-wire-BiImBos8.mjs";
7
+ import { f as DailyReportInterviewer, e as DailyReportExternalComment, D as DailyReportItem, b as DailyReportDetail, d as DailyReportAttachmentSummary, h as DailyReportPostedComment } from "./types-BP1kIGMo.mjs";
7
8
  import { TransactionRetryOptions } from "@aiquants/mssql";
8
9
  import { b as DailyReportSearchFacets } from "./search-filters-wire-5MWi6GWu.mjs";
9
10
  import { SQL } from "drizzle-orm";
@@ -22,6 +23,7 @@ type DailyReportRedisClient = {
22
23
  xRevRange(key: string, start: string, end: string, options?: {
23
24
  COUNT?: number;
24
25
  }): Promise<RedisStreamMessage[]>;
26
+ xInfoStream(key: string): Promise<Readonly<Record<string, unknown>>>;
25
27
  };
26
28
  type DailyReportRedisBlockingClient = {
27
29
  isOpen: boolean;
@@ -1893,7 +1895,9 @@ declare function createDailyReportService(config: DailyReportServiceConfig): {
1893
1895
  getDailyReportsByBusinessDateByExternalId: (scope: DailyReportViewerScope, businessDate: string, externalId: string, { forceRefresh, snapshot, ttlMsOverride, admission }?: SqlResultCacheQueryOptions) => Promise<DailyReportDetail[]>;
1894
1896
  getDailyReportDetailById: (scope: DailyReportViewerScope, reportHubId: number, userId: number, { forceRefresh, snapshot, ttlMsOverride, admission }?: SqlResultCacheQueryOptions) => Promise<DailyReportDetail | null>;
1895
1897
  getDailyReportDetailByIdByExternalId: (scope: DailyReportViewerScope, reportHubId: number, externalId: string, options?: SqlResultCacheQueryOptions) => Promise<DailyReportDetail | null>;
1896
- getDailyReportDetailsByIdsByExternalId: (scope: DailyReportViewerScope, reportHubIds: readonly number[], externalId: string) => Promise<DailyReportDetail[]>;
1898
+ getDailyReportDetailsByIdsByExternalId: (scope: DailyReportViewerScope, reportHubIds: readonly number[], externalId: string, options: {
1899
+ readonly signal: AbortSignal;
1900
+ }) => Promise<DailyReportSearchDetailOutcome[]>;
1897
1901
  getDraftLabelId: () => Promise<number | null>;
1898
1902
  searchDailyReports: (scope: DailyReportViewerScope, userId: number, criteria: DailyReportSearchCriteria) => Promise<DailyReportSearchHit[]>;
1899
1903
  markDailyReportSearchHits: (scope: DailyReportViewerScope, userId: number, plan: DailyReportSearchPlan, reportHubIds: readonly number[], options: {
package/dist/server.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { x as DailyReportSseStreamMessage, q as DailyReportInterviewer, k as DailyReportExternalComment, D as DailyReportItem, e as DailyReportDetail, j as DailyReportAttachmentSummary, s as DailyReportPostedComment } from "./sse-schema-Br0b278w.js";
2
- export { y as dailyReportSseStreamMessageSchema, z as encodeIdsStreamRows } from "./sse-schema-Br0b278w.js";
1
+ import { n as DailyReportSseStreamMessage } from "./sse-schema-BcjRPJjN.js";
2
+ export { o as dailyReportSseStreamMessageSchema, p as encodeIdsStreamRows } from "./sse-schema-BcjRPJjN.js";
3
3
  import * as drizzle_orm_mssql_core from "drizzle-orm/mssql-core";
4
4
  import { AnyMsSqlColumn } from "drizzle-orm/mssql-core";
5
- import { b as DailyReportLogger, c as DailyReportSearchCombine, i as DailyReportSearchAlternative, e as DailyReportSearchHit, f as DailyReportSearchMarksAnswer } from "./search-marks-wire-BSS2d1t6.js";
6
- export { j as DailyReportSearchAlternativeTier } from "./search-marks-wire-BSS2d1t6.js";
5
+ import { b as DailyReportLogger, c as DailyReportSearchCombine, k as DailyReportSearchAlternative, d as DailyReportSearchDetailOutcome, g as DailyReportSearchHit, h as DailyReportSearchMarksAnswer } from "./search-marks-wire-C_vjmxwf.js";
6
+ export { l as DailyReportSearchAlternativeTier } from "./search-marks-wire-C_vjmxwf.js";
7
+ import { f as DailyReportInterviewer, e as DailyReportExternalComment, D as DailyReportItem, b as DailyReportDetail, d as DailyReportAttachmentSummary, h as DailyReportPostedComment } from "./types-BP1kIGMo.js";
7
8
  import { TransactionRetryOptions } from "@aiquants/mssql";
8
9
  import { b as DailyReportSearchFacets } from "./search-filters-wire-5MWi6GWu.js";
9
10
  import { SQL } from "drizzle-orm";
@@ -22,6 +23,7 @@ type DailyReportRedisClient = {
22
23
  xRevRange(key: string, start: string, end: string, options?: {
23
24
  COUNT?: number;
24
25
  }): Promise<RedisStreamMessage[]>;
26
+ xInfoStream(key: string): Promise<Readonly<Record<string, unknown>>>;
25
27
  };
26
28
  type DailyReportRedisBlockingClient = {
27
29
  isOpen: boolean;
@@ -1893,7 +1895,9 @@ declare function createDailyReportService(config: DailyReportServiceConfig): {
1893
1895
  getDailyReportsByBusinessDateByExternalId: (scope: DailyReportViewerScope, businessDate: string, externalId: string, { forceRefresh, snapshot, ttlMsOverride, admission }?: SqlResultCacheQueryOptions) => Promise<DailyReportDetail[]>;
1894
1896
  getDailyReportDetailById: (scope: DailyReportViewerScope, reportHubId: number, userId: number, { forceRefresh, snapshot, ttlMsOverride, admission }?: SqlResultCacheQueryOptions) => Promise<DailyReportDetail | null>;
1895
1897
  getDailyReportDetailByIdByExternalId: (scope: DailyReportViewerScope, reportHubId: number, externalId: string, options?: SqlResultCacheQueryOptions) => Promise<DailyReportDetail | null>;
1896
- getDailyReportDetailsByIdsByExternalId: (scope: DailyReportViewerScope, reportHubIds: readonly number[], externalId: string) => Promise<DailyReportDetail[]>;
1898
+ getDailyReportDetailsByIdsByExternalId: (scope: DailyReportViewerScope, reportHubIds: readonly number[], externalId: string, options: {
1899
+ readonly signal: AbortSignal;
1900
+ }) => Promise<DailyReportSearchDetailOutcome[]>;
1897
1901
  getDraftLabelId: () => Promise<number | null>;
1898
1902
  searchDailyReports: (scope: DailyReportViewerScope, userId: number, criteria: DailyReportSearchCriteria) => Promise<DailyReportSearchHit[]>;
1899
1903
  markDailyReportSearchHits: (scope: DailyReportViewerScope, userId: number, plan: DailyReportSearchPlan, reportHubIds: readonly number[], options: {