@aiquants/daily-report 0.40.0 → 0.41.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 +140 -0
- package/README.md +3146 -1101
- package/dist/client.d.mts +59 -132
- package/dist/client.d.ts +59 -132
- package/dist/client.js +6 -6
- package/dist/client.mjs +6 -6
- package/dist/{comment-adapter-CNti3-Dv.d.ts → comment-adapter-BTXFkMSz.d.ts} +2 -3
- package/dist/{comment-adapter-BbGh4nc0.d.mts → comment-adapter-wejvIziS.d.mts} +2 -3
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{search-marks-wire-DLgJTytk.d.mts → search-marks-wire-BSS2d1t6.d.mts} +7 -1
- package/dist/{search-marks-wire-DLgJTytk.d.ts → search-marks-wire-BSS2d1t6.d.ts} +7 -1
- package/dist/server.d.mts +11 -40
- package/dist/server.d.ts +11 -40
- package/dist/server.js +10 -10
- package/dist/server.mjs +10 -10
- package/dist/sse-schema-CUiQKk8K.d.mts +286 -0
- package/dist/sse-schema-CUiQKk8K.d.ts +286 -0
- package/dist/styles/daily-report.standalone.css +1 -1
- package/package.json +9 -9
- package/dist/sse-schema-S7gXWA2N.d.mts +0 -2617
- package/dist/sse-schema-S7gXWA2N.d.ts +0 -2617
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as DailyReportDetail,
|
|
1
|
+
import { e as DailyReportDetail, s as DailyReportPostedComment } from "./sse-schema-CUiQKk8K.js";
|
|
2
2
|
declare const DAILY_REPORT_ACTION_INTENTS: readonly [
|
|
3
3
|
"create",
|
|
4
4
|
"update",
|
|
@@ -149,5 +149,4 @@ type UIComment = {
|
|
|
149
149
|
isLegacy: boolean;
|
|
150
150
|
isAuthorUnknown: boolean;
|
|
151
151
|
};
|
|
152
|
-
|
|
153
|
-
export { type ActionCommand as A, type DailyReportActionIntent as D, type UIComment as U, DAILY_REPORT_ACTION_FIELDS as a, DAILY_REPORT_ACTION_INTENTS as b, type ActionFailure as c, type ActionResult as d, type ActionResultOf as e, type ActionResultReading as f, encodeActionCommand as g, mergeComments as m, parseActionResult as p };
|
|
152
|
+
export { type ActionCommand as A, type DailyReportActionIntent as D, type UIComment as U, DAILY_REPORT_ACTION_FIELDS as a, DAILY_REPORT_ACTION_INTENTS as b, type ActionFailure as c, type ActionResult as d, type ActionResultOf as e, type ActionResultReading as f, encodeActionCommand as g, parseActionResult as p };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as DailyReportDetail,
|
|
1
|
+
import { e as DailyReportDetail, s as DailyReportPostedComment } from "./sse-schema-CUiQKk8K.mjs";
|
|
2
2
|
declare const DAILY_REPORT_ACTION_INTENTS: readonly [
|
|
3
3
|
"create",
|
|
4
4
|
"update",
|
|
@@ -149,5 +149,4 @@ type UIComment = {
|
|
|
149
149
|
isLegacy: boolean;
|
|
150
150
|
isAuthorUnknown: boolean;
|
|
151
151
|
};
|
|
152
|
-
|
|
153
|
-
export { type ActionCommand as A, type DailyReportActionIntent as D, type UIComment as U, DAILY_REPORT_ACTION_FIELDS as a, DAILY_REPORT_ACTION_INTENTS as b, type ActionFailure as c, type ActionResult as d, type ActionResultOf as e, type ActionResultReading as f, encodeActionCommand as g, mergeComments as m, parseActionResult as p };
|
|
152
|
+
export { type ActionCommand as A, type DailyReportActionIntent as D, type UIComment as U, DAILY_REPORT_ACTION_FIELDS as a, DAILY_REPORT_ACTION_INTENTS as b, type ActionFailure as c, type ActionResult as d, type ActionResultOf as e, type ActionResultReading as f, encodeActionCommand as g, parseActionResult as p };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { a as DAILY_REPORT_ACTION_FIELDS, b as DAILY_REPORT_ACTION_INTENTS, A as DailyReportActionCommand, c as DailyReportActionFailure, D as DailyReportActionIntent, d as DailyReportActionResult, e as DailyReportActionResultOf, f as DailyReportActionResultReading, U as DailyReportUIComment, g as encodeDailyReportActionCommand,
|
|
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
|
|
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 DailyReportSearchReportMarks } from "./search-marks-wire-
|
|
4
|
-
import "zod";
|
|
1
|
+
export { a as DAILY_REPORT_ACTION_FIELDS, b as DAILY_REPORT_ACTION_INTENTS, A as DailyReportActionCommand, c as DailyReportActionFailure, D as DailyReportActionIntent, d as DailyReportActionResult, e as DailyReportActionResultOf, f as DailyReportActionResultReading, U as DailyReportUIComment, g as encodeDailyReportActionCommand, p as parseDailyReportActionResult } from "./comment-adapter-wejvIziS.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-CUiQKk8K.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";
|
|
4
|
+
import "zod/v3";
|
|
5
5
|
declare const DAILY_REPORT_API_ENDPOINTS: Readonly<{
|
|
6
6
|
readonly businessDate: "business-date";
|
|
7
7
|
readonly idsStream: "ids-columns";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { a as DAILY_REPORT_ACTION_FIELDS, b as DAILY_REPORT_ACTION_INTENTS, A as DailyReportActionCommand, c as DailyReportActionFailure, D as DailyReportActionIntent, d as DailyReportActionResult, e as DailyReportActionResultOf, f as DailyReportActionResultReading, U as DailyReportUIComment, g as encodeDailyReportActionCommand,
|
|
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
|
|
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 DailyReportSearchReportMarks } from "./search-marks-wire-
|
|
4
|
-
import "zod";
|
|
1
|
+
export { a as DAILY_REPORT_ACTION_FIELDS, b as DAILY_REPORT_ACTION_INTENTS, A as DailyReportActionCommand, c as DailyReportActionFailure, D as DailyReportActionIntent, d as DailyReportActionResult, e as DailyReportActionResultOf, f as DailyReportActionResultReading, U as DailyReportUIComment, g as encodeDailyReportActionCommand, p as parseDailyReportActionResult } from "./comment-adapter-BTXFkMSz.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-CUiQKk8K.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";
|
|
4
|
+
import "zod/v3";
|
|
5
5
|
declare const DAILY_REPORT_API_ENDPOINTS: Readonly<{
|
|
6
6
|
readonly businessDate: "business-date";
|
|
7
7
|
readonly idsStream: "ids-columns";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var Ie=Object.prototype.hasOwnProperty;var fe=(e,t)=>{for(var n in t)_(e,n,{get:t[n],enumerable:!0})},De=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of be(t))!Ie.call(e,i)&&i!==n&&_(e,i,{get:()=>t[i],enumerable:!(o=ge(t,i))||o.enumerable});return e};var Se=e=>De(_({},"__esModule",{value:!0}),e);var Be={};fe(Be,{DAILY_REPORT_ACTION_FIELDS:()=>d,DAILY_REPORT_ACTION_INTENTS:()=>G,DAILY_REPORT_API_ENDPOINTS:()=>se,DAILY_REPORT_API_QUERY_PARAMS:()=>ie,DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS:()=>B,DAILY_REPORT_CLIENT_TEMP_ID_PATTERN:()=>b,DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT:()=>he,DAILY_REPORT_SEARCH_COMBINES:()=>Re,DAILY_REPORT_SSE_CURSOR_PARAM:()=>K,DAILY_REPORT_SSE_HEARTBEAT_MS:()=>F,DAILY_REPORT_SSE_TERMINAL_EVENTS:()=>W,buildDailyReportAttachmentUrl:()=>de,commentAddMessageSchema:()=>L,commentDeleteMessageSchema:()=>O,connectedMessageSchema:()=>N,dailyReportDetailSchema:()=>R,dailyReportExternalCommentSchema:()=>E,dailyReportInterviewerSchema:()=>C,dailyReportLabelDefSchema:()=>w,dailyReportPostedCommentSchema:()=>I,dailyReportSseMessageSchema:()=>Q,encodeDailyReportActionCommand:()=>X,forEachIdsStreamRow:()=>ae,isDailyReportAttachmentThumbnailVariant:()=>x,isDailyReportSseStreamId:()=>V,isIdsStreamChunkLine:()=>oe,mergeComments:()=>ye,normalizeBusinessDateKey:()=>re,parseDailyReportActionResult:()=>Z,parseDailyReportAttachmentQuery:()=>ce,reportCreateMessageSchema:()=>M,reportDeleteMessageSchema:()=>j,reportPublishMessageSchema:()=>Y,reportUpdateMessageSchema:()=>H,statusUpdateMessageSchema:()=>P});module.exports=Se(Be);var a=require("zod");var b=/^(?:[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 v=require("zod"),z=e=>Number.isSafeInteger(e)&&e>0,l=v.z.number().int().positive().max(Number.MAX_SAFE_INTEGER);var r=require("zod");var W=["auth-required","forbidden","resync-required"],F=15e3,K="lastEventId",Ae=/^\d{1,15}-\d{1,15}$/,V=e=>Ae.test(e),C=r.z.object({name:r.z.string().nullish(),affiliation:r.z.string().nullish()}),E=r.z.object({name:r.z.string().nullish(),text:r.z.string().nullish(),color:r.z.string().nullish()}),w=r.z.object({id:l,name:r.z.string().nullish(),color:r.z.string().nullish()}),I=r.z.object({id:l,userId:r.z.string().nullish(),userName:r.z.string().nullish(),content:r.z.string().nullish(),createdAt:r.z.string().nullish(),isMine:r.z.boolean()}),Te=r.z.object({id:r.z.string(),fileName:r.z.string(),fileType:r.z.string().nullable(),fileSize:r.z.number().nullable(),createdAt:r.z.string().nullable(),state:r.z.enum(["present","absent","unknown"]),hasThumbnail:r.z.boolean().default(!1)}),R=r.z.object({reportHubId:l,date:r.z.string().nullish(),createdAt:r.z.string().nullish(),author:r.z.string().nullish(),userId:r.z.string().nullish(),sourceType:r.z.string().nullish(),employeeName:r.z.string().nullish(),updatedBy:r.z.string().nullish(),updatedAt:r.z.string().nullish(),category:r.z.string().nullish(),creationCategory:r.z.string().nullish(),visitTimeFrom:r.z.string().nullish(),visitTimeTo:r.z.string().nullish(),customerName:r.z.string().nullish(),interviewers:r.z.array(C),subject:r.z.string().nullish(),content:r.z.string().nullish(),externalComments:r.z.array(E),isRead:r.z.boolean(),isStarred:r.z.boolean(),isDraft:r.z.boolean(),labels:r.z.array(w),postedComments:r.z.array(I),attachments:r.z.array(Te).default([])}),h=r.z.string().regex(b),N=r.z.object({type:r.z.literal("connected")}),P=r.z.object({type:r.z.literal("status-update"),reportHubId:l,statusType:r.z.enum(["star","read"]),value:r.z.boolean(),clientTempId:h,recipientRawUserId:l.optional()}),k=r.z.string().optional(),L=r.z.object({type:r.z.literal("comment-add"),reportHubId:l,comment:I,clientTempId:h,recipientRawUserId:l.optional(),sourceType:k}),O=r.z.object({type:r.z.literal("comment-delete"),reportHubId:l,commentId:l,clientTempId:h,recipientRawUserId:l.optional(),sourceType:k}),M=r.z.object({type:r.z.literal("report-create"),reportHubId:l,report:R,clientTempId:h,recipientRawUserId:l.optional()}),H=r.z.object({type:r.z.literal("report-update"),reportHubId:l,report:R,clientTempId:h,recipientRawUserId:l.optional()}),Y=r.z.object({type:r.z.literal("report-publish"),reportHubId:l,report:R,clientTempId:h,recipientRawUserId:l.optional()}),j=r.z.object({type:r.z.literal("report-delete"),reportHubId:l,clientTempId:h,sourceType:k}),Q=r.z.discriminatedUnion("type",[N,P,L,O,M,H,Y,j]);var q=e=>e.issues.map(t=>`${t.path.length===0?"(root)":t.path.join(".")}: ${t.code}`).join("; ");var G=Object.freeze(["create","update","publish","delete","toggleStar","toggleRead","addComment","deleteComment","clearCache"]);var d=Object.freeze({intent:"intent",clientTempId:"clientTempId",businessDate:"businessDate",operationTimestamp:"operationTimestamp",reportHubId:"reportHubId",title:"title",content:"content",isStarred:"isStarred",isRead:"isRead",commentId:"commentId"}),X=e=>{let t=new FormData;if(t.append(d.intent,e.intent),e.intent==="clearCache"||(t.append(d.clientTempId,e.clientTempId),e.businessDate!==null&&t.append(d.businessDate,e.businessDate),e.operationTimestamp!==null&&t.append(d.operationTimestamp,String(e.operationTimestamp)),e.intent==="create"))return t;switch(t.append(d.reportHubId,String(e.reportHubId)),e.intent){case"update":return e.changes.title!==void 0&&t.append(d.title,e.changes.title),e.changes.content!==void 0&&t.append(d.content,e.changes.content),t;case"publish":case"delete":return t;case"toggleStar":return t.append(d.isStarred,String(e.value)),t;case"toggleRead":return t.append(d.isRead,String(e.value)),t;case"addComment":return t.append(d.content,e.content),t;case"deleteComment":return t.append(d.commentId,String(e.commentId)),t}},xe=()=>{let e=l,t=a.z.string().regex(b),n=a.z.literal("OK"),o=a.z.object({isStarred:a.z.boolean(),isRead:a.z.boolean()}),i=a.z.number().int().nonnegative().nullable();return{create:a.z.object({status:n,intent:a.z.literal("create"),reportHubId:e,clientTempId:t,report:R}),update:a.z.object({status:n,intent:a.z.literal("update"),reportHubId:e,clientTempId:t}),publish:a.z.object({status:n,intent:a.z.literal("publish"),reportHubId:e,clientTempId:t,report:R.nullable()}),delete:a.z.object({status:n,intent:a.z.literal("delete"),reportHubId:e,clientTempId:t}),toggleStar:a.z.object({status:n,intent:a.z.literal("toggleStar"),reportHubId:e,clientTempId:t,updatedStatus:o,operationTimestamp:i}),toggleRead:a.z.object({status:n,intent:a.z.literal("toggleRead"),reportHubId:e,clientTempId:t,updatedStatus:o,operationTimestamp:i}),addComment:a.z.object({status:n,intent:a.z.literal("addComment"),reportHubId:e,clientTempId:t,newComment:I}),deleteComment:a.z.object({status:n,intent:a.z.literal("deleteComment"),reportHubId:e,clientTempId:t,deletedCommentId:l}),clearCache:a.z.object({status:n,intent:a.z.literal("clearCache")})}},U=null,_e=()=>(U===null&&(U=xe()),U),Z=(e,t)=>{let n=_e()[e].safeParse(t);return n.success?{result:n.data}:{mismatch:q(n.error)}};var Ce=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var J=e=>e<10?`0${e}`:`${e}`,Ee=e=>{if(Number.isNaN(e.getTime()))return null;let t=e.getFullYear(),n=J(e.getMonth()+1),o=J(e.getDate());return`${t}-${n}-${o}`},ee=e=>{let t=Ce.exec(e);if(t===null)return null;let[,n,,o,i]=t,p=Number(n),s=Number(o),u=Number(i);if(p<1)return null;let c=new Date(0);return c.setUTCFullYear(p,s-1,u),c.getUTCFullYear()!==p||c.getUTCMonth()!==s-1||c.getUTCDate()!==u?null:`${n}-${o}-${i}`},te=e=>ee(e)===e;var re=e=>e==null?null:e instanceof Date?Ee(e):ee(e);var ne="ids-columns",we=e=>{if(typeof e!="object"||e===null)return"unknown";let{kind:t}=e;return t==="chunk"?"chunk":t==="error"?"error":"unknown"},Ne=e=>typeof e=="number"&&z(e),Pe=e=>{if(typeof e!="object"||e===null)return!1;let{businessDate:t,reportHubId:n}=e;return(t===null||typeof t=="string")&&typeof n=="number"},ke=4,Le=e=>{let t=ke;for(;2**t<e*2;)t+=1;let n=new Float64Array(2**t),o=n.length-1,i=32-t;return p=>{let s=Math.imul(p|0,2654435761)>>>i;for(;;){let u=n[s];if(u===0)return n[s]=p,!0;if(u===p)return!1;s=s+1&o}}},oe=e=>{if(we(e)!=="chunk")return!1;let{ids:t,dates:n,counts:o,sourceTypes:i,sources:p,isLast:s,nextCursor:u}=e;if(typeof s!="boolean"||!(u===null||Pe(u))||!(Array.isArray(t)&&Array.isArray(n)&&Array.isArray(o)&&Array.isArray(i)&&Array.isArray(p))||n.length!==o.length||p.length!==t.length)return!1;for(let y of i)if(!(y===null||typeof y=="string"))return!1;let c=Le(t.length),m=0,D=null,f=0;for(let y=0;y<n.length;y++){let g=n[y],S=o[y];if(!(g===null||typeof g=="string"&&te(g))||y>0&&g===n[y-1]||typeof S!="number"||!Number.isSafeInteger(S)||S<1)return!1;let $=m+S;if($>t.length)return!1;for(;m<$;m++){let A=t[m],T=p[m];if(!(Ne(A)&&c(A))||typeof T!="number"||!Number.isSafeInteger(T)||T<0||T>=i.length||m>0&&!Me(D,f,g,A))return!1;D=g,f=A}}return m===t.length},ae=(e,t)=>{let{ids:n,dates:o,counts:i,sourceTypes:p,sources:s}=e,u=0;for(let c=0;c<o.length;c++){let m=o[c];for(let D=u+i[c];u<D;u++){let f=p[s[u]];t(n[u],m,f===null?void 0:f)}}};var Oe=(e,t,n,o)=>e!==n?e===null?1:n===null||e>n?-1:1:o-t,Me=(e,t,n,o)=>Oe(e,t,n,o)<0;var se=Object.freeze({businessDate:"business-date",idsStream:ne,report:"report",search:"search",reports:"reports",searchMarks:"search-marks",searchFacets:"search-facets",action:"action"}),ie=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 B=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),x=e=>Object.hasOwn(B,e);var le="download",ue="thumbnail",pe="1",de=(e,t,n)=>{let o=`${e}/attachment/${encodeURIComponent(t)}`;switch(n.kind){case"inline":return o;case"download":return`${o}?${new URLSearchParams({[le]:pe})}`;case"thumbnail":return`${o}?${new URLSearchParams({[ue]:n.variant})}`}},ce=e=>{let t=e.getAll(ue),n=e.getAll(le);if(t.length>0&&n.length>0)return{kind:"invalid",reason:"conflict"};if(t.length>0){let[o]=t;return t.length===1&&x(o)?{kind:"thumbnail",variant:o}:{kind:"invalid",reason:"thumbnail_variant"}}return n.length>0?n.length===1&&n[0]===pe?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var He=e=>typeof e=="string"?JSON.stringify(e):typeof e=="number"||typeof e=="boolean"||e===null||e===void 0?String(e):Array.isArray(e)?"array":typeof e,me=(e,t,n)=>new RangeError(`[daily-report] ${e} must be ${t}; got ${He(n)}`);var Ye="legacy-",je=e=>`${Ye}${e}`,ye=(e,t,n,o)=>{if(typeof o!="string"||o.trim()==="")throw me("mergeComments: unknownAuthorName","a non-blank string",o);let i=e.map((s,u)=>({id:je(u),authorName:s.name||o,content:s.text||"",isMine:!1,color:s.color||void 0,isLegacy:!0,isAuthorUnknown:!s.name})),p=t.map(s=>({id:s.id,authorName:s.userName||o,content:s.content??"",createdAt:s.createdAt??"",isMine:n?s.userId===n:s.isMine,isLegacy:!1,isAuthorUnknown:!s.userName}));return[...i,...p]};var Re=["intersection","union"];var dt=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100}),Ue=2,he=2,ct=Object.freeze({word:0,reading:1});var mt=2*(1+Ue);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_BATCHES_IN_FLIGHT,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,forEachIdsStreamRow,isDailyReportAttachmentThumbnailVariant,isDailyReportSseStreamId,isIdsStreamChunkLine,mergeComments,normalizeBusinessDateKey,parseDailyReportActionResult,parseDailyReportAttachmentQuery,reportCreateMessageSchema,reportDeleteMessageSchema,reportPublishMessageSchema,reportUpdateMessageSchema,statusUpdateMessageSchema});
|
|
1
|
+
"use strict";var U=Object.defineProperty;var Fe=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var Ke=Object.prototype.hasOwnProperty;var Ve=(e,t)=>{for(var r in t)U(e,r,{get:t[r],enumerable:!0})},qe=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $e(t))!Ke.call(e,o)&&o!==r&&U(e,o,{get:()=>t[o],enumerable:!(n=Fe(t,o))||n.enumerable});return e};var Ge=e=>qe(U({},"__esModule",{value:!0}),e);var Yt={};Ve(Yt,{DAILY_REPORT_ACTION_FIELDS:()=>y,DAILY_REPORT_ACTION_INTENTS:()=>be,DAILY_REPORT_API_ENDPOINTS:()=>Ee,DAILY_REPORT_API_QUERY_PARAMS:()=>Ce,DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS:()=>$,DAILY_REPORT_CLIENT_TEMP_ID_PATTERN:()=>_,DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT:()=>Ye,DAILY_REPORT_SEARCH_COMBINES:()=>je,DAILY_REPORT_SSE_CURSOR_PARAM:()=>ye,DAILY_REPORT_SSE_HEARTBEAT_MS:()=>me,DAILY_REPORT_SSE_TERMINAL_EVENTS:()=>ce,buildDailyReportAttachmentUrl:()=>Me,dailyReportDetailSchema:()=>I,dailyReportSseMessageSchema:()=>fe,encodeDailyReportActionCommand:()=>De,forEachIdsStreamRow:()=>_e,isDailyReportAttachmentThumbnailVariant:()=>j,normalizeBusinessDateKey:()=>Ae,parseDailyReportActionResult:()=>Ie,parseDailyReportAttachmentQuery:()=>Oe,readDailyReportSearchMarksAnswer:()=>Be,readIdsStreamChunkLine:()=>xe});module.exports=Ge(Yt);var p=require("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})$/;var Q=require("zod/v3"),f=e=>Number.isSafeInteger(e)&&e>0,c=Q.z.number().int().positive().max(Number.MAX_SAFE_INTEGER);var d=require("zod/v3");var S=Symbol("daily-report wire mismatch"),h=(e,t,r)=>(e.issues.push({...r,path:t===null?[...e.path]:[...e.path,t]}),S),ee=e=>e===null?"null":Array.isArray(e)?"array":Number.isNaN(e)?"nan":typeof e,A=(e,t)=>({code:"invalid_type",expected:e,received:ee(t)}),Qe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ze=e=>{let t=0;for(let r in e)t+=1;return t},Z=(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},E=e=>{let t=Object.keys(e),r=Object.values(e);return(n,o)=>{if(!Qe(n))return h(o,null,A("object",n));let a=null,l=!1,s=0;for(let i=0;i<t.length;i+=1){let m=t[i],R=n[m];R!==void 0&&(s+=1);let b=r[i](R,o,m);if(b===S){l=!0;continue}a===null&&b!==R&&(a=Z(n,t,i)),a!==null&&(b!==void 0||m in n)&&(a[m]=b)}return l?S:a!==null?a:Ze(n)===s?n:Z(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,A("array",t));r.path.push(n);let o=t,a=!1;for(let l=0;l<t.length;l+=1){let s=t[l],i=e(s,r,l);i===S?a=!0:i!==s&&(o===t&&(o=t.slice()),o[l]=i)}return r.path.pop(),a?S:o},u=(e,t,r)=>e==null||typeof e=="string"?e:h(t,r,A("string",e)),X=(e,t,r)=>e===null||typeof e=="string"?e:h(t,r,A("string",e)),J=(e,t,r)=>typeof e=="string"?e:h(t,r,A("string",e)),Xe=(e,t,r)=>e===null||typeof e=="number"&&!Number.isNaN(e)?e:h(t,r,A("number",e)),w=(e,t,r)=>typeof e=="boolean"?e:h(t,r,A("boolean",e)),W=(e,t,r)=>{if(typeof e=="number"&&f(e))return e;for(let{message:n,path:o,...a}of c.safeParse(e).error.issues)h(t,r,a);return S},te={present:!0,absent:!0,unknown:!0},re=Object.keys(te),Je=re.map(e=>`'${e}'`).join(" | "),et=(e,t,r)=>typeof e!="string"?h(t,r,{code:"invalid_type",expected:Je,received:ee(e)}):Object.hasOwn(te,e)?e:h(t,r,{code:"invalid_enum_value",received:e,options:[...re]}),ne=E({name:u,affiliation:u}),oe=E({name:u,text:u,color:u}),ae=E({id:W,name:u,color:u}),se=E({id:W,userId:u,userName:u,content:u,createdAt:u,isMine:w}),tt=E({id:J,fileName:J,fileType:X,fileSize:Xe,createdAt:X,state:et,hasThumbnail:w}),rt=E({reportHubId:W,date:u,createdAt:u,author:u,userId:u,sourceType:u,employeeName:u,updatedBy:u,updatedAt:u,category:u,creationCategory:u,visitTimeFrom:u,visitTimeTo:u,customerName:u,interviewers:k(C(ne)),subject:u,content:u,externalComments:k(C(oe)),isRead:w,isStarred:w,isDraft:w,labels:k(C(ae)),postedComments:k(C(se)),attachments:k(C(tt))}),N=(e,t)=>{let r={path:[],issues:[]},n=e(t,r);return n===S?{ok:!1,issues:r.issues}:{ok:!0,value:n}},ie=e=>N(rt,e),le=e=>N(ne,e),ue=e=>N(oe,e),pe=e=>N(ae,e),de=e=>N(se,e);var ce=["auth-required","forbidden","resync-required"],me=15e3,ye="lastEventId",nt=/^\d{1,15}-\d{1,15}$/,Re=e=>nt.test(e),M=e=>d.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 d.z.NEVER}),Vt=M(le),qt=M(ue),Gt=M(pe),B=M(de),I=M(ie),T=d.z.string().regex(_),ot=d.z.object({type:d.z.literal("connected")}),at=d.z.object({type:d.z.literal("status-update"),reportHubId:c,statusType:d.z.enum(["star","read"]),value:d.z.boolean(),clientTempId:T,recipientRawUserId:c.optional()}),v=d.z.string(),st=d.z.object({type:d.z.literal("comment-add"),reportHubId:c,comment:B,clientTempId:T,recipientRawUserId:c.optional(),sourceType:v}),it=d.z.object({type:d.z.literal("comment-delete"),reportHubId:c,commentId:c,clientTempId:T,recipientRawUserId:c.optional(),sourceType:v}),lt=d.z.object({type:d.z.literal("report-create"),reportHubId:c,report:I,clientTempId:T,recipientRawUserId:c.optional()}),ut=d.z.object({type:d.z.literal("report-update"),reportHubId:c,report:I,clientTempId:T,recipientRawUserId:c.optional()}),pt=d.z.object({type:d.z.literal("report-publish"),reportHubId:c,report:I,clientTempId:T,recipientRawUserId:c.optional()}),dt=d.z.object({type:d.z.literal("report-delete"),reportHubId:c,clientTempId:T,sourceType:v}),fe=d.z.discriminatedUnion("type",[ot,at,st,it,lt,ut,pt,dt]);var he=e=>e.issues.map(t=>`${t.path.length===0?"(root)":t.path.join(".")}: ${t.code}`).join("; ");var be=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"}),De=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}},ct=()=>{let e=c,t=p.z.string().regex(_),r=p.z.literal("OK"),n=p.z.object({isStarred:p.z.boolean(),isRead:p.z.boolean()}),o=p.z.number().int().nonnegative().nullable();return{create:p.z.object({status:r,intent:p.z.literal("create"),reportHubId:e,clientTempId:t,report:I}),update:p.z.object({status:r,intent:p.z.literal("update"),reportHubId:e,clientTempId:t}),publish:p.z.object({status:r,intent:p.z.literal("publish"),reportHubId:e,clientTempId:t,report:I.nullable()}),delete:p.z.object({status:r,intent:p.z.literal("delete"),reportHubId:e,clientTempId:t}),toggleStar:p.z.object({status:r,intent:p.z.literal("toggleStar"),reportHubId:e,clientTempId:t,updatedStatus:n,operationTimestamp:o}),toggleRead:p.z.object({status:r,intent:p.z.literal("toggleRead"),reportHubId:e,clientTempId:t,updatedStatus:n,operationTimestamp:o}),addComment:p.z.object({status:r,intent:p.z.literal("addComment"),reportHubId:e,clientTempId:t,newComment:B}),deleteComment:p.z.object({status:r,intent:p.z.literal("deleteComment"),reportHubId:e,clientTempId:t,deletedCommentId:c}),clearCache:p.z.object({status:r,intent:p.z.literal("clearCache")})}},z=null,mt=()=>(z===null&&(z=ct()),z),Ie=(e,t)=>{let r=mt()[e].safeParse(t);return r.success?{result:r.data}:{mismatch:he(r.error)}};var yt=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var ge=e=>e<10?`0${e}`:`${e}`,Rt=e=>{if(Number.isNaN(e.getTime()))return null;let t=e.getFullYear(),r=ge(e.getMonth()+1),n=ge(e.getDate());return`${t}-${r}-${n}`},Se=e=>{let t=yt.exec(e);if(t===null)return null;let[,r,,n,o]=t,a=Number(r),l=Number(n),s=Number(o);if(a<1)return null;let i=new Date(0);return i.setUTCFullYear(a,l-1,s),i.getUTCFullYear()!==a||i.getUTCMonth()!==l-1||i.getUTCDate()!==s?null:`${r}-${n}-${o}`},F=e=>Se(e)===e;var Ae=e=>e==null?null:e instanceof Date?Rt(e):Se(e);var Te="ids-columns",ft=e=>{if(typeof e!="object"||e===null)return"unknown";let{kind:t}=e;return t==="chunk"?"chunk":t==="error"?"error":"unknown"},ht=e=>typeof e=="number"&&f(e),bt=e=>{if(typeof e!="object"||e===null)return!1;let{businessDate:t,reportHubId:r}=e;return(t===null||typeof t=="string")&&typeof r=="number"},Dt=4,It=e=>{let t=Dt;for(;2**t<e*2;)t+=1;let r=new Float64Array(2**t),n=r.length-1,o=32-t;return a=>{let l=Math.imul(a|0,2654435761)>>>o;for(;;){let s=r[l];if(s===0)return r[l]=a,!0;if(s===a)return!1;l=l+1&n}}},gt=/^[0-9a-f]{1,16}$/,St=e=>f(e.reportHubId)&&(e.businessDate===null||F(e.businessDate)),At=e=>typeof e=="string"&>.test(e),Tt=Object.freeze({kind:"absent"}),xt=Object.freeze({kind:"value",value:null}),_t=e=>e===void 0?Tt:e===null?xt:typeof e=="string"&&Re(e)?{kind:"value",value:e}:{kind:"malformed",received:e},xe=e=>{if(ft(e)!=="chunk")return null;let{ids:t,dates:r,counts:n,sourceTypes:o,sources:a,isLast:l,nextCursor:s,total:i,snapshot:m,provisional:R,restarted:b,streamAnchor:ve}=e;if(typeof l!="boolean"||!(s===null||bt(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 ze=It(t.length),g=0,V=null,q=0;for(let D=0;D<r.length;D++){let x=r[D],P=n[D];if(!(x===null||typeof x=="string"&&F(x))||D>0&&x===r[D-1]||typeof P!="number"||!Number.isSafeInteger(P)||P<1)return null;let G=g+P;if(G>t.length)return null;for(;g<G;g++){let L=t[g],H=a[g];if(!(ht(L)&&ze(L))||typeof H!="number"||!Number.isSafeInteger(H)||H<0||H>=o.length||g>0&&!Ct(V,q,x,L))return null;V=x,q=L}}return g!==t.length?null:{rows:e,isLast:l,resumeCursor:s!==null&&St(s)?s:null,total:typeof i=="number"&&Number.isSafeInteger(i)&&i>=0?i:null,snapshot:At(m)?m:null,provisional:R===!0,restarted:b===!0,streamAnchor:_t(ve)}},_e=(e,t)=>{let{ids:r,dates:n,counts:o,sourceTypes:a,sources:l}=e,s=0;for(let i=0;i<n.length;i++){let m=n[i];for(let R=s+o[i];s<R;s++){let b=a[l[s]];t(r[s],m,b===null?void 0:b)}}};var Et=(e,t,r,n)=>e!==r?e===null?1:r===null||e>r?-1:1:n-t,Ct=(e,t,r,n)=>Et(e,t,r,n)<0;var Ee=Object.freeze({businessDate:"business-date",idsStream:Te,report:"report",search:"search",reports:"reports",searchMarks:"search-marks",searchFacets:"search-facets",action:"action"}),Ce=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 $=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),j=e=>Object.hasOwn($,e);var ke="download",we="thumbnail",Ne="1",Me=(e,t,r)=>{let n=`${e}/attachment/${encodeURIComponent(t)}`;switch(r.kind){case"inline":return n;case"download":return`${n}?${new URLSearchParams({[ke]:Ne})}`;case"thumbnail":return`${n}?${new URLSearchParams({[we]:r.variant})}`}},Oe=e=>{let t=e.getAll(we),r=e.getAll(ke);if(t.length>0&&r.length>0)return{kind:"invalid",reason:"conflict"};if(t.length>0){let[n]=t;return t.length===1&&j(n)?{kind:"thumbnail",variant:n}:{kind:"invalid",reason:"thumbnail_variant"}}return r.length>0?r.length===1&&r[0]===Ne?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var K="legacy-";var kt=/^[1-9][0-9]*$/,wt=/^(?:0|[1-9][0-9]*)$/,Pe=e=>{if(e===null||!kt.test(e))return null;let t=Number(e);return f(t)?t:null},Y=e=>{if(e===null||!wt.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null};var Nt=Object.freeze(["subject","content","author","employeeName","updatedBy","category","creationCategory","customerName"]),br=Object.freeze({field:e=>e,interviewer:(e,t)=>`interviewer:${e}:${t}`,attachment:e=>`attachment:${e}`,comment:(e,t)=>`comment:${e}:${t}`}),Mt=e=>e.startsWith(K)?Y(e.slice(K.length))!==null:Pe(e)!==null,Le=e=>{if(Nt.includes(e))return!0;let t=e.split(":");switch(t[0]){case"interviewer":return t.length===3&&Y(t[1])!==null&&(t[2]==="name"||t[2]==="affiliation");case"attachment":return t.length===2&&Y(t[1])!==null;case"comment":return t.length===3&&Mt(t[1])&&(t[2]==="author"||t[2]==="content");default:return!1}};var Dr=String.fromCodePoint(3),Ir=String.fromCodePoint(2),gr=String.fromCodePoint(1);var je=["intersection","union"];var Ar=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100}),Ot=2,Ye=2,He=Object.freeze({word:0,reading:1}),Ue=e=>e===He.word||e===He.reading;var O=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Tr=2*(1+Ot);var Pt=4294967295,We=e=>typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=Pt,Lt=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)||!Ue(a))return null;if(r>0){let l=t[r-2];if(l>n||l===n&&t[r-1]===a)return null}t.push(n,o,a)}return t},Ht=e=>{if(!(O(e)&&We(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=Lt(e.ranges);return t===null?null:{fingerprint:e.fingerprint,ranges:t}},jt=e=>{if(!O(e))return null;let t={};for(let[r,n]of Object.entries(e)){if(!Le(r))return null;let o=Ht(n);if(o===null)return null;t[r]=o}return t},Be=(e,t)=>{if(!(O(e)&&We(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(!O(s))return null;let{reportHubId:i,matchedSets:m}=s;if(!(typeof i=="number"&&f(i)&&r.has(i))||n.has(i)||(n.add(i),t.expectsMatchedSets?!(typeof m=="number"&&Number.isInteger(m)&&m>=0&&m<=o):m!==null))return null;let R=jt(s.fields);if(R===null)return null;a.push({reportHubId:i,matchedSets:m,fields:R})}if(a.length===0&&e.deferred.length>0)return null;let l=[];for(let s of e.deferred){if(!(typeof s=="number"&&f(s)&&r.has(s))||n.has(s))return null;n.add(s),l.push(s)}return{wordsDigest:e.wordsDigest,reports:a,deferred:l}};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_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,forEachIdsStreamRow,isDailyReportAttachmentThumbnailVariant,normalizeBusinessDateKey,parseDailyReportActionResult,parseDailyReportAttachmentQuery,readDailyReportSearchMarksAnswer,readIdsStreamChunkLine});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as s}from"zod";var I=/^(?:[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 X}from"zod";var w=e=>Number.isSafeInteger(e)&&e>0,i=X.number().int().positive().max(Number.MAX_SAFE_INTEGER);import{z as r}from"zod";var Z=["auth-required","forbidden","resync-required"],J=15e3,ee="lastEventId",te=/^\d{1,15}-\d{1,15}$/,re=e=>te.test(e),N=r.object({name:r.string().nullish(),affiliation:r.string().nullish()}),P=r.object({name:r.string().nullish(),text:r.string().nullish(),color:r.string().nullish()}),k=r.object({id:i,name:r.string().nullish(),color:r.string().nullish()}),f=r.object({id:i,userId:r.string().nullish(),userName:r.string().nullish(),content:r.string().nullish(),createdAt:r.string().nullish(),isMine:r.boolean()}),ne=r.object({id:r.string(),fileName:r.string(),fileType:r.string().nullable(),fileSize:r.number().nullable(),createdAt:r.string().nullable(),state:r.enum(["present","absent","unknown"]),hasThumbnail:r.boolean().default(!1)}),R=r.object({reportHubId:i,date:r.string().nullish(),createdAt:r.string().nullish(),author:r.string().nullish(),userId:r.string().nullish(),sourceType:r.string().nullish(),employeeName:r.string().nullish(),updatedBy:r.string().nullish(),updatedAt:r.string().nullish(),category:r.string().nullish(),creationCategory:r.string().nullish(),visitTimeFrom:r.string().nullish(),visitTimeTo:r.string().nullish(),customerName:r.string().nullish(),interviewers:r.array(N),subject:r.string().nullish(),content:r.string().nullish(),externalComments:r.array(P),isRead:r.boolean(),isStarred:r.boolean(),isDraft:r.boolean(),labels:r.array(k),postedComments:r.array(f),attachments:r.array(ne).default([])}),h=r.string().regex(I),L=r.object({type:r.literal("connected")}),O=r.object({type:r.literal("status-update"),reportHubId:i,statusType:r.enum(["star","read"]),value:r.boolean(),clientTempId:h,recipientRawUserId:i.optional()}),x=r.string().optional(),M=r.object({type:r.literal("comment-add"),reportHubId:i,comment:f,clientTempId:h,recipientRawUserId:i.optional(),sourceType:x}),H=r.object({type:r.literal("comment-delete"),reportHubId:i,commentId:i,clientTempId:h,recipientRawUserId:i.optional(),sourceType:x}),Y=r.object({type:r.literal("report-create"),reportHubId:i,report:R,clientTempId:h,recipientRawUserId:i.optional()}),j=r.object({type:r.literal("report-update"),reportHubId:i,report:R,clientTempId:h,recipientRawUserId:i.optional()}),U=r.object({type:r.literal("report-publish"),reportHubId:i,report:R,clientTempId:h,recipientRawUserId:i.optional()}),B=r.object({type:r.literal("report-delete"),reportHubId:i,clientTempId:h,sourceType:x}),oe=r.discriminatedUnion("type",[L,O,M,H,Y,j,U,B]);var $=e=>e.issues.map(t=>`${t.path.length===0?"(root)":t.path.join(".")}: ${t.code}`).join("; ");var ae=Object.freeze(["create","update","publish","delete","toggleStar","toggleRead","addComment","deleteComment","clearCache"]);var d=Object.freeze({intent:"intent",clientTempId:"clientTempId",businessDate:"businessDate",operationTimestamp:"operationTimestamp",reportHubId:"reportHubId",title:"title",content:"content",isStarred:"isStarred",isRead:"isRead",commentId:"commentId"}),se=e=>{let t=new FormData;if(t.append(d.intent,e.intent),e.intent==="clearCache"||(t.append(d.clientTempId,e.clientTempId),e.businessDate!==null&&t.append(d.businessDate,e.businessDate),e.operationTimestamp!==null&&t.append(d.operationTimestamp,String(e.operationTimestamp)),e.intent==="create"))return t;switch(t.append(d.reportHubId,String(e.reportHubId)),e.intent){case"update":return e.changes.title!==void 0&&t.append(d.title,e.changes.title),e.changes.content!==void 0&&t.append(d.content,e.changes.content),t;case"publish":case"delete":return t;case"toggleStar":return t.append(d.isStarred,String(e.value)),t;case"toggleRead":return t.append(d.isRead,String(e.value)),t;case"addComment":return t.append(d.content,e.content),t;case"deleteComment":return t.append(d.commentId,String(e.commentId)),t}},ie=()=>{let e=i,t=s.string().regex(I),n=s.literal("OK"),o=s.object({isStarred:s.boolean(),isRead:s.boolean()}),u=s.number().int().nonnegative().nullable();return{create:s.object({status:n,intent:s.literal("create"),reportHubId:e,clientTempId:t,report:R}),update:s.object({status:n,intent:s.literal("update"),reportHubId:e,clientTempId:t}),publish:s.object({status:n,intent:s.literal("publish"),reportHubId:e,clientTempId:t,report:R.nullable()}),delete:s.object({status:n,intent:s.literal("delete"),reportHubId:e,clientTempId:t}),toggleStar:s.object({status:n,intent:s.literal("toggleStar"),reportHubId:e,clientTempId:t,updatedStatus:o,operationTimestamp:u}),toggleRead:s.object({status:n,intent:s.literal("toggleRead"),reportHubId:e,clientTempId:t,updatedStatus:o,operationTimestamp:u}),addComment:s.object({status:n,intent:s.literal("addComment"),reportHubId:e,clientTempId:t,newComment:f}),deleteComment:s.object({status:n,intent:s.literal("deleteComment"),reportHubId:e,clientTempId:t,deletedCommentId:i}),clearCache:s.object({status:n,intent:s.literal("clearCache")})}},_=null,le=()=>(_===null&&(_=ie()),_),ue=(e,t)=>{let n=le()[e].safeParse(t);return n.success?{result:n.data}:{mismatch:$(n.error)}};var pe=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var v=e=>e<10?`0${e}`:`${e}`,de=e=>{if(Number.isNaN(e.getTime()))return null;let t=e.getFullYear(),n=v(e.getMonth()+1),o=v(e.getDate());return`${t}-${n}-${o}`},z=e=>{let t=pe.exec(e);if(t===null)return null;let[,n,,o,u]=t,p=Number(n),a=Number(o),l=Number(u);if(p<1)return null;let c=new Date(0);return c.setUTCFullYear(p,a-1,l),c.getUTCFullYear()!==p||c.getUTCMonth()!==a-1||c.getUTCDate()!==l?null:`${n}-${o}-${u}`},W=e=>z(e)===e;var ce=e=>e==null?null:e instanceof Date?de(e):z(e);var F="ids-columns",me=e=>{if(typeof e!="object"||e===null)return"unknown";let{kind:t}=e;return t==="chunk"?"chunk":t==="error"?"error":"unknown"},ye=e=>typeof e=="number"&&w(e),Re=e=>{if(typeof e!="object"||e===null)return!1;let{businessDate:t,reportHubId:n}=e;return(t===null||typeof t=="string")&&typeof n=="number"},he=4,ge=e=>{let t=he;for(;2**t<e*2;)t+=1;let n=new Float64Array(2**t),o=n.length-1,u=32-t;return p=>{let a=Math.imul(p|0,2654435761)>>>u;for(;;){let l=n[a];if(l===0)return n[a]=p,!0;if(l===p)return!1;a=a+1&o}}},be=e=>{if(me(e)!=="chunk")return!1;let{ids:t,dates:n,counts:o,sourceTypes:u,sources:p,isLast:a,nextCursor:l}=e;if(typeof a!="boolean"||!(l===null||Re(l))||!(Array.isArray(t)&&Array.isArray(n)&&Array.isArray(o)&&Array.isArray(u)&&Array.isArray(p))||n.length!==o.length||p.length!==t.length)return!1;for(let y of u)if(!(y===null||typeof y=="string"))return!1;let c=ge(t.length),m=0,D=null,b=0;for(let y=0;y<n.length;y++){let g=n[y],S=o[y];if(!(g===null||typeof g=="string"&&W(g))||y>0&&g===n[y-1]||typeof S!="number"||!Number.isSafeInteger(S)||S<1)return!1;let E=m+S;if(E>t.length)return!1;for(;m<E;m++){let A=t[m],T=p[m];if(!(ye(A)&&c(A))||typeof T!="number"||!Number.isSafeInteger(T)||T<0||T>=u.length||m>0&&!De(D,b,g,A))return!1;D=g,b=A}}return m===t.length},Ie=(e,t)=>{let{ids:n,dates:o,counts:u,sourceTypes:p,sources:a}=e,l=0;for(let c=0;c<o.length;c++){let m=o[c];for(let D=l+u[c];l<D;l++){let b=p[a[l]];t(n[l],m,b===null?void 0:b)}}};var fe=(e,t,n,o)=>e!==n?e===null?1:n===null||e>n?-1:1:o-t,De=(e,t,n,o)=>fe(e,t,n,o)<0;var Se=Object.freeze({businessDate:"business-date",idsStream:F,report:"report",search:"search",reports:"reports",searchMarks:"search-marks",searchFacets:"search-facets",action:"action"}),Ae=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 K=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),C=e=>Object.hasOwn(K,e);var V="download",Q="thumbnail",q="1",Te=(e,t,n)=>{let o=`${e}/attachment/${encodeURIComponent(t)}`;switch(n.kind){case"inline":return o;case"download":return`${o}?${new URLSearchParams({[V]:q})}`;case"thumbnail":return`${o}?${new URLSearchParams({[Q]:n.variant})}`}},xe=e=>{let t=e.getAll(Q),n=e.getAll(V);if(t.length>0&&n.length>0)return{kind:"invalid",reason:"conflict"};if(t.length>0){let[o]=t;return t.length===1&&C(o)?{kind:"thumbnail",variant:o}:{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 _e=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,G=(e,t,n)=>new RangeError(`[daily-report] ${e} must be ${t}; got ${_e(n)}`);var Ce="legacy-",Ee=e=>`${Ce}${e}`,we=(e,t,n,o)=>{if(typeof o!="string"||o.trim()==="")throw G("mergeComments: unknownAuthorName","a non-blank string",o);let u=e.map((a,l)=>({id:Ee(l),authorName:a.name||o,content:a.text||"",isMine:!1,color:a.color||void 0,isLegacy:!0,isAuthorUnknown:!a.name})),p=t.map(a=>({id:a.id,authorName:a.userName||o,content:a.content??"",createdAt:a.createdAt??"",isMine:n?a.userId===n:a.isMine,isLegacy:!1,isAuthorUnknown:!a.userName}));return[...u,...p]};var Ne=["intersection","union"];var at=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100}),Pe=2,ke=2,st=Object.freeze({word:0,reading:1});var it=2*(1+Pe);export{d as DAILY_REPORT_ACTION_FIELDS,ae as DAILY_REPORT_ACTION_INTENTS,Se as DAILY_REPORT_API_ENDPOINTS,Ae as DAILY_REPORT_API_QUERY_PARAMS,K as DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS,I as DAILY_REPORT_CLIENT_TEMP_ID_PATTERN,ke as DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT,Ne as DAILY_REPORT_SEARCH_COMBINES,ee as DAILY_REPORT_SSE_CURSOR_PARAM,J as DAILY_REPORT_SSE_HEARTBEAT_MS,Z as DAILY_REPORT_SSE_TERMINAL_EVENTS,Te as buildDailyReportAttachmentUrl,M as commentAddMessageSchema,H as commentDeleteMessageSchema,L as connectedMessageSchema,R as dailyReportDetailSchema,P as dailyReportExternalCommentSchema,N as dailyReportInterviewerSchema,k as dailyReportLabelDefSchema,f as dailyReportPostedCommentSchema,oe as dailyReportSseMessageSchema,se as encodeDailyReportActionCommand,Ie as forEachIdsStreamRow,C as isDailyReportAttachmentThumbnailVariant,re as isDailyReportSseStreamId,be as isIdsStreamChunkLine,we as mergeComments,ce as normalizeBusinessDateKey,ue as parseDailyReportActionResult,xe as parseDailyReportAttachmentQuery,Y as reportCreateMessageSchema,B as reportDeleteMessageSchema,U as reportPublishMessageSchema,j as reportUpdateMessageSchema,O as statusUpdateMessageSchema};
|
|
1
|
+
import{z as p}from"zod/v3";var E=/^(?:[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 xe}from"zod/v3";var f=e=>Number.isSafeInteger(e)&&e>0,c=xe.number().int().positive().max(Number.MAX_SAFE_INTEGER);import{z as d}from"zod/v3";var g=Symbol("daily-report wire mismatch"),h=(e,t,r)=>(e.issues.push({...r,path:t===null?[...e.path]:[...e.path,t]}),g),Z=e=>e===null?"null":Array.isArray(e)?"array":Number.isNaN(e)?"nan":typeof e,S=(e,t)=>({code:"invalid_type",expected:e,received:Z(t)}),_e=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ee=e=>{let t=0;for(let r in e)t+=1;return t},q=(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},_=e=>{let t=Object.keys(e),r=Object.values(e);return(n,o)=>{if(!_e(n))return h(o,null,S("object",n));let a=null,l=!1,s=0;for(let i=0;i<t.length;i+=1){let m=t[i],R=n[m];R!==void 0&&(s+=1);let b=r[i](R,o,m);if(b===g){l=!0;continue}a===null&&b!==R&&(a=q(n,t,i)),a!==null&&(b!==void 0||m in n)&&(a[m]=b)}return l?g:a!==null?a:Ee(n)===s?n:q(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,S("array",t));r.path.push(n);let o=t,a=!1;for(let l=0;l<t.length;l+=1){let s=t[l],i=e(s,r,l);i===g?a=!0:i!==s&&(o===t&&(o=t.slice()),o[l]=i)}return r.path.pop(),a?g:o},u=(e,t,r)=>e==null||typeof e=="string"?e:h(t,r,S("string",e)),G=(e,t,r)=>e===null||typeof e=="string"?e:h(t,r,S("string",e)),Q=(e,t,r)=>typeof e=="string"?e:h(t,r,S("string",e)),Ce=(e,t,r)=>e===null||typeof e=="number"&&!Number.isNaN(e)?e:h(t,r,S("number",e)),w=(e,t,r)=>typeof e=="boolean"?e:h(t,r,S("boolean",e)),Y=(e,t,r)=>{if(typeof e=="number"&&f(e))return e;for(let{message:n,path:o,...a}of c.safeParse(e).error.issues)h(t,r,a);return g},X={present:!0,absent:!0,unknown:!0},J=Object.keys(X),ke=J.map(e=>`'${e}'`).join(" | "),we=(e,t,r)=>typeof e!="string"?h(t,r,{code:"invalid_type",expected:ke,received:Z(e)}):Object.hasOwn(X,e)?e:h(t,r,{code:"invalid_enum_value",received:e,options:[...J]}),ee=_({name:u,affiliation:u}),te=_({name:u,text:u,color:u}),re=_({id:Y,name:u,color:u}),ne=_({id:Y,userId:u,userName:u,content:u,createdAt:u,isMine:w}),Ne=_({id:Q,fileName:Q,fileType:G,fileSize:Ce,createdAt:G,state:we,hasThumbnail:w}),Me=_({reportHubId:Y,date:u,createdAt:u,author:u,userId:u,sourceType:u,employeeName:u,updatedBy:u,updatedAt:u,category:u,creationCategory:u,visitTimeFrom:u,visitTimeTo:u,customerName:u,interviewers:k(C(ee)),subject:u,content:u,externalComments:k(C(te)),isRead:w,isStarred:w,isDraft:w,labels:k(C(re)),postedComments:k(C(ne)),attachments:k(C(Ne))}),N=(e,t)=>{let r={path:[],issues:[]},n=e(t,r);return n===g?{ok:!1,issues:r.issues}:{ok:!0,value:n}},oe=e=>N(Me,e),ae=e=>N(ee,e),se=e=>N(te,e),ie=e=>N(re,e),le=e=>N(ne,e);var Oe=["auth-required","forbidden","resync-required"],Pe=15e3,Le="lastEventId",He=/^\d{1,15}-\d{1,15}$/,ue=e=>He.test(e),M=e=>d.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 d.NEVER}),Wt=M(ae),Bt=M(se),vt=M(ie),U=M(le),A=M(oe),T=d.string().regex(E),je=d.object({type:d.literal("connected")}),Ye=d.object({type:d.literal("status-update"),reportHubId:c,statusType:d.enum(["star","read"]),value:d.boolean(),clientTempId:T,recipientRawUserId:c.optional()}),W=d.string(),Ue=d.object({type:d.literal("comment-add"),reportHubId:c,comment:U,clientTempId:T,recipientRawUserId:c.optional(),sourceType:W}),We=d.object({type:d.literal("comment-delete"),reportHubId:c,commentId:c,clientTempId:T,recipientRawUserId:c.optional(),sourceType:W}),Be=d.object({type:d.literal("report-create"),reportHubId:c,report:A,clientTempId:T,recipientRawUserId:c.optional()}),ve=d.object({type:d.literal("report-update"),reportHubId:c,report:A,clientTempId:T,recipientRawUserId:c.optional()}),ze=d.object({type:d.literal("report-publish"),reportHubId:c,report:A,clientTempId:T,recipientRawUserId:c.optional()}),Fe=d.object({type:d.literal("report-delete"),reportHubId:c,clientTempId:T,sourceType:W}),$e=d.discriminatedUnion("type",[je,Ye,Ue,We,Be,ve,ze,Fe]);var pe=e=>e.issues.map(t=>`${t.path.length===0?"(root)":t.path.join(".")}: ${t.code}`).join("; ");var Ke=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"}),Ve=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}},qe=()=>{let e=c,t=p.string().regex(E),r=p.literal("OK"),n=p.object({isStarred:p.boolean(),isRead:p.boolean()}),o=p.number().int().nonnegative().nullable();return{create:p.object({status:r,intent:p.literal("create"),reportHubId:e,clientTempId:t,report:A}),update:p.object({status:r,intent:p.literal("update"),reportHubId:e,clientTempId:t}),publish:p.object({status:r,intent:p.literal("publish"),reportHubId:e,clientTempId:t,report:A.nullable()}),delete:p.object({status:r,intent:p.literal("delete"),reportHubId:e,clientTempId:t}),toggleStar:p.object({status:r,intent:p.literal("toggleStar"),reportHubId:e,clientTempId:t,updatedStatus:n,operationTimestamp:o}),toggleRead:p.object({status:r,intent:p.literal("toggleRead"),reportHubId:e,clientTempId:t,updatedStatus:n,operationTimestamp:o}),addComment:p.object({status:r,intent:p.literal("addComment"),reportHubId:e,clientTempId:t,newComment:U}),deleteComment:p.object({status:r,intent:p.literal("deleteComment"),reportHubId:e,clientTempId:t,deletedCommentId:c}),clearCache:p.object({status:r,intent:p.literal("clearCache")})}},B=null,Ge=()=>(B===null&&(B=qe()),B),Qe=(e,t)=>{let r=Ge()[e].safeParse(t);return r.success?{result:r.data}:{mismatch:pe(r.error)}};var Ze=/^(\d{4})([-/])(\d{2})\2(\d{2})$/;var de=e=>e<10?`0${e}`:`${e}`,Xe=e=>{if(Number.isNaN(e.getTime()))return null;let t=e.getFullYear(),r=de(e.getMonth()+1),n=de(e.getDate());return`${t}-${r}-${n}`},ce=e=>{let t=Ze.exec(e);if(t===null)return null;let[,r,,n,o]=t,a=Number(r),l=Number(n),s=Number(o);if(a<1)return null;let i=new Date(0);return i.setUTCFullYear(a,l-1,s),i.getUTCFullYear()!==a||i.getUTCMonth()!==l-1||i.getUTCDate()!==s?null:`${r}-${n}-${o}`},v=e=>ce(e)===e;var Je=e=>e==null?null:e instanceof Date?Xe(e):ce(e);var me="ids-columns",et=e=>{if(typeof e!="object"||e===null)return"unknown";let{kind:t}=e;return t==="chunk"?"chunk":t==="error"?"error":"unknown"},tt=e=>typeof e=="number"&&f(e),rt=e=>{if(typeof e!="object"||e===null)return!1;let{businessDate:t,reportHubId:r}=e;return(t===null||typeof t=="string")&&typeof r=="number"},nt=4,ot=e=>{let t=nt;for(;2**t<e*2;)t+=1;let r=new Float64Array(2**t),n=r.length-1,o=32-t;return a=>{let l=Math.imul(a|0,2654435761)>>>o;for(;;){let s=r[l];if(s===0)return r[l]=a,!0;if(s===a)return!1;l=l+1&n}}},at=/^[0-9a-f]{1,16}$/,st=e=>f(e.reportHubId)&&(e.businessDate===null||v(e.businessDate)),it=e=>typeof e=="string"&&at.test(e),lt=Object.freeze({kind:"absent"}),ut=Object.freeze({kind:"value",value:null}),pt=e=>e===void 0?lt:e===null?ut:typeof e=="string"&&ue(e)?{kind:"value",value:e}:{kind:"malformed",received:e},dt=e=>{if(et(e)!=="chunk")return null;let{ids:t,dates:r,counts:n,sourceTypes:o,sources:a,isLast:l,nextCursor:s,total:i,snapshot:m,provisional:R,restarted:b,streamAnchor:Ae}=e;if(typeof l!="boolean"||!(s===null||rt(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 Te=ot(t.length),I=0,$=null,K=0;for(let D=0;D<r.length;D++){let x=r[D],P=n[D];if(!(x===null||typeof x=="string"&&v(x))||D>0&&x===r[D-1]||typeof P!="number"||!Number.isSafeInteger(P)||P<1)return null;let V=I+P;if(V>t.length)return null;for(;I<V;I++){let L=t[I],H=a[I];if(!(tt(L)&&Te(L))||typeof H!="number"||!Number.isSafeInteger(H)||H<0||H>=o.length||I>0&&!yt($,K,x,L))return null;$=x,K=L}}return I!==t.length?null:{rows:e,isLast:l,resumeCursor:s!==null&&st(s)?s:null,total:typeof i=="number"&&Number.isSafeInteger(i)&&i>=0?i:null,snapshot:it(m)?m:null,provisional:R===!0,restarted:b===!0,streamAnchor:pt(Ae)}},ct=(e,t)=>{let{ids:r,dates:n,counts:o,sourceTypes:a,sources:l}=e,s=0;for(let i=0;i<n.length;i++){let m=n[i];for(let R=s+o[i];s<R;s++){let b=a[l[s]];t(r[s],m,b===null?void 0:b)}}};var mt=(e,t,r,n)=>e!==r?e===null?1:r===null||e>r?-1:1:n-t,yt=(e,t,r,n)=>mt(e,t,r,n)<0;var Rt=Object.freeze({businessDate:"business-date",idsStream:me,report:"report",search:"search",reports:"reports",searchMarks:"search-marks",searchFacets:"search-facets",action:"action"}),ft=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 ye=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),z=e=>Object.hasOwn(ye,e);var Re="download",fe="thumbnail",he="1",ht=(e,t,r)=>{let n=`${e}/attachment/${encodeURIComponent(t)}`;switch(r.kind){case"inline":return n;case"download":return`${n}?${new URLSearchParams({[Re]:he})}`;case"thumbnail":return`${n}?${new URLSearchParams({[fe]:r.variant})}`}},bt=e=>{let t=e.getAll(fe),r=e.getAll(Re);if(t.length>0&&r.length>0)return{kind:"invalid",reason:"conflict"};if(t.length>0){let[n]=t;return t.length===1&&z(n)?{kind:"thumbnail",variant:n}:{kind:"invalid",reason:"thumbnail_variant"}}return r.length>0?r.length===1&&r[0]===he?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var F="legacy-";var Dt=/^[1-9][0-9]*$/,It=/^(?:0|[1-9][0-9]*)$/,be=e=>{if(e===null||!Dt.test(e))return null;let t=Number(e);return f(t)?t:null},j=e=>{if(e===null||!It.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null};var gt=Object.freeze(["subject","content","author","employeeName","updatedBy","category","creationCategory","customerName"]),cr=Object.freeze({field:e=>e,interviewer:(e,t)=>`interviewer:${e}:${t}`,attachment:e=>`attachment:${e}`,comment:(e,t)=>`comment:${e}:${t}`}),St=e=>e.startsWith(F)?j(e.slice(F.length))!==null:be(e)!==null,De=e=>{if(gt.includes(e))return!0;let t=e.split(":");switch(t[0]){case"interviewer":return t.length===3&&j(t[1])!==null&&(t[2]==="name"||t[2]==="affiliation");case"attachment":return t.length===2&&j(t[1])!==null;case"comment":return t.length===3&&St(t[1])&&(t[2]==="author"||t[2]==="content");default:return!1}};var mr=String.fromCodePoint(3),yr=String.fromCodePoint(2),Rr=String.fromCodePoint(1);var At=["intersection","union"];var hr=Object.freeze({maxQueryLength:500,maxSets:16,maxWordsPerSet:16,maxWords:32,maxWordLength:100,maxDetailIds:100}),Tt=2,xt=2,Ie=Object.freeze({word:0,reading:1}),ge=e=>e===Ie.word||e===Ie.reading;var O=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},br=2*(1+Tt);var _t=4294967295,Se=e=>typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=_t,Et=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)||!ge(a))return null;if(r>0){let l=t[r-2];if(l>n||l===n&&t[r-1]===a)return null}t.push(n,o,a)}return t},Ct=e=>{if(!(O(e)&&Se(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=Et(e.ranges);return t===null?null:{fingerprint:e.fingerprint,ranges:t}},kt=e=>{if(!O(e))return null;let t={};for(let[r,n]of Object.entries(e)){if(!De(r))return null;let o=Ct(n);if(o===null)return null;t[r]=o}return t},wt=(e,t)=>{if(!(O(e)&&Se(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(!O(s))return null;let{reportHubId:i,matchedSets:m}=s;if(!(typeof i=="number"&&f(i)&&r.has(i))||n.has(i)||(n.add(i),t.expectsMatchedSets?!(typeof m=="number"&&Number.isInteger(m)&&m>=0&&m<=o):m!==null))return null;let R=kt(s.fields);if(R===null)return null;a.push({reportHubId:i,matchedSets:m,fields:R})}if(a.length===0&&e.deferred.length>0)return null;let l=[];for(let s of e.deferred){if(!(typeof s=="number"&&f(s)&&r.has(s))||n.has(s))return null;n.add(s),l.push(s)}return{wordsDigest:e.wordsDigest,reports:a,deferred:l}};export{y as DAILY_REPORT_ACTION_FIELDS,Ke as DAILY_REPORT_ACTION_INTENTS,Rt as DAILY_REPORT_API_ENDPOINTS,ft as DAILY_REPORT_API_QUERY_PARAMS,ye as DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS,E as DAILY_REPORT_CLIENT_TEMP_ID_PATTERN,xt as DAILY_REPORT_SEARCH_BATCHES_IN_FLIGHT,At as DAILY_REPORT_SEARCH_COMBINES,Le as DAILY_REPORT_SSE_CURSOR_PARAM,Pe as DAILY_REPORT_SSE_HEARTBEAT_MS,Oe as DAILY_REPORT_SSE_TERMINAL_EVENTS,ht as buildDailyReportAttachmentUrl,A as dailyReportDetailSchema,$e as dailyReportSseMessageSchema,Ve as encodeDailyReportActionCommand,ct as forEachIdsStreamRow,z as isDailyReportAttachmentThumbnailVariant,Je as normalizeBusinessDateKey,Qe as parseDailyReportActionResult,bt as parseDailyReportAttachmentQuery,wt as readDailyReportSearchMarksAnswer,dt as readIdsStreamChunkLine};
|
|
@@ -37,4 +37,10 @@ type DailyReportSearchMarksAnswer = {
|
|
|
37
37
|
readonly reports: readonly DailyReportSearchReportMarks[];
|
|
38
38
|
readonly deferred: readonly number[];
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
type DailyReportSearchMarksExpectation = {
|
|
41
|
+
readonly requestedIds: readonly number[];
|
|
42
|
+
readonly setCount: number;
|
|
43
|
+
readonly expectsMatchedSets: boolean;
|
|
44
|
+
};
|
|
45
|
+
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 };
|
|
@@ -37,4 +37,10 @@ type DailyReportSearchMarksAnswer = {
|
|
|
37
37
|
readonly reports: readonly DailyReportSearchReportMarks[];
|
|
38
38
|
readonly deferred: readonly number[];
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
type DailyReportSearchMarksExpectation = {
|
|
41
|
+
readonly requestedIds: readonly number[];
|
|
42
|
+
readonly setCount: number;
|
|
43
|
+
readonly expectsMatchedSets: boolean;
|
|
44
|
+
};
|
|
45
|
+
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 };
|
package/dist/server.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { d as DailyReportSseMessage,
|
|
2
|
-
export {
|
|
1
|
+
import { d as DailyReportSseMessage, q as DailyReportInterviewer, k as DailyReportExternalComment, D as DailyReportItem, e as DailyReportDetail, j as DailyReportAttachmentSummary, s as DailyReportPostedComment } from "./sse-schema-CUiQKk8K.mjs";
|
|
2
|
+
export { x as encodeIdsStreamRows } from "./sse-schema-CUiQKk8K.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,
|
|
6
|
-
export {
|
|
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";
|
|
7
7
|
import { TransactionRetryOptions } from "@aiquants/mssql";
|
|
8
8
|
import { b as DailyReportSearchFacets } from "./search-filters-wire-5MWi6GWu.mjs";
|
|
9
9
|
import { SQL } from "drizzle-orm";
|
|
10
|
-
import "zod";
|
|
10
|
+
import "zod/v3";
|
|
11
11
|
type RedisStreamMessage = {
|
|
12
12
|
id: string;
|
|
13
13
|
message: Record<string, string>;
|
|
@@ -162,10 +162,10 @@ declare class SqlResultCache {
|
|
|
162
162
|
private readonly maxBuckets;
|
|
163
163
|
private readonly maxBytes;
|
|
164
164
|
private lastSweepAt;
|
|
165
|
-
constructor(
|
|
166
|
-
readonly defaultTtlMs
|
|
167
|
-
readonly maxBuckets
|
|
168
|
-
readonly maxBytes
|
|
165
|
+
constructor(options: {
|
|
166
|
+
readonly defaultTtlMs?: number;
|
|
167
|
+
readonly maxBuckets?: number;
|
|
168
|
+
readonly maxBytes?: number;
|
|
169
169
|
}, epochStore: EpochStore);
|
|
170
170
|
private dropBucket;
|
|
171
171
|
private writeBucket;
|
|
@@ -1790,31 +1790,6 @@ type DailyReportSearchReconcileOptions = {
|
|
|
1790
1790
|
readonly signal?: AbortSignal;
|
|
1791
1791
|
readonly onProgress?: (progress: DailyReportSearchReconcileProgress) => void;
|
|
1792
1792
|
};
|
|
1793
|
-
type DailyReportHubRow = {
|
|
1794
|
-
id: number;
|
|
1795
|
-
sourceType: string;
|
|
1796
|
-
sourceId: string;
|
|
1797
|
-
sourceIdNum: number | null;
|
|
1798
|
-
businessDate: Date | string | null;
|
|
1799
|
-
userId: number | null;
|
|
1800
|
-
title: string | null;
|
|
1801
|
-
summary: string | null;
|
|
1802
|
-
createdAt: Date | string;
|
|
1803
|
-
createdBy: string;
|
|
1804
|
-
updatedAt: Date | string;
|
|
1805
|
-
updatedBy: string;
|
|
1806
|
-
deletedAt: Date | string | null;
|
|
1807
|
-
deletedBy: string | null;
|
|
1808
|
-
};
|
|
1809
|
-
type DailyReportInternalRow = {
|
|
1810
|
-
hubId: number;
|
|
1811
|
-
body: string | null;
|
|
1812
|
-
metadata: string | null;
|
|
1813
|
-
createdAt: Date | string;
|
|
1814
|
-
createdBy: string;
|
|
1815
|
-
updatedAt: Date | string;
|
|
1816
|
-
updatedBy: string;
|
|
1817
|
-
};
|
|
1818
1793
|
type DailyReportUserStatusRow = {
|
|
1819
1794
|
hubId: number;
|
|
1820
1795
|
userId: number;
|
|
@@ -1888,9 +1863,9 @@ type DailyReportIdsSource = {
|
|
|
1888
1863
|
readonly streamAnchor: string | null;
|
|
1889
1864
|
readonly snapshot: string;
|
|
1890
1865
|
};
|
|
1866
|
+
declare const buildDailyReportSseStreamKey: (baseKey: string) => string;
|
|
1891
1867
|
declare function createDailyReportService(config: DailyReportServiceConfig): {
|
|
1892
1868
|
streamKey: string;
|
|
1893
|
-
streamMaxLen: number;
|
|
1894
1869
|
attachmentDelivery: Readonly<{
|
|
1895
1870
|
idCodec: DailyReportIdCodec;
|
|
1896
1871
|
read: DailyReportReadAttachment;
|
|
@@ -1945,10 +1920,6 @@ declare function createDailyReportService(config: DailyReportServiceConfig): {
|
|
|
1945
1920
|
}, clientTempId: DailyReportClientTempId) => Promise<void>;
|
|
1946
1921
|
publishDailyReport: (reportHubId: number, userId: number, clientTempId: DailyReportClientTempId) => Promise<DailyReportDetail | null>;
|
|
1947
1922
|
deleteDailyReport: (reportHubId: number, userId: number, clientTempId: DailyReportClientTempId) => Promise<void>;
|
|
1948
|
-
findDailyReportHubById: (tx: DailyReportDb, reportHubId: number) => Promise<DailyReportHubRow[]>;
|
|
1949
|
-
updateDailyReportHub: (tx: DailyReportDb, reportHubId: number, data: Partial<DailyReportHubRow>) => Promise<void>;
|
|
1950
|
-
updateDailyReportInternal: (tx: DailyReportDb, hubId: number, data: Partial<DailyReportInternalRow>) => Promise<void>;
|
|
1951
|
-
deleteDailyReportLabel: (tx: DailyReportDb, hubId: number, labelId: number) => Promise<void>;
|
|
1952
1923
|
};
|
|
1953
1924
|
type DailyReportHandlersConfig = {
|
|
1954
1925
|
authenticate: DailyReportAuthenticate;
|
|
@@ -2128,4 +2099,4 @@ type DailyReportServer = DailyReportHandlers & {
|
|
|
2128
2099
|
knownSourceTypes: readonly string[];
|
|
2129
2100
|
};
|
|
2130
2101
|
declare function createDailyReportServer(config: DailyReportServerConfig): DailyReportServer;
|
|
2131
|
-
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
|
|
2102
|
+
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 ExternalReportFields as DailyReportExternalReportFields, type DailyReportExternalSource, type DailyReportHandlers, type DailyReportHandlersConfig, type DailyReportHubLabelTable, type DailyReportHubTable, type DailyReportIdCodec, type DailyReportIdsSource, 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 SharpLike as DailyReportSharpLike, type SharpPipelineLike as DailyReportSharpPipelineLike, type SqlResultCacheMissAdmission as DailyReportSqlResultCacheMissAdmission, type SqlResultCacheQueryOptions as DailyReportSqlResultCacheQueryOptions, type DailyReportSseEntryMessage, DailyReportSseReader, type DailyReportSseReaderConfig, type DailyReportSseReaderPort, type StreamEntry as DailyReportSseStreamEntry, type DailyReportTables, type DailyReportUserStatusRow, type DailyReportUserStatusTable, type DailyReportUserTable, DailyReportViewerScope, type DailyReportVisibilityDimensions, type DailyReportVisibilityResolveContext, type DailyReportVisibilityResolveReason, type VisibleSourceTypeSet as DailyReportVisibleSourceTypeSet, type DailyReportVisibleSourceTypes, SqlResultCache, buildDailyReportSseStreamKey, createDailyReportHandlers, createDailyReportServer, createDailyReportService, createEpochStore, createSharpThumbnailRenderer, defineDailyReportSchema, defineDailyReportSearchSchema, isStreamIdLte, parseClientTempId, predictSharpThumbnailWorkingSetBytes, readSseStreamEntry as readDailyReportSseStreamEntry, transformJsonArray };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { d as DailyReportSseMessage,
|
|
2
|
-
export {
|
|
1
|
+
import { d as DailyReportSseMessage, q as DailyReportInterviewer, k as DailyReportExternalComment, D as DailyReportItem, e as DailyReportDetail, j as DailyReportAttachmentSummary, s as DailyReportPostedComment } from "./sse-schema-CUiQKk8K.js";
|
|
2
|
+
export { x as encodeIdsStreamRows } from "./sse-schema-CUiQKk8K.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,
|
|
6
|
-
export {
|
|
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";
|
|
7
7
|
import { TransactionRetryOptions } from "@aiquants/mssql";
|
|
8
8
|
import { b as DailyReportSearchFacets } from "./search-filters-wire-5MWi6GWu.js";
|
|
9
9
|
import { SQL } from "drizzle-orm";
|
|
10
|
-
import "zod";
|
|
10
|
+
import "zod/v3";
|
|
11
11
|
type RedisStreamMessage = {
|
|
12
12
|
id: string;
|
|
13
13
|
message: Record<string, string>;
|
|
@@ -162,10 +162,10 @@ declare class SqlResultCache {
|
|
|
162
162
|
private readonly maxBuckets;
|
|
163
163
|
private readonly maxBytes;
|
|
164
164
|
private lastSweepAt;
|
|
165
|
-
constructor(
|
|
166
|
-
readonly defaultTtlMs
|
|
167
|
-
readonly maxBuckets
|
|
168
|
-
readonly maxBytes
|
|
165
|
+
constructor(options: {
|
|
166
|
+
readonly defaultTtlMs?: number;
|
|
167
|
+
readonly maxBuckets?: number;
|
|
168
|
+
readonly maxBytes?: number;
|
|
169
169
|
}, epochStore: EpochStore);
|
|
170
170
|
private dropBucket;
|
|
171
171
|
private writeBucket;
|
|
@@ -1790,31 +1790,6 @@ type DailyReportSearchReconcileOptions = {
|
|
|
1790
1790
|
readonly signal?: AbortSignal;
|
|
1791
1791
|
readonly onProgress?: (progress: DailyReportSearchReconcileProgress) => void;
|
|
1792
1792
|
};
|
|
1793
|
-
type DailyReportHubRow = {
|
|
1794
|
-
id: number;
|
|
1795
|
-
sourceType: string;
|
|
1796
|
-
sourceId: string;
|
|
1797
|
-
sourceIdNum: number | null;
|
|
1798
|
-
businessDate: Date | string | null;
|
|
1799
|
-
userId: number | null;
|
|
1800
|
-
title: string | null;
|
|
1801
|
-
summary: string | null;
|
|
1802
|
-
createdAt: Date | string;
|
|
1803
|
-
createdBy: string;
|
|
1804
|
-
updatedAt: Date | string;
|
|
1805
|
-
updatedBy: string;
|
|
1806
|
-
deletedAt: Date | string | null;
|
|
1807
|
-
deletedBy: string | null;
|
|
1808
|
-
};
|
|
1809
|
-
type DailyReportInternalRow = {
|
|
1810
|
-
hubId: number;
|
|
1811
|
-
body: string | null;
|
|
1812
|
-
metadata: string | null;
|
|
1813
|
-
createdAt: Date | string;
|
|
1814
|
-
createdBy: string;
|
|
1815
|
-
updatedAt: Date | string;
|
|
1816
|
-
updatedBy: string;
|
|
1817
|
-
};
|
|
1818
1793
|
type DailyReportUserStatusRow = {
|
|
1819
1794
|
hubId: number;
|
|
1820
1795
|
userId: number;
|
|
@@ -1888,9 +1863,9 @@ type DailyReportIdsSource = {
|
|
|
1888
1863
|
readonly streamAnchor: string | null;
|
|
1889
1864
|
readonly snapshot: string;
|
|
1890
1865
|
};
|
|
1866
|
+
declare const buildDailyReportSseStreamKey: (baseKey: string) => string;
|
|
1891
1867
|
declare function createDailyReportService(config: DailyReportServiceConfig): {
|
|
1892
1868
|
streamKey: string;
|
|
1893
|
-
streamMaxLen: number;
|
|
1894
1869
|
attachmentDelivery: Readonly<{
|
|
1895
1870
|
idCodec: DailyReportIdCodec;
|
|
1896
1871
|
read: DailyReportReadAttachment;
|
|
@@ -1945,10 +1920,6 @@ declare function createDailyReportService(config: DailyReportServiceConfig): {
|
|
|
1945
1920
|
}, clientTempId: DailyReportClientTempId) => Promise<void>;
|
|
1946
1921
|
publishDailyReport: (reportHubId: number, userId: number, clientTempId: DailyReportClientTempId) => Promise<DailyReportDetail | null>;
|
|
1947
1922
|
deleteDailyReport: (reportHubId: number, userId: number, clientTempId: DailyReportClientTempId) => Promise<void>;
|
|
1948
|
-
findDailyReportHubById: (tx: DailyReportDb, reportHubId: number) => Promise<DailyReportHubRow[]>;
|
|
1949
|
-
updateDailyReportHub: (tx: DailyReportDb, reportHubId: number, data: Partial<DailyReportHubRow>) => Promise<void>;
|
|
1950
|
-
updateDailyReportInternal: (tx: DailyReportDb, hubId: number, data: Partial<DailyReportInternalRow>) => Promise<void>;
|
|
1951
|
-
deleteDailyReportLabel: (tx: DailyReportDb, hubId: number, labelId: number) => Promise<void>;
|
|
1952
1923
|
};
|
|
1953
1924
|
type DailyReportHandlersConfig = {
|
|
1954
1925
|
authenticate: DailyReportAuthenticate;
|
|
@@ -2128,4 +2099,4 @@ type DailyReportServer = DailyReportHandlers & {
|
|
|
2128
2099
|
knownSourceTypes: readonly string[];
|
|
2129
2100
|
};
|
|
2130
2101
|
declare function createDailyReportServer(config: DailyReportServerConfig): DailyReportServer;
|
|
2131
|
-
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
|
|
2102
|
+
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 ExternalReportFields as DailyReportExternalReportFields, type DailyReportExternalSource, type DailyReportHandlers, type DailyReportHandlersConfig, type DailyReportHubLabelTable, type DailyReportHubTable, type DailyReportIdCodec, type DailyReportIdsSource, 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 SharpLike as DailyReportSharpLike, type SharpPipelineLike as DailyReportSharpPipelineLike, type SqlResultCacheMissAdmission as DailyReportSqlResultCacheMissAdmission, type SqlResultCacheQueryOptions as DailyReportSqlResultCacheQueryOptions, type DailyReportSseEntryMessage, DailyReportSseReader, type DailyReportSseReaderConfig, type DailyReportSseReaderPort, type StreamEntry as DailyReportSseStreamEntry, type DailyReportTables, type DailyReportUserStatusRow, type DailyReportUserStatusTable, type DailyReportUserTable, DailyReportViewerScope, type DailyReportVisibilityDimensions, type DailyReportVisibilityResolveContext, type DailyReportVisibilityResolveReason, type VisibleSourceTypeSet as DailyReportVisibleSourceTypeSet, type DailyReportVisibleSourceTypes, SqlResultCache, buildDailyReportSseStreamKey, createDailyReportHandlers, createDailyReportServer, createDailyReportService, createEpochStore, createSharpThumbnailRenderer, defineDailyReportSchema, defineDailyReportSearchSchema, isStreamIdLte, parseClientTempId, predictSharpThumbnailWorkingSetBytes, readSseStreamEntry as readDailyReportSseStreamEntry, transformJsonArray };
|