@aiquants/daily-report 0.32.0 → 0.34.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 +106 -0
- package/README.md +155 -55
- package/dist/client.d.mts +111 -111
- package/dist/client.d.ts +111 -111
- package/dist/client.js +4 -4
- package/dist/client.mjs +4 -4
- package/dist/comment-adapter-7TduiLiu.d.mts +127 -0
- package/dist/comment-adapter-BLfjD6P0.d.ts +127 -0
- package/dist/index.d.mts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/server.d.mts +33 -14
- package/dist/server.d.ts +33 -14
- package/dist/server.js +4 -4
- package/dist/server.mjs +4 -4
- package/dist/{ids-stream-BR5RSj5u.d.ts → sse-schema-DVIUaiAG.d.mts} +685 -643
- package/dist/{ids-stream-DvB2h1dj.d.mts → sse-schema-DVIUaiAG.d.ts} +685 -643
- package/dist/styles/daily-report.standalone.css +1 -1
- package/package.json +5 -4
- package/dist/types-DkERw8NE.d.mts +0 -74
- package/dist/types-DkERw8NE.d.ts +0 -74
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { c as DailyReportSseMessage, j as DailyReportInterviewer, i as DailyReportExternalComment, D as DailyReportItem, d as DailyReportDetail, h as DailyReportAttachmentSummary, l as DailyReportPostedComment } from "./sse-schema-DVIUaiAG.js";
|
|
1
2
|
import * as drizzle_orm_mssql_core from "drizzle-orm/mssql-core";
|
|
2
3
|
import { AnyMsSqlColumn } from "drizzle-orm/mssql-core";
|
|
3
|
-
import { e as DailyReportInterviewer, d as DailyReportExternalComment, D as DailyReportItem, b as DailyReportDetail, c as DailyReportAttachmentSummary, g as DailyReportPostedComment } from "./types-DkERw8NE.js";
|
|
4
4
|
import { TransactionRetryOptions } from "@aiquants/mssql";
|
|
5
|
+
import "zod";
|
|
5
6
|
type RedisStreamMessage = {
|
|
6
7
|
id: string;
|
|
7
8
|
message: Record<string, string>;
|
|
@@ -36,9 +37,14 @@ type DailyReportRedisProvider = {
|
|
|
36
37
|
getClient(): Promise<DailyReportRedisClient | undefined>;
|
|
37
38
|
createClient(): Promise<DailyReportRedisBlockingClient | undefined>;
|
|
38
39
|
};
|
|
40
|
+
type DailyReportSseEntryMessage = {
|
|
41
|
+
readonly parsed: DailyReportSseMessage;
|
|
42
|
+
readonly published: Readonly<Record<string, unknown>>;
|
|
43
|
+
readonly text: string;
|
|
44
|
+
};
|
|
39
45
|
type StreamEntry = {
|
|
40
|
-
id: string;
|
|
41
|
-
message:
|
|
46
|
+
readonly id: string;
|
|
47
|
+
readonly message: DailyReportSseEntryMessage | null;
|
|
42
48
|
};
|
|
43
49
|
type DailyReportSseReaderPort = {
|
|
44
50
|
ready(): Promise<void>;
|
|
@@ -141,10 +147,14 @@ declare class SqlResultCache {
|
|
|
141
147
|
private readonly epochStore;
|
|
142
148
|
private readonly buckets;
|
|
143
149
|
private readonly inFlight;
|
|
150
|
+
private readonly forcedFetches;
|
|
144
151
|
constructor(config: {
|
|
145
152
|
defaultTtlMs: number;
|
|
146
153
|
}, epochStore: EpochStore);
|
|
147
154
|
private maybeRefreshAhead;
|
|
155
|
+
private startFetch;
|
|
156
|
+
private forcedFetch;
|
|
157
|
+
private runForcedFetch;
|
|
148
158
|
getOrFetch: <T>(opts: {
|
|
149
159
|
cacheKey: string;
|
|
150
160
|
fetcher: () => Promise<readonly T[]>;
|
|
@@ -178,6 +188,11 @@ type DailyReportExternalSource = {
|
|
|
178
188
|
mapRow: (row: Record<string, unknown>) => ExternalReportFields;
|
|
179
189
|
};
|
|
180
190
|
declare const transformJsonArray: <TRaw, TResult>(payload: string | null, label: string, mapper: (raw: TRaw) => TResult | null, logger?: DailyReportLogger) => TResult[];
|
|
191
|
+
declare const CLIENT_TEMP_ID_BRAND: unique symbol;
|
|
192
|
+
type DailyReportClientTempId = string & {
|
|
193
|
+
readonly [CLIENT_TEMP_ID_BRAND]: true;
|
|
194
|
+
};
|
|
195
|
+
declare const parseClientTempId: (raw: string | null) => DailyReportClientTempId | null;
|
|
181
196
|
type ResourceRouteArgs = {
|
|
182
197
|
request: Request;
|
|
183
198
|
params: Record<string, string | undefined>;
|
|
@@ -1599,17 +1614,17 @@ declare function createDailyReportService(config: DailyReportServiceConfig): {
|
|
|
1599
1614
|
} | null>;
|
|
1600
1615
|
markAttachmentMissing: (attachmentId: number) => Promise<void>;
|
|
1601
1616
|
markAttachmentPresent: (attachmentId: number) => Promise<void>;
|
|
1602
|
-
setStarStatus: (scope: DailyReportViewerScope, userId: number, reportHubId: number, businessDate: string | null, isStarred: boolean, clientTempId:
|
|
1603
|
-
setReadStatus: (scope: DailyReportViewerScope, userId: number, reportHubId: number, businessDate: string | null, isRead: boolean, clientTempId:
|
|
1604
|
-
addComment: (scope: DailyReportViewerScope, userId: number, reportHubId: number, content: string, businessDate: string | null, clientTempId:
|
|
1605
|
-
deleteComment: (scope: DailyReportViewerScope, userId: number, reportHubId: number, commentId: number, businessDate: string | null, clientTempId:
|
|
1606
|
-
createDailyReport: (userId: number, businessDate: string, clientTempId:
|
|
1617
|
+
setStarStatus: (scope: DailyReportViewerScope, userId: number, reportHubId: number, businessDate: string | null, isStarred: boolean, clientTempId: DailyReportClientTempId) => Promise<DailyReportUserStatusRow>;
|
|
1618
|
+
setReadStatus: (scope: DailyReportViewerScope, userId: number, reportHubId: number, businessDate: string | null, isRead: boolean, clientTempId: DailyReportClientTempId) => Promise<DailyReportUserStatusRow>;
|
|
1619
|
+
addComment: (scope: DailyReportViewerScope, userId: number, reportHubId: number, content: string, businessDate: string | null, clientTempId: DailyReportClientTempId) => Promise<DailyReportPostedComment>;
|
|
1620
|
+
deleteComment: (scope: DailyReportViewerScope, userId: number, reportHubId: number, commentId: number, businessDate: string | null, clientTempId: DailyReportClientTempId) => Promise<void>;
|
|
1621
|
+
createDailyReport: (userId: number, businessDate: string, clientTempId: DailyReportClientTempId) => Promise<DailyReportDetail>;
|
|
1607
1622
|
updateDailyReport: (reportHubId: number, userId: number, data: {
|
|
1608
1623
|
title?: string;
|
|
1609
1624
|
content?: string;
|
|
1610
|
-
}, clientTempId:
|
|
1611
|
-
publishDailyReport: (reportHubId: number, userId: number, clientTempId:
|
|
1612
|
-
deleteDailyReport: (reportHubId: number, userId: number, clientTempId:
|
|
1625
|
+
}, clientTempId: DailyReportClientTempId) => Promise<void>;
|
|
1626
|
+
publishDailyReport: (reportHubId: number, userId: number, clientTempId: DailyReportClientTempId) => Promise<DailyReportDetail | null>;
|
|
1627
|
+
deleteDailyReport: (reportHubId: number, userId: number, clientTempId: DailyReportClientTempId) => Promise<void>;
|
|
1613
1628
|
findDailyReportHubById: (tx: DailyReportDb, reportHubId: number) => Promise<DailyReportHubRow[]>;
|
|
1614
1629
|
updateDailyReportHub: (tx: DailyReportDb, reportHubId: number, data: Partial<DailyReportHubRow>) => Promise<void>;
|
|
1615
1630
|
updateDailyReportInternal: (tx: DailyReportDb, hubId: number, data: Partial<DailyReportInternalRow>) => Promise<void>;
|
|
@@ -1677,7 +1692,7 @@ declare class DailyReportSseReader implements DailyReportSseReaderPort {
|
|
|
1677
1692
|
private _invalidateCaches;
|
|
1678
1693
|
}
|
|
1679
1694
|
declare const generateETag: (data: unknown) => string;
|
|
1680
|
-
declare const jsonResponseWithETag: (request: Request, cookie: string | null, payload: Record<string, unknown>, status?: number
|
|
1695
|
+
declare const jsonResponseWithETag: (request: Request, cookie: string | null, payload: Record<string, unknown>, status?: number) => Response;
|
|
1681
1696
|
type SharpHeaderLike = {
|
|
1682
1697
|
width: number;
|
|
1683
1698
|
height: number;
|
|
@@ -1771,7 +1786,11 @@ declare const DAILY_REPORT_SHARP_THUMBNAIL_DECODE_WORK_MODEL: Readonly<{
|
|
|
1771
1786
|
declare const predictSharpThumbnailWorkingSetBytes: (source: Uint8Array, format: DailyReportAttachmentThumbnailSourceFormat, header: SharpHeaderLike) => number | null;
|
|
1772
1787
|
declare const createSharpThumbnailRenderer: (sharp: SharpLike) => DailyReportAttachmentThumbnailRenderer;
|
|
1773
1788
|
declare const DAILY_REPORT_SSE_VISIBILITY_REFRESH_MS = 60000;
|
|
1774
|
-
declare const DAILY_REPORT_SSE_CATCH_UP_BATCH
|
|
1789
|
+
declare const DAILY_REPORT_SSE_CATCH_UP_BATCH: number;
|
|
1790
|
+
declare const readSseStreamEntry: (raw: RedisStreamMessage, logger: DailyReportLogger) => {
|
|
1791
|
+
readonly entry: StreamEntry;
|
|
1792
|
+
readonly json: unknown;
|
|
1793
|
+
};
|
|
1775
1794
|
type DailyReportServerConfig = Omit<DailyReportServiceConfig, "cache" | "epochs"> & {
|
|
1776
1795
|
authenticate: DailyReportAuthenticate;
|
|
1777
1796
|
resolveVisibleSourceTypes?: DailyReportResolveVisibleSourceTypes;
|
|
@@ -1789,4 +1808,4 @@ type DailyReportServer = DailyReportHandlers & {
|
|
|
1789
1808
|
knownSourceTypes: readonly string[];
|
|
1790
1809
|
};
|
|
1791
1810
|
declare function createDailyReportServer(config: DailyReportServerConfig): DailyReportServer;
|
|
1792
|
-
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 DailyReportAttachmentDelivery, type DailyReportAttachmentError, type DailyReportAttachmentFailure, type DailyReportAttachmentThumbnail, type DailyReportAttachmentThumbnailOutputMediaType, type DailyReportAttachmentThumbnailRenderer, type DailyReportAttachmentThumbnailSourceFormat, type DailyReportAttachmentThumbnailsConfig, type DailyReportAttachmentsConfig, type DailyReportAuthResult, type DailyReportAuthenticate, type DailyReportDb, type DailyReportHandlers, type DailyReportHandlersConfig, type DailyReportIdCodec, type DailyReportReadAttachment, type DailyReportRedisProvider, type DailyReportServer, type DailyReportServerConfig, type DailyReportServiceConfig, DailyReportSseReader, type DailyReportSseReaderPort, type DailyReportTables, DailyReportViewerScope, type ExternalReportFields, type SharpLike, SqlResultCache, type StreamEntry, createDailyReportHandlers, createDailyReportServer, createDailyReportService, createEpochStore, createSharpThumbnailRenderer, defineDailyReportSchema, generateETag, isStreamIdLte, jsonResponseWithETag, predictSharpThumbnailWorkingSetBytes, transformJsonArray };
|
|
1811
|
+
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 DailyReportAttachmentDelivery, type DailyReportAttachmentError, type DailyReportAttachmentFailure, type DailyReportAttachmentThumbnail, type DailyReportAttachmentThumbnailOutputMediaType, type DailyReportAttachmentThumbnailRenderer, type DailyReportAttachmentThumbnailSourceFormat, type DailyReportAttachmentThumbnailsConfig, type DailyReportAttachmentsConfig, type DailyReportAuthResult, type DailyReportAuthenticate, type DailyReportClientTempId, type DailyReportDb, type DailyReportHandlers, type DailyReportHandlersConfig, type DailyReportIdCodec, type DailyReportReadAttachment, type DailyReportRedisProvider, type DailyReportServer, type DailyReportServerConfig, type DailyReportServiceConfig, DailyReportSseReader, type DailyReportSseReaderPort, type DailyReportTables, DailyReportViewerScope, type ExternalReportFields, type SharpLike, SqlResultCache, type StreamEntry, createDailyReportHandlers, createDailyReportServer, createDailyReportService, createEpochStore, createSharpThumbnailRenderer, defineDailyReportSchema, generateETag, isStreamIdLte, jsonResponseWithETag, parseClientTempId, predictSharpThumbnailWorkingSetBytes, readSseStreamEntry as readDailyReportSseStreamEntry, transformJsonArray };
|