@aiquants/daily-report 0.28.0 → 0.29.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 +47 -1
- package/README.md +119 -50
- package/dist/client.d.mts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +5 -5
- package/dist/client.mjs +5 -5
- package/dist/{ids-stream-BR5RSj5u.d.ts → comment-adapter-5bAtR4qb.d.ts} +2 -22
- package/dist/{ids-stream-DvB2h1dj.d.mts → comment-adapter-lV2ZB_vH.d.mts} +2 -22
- package/dist/{types-DkERw8NE.d.mts → ids-stream-CWuIDrIO.d.mts} +22 -1
- package/dist/{types-DkERw8NE.d.ts → ids-stream-CWuIDrIO.d.ts} +22 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/server.d.mts +3 -2
- package/dist/server.d.ts +3 -2
- package/dist/server.js +4 -4
- package/dist/server.mjs +4 -4
- package/dist/styles/daily-report.standalone.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { e as DailyReportExternalComment, i as DailyReportPostedComment } from "./ids-stream-CWuIDrIO.js";
|
|
3
3
|
declare const DAILY_REPORT_SSE_TERMINAL_EVENTS: readonly [
|
|
4
4
|
"auth-required",
|
|
5
5
|
"forbidden",
|
|
@@ -2491,24 +2491,4 @@ type UIComment = {
|
|
|
2491
2491
|
isLegacy: boolean;
|
|
2492
2492
|
};
|
|
2493
2493
|
declare const mergeComments: (legacyComments: DailyReportExternalComment[], modernComments: DailyReportPostedComment[], currentUserId: string | null | undefined, unknownAuthorName: string) => UIComment[];
|
|
2494
|
-
type
|
|
2495
|
-
businessDate: string | null;
|
|
2496
|
-
reportHubId: number;
|
|
2497
|
-
};
|
|
2498
|
-
type DailyReportIdsStreamChunkLine = {
|
|
2499
|
-
kind: "chunk";
|
|
2500
|
-
items: DailyReportItem[];
|
|
2501
|
-
nextCursor: DailyReportIdsStreamCursor | null;
|
|
2502
|
-
isLast: boolean;
|
|
2503
|
-
total?: number;
|
|
2504
|
-
provisional?: boolean;
|
|
2505
|
-
snapshot?: string;
|
|
2506
|
-
restarted?: boolean;
|
|
2507
|
-
streamAnchor?: string | null;
|
|
2508
|
-
};
|
|
2509
|
-
type DailyReportSseStreamAnchor = {
|
|
2510
|
-
readonly lastEventId: string | null;
|
|
2511
|
-
readonly revision: number;
|
|
2512
|
-
};
|
|
2513
|
-
declare const isIdsStreamChunkLine: (line: unknown) => line is DailyReportIdsStreamChunkLine;
|
|
2514
|
-
export { type DailyReportSseTerminalEvent as D, type UIComment as U, type DailyReportSseMessage as a, type DailyReportSseStreamAnchor as b, DAILY_REPORT_SSE_CURSOR_PARAM as c, DAILY_REPORT_SSE_HEARTBEAT_MS as d, DAILY_REPORT_SSE_TERMINAL_EVENTS as e, type DailyReportIdsStreamChunkLine as f, commentAddMessageSchema as g, commentDeleteMessageSchema as h, connectedMessageSchema as i, dailyReportDetailSchema as j, dailyReportExternalCommentSchema as k, dailyReportInterviewerSchema as l, dailyReportLabelDefSchema as m, dailyReportPostedCommentSchema as n, dailyReportSseMessageSchema as o, isDailyReportSseStreamId as p, isIdsStreamChunkLine as q, mergeComments as r, reportCreateMessageSchema as s, reportDeleteMessageSchema as t, reportPublishMessageSchema as u, reportUpdateMessageSchema as v, statusUpdateMessageSchema as w };
|
|
2494
|
+
export { type DailyReportSseTerminalEvent as D, type UIComment as U, type DailyReportSseMessage as a, DAILY_REPORT_SSE_CURSOR_PARAM as b, DAILY_REPORT_SSE_HEARTBEAT_MS as c, DAILY_REPORT_SSE_TERMINAL_EVENTS as d, commentAddMessageSchema as e, commentDeleteMessageSchema as f, connectedMessageSchema as g, dailyReportDetailSchema as h, dailyReportExternalCommentSchema as i, dailyReportInterviewerSchema as j, dailyReportLabelDefSchema as k, dailyReportPostedCommentSchema as l, dailyReportSseMessageSchema as m, isDailyReportSseStreamId as n, mergeComments as o, reportDeleteMessageSchema as p, reportPublishMessageSchema as q, reportCreateMessageSchema as r, reportUpdateMessageSchema as s, statusUpdateMessageSchema as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { e as DailyReportExternalComment, i as DailyReportPostedComment } from "./ids-stream-CWuIDrIO.mjs";
|
|
3
3
|
declare const DAILY_REPORT_SSE_TERMINAL_EVENTS: readonly [
|
|
4
4
|
"auth-required",
|
|
5
5
|
"forbidden",
|
|
@@ -2491,24 +2491,4 @@ type UIComment = {
|
|
|
2491
2491
|
isLegacy: boolean;
|
|
2492
2492
|
};
|
|
2493
2493
|
declare const mergeComments: (legacyComments: DailyReportExternalComment[], modernComments: DailyReportPostedComment[], currentUserId: string | null | undefined, unknownAuthorName: string) => UIComment[];
|
|
2494
|
-
type
|
|
2495
|
-
businessDate: string | null;
|
|
2496
|
-
reportHubId: number;
|
|
2497
|
-
};
|
|
2498
|
-
type DailyReportIdsStreamChunkLine = {
|
|
2499
|
-
kind: "chunk";
|
|
2500
|
-
items: DailyReportItem[];
|
|
2501
|
-
nextCursor: DailyReportIdsStreamCursor | null;
|
|
2502
|
-
isLast: boolean;
|
|
2503
|
-
total?: number;
|
|
2504
|
-
provisional?: boolean;
|
|
2505
|
-
snapshot?: string;
|
|
2506
|
-
restarted?: boolean;
|
|
2507
|
-
streamAnchor?: string | null;
|
|
2508
|
-
};
|
|
2509
|
-
type DailyReportSseStreamAnchor = {
|
|
2510
|
-
readonly lastEventId: string | null;
|
|
2511
|
-
readonly revision: number;
|
|
2512
|
-
};
|
|
2513
|
-
declare const isIdsStreamChunkLine: (line: unknown) => line is DailyReportIdsStreamChunkLine;
|
|
2514
|
-
export { type DailyReportSseTerminalEvent as D, type UIComment as U, type DailyReportSseMessage as a, type DailyReportSseStreamAnchor as b, DAILY_REPORT_SSE_CURSOR_PARAM as c, DAILY_REPORT_SSE_HEARTBEAT_MS as d, DAILY_REPORT_SSE_TERMINAL_EVENTS as e, type DailyReportIdsStreamChunkLine as f, commentAddMessageSchema as g, commentDeleteMessageSchema as h, connectedMessageSchema as i, dailyReportDetailSchema as j, dailyReportExternalCommentSchema as k, dailyReportInterviewerSchema as l, dailyReportLabelDefSchema as m, dailyReportPostedCommentSchema as n, dailyReportSseMessageSchema as o, isDailyReportSseStreamId as p, isIdsStreamChunkLine as q, mergeComments as r, reportCreateMessageSchema as s, reportDeleteMessageSchema as t, reportPublishMessageSchema as u, reportUpdateMessageSchema as v, statusUpdateMessageSchema as w };
|
|
2494
|
+
export { type DailyReportSseTerminalEvent as D, type UIComment as U, type DailyReportSseMessage as a, DAILY_REPORT_SSE_CURSOR_PARAM as b, DAILY_REPORT_SSE_HEARTBEAT_MS as c, DAILY_REPORT_SSE_TERMINAL_EVENTS as d, commentAddMessageSchema as e, commentDeleteMessageSchema as f, connectedMessageSchema as g, dailyReportDetailSchema as h, dailyReportExternalCommentSchema as i, dailyReportInterviewerSchema as j, dailyReportLabelDefSchema as k, dailyReportPostedCommentSchema as l, dailyReportSseMessageSchema as m, isDailyReportSseStreamId as n, mergeComments as o, reportDeleteMessageSchema as p, reportPublishMessageSchema as q, reportCreateMessageSchema as r, reportUpdateMessageSchema as s, statusUpdateMessageSchema as t };
|
|
@@ -71,4 +71,25 @@ type DailyReportUser = {
|
|
|
71
71
|
value: string;
|
|
72
72
|
}[];
|
|
73
73
|
};
|
|
74
|
-
|
|
74
|
+
declare const DAILY_REPORT_IDS_STREAM_ENDPOINT = "ids-stream";
|
|
75
|
+
type DailyReportIdsStreamCursor = {
|
|
76
|
+
businessDate: string | null;
|
|
77
|
+
reportHubId: number;
|
|
78
|
+
};
|
|
79
|
+
type DailyReportIdsStreamChunkLine = {
|
|
80
|
+
kind: "chunk";
|
|
81
|
+
items: DailyReportItem[];
|
|
82
|
+
nextCursor: DailyReportIdsStreamCursor | null;
|
|
83
|
+
isLast: boolean;
|
|
84
|
+
total?: number;
|
|
85
|
+
provisional?: boolean;
|
|
86
|
+
snapshot?: string;
|
|
87
|
+
restarted?: boolean;
|
|
88
|
+
streamAnchor?: string | null;
|
|
89
|
+
};
|
|
90
|
+
type DailyReportSseStreamAnchor = {
|
|
91
|
+
readonly lastEventId: string | null;
|
|
92
|
+
readonly revision: number;
|
|
93
|
+
};
|
|
94
|
+
declare const isIdsStreamChunkLine: (line: unknown) => line is DailyReportIdsStreamChunkLine;
|
|
95
|
+
export { type DailyReportItem as D, type DailyReportUser as a, type DailyReportDetail as b, type DailyReportSseStreamAnchor as c, type DailyReportAttachmentSummary as d, type DailyReportExternalComment as e, type DailyReportIdsStreamChunkLine as f, type DailyReportInterviewer as g, type DailyReportLabelDef as h, type DailyReportPostedComment as i, isIdsStreamChunkLine as j, DAILY_REPORT_IDS_STREAM_ENDPOINT as k };
|
|
@@ -71,4 +71,25 @@ type DailyReportUser = {
|
|
|
71
71
|
value: string;
|
|
72
72
|
}[];
|
|
73
73
|
};
|
|
74
|
-
|
|
74
|
+
declare const DAILY_REPORT_IDS_STREAM_ENDPOINT = "ids-stream";
|
|
75
|
+
type DailyReportIdsStreamCursor = {
|
|
76
|
+
businessDate: string | null;
|
|
77
|
+
reportHubId: number;
|
|
78
|
+
};
|
|
79
|
+
type DailyReportIdsStreamChunkLine = {
|
|
80
|
+
kind: "chunk";
|
|
81
|
+
items: DailyReportItem[];
|
|
82
|
+
nextCursor: DailyReportIdsStreamCursor | null;
|
|
83
|
+
isLast: boolean;
|
|
84
|
+
total?: number;
|
|
85
|
+
provisional?: boolean;
|
|
86
|
+
snapshot?: string;
|
|
87
|
+
restarted?: boolean;
|
|
88
|
+
streamAnchor?: string | null;
|
|
89
|
+
};
|
|
90
|
+
type DailyReportSseStreamAnchor = {
|
|
91
|
+
readonly lastEventId: string | null;
|
|
92
|
+
readonly revision: number;
|
|
93
|
+
};
|
|
94
|
+
declare const isIdsStreamChunkLine: (line: unknown) => line is DailyReportIdsStreamChunkLine;
|
|
95
|
+
export { type DailyReportItem as D, type DailyReportUser as a, type DailyReportDetail as b, type DailyReportSseStreamAnchor as c, type DailyReportAttachmentSummary as d, type DailyReportExternalComment as e, type DailyReportIdsStreamChunkLine as f, type DailyReportInterviewer as g, type DailyReportLabelDef as h, type DailyReportPostedComment as i, isIdsStreamChunkLine as j, DAILY_REPORT_IDS_STREAM_ENDPOINT as k };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { b as DAILY_REPORT_SSE_CURSOR_PARAM, c as DAILY_REPORT_SSE_HEARTBEAT_MS, d as DAILY_REPORT_SSE_TERMINAL_EVENTS, a as DailyReportSseMessage, e as commentAddMessageSchema, f as commentDeleteMessageSchema, g as connectedMessageSchema, h as dailyReportDetailSchema, i as dailyReportExternalCommentSchema, j as dailyReportInterviewerSchema, k as dailyReportLabelDefSchema, l as dailyReportPostedCommentSchema, m as dailyReportSseMessageSchema, n as isDailyReportSseStreamId, o as mergeComments, r as reportCreateMessageSchema, p as reportDeleteMessageSchema, q as reportPublishMessageSchema, s as reportUpdateMessageSchema, t as statusUpdateMessageSchema } from "./comment-adapter-lV2ZB_vH.mjs";
|
|
2
|
+
export { d as DailyReportAttachmentSummary, b as DailyReportDetail, e as DailyReportExternalComment, f as DailyReportIdsStreamChunkLine, g as DailyReportInterviewer, D as DailyReportItem, h as DailyReportLabelDef, i as DailyReportPostedComment, c as DailyReportSseStreamAnchor, a as DailyReportUser, j as isIdsStreamChunkLine } from "./ids-stream-CWuIDrIO.mjs";
|
|
3
3
|
import "zod";
|
|
4
4
|
type DailyReportAttachmentThumbnailBox = {
|
|
5
5
|
readonly maxWidth: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { b as DAILY_REPORT_SSE_CURSOR_PARAM, c as DAILY_REPORT_SSE_HEARTBEAT_MS, d as DAILY_REPORT_SSE_TERMINAL_EVENTS, a as DailyReportSseMessage, e as commentAddMessageSchema, f as commentDeleteMessageSchema, g as connectedMessageSchema, h as dailyReportDetailSchema, i as dailyReportExternalCommentSchema, j as dailyReportInterviewerSchema, k as dailyReportLabelDefSchema, l as dailyReportPostedCommentSchema, m as dailyReportSseMessageSchema, n as isDailyReportSseStreamId, o as mergeComments, r as reportCreateMessageSchema, p as reportDeleteMessageSchema, q as reportPublishMessageSchema, s as reportUpdateMessageSchema, t as statusUpdateMessageSchema } from "./comment-adapter-5bAtR4qb.js";
|
|
2
|
+
export { d as DailyReportAttachmentSummary, b as DailyReportDetail, e as DailyReportExternalComment, f as DailyReportIdsStreamChunkLine, g as DailyReportInterviewer, D as DailyReportItem, h as DailyReportLabelDef, i as DailyReportPostedComment, c as DailyReportSseStreamAnchor, a as DailyReportUser, j as isIdsStreamChunkLine } from "./ids-stream-CWuIDrIO.js";
|
|
3
3
|
import "zod";
|
|
4
4
|
type DailyReportAttachmentThumbnailBox = {
|
|
5
5
|
readonly maxWidth: number;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var q=(t,r)=>{for(var n in r)p(t,n,{get:r[n],enumerable:!0})},F=(t,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of z(r))!Y.call(t,i)&&i!==n&&p(t,i,{get:()=>r[i],enumerable:!(o=V(r,i))||o.enumerable});return t};var K=t=>F(p({},"__esModule",{value:!0}),t);var ee={};q(ee,{DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS:()=>u,DAILY_REPORT_SSE_CURSOR_PARAM:()=>
|
|
1
|
+
"use strict";var p=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var q=(t,r)=>{for(var n in r)p(t,n,{get:r[n],enumerable:!0})},F=(t,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of z(r))!Y.call(t,i)&&i!==n&&p(t,i,{get:()=>r[i],enumerable:!(o=V(r,i))||o.enumerable});return t};var K=t=>F(p({},"__esModule",{value:!0}),t);var ee={};q(ee,{DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS:()=>u,DAILY_REPORT_SSE_CURSOR_PARAM:()=>H,DAILY_REPORT_SSE_HEARTBEAT_MS:()=>U,DAILY_REPORT_SSE_TERMINAL_EVENTS:()=>O,buildDailyReportAttachmentUrl:()=>E,commentAddMessageSchema:()=>D,commentDeleteMessageSchema:()=>b,connectedMessageSchema:()=>h,dailyReportDetailSchema:()=>s,dailyReportExternalCommentSchema:()=>c,dailyReportInterviewerSchema:()=>d,dailyReportLabelDefSchema:()=>y,dailyReportPostedCommentSchema:()=>m,dailyReportSseMessageSchema:()=>j,isDailyReportAttachmentThumbnailVariant:()=>l,isDailyReportSseStreamId:()=>$,isIdsStreamChunkLine:()=>P,mergeComments:()=>N,normalizeBusinessDateKey:()=>L,parseDailyReportAttachmentQuery:()=>M,reportCreateMessageSchema:()=>f,reportDeleteMessageSchema:()=>I,reportPublishMessageSchema:()=>S,reportUpdateMessageSchema:()=>x,statusUpdateMessageSchema:()=>g});module.exports=K(ee);var u=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),l=t=>Object.hasOwn(u,t);var A="download",T="thumbnail",_="1",E=(t,r,n)=>{let o=`${t}/attachment/${encodeURIComponent(r)}`;switch(n.kind){case"inline":return o;case"download":return`${o}?${new URLSearchParams({[A]:_})}`;case"thumbnail":return`${o}?${new URLSearchParams({[T]:n.variant})}`}},M=t=>{let r=t.getAll(T),n=t.getAll(A);if(r.length>0&&n.length>0)return{kind:"invalid",reason:"conflict"};if(r.length>0){let[o]=r;return r.length===1&&l(o)?{kind:"thumbnail",variant:o}:{kind:"invalid",reason:"thumbnail_variant"}}return n.length>0?n.length===1&&n[0]===_?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var Q=/^\d{4}-\d{2}-\d{2}$/,W=/^\d{4}\/\d{2}\/\d{2}$/,C=t=>t<10?`0${t}`:`${t}`,k=t=>{if(Number.isNaN(t.getTime()))return null;let r=t.getFullYear(),n=C(t.getMonth()+1),o=C(t.getDate());return`${r}-${n}-${o}`};var L=t=>{if(t==null)return null;if(t instanceof Date)return k(t);let r=t.trim();if(r==="")return null;if(Q.test(r))return r;if(W.test(r))return r.replaceAll("/","-");let n=new Date(r);return k(n)};var J=t=>typeof t=="string"?JSON.stringify(t):typeof t=="number"||typeof t=="boolean"||t===null||t===void 0?String(t):Array.isArray(t)?"array":typeof t,w=(t,r,n)=>new RangeError(`[daily-report] ${t} must be ${r}; got ${J(n)}`);var N=(t,r,n,o)=>{if(typeof o!="string"||o.trim()==="")throw w("mergeComments: unknownAuthorName","a non-blank string",o);let i=t.map((a,B)=>({id:`legacy-${B}`,authorName:a.name||o,content:a.text||"",isMine:!1,color:a.color||void 0,isLegacy:!0})),v=r.map(a=>({id:a.id,authorName:a.userName||o,content:a.content??"",createdAt:a.createdAt??"",isMine:n?a.userId===n:a.isMine,isLegacy:!1}));return[...i,...v]};var G=t=>{if(typeof t!="object"||t===null)return"unknown";let r=t;return typeof r.kind=="string"?r.kind==="chunk"?"chunk":r.kind==="error"?"error":"unknown":Array.isArray(r.items)?"chunk":typeof r.error=="string"?"error":"unknown"},P=t=>G(t)==="chunk";var e=require("zod"),O=["auth-required","forbidden","resync-required"],U=15e3,H="lastEventId",X=/^\d{1,15}-\d{1,15}$/,$=t=>X.test(t),d=e.z.object({name:e.z.string().nullish(),affiliation:e.z.string().nullish()}),c=e.z.object({name:e.z.string().nullish(),text:e.z.string().nullish(),color:e.z.string().nullish()}),y=e.z.object({id:e.z.number(),name:e.z.string().nullish(),color:e.z.string().nullish()}),m=e.z.object({id:e.z.number(),userId:e.z.string().nullish(),userName:e.z.string().nullish(),content:e.z.string().nullish(),createdAt:e.z.string().nullish(),isMine:e.z.boolean()}),Z=e.z.object({id:e.z.string(),fileName:e.z.string(),fileType:e.z.string().nullable(),fileSize:e.z.number().nullable(),createdAt:e.z.string().nullable(),state:e.z.enum(["present","absent","unknown"]),hasThumbnail:e.z.boolean().default(!1)}),s=e.z.object({reportHubId:e.z.number(),date:e.z.string().nullish(),createdAt:e.z.string().nullish(),author:e.z.string().nullish(),userId:e.z.string().nullish(),sourceType:e.z.string().nullish(),employeeName:e.z.string().nullish(),updatedBy:e.z.string().nullish(),updatedAt:e.z.string().nullish(),category:e.z.string().nullish(),creationCategory:e.z.string().nullish(),visitTimeFrom:e.z.string().nullish(),visitTimeTo:e.z.string().nullish(),customerName:e.z.string().nullish(),interviewers:e.z.array(d),subject:e.z.string().nullish(),content:e.z.string().nullish(),externalComments:e.z.array(c),isRead:e.z.boolean(),isStarred:e.z.boolean(),labels:e.z.array(y),postedComments:e.z.array(m),attachments:e.z.array(Z).default([])}),h=e.z.object({type:e.z.literal("connected")}),g=e.z.object({type:e.z.literal("status-update"),reportHubId:e.z.number(),statusType:e.z.enum(["star","read"]),value:e.z.boolean(),clientTempId:e.z.string(),recipientRawUserId:e.z.number().optional()}),R=e.z.string().optional(),D=e.z.object({type:e.z.literal("comment-add"),reportHubId:e.z.number(),comment:m,clientTempId:e.z.string(),recipientRawUserId:e.z.number().optional(),sourceType:R}),b=e.z.object({type:e.z.literal("comment-delete"),reportHubId:e.z.number(),commentId:e.z.number(),clientTempId:e.z.string(),recipientRawUserId:e.z.number().optional(),sourceType:R}),f=e.z.object({type:e.z.literal("report-create"),reportHubId:e.z.number(),report:s,clientTempId:e.z.string(),recipientRawUserId:e.z.number().optional()}),x=e.z.object({type:e.z.literal("report-update"),reportHubId:e.z.number(),report:s,clientTempId:e.z.string(),recipientRawUserId:e.z.number().optional()}),S=e.z.object({type:e.z.literal("report-publish"),reportHubId:e.z.number(),report:s,clientTempId:e.z.string(),recipientRawUserId:e.z.number().optional()}),I=e.z.object({type:e.z.literal("report-delete"),reportHubId:e.z.number(),clientTempId:e.z.string(),sourceType:R}),j=e.z.discriminatedUnion("type",[h,g,D,b,f,x,S,I]);0&&(module.exports={DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS,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,isDailyReportAttachmentThumbnailVariant,isDailyReportSseStreamId,isIdsStreamChunkLine,mergeComments,normalizeBusinessDateKey,parseDailyReportAttachmentQuery,reportCreateMessageSchema,reportDeleteMessageSchema,reportPublishMessageSchema,reportUpdateMessageSchema,statusUpdateMessageSchema});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),s=t=>Object.hasOwn(p,t);var u="download",d="thumbnail",c="1",L=(t,r,n)=>{let o=`${t}/attachment/${encodeURIComponent(r)}`;switch(n.kind){case"inline":return o;case"download":return`${o}?${new URLSearchParams({[u]:c})}`;case"thumbnail":return`${o}?${new URLSearchParams({[d]:n.variant})}`}},w=t=>{let r=t.getAll(d),n=t.getAll(u);if(r.length>0&&n.length>0)return{kind:"invalid",reason:"conflict"};if(r.length>0){let[o]=r;return r.length===1&&s(o)?{kind:"thumbnail",variant:o}:{kind:"invalid",reason:"thumbnail_variant"}}return n.length>0?n.length===1&&n[0]===c?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var N=/^\d{4}-\d{2}-\d{2}$/,P=/^\d{4}\/\d{2}\/\d{2}$/,y=t=>t<10?`0${t}`:`${t}`,h=t=>{if(Number.isNaN(t.getTime()))return null;let r=t.getFullYear(),n=y(t.getMonth()+1),o=y(t.getDate());return`${r}-${n}-${o}`};var
|
|
1
|
+
var p=Object.freeze({tile:Object.freeze({maxWidth:480,maxHeight:320})}),s=t=>Object.hasOwn(p,t);var u="download",d="thumbnail",c="1",L=(t,r,n)=>{let o=`${t}/attachment/${encodeURIComponent(r)}`;switch(n.kind){case"inline":return o;case"download":return`${o}?${new URLSearchParams({[u]:c})}`;case"thumbnail":return`${o}?${new URLSearchParams({[d]:n.variant})}`}},w=t=>{let r=t.getAll(d),n=t.getAll(u);if(r.length>0&&n.length>0)return{kind:"invalid",reason:"conflict"};if(r.length>0){let[o]=r;return r.length===1&&s(o)?{kind:"thumbnail",variant:o}:{kind:"invalid",reason:"thumbnail_variant"}}return n.length>0?n.length===1&&n[0]===c?{kind:"download"}:{kind:"invalid",reason:"download_value"}:{kind:"inline"}};var N=/^\d{4}-\d{2}-\d{2}$/,P=/^\d{4}\/\d{2}\/\d{2}$/,y=t=>t<10?`0${t}`:`${t}`,h=t=>{if(Number.isNaN(t.getTime()))return null;let r=t.getFullYear(),n=y(t.getMonth()+1),o=y(t.getDate());return`${r}-${n}-${o}`};var O=t=>{if(t==null)return null;if(t instanceof Date)return h(t);let r=t.trim();if(r==="")return null;if(N.test(r))return r;if(P.test(r))return r.replaceAll("/","-");let n=new Date(r);return h(n)};var U=t=>typeof t=="string"?JSON.stringify(t):typeof t=="number"||typeof t=="boolean"||t===null||t===void 0?String(t):Array.isArray(t)?"array":typeof t,g=(t,r,n)=>new RangeError(`[daily-report] ${t} must be ${r}; got ${U(n)}`);var H=(t,r,n,o)=>{if(typeof o!="string"||o.trim()==="")throw g("mergeComments: unknownAuthorName","a non-blank string",o);let M=t.map((a,k)=>({id:`legacy-${k}`,authorName:a.name||o,content:a.text||"",isMine:!1,color:a.color||void 0,isLegacy:!0})),C=r.map(a=>({id:a.id,authorName:a.userName||o,content:a.content??"",createdAt:a.createdAt??"",isMine:n?a.userId===n:a.isMine,isLegacy:!1}));return[...M,...C]};var $=t=>{if(typeof t!="object"||t===null)return"unknown";let r=t;return typeof r.kind=="string"?r.kind==="chunk"?"chunk":r.kind==="error"?"error":"unknown":Array.isArray(r.items)?"chunk":typeof r.error=="string"?"error":"unknown"},j=t=>$(t)==="chunk";import{z as e}from"zod";var v=["auth-required","forbidden","resync-required"],B=15e3,V="lastEventId",z=/^\d{1,15}-\d{1,15}$/,Y=t=>z.test(t),R=e.object({name:e.string().nullish(),affiliation:e.string().nullish()}),D=e.object({name:e.string().nullish(),text:e.string().nullish(),color:e.string().nullish()}),b=e.object({id:e.number(),name:e.string().nullish(),color:e.string().nullish()}),l=e.object({id:e.number(),userId:e.string().nullish(),userName:e.string().nullish(),content:e.string().nullish(),createdAt:e.string().nullish(),isMine:e.boolean()}),q=e.object({id:e.string(),fileName:e.string(),fileType:e.string().nullable(),fileSize:e.number().nullable(),createdAt:e.string().nullable(),state:e.enum(["present","absent","unknown"]),hasThumbnail:e.boolean().default(!1)}),i=e.object({reportHubId:e.number(),date:e.string().nullish(),createdAt:e.string().nullish(),author:e.string().nullish(),userId:e.string().nullish(),sourceType:e.string().nullish(),employeeName:e.string().nullish(),updatedBy:e.string().nullish(),updatedAt:e.string().nullish(),category:e.string().nullish(),creationCategory:e.string().nullish(),visitTimeFrom:e.string().nullish(),visitTimeTo:e.string().nullish(),customerName:e.string().nullish(),interviewers:e.array(R),subject:e.string().nullish(),content:e.string().nullish(),externalComments:e.array(D),isRead:e.boolean(),isStarred:e.boolean(),labels:e.array(b),postedComments:e.array(l),attachments:e.array(q).default([])}),f=e.object({type:e.literal("connected")}),x=e.object({type:e.literal("status-update"),reportHubId:e.number(),statusType:e.enum(["star","read"]),value:e.boolean(),clientTempId:e.string(),recipientRawUserId:e.number().optional()}),m=e.string().optional(),S=e.object({type:e.literal("comment-add"),reportHubId:e.number(),comment:l,clientTempId:e.string(),recipientRawUserId:e.number().optional(),sourceType:m}),I=e.object({type:e.literal("comment-delete"),reportHubId:e.number(),commentId:e.number(),clientTempId:e.string(),recipientRawUserId:e.number().optional(),sourceType:m}),A=e.object({type:e.literal("report-create"),reportHubId:e.number(),report:i,clientTempId:e.string(),recipientRawUserId:e.number().optional()}),T=e.object({type:e.literal("report-update"),reportHubId:e.number(),report:i,clientTempId:e.string(),recipientRawUserId:e.number().optional()}),_=e.object({type:e.literal("report-publish"),reportHubId:e.number(),report:i,clientTempId:e.string(),recipientRawUserId:e.number().optional()}),E=e.object({type:e.literal("report-delete"),reportHubId:e.number(),clientTempId:e.string(),sourceType:m}),F=e.discriminatedUnion("type",[f,x,S,I,A,T,_,E]);export{p as DAILY_REPORT_ATTACHMENT_THUMBNAIL_VARIANTS,V as DAILY_REPORT_SSE_CURSOR_PARAM,B as DAILY_REPORT_SSE_HEARTBEAT_MS,v as DAILY_REPORT_SSE_TERMINAL_EVENTS,L as buildDailyReportAttachmentUrl,S as commentAddMessageSchema,I as commentDeleteMessageSchema,f as connectedMessageSchema,i as dailyReportDetailSchema,D as dailyReportExternalCommentSchema,R as dailyReportInterviewerSchema,b as dailyReportLabelDefSchema,l as dailyReportPostedCommentSchema,F as dailyReportSseMessageSchema,s as isDailyReportAttachmentThumbnailVariant,Y as isDailyReportSseStreamId,j as isIdsStreamChunkLine,H as mergeComments,O as normalizeBusinessDateKey,w as parseDailyReportAttachmentQuery,A as reportCreateMessageSchema,E as reportDeleteMessageSchema,_ as reportPublishMessageSchema,T as reportUpdateMessageSchema,x as statusUpdateMessageSchema};
|
package/dist/server.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as DailyReportInterviewer, e as DailyReportExternalComment, D as DailyReportItem, b as DailyReportDetail, d as DailyReportAttachmentSummary, i as DailyReportPostedComment } from "./ids-stream-CWuIDrIO.mjs";
|
|
2
|
+
export { k as DAILY_REPORT_IDS_STREAM_ENDPOINT } from "./ids-stream-CWuIDrIO.mjs";
|
|
2
3
|
import { TransactionRetryOptions } from "@aiquants/mssql";
|
|
3
4
|
import * as drizzle_orm_mssql_core from "drizzle-orm/mssql-core";
|
|
4
5
|
import { AnyMsSqlColumn } from "drizzle-orm/mssql-core";
|
|
@@ -85,7 +86,7 @@ type DailyReportIdCodec = {
|
|
|
85
86
|
encode: (id: number) => string;
|
|
86
87
|
decode: (token: string) => number | null;
|
|
87
88
|
};
|
|
88
|
-
type DailyReportAttachmentFailure = "not_found" | "denied" | "too_large" | "invalid_path" | "unavailable";
|
|
89
|
+
type DailyReportAttachmentFailure = "not_found" | "denied" | "too_large" | "invalid_path" | "unavailable" | "busy" | "deadline";
|
|
89
90
|
type DailyReportAttachmentBytes = {
|
|
90
91
|
ok: true;
|
|
91
92
|
bytes: Uint8Array<ArrayBuffer>;
|
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as DailyReportInterviewer, e as DailyReportExternalComment, D as DailyReportItem, b as DailyReportDetail, d as DailyReportAttachmentSummary, i as DailyReportPostedComment } from "./ids-stream-CWuIDrIO.js";
|
|
2
|
+
export { k as DAILY_REPORT_IDS_STREAM_ENDPOINT } from "./ids-stream-CWuIDrIO.js";
|
|
2
3
|
import { TransactionRetryOptions } from "@aiquants/mssql";
|
|
3
4
|
import * as drizzle_orm_mssql_core from "drizzle-orm/mssql-core";
|
|
4
5
|
import { AnyMsSqlColumn } from "drizzle-orm/mssql-core";
|
|
@@ -85,7 +86,7 @@ type DailyReportIdCodec = {
|
|
|
85
86
|
encode: (id: number) => string;
|
|
86
87
|
decode: (token: string) => number | null;
|
|
87
88
|
};
|
|
88
|
-
type DailyReportAttachmentFailure = "not_found" | "denied" | "too_large" | "invalid_path" | "unavailable";
|
|
89
|
+
type DailyReportAttachmentFailure = "not_found" | "denied" | "too_large" | "invalid_path" | "unavailable" | "busy" | "deadline";
|
|
89
90
|
type DailyReportAttachmentBytes = {
|
|
90
91
|
ok: true;
|
|
91
92
|
bytes: Uint8Array<ArrayBuffer>;
|