@thinkingai/ae-cli 6.1.17 → 6.1.19
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 +2 -0
- package/README.zh.md +6 -0
- package/dist/{auth-77BUFLGC.js → auth-QPEVVBKT.js} +20 -15
- package/dist/auth-UMJAA72O.js +15 -0
- package/dist/{capability-72DTW5M2.js → capability-ASI62I4A.js} +53 -15
- package/dist/{chunk-UW5UN47B.js → chunk-533JK3YX.js} +2 -0
- package/dist/{chunk-UOUS37JQ.js → chunk-6QK7SYYY.js} +5 -4
- package/dist/{chunk-TUKQZTMI.js → chunk-7K24F7T2.js} +2 -0
- package/dist/{chunk-OO6XR6LK.js → chunk-AMBFK2K3.js} +2 -0
- package/dist/{sync-DAVKYVMW.js → chunk-B5HMQAOM.js} +31 -540
- package/dist/{chunk-VR3LCBHW.js → chunk-DKEXH6Q5.js} +6 -5
- package/dist/{chunk-VTWMIC5L.js → chunk-E2JKXMVO.js} +2 -0
- package/dist/{chunk-LYVNONC4.js → chunk-FR2EDAQM.js} +36 -0
- package/dist/{chunk-ILIU36SU.js → chunk-GJXRF7Y6.js} +6 -5
- package/dist/{chunk-DWO43OIB.js → chunk-JQ3ENZZH.js} +2 -0
- package/dist/chunk-JYMGHGCE.js +191 -0
- package/dist/{chunk-GT46FPXN.js → chunk-KEWVSO64.js} +18 -8
- package/dist/chunk-KZ6ZHF5J.js +294 -0
- package/dist/chunk-O6K2ODUE.js +318 -0
- package/dist/chunk-QL6R6TSK.js +25215 -0
- package/dist/{chunk-4SGZG4XY.js → chunk-RWXIXOZG.js} +28 -13
- package/dist/{chunk-YA6SMTXG.js → chunk-S5PONFBM.js} +5 -4
- package/dist/{chunk-4NN5IWVN.js → chunk-T6OSFQZD.js} +2 -0
- package/dist/{chunk-PTE56QPL.js → chunk-TKHSULJT.js} +6 -0
- package/dist/{chunk-6EIJSNBD.js → chunk-Y74WTIKJ.js} +2 -0
- package/dist/{client-TKG4WBHN.js → client-N7NGZUNI.js} +6 -4
- package/dist/{community-report-client-FI4LNVYS.js → community-report-client-6OL6GBQW.js} +3 -3
- package/dist/{config-RE6CMGPK.js → config-XNMACCKX.js} +10 -8
- package/dist/{data-integration-XQYB4X4F.js → data-integration-4NZGZ45E.js} +2502 -272
- package/dist/index.js +137 -1245
- package/dist/{local-data-upload-client-BWHSUQQK.js → local-data-upload-client-EFHDLXFG.js} +3 -3
- package/dist/{memory-YK33G4T7.js → memory-HBJQ2GC5.js} +8 -7
- package/dist/{metadata-UILXHBWF.js → metadata-62EWBEIG.js} +12 -11
- package/dist/{model-NR3JHFSJ.js → model-BHLJ2QMT.js} +10 -9
- package/dist/personal-semantic-preference-JBVMAI7L.js +240 -0
- package/dist/project-semantic-BQ4MPUS5.js +1115 -0
- package/dist/sync-MUWPRM5I.js +522 -0
- package/dist/{te-agent-4BKBODMF.js → te-agent-WQZTMEK4.js} +12 -10
- package/dist/{te-analysis-O6DCO6BS.js → te-analysis-MNCG65LU.js} +534 -48
- package/dist/{te-community-HLC43QKH.js → te-community-BNE6KREL.js} +8 -7
- package/dist/{te-dataops-EJP56W3K.js → te-dataops-TXLKM2W6.js} +469 -68
- package/dist/{te-engage-FGBGQ4IY.js → te-engage-TPKLRVTL.js} +84 -10
- package/dist/{te-experiment-SO5MPDMJ.js → te-experiment-6BYKTCY7.js} +303 -12
- package/dist/{te-kb-SQCLHG6X.js → te-kb-BUD6N3NI.js} +312 -25
- package/dist/{te-system-YARIK4S5.js → te-system-44LZJDTQ.js} +573 -37
- package/dist/{te-team-EFKWYKMK.js → te-team-XMP47YXE.js} +10 -7
- package/dist/{update-OGPSZM5A.js → update-UODFOZ4P.js} +9 -7
- package/package.json +18 -9
- package/skills/ae-agent/SKILL.md +3 -4
- package/skills/ae-agent/references/edit-skill.md +3 -0
- package/skills/ae-agent/references/get-skill-content.md +1 -1
- package/skills/ae-agent/references/rescan-skills.md +15 -13
- package/skills/ae-agent/references/upload-skill.md +7 -4
- package/skills/ae-analysis/SKILL.md +45 -4
- package/skills/ae-analysis/metadata_resolution.md +38 -4
- package/skills/ae-analysis/references/analysis_data_retrieval.md +29 -0
- package/skills/ae-analysis/references/analysis_gateway_assets.md +1 -1
- package/skills/ae-analysis/references/asset_authentication_export.md +22 -0
- package/skills/ae-analysis/references/asset_authentication_list.md +18 -14
- package/skills/ae-analysis/references/asset_authentication_update.md +29 -14
- package/skills/ae-analysis/references/audience_models.md +18 -0
- package/skills/ae-analysis/references/command_index.md +19 -11
- package/skills/ae-analysis/references/dashboard_get.md +18 -1
- package/skills/ae-analysis/references/dashboard_update.md +3 -0
- package/skills/ae-analysis/references/personal_semantic_preference_add.md +23 -0
- package/skills/ae-analysis/references/personal_semantic_preference_delete.md +17 -0
- package/skills/ae-analysis/references/personal_semantic_preference_get.md +19 -0
- package/skills/ae-analysis/references/personal_semantic_preference_list.md +21 -0
- package/skills/ae-analysis/references/personal_semantic_preference_update.md +19 -0
- package/skills/ae-analysis/references/project_timezone_update.md +13 -4
- package/skills/ae-analysis/references/property_create.md +2 -0
- package/skills/ae-analysis/references/super_metadata_batch_create.md +2 -0
- package/skills/ae-analysis/references/user_cluster_models.md +2 -0
- package/skills/ae-analysis/references/user_cluster_update.md +8 -4
- package/skills/ae-analysis/references/user_tag_create.md +7 -1
- package/skills/ae-analysis/references/user_tag_models.md +8 -2
- package/skills/ae-data-integration/SKILL.md +24 -4
- package/skills/ae-data-integration/references/custom-layer.md +93 -0
- package/skills/ae-data-integration/references/error-handling.md +145 -0
- package/skills/ae-data-integration/references/handoff.md +77 -18
- package/skills/ae-data-integration/references/local-analysis.md +1 -1
- package/skills/ae-data-integration/references/reuse.md +9 -5
- package/skills/ae-data-integration/references/sink-upload.md +1 -1
- package/skills/ae-data-integration/references/source-inspect.md +35 -13
- package/skills/ae-data-integration/references/tracking-plan.md +7 -5
- package/skills/ae-data-integration/references/transform.md +12 -10
- package/skills/ae-data-integration/references/ue-mapping.md +33 -11
- package/skills/ae-data-integration/references/ue-routing.md +23 -0
- package/skills/ae-dataops/SKILL.md +11 -1
- package/skills/ae-dataops/references/dataops-backfill.md +135 -0
- package/skills/ae-engage/SKILL.md +5 -0
- package/skills/ae-engage/references/build-task-save-guide.md +14 -1
- package/skills/ae-engage/references/save-flow.md +37 -1
- package/skills/ae-engage/references/save-task.md +88 -0
- package/skills/ae-experiment/SKILL.md +14 -4
- package/skills/ae-experiment/references/manage_feature_whitelist.md +66 -0
- package/skills/ae-experiment/references/manage_guardrail_metrics.md +26 -0
- package/skills/ae-experiment/references/save_experiment.md +1 -1
- package/skills/ae-experiment/references/save_metric.md +20 -8
- package/skills/ae-kb/SKILL.md +121 -10
- package/skills/ae-project-semantic/SKILL.md +193 -0
- package/skills/ae-project-semantic/references/query-routing-v5.md +165 -0
- package/skills/ae-project-semantic/references/recommendation-quality.md +68 -0
- package/skills/ae-system/SKILL.md +28 -30
- package/skills/ae-system/references/channel-management.md +303 -0
- package/dist/auth-2WTQOP77.js +0 -14
- package/dist/capability-PJHNI4GJ.js +0 -315
- package/dist/chunk-4KVPKXFX.js +0 -98
- package/dist/chunk-C4MGVGJW.js +0 -13
- package/dist/chunk-P3FGXJTU.js +0 -349
- package/dist/chunk-QGM4M3NI.js +0 -37
- package/dist/chunk-RGKJGKT7.js +0 -71
- package/dist/chunk-SAU3QFIQ.js +0 -556
- package/dist/chunk-VPKZ7I72.js +0 -509
- package/dist/chunk-ZZUOD757.js +0 -598
- package/dist/memory-CHRU2F7W.js +0 -893
- package/dist/metadata-XXR34N5P.js +0 -339
- package/dist/model-K3KLWIW6.js +0 -139
- package/dist/sync-FCKOVWWS.js +0 -10261
- package/dist/te-agent-HLW4VTQK.js +0 -3893
- package/dist/te-analysis-ZMNGOVNW.js +0 -8958
- package/dist/te-community-6HPBWJUZ.js +0 -1859
- package/dist/te-dataops-HDRUXY4K.js +0 -2208
- package/dist/te-engage-RAK5PESW.js +0 -4898
- package/dist/te-experiment-VZF7BT6G.js +0 -770
- package/dist/te-system-Z77IKZFN.js +0 -2213
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
1
2
|
import {
|
|
2
3
|
assertOutputPathAvailable,
|
|
3
4
|
clientWaitTimeoutSeconds,
|
|
@@ -6,17 +7,17 @@ import {
|
|
|
6
7
|
waitForAnalysisRun,
|
|
7
8
|
withAsyncArtifactLifecycle,
|
|
8
9
|
withInterruptSignal
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-S5PONFBM.js";
|
|
10
11
|
import {
|
|
11
12
|
createCapabilityCommand
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DKEXH6Q5.js";
|
|
13
14
|
import {
|
|
14
15
|
registerCapabilityGatewayRoute,
|
|
15
16
|
resolveGatewayDomain
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TKHSULJT.js";
|
|
17
18
|
import {
|
|
18
19
|
withOutputMetadata
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-KEWVSO64.js";
|
|
20
21
|
import {
|
|
21
22
|
CapabilityGatewayError,
|
|
22
23
|
buildCapabilityGatewayUrl,
|
|
@@ -27,17 +28,17 @@ import {
|
|
|
27
28
|
requestCapabilityGatewayWithEnvelope,
|
|
28
29
|
uploadInputFile,
|
|
29
30
|
validateCapability
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-GJXRF7Y6.js";
|
|
32
|
+
import "./chunk-Y74WTIKJ.js";
|
|
32
33
|
import {
|
|
33
34
|
getCliToken
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-RWXIXOZG.js";
|
|
36
|
+
import "./chunk-O6K2ODUE.js";
|
|
37
|
+
import "./chunk-KZ6ZHF5J.js";
|
|
36
38
|
import {
|
|
37
39
|
CliValidationError
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-QGM4M3NI.js";
|
|
40
|
+
} from "./chunk-533JK3YX.js";
|
|
41
|
+
import "./chunk-FR2EDAQM.js";
|
|
41
42
|
|
|
42
43
|
// src/commands/te-analysis/capability-shared.ts
|
|
43
44
|
var ANALYSIS_GATEWAY_CLI_SERVICES = /* @__PURE__ */ new Set(["project", "system"]);
|
|
@@ -179,6 +180,13 @@ var directoryOffsetFlag = {
|
|
|
179
180
|
alias: "o",
|
|
180
181
|
min: 0
|
|
181
182
|
};
|
|
183
|
+
var certificationScopeFlag = {
|
|
184
|
+
name: "certification-scope",
|
|
185
|
+
type: "string",
|
|
186
|
+
required: false,
|
|
187
|
+
desc: "Asset certification filter scope: project follows the project switch, certified returns only certified assets, all returns every asset.",
|
|
188
|
+
default: "project"
|
|
189
|
+
};
|
|
182
190
|
var payloadFlag = {
|
|
183
191
|
name: "payload",
|
|
184
192
|
type: "json",
|
|
@@ -268,9 +276,18 @@ function listInput(ctx) {
|
|
|
268
276
|
function reportListInput(ctx) {
|
|
269
277
|
return compactInput({
|
|
270
278
|
...listInput(ctx),
|
|
271
|
-
model_types: optionalJson(ctx, "model-types")
|
|
279
|
+
model_types: optionalJson(ctx, "model-types"),
|
|
280
|
+
certification_scope: certificationScopeInput(ctx)
|
|
272
281
|
});
|
|
273
282
|
}
|
|
283
|
+
function certificationScopeInput(ctx) {
|
|
284
|
+
const value = optionalString(ctx, "certification-scope");
|
|
285
|
+
if (value === void 0) return void 0;
|
|
286
|
+
if (!["project", "certified", "all"].includes(value)) {
|
|
287
|
+
throw new Error("--certification-scope must be project, certified, or all.");
|
|
288
|
+
}
|
|
289
|
+
return value;
|
|
290
|
+
}
|
|
274
291
|
function dashboardReportDataInput(ctx) {
|
|
275
292
|
return compactInput({
|
|
276
293
|
...projectInput(ctx),
|
|
@@ -644,7 +661,8 @@ var metadataEventList = createAnalysisMetaCapabilityCommand({
|
|
|
644
661
|
fieldsFlag,
|
|
645
662
|
directoryLimitFlag,
|
|
646
663
|
directoryOffsetFlag,
|
|
647
|
-
{ name: "authenticated-only", type: "boolean", required: false, desc: "When true, return only authenticated events." }
|
|
664
|
+
{ name: "authenticated-only", type: "boolean", required: false, desc: "When true, return only authenticated events." },
|
|
665
|
+
certificationScopeFlag
|
|
648
666
|
],
|
|
649
667
|
risk: "read",
|
|
650
668
|
validate: validateCatalogListFlags,
|
|
@@ -654,9 +672,23 @@ var metadataEventList = createAnalysisMetaCapabilityCommand({
|
|
|
654
672
|
fields: optionalJson(ctx, "fields"),
|
|
655
673
|
limit: optionalNumber(ctx, "limit"),
|
|
656
674
|
offset: optionalNumber(ctx, "offset"),
|
|
657
|
-
authenticated_only: optionalBoolean(ctx, "authenticated-only")
|
|
658
|
-
|
|
675
|
+
authenticated_only: optionalBoolean(ctx, "authenticated-only"),
|
|
676
|
+
certification_scope: certificationScopeInput(ctx)
|
|
677
|
+
}),
|
|
678
|
+
postProcess: normalizeEventDirectory
|
|
659
679
|
});
|
|
680
|
+
function normalizeEventDirectory(result) {
|
|
681
|
+
if (result === null || typeof result !== "object" || Array.isArray(result)) {
|
|
682
|
+
return result;
|
|
683
|
+
}
|
|
684
|
+
const directory = result;
|
|
685
|
+
const items = Array.isArray(directory.items) ? directory.items : directory.events;
|
|
686
|
+
if (!Array.isArray(items)) {
|
|
687
|
+
return result;
|
|
688
|
+
}
|
|
689
|
+
const { events: _events, ...rest } = directory;
|
|
690
|
+
return { ...rest, items };
|
|
691
|
+
}
|
|
660
692
|
|
|
661
693
|
// src/commands/te-analysis/metadata-export.ts
|
|
662
694
|
import { createHash as createHash2, randomBytes as randomBytes2 } from "crypto";
|
|
@@ -935,7 +967,8 @@ var metadataPropertyList = createAnalysisMetaCapabilityCommand({
|
|
|
935
967
|
fieldsFlag,
|
|
936
968
|
directoryLimitFlag,
|
|
937
969
|
directoryOffsetFlag,
|
|
938
|
-
{ name: "authenticated-only", type: "boolean", required: false, desc: "When true, return only authenticated properties." }
|
|
970
|
+
{ name: "authenticated-only", type: "boolean", required: false, desc: "When true, return only authenticated properties." },
|
|
971
|
+
certificationScopeFlag
|
|
939
972
|
],
|
|
940
973
|
risk: "read",
|
|
941
974
|
validate: validateCatalogListFlags,
|
|
@@ -948,7 +981,8 @@ var metadataPropertyList = createAnalysisMetaCapabilityCommand({
|
|
|
948
981
|
fields: optionalJson(ctx, "fields"),
|
|
949
982
|
limit: optionalNumber(ctx, "limit"),
|
|
950
983
|
offset: optionalNumber(ctx, "offset"),
|
|
951
|
-
authenticated_only: optionalBoolean(ctx, "authenticated-only")
|
|
984
|
+
authenticated_only: optionalBoolean(ctx, "authenticated-only"),
|
|
985
|
+
certification_scope: certificationScopeInput(ctx)
|
|
952
986
|
})
|
|
953
987
|
});
|
|
954
988
|
|
|
@@ -1340,7 +1374,8 @@ var metadataMetricList = createAnalysisMetaCapabilityCommand({
|
|
|
1340
1374
|
fieldsFlag,
|
|
1341
1375
|
directoryLimitFlag,
|
|
1342
1376
|
directoryOffsetFlag,
|
|
1343
|
-
{ name: "authenticated-only", type: "boolean", required: false, desc: "When true, return only authenticated metrics." }
|
|
1377
|
+
{ name: "authenticated-only", type: "boolean", required: false, desc: "When true, return only authenticated metrics." },
|
|
1378
|
+
certificationScopeFlag
|
|
1344
1379
|
],
|
|
1345
1380
|
risk: "read",
|
|
1346
1381
|
validate: validateCatalogListFlags,
|
|
@@ -1351,7 +1386,8 @@ var metadataMetricList = createAnalysisMetaCapabilityCommand({
|
|
|
1351
1386
|
fields: optionalJson(ctx, "fields"),
|
|
1352
1387
|
limit: optionalNumber(ctx, "limit"),
|
|
1353
1388
|
offset: optionalNumber(ctx, "offset"),
|
|
1354
|
-
authenticated_only: optionalBoolean(ctx, "authenticated-only")
|
|
1389
|
+
authenticated_only: optionalBoolean(ctx, "authenticated-only"),
|
|
1390
|
+
certification_scope: certificationScopeInput(ctx)
|
|
1355
1391
|
})
|
|
1356
1392
|
});
|
|
1357
1393
|
|
|
@@ -1976,13 +2012,14 @@ var metadataCatalogExport = createAnalysisMetaCapabilityCommand({
|
|
|
1976
2012
|
materialize: catalogArtifactMaterializer("analysis_metadata")
|
|
1977
2013
|
},
|
|
1978
2014
|
description: "Export the complete accessible analysis metadata catalog to JSONL with an integrity sidecar.",
|
|
1979
|
-
flags: [projectIdFlag, requestIdFlag, asyncTimeoutSecondsFlag],
|
|
2015
|
+
flags: [projectIdFlag, requestIdFlag, asyncTimeoutSecondsFlag, certificationScopeFlag],
|
|
1980
2016
|
risk: "read",
|
|
1981
2017
|
validate: validateCatalogExportFlags,
|
|
1982
2018
|
buildInput: (ctx) => compactInput({
|
|
1983
2019
|
...projectInput(ctx),
|
|
1984
2020
|
request_id: optionalString(ctx, "request-id"),
|
|
1985
|
-
timeout_seconds: optionalNumber(ctx, "timeout-seconds")
|
|
2021
|
+
timeout_seconds: optionalNumber(ctx, "timeout-seconds"),
|
|
2022
|
+
certification_scope: certificationScopeInput(ctx)
|
|
1986
2023
|
})
|
|
1987
2024
|
});
|
|
1988
2025
|
|
|
@@ -2038,7 +2075,8 @@ var metadataCatalogList = createAnalysisMetaCapabilityCommand({
|
|
|
2038
2075
|
projectIdFlag,
|
|
2039
2076
|
queriesFlag,
|
|
2040
2077
|
resourceTypesFlag,
|
|
2041
|
-
limitPerTypeFlag
|
|
2078
|
+
limitPerTypeFlag,
|
|
2079
|
+
certificationScopeFlag
|
|
2042
2080
|
],
|
|
2043
2081
|
risk: "read",
|
|
2044
2082
|
validate: validateMetadataCatalogList,
|
|
@@ -2046,7 +2084,8 @@ var metadataCatalogList = createAnalysisMetaCapabilityCommand({
|
|
|
2046
2084
|
...projectInput(ctx),
|
|
2047
2085
|
queries: optionalQueries(ctx),
|
|
2048
2086
|
resource_types: optionalResourceTypes(ctx),
|
|
2049
|
-
limit_per_type: ctx.optionalNum("limit-per-type")
|
|
2087
|
+
limit_per_type: ctx.optionalNum("limit-per-type"),
|
|
2088
|
+
certification_scope: certificationScopeInput(ctx)
|
|
2050
2089
|
})
|
|
2051
2090
|
});
|
|
2052
2091
|
|
|
@@ -2289,8 +2328,353 @@ var analysisMetaAssetOperationRecordExport = createAnalysisGovernanceCapabilityC
|
|
|
2289
2328
|
buildInput: (ctx) => assetGovernanceInput(ctx, ["record_id"])
|
|
2290
2329
|
});
|
|
2291
2330
|
|
|
2331
|
+
// src/commands/te-analysis/governance/asset-authentication-shared.ts
|
|
2332
|
+
import { createHash as createHash3, randomBytes as randomBytes3 } from "crypto";
|
|
2333
|
+
import { readFileSync, statSync } from "fs";
|
|
2334
|
+
import { mkdir as mkdir3, open as open3, rm as rm3 } from "fs/promises";
|
|
2335
|
+
import { dirname as dirname3, extname as extname3, resolve as resolve3 } from "path";
|
|
2336
|
+
var ASSET_TYPES = /* @__PURE__ */ new Set([
|
|
2337
|
+
"event",
|
|
2338
|
+
"event_prop",
|
|
2339
|
+
"user_prop",
|
|
2340
|
+
"user_tag",
|
|
2341
|
+
"user_cluster",
|
|
2342
|
+
"metric",
|
|
2343
|
+
"report",
|
|
2344
|
+
"dashboard"
|
|
2345
|
+
]);
|
|
2346
|
+
var OUTPUT_FIELDS = /* @__PURE__ */ new Set([
|
|
2347
|
+
"resource_type",
|
|
2348
|
+
"resource_key",
|
|
2349
|
+
"display_name",
|
|
2350
|
+
"description",
|
|
2351
|
+
"owner_open_id",
|
|
2352
|
+
"owner_name",
|
|
2353
|
+
"authentication_status",
|
|
2354
|
+
"heat_count90d",
|
|
2355
|
+
"user_count90d",
|
|
2356
|
+
"impact_degree"
|
|
2357
|
+
]);
|
|
2358
|
+
var assetTypesFlag = {
|
|
2359
|
+
name: "asset-types",
|
|
2360
|
+
type: "json",
|
|
2361
|
+
required: false,
|
|
2362
|
+
desc: "Optional JSON array of asset types. Omit for every supported type."
|
|
2363
|
+
};
|
|
2364
|
+
var authenticationStatusFilterFlag = {
|
|
2365
|
+
name: "authentication-status",
|
|
2366
|
+
type: "number",
|
|
2367
|
+
required: false,
|
|
2368
|
+
desc: "Authentication status: 1 for authenticated or 0 for unauthenticated.",
|
|
2369
|
+
min: 0,
|
|
2370
|
+
max: 1
|
|
2371
|
+
};
|
|
2372
|
+
var governanceQueriesFlag = {
|
|
2373
|
+
name: "queries",
|
|
2374
|
+
type: "json",
|
|
2375
|
+
required: false,
|
|
2376
|
+
desc: "Optional JSON array of 1 to 20 keywords matched against identity and display fields."
|
|
2377
|
+
};
|
|
2378
|
+
var heatCountGtFlag = {
|
|
2379
|
+
name: "heat-count-gt",
|
|
2380
|
+
type: "number",
|
|
2381
|
+
required: false,
|
|
2382
|
+
desc: "Strict recent-90-day heat threshold.",
|
|
2383
|
+
min: 0
|
|
2384
|
+
};
|
|
2385
|
+
var userCountGtFlag = {
|
|
2386
|
+
name: "user-count-gt",
|
|
2387
|
+
type: "number",
|
|
2388
|
+
required: false,
|
|
2389
|
+
desc: "Strict recent-90-day user threshold.",
|
|
2390
|
+
min: 0
|
|
2391
|
+
};
|
|
2392
|
+
var impactDegreeGtFlag = {
|
|
2393
|
+
name: "impact-degree-gt",
|
|
2394
|
+
type: "number",
|
|
2395
|
+
required: false,
|
|
2396
|
+
desc: "Strict governance impact threshold.",
|
|
2397
|
+
min: 0
|
|
2398
|
+
};
|
|
2399
|
+
var matchFlag = {
|
|
2400
|
+
name: "match",
|
|
2401
|
+
type: "string",
|
|
2402
|
+
required: false,
|
|
2403
|
+
desc: "Combine multiple numeric thresholds with any or all. Default: all.",
|
|
2404
|
+
default: "all"
|
|
2405
|
+
};
|
|
2406
|
+
var authenticationFieldsFlag = {
|
|
2407
|
+
name: "fields",
|
|
2408
|
+
type: "json",
|
|
2409
|
+
required: false,
|
|
2410
|
+
desc: "Optional JSON array of output fields."
|
|
2411
|
+
};
|
|
2412
|
+
var authenticationExportOutputFlag = {
|
|
2413
|
+
name: "output",
|
|
2414
|
+
type: "string",
|
|
2415
|
+
required: true,
|
|
2416
|
+
desc: "Local .jsonl output path. Integrity metadata is written to <output>.meta.json."
|
|
2417
|
+
};
|
|
2418
|
+
var authenticationFilterFlags = [
|
|
2419
|
+
assetTypesFlag,
|
|
2420
|
+
authenticationStatusFilterFlag,
|
|
2421
|
+
governanceQueriesFlag,
|
|
2422
|
+
heatCountGtFlag,
|
|
2423
|
+
userCountGtFlag,
|
|
2424
|
+
impactDegreeGtFlag,
|
|
2425
|
+
matchFlag,
|
|
2426
|
+
authenticationFieldsFlag
|
|
2427
|
+
];
|
|
2428
|
+
function validateAuthenticationFilters(ctx) {
|
|
2429
|
+
validateQueriesFlag(ctx);
|
|
2430
|
+
validateStringArray(ctx, "asset-types", ASSET_TYPES);
|
|
2431
|
+
validateStringArray(ctx, "fields", OUTPUT_FIELDS);
|
|
2432
|
+
const match = optionalString(ctx, "match");
|
|
2433
|
+
if (match !== void 0 && match !== "any" && match !== "all") {
|
|
2434
|
+
throw new CliValidationError("--match must be any or all");
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
function authenticationFilterInput(ctx) {
|
|
2438
|
+
return compactInput({
|
|
2439
|
+
...projectInput(ctx),
|
|
2440
|
+
asset_types: optionalJson(ctx, "asset-types"),
|
|
2441
|
+
authentication_status: optionalNumber(ctx, "authentication-status"),
|
|
2442
|
+
queries: optionalJson(ctx, "queries"),
|
|
2443
|
+
heat_count_gt: optionalNumber(ctx, "heat-count-gt"),
|
|
2444
|
+
user_count_gt: optionalNumber(ctx, "user-count-gt"),
|
|
2445
|
+
impact_degree_gt: optionalNumber(ctx, "impact-degree-gt"),
|
|
2446
|
+
match: optionalString(ctx, "match"),
|
|
2447
|
+
fields: optionalJson(ctx, "fields")
|
|
2448
|
+
});
|
|
2449
|
+
}
|
|
2450
|
+
function validateAuthenticationExport(ctx) {
|
|
2451
|
+
validateAuthenticationFilters(ctx);
|
|
2452
|
+
if (extname3(ctx.str("output").trim()).toLowerCase() !== ".jsonl") {
|
|
2453
|
+
throw new CliValidationError("--output must use the .jsonl extension");
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
function authenticationExportPostProcess() {
|
|
2457
|
+
return async (result, input, ctx) => {
|
|
2458
|
+
if (typeof result !== "object" || result === null) {
|
|
2459
|
+
throw new Error("Asset-authentication export returned an invalid response");
|
|
2460
|
+
}
|
|
2461
|
+
const data = result;
|
|
2462
|
+
const rows = data.assets;
|
|
2463
|
+
if (!Array.isArray(rows) || data.complete !== true || typeof data.total !== "number" || data.total !== rows.length || typeof data.snapshot_hash !== "string" || typeof data.stat_as_of !== "string") {
|
|
2464
|
+
throw new Error("Asset-authentication export failed completeness or snapshot validation");
|
|
2465
|
+
}
|
|
2466
|
+
const outputPath = resolve3(ctx.str("output").trim());
|
|
2467
|
+
const metaPath = `${outputPath}.meta.json`;
|
|
2468
|
+
await mkdir3(dirname3(outputPath), { recursive: true });
|
|
2469
|
+
await assertRegularFileOrMissing(outputPath);
|
|
2470
|
+
await assertRegularFileOrMissing(metaPath);
|
|
2471
|
+
const suffix = `${process.pid}.${randomBytes3(8).toString("hex")}`;
|
|
2472
|
+
const partPath = `${outputPath}.part.${suffix}`;
|
|
2473
|
+
const metaPartPath = `${metaPath}.part.${suffix}`;
|
|
2474
|
+
const hash = createHash3("sha256");
|
|
2475
|
+
let bytes = 0;
|
|
2476
|
+
let handle;
|
|
2477
|
+
try {
|
|
2478
|
+
handle = await open3(partPath, "w", 384);
|
|
2479
|
+
for (const row of rows) {
|
|
2480
|
+
const line = `${JSON.stringify(row)}
|
|
2481
|
+
`;
|
|
2482
|
+
const buffer = Buffer.from(line, "utf8");
|
|
2483
|
+
hash.update(buffer);
|
|
2484
|
+
bytes += buffer.length;
|
|
2485
|
+
await handle.write(buffer);
|
|
2486
|
+
}
|
|
2487
|
+
await handle.sync();
|
|
2488
|
+
await handle.close();
|
|
2489
|
+
handle = void 0;
|
|
2490
|
+
const checksum = hash.digest("hex");
|
|
2491
|
+
const metadata = {
|
|
2492
|
+
complete: true,
|
|
2493
|
+
project_id: input.project_id,
|
|
2494
|
+
total: rows.length,
|
|
2495
|
+
stat_as_of: data.stat_as_of,
|
|
2496
|
+
snapshot_hash: data.snapshot_hash,
|
|
2497
|
+
checksum
|
|
2498
|
+
};
|
|
2499
|
+
handle = await open3(metaPartPath, "w", 384);
|
|
2500
|
+
await handle.write(`${JSON.stringify(metadata)}
|
|
2501
|
+
`, void 0, "utf8");
|
|
2502
|
+
await handle.sync();
|
|
2503
|
+
await handle.close();
|
|
2504
|
+
handle = void 0;
|
|
2505
|
+
await publishCatalogPair(partPath, outputPath, metaPartPath, metaPath, suffix);
|
|
2506
|
+
return {
|
|
2507
|
+
output_path: outputPath,
|
|
2508
|
+
metadata_path: metaPath,
|
|
2509
|
+
format: "jsonl",
|
|
2510
|
+
row_count: rows.length,
|
|
2511
|
+
bytes,
|
|
2512
|
+
checksum,
|
|
2513
|
+
snapshot_hash: data.snapshot_hash,
|
|
2514
|
+
complete: true
|
|
2515
|
+
};
|
|
2516
|
+
} catch (error) {
|
|
2517
|
+
await handle?.close().catch(() => void 0);
|
|
2518
|
+
await rm3(partPath, { force: true }).catch(() => void 0);
|
|
2519
|
+
await rm3(metaPartPath, { force: true }).catch(() => void 0);
|
|
2520
|
+
throw error;
|
|
2521
|
+
}
|
|
2522
|
+
};
|
|
2523
|
+
}
|
|
2524
|
+
function assetRefsInput(ctx) {
|
|
2525
|
+
const inline = optionalJson(ctx, "asset-refs");
|
|
2526
|
+
const file = optionalString(ctx, "asset-file");
|
|
2527
|
+
const assetType = optionalString(ctx, "asset-type");
|
|
2528
|
+
const assetIds = optionalJson(ctx, "asset-ids");
|
|
2529
|
+
const sources = Number(inline !== void 0) + Number(file !== void 0) + Number(assetType !== void 0 || assetIds !== void 0);
|
|
2530
|
+
if (sources !== 1) {
|
|
2531
|
+
throw new CliValidationError("Use exactly one input: --asset-refs, --asset-file, or --asset-type with --asset-ids");
|
|
2532
|
+
}
|
|
2533
|
+
let values;
|
|
2534
|
+
if (inline !== void 0) {
|
|
2535
|
+
values = inline;
|
|
2536
|
+
} else if (file !== void 0) {
|
|
2537
|
+
const path = resolve3(file);
|
|
2538
|
+
if (!statSync(path, { throwIfNoEntry: false })?.isFile()) {
|
|
2539
|
+
throw new CliValidationError(`--asset-file must be a regular file: ${path}`);
|
|
2540
|
+
}
|
|
2541
|
+
values = readFileSync(path, "utf8").split(/\r?\n/).filter(Boolean).map((line, index) => {
|
|
2542
|
+
try {
|
|
2543
|
+
return JSON.parse(line);
|
|
2544
|
+
} catch {
|
|
2545
|
+
throw new CliValidationError(`--asset-file line ${index + 1} is not valid JSON`);
|
|
2546
|
+
}
|
|
2547
|
+
});
|
|
2548
|
+
} else {
|
|
2549
|
+
if (assetType === void 0 || assetIds === void 0 || !Array.isArray(assetIds)) {
|
|
2550
|
+
throw new CliValidationError("--asset-type and --asset-ids must be provided together");
|
|
2551
|
+
}
|
|
2552
|
+
values = assetIds.map((resourceKey) => ({ resource_type: assetType, resource_key: resourceKey }));
|
|
2553
|
+
}
|
|
2554
|
+
if (!Array.isArray(values) || values.length === 0) {
|
|
2555
|
+
throw new CliValidationError("The selected asset reference set must not be empty");
|
|
2556
|
+
}
|
|
2557
|
+
const refs = values.map((value, index) => normalizeRef(value, index));
|
|
2558
|
+
return [...new Map(refs.map((ref) => [`${ref.resource_type}${ref.resource_key}`, ref])).values()];
|
|
2559
|
+
}
|
|
2560
|
+
function normalizeRef(value, index) {
|
|
2561
|
+
if (typeof value !== "object" || value === null) {
|
|
2562
|
+
throw new CliValidationError(`Asset reference ${index + 1} must be an object`);
|
|
2563
|
+
}
|
|
2564
|
+
const source = value;
|
|
2565
|
+
const resourceType = source.resource_type;
|
|
2566
|
+
const resourceKey = source.resource_key;
|
|
2567
|
+
if (typeof resourceType !== "string" || !ASSET_TYPES.has(resourceType) || typeof resourceKey !== "string" && typeof resourceKey !== "number" || String(resourceKey).trim() === "") {
|
|
2568
|
+
throw new CliValidationError(`Asset reference ${index + 1} requires a supported resource_type and non-empty resource_key`);
|
|
2569
|
+
}
|
|
2570
|
+
return { resource_type: resourceType, resource_key: String(resourceKey) };
|
|
2571
|
+
}
|
|
2572
|
+
function validateStringArray(ctx, name, allowed) {
|
|
2573
|
+
const value = optionalJson(ctx, name);
|
|
2574
|
+
if (value === void 0) return;
|
|
2575
|
+
if (!Array.isArray(value) || value.length === 0 || value.some((item) => typeof item !== "string" || !allowed.has(item))) {
|
|
2576
|
+
throw new CliValidationError(`--${name} must be a non-empty JSON array of supported values`);
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
// src/commands/te-analysis/governance/asset-authentication-list.ts
|
|
2581
|
+
var analysisGovernanceAssetAuthenticationList = createAnalysisGovernanceCapabilityCommand({
|
|
2582
|
+
resource: "asset-authentication",
|
|
2583
|
+
command: "list",
|
|
2584
|
+
capabilityId: "governance.asset_authentication.list",
|
|
2585
|
+
description: "Preview asset authentication with server-side filtering, sorting, and pagination.",
|
|
2586
|
+
flags: [projectIdFlag, ...authenticationFilterFlags, directoryLimitFlag, directoryOffsetFlag],
|
|
2587
|
+
risk: "read",
|
|
2588
|
+
validate: validateAuthenticationFilters,
|
|
2589
|
+
buildInput: (ctx) => compactInput({
|
|
2590
|
+
...authenticationFilterInput(ctx),
|
|
2591
|
+
limit: optionalNumber(ctx, "limit"),
|
|
2592
|
+
offset: optionalNumber(ctx, "offset")
|
|
2593
|
+
})
|
|
2594
|
+
});
|
|
2595
|
+
|
|
2596
|
+
// src/commands/te-analysis/governance/asset-authentication-export.ts
|
|
2597
|
+
var analysisGovernanceAssetAuthenticationExport = createAnalysisGovernanceCapabilityCommand({
|
|
2598
|
+
resource: "asset-authentication",
|
|
2599
|
+
command: "export",
|
|
2600
|
+
capabilityId: "governance.asset_authentication.export",
|
|
2601
|
+
description: "Export the complete filtered asset-authentication catalog to JSONL without pagination.",
|
|
2602
|
+
flags: [projectIdFlag, ...authenticationFilterFlags, authenticationExportOutputFlag],
|
|
2603
|
+
risk: "read",
|
|
2604
|
+
validate: validateAuthenticationExport,
|
|
2605
|
+
buildInput: authenticationFilterInput,
|
|
2606
|
+
postProcess: authenticationExportPostProcess()
|
|
2607
|
+
});
|
|
2608
|
+
|
|
2609
|
+
// src/commands/te-analysis/governance/asset-authentication-update.ts
|
|
2610
|
+
var authenticationStatusFlag = {
|
|
2611
|
+
name: "authentication-status",
|
|
2612
|
+
type: "number",
|
|
2613
|
+
required: true,
|
|
2614
|
+
desc: "Target authentication status: 1 authenticates and 0 revokes.",
|
|
2615
|
+
min: 0,
|
|
2616
|
+
max: 1
|
|
2617
|
+
};
|
|
2618
|
+
var assetRefsFlag = {
|
|
2619
|
+
name: "asset-refs",
|
|
2620
|
+
type: "json",
|
|
2621
|
+
required: false,
|
|
2622
|
+
desc: "Inline JSON array of {resource_type,resource_key} asset references."
|
|
2623
|
+
};
|
|
2624
|
+
var assetFileFlag = {
|
|
2625
|
+
name: "asset-file",
|
|
2626
|
+
type: "string",
|
|
2627
|
+
required: false,
|
|
2628
|
+
desc: "JSONL file whose rows contain resource_type and resource_key."
|
|
2629
|
+
};
|
|
2630
|
+
var assetTypeFlag = {
|
|
2631
|
+
name: "asset-type",
|
|
2632
|
+
type: "string",
|
|
2633
|
+
required: false,
|
|
2634
|
+
desc: "Convenience asset type used together with --asset-ids."
|
|
2635
|
+
};
|
|
2636
|
+
var assetIdsFlag = {
|
|
2637
|
+
name: "asset-ids",
|
|
2638
|
+
type: "json",
|
|
2639
|
+
required: false,
|
|
2640
|
+
desc: "Convenience JSON array of business keys used together with --asset-type."
|
|
2641
|
+
};
|
|
2642
|
+
var expectedSnapshotHashFlag = {
|
|
2643
|
+
name: "expected-snapshot-hash",
|
|
2644
|
+
type: "string",
|
|
2645
|
+
required: false,
|
|
2646
|
+
desc: "Optional snapshot_hash from the export sidecar. A mismatch rejects the whole update."
|
|
2647
|
+
};
|
|
2648
|
+
var analysisGovernanceAssetAuthenticationUpdate = createAnalysisGovernanceCapabilityCommand({
|
|
2649
|
+
resource: "asset-authentication",
|
|
2650
|
+
command: "update",
|
|
2651
|
+
capabilityId: "governance.asset_authentication.update",
|
|
2652
|
+
description: "Batch update explicit typed asset references.",
|
|
2653
|
+
flags: [
|
|
2654
|
+
projectIdFlag,
|
|
2655
|
+
authenticationStatusFlag,
|
|
2656
|
+
assetRefsFlag,
|
|
2657
|
+
assetFileFlag,
|
|
2658
|
+
assetTypeFlag,
|
|
2659
|
+
assetIdsFlag,
|
|
2660
|
+
expectedSnapshotHashFlag,
|
|
2661
|
+
requestIdFlag
|
|
2662
|
+
],
|
|
2663
|
+
risk: "write",
|
|
2664
|
+
buildInput: (ctx) => compactInput({
|
|
2665
|
+
project_id: ctx.num("project-id"),
|
|
2666
|
+
authentication_status: ctx.num("authentication-status"),
|
|
2667
|
+
asset_refs: assetRefsInput(ctx),
|
|
2668
|
+
expected_snapshot_hash: optionalString(ctx, "expected-snapshot-hash"),
|
|
2669
|
+
request_id: optionalString(ctx, "request-id")
|
|
2670
|
+
})
|
|
2671
|
+
});
|
|
2672
|
+
|
|
2292
2673
|
// src/commands/te-analysis/governance/index.ts
|
|
2293
2674
|
var commands12 = [
|
|
2675
|
+
analysisGovernanceAssetAuthenticationList,
|
|
2676
|
+
analysisGovernanceAssetAuthenticationExport,
|
|
2677
|
+
analysisGovernanceAssetAuthenticationUpdate,
|
|
2294
2678
|
analysisMetaAssetUsageList,
|
|
2295
2679
|
analysisMetaAssetUsageExport,
|
|
2296
2680
|
analysisMetaAssetBatchInfoExport,
|
|
@@ -2320,7 +2704,15 @@ var reportList = createAnalysisCapabilityCommand({
|
|
|
2320
2704
|
command: "list",
|
|
2321
2705
|
capabilityId: "analysis.report.list",
|
|
2322
2706
|
description: "List analysis reports visible to the current user through the capability gateway.",
|
|
2323
|
-
flags: [
|
|
2707
|
+
flags: [
|
|
2708
|
+
projectIdFlag,
|
|
2709
|
+
queriesFlag,
|
|
2710
|
+
fieldsFlag,
|
|
2711
|
+
reportModelTypesFlag,
|
|
2712
|
+
reportListLimitFlag,
|
|
2713
|
+
directoryOffsetFlag,
|
|
2714
|
+
certificationScopeFlag
|
|
2715
|
+
],
|
|
2324
2716
|
risk: "read",
|
|
2325
2717
|
validate: validateQueriesFlag,
|
|
2326
2718
|
buildInput: reportListInput
|
|
@@ -2340,7 +2732,8 @@ var reportListExport = createAnalysisCapabilityCommand({
|
|
|
2340
2732
|
reportModelTypesFlag,
|
|
2341
2733
|
requestIdFlag,
|
|
2342
2734
|
artifactFormatFlag,
|
|
2343
|
-
asyncTimeoutSecondsFlag
|
|
2735
|
+
asyncTimeoutSecondsFlag,
|
|
2736
|
+
certificationScopeFlag
|
|
2344
2737
|
],
|
|
2345
2738
|
risk: "read",
|
|
2346
2739
|
validate: validateQueriesFlag,
|
|
@@ -2349,6 +2742,7 @@ var reportListExport = createAnalysisCapabilityCommand({
|
|
|
2349
2742
|
queries: optionalQueries(ctx),
|
|
2350
2743
|
fields: optionalJson(ctx, "fields"),
|
|
2351
2744
|
model_types: optionalJson(ctx, "model-types"),
|
|
2745
|
+
certification_scope: certificationScopeInput(ctx),
|
|
2352
2746
|
...exportLifecycleInput(ctx)
|
|
2353
2747
|
})
|
|
2354
2748
|
});
|
|
@@ -2738,11 +3132,15 @@ var dashboardList = createAnalysisCapabilityCommand({
|
|
|
2738
3132
|
alias: "f"
|
|
2739
3133
|
},
|
|
2740
3134
|
directoryLimitFlag,
|
|
2741
|
-
directoryOffsetFlag
|
|
3135
|
+
directoryOffsetFlag,
|
|
3136
|
+
certificationScopeFlag
|
|
2742
3137
|
],
|
|
2743
3138
|
risk: "read",
|
|
2744
3139
|
validate: validateQueriesFlag,
|
|
2745
|
-
buildInput:
|
|
3140
|
+
buildInput: (ctx) => compactInput({
|
|
3141
|
+
...listInput(ctx),
|
|
3142
|
+
certification_scope: certificationScopeInput(ctx)
|
|
3143
|
+
})
|
|
2746
3144
|
});
|
|
2747
3145
|
|
|
2748
3146
|
// src/commands/te-analysis/dashboard/create.ts
|
|
@@ -2775,7 +3173,7 @@ var dashboardGet = createAnalysisCapabilityCommand({
|
|
|
2775
3173
|
resource: "dashboard",
|
|
2776
3174
|
command: "get",
|
|
2777
3175
|
capabilityId: "analysis.dashboard.get",
|
|
2778
|
-
description: "Get one dashboard detail, including
|
|
3176
|
+
description: "Get one dashboard detail, including normalized effective settings, saved filter configuration, location, reports, notes, and sharing context.",
|
|
2779
3177
|
flags: [
|
|
2780
3178
|
projectIdFlag,
|
|
2781
3179
|
{ name: "dashboard-id", type: "number", required: true, desc: "Dashboard ID." },
|
|
@@ -2794,10 +3192,10 @@ var dashboardUpdate = createAnalysisCapabilityCommand({
|
|
|
2794
3192
|
resource: "dashboard",
|
|
2795
3193
|
command: "update",
|
|
2796
3194
|
capabilityId: "analysis.dashboard.update",
|
|
2797
|
-
description: "Update dashboard settings, create/update a dashboard note, or replace the dashboard-level business filter. Use --operation settings, note-upsert, or business-filter.",
|
|
3195
|
+
description: "Update dashboard settings, create/update a dashboard note, save a dashboard-wide default filter, or replace the dashboard-level business filter. Use --operation settings, note-upsert, default-filter, or business-filter.",
|
|
2798
3196
|
flags: [
|
|
2799
3197
|
projectIdFlag,
|
|
2800
|
-
{ name: "operation", type: "string", required: true, desc: "Update operation: settings, note-upsert, or business-filter." },
|
|
3198
|
+
{ name: "operation", type: "string", required: true, desc: "Update operation: settings, note-upsert, default-filter, or business-filter." },
|
|
2801
3199
|
{ name: "dashboard-id", type: "number", required: false, desc: "Dashboard ID for a single-dashboard update." },
|
|
2802
3200
|
{ name: "dashboard-ids", type: "json", required: false, desc: "Dashboard ID array for batch settings updates." },
|
|
2803
3201
|
{ name: "dashboard-name", type: "string", required: false, desc: "Dashboard name for single rename." },
|
|
@@ -2808,7 +3206,8 @@ var dashboardUpdate = createAnalysisCapabilityCommand({
|
|
|
2808
3206
|
{ name: "note-title", type: "string", required: false, desc: "Dashboard note title." },
|
|
2809
3207
|
{ name: "description", type: "string", required: false, desc: "Dashboard note description." },
|
|
2810
3208
|
{ name: "ui-config", type: "string", required: false, desc: "Dashboard or note UI config string." },
|
|
2811
|
-
{ name: "filter", type: "
|
|
3209
|
+
{ name: "filter-name", type: "string", required: false, desc: "Saved filter name. Required with --operation default-filter." },
|
|
3210
|
+
{ name: "filter", type: "json", required: false, desc: 'Saved filter in snake_case QP form. Required with --operation default-filter or business-filter. Pass {"junction_kind":"and","ta_filters":[]} to clear a business filter.' },
|
|
2812
3211
|
payloadFlag
|
|
2813
3212
|
],
|
|
2814
3213
|
risk: "write",
|
|
@@ -2825,6 +3224,7 @@ var dashboardUpdate = createAnalysisCapabilityCommand({
|
|
|
2825
3224
|
note_title: optionalString(ctx, "note-title"),
|
|
2826
3225
|
description: optionalString(ctx, "description"),
|
|
2827
3226
|
ui_config: optionalString(ctx, "ui-config"),
|
|
3227
|
+
filter_name: optionalString(ctx, "filter-name"),
|
|
2828
3228
|
filter: optionalJson(ctx, "filter"),
|
|
2829
3229
|
payload: optionalJson(ctx, "payload")
|
|
2830
3230
|
})
|
|
@@ -3301,7 +3701,7 @@ var commands23 = [
|
|
|
3301
3701
|
var run_default = commands23;
|
|
3302
3702
|
|
|
3303
3703
|
// src/commands/te-analysis/artifact/download.ts
|
|
3304
|
-
import { resolve as
|
|
3704
|
+
import { resolve as resolve4 } from "path";
|
|
3305
3705
|
function artifactPath(runId, artifactId) {
|
|
3306
3706
|
return `runs/${encodeURIComponent(runId)}/artifacts/${encodeURIComponent(artifactId)}/download`;
|
|
3307
3707
|
}
|
|
@@ -3325,7 +3725,7 @@ var artifactDownload = {
|
|
|
3325
3725
|
resolveGatewayDomain("analysis"),
|
|
3326
3726
|
artifactPath(ctx.str("run-id"), ctx.str("artifact-id"))
|
|
3327
3727
|
),
|
|
3328
|
-
output_path:
|
|
3728
|
+
output_path: resolve4(ctx.str("output")),
|
|
3329
3729
|
...ctx.bool("force") ? { force: true } : {}
|
|
3330
3730
|
}),
|
|
3331
3731
|
execute: async (ctx) => {
|
|
@@ -4664,7 +5064,7 @@ var commands39 = [drilldownUserEventsRun, drilldownUserEventsExport];
|
|
|
4664
5064
|
var drilldown_user_events_default = commands39;
|
|
4665
5065
|
|
|
4666
5066
|
// src/commands/te-analysis/user/index.ts
|
|
4667
|
-
import { existsSync, statSync } from "fs";
|
|
5067
|
+
import { existsSync, statSync as statSync2 } from "fs";
|
|
4668
5068
|
var authenticatedOnlyFlag = {
|
|
4669
5069
|
name: "authenticated-only",
|
|
4670
5070
|
type: "boolean",
|
|
@@ -4741,7 +5141,7 @@ var clusterDefinitionRequestFlag = {
|
|
|
4741
5141
|
var optionalClusterDefinitionRequestFlag = {
|
|
4742
5142
|
...clusterDefinitionRequestFlag,
|
|
4743
5143
|
required: false,
|
|
4744
|
-
desc: "Optional semantic snake_case cluster definition. Read user_cluster_models.md; raw filts, C-codes, ftv, columnName, and backend DTOs are rejected."
|
|
5144
|
+
desc: "Optional semantic snake_case cluster definition. Its type must match the existing cluster type; update cannot change the analysis entity. Read user_cluster_models.md; raw filts, C-codes, ftv, columnName, and backend DTOs are rejected."
|
|
4745
5145
|
};
|
|
4746
5146
|
var tagDefinitionRequestFlag = {
|
|
4747
5147
|
...clusterDefinitionRequestFlag,
|
|
@@ -4894,7 +5294,7 @@ function idImportCapability(command) {
|
|
|
4894
5294
|
throw new Error("Pass exactly one of --input-file, --input-file-id, or --file-content");
|
|
4895
5295
|
}
|
|
4896
5296
|
const localFile = ctx.str("input-file");
|
|
4897
|
-
if (localFile && (!existsSync(localFile) || !
|
|
5297
|
+
if (localFile && (!existsSync(localFile) || !statSync2(localFile).isFile())) {
|
|
4898
5298
|
throw new Error(`--input-file must reference a readable local file: ${localFile}`);
|
|
4899
5299
|
}
|
|
4900
5300
|
},
|
|
@@ -5192,7 +5592,7 @@ var commands40 = [
|
|
|
5192
5592
|
zoneOffsetFlag3,
|
|
5193
5593
|
entityIdFlag
|
|
5194
5594
|
], "write", (ctx) => clusterWriteInput(ctx, true)),
|
|
5195
|
-
capability("user-cluster", "update", "analysis.user_cluster.update", "Update a condition or SQL user cluster. Pass only fields that should change.", [
|
|
5595
|
+
capability("user-cluster", "update", "analysis.user_cluster.update", "Update a condition or SQL user cluster without changing its existing type or analysis entity. Pass only fields that should change.", [
|
|
5196
5596
|
projectIdFlag,
|
|
5197
5597
|
clusterNameFlag,
|
|
5198
5598
|
optionalDisplayNameFlag,
|
|
@@ -5201,7 +5601,7 @@ var commands40 = [
|
|
|
5201
5601
|
remarkFlag,
|
|
5202
5602
|
zoneOffsetFlag3,
|
|
5203
5603
|
autoRefreshCronFlag
|
|
5204
|
-
], "write", (ctx) => clusterWriteInput(ctx, false)),
|
|
5604
|
+
], "high-risk-write", (ctx) => clusterWriteInput(ctx, false)),
|
|
5205
5605
|
idImportCapability(capability("user-cluster", "create-id", "analysis.user_cluster.create_id", "Create a cluster by mapping imported values to an analysis entity.", [
|
|
5206
5606
|
projectIdFlag,
|
|
5207
5607
|
{ ...newClusterNameFlag, required: false, desc: "Optional cluster_name; generated if omitted. When provided, it must satisfy the 1-80 character machine-name contract." },
|
|
@@ -6487,6 +6887,16 @@ var projectTimezoneOverview = createAnalysisCapabilityCommand({
|
|
|
6487
6887
|
});
|
|
6488
6888
|
|
|
6489
6889
|
// src/commands/te-analysis/project/timezone/update.ts
|
|
6890
|
+
var TIMEZONE_ITEMS = [
|
|
6891
|
+
"timezone_toggle",
|
|
6892
|
+
"zone_offset",
|
|
6893
|
+
"user_timezone",
|
|
6894
|
+
"project_timezone_display"
|
|
6895
|
+
];
|
|
6896
|
+
var timezonePayloadFlag = {
|
|
6897
|
+
...requiredPayloadFlag,
|
|
6898
|
+
desc: 'Item-specific snake_case payload: timezone_toggle uses {"toggle":true}; zone_offset uses {"column_name":"#zone_offset"}; user_timezone uses {"column_name":"user_timezone","codetable":"optional_table"}; project_timezone_display uses {"display_timezones":[{"timezone":8,"is_default":true}]}.'
|
|
6899
|
+
};
|
|
6490
6900
|
var projectTimezoneUpdate = createAnalysisCapabilityCommand({
|
|
6491
6901
|
resource: "project timezone",
|
|
6492
6902
|
command: "update",
|
|
@@ -6494,16 +6904,92 @@ var projectTimezoneUpdate = createAnalysisCapabilityCommand({
|
|
|
6494
6904
|
description: "Update one project time zone configuration item.",
|
|
6495
6905
|
flags: [
|
|
6496
6906
|
projectIdFlag,
|
|
6497
|
-
|
|
6907
|
+
timezonePayloadFlag,
|
|
6498
6908
|
{ name: "item", type: "string", required: true, desc: "Timezone item: timezone_toggle, zone_offset, user_timezone, project_timezone_display." }
|
|
6499
6909
|
],
|
|
6500
6910
|
risk: "write",
|
|
6501
|
-
buildInput: (ctx) =>
|
|
6502
|
-
|
|
6503
|
-
payload
|
|
6504
|
-
item
|
|
6505
|
-
|
|
6911
|
+
buildInput: (ctx) => {
|
|
6912
|
+
const item = ctx.str("item").toLowerCase();
|
|
6913
|
+
const payload = ctx.json("payload");
|
|
6914
|
+
validateTimezonePayload(item, payload);
|
|
6915
|
+
return compactInput({
|
|
6916
|
+
project_id: ctx.num("project-id"),
|
|
6917
|
+
payload,
|
|
6918
|
+
item
|
|
6919
|
+
});
|
|
6920
|
+
}
|
|
6506
6921
|
});
|
|
6922
|
+
function validateTimezonePayload(item, payload) {
|
|
6923
|
+
if (!TIMEZONE_ITEMS.includes(item)) {
|
|
6924
|
+
throw new CliValidationError(
|
|
6925
|
+
"--item must be timezone_toggle, zone_offset, user_timezone, or project_timezone_display.",
|
|
6926
|
+
{ code: "INVALID_TIMEZONE_ITEM" }
|
|
6927
|
+
);
|
|
6928
|
+
}
|
|
6929
|
+
if (!isObject(payload)) {
|
|
6930
|
+
throw invalidPayload(item, "must be a JSON object");
|
|
6931
|
+
}
|
|
6932
|
+
switch (item) {
|
|
6933
|
+
case "timezone_toggle":
|
|
6934
|
+
if (typeof payload.toggle !== "boolean") {
|
|
6935
|
+
throw invalidPayload(item, "requires boolean field toggle", '{"toggle":true}');
|
|
6936
|
+
}
|
|
6937
|
+
allowOnly(payload, item, ["toggle"]);
|
|
6938
|
+
return;
|
|
6939
|
+
case "zone_offset":
|
|
6940
|
+
if (typeof payload.column_name !== "string") {
|
|
6941
|
+
throw invalidPayload(item, "requires string field column_name", '{"column_name":"#zone_offset"}');
|
|
6942
|
+
}
|
|
6943
|
+
allowOnly(payload, item, ["column_name"]);
|
|
6944
|
+
return;
|
|
6945
|
+
case "user_timezone":
|
|
6946
|
+
if (typeof payload.column_name !== "string" || payload.column_name.length === 0) {
|
|
6947
|
+
throw invalidPayload(item, "requires non-empty string field column_name", '{"column_name":"user_timezone"}');
|
|
6948
|
+
}
|
|
6949
|
+
if (payload.codetable !== void 0 && typeof payload.codetable !== "string") {
|
|
6950
|
+
throw invalidPayload(item, "optional field codetable must be a string", '{"column_name":"user_timezone","codetable":"timezone_code_table"}');
|
|
6951
|
+
}
|
|
6952
|
+
allowOnly(payload, item, ["column_name", "codetable"]);
|
|
6953
|
+
return;
|
|
6954
|
+
case "project_timezone_display":
|
|
6955
|
+
validateDisplayTimezones(payload.display_timezones, item);
|
|
6956
|
+
allowOnly(payload, item, ["display_timezones"]);
|
|
6957
|
+
}
|
|
6958
|
+
}
|
|
6959
|
+
function validateDisplayTimezones(value, item) {
|
|
6960
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
6961
|
+
throw invalidPayload(item, "requires non-empty array field display_timezones", '{"display_timezones":[{"timezone":8,"is_default":true}]}');
|
|
6962
|
+
}
|
|
6963
|
+
for (const entry of value) {
|
|
6964
|
+
if (!isObject(entry)) {
|
|
6965
|
+
throw invalidPayload(item, "display_timezones entries must be objects", '{"display_timezones":[{"timezone":8,"is_default":true}]}');
|
|
6966
|
+
}
|
|
6967
|
+
allowOnly(entry, item, ["timezone", "is_default"]);
|
|
6968
|
+
if (!Number.isInteger(entry.timezone) || !(entry.timezone >= -12 && entry.timezone <= 14 || entry.timezone === 99)) {
|
|
6969
|
+
throw invalidPayload(item, "display_timezones[].timezone must be an integer from -12 through 14, or 99 for no fixed display timezone");
|
|
6970
|
+
}
|
|
6971
|
+
if (entry.is_default !== void 0 && typeof entry.is_default !== "boolean") {
|
|
6972
|
+
throw invalidPayload(item, "display_timezones[].is_default must be a boolean when provided");
|
|
6973
|
+
}
|
|
6974
|
+
}
|
|
6975
|
+
}
|
|
6976
|
+
function allowOnly(payload, item, fields) {
|
|
6977
|
+
if (Object.keys(payload).some((field) => !fields.includes(field))) {
|
|
6978
|
+
throw invalidPayload(item, `supports only fields ${fields.join(", ")}`);
|
|
6979
|
+
}
|
|
6980
|
+
}
|
|
6981
|
+
function invalidPayload(item, reason, example) {
|
|
6982
|
+
return new CliValidationError(
|
|
6983
|
+
`--payload for --item ${item} ${reason}.`,
|
|
6984
|
+
{
|
|
6985
|
+
code: "INVALID_TIMEZONE_PAYLOAD",
|
|
6986
|
+
hint: example === void 0 ? void 0 : `Use: --payload '${example}'`
|
|
6987
|
+
}
|
|
6988
|
+
);
|
|
6989
|
+
}
|
|
6990
|
+
function isObject(value) {
|
|
6991
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
6992
|
+
}
|
|
6507
6993
|
|
|
6508
6994
|
// src/commands/te-analysis/project/timezone/index.ts
|
|
6509
6995
|
var commands62 = [
|
|
@@ -7832,7 +8318,7 @@ var commands79 = [
|
|
|
7832
8318
|
var alert_notice_config_default = commands79;
|
|
7833
8319
|
|
|
7834
8320
|
// src/commands/te-analysis/system/shared.ts
|
|
7835
|
-
import { readFileSync, statSync as
|
|
8321
|
+
import { readFileSync as readFileSync2, statSync as statSync3 } from "fs";
|
|
7836
8322
|
var secretValues = /* @__PURE__ */ new WeakMap();
|
|
7837
8323
|
var companyIdField = {
|
|
7838
8324
|
flag: "company-id",
|
|
@@ -7995,14 +8481,14 @@ function secretValue(ctx, secret) {
|
|
|
7995
8481
|
let value;
|
|
7996
8482
|
const file = ctx.str(`${secret.flag}-file`);
|
|
7997
8483
|
if (file) {
|
|
7998
|
-
const stat =
|
|
8484
|
+
const stat = statSync3(file);
|
|
7999
8485
|
if (!stat.isFile()) throw validation(`--${secret.flag}-file must reference a regular file.`);
|
|
8000
8486
|
if ((stat.mode & 63) !== 0) {
|
|
8001
8487
|
throw validation(`--${secret.flag}-file must not be readable or writable by group/others (use chmod 600).`);
|
|
8002
8488
|
}
|
|
8003
|
-
value = nonEmptySecret(
|
|
8489
|
+
value = nonEmptySecret(readFileSync2(file, "utf8"), secret.flag);
|
|
8004
8490
|
} else if (ctx.bool(`${secret.flag}-stdin`)) {
|
|
8005
|
-
value = nonEmptySecret(
|
|
8491
|
+
value = nonEmptySecret(readFileSync2(0, "utf8"), secret.flag);
|
|
8006
8492
|
}
|
|
8007
8493
|
values.set(secret.flag, value);
|
|
8008
8494
|
return value;
|