@things-factory/kpi 10.1.248 → 10.1.249
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/dist-client/bootstrap.d.ts +2 -0
- package/dist-client/bootstrap.js +7 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/charts/kpi-boxplot-chart.d.ts +24 -0
- package/dist-client/charts/kpi-boxplot-chart.js +324 -0
- package/dist-client/charts/kpi-boxplot-chart.js.map +1 -0
- package/dist-client/charts/kpi-mini-trend-chart.d.ts +14 -0
- package/dist-client/charts/kpi-mini-trend-chart.js +148 -0
- package/dist-client/charts/kpi-mini-trend-chart.js.map +1 -0
- package/dist-client/charts/kpi-radar-chart.d.ts +16 -0
- package/dist-client/charts/kpi-radar-chart.js +138 -0
- package/dist-client/charts/kpi-radar-chart.js.map +1 -0
- package/dist-client/charts/kpi-trend-chart.d.ts +25 -0
- package/dist-client/charts/kpi-trend-chart.js +186 -0
- package/dist-client/charts/kpi-trend-chart.js.map +1 -0
- package/dist-client/google-map/common-google-map.d.ts +34 -0
- package/dist-client/google-map/common-google-map.js +333 -0
- package/dist-client/google-map/common-google-map.js.map +1 -0
- package/dist-client/google-map/google-map-loader.d.ts +8 -0
- package/dist-client/google-map/google-map-loader.js +22 -0
- package/dist-client/google-map/google-map-loader.js.map +1 -0
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/kpi/kpi-grade-editor.d.ts +35 -0
- package/dist-client/pages/kpi/kpi-grade-editor.js +165 -0
- package/dist-client/pages/kpi/kpi-grade-editor.js.map +1 -0
- package/dist-client/pages/kpi/kpi-importer.d.ts +23 -0
- package/dist-client/pages/kpi/kpi-importer.js +92 -0
- package/dist-client/pages/kpi/kpi-importer.js.map +1 -0
- package/dist-client/pages/kpi/kpi-list-page.d.ts +136 -0
- package/dist-client/pages/kpi/kpi-list-page.js +948 -0
- package/dist-client/pages/kpi/kpi-list-page.js.map +1 -0
- package/dist-client/pages/kpi/kpi-overview-sample.d.ts +36 -0
- package/dist-client/pages/kpi/kpi-overview-sample.js +264 -0
- package/dist-client/pages/kpi/kpi-overview-sample.js.map +1 -0
- package/dist-client/pages/kpi/kpi-overview.d.ts +14 -0
- package/dist-client/pages/kpi/kpi-overview.js +361 -0
- package/dist-client/pages/kpi/kpi-overview.js.map +1 -0
- package/dist-client/pages/kpi/kpi-tree-page.d.ts +51 -0
- package/dist-client/pages/kpi/kpi-tree-page.js +355 -0
- package/dist-client/pages/kpi/kpi-tree-page.js.map +1 -0
- package/dist-client/pages/kpi/kpi-view.d.ts +12 -0
- package/dist-client/pages/kpi/kpi-view.js +193 -0
- package/dist-client/pages/kpi/kpi-view.js.map +1 -0
- package/dist-client/pages/kpi/kpi-viz-editor.d.ts +19 -0
- package/dist-client/pages/kpi/kpi-viz-editor.js +562 -0
- package/dist-client/pages/kpi/kpi-viz-editor.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.d.ts +17 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js +279 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.d.ts +19 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js +385 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.d.ts +23 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js +465 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.d.ts +8 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js +78 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.d.ts +24 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +440 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.d.ts +33 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +444 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.d.ts +23 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js +369 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +18 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +128 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.d.ts +31 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +493 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +50 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +884 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +12 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +82 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +11 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +65 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +13 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +115 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +15 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +146 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +7 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +86 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +1 -0
- package/dist-client/pages/kpi-history/kpi-history-list-page.d.ts +21 -0
- package/dist-client/pages/kpi-history/kpi-history-list-page.js +160 -0
- package/dist-client/pages/kpi-history/kpi-history-list-page.js.map +1 -0
- package/dist-client/pages/kpi-metric/kpi-metric-importer.d.ts +23 -0
- package/dist-client/pages/kpi-metric/kpi-metric-importer.js +92 -0
- package/dist-client/pages/kpi-metric/kpi-metric-importer.js.map +1 -0
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.d.ts +65 -0
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +415 -0
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.d.ts +52 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +678 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.d.ts +23 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js +75 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.d.ts +64 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +311 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.d.ts +12 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js +175 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.d.ts +35 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js +161 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js.map +1 -0
- package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.d.ts +47 -0
- package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.js +655 -0
- package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.js.map +1 -0
- package/dist-client/pages/kpi-statistic/kpi-statistic-importer.d.ts +23 -0
- package/dist-client/pages/kpi-statistic/kpi-statistic-importer.js +92 -0
- package/dist-client/pages/kpi-statistic/kpi-statistic-importer.js.map +1 -0
- package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.d.ts +65 -0
- package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.js +416 -0
- package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-editor-page.d.ts +50 -0
- package/dist-client/pages/kpi-value/kpi-value-editor-page.js +700 -0
- package/dist-client/pages/kpi-value/kpi-value-editor-page.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.d.ts +23 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.js +92 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +73 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +403 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +47 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-client/viewparts/kpi-metric-input.d.ts +23 -0
- package/dist-client/viewparts/kpi-metric-input.js +140 -0
- package/dist-client/viewparts/kpi-metric-input.js.map +1 -0
- package/dist-client/viewparts/kpi-metric-meta-editor.d.ts +36 -0
- package/dist-client/viewparts/kpi-metric-meta-editor.js +321 -0
- package/dist-client/viewparts/kpi-metric-meta-editor.js.map +1 -0
- package/dist-client/viewparts/metric-input-hint.d.ts +26 -0
- package/dist-client/viewparts/metric-input-hint.js +19 -0
- package/dist-client/viewparts/metric-input-hint.js.map +1 -0
- package/dist-client/viewparts/metric-input.test.d.ts +1 -0
- package/dist-client/viewparts/metric-input.test.js +43 -0
- package/dist-client/viewparts/metric-input.test.js.map +1 -0
- package/dist-client/viewparts/metric-renderer-registry.d.ts +18 -0
- package/dist-client/viewparts/metric-renderer-registry.js +29 -0
- package/dist-client/viewparts/metric-renderer-registry.js.map +1 -0
- package/dist-client/viewparts/ox-grist-editor-metric-input-hint.d.ts +19 -0
- package/dist-client/viewparts/ox-grist-editor-metric-input-hint.js +76 -0
- package/dist-client/viewparts/ox-grist-editor-metric-input-hint.js.map +1 -0
- package/dist-server/calculator/calculator.test.d.ts +1 -0
- package/dist-server/calculator/calculator.test.js +126 -0
- package/dist-server/calculator/calculator.test.js.map +1 -0
- package/dist-server/calculator/evaluator.d.ts +8 -0
- package/dist-server/calculator/evaluator.js +42 -0
- package/dist-server/calculator/evaluator.js.map +1 -0
- package/dist-server/calculator/functions.d.ts +3 -0
- package/dist-server/calculator/functions.js +62 -0
- package/dist-server/calculator/functions.js.map +1 -0
- package/dist-server/calculator/index.d.ts +6 -0
- package/dist-server/calculator/index.js +10 -0
- package/dist-server/calculator/index.js.map +1 -0
- package/dist-server/calculator/parser.d.ts +34 -0
- package/dist-server/calculator/parser.js +185 -0
- package/dist-server/calculator/parser.js.map +1 -0
- package/dist-server/calculator/provider.d.ts +8 -0
- package/dist-server/calculator/provider.js +13 -0
- package/dist-server/calculator/provider.js.map +1 -0
- package/dist-server/calculator/score.d.ts +21 -0
- package/dist-server/calculator/score.js +36 -0
- package/dist-server/calculator/score.js.map +1 -0
- package/dist-server/calculator/score.test.d.ts +1 -0
- package/dist-server/calculator/score.test.js +47 -0
- package/dist-server/calculator/score.test.js.map +1 -0
- package/dist-server/calculator/validate.d.ts +15 -0
- package/dist-server/calculator/validate.js +30 -0
- package/dist-server/calculator/validate.js.map +1 -0
- package/dist-server/calculator/validate.test.d.ts +1 -0
- package/dist-server/calculator/validate.test.js +45 -0
- package/dist-server/calculator/validate.test.js.map +1 -0
- package/dist-server/controllers/index.d.ts +2 -0
- package/dist-server/controllers/index.js +6 -0
- package/dist-server/controllers/index.js.map +1 -0
- package/dist-server/controllers/kpi-metric-value-provider.d.ts +11 -0
- package/dist-server/controllers/kpi-metric-value-provider.js +97 -0
- package/dist-server/controllers/kpi-metric-value-provider.js.map +1 -0
- package/dist-server/controllers/kpi-value-provider.d.ts +11 -0
- package/dist-server/controllers/kpi-value-provider.js +50 -0
- package/dist-server/controllers/kpi-value-provider.js.map +1 -0
- package/dist-server/index.d.ts +5 -0
- package/dist-server/index.js +9 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/migrations/1752190849680-seed-kpi-metrics.d.ts +6 -0
- package/dist-server/migrations/1752190849680-seed-kpi-metrics.js +102 -0
- package/dist-server/migrations/1752190849680-seed-kpi-metrics.js.map +1 -0
- package/dist-server/migrations/1752190849681-seed-kpi.d.ts +5 -0
- package/dist-server/migrations/1752190849681-seed-kpi.js +315 -0
- package/dist-server/migrations/1752190849681-seed-kpi.js.map +1 -0
- package/dist-server/migrations/1752192090123-add-grades-to-kpi.d.ts +7 -0
- package/dist-server/migrations/1752192090123-add-grades-to-kpi.js +51 -0
- package/dist-server/migrations/1752192090123-add-grades-to-kpi.js.map +1 -0
- package/dist-server/migrations/1752192090124-add-kpi-statistics.d.ts +5 -0
- package/dist-server/migrations/1752192090124-add-kpi-statistics.js +710 -0
- package/dist-server/migrations/1752192090124-add-kpi-statistics.js.map +1 -0
- package/dist-server/migrations/1752192090128-seed-kpi-org-scope.d.ts +6 -0
- package/dist-server/migrations/1752192090128-seed-kpi-org-scope.js +111 -0
- package/dist-server/migrations/1752192090128-seed-kpi-org-scope.js.map +1 -0
- package/dist-server/migrations/1752192090129-seed-kpi-values.d.ts +6 -0
- package/dist-server/migrations/1752192090129-seed-kpi-values.js +187 -0
- package/dist-server/migrations/1752192090129-seed-kpi-values.js.map +1 -0
- package/dist-server/migrations/1752192090200-add-meta-to-kpi-metric.d.ts +10 -0
- package/dist-server/migrations/1752192090200-add-meta-to-kpi-metric.js +26 -0
- package/dist-server/migrations/1752192090200-add-meta-to-kpi-metric.js.map +1 -0
- package/dist-server/migrations/1752192090201-backfill-kpi-metric-meta.d.ts +11 -0
- package/dist-server/migrations/1752192090201-backfill-kpi-metric-meta.js +54 -0
- package/dist-server/migrations/1752192090201-backfill-kpi-metric-meta.js.map +1 -0
- package/dist-server/migrations/grade-data/x11-performance-table.json +962 -0
- package/dist-server/migrations/grade-data/x12-performance-table.json +611 -0
- package/dist-server/migrations/grade-data/x14-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x21-performance-table.json +889 -0
- package/dist-server/migrations/grade-data/x22-performance-table.json +1064 -0
- package/dist-server/migrations/grade-data/x23-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x31-performance-table.json +644 -0
- package/dist-server/migrations/grade-data/x32-performance-table.json +993 -0
- package/dist-server/migrations/grade-data/x33-performance-table.json +195 -0
- package/dist-server/migrations/grade-data/x34-performance-table.json +12 -0
- package/dist-server/migrations/grade-data/x35-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x41-performance-table.json +825 -0
- package/dist-server/migrations/grade-data/x42-performance-table.json +786 -0
- package/dist-server/migrations/grade-data/x43-performance-table.json +12 -0
- package/dist-server/migrations/grade-data/x44-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x51-performance-table.json +924 -0
- package/dist-server/migrations/grade-data/x52-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x61-performance-table.json +261 -0
- package/dist-server/migrations/grade-data/x62-performance-table.json +42 -0
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/migrations/seed-data/kpi-metrics-seed.json +517 -0
- package/dist-server/migrations/seed-data/kpi-org-scope-seed.json +1676 -0
- package/dist-server/migrations/seed-data/kpi-scopes-seed.json +121 -0
- package/dist-server/migrations/seed-data/kpi-values-seed.json +402 -0
- package/dist-server/migrations/seed-data/kpis-seed.json +488 -0
- package/dist-server/migrations/seed-data/scope-definitions-seed.json +90 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/routes.js +72 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/index.d.ts +15 -0
- package/dist-server/service/index.js +49 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/kpi/aggregate-kpi.d.ts +8 -0
- package/dist-server/service/kpi/aggregate-kpi.js +123 -0
- package/dist-server/service/kpi/aggregate-kpi.js.map +1 -0
- package/dist-server/service/kpi/event-subscriber.d.ts +9 -0
- package/dist-server/service/kpi/event-subscriber.js +31 -0
- package/dist-server/service/kpi/event-subscriber.js.map +1 -0
- package/dist-server/service/kpi/index.d.ts +8 -0
- package/dist-server/service/kpi/index.js +12 -0
- package/dist-server/service/kpi/index.js.map +1 -0
- package/dist-server/service/kpi/kpi-formula.service.d.ts +49 -0
- package/dist-server/service/kpi/kpi-formula.service.js +165 -0
- package/dist-server/service/kpi/kpi-formula.service.js.map +1 -0
- package/dist-server/service/kpi/kpi-grade.types.d.ts +22 -0
- package/dist-server/service/kpi/kpi-grade.types.js +3 -0
- package/dist-server/service/kpi/kpi-grade.types.js.map +1 -0
- package/dist-server/service/kpi/kpi-history.d.ts +29 -0
- package/dist-server/service/kpi/kpi-history.js +148 -0
- package/dist-server/service/kpi/kpi-history.js.map +1 -0
- package/dist-server/service/kpi/kpi-mutation.d.ts +14 -0
- package/dist-server/service/kpi/kpi-mutation.js +553 -0
- package/dist-server/service/kpi/kpi-mutation.js.map +1 -0
- package/dist-server/service/kpi/kpi-query.d.ts +24 -0
- package/dist-server/service/kpi/kpi-query.js +309 -0
- package/dist-server/service/kpi/kpi-query.js.map +1 -0
- package/dist-server/service/kpi/kpi-type.d.ts +48 -0
- package/dist-server/service/kpi/kpi-type.js +221 -0
- package/dist-server/service/kpi/kpi-type.js.map +1 -0
- package/dist-server/service/kpi/kpi.d.ts +130 -0
- package/dist-server/service/kpi/kpi.js +356 -0
- package/dist-server/service/kpi/kpi.js.map +1 -0
- package/dist-server/service/kpi-alert/index.d.ts +2 -0
- package/dist-server/service/kpi-alert/index.js +6 -0
- package/dist-server/service/kpi-alert/index.js.map +1 -0
- package/dist-server/service/kpi-alert/kpi-alert-query.d.ts +4 -0
- package/dist-server/service/kpi-alert/kpi-alert-query.js +72 -0
- package/dist-server/service/kpi-alert/kpi-alert-query.js.map +1 -0
- package/dist-server/service/kpi-alert/kpi-alert-type.d.ts +8 -0
- package/dist-server/service/kpi-alert/kpi-alert-type.js +33 -0
- package/dist-server/service/kpi-alert/kpi-alert-type.js.map +1 -0
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.d.ts +8 -0
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.js +126 -0
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.js.map +1 -0
- package/dist-server/service/kpi-metric/index.d.ts +6 -0
- package/dist-server/service/kpi-metric/index.js +10 -0
- package/dist-server/service/kpi-metric/index.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-meta.d.ts +46 -0
- package/dist-server/service/kpi-metric/kpi-metric-meta.js +27 -0
- package/dist-server/service/kpi-metric/kpi-metric-meta.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-meta.test.d.ts +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-meta.test.js +43 -0
- package/dist-server/service/kpi-metric/kpi-metric-meta.test.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-mutation.d.ts +10 -0
- package/dist-server/service/kpi-metric/kpi-metric-mutation.js +296 -0
- package/dist-server/service/kpi-metric/kpi-metric-mutation.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-query.d.ts +14 -0
- package/dist-server/service/kpi-metric/kpi-metric-query.js +126 -0
- package/dist-server/service/kpi-metric/kpi-metric-query.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric-type.d.ts +45 -0
- package/dist-server/service/kpi-metric/kpi-metric-type.js +177 -0
- package/dist-server/service/kpi-metric/kpi-metric-type.js.map +1 -0
- package/dist-server/service/kpi-metric/kpi-metric.d.ts +39 -0
- package/dist-server/service/kpi-metric/kpi-metric.js +174 -0
- package/dist-server/service/kpi-metric/kpi-metric.js.map +1 -0
- package/dist-server/service/kpi-metric-value/index.d.ts +6 -0
- package/dist-server/service/kpi-metric-value/index.js +10 -0
- package/dist-server/service/kpi-metric-value/index.js.map +1 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +11 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +283 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.d.ts +13 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js +106 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js.map +1 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-type.d.ts +26 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-type.js +112 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-type.js.map +1 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value.d.ts +23 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value.js +107 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value.js.map +1 -0
- package/dist-server/service/kpi-org-scope/index.d.ts +5 -0
- package/dist-server/service/kpi-org-scope/index.js +9 -0
- package/dist-server/service/kpi-org-scope/index.js.map +1 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-mutation.d.ts +8 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-mutation.js +170 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-mutation.js.map +1 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-query.d.ts +14 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-query.js +152 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-query.js.map +1 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-type.d.ts +26 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-type.js +101 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-type.js.map +1 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope.d.ts +26 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope.js +135 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope.js.map +1 -0
- package/dist-server/service/kpi-scope/index.d.ts +9 -0
- package/dist-server/service/kpi-scope/index.js +14 -0
- package/dist-server/service/kpi-scope/index.js.map +1 -0
- package/dist-server/service/kpi-scope/kpi-scope-mutation.d.ts +9 -0
- package/dist-server/service/kpi-scope/kpi-scope-mutation.js +140 -0
- package/dist-server/service/kpi-scope/kpi-scope-mutation.js.map +1 -0
- package/dist-server/service/kpi-scope/kpi-scope-query.d.ts +11 -0
- package/dist-server/service/kpi-scope/kpi-scope-query.js +89 -0
- package/dist-server/service/kpi-scope/kpi-scope-query.js.map +1 -0
- package/dist-server/service/kpi-scope/kpi-scope-type.d.ts +35 -0
- package/dist-server/service/kpi-scope/kpi-scope-type.js +138 -0
- package/dist-server/service/kpi-scope/kpi-scope-type.js.map +1 -0
- package/dist-server/service/kpi-scope/kpi-scope.d.ts +38 -0
- package/dist-server/service/kpi-scope/kpi-scope.js +144 -0
- package/dist-server/service/kpi-scope/kpi-scope.js.map +1 -0
- package/dist-server/service/kpi-statistic/index.d.ts +6 -0
- package/dist-server/service/kpi-statistic/index.js +10 -0
- package/dist-server/service/kpi-statistic/index.js.map +1 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-batch.service.d.ts +43 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-batch.service.js +181 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-batch.service.js.map +1 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-calculation.service.d.ts +50 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-calculation.service.js +324 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-calculation.service.js.map +1 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-mutation.d.ts +14 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-mutation.js +279 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-mutation.js.map +1 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-query.d.ts +17 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-query.js +183 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-query.js.map +1 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-type.d.ts +59 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-type.js +200 -0
- package/dist-server/service/kpi-statistic/kpi-statistic-type.js.map +1 -0
- package/dist-server/service/kpi-statistic/kpi-statistic.d.ts +42 -0
- package/dist-server/service/kpi-statistic/kpi-statistic.js +210 -0
- package/dist-server/service/kpi-statistic/kpi-statistic.js.map +1 -0
- package/dist-server/service/kpi-value/index.d.ts +6 -0
- package/dist-server/service/kpi-value/index.js +10 -0
- package/dist-server/service/kpi-value/index.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-mutation.d.ts +13 -0
- package/dist-server/service/kpi-value/kpi-value-mutation.js +447 -0
- package/dist-server/service/kpi-value/kpi-value-mutation.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-query.d.ts +22 -0
- package/dist-server/service/kpi-value/kpi-value-query.js +149 -0
- package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-score.service.d.ts +24 -0
- package/dist-server/service/kpi-value/kpi-value-score.service.js +61 -0
- package/dist-server/service/kpi-value/kpi-value-score.service.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-type.d.ts +33 -0
- package/dist-server/service/kpi-value/kpi-value-type.js +156 -0
- package/dist-server/service/kpi-value/kpi-value-type.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value.d.ts +32 -0
- package/dist-server/service/kpi-value/kpi-value.js +175 -0
- package/dist-server/service/kpi-value/kpi-value.js.map +1 -0
- package/dist-server/service/utils/value-date-util.d.ts +4 -0
- package/dist-server/service/utils/value-date-util.js +117 -0
- package/dist-server/service/utils/value-date-util.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KpiOrgScopeList = exports.KpiOrgScopePatch = exports.NewKpiOrgScope = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const kpi_org_scope_1 = require("./kpi-org-scope");
|
|
7
|
+
let NewKpiOrgScope = class NewKpiOrgScope {
|
|
8
|
+
};
|
|
9
|
+
exports.NewKpiOrgScope = NewKpiOrgScope;
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, type_graphql_1.Field)({ description: 'Organizational unit identifier' }),
|
|
12
|
+
tslib_1.__metadata("design:type", String)
|
|
13
|
+
], NewKpiOrgScope.prototype, "org", void 0);
|
|
14
|
+
tslib_1.__decorate([
|
|
15
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'First scope dimension' }),
|
|
16
|
+
tslib_1.__metadata("design:type", String)
|
|
17
|
+
], NewKpiOrgScope.prototype, "scope01", void 0);
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Second scope dimension' }),
|
|
20
|
+
tslib_1.__metadata("design:type", String)
|
|
21
|
+
], NewKpiOrgScope.prototype, "scope02", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Third scope dimension' }),
|
|
24
|
+
tslib_1.__metadata("design:type", String)
|
|
25
|
+
], NewKpiOrgScope.prototype, "scope03", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Fourth scope dimension' }),
|
|
28
|
+
tslib_1.__metadata("design:type", String)
|
|
29
|
+
], NewKpiOrgScope.prototype, "scope04", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Fifth scope dimension' }),
|
|
32
|
+
tslib_1.__metadata("design:type", String)
|
|
33
|
+
], NewKpiOrgScope.prototype, "scope05", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Human-readable name or description' }),
|
|
36
|
+
tslib_1.__metadata("design:type", String)
|
|
37
|
+
], NewKpiOrgScope.prototype, "displayName", void 0);
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Active status' }),
|
|
40
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
41
|
+
], NewKpiOrgScope.prototype, "active", void 0);
|
|
42
|
+
exports.NewKpiOrgScope = NewKpiOrgScope = tslib_1.__decorate([
|
|
43
|
+
(0, type_graphql_1.InputType)({ description: 'Input type for creating a new KPI org-scope mapping' })
|
|
44
|
+
], NewKpiOrgScope);
|
|
45
|
+
let KpiOrgScopePatch = class KpiOrgScopePatch {
|
|
46
|
+
};
|
|
47
|
+
exports.KpiOrgScopePatch = KpiOrgScopePatch;
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'ID of the org-scope mapping to update' }),
|
|
50
|
+
tslib_1.__metadata("design:type", String)
|
|
51
|
+
], KpiOrgScopePatch.prototype, "id", void 0);
|
|
52
|
+
tslib_1.__decorate([
|
|
53
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Organizational unit identifier' }),
|
|
54
|
+
tslib_1.__metadata("design:type", String)
|
|
55
|
+
], KpiOrgScopePatch.prototype, "org", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'First scope dimension' }),
|
|
58
|
+
tslib_1.__metadata("design:type", String)
|
|
59
|
+
], KpiOrgScopePatch.prototype, "scope01", void 0);
|
|
60
|
+
tslib_1.__decorate([
|
|
61
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Second scope dimension' }),
|
|
62
|
+
tslib_1.__metadata("design:type", String)
|
|
63
|
+
], KpiOrgScopePatch.prototype, "scope02", void 0);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Third scope dimension' }),
|
|
66
|
+
tslib_1.__metadata("design:type", String)
|
|
67
|
+
], KpiOrgScopePatch.prototype, "scope03", void 0);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Fourth scope dimension' }),
|
|
70
|
+
tslib_1.__metadata("design:type", String)
|
|
71
|
+
], KpiOrgScopePatch.prototype, "scope04", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Fifth scope dimension' }),
|
|
74
|
+
tslib_1.__metadata("design:type", String)
|
|
75
|
+
], KpiOrgScopePatch.prototype, "scope05", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Human-readable name or description' }),
|
|
78
|
+
tslib_1.__metadata("design:type", String)
|
|
79
|
+
], KpiOrgScopePatch.prototype, "displayName", void 0);
|
|
80
|
+
tslib_1.__decorate([
|
|
81
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Active status' }),
|
|
82
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
83
|
+
], KpiOrgScopePatch.prototype, "active", void 0);
|
|
84
|
+
exports.KpiOrgScopePatch = KpiOrgScopePatch = tslib_1.__decorate([
|
|
85
|
+
(0, type_graphql_1.InputType)({ description: 'Input type for updating an existing KPI org-scope mapping' })
|
|
86
|
+
], KpiOrgScopePatch);
|
|
87
|
+
let KpiOrgScopeList = class KpiOrgScopeList {
|
|
88
|
+
};
|
|
89
|
+
exports.KpiOrgScopeList = KpiOrgScopeList;
|
|
90
|
+
tslib_1.__decorate([
|
|
91
|
+
(0, type_graphql_1.Field)(type => [kpi_org_scope_1.KpiOrgScope], { description: 'Array of KPI org-scope mappings' }),
|
|
92
|
+
tslib_1.__metadata("design:type", Array)
|
|
93
|
+
], KpiOrgScopeList.prototype, "items", void 0);
|
|
94
|
+
tslib_1.__decorate([
|
|
95
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Total count of items' }),
|
|
96
|
+
tslib_1.__metadata("design:type", Number)
|
|
97
|
+
], KpiOrgScopeList.prototype, "total", void 0);
|
|
98
|
+
exports.KpiOrgScopeList = KpiOrgScopeList = tslib_1.__decorate([
|
|
99
|
+
(0, type_graphql_1.ObjectType)({ description: 'List of KPI org-scope mappings with pagination' })
|
|
100
|
+
], KpiOrgScopeList);
|
|
101
|
+
//# sourceMappingURL=kpi-org-scope-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-org-scope-type.js","sourceRoot":"","sources":["../../../server/service/kpi-org-scope/kpi-org-scope-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,mDAA6C;AAGtC,IAAM,cAAc,GAApB,MAAM,cAAc;CAwB1B,CAAA;AAxBY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;;2CAC9C;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE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CAAC;;iDACjD;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;;iDAChD;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;;iDACjD;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;;iDAChD;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;;qDACzD;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;;gDACxC;2BA1BL,gBAAgB;IAD5B,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,2DAA2D,EAAE,CAAC;GAC3E,gBAAgB,CA2B5B;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAM3B,CAAA;AANY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,2BAAW,CAAC,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;;8CAC7D;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;;8CAC/C;0BALF,eAAe;IAD3B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,gDAAgD,EAAE,CAAC;GACjE,eAAe,CAM3B","sourcesContent":["import { InputType, Field, ID, ObjectType, Int } from 'type-graphql'\nimport { KpiOrgScope } from './kpi-org-scope'\n\n@InputType({ description: 'Input type for creating a new KPI org-scope mapping' })\nexport class NewKpiOrgScope {\n @Field({ description: 'Organizational unit identifier' })\n org: string\n\n @Field({ nullable: true, description: 'First scope dimension' })\n scope01?: string\n\n @Field({ nullable: true, description: 'Second scope dimension' })\n scope02?: string\n\n @Field({ nullable: true, description: 'Third scope dimension' })\n scope03?: string\n\n @Field({ nullable: true, description: 'Fourth scope dimension' })\n scope04?: string\n\n @Field({ nullable: true, description: 'Fifth scope dimension' })\n scope05?: string\n\n @Field({ nullable: true, description: 'Human-readable name or description' })\n displayName?: string\n\n @Field({ nullable: true, description: 'Active status' })\n active?: boolean\n}\n\n@InputType({ description: 'Input type for updating an existing KPI org-scope mapping' })\nexport class KpiOrgScopePatch {\n @Field(type => ID, { description: 'ID of the org-scope mapping to update' })\n id: string\n\n @Field({ nullable: true, description: 'Organizational unit identifier' })\n org?: string\n\n @Field({ nullable: true, description: 'First scope dimension' })\n scope01?: string\n\n @Field({ nullable: true, description: 'Second scope dimension' })\n scope02?: string\n\n @Field({ nullable: true, description: 'Third scope dimension' })\n scope03?: string\n\n @Field({ nullable: true, description: 'Fourth scope dimension' })\n scope04?: string\n\n @Field({ nullable: true, description: 'Fifth scope dimension' })\n scope05?: string\n\n @Field({ nullable: true, description: 'Human-readable name or description' })\n displayName?: string\n\n @Field({ nullable: true, description: 'Active status' })\n active?: boolean\n}\n\n@ObjectType({ description: 'List of KPI org-scope mappings with pagination' })\nexport class KpiOrgScopeList {\n @Field(type => [KpiOrgScope], { description: 'Array of KPI org-scope mappings' })\n items: KpiOrgScope[]\n\n @Field(type => Int, { description: 'Total count of items' })\n total: number\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EntityManager } from 'typeorm';
|
|
2
|
+
import { Domain } from '@things-factory/shell';
|
|
3
|
+
import { User } from '@things-factory/auth-base';
|
|
4
|
+
export declare class KpiOrgScope {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
domain?: Domain;
|
|
7
|
+
domainId?: string;
|
|
8
|
+
entityType: string;
|
|
9
|
+
entityId: string;
|
|
10
|
+
entityName: string;
|
|
11
|
+
org?: string;
|
|
12
|
+
scope01?: string;
|
|
13
|
+
scope02?: string;
|
|
14
|
+
scope03?: string;
|
|
15
|
+
scope04?: string;
|
|
16
|
+
scope05?: string;
|
|
17
|
+
createdAt?: Date;
|
|
18
|
+
updatedAt?: Date;
|
|
19
|
+
creator?: User;
|
|
20
|
+
creatorId?: string;
|
|
21
|
+
updater?: User;
|
|
22
|
+
updaterId?: string;
|
|
23
|
+
getReferencedEntity(entityManager: EntityManager): Promise<any>;
|
|
24
|
+
validateEntityReference(entityManager: EntityManager): Promise<boolean>;
|
|
25
|
+
get displayName(): string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KpiOrgScope = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
+
let KpiOrgScope = class KpiOrgScope {
|
|
10
|
+
// Helper methods for Generic Reference Pattern
|
|
11
|
+
async getReferencedEntity(entityManager) {
|
|
12
|
+
try {
|
|
13
|
+
const repository = entityManager.getRepository(this.entityType);
|
|
14
|
+
return await repository.findOne({ where: { id: this.entityId } });
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
console.warn(`Failed to get referenced entity ${this.entityType}:${this.entityId}`, error);
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async validateEntityReference(entityManager) {
|
|
22
|
+
try {
|
|
23
|
+
const entity = await this.getReferencedEntity(entityManager);
|
|
24
|
+
return !!entity;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// Convenience getter for display purposes
|
|
31
|
+
get displayName() {
|
|
32
|
+
return this.entityName || `${this.entityType}:${this.entityId}` || this.org || 'Unknown';
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.KpiOrgScope = KpiOrgScope;
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
38
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for this org-scope mapping.' }),
|
|
39
|
+
tslib_1.__metadata("design:type", String)
|
|
40
|
+
], KpiOrgScope.prototype, "id", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
43
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Domain (tenant) to which this org-scope mapping belongs.' }),
|
|
44
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
45
|
+
], KpiOrgScope.prototype, "domain", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.RelationId)((orgScope) => orgScope.domain),
|
|
48
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'ID of the domain (tenant) for this org-scope mapping.' }),
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
50
|
+
], KpiOrgScope.prototype, "domainId", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, typeorm_1.Column)(),
|
|
53
|
+
(0, type_graphql_1.Field)({ description: 'Type of the referenced business entity (e.g., Project, Department, Company, Employee)' }),
|
|
54
|
+
tslib_1.__metadata("design:type", String)
|
|
55
|
+
], KpiOrgScope.prototype, "entityType", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.Column)(),
|
|
58
|
+
(0, type_graphql_1.Field)({ description: 'ID of the referenced business entity' }),
|
|
59
|
+
tslib_1.__metadata("design:type", String)
|
|
60
|
+
], KpiOrgScope.prototype, "entityId", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, typeorm_1.Column)(),
|
|
63
|
+
(0, type_graphql_1.Field)({ description: 'Name of the referenced business entity (denormalized for performance and convenience)' }),
|
|
64
|
+
tslib_1.__metadata("design:type", String)
|
|
65
|
+
], KpiOrgScope.prototype, "entityName", void 0);
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
68
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Legacy org field for backward compatibility' }),
|
|
69
|
+
tslib_1.__metadata("design:type", String)
|
|
70
|
+
], KpiOrgScope.prototype, "org", void 0);
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
73
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'First scope dimension (e.g., geographical region, business unit)' }),
|
|
74
|
+
tslib_1.__metadata("design:type", String)
|
|
75
|
+
], KpiOrgScope.prototype, "scope01", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
78
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Second scope dimension (e.g., product line, customer segment)' }),
|
|
79
|
+
tslib_1.__metadata("design:type", String)
|
|
80
|
+
], KpiOrgScope.prototype, "scope02", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
83
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Third scope dimension (e.g., process type, technology stack)' }),
|
|
84
|
+
tslib_1.__metadata("design:type", String)
|
|
85
|
+
], KpiOrgScope.prototype, "scope03", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
88
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Fourth scope dimension (e.g., cost center, profit center)' }),
|
|
89
|
+
tslib_1.__metadata("design:type", String)
|
|
90
|
+
], KpiOrgScope.prototype, "scope04", void 0);
|
|
91
|
+
tslib_1.__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
93
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Fifth scope dimension (e.g., risk level, priority tier)' }),
|
|
94
|
+
tslib_1.__metadata("design:type", String)
|
|
95
|
+
], KpiOrgScope.prototype, "scope05", void 0);
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
98
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when this org-scope mapping was created.' }),
|
|
99
|
+
tslib_1.__metadata("design:type", Date)
|
|
100
|
+
], KpiOrgScope.prototype, "createdAt", void 0);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
103
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Timestamp when this org-scope mapping was last updated.' }),
|
|
104
|
+
tslib_1.__metadata("design:type", Date)
|
|
105
|
+
], KpiOrgScope.prototype, "updatedAt", void 0);
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
108
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who created this org-scope mapping.' }),
|
|
109
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
110
|
+
], KpiOrgScope.prototype, "creator", void 0);
|
|
111
|
+
tslib_1.__decorate([
|
|
112
|
+
(0, typeorm_1.RelationId)((orgScope) => orgScope.creator),
|
|
113
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'ID of the user who created this org-scope mapping.' }),
|
|
114
|
+
tslib_1.__metadata("design:type", String)
|
|
115
|
+
], KpiOrgScope.prototype, "creatorId", void 0);
|
|
116
|
+
tslib_1.__decorate([
|
|
117
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
118
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who last updated this org-scope mapping.' }),
|
|
119
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
120
|
+
], KpiOrgScope.prototype, "updater", void 0);
|
|
121
|
+
tslib_1.__decorate([
|
|
122
|
+
(0, typeorm_1.RelationId)((orgScope) => orgScope.updater),
|
|
123
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'ID of the user who last updated this org-scope mapping.' }),
|
|
124
|
+
tslib_1.__metadata("design:type", String)
|
|
125
|
+
], KpiOrgScope.prototype, "updaterId", void 0);
|
|
126
|
+
exports.KpiOrgScope = KpiOrgScope = tslib_1.__decorate([
|
|
127
|
+
(0, typeorm_1.Entity)(),
|
|
128
|
+
(0, typeorm_1.Index)('ix_kpi_org_scope_0', (orgScope) => [orgScope.domain, orgScope.entityType, orgScope.entityId], {
|
|
129
|
+
unique: true
|
|
130
|
+
}),
|
|
131
|
+
(0, type_graphql_1.ObjectType)({
|
|
132
|
+
description: 'KPI organization scope mapping entity. Maps business entities to various scope dimensions for KPI analysis using generic reference pattern.'
|
|
133
|
+
})
|
|
134
|
+
], KpiOrgScope);
|
|
135
|
+
//# sourceMappingURL=kpi-org-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-org-scope.js","sourceRoot":"","sources":["../../../server/service/kpi-org-scope/kpi-org-scope.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAAoD;AAEpD,iDAA8C;AAC9C,yDAAgD;AAUzC,IAAM,WAAW,GAAjB,MAAM,WAAW;IAyEtB,+CAA+C;IAC/C,KAAK,CAAC,mBAAmB,CAAC,aAA4B;QACpD,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;YAC/D,OAAO,MAAM,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;QACnE,CAAC;QAAC,OAAO,KAAK,EAAE,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EAAE,CAAC,QAAqB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE;QACjH,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC;QACV,WAAW,EACT,6IAA6I;KAChJ,CAAC;GACW,WAAW,CAiGvB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n EntityManager\n} from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n@Entity()\n@Index('ix_kpi_org_scope_0', (orgScope: KpiOrgScope) => [orgScope.domain, orgScope.entityType, orgScope.entityId], {\n unique: true\n})\n@ObjectType({\n description:\n 'KPI organization scope mapping entity. Maps business entities to various scope dimensions for KPI analysis using generic reference pattern.'\n})\nexport class KpiOrgScope {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for this org-scope mapping.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true, description: 'Domain (tenant) to which this org-scope mapping belongs.' })\n domain?: Domain\n\n @RelationId((orgScope: KpiOrgScope) => orgScope.domain)\n @Field({ nullable: true, description: 'ID of the domain (tenant) for this org-scope mapping.' })\n domainId?: string\n\n @Column()\n @Field({ description: 'Type of the referenced business entity (e.g., Project, Department, Company, Employee)' })\n entityType: string\n\n @Column()\n @Field({ description: 'ID of the referenced business entity' })\n entityId: string\n\n @Column()\n @Field({ description: 'Name of the referenced business entity (denormalized for performance and convenience)' })\n entityName: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Legacy org field for backward compatibility' })\n org?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'First scope dimension (e.g., geographical region, business unit)' })\n scope01?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Second scope dimension (e.g., product line, customer segment)' })\n scope02?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Third scope dimension (e.g., process type, technology stack)' })\n scope03?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fourth scope dimension (e.g., cost center, profit center)' })\n scope04?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fifth scope dimension (e.g., risk level, priority tier)' })\n scope05?: string\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when this org-scope mapping was created.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Timestamp when this org-scope mapping was last updated.' })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created this org-scope mapping.' })\n creator?: User\n\n @RelationId((orgScope: KpiOrgScope) => orgScope.creator)\n @Field({ nullable: true, description: 'ID of the user who created this org-scope mapping.' })\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who last updated this org-scope mapping.' })\n updater?: User\n\n @RelationId((orgScope: KpiOrgScope) => orgScope.updater)\n @Field({ nullable: true, description: 'ID of the user who last updated this org-scope mapping.' })\n updaterId?: string\n\n // Helper methods for Generic Reference Pattern\n async getReferencedEntity(entityManager: EntityManager): Promise<any> {\n try {\n const repository = entityManager.getRepository(this.entityType)\n return await repository.findOne({ where: { id: this.entityId } })\n } catch (error) {\n console.warn(`Failed to get referenced entity ${this.entityType}:${this.entityId}`, error)\n return null\n }\n }\n\n async validateEntityReference(entityManager: EntityManager): Promise<boolean> {\n try {\n const entity = await this.getReferencedEntity(entityManager)\n return !!entity\n } catch {\n return false\n }\n }\n\n // Convenience getter for display purposes\n get displayName(): string {\n return this.entityName || `${this.entityType}:${this.entityId}` || this.org || 'Unknown'\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { KpiScope } from './kpi-scope';
|
|
2
|
+
import { KpiScopeQuery } from './kpi-scope-query';
|
|
3
|
+
import { KpiScopeMutation } from './kpi-scope-mutation';
|
|
4
|
+
export declare const entities: (typeof KpiScope)[];
|
|
5
|
+
export declare const resolvers: (typeof KpiScopeQuery | typeof KpiScopeMutation)[];
|
|
6
|
+
export * from './kpi-scope';
|
|
7
|
+
export * from './kpi-scope-query';
|
|
8
|
+
export * from './kpi-scope-mutation';
|
|
9
|
+
export * from './kpi-scope-type';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const kpi_scope_1 = require("./kpi-scope");
|
|
6
|
+
const kpi_scope_query_1 = require("./kpi-scope-query");
|
|
7
|
+
const kpi_scope_mutation_1 = require("./kpi-scope-mutation");
|
|
8
|
+
exports.entities = [kpi_scope_1.KpiScope];
|
|
9
|
+
exports.resolvers = [kpi_scope_query_1.KpiScopeQuery, kpi_scope_mutation_1.KpiScopeMutation];
|
|
10
|
+
tslib_1.__exportStar(require("./kpi-scope"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./kpi-scope-query"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./kpi-scope-mutation"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./kpi-scope-type"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/kpi-scope/index.ts"],"names":[],"mappings":";;;;AAAA,2CAAsC;AACtC,uDAAiD;AACjD,6DAAuD;AAE1C,QAAA,QAAQ,GAAG,CAAC,oBAAQ,CAAC,CAAA;AACrB,QAAA,SAAS,GAAG,CAAC,+BAAa,EAAE,qCAAgB,CAAC,CAAA;AAE1D,sDAA2B;AAC3B,4DAAiC;AACjC,+DAAoC;AACpC,2DAAgC","sourcesContent":["import { KpiScope } from './kpi-scope'\nimport { KpiScopeQuery } from './kpi-scope-query'\nimport { KpiScopeMutation } from './kpi-scope-mutation'\n\nexport const entities = [KpiScope]\nexport const resolvers = [KpiScopeQuery, KpiScopeMutation]\n\nexport * from './kpi-scope'\nexport * from './kpi-scope-query'\nexport * from './kpi-scope-mutation'\nexport * from './kpi-scope-type'\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { KpiScope } from './kpi-scope';
|
|
2
|
+
import { NewKpiScope, KpiScopePatch } from './kpi-scope-type';
|
|
3
|
+
export declare class KpiScopeMutation {
|
|
4
|
+
createKpiScope(kpiScope: NewKpiScope, context: ResolverContext): Promise<KpiScope>;
|
|
5
|
+
updateKpiScope(id: string, patch: KpiScopePatch, context: ResolverContext): Promise<KpiScope>;
|
|
6
|
+
updateMultipleKpiScope(patches: KpiScopePatch[], context: ResolverContext): Promise<KpiScope[]>;
|
|
7
|
+
deleteKpiScope(id: string, context: ResolverContext): Promise<boolean>;
|
|
8
|
+
deleteKpiScopes(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KpiScopeMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const kpi_scope_1 = require("./kpi-scope");
|
|
9
|
+
const kpi_scope_type_1 = require("./kpi-scope-type");
|
|
10
|
+
let KpiScopeMutation = class KpiScopeMutation {
|
|
11
|
+
async createKpiScope(kpiScope, context) {
|
|
12
|
+
const { domain, user, tx } = context.state;
|
|
13
|
+
const result = await (0, shell_1.getRepository)(kpi_scope_1.KpiScope, tx).save({
|
|
14
|
+
...kpiScope,
|
|
15
|
+
domain,
|
|
16
|
+
creator: user,
|
|
17
|
+
updater: user
|
|
18
|
+
});
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
async updateKpiScope(id, patch, context) {
|
|
22
|
+
const { domain, user, tx } = context.state;
|
|
23
|
+
const repository = (0, shell_1.getRepository)(kpi_scope_1.KpiScope, tx);
|
|
24
|
+
const kpiScope = await repository.findOne({
|
|
25
|
+
where: { domain: { id: domain.id }, id }
|
|
26
|
+
});
|
|
27
|
+
const result = await repository.save({
|
|
28
|
+
...kpiScope,
|
|
29
|
+
...patch,
|
|
30
|
+
updater: user
|
|
31
|
+
});
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
async updateMultipleKpiScope(patches, context) {
|
|
35
|
+
const { domain, user, tx } = context.state;
|
|
36
|
+
let results = [];
|
|
37
|
+
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
38
|
+
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
39
|
+
const kpiScopeRepo = (0, shell_1.getRepository)(kpi_scope_1.KpiScope, tx);
|
|
40
|
+
if (_createRecords.length > 0) {
|
|
41
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
42
|
+
const newRecord = _createRecords[i];
|
|
43
|
+
const result = await kpiScopeRepo.save({
|
|
44
|
+
...newRecord,
|
|
45
|
+
domain,
|
|
46
|
+
creator: user,
|
|
47
|
+
updater: user
|
|
48
|
+
});
|
|
49
|
+
results.push({ ...result, cuFlag: '+' });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (_updateRecords.length > 0) {
|
|
53
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
54
|
+
const updateRecord = _updateRecords[i];
|
|
55
|
+
const kpiScope = await kpiScopeRepo.findOne({
|
|
56
|
+
where: { domain: { id: domain.id }, id: updateRecord.id }
|
|
57
|
+
});
|
|
58
|
+
if (!kpiScope) {
|
|
59
|
+
throw new Error(`failed to find kpiScope to update: ${updateRecord.id}`);
|
|
60
|
+
}
|
|
61
|
+
const result = await kpiScopeRepo.save({
|
|
62
|
+
...kpiScope,
|
|
63
|
+
...updateRecord,
|
|
64
|
+
updater: user
|
|
65
|
+
});
|
|
66
|
+
results.push({ ...result, cuFlag: 'M' });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return results;
|
|
70
|
+
}
|
|
71
|
+
async deleteKpiScope(id, context) {
|
|
72
|
+
const { domain, tx } = context.state;
|
|
73
|
+
await (0, shell_1.getRepository)(kpi_scope_1.KpiScope, tx).delete({ domain: { id: domain.id }, id });
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
async deleteKpiScopes(ids, context) {
|
|
77
|
+
const { domain, tx } = context.state;
|
|
78
|
+
await (0, shell_1.getRepository)(kpi_scope_1.KpiScope, tx).delete({
|
|
79
|
+
domain: { id: domain.id },
|
|
80
|
+
id: (0, typeorm_1.In)(ids)
|
|
81
|
+
});
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
exports.KpiScopeMutation = KpiScopeMutation;
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
88
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "mutation", domainOwnerGranted: true, superUserGranted: true)'),
|
|
89
|
+
(0, type_graphql_1.Mutation)(returns => kpi_scope_1.KpiScope, { description: 'Create a new scope dimension definition' }),
|
|
90
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('kpiScope')),
|
|
91
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
92
|
+
tslib_1.__metadata("design:type", Function),
|
|
93
|
+
tslib_1.__metadata("design:paramtypes", [kpi_scope_type_1.NewKpiScope, Object]),
|
|
94
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
95
|
+
], KpiScopeMutation.prototype, "createKpiScope", null);
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
98
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "mutation", domainOwnerGranted: true, superUserGranted: true)'),
|
|
99
|
+
(0, type_graphql_1.Mutation)(returns => kpi_scope_1.KpiScope, { description: 'Update a scope dimension definition' }),
|
|
100
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
101
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
102
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
103
|
+
tslib_1.__metadata("design:type", Function),
|
|
104
|
+
tslib_1.__metadata("design:paramtypes", [String, kpi_scope_type_1.KpiScopePatch, Object]),
|
|
105
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
106
|
+
], KpiScopeMutation.prototype, "updateKpiScope", null);
|
|
107
|
+
tslib_1.__decorate([
|
|
108
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
109
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "mutation", domainOwnerGranted: true, superUserGranted: true)'),
|
|
110
|
+
(0, type_graphql_1.Mutation)(returns => [kpi_scope_1.KpiScope], { description: "Update multiple scope dimension definitions" }),
|
|
111
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [kpi_scope_type_1.KpiScopePatch])),
|
|
112
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
113
|
+
tslib_1.__metadata("design:type", Function),
|
|
114
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
115
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
116
|
+
], KpiScopeMutation.prototype, "updateMultipleKpiScope", null);
|
|
117
|
+
tslib_1.__decorate([
|
|
118
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
119
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "mutation", domainOwnerGranted: true, superUserGranted: true)'),
|
|
120
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'Delete a scope dimension definition' }),
|
|
121
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
122
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
123
|
+
tslib_1.__metadata("design:type", Function),
|
|
124
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
125
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
126
|
+
], KpiScopeMutation.prototype, "deleteKpiScope", null);
|
|
127
|
+
tslib_1.__decorate([
|
|
128
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
129
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "mutation", domainOwnerGranted: true, superUserGranted: true)'),
|
|
130
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'Delete multiple scope dimension definitions' }),
|
|
131
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
132
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
133
|
+
tslib_1.__metadata("design:type", Function),
|
|
134
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
135
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
136
|
+
], KpiScopeMutation.prototype, "deleteKpiScopes", null);
|
|
137
|
+
exports.KpiScopeMutation = KpiScopeMutation = tslib_1.__decorate([
|
|
138
|
+
(0, type_graphql_1.Resolver)(kpi_scope_1.KpiScope)
|
|
139
|
+
], KpiScopeMutation);
|
|
140
|
+
//# sourceMappingURL=kpi-scope-mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-scope-mutation.js","sourceRoot":"","sources":["../../../server/service/kpi-scope/kpi-scope-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,iDAAqD;AAGrD,2CAAsC;AACtC,qDAA6D;AAGtD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAIrB,A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AAE,WAAW,EAAE,6CAA6C,EAAE,CAAC;IAE1F,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDAUP;2BA3HU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,oBAAQ,CAAC;GACN,gBAAgB,CA6H5B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { getRepository } from '@things-factory/shell'\nimport type ResolverContext from '@things-factory/auth-base'\n\nimport { KpiScope } from './kpi-scope'\nimport { NewKpiScope, KpiScopePatch } from './kpi-scope-type'\n\n@Resolver(KpiScope)\nexport class KpiScopeMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"kpi\", privilege: \"mutation\", domainOwnerGranted: true, superUserGranted: true)')\n @Mutation(returns => KpiScope, { description: 'Create a new scope dimension definition' })\n async createKpiScope(\n @Arg('kpiScope') kpiScope: NewKpiScope,\n @Ctx() context: ResolverContext\n ): Promise<KpiScope> {\n const { domain, user, tx } = context.state\n\n const result = await getRepository(KpiScope, tx).save({\n ...kpiScope,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"kpi\", privilege: \"mutation\", domainOwnerGranted: true, superUserGranted: true)')\n @Mutation(returns => KpiScope, { description: 'Update a scope dimension definition' })\n async updateKpiScope(\n @Arg('id') id: string,\n @Arg('patch') patch: KpiScopePatch,\n @Ctx() context: ResolverContext\n ): Promise<KpiScope> {\n const { domain, user, tx } = context.state\n\n const repository = getRepository(KpiScope, tx)\n const kpiScope = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...kpiScope,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"kpi\", privilege: \"mutation\", domainOwnerGranted: true, superUserGranted: true)')\n @Mutation(returns => [KpiScope], { description: \"Update multiple scope dimension definitions\" })\n async updateMultipleKpiScope(\n @Arg('patches', type => [KpiScopePatch]) patches: KpiScopePatch[],\n @Ctx() context: ResolverContext\n ): Promise<KpiScope[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const kpiScopeRepo = getRepository(KpiScope, tx)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await kpiScopeRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const kpiScope = await kpiScopeRepo.findOne({\n where: { domain: { id: domain.id }, id: updateRecord.id }\n })\n\n if (!kpiScope) {\n throw new Error(`failed to find kpiScope to update: ${updateRecord.id}`)\n }\n\n const result = await kpiScopeRepo.save({\n ...kpiScope,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"kpi\", privilege: \"mutation\", domainOwnerGranted: true, superUserGranted: true)')\n @Mutation(returns => Boolean, { description: 'Delete a scope dimension definition' })\n async deleteKpiScope(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(KpiScope, tx).delete({ domain: { id: domain.id }, id })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"kpi\", privilege: \"mutation\", domainOwnerGranted: true, superUserGranted: true)')\n @Mutation(returns => Boolean, { description: 'Delete multiple scope dimension definitions' })\n async deleteKpiScopes(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await getRepository(KpiScope, tx).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n\n}"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Domain, ListParam } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
import { KpiScope } from './kpi-scope';
|
|
4
|
+
import { KpiScopeList } from './kpi-scope-type';
|
|
5
|
+
export declare class KpiScopeQuery {
|
|
6
|
+
kpiScope(id: string, context: ResolverContext): Promise<KpiScope>;
|
|
7
|
+
kpiScopes(params: ListParam, context: ResolverContext): Promise<KpiScopeList>;
|
|
8
|
+
domain(kpiScope: KpiScope): Promise<Domain>;
|
|
9
|
+
updater(kpiScope: KpiScope): Promise<User>;
|
|
10
|
+
creator(kpiScope: KpiScope): Promise<User>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KpiScopeQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const shell_1 = require("@things-factory/shell");
|
|
7
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
|
+
const kpi_scope_1 = require("./kpi-scope");
|
|
9
|
+
const kpi_scope_type_1 = require("./kpi-scope-type");
|
|
10
|
+
let KpiScopeQuery = class KpiScopeQuery {
|
|
11
|
+
async kpiScope(id, context) {
|
|
12
|
+
const { domain } = context.state;
|
|
13
|
+
return await (0, shell_1.getRepository)(kpi_scope_1.KpiScope).findOne({
|
|
14
|
+
where: { domain: { id: domain.id }, id }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async kpiScopes(params, context) {
|
|
18
|
+
const { domain } = context.state;
|
|
19
|
+
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
20
|
+
domain,
|
|
21
|
+
params,
|
|
22
|
+
repository: await (0, shell_1.getRepository)(kpi_scope_1.KpiScope),
|
|
23
|
+
searchables: ['name', 'description'],
|
|
24
|
+
filtersMap: {
|
|
25
|
+
level: { columnName: 'level' },
|
|
26
|
+
scopeType: { columnName: 'scopeType' },
|
|
27
|
+
parentLevel: { columnName: 'parentLevel' },
|
|
28
|
+
active: { columnName: 'active' },
|
|
29
|
+
includeInStatistics: { columnName: 'includeInStatistics' },
|
|
30
|
+
showInDashboard: { columnName: 'showInDashboard' }
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
|
34
|
+
return { items, total };
|
|
35
|
+
}
|
|
36
|
+
async domain(kpiScope) {
|
|
37
|
+
return kpiScope.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: kpiScope.domainId }));
|
|
38
|
+
}
|
|
39
|
+
async updater(kpiScope) {
|
|
40
|
+
return kpiScope.updaterId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: kpiScope.updaterId }));
|
|
41
|
+
}
|
|
42
|
+
async creator(kpiScope) {
|
|
43
|
+
return kpiScope.creatorId && (await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: kpiScope.creatorId }));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.KpiScopeQuery = KpiScopeQuery;
|
|
47
|
+
tslib_1.__decorate([
|
|
48
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "query", domainOwnerGranted: true, superUserGranted: true)'),
|
|
49
|
+
(0, type_graphql_1.Query)(returns => kpi_scope_1.KpiScope, { nullable: true, description: 'Fetch a scope dimension definition by ID' }),
|
|
50
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
51
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
52
|
+
tslib_1.__metadata("design:type", Function),
|
|
53
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
54
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
55
|
+
], KpiScopeQuery.prototype, "kpiScope", null);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, type_graphql_1.Query)(returns => kpi_scope_type_1.KpiScopeList, { description: 'Fetch multiple scope dimension definitions' }),
|
|
58
|
+
(0, type_graphql_1.Directive)('@privilege(category: "kpi", privilege: "query", domainOwnerGranted: true, superUserGranted: true)'),
|
|
59
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
|
60
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
61
|
+
tslib_1.__metadata("design:type", Function),
|
|
62
|
+
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
63
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
64
|
+
], KpiScopeQuery.prototype, "kpiScopes", null);
|
|
65
|
+
tslib_1.__decorate([
|
|
66
|
+
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
67
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
68
|
+
tslib_1.__metadata("design:type", Function),
|
|
69
|
+
tslib_1.__metadata("design:paramtypes", [kpi_scope_1.KpiScope]),
|
|
70
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
71
|
+
], KpiScopeQuery.prototype, "domain", null);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
74
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
75
|
+
tslib_1.__metadata("design:type", Function),
|
|
76
|
+
tslib_1.__metadata("design:paramtypes", [kpi_scope_1.KpiScope]),
|
|
77
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
78
|
+
], KpiScopeQuery.prototype, "updater", null);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
81
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
82
|
+
tslib_1.__metadata("design:type", Function),
|
|
83
|
+
tslib_1.__metadata("design:paramtypes", [kpi_scope_1.KpiScope]),
|
|
84
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
85
|
+
], KpiScopeQuery.prototype, "creator", null);
|
|
86
|
+
exports.KpiScopeQuery = KpiScopeQuery = tslib_1.__decorate([
|
|
87
|
+
(0, type_graphql_1.Resolver)(kpi_scope_1.KpiScope)
|
|
88
|
+
], KpiScopeQuery);
|
|
89
|
+
//# sourceMappingURL=kpi-scope-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-scope-query.js","sourceRoot":"","sources":["../../../server/service/kpi-scope/kpi-scope-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAEhD,2CAAsC;AACtC,qDAA+C;AAGxC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGlB,AAAN,KAAK,CAAC,QAAQ,CAAY,EAAU,EAAS,OAAwB;QACnE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,oBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,SAAS,CACY,MAAiB,EACnC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,oBAAQ,CAAC;YACzC,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;YACpC,UAAU,EAAE;gBACV,KA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E,CAAC,oBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;IACzF,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;6CAM3C;AAIK;IAFL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6BAAY,EAAE,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;IAC7F,IAAA,wBAAS,EAAC,mGAAmG,CAAC;IAE5G,mBAAA,IAAA,mBAAI,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC,CAAA;IACvB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAD2B,iBAAS;;8CAuB3C;AAIK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,oBAAQ;;2CAEtC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,oBAAQ;;4CAEvC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,oBAAQ;;4CAEvC;wBArDU,aAAa;IADzB,IAAA,uBAAQ,EAAC,oBAAQ,CAAC;GACN,aAAa,CAsDzB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport type ResolverContext from '@things-factory/auth-base'\nimport { KpiScope } from './kpi-scope'\nimport { KpiScopeList } from './kpi-scope-type'\n\n@Resolver(KpiScope)\nexport class KpiScopeQuery {\n @Directive('@privilege(category: \"kpi\", privilege: \"query\", domainOwnerGranted: true, superUserGranted: true)')\n @Query(returns => KpiScope!, { nullable: true, description: 'Fetch a scope dimension definition by ID' })\n async kpiScope(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<KpiScope> {\n const { domain } = context.state\n\n return await getRepository(KpiScope).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => KpiScopeList, { description: 'Fetch multiple scope dimension definitions' })\n @Directive('@privilege(category: \"kpi\", privilege: \"query\", domainOwnerGranted: true, superUserGranted: true)')\n async kpiScopes(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<KpiScopeList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(KpiScope),\n searchables: ['name', 'description'],\n filtersMap: {\n level: { columnName: 'level' },\n scopeType: { columnName: 'scopeType' },\n parentLevel: { columnName: 'parentLevel' },\n active: { columnName: 'active' },\n includeInStatistics: { columnName: 'includeInStatistics' },\n showInDashboard: { columnName: 'showInDashboard' }\n }\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n\n @FieldResolver(type => Domain)\n async domain(@Root() kpiScope: KpiScope): Promise<Domain> {\n return kpiScope.domainId && (await getRepository(Domain).findOneBy({ id: kpiScope.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() kpiScope: KpiScope): Promise<User> {\n return kpiScope.updaterId && (await getRepository(User).findOneBy({ id: kpiScope.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() kpiScope: KpiScope): Promise<User> {\n return kpiScope.creatorId && (await getRepository(User).findOneBy({ id: kpiScope.creatorId }))\n }\n}"]}
|