@aiquants/daily-report 0.26.0 → 0.27.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 +36 -2
- package/README.md +86 -49
- package/dist/client.d.mts +4 -0
- package/dist/client.d.ts +4 -0
- package/dist/client.js +4 -4
- package/dist/client.mjs +4 -4
- package/dist/server.d.mts +35 -31
- package/dist/server.d.ts +35 -31
- package/dist/server.js +3 -3
- package/dist/server.mjs +3 -3
- package/dist/styles/daily-report.standalone.css +1 -1
- package/package.json +7 -7
package/dist/server.d.mts
CHANGED
|
@@ -14,6 +14,35 @@ declare const DAILY_REPORT_ATTACHMENT_THUMBNAIL_OUTPUT_MEDIA_TYPES: readonly [
|
|
|
14
14
|
"image/png"
|
|
15
15
|
];
|
|
16
16
|
declare const DAILY_REPORT_ATTACHMENT_THUMBNAIL_MAX_OUTPUT_BYTES: number;
|
|
17
|
+
declare const isStreamIdLte: (a: string, b: string) => boolean;
|
|
18
|
+
type StreamEntry = {
|
|
19
|
+
id: string;
|
|
20
|
+
message: Record<string, string>;
|
|
21
|
+
};
|
|
22
|
+
type DailyReportSseReaderConfig = {
|
|
23
|
+
redis?: DailyReportRedisProvider;
|
|
24
|
+
streamKey: string;
|
|
25
|
+
cache: SqlResultCache;
|
|
26
|
+
logger?: DailyReportLogger;
|
|
27
|
+
};
|
|
28
|
+
declare class DailyReportSseReader implements DailyReportSseReaderPort {
|
|
29
|
+
private readonly config;
|
|
30
|
+
private _source;
|
|
31
|
+
private _lastId;
|
|
32
|
+
private _positioning;
|
|
33
|
+
private _generation;
|
|
34
|
+
private readonly _logger;
|
|
35
|
+
constructor(config: DailyReportSseReaderConfig);
|
|
36
|
+
ready(): Promise<void>;
|
|
37
|
+
subscribe(onEntry: (entry: StreamEntry) => void, onError: (err: Error) => void): () => void;
|
|
38
|
+
destroy(): Promise<void>;
|
|
39
|
+
private _position;
|
|
40
|
+
private _readTail;
|
|
41
|
+
private _createSource;
|
|
42
|
+
private _start;
|
|
43
|
+
private _readLoop;
|
|
44
|
+
private _invalidateCaches;
|
|
45
|
+
}
|
|
17
46
|
type RedisStreamMessage = {
|
|
18
47
|
id: string;
|
|
19
48
|
message: Record<string, string>;
|
|
@@ -48,6 +77,10 @@ type DailyReportRedisProvider = {
|
|
|
48
77
|
getClient(): Promise<DailyReportRedisClient | undefined>;
|
|
49
78
|
createClient(): Promise<DailyReportRedisBlockingClient | undefined>;
|
|
50
79
|
};
|
|
80
|
+
type DailyReportSseReaderPort = {
|
|
81
|
+
ready(): Promise<void>;
|
|
82
|
+
subscribe(onEntry: (entry: StreamEntry) => void, onError: (err: Error) => void): () => void;
|
|
83
|
+
};
|
|
51
84
|
type DailyReportAuthResult = {
|
|
52
85
|
user?: {
|
|
53
86
|
id: string;
|
|
@@ -1575,35 +1608,6 @@ declare function createDailyReportService(config: DailyReportServiceConfig): {
|
|
|
1575
1608
|
updateDailyReportInternal: (tx: DailyReportDb, hubId: number, data: Partial<DailyReportInternalRow>) => Promise<void>;
|
|
1576
1609
|
deleteDailyReportLabel: (tx: DailyReportDb, hubId: number, labelId: number) => Promise<void>;
|
|
1577
1610
|
};
|
|
1578
|
-
declare const isStreamIdLte: (a: string, b: string) => boolean;
|
|
1579
|
-
type StreamEntry = {
|
|
1580
|
-
id: string;
|
|
1581
|
-
message: Record<string, string>;
|
|
1582
|
-
};
|
|
1583
|
-
type DailyReportSseReaderConfig = {
|
|
1584
|
-
redis?: DailyReportRedisProvider;
|
|
1585
|
-
streamKey: string;
|
|
1586
|
-
cache: SqlResultCache;
|
|
1587
|
-
logger?: DailyReportLogger;
|
|
1588
|
-
};
|
|
1589
|
-
declare class DailyReportSseReader {
|
|
1590
|
-
private readonly config;
|
|
1591
|
-
private _source;
|
|
1592
|
-
private _lastId;
|
|
1593
|
-
private _positioning;
|
|
1594
|
-
private _generation;
|
|
1595
|
-
private readonly _logger;
|
|
1596
|
-
constructor(config: DailyReportSseReaderConfig);
|
|
1597
|
-
ready(): Promise<void>;
|
|
1598
|
-
subscribe(onEntry: (entry: StreamEntry) => void, onError: (err: Error) => void): () => void;
|
|
1599
|
-
destroy(): Promise<void>;
|
|
1600
|
-
private _position;
|
|
1601
|
-
private _readTail;
|
|
1602
|
-
private _createSource;
|
|
1603
|
-
private _start;
|
|
1604
|
-
private _readLoop;
|
|
1605
|
-
private _invalidateCaches;
|
|
1606
|
-
}
|
|
1607
1611
|
type LoaderArgs = {
|
|
1608
1612
|
request: Request;
|
|
1609
1613
|
params: Record<string, string | undefined>;
|
|
@@ -1621,7 +1625,7 @@ type DailyReportHandlersConfig = {
|
|
|
1621
1625
|
attachmentThumbnailConcurrency?: number;
|
|
1622
1626
|
attachmentThumbnailCacheBytes?: number;
|
|
1623
1627
|
redis?: DailyReportRedisProvider;
|
|
1624
|
-
sseReader:
|
|
1628
|
+
sseReader: DailyReportSseReaderPort;
|
|
1625
1629
|
streamKey: string;
|
|
1626
1630
|
loginRedirectPath?: string;
|
|
1627
1631
|
enableDevCacheClear?: boolean;
|
|
@@ -1846,4 +1850,4 @@ declare function createDailyReportServer(config: DailyReportServerConfig): {
|
|
|
1846
1850
|
streamKey: string;
|
|
1847
1851
|
knownSourceTypes: readonly string[];
|
|
1848
1852
|
};
|
|
1849
|
-
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 DailyReportAuthResult, type DailyReportAuthenticate, type DailyReportDb, type DailyReportIdCodec, type DailyReportReadAttachment, type DailyReportRedisProvider, type DailyReportServerConfig, type DailyReportServiceConfig, DailyReportSseReader, type DailyReportTables, DailyReportViewerScope, type ExternalReportFields, type SharpLike, SqlResultCache, type StreamEntry, createDailyReportHandlers, createDailyReportServer, createDailyReportService, createEpochStore, createSharpThumbnailRenderer, defineDailyReportSchema, generateETag, isStreamIdLte, jsonResponseWithETag, predictSharpThumbnailWorkingSetBytes, transformJsonArray };
|
|
1853
|
+
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 DailyReportAuthResult, type DailyReportAuthenticate, type DailyReportDb, type DailyReportIdCodec, type DailyReportReadAttachment, type DailyReportRedisProvider, 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 };
|
package/dist/server.d.ts
CHANGED
|
@@ -14,6 +14,35 @@ declare const DAILY_REPORT_ATTACHMENT_THUMBNAIL_OUTPUT_MEDIA_TYPES: readonly [
|
|
|
14
14
|
"image/png"
|
|
15
15
|
];
|
|
16
16
|
declare const DAILY_REPORT_ATTACHMENT_THUMBNAIL_MAX_OUTPUT_BYTES: number;
|
|
17
|
+
declare const isStreamIdLte: (a: string, b: string) => boolean;
|
|
18
|
+
type StreamEntry = {
|
|
19
|
+
id: string;
|
|
20
|
+
message: Record<string, string>;
|
|
21
|
+
};
|
|
22
|
+
type DailyReportSseReaderConfig = {
|
|
23
|
+
redis?: DailyReportRedisProvider;
|
|
24
|
+
streamKey: string;
|
|
25
|
+
cache: SqlResultCache;
|
|
26
|
+
logger?: DailyReportLogger;
|
|
27
|
+
};
|
|
28
|
+
declare class DailyReportSseReader implements DailyReportSseReaderPort {
|
|
29
|
+
private readonly config;
|
|
30
|
+
private _source;
|
|
31
|
+
private _lastId;
|
|
32
|
+
private _positioning;
|
|
33
|
+
private _generation;
|
|
34
|
+
private readonly _logger;
|
|
35
|
+
constructor(config: DailyReportSseReaderConfig);
|
|
36
|
+
ready(): Promise<void>;
|
|
37
|
+
subscribe(onEntry: (entry: StreamEntry) => void, onError: (err: Error) => void): () => void;
|
|
38
|
+
destroy(): Promise<void>;
|
|
39
|
+
private _position;
|
|
40
|
+
private _readTail;
|
|
41
|
+
private _createSource;
|
|
42
|
+
private _start;
|
|
43
|
+
private _readLoop;
|
|
44
|
+
private _invalidateCaches;
|
|
45
|
+
}
|
|
17
46
|
type RedisStreamMessage = {
|
|
18
47
|
id: string;
|
|
19
48
|
message: Record<string, string>;
|
|
@@ -48,6 +77,10 @@ type DailyReportRedisProvider = {
|
|
|
48
77
|
getClient(): Promise<DailyReportRedisClient | undefined>;
|
|
49
78
|
createClient(): Promise<DailyReportRedisBlockingClient | undefined>;
|
|
50
79
|
};
|
|
80
|
+
type DailyReportSseReaderPort = {
|
|
81
|
+
ready(): Promise<void>;
|
|
82
|
+
subscribe(onEntry: (entry: StreamEntry) => void, onError: (err: Error) => void): () => void;
|
|
83
|
+
};
|
|
51
84
|
type DailyReportAuthResult = {
|
|
52
85
|
user?: {
|
|
53
86
|
id: string;
|
|
@@ -1575,35 +1608,6 @@ declare function createDailyReportService(config: DailyReportServiceConfig): {
|
|
|
1575
1608
|
updateDailyReportInternal: (tx: DailyReportDb, hubId: number, data: Partial<DailyReportInternalRow>) => Promise<void>;
|
|
1576
1609
|
deleteDailyReportLabel: (tx: DailyReportDb, hubId: number, labelId: number) => Promise<void>;
|
|
1577
1610
|
};
|
|
1578
|
-
declare const isStreamIdLte: (a: string, b: string) => boolean;
|
|
1579
|
-
type StreamEntry = {
|
|
1580
|
-
id: string;
|
|
1581
|
-
message: Record<string, string>;
|
|
1582
|
-
};
|
|
1583
|
-
type DailyReportSseReaderConfig = {
|
|
1584
|
-
redis?: DailyReportRedisProvider;
|
|
1585
|
-
streamKey: string;
|
|
1586
|
-
cache: SqlResultCache;
|
|
1587
|
-
logger?: DailyReportLogger;
|
|
1588
|
-
};
|
|
1589
|
-
declare class DailyReportSseReader {
|
|
1590
|
-
private readonly config;
|
|
1591
|
-
private _source;
|
|
1592
|
-
private _lastId;
|
|
1593
|
-
private _positioning;
|
|
1594
|
-
private _generation;
|
|
1595
|
-
private readonly _logger;
|
|
1596
|
-
constructor(config: DailyReportSseReaderConfig);
|
|
1597
|
-
ready(): Promise<void>;
|
|
1598
|
-
subscribe(onEntry: (entry: StreamEntry) => void, onError: (err: Error) => void): () => void;
|
|
1599
|
-
destroy(): Promise<void>;
|
|
1600
|
-
private _position;
|
|
1601
|
-
private _readTail;
|
|
1602
|
-
private _createSource;
|
|
1603
|
-
private _start;
|
|
1604
|
-
private _readLoop;
|
|
1605
|
-
private _invalidateCaches;
|
|
1606
|
-
}
|
|
1607
1611
|
type LoaderArgs = {
|
|
1608
1612
|
request: Request;
|
|
1609
1613
|
params: Record<string, string | undefined>;
|
|
@@ -1621,7 +1625,7 @@ type DailyReportHandlersConfig = {
|
|
|
1621
1625
|
attachmentThumbnailConcurrency?: number;
|
|
1622
1626
|
attachmentThumbnailCacheBytes?: number;
|
|
1623
1627
|
redis?: DailyReportRedisProvider;
|
|
1624
|
-
sseReader:
|
|
1628
|
+
sseReader: DailyReportSseReaderPort;
|
|
1625
1629
|
streamKey: string;
|
|
1626
1630
|
loginRedirectPath?: string;
|
|
1627
1631
|
enableDevCacheClear?: boolean;
|
|
@@ -1846,4 +1850,4 @@ declare function createDailyReportServer(config: DailyReportServerConfig): {
|
|
|
1846
1850
|
streamKey: string;
|
|
1847
1851
|
knownSourceTypes: readonly string[];
|
|
1848
1852
|
};
|
|
1849
|
-
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 DailyReportAuthResult, type DailyReportAuthenticate, type DailyReportDb, type DailyReportIdCodec, type DailyReportReadAttachment, type DailyReportRedisProvider, type DailyReportServerConfig, type DailyReportServiceConfig, DailyReportSseReader, type DailyReportTables, DailyReportViewerScope, type ExternalReportFields, type SharpLike, SqlResultCache, type StreamEntry, createDailyReportHandlers, createDailyReportServer, createDailyReportService, createEpochStore, createSharpThumbnailRenderer, defineDailyReportSchema, generateETag, isStreamIdLte, jsonResponseWithETag, predictSharpThumbnailWorkingSetBytes, transformJsonArray };
|
|
1853
|
+
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 DailyReportAuthResult, type DailyReportAuthenticate, type DailyReportDb, type DailyReportIdCodec, type DailyReportReadAttachment, type DailyReportRedisProvider, 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 };
|