farseer-cli 1.18.0 → 1.20.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 +33 -10
- package/dist/commands/app.js +42 -3
- package/dist/commands/app.js.map +1 -2
- package/dist/commands/apps.js.map +0 -1
- package/dist/commands/cells.js +120 -85
- package/dist/commands/cells.js.map +1 -2
- package/dist/commands/code.js.map +0 -1
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/dashboards.js +246 -12
- package/dist/commands/dashboards.js.map +1 -2
- package/dist/commands/diff.js.map +0 -1
- package/dist/commands/dimensions.js +52 -27
- package/dist/commands/dimensions.js.map +1 -2
- package/dist/commands/docs.js +82 -0
- package/dist/commands/docs.js.map +6 -0
- package/dist/commands/files.js +49 -0
- package/dist/commands/files.js.map +2 -3
- package/dist/commands/folders.js +76 -0
- package/dist/commands/folders.js.map +6 -0
- package/dist/commands/formula.js +38 -30
- package/dist/commands/formula.js.map +1 -2
- package/dist/commands/install.js +32 -30
- package/dist/commands/install.js.map +2 -3
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/login.js +3 -3
- package/dist/commands/login.js.map +1 -2
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/mcp-server.js.map +0 -1
- package/dist/commands/model.js +30 -5
- package/dist/commands/model.js.map +2 -3
- package/dist/commands/pipeline.js.map +0 -1
- package/dist/commands/pull.js +1 -1
- package/dist/commands/pull.js.map +1 -2
- package/dist/commands/push.js +6 -4
- package/dist/commands/push.js.map +1 -2
- package/dist/commands/refresh.js.map +0 -1
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/sheets.js +289 -52
- package/dist/commands/sheets.js.map +1 -2
- package/dist/commands/skills.js +157 -0
- package/dist/commands/skills.js.map +6 -0
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/tool.js.map +0 -1
- package/dist/commands/variables.js +246 -82
- package/dist/commands/variables.js.map +1 -2
- package/dist/commands/whoami.js.map +0 -1
- package/dist/index.js +117 -23
- package/dist/index.js.map +1 -2
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/prompts/workflows.js.map +0 -1
- package/dist/mcp/resources/documentation.js +19 -12
- package/dist/mcp/resources/documentation.js.map +1 -2
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/skills.js.map +0 -1
- package/dist/mcp/tools/appTools.js +1 -7
- package/dist/mcp/tools/appTools.js.map +1 -2
- package/dist/mcp/tools/authTools.js +1 -1
- package/dist/mcp/tools/authTools.js.map +1 -2
- package/dist/mcp/tools/cellTools.js +6 -19
- package/dist/mcp/tools/cellTools.js.map +1 -2
- package/dist/mcp/tools/dashboardTools.js +30 -412
- package/dist/mcp/tools/dashboardTools.js.map +2 -3
- package/dist/mcp/tools/dataTools.js +15 -146
- package/dist/mcp/tools/dataTools.js.map +1 -2
- package/dist/mcp/tools/folderTools.js +12 -78
- package/dist/mcp/tools/folderTools.js.map +1 -2
- package/dist/mcp/tools/modelTools.js +23 -372
- package/dist/mcp/tools/modelTools.js.map +1 -2
- package/dist/mcp/tools/pipelineContract.js +5 -1
- package/dist/mcp/tools/pipelineContract.js.map +1 -2
- package/dist/mcp/tools/pipelineTools.js.map +0 -1
- package/dist/mcp/tools/runTools.js +8 -69
- package/dist/mcp/tools/runTools.js.map +1 -2
- package/dist/mcp/tools/sheetTools.js +14 -264
- package/dist/mcp/tools/sheetTools.js.map +1 -2
- package/dist/mcp/tools/syncTools.js +7 -3
- package/dist/mcp/tools/syncTools.js.map +1 -2
- package/dist/mcp/utils/helpers.js.map +0 -1
- package/dist/mcp/utils/launchPin.js.map +0 -1
- package/dist/mcp/utils/operationResponse.js +41 -0
- package/dist/mcp/utils/operationResponse.js.map +6 -0
- package/dist/mcp/utils/registerTool.js.map +0 -1
- package/dist/mcp/utils/session.js.map +0 -1
- package/dist/mcp/utils/tenantPin.js.map +0 -1
- package/dist/operations/cells.js +444 -0
- package/dist/operations/cells.js.map +6 -0
- package/dist/operations/dashboards.js +357 -0
- package/dist/operations/dashboards.js.map +6 -0
- package/dist/operations/data.js +206 -0
- package/dist/operations/data.js.map +6 -0
- package/dist/operations/errors.js +64 -0
- package/dist/operations/errors.js.map +6 -0
- package/dist/operations/exportModel.js +59 -0
- package/dist/operations/exportModel.js.map +6 -0
- package/dist/operations/folderPath.js +128 -0
- package/dist/operations/folderPath.js.map +6 -0
- package/dist/operations/folders.js +80 -0
- package/dist/operations/folders.js.map +6 -0
- package/dist/operations/install.js +109 -0
- package/dist/operations/install.js.map +6 -0
- package/dist/operations/model.js +271 -0
- package/dist/operations/model.js.map +6 -0
- package/dist/operations/sheets.js +428 -0
- package/dist/operations/sheets.js.map +6 -0
- package/dist/pipeline/compatibility.js.map +0 -1
- package/dist/pipeline/connect.js.map +0 -1
- package/dist/pipeline/create.js.map +0 -1
- package/dist/pipeline/errors.js.map +0 -1
- package/dist/pipeline/failStep.js +43 -0
- package/dist/pipeline/failStep.js.map +6 -0
- package/dist/pipeline/generated-reference.json +25 -13
- package/dist/pipeline/guide.js.map +0 -1
- package/dist/pipeline/init.js.map +0 -1
- package/dist/pipeline/operations.js.map +0 -1
- package/dist/pipeline/query.js.map +0 -1
- package/dist/pipeline/queryDownloads.js.map +0 -1
- package/dist/pipeline/queryWorker.js +3 -1
- package/dist/pipeline/queryWorker.js.map +1 -2
- package/dist/pipeline/readiness.js.map +0 -1
- package/dist/pipeline/reference.js.map +0 -1
- package/dist/pipeline/requests.js +3 -32
- package/dist/pipeline/requests.js.map +1 -2
- package/dist/pipeline/runArguments.js.map +0 -1
- package/dist/pipeline/runtime.js.map +0 -1
- package/dist/pipeline/service.js +46 -2
- package/dist/pipeline/service.js.map +1 -2
- package/dist/services/appSyncService.js +59 -9
- package/dist/services/appSyncService.js.map +1 -2
- package/dist/services/apps.js +10 -0
- package/dist/services/apps.js.map +1 -2
- package/dist/services/authErrors.js.map +0 -1
- package/dist/services/codefirst/api.js +38 -5
- package/dist/services/codefirst/api.js.map +1 -2
- package/dist/services/codefirst/binaryDisk.js.map +0 -1
- package/dist/services/codefirst/byteHashes.js +5 -0
- package/dist/services/codefirst/byteHashes.js.map +1 -2
- package/dist/services/codefirst/documents.js +41 -15
- package/dist/services/codefirst/documents.js.map +1 -2
- package/dist/services/codefirst/layoutBinaryProjection.js +24 -13
- package/dist/services/codefirst/layoutBinaryProjection.js.map +1 -2
- package/dist/services/codefirst/layoutCompose.js +44 -38
- package/dist/services/codefirst/layoutCompose.js.map +1 -2
- package/dist/services/codefirst/layoutCore.js +14 -1
- package/dist/services/codefirst/layoutCore.js.map +1 -2
- package/dist/services/codefirst/layoutPaths.js +80 -4
- package/dist/services/codefirst/layoutPaths.js.map +1 -2
- package/dist/services/codefirst/layoutProjection.js +73 -39
- package/dist/services/codefirst/layoutProjection.js.map +1 -2
- package/dist/services/codefirst/layoutReadback.js +357 -130
- package/dist/services/codefirst/layoutReadback.js.map +2 -3
- package/dist/services/codefirst/layoutReadbackPlacement.js +94 -57
- package/dist/services/codefirst/layoutReadbackPlacement.js.map +2 -3
- package/dist/services/codefirst/layoutReceipt.js +283 -243
- package/dist/services/codefirst/layoutReceipt.js.map +2 -3
- package/dist/services/codefirst/layoutScan.js +208 -110
- package/dist/services/codefirst/layoutScan.js.map +1 -2
- package/dist/services/codefirst/output.js +76 -10
- package/dist/services/codefirst/output.js.map +1 -2
- package/dist/services/codefirst/types.js.map +0 -1
- package/dist/services/codefirst/workflow.js +65 -29
- package/dist/services/codefirst/workflow.js.map +2 -3
- package/dist/services/codefirst/workspace.js.map +0 -1
- package/dist/services/codefirst/workspaceLock.js.map +0 -1
- package/dist/services/codefirst/workspaceRoot.js +2 -1
- package/dist/services/codefirst/workspaceRoot.js.map +1 -2
- package/dist/services/configService.js.map +0 -1
- package/dist/services/credentials.js.map +0 -1
- package/dist/services/farseerService.js +31 -7
- package/dist/services/farseerService.js.map +1 -2
- package/dist/services/httpError.js.map +0 -1
- package/dist/services/modelExport.js.map +0 -1
- package/dist/services/organisation.js.map +0 -1
- package/dist/services/preflight.js.map +0 -1
- package/dist/services/realms.js.map +0 -1
- package/dist/services/syncService.js +3 -3
- package/dist/services/syncService.js.map +1 -2
- package/dist/skills/bundled.js +106 -0
- package/dist/skills/bundled.js.map +6 -0
- package/dist/skills/install.js +257 -0
- package/dist/skills/install.js.map +6 -0
- package/dist/skills/pipeline.js +10 -18
- package/dist/skills/pipeline.js.map +1 -2
- package/dist/utils/agentSandbox.js +1 -1
- package/dist/utils/agentSandbox.js.map +0 -1
- package/dist/utils/cliOptions.js.map +0 -1
- package/dist/utils/constants.js.map +0 -1
- package/dist/utils/entityResolver.js +72 -25
- package/dist/utils/entityResolver.js.map +1 -2
- package/dist/utils/errorFormatter.js +72 -11
- package/dist/utils/errorFormatter.js.map +1 -2
- package/dist/utils/fileLogger.js.map +0 -1
- package/dist/utils/fileValidation.js.map +0 -1
- package/dist/utils/folderMatch.js.map +0 -1
- package/dist/utils/formulaFilters.js +11 -2
- package/dist/utils/formulaFilters.js.map +1 -2
- package/dist/utils/helpers.js.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/nameResolver.js.map +0 -1
- package/dist/utils/operationCli.js +102 -0
- package/dist/utils/operationCli.js.map +6 -0
- package/dist/utils/packageManager.js.map +0 -1
- package/dist/utils/syncReporting.js.map +0 -1
- package/dist/utils/syncScope.js.map +0 -1
- package/dist/utils/updateCheck.js.map +0 -1
- package/dist/utils/variableValues.js.map +0 -1
- package/dist/utils/workspace.js.map +0 -1
- package/docs/cli-guide.md +182 -2
- package/docs/import-workflows.md +14 -14
- package/docs/new-app-template.md +1 -1
- package/docs/pipeline-client-guide.md +1 -1
- package/docs/pipeline-reference.md +304 -9
- package/docs/troubleshooting.md +18 -0
- package/package.json +2 -2
- package/skills/farseer-analysis/SKILL.md +132 -0
- package/skills/farseer-app-dev/SKILL.md +131 -0
- package/skills/farseer-app-dev/assignments.md +185 -0
- package/skills/farseer-app-dev/farseer-client-api-guide.md +907 -0
- package/skills/farseer-app-dev/farseer-client-release-notes.md +212 -0
- package/skills/farseer-app-dev/working-patterns.md +876 -0
- package/skills/farseer-authenticate-to-tenant/SKILL.md +60 -0
- package/skills/farseer-authenticate-to-tenant/app-authentication.md +91 -0
- package/skills/farseer-author-import-job/SKILL.md +114 -0
- package/skills/farseer-author-import-job/cell-writes.md +530 -0
- package/skills/farseer-author-import-job/deploying-a-farseer-app.md +383 -0
- package/skills/farseer-author-import-job/import-job-pattern.md +232 -0
- package/skills/farseer-build-model/SKILL.md +122 -0
- package/skills/farseer-build-model/formula-grain-alignment.md +612 -0
- package/skills/farseer-build-model/naming-conventions.md +435 -0
- package/skills/farseer-build-model/sparse-formulas-pattern.md +330 -0
- package/skills/farseer-build-pipeline/SKILL.md +190 -0
- package/skills/farseer-build-pipeline/erp-sales/README.md +108 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_invoice_lines.yaml +23 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_invoice_lines_raw.yaml +23 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_item_product_map.yaml +17 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_item_product_map_raw.yaml +11 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/gold/erp_sales_cells.yaml +40 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_lines.yaml +35 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_recon.yaml +43 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_unmapped_items.yaml +28 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/main.py +49 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells.yaml +17 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells_raw.yaml +14 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/load/erp_sales_to_model.yaml +47 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/main.py +44 -0
- package/skills/farseer-build-pipeline/erp-sales/item_to_product.csv +5 -0
- package/skills/farseer-build-pipeline/pipeline-app-failure-report-pattern.md +103 -0
- package/skills/farseer-build-pipeline/pipeline-source-encoding.md +68 -0
- package/skills/farseer-dashboards/SKILL.md +40 -0
- package/skills/farseer-formulas/SKILL.md +165 -0
- package/skills/farseer-help-center/SKILL.md +66 -0
- package/skills/farseer-model/SKILL.md +119 -0
- package/skills/farseer-modify-model/SKILL.md +158 -0
- package/skills/farseer-modify-model/model-validation-pattern.md +251 -0
- package/skills/farseer-optimize-model/SKILL.md +314 -0
- package/skills/farseer-optimize-model/stats-dump.ts +139 -0
- package/skills/farseer-pnl/SKILL.md +220 -0
- package/skills/farseer-review-model/SKILL.md +172 -0
- package/skills/farseer-run-apps/SKILL.md +102 -0
- package/skills/pipeline-authoring/SKILL.md +7 -5
- package/skills/pipeline-authoring/practices.md +21 -8
- package/dist/services/agentApprovalFetch.js +0 -86
- package/dist/services/agentApprovalFetch.js.map +0 -7
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var dashboardTools_exports = {};
|
|
30
20
|
__export(dashboardTools_exports, {
|
|
@@ -33,48 +23,11 @@ __export(dashboardTools_exports, {
|
|
|
33
23
|
module.exports = __toCommonJS(dashboardTools_exports);
|
|
34
24
|
var import_registerTool = require("../utils/registerTool");
|
|
35
25
|
var import_zod = require("zod");
|
|
36
|
-
var farseer = __toESM(require("farseer-client"));
|
|
37
26
|
var import_session = require("../utils/session");
|
|
38
27
|
var import_helpers = require("../utils/helpers");
|
|
28
|
+
var import_operationResponse = require("../utils/operationResponse");
|
|
39
29
|
var import_errorFormatter = require("../../utils/errorFormatter");
|
|
40
|
-
var
|
|
41
|
-
function getRawApiConfig(nativeClient) {
|
|
42
|
-
const config = nativeClient.dashboards?.configuration || nativeClient._configuration || nativeClient.configuration;
|
|
43
|
-
return {
|
|
44
|
-
basePath: config?.basePath || "",
|
|
45
|
-
headers: config?.headers || {}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
async function rawApiCall(nativeClient, method, path, body) {
|
|
49
|
-
const { basePath, headers } = getRawApiConfig(nativeClient);
|
|
50
|
-
const url = `${basePath}${path}`;
|
|
51
|
-
const response = await fetch(url, {
|
|
52
|
-
method,
|
|
53
|
-
headers: {
|
|
54
|
-
...headers,
|
|
55
|
-
"Content-Type": "application/json"
|
|
56
|
-
},
|
|
57
|
-
body: body !== void 0 ? JSON.stringify(body) : void 0
|
|
58
|
-
});
|
|
59
|
-
if (!response.ok) {
|
|
60
|
-
const text2 = await response.text();
|
|
61
|
-
throw new Error(`HTTP ${response.status} ${response.statusText}: ${text2}`);
|
|
62
|
-
}
|
|
63
|
-
const contentLength = response.headers.get("content-length");
|
|
64
|
-
if (response.status === 204 || contentLength === "0") {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
const text = await response.text();
|
|
68
|
-
return text ? JSON.parse(text) : null;
|
|
69
|
-
}
|
|
70
|
-
async function collectDashboardsWithPaths(client) {
|
|
71
|
-
const items = await (0, import_entityResolver.collectFolderItems)(client, farseer.FolderItemType.Dashboard);
|
|
72
|
-
return items.map((item) => ({
|
|
73
|
-
id: Number(item.reference),
|
|
74
|
-
name: item.name,
|
|
75
|
-
folderPath: item.folderPath.join("/") || "/"
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
30
|
+
var import_dashboards = require("../../operations/dashboards");
|
|
78
31
|
const listDashboardsSchema = {
|
|
79
32
|
includeFolderPath: import_zod.z.boolean().optional().describe("Include folder path for each dashboard (slower, traverses folder tree). Default: false.")
|
|
80
33
|
};
|
|
@@ -97,7 +50,7 @@ const createTileSchema = {
|
|
|
97
50
|
"name": "Tile Name",
|
|
98
51
|
"subtitle": "",
|
|
99
52
|
"footnotes": "",
|
|
100
|
-
"gridPlacements": { "
|
|
53
|
+
"gridPlacements": { "absolute": { "x": 0, "y": 0, "w": 30, "h": 20 } },
|
|
101
54
|
"data": {
|
|
102
55
|
"type": "TEXT" | "SHEET_BACKED" | "DIMENSION_SLICER",
|
|
103
56
|
... type-specific fields
|
|
@@ -117,12 +70,14 @@ const updateTileSchema = {
|
|
|
117
70
|
and deep-merges your changes, so you can pass only the fields you want to change.
|
|
118
71
|
Uses raw API internally (bypasses TypeScript client serialization that strips fields like table/sheet).
|
|
119
72
|
|
|
120
|
-
Example - update
|
|
73
|
+
Example - update the table's row and column styles only:
|
|
121
74
|
{
|
|
122
75
|
"data": {
|
|
123
76
|
"visualization": {
|
|
124
|
-
"
|
|
125
|
-
|
|
77
|
+
"table": {
|
|
78
|
+
"rowStyles": {...},
|
|
79
|
+
"columnVisualizationByKey": {...}
|
|
80
|
+
}
|
|
126
81
|
}
|
|
127
82
|
}
|
|
128
83
|
}`
|
|
@@ -151,34 +106,7 @@ Returns dashboard IDs, names, and tile counts.
|
|
|
151
106
|
Set includeFolderPath=true to also show the folder path for each dashboard
|
|
152
107
|
(this is slower as it traverses the folder tree).`,
|
|
153
108
|
listDashboardsSchema,
|
|
154
|
-
async (params) => {
|
|
155
|
-
const gate = await (0, import_session.requireSession)();
|
|
156
|
-
if (!gate.ok) return gate.response;
|
|
157
|
-
const { tenant, native: nativeClient } = gate.session;
|
|
158
|
-
try {
|
|
159
|
-
if (params.includeFolderPath) {
|
|
160
|
-
const dashboards2 = await collectDashboardsWithPaths(nativeClient);
|
|
161
|
-
return (0, import_helpers.successResponse)({
|
|
162
|
-
tenant,
|
|
163
|
-
totalDashboards: dashboards2.length,
|
|
164
|
-
dashboards: dashboards2
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
const dashboards = await nativeClient.dashboards.list();
|
|
168
|
-
const result = dashboards.map((d) => ({
|
|
169
|
-
id: d.id,
|
|
170
|
-
name: d.name,
|
|
171
|
-
tileCount: d.tiles?.length || 0
|
|
172
|
-
}));
|
|
173
|
-
return (0, import_helpers.successResponse)({
|
|
174
|
-
tenant,
|
|
175
|
-
totalDashboards: result.length,
|
|
176
|
-
dashboards: result
|
|
177
|
-
});
|
|
178
|
-
} catch (error) {
|
|
179
|
-
return (0, import_helpers.errorResponse)(`List dashboards failed: ${await (0, import_errorFormatter.formatClientError)(error)}`, "NETWORK_ERROR");
|
|
180
|
-
}
|
|
181
|
-
}
|
|
109
|
+
async (params) => (0, import_operationResponse.operationResponse)("List dashboards", ({ native }) => (0, import_dashboards.listDashboards)(native, params))
|
|
182
110
|
);
|
|
183
111
|
(0, import_registerTool.registerTool)(
|
|
184
112
|
server,
|
|
@@ -235,39 +163,7 @@ grid placements, and associated sheet IDs for SHEET_BACKED tiles.
|
|
|
235
163
|
|
|
236
164
|
Accepts either a dashboard name or numeric ID.`,
|
|
237
165
|
listTilesSchema,
|
|
238
|
-
async (params) => {
|
|
239
|
-
const gate = await (0, import_session.requireSession)();
|
|
240
|
-
if (!gate.ok) return gate.response;
|
|
241
|
-
const { tenant, native: nativeClient } = gate.session;
|
|
242
|
-
try {
|
|
243
|
-
const dashRef = await (0, import_helpers.resolveEntityForMcp)(nativeClient, "dashboard", params.dashboardNameOrId);
|
|
244
|
-
if ("error" in dashRef) {
|
|
245
|
-
return dashRef.error;
|
|
246
|
-
}
|
|
247
|
-
const tiles = await nativeClient.dashboards.listTiles(dashRef.entity.id);
|
|
248
|
-
const result = tiles.map((t) => {
|
|
249
|
-
const tile = {
|
|
250
|
-
id: t.id,
|
|
251
|
-
name: t.name,
|
|
252
|
-
type: t.data?.type,
|
|
253
|
-
gridPlacements: t.gridPlacements
|
|
254
|
-
};
|
|
255
|
-
if (t.data?.type === "SHEET_BACKED" && t.data?.sheet) {
|
|
256
|
-
tile.sheetId = t.data.sheet.id;
|
|
257
|
-
tile.sheetName = t.data.sheet.name;
|
|
258
|
-
}
|
|
259
|
-
return tile;
|
|
260
|
-
});
|
|
261
|
-
return (0, import_helpers.successResponse)({
|
|
262
|
-
tenant,
|
|
263
|
-
dashboard: { id: dashRef.entity.id, name: dashRef.entity.name },
|
|
264
|
-
totalTiles: result.length,
|
|
265
|
-
tiles: result
|
|
266
|
-
});
|
|
267
|
-
} catch (error) {
|
|
268
|
-
return (0, import_helpers.errorResponse)(`List tiles failed: ${await (0, import_errorFormatter.formatClientError)(error)}`, "NETWORK_ERROR");
|
|
269
|
-
}
|
|
270
|
-
}
|
|
166
|
+
async (params) => (0, import_operationResponse.operationResponse)("List tiles", ({ native }) => (0, import_dashboards.listTiles)(native, params))
|
|
271
167
|
);
|
|
272
168
|
(0, import_registerTool.registerTool)(
|
|
273
169
|
server,
|
|
@@ -283,29 +179,7 @@ with farseer_update_tile.
|
|
|
283
179
|
|
|
284
180
|
Accepts either a dashboard name or numeric ID.`,
|
|
285
181
|
getTileSchema,
|
|
286
|
-
async (params) => {
|
|
287
|
-
const gate = await (0, import_session.requireSession)();
|
|
288
|
-
if (!gate.ok) return gate.response;
|
|
289
|
-
const { tenant, native: nativeClient } = gate.session;
|
|
290
|
-
try {
|
|
291
|
-
const dashRef = await (0, import_helpers.resolveEntityForMcp)(nativeClient, "dashboard", params.dashboardNameOrId);
|
|
292
|
-
if ("error" in dashRef) {
|
|
293
|
-
return dashRef.error;
|
|
294
|
-
}
|
|
295
|
-
const tile = await rawApiCall(
|
|
296
|
-
nativeClient,
|
|
297
|
-
"GET",
|
|
298
|
-
`/dashboards/${dashRef.entity.id}/tiles/${params.tileId}`
|
|
299
|
-
);
|
|
300
|
-
return (0, import_helpers.successResponse)({
|
|
301
|
-
tenant,
|
|
302
|
-
dashboard: { id: dashRef.entity.id, name: dashRef.entity.name },
|
|
303
|
-
tile
|
|
304
|
-
});
|
|
305
|
-
} catch (error) {
|
|
306
|
-
return (0, import_helpers.errorResponse)(`Get tile failed: ${await (0, import_errorFormatter.formatClientError)(error)}`, "NETWORK_ERROR");
|
|
307
|
-
}
|
|
308
|
-
}
|
|
182
|
+
async (params) => (0, import_operationResponse.operationResponse)("Get tile", ({ native }) => (0, import_dashboards.getTile)(native, params))
|
|
309
183
|
);
|
|
310
184
|
(0, import_registerTool.registerTool)(
|
|
311
185
|
server,
|
|
@@ -320,54 +194,16 @@ Tile types:
|
|
|
320
194
|
- SHEET_BACKED: Table/chart tile backed by a sheet. data = { type: "SHEET_BACKED", useDashboardFilters: true, ... }
|
|
321
195
|
- DIMENSION_SLICER: Filter tile. data = { type: "DIMENSION_SLICER", ... }
|
|
322
196
|
|
|
323
|
-
Grid placements
|
|
324
|
-
|
|
197
|
+
Grid placements: dashboards read only the keys absolute (the default fixed grid, 30 px cells)
|
|
198
|
+
and large/small (responsive dashboards, 12 and 6 columns); any other key is refused:
|
|
199
|
+
gridPlacements: { "absolute": { "x": 0, "y": 0, "w": 30, "h": 20 } }
|
|
200
|
+
|
|
201
|
+
A SHEET_BACKED tile gets its own sheet, returned as tile.sheet ({ id, name }). Its rows and columns are lines of
|
|
202
|
+
that sheet.
|
|
325
203
|
|
|
326
204
|
Style options: showBackground, backgroundColor, showBorder, borderColor, hasShadow, showSubtitle, showFootnotes.`,
|
|
327
205
|
createTileSchema,
|
|
328
|
-
async (params) => {
|
|
329
|
-
const gate = await (0, import_session.requireSession)();
|
|
330
|
-
if (!gate.ok) return gate.response;
|
|
331
|
-
const { tenant, native: nativeClient } = gate.session;
|
|
332
|
-
try {
|
|
333
|
-
const dashRef = await (0, import_helpers.resolveEntityForMcp)(nativeClient, "dashboard", params.dashboardNameOrId);
|
|
334
|
-
if ("error" in dashRef) {
|
|
335
|
-
return dashRef.error;
|
|
336
|
-
}
|
|
337
|
-
const tilePayload = { ...params.tile };
|
|
338
|
-
if (tilePayload.subtitle === void 0) tilePayload.subtitle = "";
|
|
339
|
-
if (tilePayload.footnotes === void 0) tilePayload.footnotes = "";
|
|
340
|
-
if (tilePayload.style === void 0) tilePayload.style = {};
|
|
341
|
-
if (tilePayload.data?.type === "SHEET_BACKED") {
|
|
342
|
-
const d = tilePayload.data;
|
|
343
|
-
if (d.useDashboardFilters === void 0) d.useDashboardFilters = true;
|
|
344
|
-
if (d.useDashboardTimeline === void 0) d.useDashboardTimeline = true;
|
|
345
|
-
if (d.showTileFilters === void 0) d.showTileFilters = false;
|
|
346
|
-
if (d.showTileTimeline === void 0) d.showTileTimeline = false;
|
|
347
|
-
if (d.exportConfigurationId === void 0) d.exportConfigurationId = null;
|
|
348
|
-
if (d.visualization === void 0) d.visualization = { type: "TABLE" };
|
|
349
|
-
}
|
|
350
|
-
const result = await rawApiCall(
|
|
351
|
-
nativeClient,
|
|
352
|
-
"POST",
|
|
353
|
-
`/dashboards/${dashRef.entity.id}/tiles`,
|
|
354
|
-
tilePayload
|
|
355
|
-
);
|
|
356
|
-
return (0, import_helpers.successResponse)({
|
|
357
|
-
tenant,
|
|
358
|
-
dashboard: { id: dashRef.entity.id, name: dashRef.entity.name },
|
|
359
|
-
action: "created",
|
|
360
|
-
tile: {
|
|
361
|
-
id: result?.id,
|
|
362
|
-
name: result?.name,
|
|
363
|
-
type: result?.data?.type
|
|
364
|
-
},
|
|
365
|
-
message: `Tile "${params.tile.name || "unnamed"}" created on dashboard "${dashRef.entity.name}"`
|
|
366
|
-
});
|
|
367
|
-
} catch (error) {
|
|
368
|
-
return (0, import_helpers.errorResponse)(`Create tile failed: ${await (0, import_errorFormatter.formatClientError)(error)}`, "NETWORK_ERROR");
|
|
369
|
-
}
|
|
370
|
-
}
|
|
206
|
+
async (params) => (0, import_operationResponse.operationResponse)("Create tile", ({ native }) => (0, import_dashboards.createTile)(native, params))
|
|
371
207
|
);
|
|
372
208
|
(0, import_registerTool.registerTool)(
|
|
373
209
|
server,
|
|
@@ -384,62 +220,20 @@ which strips fields like table/sheet on SHEET_BACKED tiles.
|
|
|
384
220
|
Tip: Use farseer_get_tile first to see the current config, then pass
|
|
385
221
|
only the changes you need.
|
|
386
222
|
|
|
387
|
-
Example -
|
|
223
|
+
Example - make one table row bold (rowStyles is a map keyed by row key):
|
|
388
224
|
{
|
|
389
225
|
"data": {
|
|
390
226
|
"visualization": {
|
|
391
|
-
"
|
|
227
|
+
"table": {
|
|
228
|
+
"rowStyles": { "<rowKey>": { "bold": true } }
|
|
229
|
+
}
|
|
392
230
|
}
|
|
393
231
|
}
|
|
394
232
|
}
|
|
395
233
|
|
|
396
234
|
WARNING: This modifies dashboard configuration. Use with caution.`,
|
|
397
235
|
updateTileSchema,
|
|
398
|
-
async (params) => {
|
|
399
|
-
const gate = await (0, import_session.requireSession)();
|
|
400
|
-
if (!gate.ok) return gate.response;
|
|
401
|
-
const { tenant, native: nativeClient } = gate.session;
|
|
402
|
-
try {
|
|
403
|
-
const dashRef = await (0, import_helpers.resolveEntityForMcp)(nativeClient, "dashboard", params.dashboardNameOrId);
|
|
404
|
-
if ("error" in dashRef) {
|
|
405
|
-
return dashRef.error;
|
|
406
|
-
}
|
|
407
|
-
const currentTile = await rawApiCall(
|
|
408
|
-
nativeClient,
|
|
409
|
-
"GET",
|
|
410
|
-
`/dashboards/${dashRef.entity.id}/tiles/${params.tileId}`
|
|
411
|
-
);
|
|
412
|
-
if (!currentTile) {
|
|
413
|
-
return (0, import_helpers.errorResponse)(
|
|
414
|
-
`Tile ${params.tileId} not found on dashboard "${dashRef.entity.name}"`,
|
|
415
|
-
"NOT_FOUND"
|
|
416
|
-
);
|
|
417
|
-
}
|
|
418
|
-
const replaceSet = new Set(params.replaceKeys || []);
|
|
419
|
-
const newVisType = params.tile?.data?.visualization?.type;
|
|
420
|
-
const curVisType = currentTile?.data?.visualization?.type;
|
|
421
|
-
if (newVisType && curVisType && newVisType !== curVisType) {
|
|
422
|
-
replaceSet.add("visualization");
|
|
423
|
-
}
|
|
424
|
-
const merged = deepMerge(currentTile, params.tile, replaceSet);
|
|
425
|
-
delete merged.id;
|
|
426
|
-
await rawApiCall(
|
|
427
|
-
nativeClient,
|
|
428
|
-
"PUT",
|
|
429
|
-
`/dashboards/${dashRef.entity.id}/tiles/${params.tileId}`,
|
|
430
|
-
merged
|
|
431
|
-
);
|
|
432
|
-
return (0, import_helpers.successResponse)({
|
|
433
|
-
tenant,
|
|
434
|
-
dashboard: { id: dashRef.entity.id, name: dashRef.entity.name },
|
|
435
|
-
action: "updated",
|
|
436
|
-
tileId: params.tileId,
|
|
437
|
-
message: `Tile ${params.tileId} updated on dashboard "${dashRef.entity.name}"`
|
|
438
|
-
});
|
|
439
|
-
} catch (error) {
|
|
440
|
-
return (0, import_helpers.errorResponse)(`Update tile failed: ${await (0, import_errorFormatter.formatClientError)(error)}`, "NETWORK_ERROR");
|
|
441
|
-
}
|
|
442
|
-
}
|
|
236
|
+
async (params) => (0, import_operationResponse.operationResponse)("Update tile", ({ native }) => (0, import_dashboards.updateTile)(native, params))
|
|
443
237
|
);
|
|
444
238
|
(0, import_registerTool.registerTool)(
|
|
445
239
|
server,
|
|
@@ -454,27 +248,7 @@ WARNING: This is destructive and cannot be undone.`,
|
|
|
454
248
|
dashboardNameOrId: import_zod.z.string().describe("Dashboard name or numeric ID"),
|
|
455
249
|
tileId: import_zod.z.number().describe("Tile ID to delete")
|
|
456
250
|
},
|
|
457
|
-
async (params) => {
|
|
458
|
-
const gate = await (0, import_session.requireSession)();
|
|
459
|
-
if (!gate.ok) return gate.response;
|
|
460
|
-
const { tenant, native: nativeClient } = gate.session;
|
|
461
|
-
try {
|
|
462
|
-
const dashRef = await (0, import_helpers.resolveEntityForMcp)(nativeClient, "dashboard", params.dashboardNameOrId);
|
|
463
|
-
if ("error" in dashRef) {
|
|
464
|
-
return dashRef.error;
|
|
465
|
-
}
|
|
466
|
-
await rawApiCall(nativeClient, "DELETE", `/dashboards/${dashRef.entity.id}/tiles/${params.tileId}`);
|
|
467
|
-
return (0, import_helpers.successResponse)({
|
|
468
|
-
tenant,
|
|
469
|
-
dashboard: { id: dashRef.entity.id, name: dashRef.entity.name },
|
|
470
|
-
action: "deleted",
|
|
471
|
-
tileId: params.tileId,
|
|
472
|
-
message: `Tile ${params.tileId} deleted from dashboard "${dashRef.entity.name}"`
|
|
473
|
-
});
|
|
474
|
-
} catch (error) {
|
|
475
|
-
return (0, import_helpers.errorResponse)(`Delete tile failed: ${await (0, import_errorFormatter.formatClientError)(error)}`, "NETWORK_ERROR");
|
|
476
|
-
}
|
|
477
|
-
}
|
|
251
|
+
async (params) => (0, import_operationResponse.operationResponse)("Delete tile", ({ native }) => (0, import_dashboards.deleteTile)(native, params))
|
|
478
252
|
);
|
|
479
253
|
(0, import_registerTool.registerTool)(
|
|
480
254
|
server,
|
|
@@ -493,50 +267,7 @@ If no folder is specified, creates in the root Dashboards folder.`,
|
|
|
493
267
|
folderId: import_zod.z.number().optional().describe("Target folder ID. If omitted, uses root Dashboards folder."),
|
|
494
268
|
folderPath: import_zod.z.array(import_zod.z.string()).optional().describe('Target folder path as array (e.g., ["Dashboards", "Reports"]). Alternative to folderId.')
|
|
495
269
|
},
|
|
496
|
-
async (params) => {
|
|
497
|
-
const gate = await (0, import_session.requireSession)();
|
|
498
|
-
if (!gate.ok) return gate.response;
|
|
499
|
-
const { tenant, native: nativeClient } = gate.session;
|
|
500
|
-
try {
|
|
501
|
-
let targetFolderId = params.folderId ?? 0;
|
|
502
|
-
if (!params.folderId && params.folderPath && params.folderPath.length > 0) {
|
|
503
|
-
const folderResults = await nativeClient.folders.search({
|
|
504
|
-
name: params.folderPath[params.folderPath.length - 1],
|
|
505
|
-
types: [farseer.FolderItemType.Folder],
|
|
506
|
-
limit: 20
|
|
507
|
-
});
|
|
508
|
-
if (folderResults.length > 0) {
|
|
509
|
-
targetFolderId = folderResults[0].id;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
if (targetFolderId === 0) {
|
|
513
|
-
const rootItems = await nativeClient.folders.listItemsBatch([{ id: null }]);
|
|
514
|
-
const dashboardsFolder = rootItems[0]?.items?.find(
|
|
515
|
-
(item) => item.type === farseer.FolderItemType.Folder && item.name.toLowerCase() === "dashboards"
|
|
516
|
-
);
|
|
517
|
-
if (dashboardsFolder) {
|
|
518
|
-
targetFolderId = dashboardsFolder.id;
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
const createRequest = {
|
|
522
|
-
name: params.name,
|
|
523
|
-
folderId: targetFolderId
|
|
524
|
-
};
|
|
525
|
-
const result = await nativeClient.dashboards.create(createRequest);
|
|
526
|
-
return (0, import_helpers.successResponse)({
|
|
527
|
-
tenant,
|
|
528
|
-
action: "created",
|
|
529
|
-
dashboard: {
|
|
530
|
-
id: result.id,
|
|
531
|
-
name: result.name
|
|
532
|
-
},
|
|
533
|
-
folderId: targetFolderId,
|
|
534
|
-
message: `Dashboard "${params.name}" created`
|
|
535
|
-
});
|
|
536
|
-
} catch (error) {
|
|
537
|
-
return (0, import_helpers.errorResponse)(`Create dashboard failed: ${await (0, import_errorFormatter.formatClientError)(error)}`, "NETWORK_ERROR");
|
|
538
|
-
}
|
|
539
|
-
}
|
|
270
|
+
async (params) => (0, import_operationResponse.operationResponse)("Create dashboard", ({ native }) => (0, import_dashboards.createDashboard)(native, params))
|
|
540
271
|
);
|
|
541
272
|
(0, import_registerTool.registerTool)(
|
|
542
273
|
server,
|
|
@@ -562,66 +293,18 @@ WARNING: This modifies dashboard configuration. Use with caution.`,
|
|
|
562
293
|
"Dashboard fields to update. Supported: name, columns (timeline config), rows (comparison config), options."
|
|
563
294
|
)
|
|
564
295
|
},
|
|
565
|
-
async (params) => {
|
|
566
|
-
const gate = await (0, import_session.requireSession)();
|
|
567
|
-
if (!gate.ok) return gate.response;
|
|
568
|
-
const { tenant, native: nativeClient } = gate.session;
|
|
569
|
-
try {
|
|
570
|
-
const dashRef = await (0, import_helpers.resolveEntityForMcp)(nativeClient, "dashboard", params.dashboardNameOrId);
|
|
571
|
-
if ("error" in dashRef) {
|
|
572
|
-
return dashRef.error;
|
|
573
|
-
}
|
|
574
|
-
const current = await rawApiCall(nativeClient, "GET", `/dashboards/${dashRef.entity.id}`);
|
|
575
|
-
const base = {
|
|
576
|
-
name: current.name,
|
|
577
|
-
columns: current.columns,
|
|
578
|
-
rows: current.rows,
|
|
579
|
-
options: current.options
|
|
580
|
-
};
|
|
581
|
-
const replaceSet = /* @__PURE__ */ new Set(["columns", "rows", "options"]);
|
|
582
|
-
const merged = deepMerge(base, params.update, replaceSet);
|
|
583
|
-
await rawApiCall(nativeClient, "PUT", `/dashboards/${dashRef.entity.id}`, merged);
|
|
584
|
-
return (0, import_helpers.successResponse)({
|
|
585
|
-
tenant,
|
|
586
|
-
action: "updated",
|
|
587
|
-
dashboard: { id: dashRef.entity.id, name: merged.name },
|
|
588
|
-
message: `Dashboard "${dashRef.entity.name}" updated`
|
|
589
|
-
});
|
|
590
|
-
} catch (error) {
|
|
591
|
-
return (0, import_helpers.errorResponse)(`Update dashboard failed: ${await (0, import_errorFormatter.formatClientError)(error)}`, "NETWORK_ERROR");
|
|
592
|
-
}
|
|
593
|
-
}
|
|
296
|
+
async (params) => (0, import_operationResponse.operationResponse)("Update dashboard", ({ native }) => (0, import_dashboards.updateDashboard)(native, params))
|
|
594
297
|
);
|
|
595
298
|
(0, import_registerTool.registerTool)(
|
|
596
299
|
server,
|
|
597
300
|
"farseer_delete_dashboard",
|
|
598
|
-
`Delete a dashboard.
|
|
301
|
+
`Delete a dashboard, with its tiles and their sheets.
|
|
599
302
|
|
|
600
|
-
WARNING: This is destructive
|
|
601
|
-
if dashboard deletion is not supported for the tenant.`,
|
|
303
|
+
WARNING: This is destructive and cannot be undone.`,
|
|
602
304
|
{
|
|
603
305
|
dashboardNameOrId: import_zod.z.string().describe("Dashboard name or numeric ID")
|
|
604
306
|
},
|
|
605
|
-
async (params) => {
|
|
606
|
-
const gate = await (0, import_session.requireSession)();
|
|
607
|
-
if (!gate.ok) return gate.response;
|
|
608
|
-
const { tenant, native: nativeClient } = gate.session;
|
|
609
|
-
try {
|
|
610
|
-
const dashRef = await (0, import_helpers.resolveEntityForMcp)(nativeClient, "dashboard", params.dashboardNameOrId);
|
|
611
|
-
if ("error" in dashRef) {
|
|
612
|
-
return dashRef.error;
|
|
613
|
-
}
|
|
614
|
-
await rawApiCall(nativeClient, "DELETE", `/dashboards/${dashRef.entity.id}`);
|
|
615
|
-
return (0, import_helpers.successResponse)({
|
|
616
|
-
tenant,
|
|
617
|
-
action: "deleted",
|
|
618
|
-
dashboard: { id: dashRef.entity.id, name: dashRef.entity.name },
|
|
619
|
-
message: `Dashboard "${dashRef.entity.name}" deleted`
|
|
620
|
-
});
|
|
621
|
-
} catch (error) {
|
|
622
|
-
return (0, import_helpers.errorResponse)(`Delete dashboard failed: ${await (0, import_errorFormatter.formatClientError)(error)}`, "NETWORK_ERROR");
|
|
623
|
-
}
|
|
624
|
-
}
|
|
307
|
+
async (params) => (0, import_operationResponse.operationResponse)("Delete dashboard", ({ native }) => (0, import_dashboards.deleteDashboard)(native, params))
|
|
625
308
|
);
|
|
626
309
|
(0, import_registerTool.registerTool)(
|
|
627
310
|
server,
|
|
@@ -633,74 +316,9 @@ Specify folderId directly or use folderPath to resolve the target folder.
|
|
|
633
316
|
|
|
634
317
|
If no folder is specified, duplicates to the root Dashboards folder.`,
|
|
635
318
|
duplicateDashboardSchema,
|
|
636
|
-
async (params) => {
|
|
637
|
-
const gate = await (0, import_session.requireSession)();
|
|
638
|
-
if (!gate.ok) return gate.response;
|
|
639
|
-
const { tenant, native: nativeClient } = gate.session;
|
|
640
|
-
try {
|
|
641
|
-
const dashRef = await (0, import_helpers.resolveEntityForMcp)(nativeClient, "dashboard", params.dashboardNameOrId);
|
|
642
|
-
if ("error" in dashRef) {
|
|
643
|
-
return dashRef.error;
|
|
644
|
-
}
|
|
645
|
-
let targetFolderId = params.folderId ?? 0;
|
|
646
|
-
if (!params.folderId && params.folderPath && params.folderPath.length > 0) {
|
|
647
|
-
const folderResults = await nativeClient.folders.search({
|
|
648
|
-
name: params.folderPath[params.folderPath.length - 1],
|
|
649
|
-
types: [farseer.FolderItemType.Folder],
|
|
650
|
-
limit: 20
|
|
651
|
-
});
|
|
652
|
-
if (folderResults.length > 0) {
|
|
653
|
-
targetFolderId = folderResults[0].id;
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
if (targetFolderId === 0) {
|
|
657
|
-
const rootItems = await nativeClient.folders.listItemsBatch([{ id: null }]);
|
|
658
|
-
const dashboardsFolder = rootItems[0]?.items?.find(
|
|
659
|
-
(item) => item.type === farseer.FolderItemType.Folder && item.name.toLowerCase() === "dashboards"
|
|
660
|
-
);
|
|
661
|
-
if (dashboardsFolder) {
|
|
662
|
-
targetFolderId = dashboardsFolder.id;
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
const result = await nativeClient.dashboards.duplicate({
|
|
666
|
-
name: params.name,
|
|
667
|
-
sourceId: dashRef.entity.id,
|
|
668
|
-
folderId: targetFolderId
|
|
669
|
-
});
|
|
670
|
-
return (0, import_helpers.successResponse)({
|
|
671
|
-
tenant,
|
|
672
|
-
action: "duplicated",
|
|
673
|
-
source: { id: dashRef.entity.id, name: dashRef.entity.name },
|
|
674
|
-
newDashboard: {
|
|
675
|
-
id: result.id,
|
|
676
|
-
name: result.name
|
|
677
|
-
},
|
|
678
|
-
folderId: targetFolderId,
|
|
679
|
-
message: `Dashboard "${dashRef.entity.name}" duplicated as "${params.name}"`
|
|
680
|
-
});
|
|
681
|
-
} catch (error) {
|
|
682
|
-
return (0, import_helpers.errorResponse)(`Duplicate dashboard failed: ${await (0, import_errorFormatter.formatClientError)(error)}`, "NETWORK_ERROR");
|
|
683
|
-
}
|
|
684
|
-
}
|
|
319
|
+
async (params) => (0, import_operationResponse.operationResponse)("Duplicate dashboard", ({ native }) => (0, import_dashboards.duplicateDashboard)(native, params))
|
|
685
320
|
);
|
|
686
321
|
}
|
|
687
|
-
function deepMerge(target, source, replaceKeys) {
|
|
688
|
-
if (source === null || source === void 0) return target;
|
|
689
|
-
if (target === null || target === void 0) return source;
|
|
690
|
-
if (typeof source !== "object" || Array.isArray(source)) return source;
|
|
691
|
-
if (typeof target !== "object" || Array.isArray(target)) return source;
|
|
692
|
-
const result = { ...target };
|
|
693
|
-
for (const key of Object.keys(source)) {
|
|
694
|
-
if (replaceKeys?.has(key)) {
|
|
695
|
-
result[key] = source[key];
|
|
696
|
-
} else if (typeof source[key] === "object" && source[key] !== null && !Array.isArray(source[key])) {
|
|
697
|
-
result[key] = deepMerge(target[key], source[key], replaceKeys);
|
|
698
|
-
} else {
|
|
699
|
-
result[key] = source[key];
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
return result;
|
|
703
|
-
}
|
|
704
322
|
// Annotate the CommonJS export names for ESM import in node:
|
|
705
323
|
0 && (module.exports = {
|
|
706
324
|
registerDashboardTools
|