@agile-team/mach-report 2.14.0 → 2.15.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 +16 -11
- package/THIRD_PARTY_NOTICES.md +3 -1
- package/dist/{ExcelBindingWizard-CvsWR8Ga.js → ExcelBindingWizard-BKH1nGNS.js} +3 -3
- package/dist/{ExcelBindingWizard-CLT2p7P3.cjs → ExcelBindingWizard-Bs43BGNp.cjs} +1 -1
- package/dist/ParamEditor-Da4akw6V.cjs +1 -0
- package/dist/ParamEditor-DoAhzJsm.js +594 -0
- package/dist/{ReportBatchPanel-LqVgiqp7.js → ReportBatchPanel-BMf6boMA.js} +39 -39
- package/dist/{ReportBatchPanel-DkxTzBkD.cjs → ReportBatchPanel-wP9m9Pj1.cjs} +1 -1
- package/dist/ReportPreview-ChV19HBp.js +4619 -0
- package/dist/ReportPreview-DbLvvOUT.cjs +6 -0
- package/dist/{ReportTemplateLibrary-MjWEtc7X.js → ReportTemplateLibrary-C9wutIiT.js} +1 -1
- package/dist/{ReportTemplateLibrary-cQ1sqNYo.cjs → ReportTemplateLibrary-Sxr3eD0J.cjs} +1 -1
- package/dist/{RuleEditor-ChuXMlei.js → RuleEditor-C_Clasvd.js} +5 -5
- package/dist/{RuleEditor-BaR6xUiI.cjs → RuleEditor-XhGHK8DE.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-Dci6aRn1.js → TemplateOutlinePanel-D6Bkny59.js} +2 -2
- package/dist/{TemplateOutlinePanel-BHKP89Xz.cjs → TemplateOutlinePanel-JTSR53vJ.cjs} +1 -1
- package/dist/{TemplateReusePanel-CY5eO2Sh.cjs → TemplateReusePanel-Kx35S0Ql.cjs} +1 -1
- package/dist/{TemplateReusePanel-B7Gmyc1z.js → TemplateReusePanel-rVuK1kTz.js} +2 -2
- package/dist/{TemplateReviewPanel-DjlX3xpt.js → TemplateReviewPanel-B0ar9_zf.js} +2 -2
- package/dist/{TemplateReviewPanel-JvZe9_4G.cjs → TemplateReviewPanel-Dn6X9UmY.cjs} +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +3 -1
- package/dist/analytics.d.ts +3 -1
- package/dist/analytics.js +154 -60
- package/dist/artifact-integrity.json +135 -0
- package/dist/assets-B9ImAi6_.cjs +1 -0
- package/dist/assets-DEaz4qsp.js +124 -0
- package/dist/batch-BaP6pWDE.cjs +1 -0
- package/dist/batch-BfZHN1do.js +220 -0
- package/dist/batch-CGyt-b2W.js +273 -0
- package/dist/batch-CLpELXBl.cjs +1 -0
- package/dist/capabilities-CAh2Nrue.cjs +1 -0
- package/dist/capabilities-DskCHs3V.js +69 -0
- package/dist/codes.d.cts +2 -0
- package/dist/codes.d.ts +2 -0
- package/dist/{computed-Bvk0W15F.js → computed-C-4C2S5h.js} +3 -3
- package/dist/config-BVsJXSqS.js +842 -0
- package/dist/config-D10us76d.cjs +1 -0
- package/dist/data-explanation-B8MZRYVS.js +16 -0
- package/dist/data-explanation-DE55G30w.cjs +1 -0
- package/dist/designer-2bDlcNXQ.js +5136 -0
- package/dist/designer-BT7XCdbW.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +144 -16
- package/dist/designer.d.ts +144 -16
- package/dist/designer.js +1 -1
- package/dist/drill-ByJviLXS.js +145 -0
- package/dist/drill-DYTxuL3A.cjs +1 -0
- package/dist/{font-loader-vhCT8znW.cjs → font-loader-B_UkxpzC.cjs} +1 -1
- package/dist/{font-loader-DHto6Lra.js → font-loader-Q3bQjmrI.js} +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +82 -4
- package/dist/index.d.ts +82 -4
- package/dist/index.js +785 -820
- package/dist/json-snapshot-DFb2eWkf.js +1416 -0
- package/dist/json-snapshot-WWSGlaHG.cjs +2 -0
- package/dist/licenses/_bwip-js_generic-4.11.4.txt +24 -0
- package/dist/licenses/_fast-csv_format-4.3.5.txt +22 -0
- package/dist/licenses/_fast-csv_parse-4.3.6.txt +22 -0
- package/dist/licenses/_pdf-lib_fontkit-1.1.1.txt +326 -0
- package/dist/licenses/_pdf-lib_standard-fonts-1.0.0.txt +22 -0
- package/dist/licenses/_pdf-lib_upng-1.0.1.txt +22 -0
- package/dist/licenses/_types_node-14.18.63.txt +22 -0
- package/dist/licenses/_types_pako-2.0.3.txt +22 -0
- package/dist/licenses/_types_pegjs-0.10.6.txt +22 -0
- package/dist/licenses/archiver-5.3.2.txt +23 -0
- package/dist/licenses/archiver-utils-2.1.0.txt +23 -0
- package/dist/licenses/archiver-utils-3.0.4.txt +23 -0
- package/dist/licenses/async-3.2.6.txt +20 -0
- package/dist/licenses/balanced-match-1.0.2.txt +22 -0
- package/dist/licenses/base64-js-1.5.1.txt +22 -0
- package/dist/licenses/big-integer-1.6.52.txt +25 -0
- package/dist/licenses/binary-0.3.0.txt +178 -0
- package/dist/licenses/bl-4.1.0.txt +14 -0
- package/dist/licenses/bluebird-3.4.7.txt +22 -0
- package/dist/licenses/brace-expansion-1.1.21.txt +22 -0
- package/dist/licenses/brace-expansion-2.1.7.txt +22 -0
- package/dist/licenses/buffer-5.7.1.txt +22 -0
- package/dist/licenses/buffer-crc32-0.2.13.txt +20 -0
- package/dist/licenses/buffer-indexof-polyfill-1.0.2.txt +23 -0
- package/dist/licenses/buffers-0.1.1.txt +140 -0
- package/dist/licenses/chainsaw-0.1.0.txt +184 -0
- package/dist/licenses/compress-commons-4.1.2.txt +23 -0
- package/dist/licenses/concat-map-0.0.1.txt +19 -0
- package/dist/licenses/core-util-is-1.0.3.txt +20 -0
- package/dist/licenses/crc-32-1.2.2.txt +202 -0
- package/dist/licenses/crc32-stream-4.0.3.txt +23 -0
- package/dist/licenses/dayjs-1.11.23.txt +22 -0
- package/dist/licenses/duplexer2-0.1.4.txt +27 -0
- package/dist/licenses/end-of-stream-1.4.5.txt +22 -0
- package/dist/licenses/exceljs-4.4.0.txt +23 -0
- package/dist/licenses/fast-csv-4.3.6.txt +22 -0
- package/dist/licenses/fast-png-6.4.0.txt +22 -0
- package/dist/licenses/fs-constants-1.0.0.txt +22 -0
- package/dist/licenses/fs.realpath-1.0.0.txt +44 -0
- package/dist/licenses/fstream-1.0.12.txt +16 -0
- package/dist/licenses/glob-7.2.3.txt +22 -0
- package/dist/licenses/graceful-fs-4.2.11.txt +16 -0
- package/dist/licenses/ieee754-1.2.1.txt +12 -0
- package/dist/licenses/immediate-3.0.6.txt +21 -0
- package/dist/licenses/inflight-1.0.6.txt +16 -0
- package/dist/licenses/inherits-2.0.4.txt +17 -0
- package/dist/licenses/iobuffer-5.4.0.txt +23 -0
- package/dist/licenses/isarray-1.0.0.txt +61 -0
- package/dist/licenses/jszip-3.10.2.txt +652 -0
- package/dist/licenses/lazystream-1.0.1.txt +24 -0
- package/dist/licenses/lie-3.3.0.txt +8 -0
- package/dist/licenses/listenercount-1.0.1.txt +6 -0
- package/dist/licenses/lodash.defaults-4.2.0.txt +48 -0
- package/dist/licenses/lodash.difference-4.5.0.txt +48 -0
- package/dist/licenses/lodash.escaperegexp-4.1.2.txt +48 -0
- package/dist/licenses/lodash.flatten-4.4.0.txt +48 -0
- package/dist/licenses/lodash.groupby-4.6.0.txt +48 -0
- package/dist/licenses/lodash.isboolean-3.0.3.txt +23 -0
- package/dist/licenses/lodash.isequal-4.5.0.txt +48 -0
- package/dist/licenses/lodash.isfunction-3.0.9.txt +48 -0
- package/dist/licenses/lodash.isnil-4.0.0.txt +23 -0
- package/dist/licenses/lodash.isplainobject-4.0.6.txt +48 -0
- package/dist/licenses/lodash.isundefined-3.0.1.txt +23 -0
- package/dist/licenses/lodash.union-4.6.0.txt +48 -0
- package/dist/licenses/lodash.uniq-4.5.0.txt +48 -0
- package/dist/licenses/minimatch-3.1.5.txt +16 -0
- package/dist/licenses/minimatch-5.1.9.txt +16 -0
- package/dist/licenses/minimist-1.2.8.txt +19 -0
- package/dist/licenses/mkdirp-0.5.6.txt +22 -0
- package/dist/licenses/node-sql-parser-5.4.0.txt +202 -0
- package/dist/licenses/normalize-path-3.0.0.txt +22 -0
- package/dist/licenses/once-1.4.0.txt +16 -0
- package/dist/licenses/pako-1.0.11.txt +22 -0
- package/dist/licenses/pako-2.2.0.txt +22 -0
- package/dist/licenses/path-is-absolute-1.0.1.txt +22 -0
- package/dist/licenses/pdf-lib-1.17.1.txt +22 -0
- package/dist/licenses/process-nextick-args-2.0.1.txt +20 -0
- package/dist/licenses/readable-stream-2.3.8.txt +48 -0
- package/dist/licenses/readable-stream-3.6.2.txt +48 -0
- package/dist/licenses/readdir-glob-1.1.3.txt +202 -0
- package/dist/licenses/rimraf-2.7.1.txt +16 -0
- package/dist/licenses/safe-buffer-5.1.2.txt +22 -0
- package/dist/licenses/safe-buffer-5.2.1.txt +22 -0
- package/dist/licenses/saxes-5.0.1.txt +397 -0
- package/dist/licenses/setimmediate-1.0.5.txt +21 -0
- package/dist/licenses/string_decoder-1.1.1.txt +49 -0
- package/dist/licenses/string_decoder-1.3.0.txt +49 -0
- package/dist/licenses/tar-stream-2.2.0.txt +22 -0
- package/dist/licenses/tmp-0.2.7.txt +22 -0
- package/dist/licenses/traverse-0.3.9.txt +25 -0
- package/dist/licenses/tslib-1.14.1.txt +13 -0
- package/dist/licenses/unzipper-0.10.14.txt +26 -0
- package/dist/licenses/util-deprecate-1.0.2.txt +25 -0
- package/dist/licenses/uuid-11.1.1.txt +10 -0
- package/dist/licenses/wrappy-1.0.2.txt +16 -0
- package/dist/licenses/xmlchars-2.2.0.txt +19 -0
- package/dist/licenses/zip-stream-4.1.1.txt +23 -0
- package/dist/matrix-CGRGkn5s.js +112 -0
- package/dist/matrix-gEO7ZM_u.cjs +1 -0
- package/dist/media-B7vnpD8k.cjs +1 -0
- package/dist/media-Y90dHK9z.js +70 -0
- package/dist/param-validation-C3HlcLLO.cjs +1 -0
- package/dist/param-validation-Do7Eg8Zv.js +181 -0
- package/dist/{pdf-8UPQebOE.js → pdf-BwNyeGpt.js} +4385 -4321
- package/dist/{pdf-AyJGb22z.cjs → pdf-CvvrjPQg.cjs} +51 -49
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.d.cts +18 -3
- package/dist/pdf.d.ts +18 -3
- package/dist/pdf.js +2 -2
- package/dist/{plugin-BGKf-Tqg.js → plugin-Ca_XZG3l.js} +2 -2
- package/dist/{plugin-CktLH_Iy.cjs → plugin-DHO7X8z2.cjs} +1 -1
- package/dist/prepared-CFy9B75C.cjs +1 -0
- package/dist/prepared-ajM-H-9B.js +69 -0
- package/dist/progress-B0ctFpKf.cjs +1 -0
- package/dist/progress-D-OTpEav.js +52 -0
- package/dist/record-bindings-By_UKZ2g.cjs +1 -0
- package/dist/record-bindings-Do_b3h4V.js +196 -0
- package/dist/{region-binding-workflow-DEJbhpCv.js → region-binding-workflow-BMhK_TjP.js} +1 -1
- package/dist/{region-binding-workflow-BzfbxRiR.cjs → region-binding-workflow-DIYJdCUr.cjs} +1 -1
- package/dist/{report-params-B44imUd4.js → report-params-B1RzkhJj.js} +1 -1
- package/dist/{report-params-SJfhKgaX.cjs → report-params-WDGrA4oP.cjs} +1 -1
- package/dist/sbom.cdx.json +3982 -0
- package/dist/server/node.d.cts +20 -1
- package/dist/server/node.d.ts +20 -1
- package/dist/server-node.cjs +1 -1
- package/dist/server-node.js +247 -237
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +772 -4
- package/dist/server.d.ts +772 -4
- package/dist/server.js +885 -645
- package/dist/sha256-ArEYjaTI.cjs +1 -0
- package/dist/sha256-DPEuJ3nh.js +155 -0
- package/dist/style.css +1 -1
- package/dist/template-bindings-C2SpvsMU.js +58 -0
- package/dist/template-bindings-CEtWyiLX.cjs +1 -0
- package/dist/template-catalog-FJE_c9Qe.cjs +1 -0
- package/dist/template-catalog-j2B1MJlL.js +414 -0
- package/dist/{template-fragments-CLkGo6To.js → template-fragments-BGbQLGlV.js} +21 -21
- package/dist/{template-fragments-DFUpq5QM.cjs → template-fragments-DcKeiylI.cjs} +1 -1
- package/dist/{template-outline-B3xVkzSv.cjs → template-outline-BwRV_eRo.cjs} +1 -1
- package/dist/{template-outline-CFenM1PV.js → template-outline-cnWfT_LK.js} +3 -3
- package/dist/{template-registry-COXDEJEM.js → template-registry-BtaKPELV.js} +364 -201
- package/dist/template-registry-Co1zPq5e.cjs +1 -0
- package/dist/textwrap-CWHyzkBH.cjs +4 -0
- package/dist/textwrap-DE1kgcJB.js +110 -0
- package/dist/{tree-CqcQ99NM.js → tree-CjVZLRw7.js} +1 -1
- package/dist/vue/async.d.cts +123 -14
- package/dist/vue/async.d.ts +123 -14
- package/dist/vue/index.d.cts +158 -22
- package/dist/vue/index.d.ts +158 -22
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +80 -78
- package/dist/{workbook-session-DNa2RHNG.cjs → workbook-session-Bjv1YCRK.cjs} +18 -18
- package/dist/{workbook-session-BfK1yHOO.js → workbook-session-BvToI-Fd.js} +5440 -5288
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +20 -1
- package/dist/worker.d.ts +20 -1
- package/dist/worker.js +33 -32
- package/dist/xlsx-node.cjs +34 -34
- package/dist/xlsx-node.js +878 -870
- package/dist/xlsx.cjs +3 -4
- package/dist/xlsx.d.cts +22 -10
- package/dist/xlsx.d.ts +22 -10
- package/dist/xlsx.js +261 -253
- package/package.json +2 -2
- package/dist/ParamEditor-CflQV3eQ.js +0 -526
- package/dist/ParamEditor-vIDzvpPV.cjs +0 -1
- package/dist/ReportPreview-CvbqLUzM.cjs +0 -6
- package/dist/ReportPreview-D_ywJ_-H.js +0 -4533
- package/dist/assets-C2U-e-Sz.cjs +0 -4
- package/dist/assets-Q0wUwNrV.js +0 -217
- package/dist/batch-DzaTNLWI.js +0 -371
- package/dist/batch-xMkqYiTr.cjs +0 -1
- package/dist/capabilities-CK_7hizc.js +0 -63
- package/dist/capabilities-CsZ-pNHR.cjs +0 -1
- package/dist/config-0UIohTS7.cjs +0 -1
- package/dist/config-Dt9NtCPl.js +0 -566
- package/dist/data-explanation-BktvER5B.cjs +0 -1
- package/dist/data-explanation-C_J6jYNi.js +0 -16
- package/dist/designer-Ci1LizA9.js +0 -5020
- package/dist/designer-rtmVIIdN.cjs +0 -2
- package/dist/json-snapshot-BeFT3Tso.js +0 -1952
- package/dist/json-snapshot-D1NTP2oI.cjs +0 -2
- package/dist/matrix-DVyWiYsd.cjs +0 -1
- package/dist/matrix-yZsGnldA.js +0 -227
- package/dist/page-window-index-CIuT4BAv.js +0 -43
- package/dist/page-window-index-DEjnM6IB.cjs +0 -1
- package/dist/param-validation-BlHHXs6u.js +0 -153
- package/dist/param-validation-DCK039V1.cjs +0 -1
- package/dist/progress-7OSZbFok.js +0 -39
- package/dist/progress-BnLiS5eH.cjs +0 -1
- package/dist/task-events-DQ276fn2.cjs +0 -1
- package/dist/task-events-Dpsvf_t2.js +0 -47
- package/dist/template-bindings-BJR4k7qZ.cjs +0 -1
- package/dist/template-bindings-Daui7hLF.js +0 -252
- package/dist/template-registry-D3SjENi6.cjs +0 -1
- package/dist/validate-BJ5HIWY8.cjs +0 -1
- package/dist/validate-CkQBWCeg.js +0 -163
package/dist/worker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("./json-snapshot-WWSGlaHG.cjs"),M=require("./prepared-CFy9B75C.cjs"),A=require("./data-explanation-DE55G30w.cjs"),L=require("./template-registry-Co1zPq5e.cjs"),u="mach-report-worker/1";class l extends Error{constructor(r){super(r.message),this.name=r.name,this.code=r.code,this.path=r.path,this.issues=r.issues,this.diagnostics=r.diagnostics}}function f(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function T(e){return f(e)?["rows","pages","cells"].every(r=>typeof e[r]=="number"&&Number.isSafeInteger(e[r])&&e[r]>=0)&&typeof e.durationMs=="number"&&Number.isFinite(e.durationMs)&&e.durationMs>=0:!1}function j(e){return Array.isArray(e)&&e.every(r=>f(r)&&typeof r.code=="string"&&typeof r.message=="string"&&["info","warning","error"].includes(r.severity)&&A.hasValidDataExplanation(r))}function S(e){return f(e)&&Object.values(e).every(r=>f(r)&&(r.revision===void 0||typeof r.revision=="string")&&(r.sourceToken===void 0||typeof r.sourceToken=="string"))}function O(e){return e===void 0?!0:f(e)&&["heuristic","provided","font-bytes"].includes(e.textMetrics)&&(e.fontFingerprint===void 0||typeof e.fontFingerprint=="string"&&/^[a-f0-9]{64}$/.test(e.fontFingerprint))}function F(e,r){if(!f(e)||!T(e.stats)||!j(e.diagnostics)||!S(e.revisions)||!O(e.layout)||!M.validPreparedSources(e.sources))return!1;if(r==="prepare")return L.validateRenderPlan(e.plan).ok;const t=e.format==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";return e.bytes instanceof Uint8Array&&(e.format==="pdf"||e.format==="xlsx")&&e.contentType===t}function x(e){if(!e||typeof e!="object")return{message:String(e)};const r={};for(const t of["code","path","field","message"]){const o=e[t];typeof o=="string"&&(r[t]=o)}return r}function N(e){const r=x(e);if(!f(e))return r;for(const t of["format","severity","kind","nid"])typeof e[t]=="string"&&(r[t]=e[t]);for(const t of["pageIndex","componentIndex"])Number.isSafeInteger(e[t])&&e[t]>=0&&(r[t]=e[t]);return Array.isArray(e.componentPath)&&e.componentPath.every(t=>Number.isSafeInteger(t)&&t>=0)&&(r.componentPath=e.componentPath),r}function z(e){if(!(e instanceof Error))return{name:"Error",message:String(e)};const r=e;return{name:e.name,message:e.message,...typeof r.code=="string"?{code:r.code}:{},...typeof r.path=="string"?{path:r.path}:{},...Array.isArray(r.issues)?{issues:r.issues.map(x)}:{},...Array.isArray(r.diagnostics)?{diagnostics:r.diagnostics.map(N)}:{}}}function _(e){if(!e||typeof e!="object")return!1;const r=e;return r.protocol===u&&typeof r.id=="string"&&(r.operation==="prepare"||r.operation==="export"||r.operation==="exportPrepared")&&!!r.input&&typeof r.input=="object"}async function $(e,r,t){try{const o=r.operation==="prepare"?await e.prepare({...r.input,onEvent:t}):r.operation==="exportPrepared"?await e.exportPrepared({...r.input,onEvent:t}):await e.export({...r.input,onEvent:t});return{protocol:u,id:r.id,result:o}}catch(o){return{protocol:u,id:r.id,error:z(o)}}}function q(e){const r=e.result;return!r||!("bytes"in r)||!(r.bytes.buffer instanceof ArrayBuffer)?[]:[r.bytes.buffer]}function v(e,r){if(!f(e)||typeof e.taskId!="string"||!e.taskId||r.taskId!==void 0&&e.taskId!==r.taskId||e.correlationId!==r.correlationId||e.reportId!==void 0&&(typeof e.reportId!="string"||!("reportIds"in r&&r.reportIds.includes(e.reportId)))||!["query","validate","layout","assets","encode"].includes(e.stage)||!["started","completed","failed"].includes(e.status))return!1;for(const t of["completed","total"])if(e[t]!==void 0&&(typeof e[t]!="number"||!Number.isFinite(e[t])||e[t]<0))return!1;return e.completed===void 0||e.total===void 0||e.completed<=e.total}let B=0;function w(e){const r=new Error("报表 Worker 任务已取消");return r.name="AbortError",Object.defineProperty(r,"cause",{value:e}),r}function D(e,r){if(!e||typeof e!="object")return;const t=e;return t.protocol===u&&t.id===r?t:void 0}function C(e,r={}){const t=r.timeoutMs??12e4;if(!Number.isFinite(t)||t<=0||t>2147483647)throw new RangeError("Worker timeoutMs 应为正有限数字,且不能超过 2147483647");const o=(s,a,n,d)=>n?.aborted?Promise.reject(w(n.reason)):new Promise((I,b)=>{let g;try{g=e()}catch(c){b(c);return}const R=`mach-report-${Date.now()}-${++B}`;let y=!1,E=()=>{},h;const p=(c,i)=>{y||(y=!0,h&&clearTimeout(h),E(),n?.removeEventListener("abort",k),Promise.resolve().then(()=>g.terminate()).then(()=>c===void 0?I(i):b(c),m=>b(c??m)))},k=()=>p(w(n?.reason)),P=c=>{const i=D(c,R);if(!(!i||y)){if("type"in i&&i.type==="event"){const m="event"in i?i.event:void 0;v(m,a)?W.notifyReportTaskEvent(d,m,n):p(new Error("报表 Worker 返回无效阶段事件"));return}i.error&&typeof i.error.name=="string"&&typeof i.error.message=="string"?p(new l(i.error)):F(i.result,s)&&(s==="prepare"||"format"in i.result&&"format"in a&&i.result.format===a.format)?p(void 0,i.result):p(new Error("报表 Worker 返回无效响应"))}};try{if(E=g.subscribe(P,c=>p(c??new Error("报表 Worker 执行失败"))),y){E();return}if(n?.addEventListener("abort",k,{once:!0}),h=setTimeout(()=>p(new l({name:"ReportRuntimeError",code:"timeout",message:`报表 Worker 执行超过 ${t}ms`})),t),n?.aborted)k();else{const{onEvent:c,signal:i,...m}=a;g.postMessage({protocol:u,id:R,operation:s,input:m})}}catch(c){p(c)}});return{exportPrepared:(s,a,n)=>o("exportPrepared",s,a,n),prepare:(s,a,n)=>o("prepare",s,a,n),export:(s,a,n)=>o("export",s,a,n)}}function K(e,r={}){return C(()=>{const t=e();return{postMessage:o=>t.postMessage(o),terminate:()=>t.terminate(),subscribe:(o,s)=>{const a=d=>o(d.data),n=d=>s(d instanceof ErrorEvent?new Error(d.message):new Error("报表 Worker 消息无法解码"));return t.addEventListener("message",a),t.addEventListener("error",n),t.addEventListener("messageerror",n),()=>{t.removeEventListener("message",a),t.removeEventListener("error",n),t.removeEventListener("messageerror",n)}}}},r)}function U(e,r=globalThis){const t=o=>{_(o.data)&&$(e,o.data,s=>r.postMessage({protocol:u,id:o.data.id,type:"event",event:s})).then(s=>r.postMessage(s,q(s)))};return r.addEventListener("message",t),()=>r.removeEventListener("message",t)}exports.ReportWorkerError=l;exports.createBrowserReportExecutor=K;exports.serveReportWorker=U;
|
package/dist/worker.d.cts
CHANGED
|
@@ -181,6 +181,8 @@ declare interface PreparedReport {
|
|
|
181
181
|
revision?: string;
|
|
182
182
|
sourceToken?: string;
|
|
183
183
|
}>;
|
|
184
|
+
/** Ordered occurrences; legacy revisions remains last-value-by-ID for compatibility. */
|
|
185
|
+
sources?: ReportRuntimeSource[];
|
|
184
186
|
/** Captured metrics identity; absence on old saved instances remains supported with diagnostics. */
|
|
185
187
|
layout?: {
|
|
186
188
|
textMetrics: "heuristic" | "provided" | "font-bytes";
|
|
@@ -197,6 +199,8 @@ declare interface RenderPlan {
|
|
|
197
199
|
|
|
198
200
|
/** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
|
|
199
201
|
declare interface ReportCellSource {
|
|
202
|
+
/** Source identity across report occurrences; sharing must be explicitly declared. */
|
|
203
|
+
sourceScope?: string;
|
|
200
204
|
datasetId: string;
|
|
201
205
|
rowKey: string | number;
|
|
202
206
|
field: string;
|
|
@@ -210,6 +214,8 @@ declare interface ReportDataTarget {
|
|
|
210
214
|
rowKey?: string | number;
|
|
211
215
|
/** Use table identity when the same dataset appears in several tables. */
|
|
212
216
|
tableId?: string;
|
|
217
|
+
/** Assigned by the source/runtime when several reports share dataset names. */
|
|
218
|
+
reportScope?: string;
|
|
213
219
|
}
|
|
214
220
|
|
|
215
221
|
declare interface ReportDescription {
|
|
@@ -247,6 +253,10 @@ declare interface ReportParamDef {
|
|
|
247
253
|
label: string;
|
|
248
254
|
value: string;
|
|
249
255
|
}>;
|
|
256
|
+
/** Opaque host-resolved source key. No URL, credentials or executable code is stored. */
|
|
257
|
+
optionsSource?: string;
|
|
258
|
+
/** Select dependencies must be declared parameters; changing a parent clears descendants. */
|
|
259
|
+
dependsOn?: string[];
|
|
250
260
|
defaultValue?: string;
|
|
251
261
|
required?: boolean;
|
|
252
262
|
placeholder?: string;
|
|
@@ -264,7 +274,7 @@ declare interface ReportParamIssue {
|
|
|
264
274
|
message: string;
|
|
265
275
|
}
|
|
266
276
|
|
|
267
|
-
declare type ReportParamIssueCode = "definition" | "required" | "type" | "option" | "minimum" | "maximum" | "minLength" | "maxLength";
|
|
277
|
+
declare type ReportParamIssueCode = "definition" | "required" | "type" | "option" | "dependency" | "minimum" | "maximum" | "minLength" | "maxLength";
|
|
268
278
|
|
|
269
279
|
declare interface ReportParamValidation {
|
|
270
280
|
ok: boolean;
|
|
@@ -338,6 +348,15 @@ declare interface ReportRuntimePreparedExportInput extends ReportTaskMonitoring
|
|
|
338
348
|
signal?: AbortSignal;
|
|
339
349
|
}
|
|
340
350
|
|
|
351
|
+
/** One query occurrence; repeated report IDs retain independent provenance. */
|
|
352
|
+
declare interface ReportRuntimeSource {
|
|
353
|
+
reportId: string;
|
|
354
|
+
reportIndex: number;
|
|
355
|
+
reportScope: string;
|
|
356
|
+
revision?: string;
|
|
357
|
+
sourceToken?: string;
|
|
358
|
+
}
|
|
359
|
+
|
|
341
360
|
declare interface ReportRuntimeStats {
|
|
342
361
|
rows: number;
|
|
343
362
|
pages: number;
|
package/dist/worker.d.ts
CHANGED
|
@@ -181,6 +181,8 @@ declare interface PreparedReport {
|
|
|
181
181
|
revision?: string;
|
|
182
182
|
sourceToken?: string;
|
|
183
183
|
}>;
|
|
184
|
+
/** Ordered occurrences; legacy revisions remains last-value-by-ID for compatibility. */
|
|
185
|
+
sources?: ReportRuntimeSource[];
|
|
184
186
|
/** Captured metrics identity; absence on old saved instances remains supported with diagnostics. */
|
|
185
187
|
layout?: {
|
|
186
188
|
textMetrics: "heuristic" | "provided" | "font-bytes";
|
|
@@ -197,6 +199,8 @@ declare interface RenderPlan {
|
|
|
197
199
|
|
|
198
200
|
/** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
|
|
199
201
|
declare interface ReportCellSource {
|
|
202
|
+
/** Source identity across report occurrences; sharing must be explicitly declared. */
|
|
203
|
+
sourceScope?: string;
|
|
200
204
|
datasetId: string;
|
|
201
205
|
rowKey: string | number;
|
|
202
206
|
field: string;
|
|
@@ -210,6 +214,8 @@ declare interface ReportDataTarget {
|
|
|
210
214
|
rowKey?: string | number;
|
|
211
215
|
/** Use table identity when the same dataset appears in several tables. */
|
|
212
216
|
tableId?: string;
|
|
217
|
+
/** Assigned by the source/runtime when several reports share dataset names. */
|
|
218
|
+
reportScope?: string;
|
|
213
219
|
}
|
|
214
220
|
|
|
215
221
|
declare interface ReportDescription {
|
|
@@ -247,6 +253,10 @@ declare interface ReportParamDef {
|
|
|
247
253
|
label: string;
|
|
248
254
|
value: string;
|
|
249
255
|
}>;
|
|
256
|
+
/** Opaque host-resolved source key. No URL, credentials or executable code is stored. */
|
|
257
|
+
optionsSource?: string;
|
|
258
|
+
/** Select dependencies must be declared parameters; changing a parent clears descendants. */
|
|
259
|
+
dependsOn?: string[];
|
|
250
260
|
defaultValue?: string;
|
|
251
261
|
required?: boolean;
|
|
252
262
|
placeholder?: string;
|
|
@@ -264,7 +274,7 @@ declare interface ReportParamIssue {
|
|
|
264
274
|
message: string;
|
|
265
275
|
}
|
|
266
276
|
|
|
267
|
-
declare type ReportParamIssueCode = "definition" | "required" | "type" | "option" | "minimum" | "maximum" | "minLength" | "maxLength";
|
|
277
|
+
declare type ReportParamIssueCode = "definition" | "required" | "type" | "option" | "dependency" | "minimum" | "maximum" | "minLength" | "maxLength";
|
|
268
278
|
|
|
269
279
|
declare interface ReportParamValidation {
|
|
270
280
|
ok: boolean;
|
|
@@ -338,6 +348,15 @@ declare interface ReportRuntimePreparedExportInput extends ReportTaskMonitoring
|
|
|
338
348
|
signal?: AbortSignal;
|
|
339
349
|
}
|
|
340
350
|
|
|
351
|
+
/** One query occurrence; repeated report IDs retain independent provenance. */
|
|
352
|
+
declare interface ReportRuntimeSource {
|
|
353
|
+
reportId: string;
|
|
354
|
+
reportIndex: number;
|
|
355
|
+
reportScope: string;
|
|
356
|
+
revision?: string;
|
|
357
|
+
sourceToken?: string;
|
|
358
|
+
}
|
|
359
|
+
|
|
341
360
|
declare interface ReportRuntimeStats {
|
|
342
361
|
rows: number;
|
|
343
362
|
pages: number;
|
package/dist/worker.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { o as M } from "./json-snapshot-DFb2eWkf.js";
|
|
2
|
+
import { d as W } from "./prepared-ajM-H-9B.js";
|
|
3
|
+
import { h as A } from "./data-explanation-B8MZRYVS.js";
|
|
4
|
+
import { a as L } from "./template-registry-BtaKPELV.js";
|
|
4
5
|
const u = "mach-report-worker/1";
|
|
5
6
|
class R extends Error {
|
|
6
7
|
constructor(r) {
|
|
@@ -10,21 +11,21 @@ class R extends Error {
|
|
|
10
11
|
function p(e) {
|
|
11
12
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
12
13
|
}
|
|
13
|
-
function L(e) {
|
|
14
|
-
return p(e) ? ["rows", "pages", "cells"].every((r) => typeof e[r] == "number" && Number.isSafeInteger(e[r]) && e[r] >= 0) && typeof e.durationMs == "number" && Number.isFinite(e.durationMs) && e.durationMs >= 0 : !1;
|
|
15
|
-
}
|
|
16
14
|
function T(e) {
|
|
17
|
-
return
|
|
15
|
+
return p(e) ? ["rows", "pages", "cells"].every((r) => typeof e[r] == "number" && Number.isSafeInteger(e[r]) && e[r] >= 0) && typeof e.durationMs == "number" && Number.isFinite(e.durationMs) && e.durationMs >= 0 : !1;
|
|
18
16
|
}
|
|
19
17
|
function j(e) {
|
|
20
|
-
return
|
|
18
|
+
return Array.isArray(e) && e.every((r) => p(r) && typeof r.code == "string" && typeof r.message == "string" && ["info", "warning", "error"].includes(r.severity) && A(r));
|
|
21
19
|
}
|
|
22
20
|
function O(e) {
|
|
21
|
+
return p(e) && Object.values(e).every((r) => p(r) && (r.revision === void 0 || typeof r.revision == "string") && (r.sourceToken === void 0 || typeof r.sourceToken == "string"));
|
|
22
|
+
}
|
|
23
|
+
function F(e) {
|
|
23
24
|
return e === void 0 ? !0 : p(e) && ["heuristic", "provided", "font-bytes"].includes(e.textMetrics) && (e.fontFingerprint === void 0 || typeof e.fontFingerprint == "string" && /^[a-f0-9]{64}$/.test(e.fontFingerprint));
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
if (!p(e) || !
|
|
27
|
-
if (r === "prepare") return
|
|
26
|
+
function N(e, r) {
|
|
27
|
+
if (!p(e) || !T(e.stats) || !j(e.diagnostics) || !O(e.revisions) || !F(e.layout) || !W(e.sources)) return !1;
|
|
28
|
+
if (r === "prepare") return L(e.plan).ok;
|
|
28
29
|
const t = e.format === "pdf" ? "application/pdf" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
29
30
|
return e.bytes instanceof Uint8Array && (e.format === "pdf" || e.format === "xlsx") && e.contentType === t;
|
|
30
31
|
}
|
|
@@ -37,14 +38,14 @@ function x(e) {
|
|
|
37
38
|
}
|
|
38
39
|
return r;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function S(e) {
|
|
41
42
|
const r = x(e);
|
|
42
43
|
if (!p(e)) return r;
|
|
43
44
|
for (const t of ["format", "severity", "kind", "nid"]) typeof e[t] == "string" && (r[t] = e[t]);
|
|
44
45
|
for (const t of ["pageIndex", "componentIndex"]) Number.isSafeInteger(e[t]) && e[t] >= 0 && (r[t] = e[t]);
|
|
45
46
|
return Array.isArray(e.componentPath) && e.componentPath.every((t) => Number.isSafeInteger(t) && t >= 0) && (r.componentPath = e.componentPath), r;
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function z(e) {
|
|
48
49
|
if (!(e instanceof Error)) return { name: "Error", message: String(e) };
|
|
49
50
|
const r = e;
|
|
50
51
|
return {
|
|
@@ -53,27 +54,27 @@ function S(e) {
|
|
|
53
54
|
...typeof r.code == "string" ? { code: r.code } : {},
|
|
54
55
|
...typeof r.path == "string" ? { path: r.path } : {},
|
|
55
56
|
...Array.isArray(r.issues) ? { issues: r.issues.map(x) } : {},
|
|
56
|
-
...Array.isArray(r.diagnostics) ? { diagnostics: r.diagnostics.map(
|
|
57
|
+
...Array.isArray(r.diagnostics) ? { diagnostics: r.diagnostics.map(S) } : {}
|
|
57
58
|
};
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function _(e) {
|
|
60
61
|
if (!e || typeof e != "object") return !1;
|
|
61
62
|
const r = e;
|
|
62
63
|
return r.protocol === u && typeof r.id == "string" && (r.operation === "prepare" || r.operation === "export" || r.operation === "exportPrepared") && !!r.input && typeof r.input == "object";
|
|
63
64
|
}
|
|
64
|
-
async function
|
|
65
|
+
async function $(e, r, t) {
|
|
65
66
|
try {
|
|
66
67
|
const o = r.operation === "prepare" ? await e.prepare({ ...r.input, onEvent: t }) : r.operation === "exportPrepared" ? await e.exportPrepared({ ...r.input, onEvent: t }) : await e.export({ ...r.input, onEvent: t });
|
|
67
68
|
return { protocol: u, id: r.id, result: o };
|
|
68
69
|
} catch (o) {
|
|
69
|
-
return { protocol: u, id: r.id, error:
|
|
70
|
+
return { protocol: u, id: r.id, error: z(o) };
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function D(e) {
|
|
73
74
|
const r = e.result;
|
|
74
75
|
return !r || !("bytes" in r) || !(r.bytes.buffer instanceof ArrayBuffer) ? [] : [r.bytes.buffer];
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
+
function B(e, r) {
|
|
77
78
|
if (!p(e) || typeof e.taskId != "string" || !e.taskId || r.taskId !== void 0 && e.taskId !== r.taskId || e.correlationId !== r.correlationId || e.reportId !== void 0 && (typeof e.reportId != "string" || !("reportIds" in r && r.reportIds.includes(e.reportId))) || !["query", "validate", "layout", "assets", "encode"].includes(e.stage) || !["started", "completed", "failed"].includes(e.status)) return !1;
|
|
78
79
|
for (const t of ["completed", "total"]) if (e[t] !== void 0 && (typeof e[t] != "number" || !Number.isFinite(e[t]) || e[t] < 0)) return !1;
|
|
79
80
|
return e.completed === void 0 || e.total === void 0 || e.completed <= e.total;
|
|
@@ -83,12 +84,12 @@ function w(e) {
|
|
|
83
84
|
const r = new Error("报表 Worker 任务已取消");
|
|
84
85
|
return r.name = "AbortError", Object.defineProperty(r, "cause", { value: e }), r;
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function C(e, r) {
|
|
87
88
|
if (!e || typeof e != "object") return;
|
|
88
89
|
const t = e;
|
|
89
90
|
return t.protocol === u && t.id === r ? t : void 0;
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
+
function K(e, r = {}) {
|
|
92
93
|
const t = r.timeoutMs ?? 12e4;
|
|
93
94
|
if (!Number.isFinite(t) || t <= 0 || t > 2147483647) throw new RangeError("Worker timeoutMs 应为正有限数字,且不能超过 2147483647");
|
|
94
95
|
const o = (s, a, n, d) => n?.aborted ? Promise.reject(w(n.reason)) : new Promise((I, b) => {
|
|
@@ -107,19 +108,19 @@ function C(e, r = {}) {
|
|
|
107
108
|
() => c === void 0 ? I(i) : b(c),
|
|
108
109
|
(m) => b(c ?? m)
|
|
109
110
|
));
|
|
110
|
-
}, k = () => f(w(n?.reason)),
|
|
111
|
-
const i =
|
|
111
|
+
}, k = () => f(w(n?.reason)), P = (c) => {
|
|
112
|
+
const i = C(c, l);
|
|
112
113
|
if (!(!i || y)) {
|
|
113
114
|
if ("type" in i && i.type === "event") {
|
|
114
115
|
const m = "event" in i ? i.event : void 0;
|
|
115
|
-
|
|
116
|
+
B(m, a) ? M(d, m, n) : f(new Error("报表 Worker 返回无效阶段事件"));
|
|
116
117
|
return;
|
|
117
118
|
}
|
|
118
|
-
i.error && typeof i.error.name == "string" && typeof i.error.message == "string" ? f(new R(i.error)) :
|
|
119
|
+
i.error && typeof i.error.name == "string" && typeof i.error.message == "string" ? f(new R(i.error)) : N(i.result, s) && (s === "prepare" || "format" in i.result && "format" in a && i.result.format === a.format) ? f(void 0, i.result) : f(new Error("报表 Worker 返回无效响应"));
|
|
119
120
|
}
|
|
120
121
|
};
|
|
121
122
|
try {
|
|
122
|
-
if (E = g.subscribe(
|
|
123
|
+
if (E = g.subscribe(P, (c) => f(c ?? new Error("报表 Worker 执行失败"))), y) {
|
|
123
124
|
E();
|
|
124
125
|
return;
|
|
125
126
|
}
|
|
@@ -134,8 +135,8 @@ function C(e, r = {}) {
|
|
|
134
135
|
});
|
|
135
136
|
return { exportPrepared: (s, a, n) => o("exportPrepared", s, a, n), prepare: (s, a, n) => o("prepare", s, a, n), export: (s, a, n) => o("export", s, a, n) };
|
|
136
137
|
}
|
|
137
|
-
function
|
|
138
|
-
return
|
|
138
|
+
function J(e, r = {}) {
|
|
139
|
+
return K(() => {
|
|
139
140
|
const t = e();
|
|
140
141
|
return {
|
|
141
142
|
postMessage: (o) => t.postMessage(o),
|
|
@@ -149,14 +150,14 @@ function G(e, r = {}) {
|
|
|
149
150
|
};
|
|
150
151
|
}, r);
|
|
151
152
|
}
|
|
152
|
-
function
|
|
153
|
+
function Q(e, r = globalThis) {
|
|
153
154
|
const t = (o) => {
|
|
154
|
-
|
|
155
|
+
_(o.data) && $(e, o.data, (s) => r.postMessage({ protocol: u, id: o.data.id, type: "event", event: s })).then((s) => r.postMessage(s, D(s)));
|
|
155
156
|
};
|
|
156
157
|
return r.addEventListener("message", t), () => r.removeEventListener("message", t);
|
|
157
158
|
}
|
|
158
159
|
export {
|
|
159
160
|
R as ReportWorkerError,
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
J as createBrowserReportExecutor,
|
|
162
|
+
Q as serveReportWorker
|
|
162
163
|
};
|