@agile-team/mach-report 2.9.1 → 2.11.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/README.md +11 -7
- package/dist/ExcelBindingWizard-CjIiVox-.cjs +1 -0
- package/dist/ExcelBindingWizard-Dxm-K5HL.js +1240 -0
- package/dist/ParamEditor-D-Hf5xfO.cjs +1 -0
- package/dist/ParamEditor-DRGxzxeO.js +381 -0
- package/dist/ReportBatchPanel-BYgg0EDB.cjs +1 -0
- package/dist/ReportBatchPanel-Bby5yLzU.js +287 -0
- package/dist/ReportPreview-DWXROHBP.cjs +6 -0
- package/dist/ReportPreview-DiNXhQI0.js +4138 -0
- package/dist/ReportTemplateLibrary-C6CO7YCT.cjs +1 -0
- package/dist/ReportTemplateLibrary-DfzDXRvr.js +260 -0
- package/dist/RuleEditor-C2QsOHOs.cjs +1 -0
- package/dist/RuleEditor-D9wQHrkf.js +2024 -0
- package/dist/TemplateReviewPanel-BKofGrV9.js +222 -0
- package/dist/TemplateReviewPanel-DwtOcLue.cjs +1 -0
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +4 -0
- package/dist/analytics.d.ts +4 -0
- package/dist/analytics.js +40 -39
- package/dist/{assets-ahTRUXRk.cjs → assets-Bu6UohJx.cjs} +1 -1
- package/dist/{assets-DDsfEi8R.js → assets-DegqDNqY.js} +1 -1
- package/dist/batch-Bt3Fd27Z.cjs +1 -0
- package/dist/batch-mRqhhhjt.js +364 -0
- package/dist/{capabilities-Cm9hZ3uV.js → capabilities-CK_7hizc.js} +16 -16
- package/dist/capabilities-CsZ-pNHR.cjs +1 -0
- package/dist/computed-Bvk0W15F.js +521 -0
- package/dist/computed-CGV2a809.cjs +1 -0
- package/dist/config-B612mw0x.js +525 -0
- package/dist/config-BRoLo2oj.cjs +1 -0
- package/dist/designer.cjs +2 -2
- package/dist/designer.d.cts +695 -50
- package/dist/designer.d.ts +695 -50
- package/dist/designer.js +2213 -1748
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +205 -6
- package/dist/index.d.ts +205 -6
- package/dist/index.js +808 -1033
- package/dist/injection-keys-Db_DyLkm.cjs +1 -0
- package/dist/injection-keys-e85udZCp.js +7 -0
- package/dist/list-cell-BuYn4tGF.cjs +1 -0
- package/dist/list-cell-ClFra1zS.js +173 -0
- package/dist/matrix-DVyWiYsd.cjs +1 -0
- package/dist/matrix-yZsGnldA.js +227 -0
- package/dist/param-validation-BlHHXs6u.js +153 -0
- package/dist/param-validation-DCK039V1.cjs +1 -0
- package/dist/pdf.cjs +49 -49
- package/dist/pdf.d.cts +31 -1
- package/dist/pdf.d.ts +31 -1
- package/dist/pdf.js +4797 -4650
- package/dist/plugin-BDTU4D94.cjs +1 -0
- package/dist/plugin-Cd5G2QQn.js +22 -0
- package/dist/region-binding-workflow-CXDmt9Bs.js +977 -0
- package/dist/region-binding-workflow-DhQvu1co.cjs +3 -0
- package/dist/{report-params-B_VCihAh.js → report-params-B44imUd4.js} +1 -1
- package/dist/{report-params-CjWrjPl6.cjs → report-params-SJfhKgaX.cjs} +1 -1
- package/dist/server/node.d.cts +48 -5
- package/dist/server/node.d.ts +48 -5
- package/dist/server-node.cjs +1 -1
- package/dist/server-node.js +503 -317
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +252 -4
- package/dist/server.d.ts +252 -4
- package/dist/server.js +567 -469
- package/dist/style.css +1 -1
- package/dist/template-registry-WNXdkiET.js +506 -0
- package/dist/template-registry-ukBGlm8N.cjs +1 -0
- package/dist/template-review-BXp2oyqg.cjs +1 -0
- package/dist/template-review-BdcXSYbx.js +1616 -0
- package/dist/tree-BX380Rr7.cjs +1 -0
- package/dist/tree-CqcQ99NM.js +172 -0
- package/dist/useLocalDraft-C07SYRnC.js +11 -0
- package/dist/useLocalDraft-Yiw1wFgI.cjs +1 -0
- package/dist/{validate-DWPF7icl.js → validate-7s0yn6ii.js} +26 -26
- package/dist/validate-DsRiNw8h.cjs +1 -0
- package/dist/vue/async.d.cts +118 -6
- package/dist/vue/async.d.ts +118 -6
- package/dist/vue/index.d.cts +177 -11
- package/dist/vue/index.d.ts +177 -11
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +5 -5
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +116 -113
- package/dist/{import-template-CNMLJSQw.js → workbook-session-BKOTwcoq.js} +4290 -4227
- package/dist/{import-template-CpxunKVp.cjs → workbook-session-CLYLhZWu.cjs} +17 -17
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +9 -2
- package/dist/worker.d.ts +9 -2
- package/dist/worker.js +1 -1
- package/dist/xlsx.cjs +4 -2
- package/dist/xlsx.d.cts +159 -3
- package/dist/xlsx.d.ts +159 -3
- package/dist/xlsx.js +354 -192
- package/package.json +1 -1
- package/dist/ExcelBindingWizard-DiaxvWpQ.cjs +0 -1
- package/dist/ExcelBindingWizard-RLJIXKKG.js +0 -816
- package/dist/ReportPreview-B5ZNEasW.js +0 -4439
- package/dist/ReportPreview-DRtVPUYo.cjs +0 -6
- package/dist/RuleEditor-CskN5Fr3.cjs +0 -1
- package/dist/RuleEditor-CtJFzKuY.js +0 -1578
- package/dist/TemplateReviewPanel-C_Lmzis6.cjs +0 -1
- package/dist/TemplateReviewPanel-Cn32OY4_.js +0 -173
- package/dist/binding-preview-B5834rml.cjs +0 -2
- package/dist/binding-preview-ChXjN5L5.js +0 -649
- package/dist/capabilities-DYzWL7KS.cjs +0 -1
- package/dist/matrix-CNPDJxED.js +0 -745
- package/dist/matrix-Div9Ilh3.cjs +0 -1
- package/dist/param-validation-BWNjLcN0.js +0 -116
- package/dist/param-validation-CiTxFeZ8.cjs +0 -1
- package/dist/plugin-BWwIgZXV.js +0 -25
- package/dist/plugin-Dg-J1Rbm.cjs +0 -1
- package/dist/template-registry-CHMYZ7SD.cjs +0 -1
- package/dist/template-registry-R61AMCr0.js +0 -433
- package/dist/template-review-hvWWQFsi.js +0 -1027
- package/dist/template-review-jEcOfmGr.cjs +0 -1
- package/dist/validate-BDiMqkJC.cjs +0 -1
package/dist/server.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ declare interface AggregateDefinition {
|
|
|
10
10
|
|
|
11
11
|
declare type AggregateOperation = "sum" | "count" | "avg" | "min" | "max" | "weightedAvg";
|
|
12
12
|
|
|
13
|
+
export declare function checkInstanceIdentity(scope: string, id: string): void;
|
|
14
|
+
|
|
13
15
|
export declare function checkJobIdentity(scope: string, id: string): void;
|
|
14
16
|
|
|
15
17
|
export declare function cloneJob<T>(value: T): T;
|
|
@@ -73,8 +75,41 @@ declare interface ComputedField extends ExpressionOptions {
|
|
|
73
75
|
dependsOn?: readonly string[];
|
|
74
76
|
}
|
|
75
77
|
|
|
78
|
+
/** Bounded reference store for tests/local sessions. Production hosts implement durable transactional CAS. */
|
|
79
|
+
export declare function createMemoryReportInstanceStore(options?: MemoryReportInstanceStoreOptions): ReportInstanceStore;
|
|
80
|
+
|
|
76
81
|
/** Reference store for tests; use a database CAS or the single-process durable Node adapter in production. */
|
|
77
|
-
export declare function createMemoryReportJobStore(): ReportJobStore;
|
|
82
|
+
export declare function createMemoryReportJobStore(options?: ReportJobStoreBudgetOptions): ReportJobStore;
|
|
83
|
+
|
|
84
|
+
/** Bind immutable template revisions to the same runtime registration. Rebuild the service on publication. */
|
|
85
|
+
export declare function createReportGenerationService(options: {
|
|
86
|
+
runtime: ReportRuntime;
|
|
87
|
+
instances: ReportInstanceStore;
|
|
88
|
+
templateRevisions: Record<string, string>;
|
|
89
|
+
maxSnapshotBytes?: number;
|
|
90
|
+
now?: () => Date;
|
|
91
|
+
}): {
|
|
92
|
+
generate(input: ReportGenerationInput): Promise<ReportInstanceSnapshot>;
|
|
93
|
+
read: (scope: string, id: string, revision?: number, signal?: AbortSignal) => Promise<ReportInstanceSnapshot | undefined>;
|
|
94
|
+
list: (scope: string, options?: ReportInstanceListOptions) => Promise<ReportInstancePage>;
|
|
95
|
+
/** Instance edits are explicit snapshots; source business persistence remains the Provider.save responsibility. */
|
|
96
|
+
save: (input: Omit<ReportInstanceSnapshot, "revision">, options: {
|
|
97
|
+
expectedRevision: number | null;
|
|
98
|
+
signal?: AbortSignal;
|
|
99
|
+
}) => Promise<ReportInstanceSnapshot>;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/** Save is explicit. A preview/query never calls this manager or overwrites a prior instance. */
|
|
103
|
+
export declare function createReportInstanceManager(store: ReportInstanceStore, options?: {
|
|
104
|
+
maxSnapshotBytes?: number;
|
|
105
|
+
}): {
|
|
106
|
+
read: (scope: string, id: string, revision?: number, signal?: AbortSignal) => Promise<ReportInstanceSnapshot | undefined>;
|
|
107
|
+
list: (scope: string, options?: ReportInstanceListOptions) => Promise<ReportInstancePage>;
|
|
108
|
+
save: (input: Omit<ReportInstanceSnapshot, "revision">, options: {
|
|
109
|
+
expectedRevision: number | null;
|
|
110
|
+
signal?: AbortSignal;
|
|
111
|
+
}) => Promise<ReportInstanceSnapshot>;
|
|
112
|
+
};
|
|
78
113
|
|
|
79
114
|
/** Durable at-least-once dispatch; export/artifact handlers must be idempotent by scope+taskId. */
|
|
80
115
|
export declare function createReportJobService(options: ReportJobServiceOptions): ReportJobService;
|
|
@@ -125,11 +160,15 @@ declare interface GridCell {
|
|
|
125
160
|
value?: string | number | boolean | null;
|
|
126
161
|
/** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
|
|
127
162
|
numberFormat?: string;
|
|
163
|
+
/** Physical left inset for hierarchical labels; raw value stays unchanged. */
|
|
164
|
+
indentMm?: number;
|
|
128
165
|
/** 编辑输入类型;省略时只按原始值推断,数字字符串不会被转换为数值。 */
|
|
129
166
|
valueType?: "text" | "number" | "boolean";
|
|
130
167
|
/** 单元格级编辑控制;预览仍需显式开启 editing。 */
|
|
131
168
|
editable?: boolean;
|
|
132
169
|
source?: ReportCellSource;
|
|
170
|
+
/** SDK 派生结果不映射业务来源,始终只读(包括覆盖同名源字段的计算)。 */
|
|
171
|
+
derived?: boolean;
|
|
133
172
|
/** Excel 公式保留元数据;当前引擎不计算公式,公式格始终只读。 */
|
|
134
173
|
formula?: string;
|
|
135
174
|
children?: PlanComponent[];
|
|
@@ -169,6 +208,8 @@ declare interface ListColumn {
|
|
|
169
208
|
|
|
170
209
|
declare interface ListComponent {
|
|
171
210
|
kind: "list";
|
|
211
|
+
/** Opaque serializable layout annotations; interpreted only by explicit optional adapters. */
|
|
212
|
+
meta?: Record<string, unknown>;
|
|
172
213
|
id?: string;
|
|
173
214
|
/** 宽表标记用于连续 Excel;不改变低层列表的列宽和分页算法。 */
|
|
174
215
|
layout?: "page" | "wide";
|
|
@@ -178,6 +219,10 @@ declare interface ListComponent {
|
|
|
178
219
|
topMm: number;
|
|
179
220
|
widthMm: number;
|
|
180
221
|
dataset: string;
|
|
222
|
+
/** Headerless record/region bindings do not allocate a synthetic list header. */
|
|
223
|
+
header?: boolean;
|
|
224
|
+
/** A fixed record region rejects multiple rows instead of dropping source data. */
|
|
225
|
+
cardinality?: "record";
|
|
181
226
|
/** 数据集中稳定业务主键的字段名;省略时编辑仅有计划内坐标。 */
|
|
182
227
|
rowKey?: string;
|
|
183
228
|
revisionField?: string;
|
|
@@ -204,6 +249,8 @@ declare interface ListComponent {
|
|
|
204
249
|
computed?: ComputedField[];
|
|
205
250
|
/** Dynamic pivot of the current source dataset, with read-only derived identities. */
|
|
206
251
|
matrix?: MatrixTableOptions;
|
|
252
|
+
/** Full ordered hierarchy; source parent values and descendant-leaf rollups are explicit. */
|
|
253
|
+
tree?: TreeTableOptions;
|
|
207
254
|
/** Explicit row visibility; hidden rows do not participate in summaries. */
|
|
208
255
|
rowVisibleWhen?: StyleRule["when"];
|
|
209
256
|
/** Master/detail relation is keyed by business identity, never by display row index. */
|
|
@@ -217,6 +264,9 @@ declare interface ListDetail {
|
|
|
217
264
|
parentKey: string;
|
|
218
265
|
foreignKey: string;
|
|
219
266
|
rowKey?: string;
|
|
267
|
+
/** 子表独立的并发契约;省略时不继承主表字段。 */
|
|
268
|
+
revisionField?: string;
|
|
269
|
+
sourceTokenField?: string;
|
|
220
270
|
columns: ListColumn[];
|
|
221
271
|
rowHeightMm?: number;
|
|
222
272
|
header?: boolean;
|
|
@@ -267,6 +317,13 @@ declare interface MatrixTableOptions {
|
|
|
267
317
|
maxCells?: number;
|
|
268
318
|
}
|
|
269
319
|
|
|
320
|
+
export declare interface MemoryReportInstanceStoreOptions {
|
|
321
|
+
maxInstances?: number;
|
|
322
|
+
maxRevisions?: number;
|
|
323
|
+
maxBytes?: number;
|
|
324
|
+
maxSnapshotBytes?: number;
|
|
325
|
+
}
|
|
326
|
+
|
|
270
327
|
declare interface OutputDiagnostic {
|
|
271
328
|
code: "missing-image" | "unsupported-component" | "unsupported-image-format" | "unsupported-style" | "rich-text-flattened" | "nested-components-omitted" | "async-image-required" | "image-decode-failed" | "asset-render-failed" | "asset-budget-exceeded";
|
|
272
329
|
severity: "warning";
|
|
@@ -335,6 +392,7 @@ declare interface PlanGrid {
|
|
|
335
392
|
}
|
|
336
393
|
|
|
337
394
|
declare interface PlanPage {
|
|
395
|
+
meta?: Record<string, unknown>;
|
|
338
396
|
/** wide 表示完整自然列宽;页面仅为预览的垂直窗口分段。 */
|
|
339
397
|
layout?: "page" | "wide";
|
|
340
398
|
pageWidthMm: number;
|
|
@@ -375,9 +433,48 @@ export declare interface PreparedReport {
|
|
|
375
433
|
|
|
376
434
|
declare interface RenderPlan {
|
|
377
435
|
schemaVersion: string;
|
|
436
|
+
/** 编辑需要模板重算上下文;跨 Worker/JSON 保留要求,但不声明本地会话可用。 */
|
|
437
|
+
requiresRecalculation?: boolean;
|
|
378
438
|
pages: PlanPage[];
|
|
379
439
|
}
|
|
380
440
|
|
|
441
|
+
export declare interface ReportBatchCase {
|
|
442
|
+
id: string;
|
|
443
|
+
params: Record<string, string>;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export declare interface ReportBatchOptions {
|
|
447
|
+
concurrency?: number;
|
|
448
|
+
maxCases?: number;
|
|
449
|
+
signal?: AbortSignal;
|
|
450
|
+
/** Stop launching new cases after the first failure; already running cases finish. */
|
|
451
|
+
failure?: "continue" | "stop";
|
|
452
|
+
onProgress?: (progress: ReportBatchProgress) => void;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
export declare type ReportBatchOutcome<T> = {
|
|
456
|
+
id: string;
|
|
457
|
+
index: number;
|
|
458
|
+
} & ({
|
|
459
|
+
status: "completed";
|
|
460
|
+
value: T;
|
|
461
|
+
} | {
|
|
462
|
+
status: "failed";
|
|
463
|
+
error: {
|
|
464
|
+
name: string;
|
|
465
|
+
message: string;
|
|
466
|
+
};
|
|
467
|
+
} | {
|
|
468
|
+
status: "cancelled";
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
export declare interface ReportBatchProgress {
|
|
472
|
+
completed: number;
|
|
473
|
+
total: number;
|
|
474
|
+
failed: number;
|
|
475
|
+
cancelled: number;
|
|
476
|
+
}
|
|
477
|
+
|
|
381
478
|
/** 预览中的物理坐标;合并单元格使用左上角坐标。 */
|
|
382
479
|
declare interface ReportCellAddress {
|
|
383
480
|
pageIndex: number;
|
|
@@ -479,6 +576,78 @@ declare interface ReportFieldContract {
|
|
|
479
576
|
unit?: string;
|
|
480
577
|
}
|
|
481
578
|
|
|
579
|
+
declare interface ReportFlowBand {
|
|
580
|
+
/** Exact stable component IDs. Static components use nid, lists use id. */
|
|
581
|
+
componentIds: string[];
|
|
582
|
+
/** Source-template coordinates; following bands keep their original gap. */
|
|
583
|
+
topMm: number;
|
|
584
|
+
heightMm: number;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
export declare interface ReportGenerationInput {
|
|
588
|
+
scope: string;
|
|
589
|
+
id: string;
|
|
590
|
+
title: string;
|
|
591
|
+
reportIds: string[];
|
|
592
|
+
params?: Record<string, string>;
|
|
593
|
+
expectedRevision: number | null;
|
|
594
|
+
signal?: AbortSignal;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
export declare interface ReportInstanceArtifact {
|
|
598
|
+
key: string;
|
|
599
|
+
format: "pdf" | "xlsx";
|
|
600
|
+
bytes: number;
|
|
601
|
+
sha256?: string;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
export declare class ReportInstanceError extends Error {
|
|
605
|
+
readonly code: "input" | "conflict" | "capacity";
|
|
606
|
+
constructor(code: "input" | "conflict" | "capacity", message: string);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
export declare interface ReportInstanceListOptions {
|
|
610
|
+
after?: string;
|
|
611
|
+
limit?: number;
|
|
612
|
+
reportId?: string;
|
|
613
|
+
signal?: AbortSignal;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export declare interface ReportInstancePage {
|
|
617
|
+
items: ReportInstanceSummary[];
|
|
618
|
+
next?: string;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/** Stable parameter identity without adding a database, user account or credential to the SDK. */
|
|
622
|
+
export declare function reportInstanceParameterKey(reportIds: string[], params: Record<string, string>): string;
|
|
623
|
+
|
|
624
|
+
export declare interface ReportInstanceSnapshot {
|
|
625
|
+
scope: string;
|
|
626
|
+
id: string;
|
|
627
|
+
revision: number;
|
|
628
|
+
title: string;
|
|
629
|
+
generatedAt: string;
|
|
630
|
+
reportIds: string[];
|
|
631
|
+
params: Record<string, string>;
|
|
632
|
+
/** Exact template/data revisions used by generation, never inferred from a later template read. */
|
|
633
|
+
templateRevisions: Record<string, string>;
|
|
634
|
+
sourceRevisions: Record<string, string>;
|
|
635
|
+
plan: RenderPlan;
|
|
636
|
+
/** Private storage keys; signed download URLs must be generated by the host after authorization. */
|
|
637
|
+
artifacts?: ReportInstanceArtifact[];
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
export declare interface ReportInstanceStore {
|
|
641
|
+
read(scope: string, id: string, revision?: number, signal?: AbortSignal): Promise<ReportInstanceSnapshot | undefined>;
|
|
642
|
+
list(scope: string, options?: ReportInstanceListOptions): Promise<ReportInstancePage>;
|
|
643
|
+
/** Atomic append + current-revision advance. Historical revisions must never be overwritten. */
|
|
644
|
+
compareAndSwap(scope: string, id: string, expectedRevision: number | null, next: ReportInstanceSnapshot, signal?: AbortSignal): Promise<boolean>;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
export declare type ReportInstanceSummary = Omit<ReportInstanceSnapshot, "plan" | "artifacts">;
|
|
648
|
+
|
|
649
|
+
export declare function reportInstanceSummary(snapshot: ReportInstanceSnapshot): ReportInstanceSummary;
|
|
650
|
+
|
|
482
651
|
export declare class ReportJobError extends Error {
|
|
483
652
|
readonly code: "input" | "conflict" | "missing" | "lease" | "closed" | "capacity";
|
|
484
653
|
constructor(code: "input" | "conflict" | "missing" | "lease" | "closed" | "capacity", message: string);
|
|
@@ -497,6 +666,18 @@ export declare type ReportJobJson = null | boolean | number | string | ReportJob
|
|
|
497
666
|
[key: string]: ReportJobJson;
|
|
498
667
|
};
|
|
499
668
|
|
|
669
|
+
export declare interface ReportJobPruneOptions {
|
|
670
|
+
now: number;
|
|
671
|
+
terminalBefore: number;
|
|
672
|
+
tombstoneRetentionMs?: number;
|
|
673
|
+
limit?: number;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
export declare interface ReportJobPruneResult {
|
|
677
|
+
archived: number;
|
|
678
|
+
expired: number;
|
|
679
|
+
}
|
|
680
|
+
|
|
500
681
|
export declare interface ReportJobRecord {
|
|
501
682
|
scope: string;
|
|
502
683
|
id: string;
|
|
@@ -516,6 +697,8 @@ export declare interface ReportJobRecord {
|
|
|
516
697
|
total?: number;
|
|
517
698
|
};
|
|
518
699
|
result?: ReportJobJson;
|
|
700
|
+
/** Idempotent submit after terminal archival; result/error payloads are no longer retained. */
|
|
701
|
+
archived?: boolean;
|
|
519
702
|
error?: {
|
|
520
703
|
code: string;
|
|
521
704
|
message: string;
|
|
@@ -539,6 +722,8 @@ export declare interface ReportJobService {
|
|
|
539
722
|
runNext(workerId: string): Promise<ReportJobRecord | undefined>;
|
|
540
723
|
/** Stops new dispatch, signals active handlers and waits until their actual completion. */
|
|
541
724
|
close(): Promise<void>;
|
|
725
|
+
/** Archive terminal payloads and retain bounded idempotency fingerprints; never removes active work. */
|
|
726
|
+
prune(options: Omit<ReportJobPruneOptions, "now">): Promise<ReportJobPruneResult>;
|
|
542
727
|
readonly active: number;
|
|
543
728
|
}
|
|
544
729
|
|
|
@@ -549,6 +734,8 @@ export declare interface ReportJobServiceOptions {
|
|
|
549
734
|
leaseMs?: number;
|
|
550
735
|
heartbeatMs?: number;
|
|
551
736
|
now?: () => number;
|
|
737
|
+
/** Result references have a separate byte budget; default 256KiB. */
|
|
738
|
+
maxResultBytes?: number;
|
|
552
739
|
}
|
|
553
740
|
|
|
554
741
|
export declare type ReportJobStatus = "queued" | "running" | "completed" | "failed" | "cancelled";
|
|
@@ -557,9 +744,33 @@ export declare type ReportJobStatus = "queued" | "running" | "completed" | "fail
|
|
|
557
744
|
export declare interface ReportJobStore {
|
|
558
745
|
read(scope: string, id: string): Promise<ReportJobRecord | undefined>;
|
|
559
746
|
candidates(now: number, limit: number): Promise<ReportJobRecord[]>;
|
|
747
|
+
/** Optional bounded retention capability; existing database adapters remain compatible. */
|
|
748
|
+
readTombstone?(scope: string, id: string): Promise<ReportJobTombstone | undefined>;
|
|
749
|
+
prune?(options: ReportJobPruneOptions): Promise<ReportJobPruneResult>;
|
|
560
750
|
compareAndSwap(scope: string, id: string, expectedRevision: number | null, next: ReportJobRecord): Promise<boolean>;
|
|
561
751
|
}
|
|
562
752
|
|
|
753
|
+
export declare interface ReportJobStoreBudgetOptions {
|
|
754
|
+
maxRecords?: number;
|
|
755
|
+
maxBytes?: number;
|
|
756
|
+
maxResultBytes?: number;
|
|
757
|
+
controlReserveBytes?: number;
|
|
758
|
+
maxTombstones?: number;
|
|
759
|
+
maxTombstoneBytes?: number;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
export declare interface ReportJobTombstone {
|
|
763
|
+
scope: string;
|
|
764
|
+
id: string;
|
|
765
|
+
revision: number;
|
|
766
|
+
status: Exclude<ReportJobStatus, "queued" | "running">;
|
|
767
|
+
createdAt: number;
|
|
768
|
+
updatedAt: number;
|
|
769
|
+
attempt: number;
|
|
770
|
+
requestHash: string;
|
|
771
|
+
expiresAt: number;
|
|
772
|
+
}
|
|
773
|
+
|
|
563
774
|
/** 取数与排版共同使用的请求上下文;取消只影响本次调用。 */
|
|
564
775
|
declare interface ReportLoadContext {
|
|
565
776
|
reportId: string;
|
|
@@ -567,13 +778,17 @@ declare interface ReportLoadContext {
|
|
|
567
778
|
signal?: AbortSignal;
|
|
568
779
|
}
|
|
569
780
|
|
|
781
|
+
declare interface ReportPageFlow {
|
|
782
|
+
bands: ReportFlowBand[];
|
|
783
|
+
}
|
|
784
|
+
|
|
570
785
|
/** 报表参数定义(声明式,模板自描述参数面:渲染组件据此生成查询面板) */
|
|
571
786
|
declare interface ReportParamDef {
|
|
572
787
|
/** 参数名(传入 params,与数据集 SQL #{field} 绑定对应) */
|
|
573
788
|
field: string;
|
|
574
789
|
/** 显示名(缺省用 field) */
|
|
575
790
|
label?: string;
|
|
576
|
-
type?: "text" | "number" | "date" | "select";
|
|
791
|
+
type?: "text" | "number" | "date" | "month" | "year" | "dateRange" | "select";
|
|
577
792
|
/** select 选项 */
|
|
578
793
|
options?: Array<{
|
|
579
794
|
label: string;
|
|
@@ -582,7 +797,7 @@ declare interface ReportParamDef {
|
|
|
582
797
|
defaultValue?: string;
|
|
583
798
|
required?: boolean;
|
|
584
799
|
placeholder?: string;
|
|
585
|
-
/**
|
|
800
|
+
/** 数字上下界;日期/月/年使用对应规范字符串;dateRange 对两端使用 YYYY-MM-DD 边界(含边界)。 */
|
|
586
801
|
min?: number | string;
|
|
587
802
|
max?: number | string;
|
|
588
803
|
minLength?: number;
|
|
@@ -874,7 +1089,7 @@ declare interface ReportTemplateReview {
|
|
|
874
1089
|
}
|
|
875
1090
|
|
|
876
1091
|
declare interface ReportTemplateReviewIssue {
|
|
877
|
-
code: "template" | "compatibility" | "dataset" | "field" | "sample" | "layout" | "output";
|
|
1092
|
+
code: "template" | "compatibility" | "dataset" | "field" | "sample" | "layout" | "output" | "params";
|
|
878
1093
|
severity: "error" | "warning";
|
|
879
1094
|
path: string;
|
|
880
1095
|
message: string;
|
|
@@ -919,12 +1134,22 @@ declare interface RichSegment {
|
|
|
919
1134
|
|
|
920
1135
|
export declare function runnableJob(record: ReportJobRecord, now: number): boolean;
|
|
921
1136
|
|
|
1137
|
+
/** Browser/Node shared bounded runner. Return small receipts; persist/export large artifacts inside execute. */
|
|
1138
|
+
export declare function runReportBatch<T>(input: readonly ReportBatchCase[], execute: (item: ReportBatchCase, context: {
|
|
1139
|
+
index: number;
|
|
1140
|
+
signal: AbortSignal;
|
|
1141
|
+
}) => Promise<T>, options?: ReportBatchOptions): Promise<ReportBatchOutcome<T>[]>;
|
|
1142
|
+
|
|
922
1143
|
/** Canonical plain JSON rejects getters/scripts and gives stable idempotency without coercion. */
|
|
923
1144
|
export declare function serializeJobJson(value: unknown, budget?: {
|
|
924
1145
|
maxNodes?: number;
|
|
925
1146
|
maxCharacters?: number;
|
|
926
1147
|
}): string;
|
|
927
1148
|
|
|
1149
|
+
export declare function snapshotReportBatchCases(input: readonly ReportBatchCase[], maximum?: number): ReportBatchCase[];
|
|
1150
|
+
|
|
1151
|
+
export declare function snapshotReportInstance(value: ReportInstanceSnapshot, maxBytes?: number): ReportInstanceSnapshot;
|
|
1152
|
+
|
|
928
1153
|
/** 条件格式规则求值(声明式,见 ListColumn.rules) */
|
|
929
1154
|
declare interface StyleRule {
|
|
930
1155
|
when: {
|
|
@@ -950,6 +1175,9 @@ declare interface TemplatePage {
|
|
|
950
1175
|
marginLeftMm?: number;
|
|
951
1176
|
marginRightMm?: number;
|
|
952
1177
|
components: TemplateComponent[];
|
|
1178
|
+
/** Explicit vertical bands preserve source gaps as dynamic regions expand. */
|
|
1179
|
+
flow?: ReportPageFlow;
|
|
1180
|
+
meta?: Record<string, unknown>;
|
|
953
1181
|
}
|
|
954
1182
|
|
|
955
1183
|
/**
|
|
@@ -972,6 +1200,26 @@ declare interface TextMeasurer {
|
|
|
972
1200
|
measureMm(text: string, options: TextMeasureOptions): number;
|
|
973
1201
|
}
|
|
974
1202
|
|
|
1203
|
+
/** A serialized tree contract. Sibling and root order follow input order. */
|
|
1204
|
+
declare interface TreeTableOptions {
|
|
1205
|
+
input: "flat" | "nested";
|
|
1206
|
+
idField: string;
|
|
1207
|
+
/** Flat roots have null/undefined parent values. */
|
|
1208
|
+
parentField?: string;
|
|
1209
|
+
/** Nested child arrays, defaults to children. Every node still needs an ID. */
|
|
1210
|
+
childrenField?: string;
|
|
1211
|
+
labelField: string;
|
|
1212
|
+
indentMm?: number;
|
|
1213
|
+
orphan?: "error" | "root";
|
|
1214
|
+
/** Source preserves parent values; leaf-aggregate derives only parents from descendant leaves. */
|
|
1215
|
+
parentValues?: "source" | "leaf-aggregate";
|
|
1216
|
+
aggregates?: AggregateDefinition[];
|
|
1217
|
+
maxRows?: number;
|
|
1218
|
+
maxDepth?: number;
|
|
1219
|
+
/** Bounded leaf-to-ancestor aggregate work; default one million. */
|
|
1220
|
+
maxAggregationVisits?: number;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
975
1223
|
export declare function validateJobRecord(record: ReportJobRecord, scope: string, id: string, expectedRevision: number | null): void;
|
|
976
1224
|
|
|
977
1225
|
export declare function validateJobTransition(previous: ReportJobRecord | undefined, next: ReportJobRecord): void;
|