@thinkingai/ae-cli 6.1.18 → 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-ROB2EDYV.js → auth-QPEVVBKT.js} +13 -7
- package/dist/auth-UMJAA72O.js +15 -0
- package/dist/{capability-DKMYUTLC.js → capability-ASI62I4A.js} +11 -10
- package/dist/{chunk-UW5UN47B.js → chunk-533JK3YX.js} +2 -0
- package/dist/{chunk-4XXOWOTA.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-HKIOZXQE.js → chunk-B5HMQAOM.js} +31 -540
- package/dist/{chunk-Y3LOALAV.js → chunk-DKEXH6Q5.js} +4 -3
- package/dist/{chunk-VTWMIC5L.js → chunk-E2JKXMVO.js} +2 -0
- package/dist/{chunk-JHENBQ5B.js → chunk-FR2EDAQM.js} +1 -0
- package/dist/{chunk-ZQ47LWTI.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-BYYS3ANB.js → chunk-KEWVSO64.js} +5 -4
- package/dist/{chunk-3FY3RJ26.js → chunk-KZ6ZHF5J.js} +2 -1
- package/dist/{chunk-ZQKDZXDO.js → chunk-O6K2ODUE.js} +3 -2
- package/dist/chunk-QL6R6TSK.js +25215 -0
- package/dist/{chunk-J2DEBMRF.js → chunk-RWXIXOZG.js} +22 -9
- package/dist/{chunk-QZ3AS4KK.js → chunk-S5PONFBM.js} +5 -4
- package/dist/{chunk-4NN5IWVN.js → chunk-T6OSFQZD.js} +2 -0
- package/dist/{chunk-3KWQYGYI.js → chunk-TKHSULJT.js} +2 -0
- package/dist/{chunk-6EIJSNBD.js → chunk-Y74WTIKJ.js} +2 -0
- package/dist/{client-L2YDMHQ6.js → client-N7NGZUNI.js} +4 -3
- package/dist/{community-report-client-C7WDGET3.js → community-report-client-6OL6GBQW.js} +3 -2
- package/dist/{config-BMYZX2UE.js → config-XNMACCKX.js} +8 -7
- package/dist/{data-integration-QEKDWQDY.js → data-integration-4NZGZ45E.js} +913 -92
- package/dist/index.js +38 -36
- package/dist/{local-data-upload-client-4YYHSYD6.js → local-data-upload-client-EFHDLXFG.js} +3 -2
- package/dist/{memory-I2WXDTV2.js → memory-HBJQ2GC5.js} +8 -7
- package/dist/{metadata-I4C2EWUN.js → metadata-62EWBEIG.js} +12 -11
- package/dist/{model-HLHIEFMU.js → model-BHLJ2QMT.js} +10 -9
- package/dist/{personal-semantic-preference-LIPACBDX.js → personal-semantic-preference-JBVMAI7L.js} +11 -10
- package/dist/{project-semantic-RT3R2VQD.js → project-semantic-BQ4MPUS5.js} +12 -11
- package/dist/sync-MUWPRM5I.js +522 -0
- package/dist/{te-agent-BR6VDBNX.js → te-agent-WQZTMEK4.js} +10 -9
- package/dist/{te-analysis-7VUNUYWZ.js → te-analysis-MNCG65LU.js} +107 -20
- package/dist/{te-community-5DMNKJWY.js → te-community-BNE6KREL.js} +8 -7
- package/dist/{te-dataops-6P5IKWNJ.js → te-dataops-TXLKM2W6.js} +467 -67
- package/dist/{te-engage-KZPR5R22.js → te-engage-TPKLRVTL.js} +84 -10
- package/dist/{te-experiment-6BITX4RD.js → te-experiment-6BYKTCY7.js} +85 -12
- package/dist/{te-kb-RCLSSH2Q.js → te-kb-BUD6N3NI.js} +311 -24
- package/dist/{te-system-FXITO2JG.js → te-system-44LZJDTQ.js} +573 -37
- package/dist/{te-team-ADOC2ROP.js → te-team-XMP47YXE.js} +10 -7
- package/dist/{update-YCYCKJOO.js → update-UODFOZ4P.js} +7 -6
- package/package.json +18 -9
- package/skills/ae-analysis/references/analysis_gateway_assets.md +1 -1
- package/skills/ae-analysis/references/audience_models.md +18 -0
- package/skills/ae-analysis/references/command_index.md +2 -2
- 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 +1 -0
- package/skills/ae-data-integration/references/error-handling.md +54 -1
- package/skills/ae-data-integration/references/source-inspect.md +18 -2
- package/skills/ae-data-integration/references/transform.md +3 -1
- 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 +5 -1
- package/skills/ae-engage/references/save-flow.md +37 -1
- package/skills/ae-engage/references/save-task.md +6 -0
- package/skills/ae-experiment/SKILL.md +6 -2
- package/skills/ae-experiment/references/save_metric.md +20 -8
- package/skills/ae-kb/SKILL.md +120 -9
- package/skills/ae-system/SKILL.md +28 -30
- package/skills/ae-system/references/channel-management.md +303 -0
- package/dist/auth-GBMV6TEJ.js +0 -14
- package/dist/capability-HYVVPG25.js +0 -352
- package/dist/chunk-EFH4XWYC.js +0 -556
- package/dist/chunk-JRJY5DMJ.js +0 -71
- package/dist/chunk-OMPRXM3V.js +0 -349
- package/dist/chunk-QNOLN2LJ.js +0 -509
- package/dist/chunk-RJDU7NYP.js +0 -1198
- package/dist/chunk-RNAALWJK.js +0 -98
- package/dist/chunk-SERWF6G5.js +0 -13
- package/dist/memory-3ORCR7JH.js +0 -893
- package/dist/metadata-VUOQJE26.js +0 -339
- package/dist/model-UGRDX4MW.js +0 -139
- package/dist/personal-semantic-preference-OEISBRHM.js +0 -239
- package/dist/project-semantic-FFPWFPIW.js +0 -1114
- package/dist/sync-TFHU2UTG.js +0 -10261
- package/dist/te-agent-VLYOV7S4.js +0 -3894
- package/dist/te-analysis-4YGQL5RC.js +0 -9357
- package/dist/te-community-ISDQWJU7.js +0 -1859
- package/dist/te-dataops-CVULXNVB.js +0 -2209
- package/dist/te-engage-N5WI32H6.js +0 -4898
- package/dist/te-experiment-UVR4HLND.js +0 -988
- package/dist/te-system-K2GYMCTB.js +0 -2213
|
@@ -1,988 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createCapabilityCommand
|
|
3
|
-
} from "./chunk-Y3LOALAV.js";
|
|
4
|
-
import {
|
|
5
|
-
registerCapabilityGatewayRoute
|
|
6
|
-
} from "./chunk-3KWQYGYI.js";
|
|
7
|
-
import "./chunk-BYYS3ANB.js";
|
|
8
|
-
import "./chunk-ZQ47LWTI.js";
|
|
9
|
-
import "./chunk-SERWF6G5.js";
|
|
10
|
-
import "./chunk-J2DEBMRF.js";
|
|
11
|
-
import "./chunk-ZQKDZXDO.js";
|
|
12
|
-
import "./chunk-3FY3RJ26.js";
|
|
13
|
-
import "./chunk-UW5UN47B.js";
|
|
14
|
-
import "./chunk-JHENBQ5B.js";
|
|
15
|
-
|
|
16
|
-
// src/commands/te-experiment/capability-shared.ts
|
|
17
|
-
function createExperimentCapabilityCommand(config) {
|
|
18
|
-
return createCapabilityCommand({
|
|
19
|
-
...config,
|
|
20
|
-
cliService: "experiment",
|
|
21
|
-
gatewayDomain: "engage"
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function readRequiredObject(ctx, name) {
|
|
25
|
-
const value = ctx.json(name);
|
|
26
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
27
|
-
throw new Error(`Flag --${name} must be a JSON object`);
|
|
28
|
-
}
|
|
29
|
-
return value;
|
|
30
|
-
}
|
|
31
|
-
function readRequiredStringArray(ctx, name) {
|
|
32
|
-
const value = ctx.json(name);
|
|
33
|
-
if (!Array.isArray(value) || value.length === 0 || !value.every((item) => typeof item === "string" && item.length > 0)) {
|
|
34
|
-
throw new Error(`Flag --${name} must be a non-empty JSON array of strings`);
|
|
35
|
-
}
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
|
-
function addOptionalString(input, name, value) {
|
|
39
|
-
if (value !== "") input[name] = value;
|
|
40
|
-
}
|
|
41
|
-
function addOptionalBoolean(input, ctx, flagName, fieldName) {
|
|
42
|
-
if (ctx.str(flagName) !== "") input[fieldName] = ctx.bool(flagName);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// src/commands/te-experiment/bucket/list.ts
|
|
46
|
-
var bucketList = createExperimentCapabilityCommand({
|
|
47
|
-
resource: "bucket",
|
|
48
|
-
command: "list",
|
|
49
|
-
capabilityId: "experiment.bucket.list",
|
|
50
|
-
description: "List split buckets in a project.",
|
|
51
|
-
flags: [{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." }],
|
|
52
|
-
risk: "read",
|
|
53
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id") })
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// src/commands/te-experiment/experiment/batch-delete.ts
|
|
57
|
-
var experimentBatchDelete = createExperimentCapabilityCommand({
|
|
58
|
-
resource: "experiment",
|
|
59
|
-
command: "batch-delete",
|
|
60
|
-
capabilityId: "experiment.experiment.batch-delete",
|
|
61
|
-
description: "Batch delete experiments.",
|
|
62
|
-
flags: [
|
|
63
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
64
|
-
{ name: "exp-ids", type: "json", required: true, desc: "Experiment IDs as a JSON string array." }
|
|
65
|
-
],
|
|
66
|
-
risk: "high-risk-write",
|
|
67
|
-
validate: (ctx) => {
|
|
68
|
-
readRequiredStringArray(ctx, "exp-ids");
|
|
69
|
-
},
|
|
70
|
-
buildInput: (ctx) => ({
|
|
71
|
-
project_id: ctx.num("project-id"),
|
|
72
|
-
exp_ids: readRequiredStringArray(ctx, "exp-ids")
|
|
73
|
-
})
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// src/commands/te-experiment/experiment/conflict-check.ts
|
|
77
|
-
function buildInput(ctx) {
|
|
78
|
-
const input = {
|
|
79
|
-
project_id: ctx.num("project-id"),
|
|
80
|
-
feature_key_list: readRequiredStringArray(ctx, "feature-key-list"),
|
|
81
|
-
traffic_layer_id: ctx.str("traffic-layer-id")
|
|
82
|
-
};
|
|
83
|
-
addOptionalString(input, "exp_id", ctx.str("exp-id"));
|
|
84
|
-
return input;
|
|
85
|
-
}
|
|
86
|
-
var experimentConflictCheck = createExperimentCapabilityCommand({
|
|
87
|
-
resource: "experiment",
|
|
88
|
-
command: "conflict-check",
|
|
89
|
-
capabilityId: "experiment.experiment.conflict-check",
|
|
90
|
-
description: "Pre-submit check for cross-layer Feature conflicts on a non-mutex traffic layer.",
|
|
91
|
-
flags: [
|
|
92
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
93
|
-
{
|
|
94
|
-
name: "feature-key-list",
|
|
95
|
-
type: "json",
|
|
96
|
-
required: true,
|
|
97
|
-
desc: "Feature keys selected by the current experiment as a JSON string array."
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: "traffic-layer-id",
|
|
101
|
-
type: "string",
|
|
102
|
-
required: true,
|
|
103
|
-
desc: "Selected non-mutex traffic layer ID."
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
name: "exp-id",
|
|
107
|
-
type: "string",
|
|
108
|
-
required: false,
|
|
109
|
-
desc: "Current experiment ID when editing an existing draft."
|
|
110
|
-
}
|
|
111
|
-
],
|
|
112
|
-
risk: "read",
|
|
113
|
-
validate: (ctx) => {
|
|
114
|
-
readRequiredStringArray(ctx, "feature-key-list");
|
|
115
|
-
if (ctx.str("traffic-layer-id") === "") {
|
|
116
|
-
throw new Error("Flag --traffic-layer-id is required");
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
buildInput
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
// src/commands/te-experiment/experiment/get.ts
|
|
123
|
-
var experimentGet = createExperimentCapabilityCommand({
|
|
124
|
-
resource: "experiment",
|
|
125
|
-
command: "get",
|
|
126
|
-
capabilityId: "experiment.experiment.get",
|
|
127
|
-
description: "Get one experiment by ID.",
|
|
128
|
-
flags: [
|
|
129
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
130
|
-
{ name: "exp-id", type: "string", required: true, desc: "Experiment ID." }
|
|
131
|
-
],
|
|
132
|
-
risk: "read",
|
|
133
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id"), exp_id: ctx.str("exp-id") })
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
// src/commands/te-experiment/experiment/list.ts
|
|
137
|
-
function buildInput2(ctx) {
|
|
138
|
-
const input = {
|
|
139
|
-
project_id: ctx.num("project-id")
|
|
140
|
-
};
|
|
141
|
-
addOptionalString(input, "status", ctx.str("status"));
|
|
142
|
-
addOptionalString(input, "traffic_layer_id", ctx.str("traffic-layer-id"));
|
|
143
|
-
addOptionalString(input, "group_id", ctx.str("group-id"));
|
|
144
|
-
addOptionalString(input, "query_name", ctx.str("query-name"));
|
|
145
|
-
return input;
|
|
146
|
-
}
|
|
147
|
-
var experimentList = createExperimentCapabilityCommand({
|
|
148
|
-
resource: "experiment",
|
|
149
|
-
command: "list",
|
|
150
|
-
capabilityId: "experiment.experiment.list",
|
|
151
|
-
description: "List experiments in a project with optional status, traffic layer, group, and name filters.",
|
|
152
|
-
flags: [
|
|
153
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
154
|
-
{
|
|
155
|
-
name: "status",
|
|
156
|
-
type: "string",
|
|
157
|
-
required: false,
|
|
158
|
-
desc: "Experiment status filter: draft, testing, pending, running, paused, ended, or archive."
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
name: "traffic-layer-id",
|
|
162
|
-
type: "string",
|
|
163
|
-
required: false,
|
|
164
|
-
desc: "Traffic layer ID filter."
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
name: "group-id",
|
|
168
|
-
type: "string",
|
|
169
|
-
required: false,
|
|
170
|
-
desc: "Business group ID filter."
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
name: "query-name",
|
|
174
|
-
type: "string",
|
|
175
|
-
required: false,
|
|
176
|
-
desc: "Fuzzy match against experiment name (exp_name LIKE)."
|
|
177
|
-
}
|
|
178
|
-
],
|
|
179
|
-
risk: "read",
|
|
180
|
-
buildInput: buildInput2
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
// src/commands/te-experiment/experiment/list-archived.ts
|
|
184
|
-
var experimentListArchived = createExperimentCapabilityCommand({
|
|
185
|
-
resource: "experiment",
|
|
186
|
-
command: "list-archived",
|
|
187
|
-
capabilityId: "experiment.experiment.list-archived",
|
|
188
|
-
description: "List archived experiments in a project.",
|
|
189
|
-
flags: [{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." }],
|
|
190
|
-
risk: "read",
|
|
191
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id") })
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
// src/commands/te-experiment/experiment/manage.ts
|
|
195
|
-
var targetStatuses = ["draft", "testing", "pending", "running", "paused", "ended", "archive"];
|
|
196
|
-
function buildInput3(ctx) {
|
|
197
|
-
const input = {
|
|
198
|
-
project_id: ctx.num("project-id"),
|
|
199
|
-
exp_id: ctx.str("exp-id"),
|
|
200
|
-
target_status: ctx.str("target-status")
|
|
201
|
-
};
|
|
202
|
-
addOptionalString(input, "remark", ctx.str("remark"));
|
|
203
|
-
return input;
|
|
204
|
-
}
|
|
205
|
-
var experimentManage = createExperimentCapabilityCommand({
|
|
206
|
-
resource: "experiment",
|
|
207
|
-
command: "manage",
|
|
208
|
-
capabilityId: "experiment.experiment.manage",
|
|
209
|
-
description: "Update an experiment status.",
|
|
210
|
-
flags: [
|
|
211
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
212
|
-
{ name: "exp-id", type: "string", required: true, desc: "Experiment ID." },
|
|
213
|
-
{ name: "target-status", type: "string", required: true, desc: "Target experiment status." },
|
|
214
|
-
{ name: "remark", type: "string", required: false, desc: "Operation remark." }
|
|
215
|
-
],
|
|
216
|
-
risk: "write",
|
|
217
|
-
validate: (ctx) => {
|
|
218
|
-
const value = ctx.str("target-status");
|
|
219
|
-
if (!targetStatuses.includes(value)) {
|
|
220
|
-
throw new Error(`Flag --target-status must be one of: ${targetStatuses.join(", ")}`);
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
buildInput: buildInput3
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
// src/commands/te-experiment/experiment/ready-check.ts
|
|
227
|
-
var experimentReadyCheck = createExperimentCapabilityCommand({
|
|
228
|
-
resource: "experiment",
|
|
229
|
-
command: "ready-check",
|
|
230
|
-
capabilityId: "experiment.experiment.ready-check",
|
|
231
|
-
description: "Check whether an experiment is ready for an online status transition.",
|
|
232
|
-
flags: [
|
|
233
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
234
|
-
{ name: "exp-id", type: "string", required: true, desc: "Experiment ID." }
|
|
235
|
-
],
|
|
236
|
-
risk: "read",
|
|
237
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id"), exp_id: ctx.str("exp-id") })
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
// src/commands/te-experiment/experiment/save.ts
|
|
241
|
-
var experimentSave = createExperimentCapabilityCommand({
|
|
242
|
-
resource: "experiment",
|
|
243
|
-
command: "save",
|
|
244
|
-
capabilityId: "experiment.experiment.save",
|
|
245
|
-
description: "Create or update an experiment draft.",
|
|
246
|
-
flags: [
|
|
247
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
248
|
-
{
|
|
249
|
-
name: "req",
|
|
250
|
-
type: "json",
|
|
251
|
-
required: true,
|
|
252
|
-
desc: "Native camelCase request; custom audiences use targeting.definitionRequest, never targetConfig."
|
|
253
|
-
}
|
|
254
|
-
],
|
|
255
|
-
risk: "write",
|
|
256
|
-
validate: (ctx) => {
|
|
257
|
-
readRequiredObject(ctx, "req");
|
|
258
|
-
},
|
|
259
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id"), req: readRequiredObject(ctx, "req") })
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
// src/commands/te-experiment/experiment/update-group.ts
|
|
263
|
-
var experimentUpdateGroup = createExperimentCapabilityCommand({
|
|
264
|
-
resource: "experiment",
|
|
265
|
-
command: "update-group",
|
|
266
|
-
capabilityId: "experiment.experiment.update-group",
|
|
267
|
-
description: "Update the business group of one experiment.",
|
|
268
|
-
flags: [
|
|
269
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
270
|
-
{ name: "exp-id", type: "string", required: true, desc: "Experiment ID." },
|
|
271
|
-
{
|
|
272
|
-
name: "group-id",
|
|
273
|
-
type: "string",
|
|
274
|
-
required: true,
|
|
275
|
-
desc: 'Target business group ID. Use "0" for ungrouped.'
|
|
276
|
-
}
|
|
277
|
-
],
|
|
278
|
-
risk: "write",
|
|
279
|
-
buildInput: (ctx) => ({
|
|
280
|
-
project_id: ctx.num("project-id"),
|
|
281
|
-
exp_id: ctx.str("exp-id"),
|
|
282
|
-
group_id: ctx.str("group-id")
|
|
283
|
-
})
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
// src/commands/te-experiment/experiment/update-metrics.ts
|
|
287
|
-
var METRIC_ROLES = /* @__PURE__ */ new Set(["primary", "secondary", "guardrail"]);
|
|
288
|
-
function readMetricBindings(ctx) {
|
|
289
|
-
const value = ctx.json("metrics");
|
|
290
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
291
|
-
throw new Error("Flag --metrics must be a non-empty JSON array");
|
|
292
|
-
}
|
|
293
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
294
|
-
const item = value[index];
|
|
295
|
-
if (!item || typeof item !== "object" || Array.isArray(item)) {
|
|
296
|
-
throw new Error(`Flag --metrics[${index}] must be a JSON object`);
|
|
297
|
-
}
|
|
298
|
-
const metricId = item.metricId;
|
|
299
|
-
const metricRole = item.metricRole;
|
|
300
|
-
if (typeof metricId !== "string" || metricId.trim() === "") {
|
|
301
|
-
throw new Error(`Flag --metrics[${index}].metricId must be a non-empty string`);
|
|
302
|
-
}
|
|
303
|
-
if (typeof metricRole !== "string" || !METRIC_ROLES.has(metricRole)) {
|
|
304
|
-
throw new Error(`Flag --metrics[${index}].metricRole must be one of primary, secondary, guardrail`);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
return value;
|
|
308
|
-
}
|
|
309
|
-
var experimentUpdateMetrics = createExperimentCapabilityCommand({
|
|
310
|
-
resource: "experiment",
|
|
311
|
-
command: "update-metrics",
|
|
312
|
-
capabilityId: "experiment.experiment.save",
|
|
313
|
-
description: "Replace experiment metric bindings and assign primary, secondary, or guardrail roles.",
|
|
314
|
-
flags: [
|
|
315
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
316
|
-
{ name: "exp-id", type: "string", required: true, desc: "Experiment draft ID." },
|
|
317
|
-
{
|
|
318
|
-
name: "metrics",
|
|
319
|
-
type: "json",
|
|
320
|
-
required: true,
|
|
321
|
-
desc: "Non-empty metric binding array with camelCase metricId and metricRole fields; replaces all saved bindings."
|
|
322
|
-
}
|
|
323
|
-
],
|
|
324
|
-
risk: "write",
|
|
325
|
-
validate: (ctx) => {
|
|
326
|
-
readMetricBindings(ctx);
|
|
327
|
-
},
|
|
328
|
-
buildInput: (ctx) => ({
|
|
329
|
-
project_id: ctx.num("project-id"),
|
|
330
|
-
req: { expId: ctx.str("exp-id"), metrics: readMetricBindings(ctx) }
|
|
331
|
-
})
|
|
332
|
-
});
|
|
333
|
-
|
|
334
|
-
// src/commands/te-experiment/feature/batch-delete.ts
|
|
335
|
-
var featureBatchDelete = createExperimentCapabilityCommand({
|
|
336
|
-
resource: "feature",
|
|
337
|
-
command: "batch-delete",
|
|
338
|
-
capabilityId: "experiment.feature.batch-delete",
|
|
339
|
-
description: "Batch delete Features.",
|
|
340
|
-
flags: [
|
|
341
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
342
|
-
{ name: "req", type: "json", required: true, desc: "Native camelCase Feature delete request object." }
|
|
343
|
-
],
|
|
344
|
-
risk: "high-risk-write",
|
|
345
|
-
validate: (ctx) => {
|
|
346
|
-
readRequiredObject(ctx, "req");
|
|
347
|
-
},
|
|
348
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id"), req: readRequiredObject(ctx, "req") })
|
|
349
|
-
});
|
|
350
|
-
|
|
351
|
-
// src/commands/te-experiment/feature/get.ts
|
|
352
|
-
function buildInput4(ctx) {
|
|
353
|
-
const input = {
|
|
354
|
-
project_id: ctx.num("project-id"),
|
|
355
|
-
feature_key: ctx.str("feature-key")
|
|
356
|
-
};
|
|
357
|
-
addOptionalString(input, "version", ctx.str("version"));
|
|
358
|
-
return input;
|
|
359
|
-
}
|
|
360
|
-
var featureGet = createExperimentCapabilityCommand({
|
|
361
|
-
resource: "feature",
|
|
362
|
-
command: "get",
|
|
363
|
-
capabilityId: "experiment.feature.get",
|
|
364
|
-
description: "Get one Feature by key and optional version.",
|
|
365
|
-
flags: [
|
|
366
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
367
|
-
{ name: "feature-key", type: "string", required: true, desc: "Feature key." },
|
|
368
|
-
{ name: "version", type: "string", required: false, desc: "Feature version ID." }
|
|
369
|
-
],
|
|
370
|
-
risk: "read",
|
|
371
|
-
buildInput: buildInput4
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
// src/commands/te-experiment/feature/list.ts
|
|
375
|
-
var featureList = createExperimentCapabilityCommand({
|
|
376
|
-
resource: "feature",
|
|
377
|
-
command: "list",
|
|
378
|
-
capabilityId: "experiment.feature.list",
|
|
379
|
-
description: "List Features in a project.",
|
|
380
|
-
flags: [{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." }],
|
|
381
|
-
risk: "read",
|
|
382
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id") })
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
// src/commands/te-experiment/feature/save.ts
|
|
386
|
-
var featureSave = createExperimentCapabilityCommand({
|
|
387
|
-
resource: "feature",
|
|
388
|
-
command: "save",
|
|
389
|
-
capabilityId: "experiment.feature.save",
|
|
390
|
-
description: "Create or update a Feature.",
|
|
391
|
-
flags: [
|
|
392
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
393
|
-
{ name: "req", type: "json", required: true, desc: "Native camelCase Feature save request object." }
|
|
394
|
-
],
|
|
395
|
-
risk: "write",
|
|
396
|
-
validate: (ctx) => {
|
|
397
|
-
readRequiredObject(ctx, "req");
|
|
398
|
-
},
|
|
399
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id"), req: readRequiredObject(ctx, "req") })
|
|
400
|
-
});
|
|
401
|
-
|
|
402
|
-
// src/commands/te-experiment/feature/update-status.ts
|
|
403
|
-
var featureUpdateStatus = createExperimentCapabilityCommand({
|
|
404
|
-
resource: "feature",
|
|
405
|
-
command: "update-status",
|
|
406
|
-
capabilityId: "experiment.feature.update-status",
|
|
407
|
-
description: "Update a Feature status.",
|
|
408
|
-
flags: [
|
|
409
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
410
|
-
{ name: "req", type: "json", required: true, desc: "Native camelCase Feature status request object." }
|
|
411
|
-
],
|
|
412
|
-
risk: "write",
|
|
413
|
-
validate: (ctx) => {
|
|
414
|
-
readRequiredObject(ctx, "req");
|
|
415
|
-
},
|
|
416
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id"), req: readRequiredObject(ctx, "req") })
|
|
417
|
-
});
|
|
418
|
-
|
|
419
|
-
// src/commands/te-experiment/feature/version-list.ts
|
|
420
|
-
var featureVersionList = createExperimentCapabilityCommand({
|
|
421
|
-
resource: "feature",
|
|
422
|
-
command: "version-list",
|
|
423
|
-
capabilityId: "experiment.feature.version-list",
|
|
424
|
-
description: "List Feature version history for one Feature key.",
|
|
425
|
-
flags: [
|
|
426
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
427
|
-
{ name: "feature-key", type: "string", required: true, desc: "Feature key." }
|
|
428
|
-
],
|
|
429
|
-
risk: "read",
|
|
430
|
-
buildInput: (ctx) => ({
|
|
431
|
-
project_id: ctx.num("project-id"),
|
|
432
|
-
feature_key: ctx.str("feature-key")
|
|
433
|
-
})
|
|
434
|
-
});
|
|
435
|
-
|
|
436
|
-
// src/commands/te-experiment/feature/operation-log/query.ts
|
|
437
|
-
var featureOperationLogQuery = createExperimentCapabilityCommand({
|
|
438
|
-
resource: "feature operation-log",
|
|
439
|
-
command: "query",
|
|
440
|
-
capabilityId: "experiment.feature.operation-log.query",
|
|
441
|
-
description: "Query Feature operation logs for one Feature key.",
|
|
442
|
-
flags: [
|
|
443
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
444
|
-
{ name: "feature-key", type: "string", required: true, desc: "Feature key." }
|
|
445
|
-
],
|
|
446
|
-
risk: "read",
|
|
447
|
-
buildInput: (ctx) => ({
|
|
448
|
-
project_id: ctx.num("project-id"),
|
|
449
|
-
feature_key: ctx.str("feature-key")
|
|
450
|
-
})
|
|
451
|
-
});
|
|
452
|
-
|
|
453
|
-
// src/commands/te-experiment/feature-whitelist/shared.ts
|
|
454
|
-
function readRuleIds(ctx) {
|
|
455
|
-
const value = ctx.json("rule-ids");
|
|
456
|
-
if (!Array.isArray(value) || value.length === 0 || !value.every((item) => typeof item === "string" && item.trim() !== "")) {
|
|
457
|
-
throw new Error("Flag --rule-ids must be a non-empty JSON array of strings");
|
|
458
|
-
}
|
|
459
|
-
return value;
|
|
460
|
-
}
|
|
461
|
-
function readWhitelist(ctx) {
|
|
462
|
-
const value = ctx.json("whitelist");
|
|
463
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
464
|
-
throw new Error("Flag --whitelist must be a non-empty JSON array");
|
|
465
|
-
}
|
|
466
|
-
const bucketIds = /* @__PURE__ */ new Set();
|
|
467
|
-
value.forEach((bucket, bucketIndex) => {
|
|
468
|
-
if (!bucket || typeof bucket !== "object" || Array.isArray(bucket)) {
|
|
469
|
-
throw new Error(`Flag --whitelist[${bucketIndex}] must be a JSON object`);
|
|
470
|
-
}
|
|
471
|
-
const item = bucket;
|
|
472
|
-
if (typeof item.bucket_id !== "string" || item.bucket_id.trim() === "") {
|
|
473
|
-
throw new Error(`Flag --whitelist[${bucketIndex}].bucket_id must be a non-empty string`);
|
|
474
|
-
}
|
|
475
|
-
if (bucketIds.has(item.bucket_id)) {
|
|
476
|
-
throw new Error(`Flag --whitelist contains duplicate bucket_id: ${item.bucket_id}`);
|
|
477
|
-
}
|
|
478
|
-
bucketIds.add(item.bucket_id);
|
|
479
|
-
if (!Array.isArray(item.rules) || item.rules.length === 0) {
|
|
480
|
-
throw new Error(`Flag --whitelist[${bucketIndex}].rules must be a non-empty array`);
|
|
481
|
-
}
|
|
482
|
-
const bucketValueIds = /* @__PURE__ */ new Set();
|
|
483
|
-
item.rules.forEach((rule, ruleIndex) => {
|
|
484
|
-
if (!rule || typeof rule !== "object" || Array.isArray(rule)) {
|
|
485
|
-
throw new Error(`Flag --whitelist[${bucketIndex}].rules[${ruleIndex}] must be a JSON object`);
|
|
486
|
-
}
|
|
487
|
-
const row = rule;
|
|
488
|
-
if (!Array.isArray(row.ids) || row.ids.length === 0 || !row.ids.every((id) => typeof id === "string" && id.trim() !== "")) {
|
|
489
|
-
throw new Error(`Flag --whitelist[${bucketIndex}].rules[${ruleIndex}].ids must be a non-empty string array`);
|
|
490
|
-
}
|
|
491
|
-
row.ids.forEach((id) => {
|
|
492
|
-
if (bucketValueIds.has(id)) {
|
|
493
|
-
throw new Error(`Flag --whitelist bucket ${item.bucket_id} contains duplicate ID: ${id}`);
|
|
494
|
-
}
|
|
495
|
-
bucketValueIds.add(id);
|
|
496
|
-
});
|
|
497
|
-
if (typeof row.value !== "string") {
|
|
498
|
-
throw new Error(`Flag --whitelist[${bucketIndex}].rules[${ruleIndex}].value must be a string`);
|
|
499
|
-
}
|
|
500
|
-
});
|
|
501
|
-
});
|
|
502
|
-
return value;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
// src/commands/te-experiment/feature-whitelist/batch-delete.ts
|
|
506
|
-
function buildBody(ctx) {
|
|
507
|
-
return { project_id: ctx.num("project-id"), rule_ids: readRuleIds(ctx) };
|
|
508
|
-
}
|
|
509
|
-
var featureWhitelistBatchDelete = createExperimentCapabilityCommand({
|
|
510
|
-
resource: "feature whitelist",
|
|
511
|
-
command: "batch-delete",
|
|
512
|
-
capabilityId: "experiment.feature_whitelist.batch_delete",
|
|
513
|
-
description: "Delete Feature whitelist rules; enabled whitelist rules are allowed and trigger RCC resync.",
|
|
514
|
-
flags: [
|
|
515
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
516
|
-
{ name: "rule-ids", type: "json", required: true, desc: "Non-empty JSON array of whitelist rule IDs." }
|
|
517
|
-
],
|
|
518
|
-
risk: "high-risk-write",
|
|
519
|
-
validate: (ctx) => {
|
|
520
|
-
buildBody(ctx);
|
|
521
|
-
},
|
|
522
|
-
buildInput: buildBody
|
|
523
|
-
});
|
|
524
|
-
|
|
525
|
-
// src/commands/te-experiment/feature-whitelist/list.ts
|
|
526
|
-
function buildInput5(ctx) {
|
|
527
|
-
return {
|
|
528
|
-
project_id: ctx.num("project-id"),
|
|
529
|
-
feature_key: ctx.str("feature-key")
|
|
530
|
-
};
|
|
531
|
-
}
|
|
532
|
-
var featureWhitelistList = createExperimentCapabilityCommand({
|
|
533
|
-
resource: "feature whitelist",
|
|
534
|
-
command: "list",
|
|
535
|
-
capabilityId: "experiment.feature_whitelist.list",
|
|
536
|
-
description: "List explicit whitelist rules for one Feature.",
|
|
537
|
-
flags: [
|
|
538
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
539
|
-
{ name: "feature-key", type: "string", required: true, desc: "Existing Feature key." }
|
|
540
|
-
],
|
|
541
|
-
risk: "read",
|
|
542
|
-
buildInput: buildInput5
|
|
543
|
-
});
|
|
544
|
-
|
|
545
|
-
// src/commands/te-experiment/feature-whitelist/save.ts
|
|
546
|
-
function buildInput6(ctx) {
|
|
547
|
-
const ruleId = ctx.str("rule-id").trim();
|
|
548
|
-
const status = ctx.str("status").trim() || "draft";
|
|
549
|
-
if (!["draft", "enable", "disable"].includes(status)) {
|
|
550
|
-
throw new Error("Flag --status must be one of draft, enable, disable");
|
|
551
|
-
}
|
|
552
|
-
const input = {
|
|
553
|
-
project_id: ctx.num("project-id"),
|
|
554
|
-
feature_key: ctx.str("feature-key"),
|
|
555
|
-
whitelist: readWhitelist(ctx),
|
|
556
|
-
status
|
|
557
|
-
};
|
|
558
|
-
if (ruleId) input.rule_id = ruleId;
|
|
559
|
-
const priority = ctx.str("priority");
|
|
560
|
-
if (priority !== "") input.priority = ctx.num("priority");
|
|
561
|
-
return input;
|
|
562
|
-
}
|
|
563
|
-
var featureWhitelistSave = createExperimentCapabilityCommand({
|
|
564
|
-
resource: "feature whitelist",
|
|
565
|
-
command: "save",
|
|
566
|
-
capabilityId: "experiment.feature_whitelist.save",
|
|
567
|
-
description: "Create or modify a Feature whitelist rule and optionally enable it.",
|
|
568
|
-
flags: [
|
|
569
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
570
|
-
{ name: "feature-key", type: "string", required: true, desc: "Existing Feature key." },
|
|
571
|
-
{ name: "rule-id", type: "string", desc: "Existing whitelist rule ID; omit to create a new rule." },
|
|
572
|
-
{ name: "priority", type: "number", desc: "Rule priority; omitted create requests use the server-assigned next priority." },
|
|
573
|
-
{ name: "status", type: "string", default: "draft", desc: "Rule status: draft, enable, or disable." },
|
|
574
|
-
{
|
|
575
|
-
name: "whitelist",
|
|
576
|
-
type: "json",
|
|
577
|
-
required: true,
|
|
578
|
-
desc: 'Whitelist bucket array: [{"bucket_id":"#user_id","rules":[{"ids":["u1"],"value":"on"}]}].'
|
|
579
|
-
}
|
|
580
|
-
],
|
|
581
|
-
risk: "write",
|
|
582
|
-
validate: (ctx) => {
|
|
583
|
-
buildInput6(ctx);
|
|
584
|
-
},
|
|
585
|
-
buildInput: buildInput6
|
|
586
|
-
});
|
|
587
|
-
|
|
588
|
-
// src/commands/te-experiment/feature-whitelist/update-status.ts
|
|
589
|
-
function buildBody2(ctx) {
|
|
590
|
-
const status = ctx.str("status");
|
|
591
|
-
if (!["enable", "disable"].includes(status)) {
|
|
592
|
-
throw new Error("Flag --status must be one of enable, disable");
|
|
593
|
-
}
|
|
594
|
-
return { project_id: ctx.num("project-id"), rule_id: ctx.str("rule-id"), status };
|
|
595
|
-
}
|
|
596
|
-
var featureWhitelistUpdateStatus = createExperimentCapabilityCommand({
|
|
597
|
-
resource: "feature whitelist",
|
|
598
|
-
command: "update-status",
|
|
599
|
-
capabilityId: "experiment.feature_whitelist.update_status",
|
|
600
|
-
description: "Enable or disable a Feature whitelist rule; enabled rules sync an online Feature to RCC.",
|
|
601
|
-
flags: [
|
|
602
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
603
|
-
{ name: "rule-id", type: "string", required: true, desc: "Whitelist rule ID." },
|
|
604
|
-
{ name: "status", type: "string", required: true, desc: "Target status: enable or disable." }
|
|
605
|
-
],
|
|
606
|
-
risk: "write",
|
|
607
|
-
validate: (ctx) => {
|
|
608
|
-
buildBody2(ctx);
|
|
609
|
-
},
|
|
610
|
-
buildInput: buildBody2
|
|
611
|
-
});
|
|
612
|
-
|
|
613
|
-
// src/commands/te-experiment/metric/delete.ts
|
|
614
|
-
var metricDelete = createExperimentCapabilityCommand({
|
|
615
|
-
resource: "metric",
|
|
616
|
-
command: "delete",
|
|
617
|
-
capabilityId: "experiment.metric.delete",
|
|
618
|
-
description: "Delete one experiment metric.",
|
|
619
|
-
flags: [
|
|
620
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
621
|
-
{ name: "metric-id", type: "string", required: true, desc: "Metric ID." }
|
|
622
|
-
],
|
|
623
|
-
risk: "high-risk-write",
|
|
624
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id"), metric_id: ctx.str("metric-id") })
|
|
625
|
-
});
|
|
626
|
-
|
|
627
|
-
// src/commands/te-experiment/metric/get.ts
|
|
628
|
-
var metricGet = createExperimentCapabilityCommand({
|
|
629
|
-
resource: "metric",
|
|
630
|
-
command: "get",
|
|
631
|
-
capabilityId: "experiment.metric.get",
|
|
632
|
-
description: "Get one experiment metric by ID.",
|
|
633
|
-
flags: [
|
|
634
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
635
|
-
{ name: "metric-id", type: "string", required: true, desc: "Metric ID." }
|
|
636
|
-
],
|
|
637
|
-
risk: "read",
|
|
638
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id"), metric_id: ctx.str("metric-id") })
|
|
639
|
-
});
|
|
640
|
-
|
|
641
|
-
// src/commands/te-experiment/metric/list.ts
|
|
642
|
-
var metricList = createExperimentCapabilityCommand({
|
|
643
|
-
resource: "metric",
|
|
644
|
-
command: "list",
|
|
645
|
-
capabilityId: "experiment.metric.list",
|
|
646
|
-
description: "List experiment metrics in a project.",
|
|
647
|
-
flags: [{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." }],
|
|
648
|
-
risk: "read",
|
|
649
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id") })
|
|
650
|
-
});
|
|
651
|
-
|
|
652
|
-
// src/commands/te-experiment/metric/save.ts
|
|
653
|
-
var metricSave = createExperimentCapabilityCommand({
|
|
654
|
-
resource: "metric",
|
|
655
|
-
command: "save",
|
|
656
|
-
capabilityId: "experiment.metric.save",
|
|
657
|
-
description: "Create or update an experiment metric.",
|
|
658
|
-
flags: [
|
|
659
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
660
|
-
{
|
|
661
|
-
name: "req",
|
|
662
|
-
type: "json",
|
|
663
|
-
required: true,
|
|
664
|
-
desc: "Native camelCase request; use metricDefinition, never metricConfig or calcType."
|
|
665
|
-
}
|
|
666
|
-
],
|
|
667
|
-
risk: "write",
|
|
668
|
-
validate: (ctx) => {
|
|
669
|
-
readRequiredObject(ctx, "req");
|
|
670
|
-
},
|
|
671
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id"), req: readRequiredObject(ctx, "req") })
|
|
672
|
-
});
|
|
673
|
-
|
|
674
|
-
// src/commands/te-experiment/operation-log/query.ts
|
|
675
|
-
var operationLogQuery = createExperimentCapabilityCommand({
|
|
676
|
-
resource: "operation-log",
|
|
677
|
-
command: "query",
|
|
678
|
-
capabilityId: "experiment.operation-log.query",
|
|
679
|
-
description: "Query full operation logs for one experiment, including remark and structured changes.",
|
|
680
|
-
flags: [
|
|
681
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
682
|
-
{ name: "exp-id", type: "string", required: true, desc: "Experiment ID." }
|
|
683
|
-
],
|
|
684
|
-
risk: "read",
|
|
685
|
-
buildInput: (ctx) => ({
|
|
686
|
-
project_id: ctx.num("project-id"),
|
|
687
|
-
exp_id: ctx.str("exp-id")
|
|
688
|
-
})
|
|
689
|
-
});
|
|
690
|
-
|
|
691
|
-
// src/commands/te-experiment/save/build-guide.ts
|
|
692
|
-
var saveBuildGuide = createExperimentCapabilityCommand({
|
|
693
|
-
resource: "save",
|
|
694
|
-
command: "build-guide",
|
|
695
|
-
capabilityId: "experiment.save.build-guide",
|
|
696
|
-
description: "Build a read-only save guide for feature, traffic layer, experiment, or metric saves. WARNING: data.guide.example_args.req keys are recursively snake_cased for display; do not copy them into --req. Final save DTOs require camelCase (e.g. expName). Prefer capability inspect <final-save-id> input_schema.properties.req.",
|
|
697
|
-
flags: [
|
|
698
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
699
|
-
{
|
|
700
|
-
name: "operation-mode",
|
|
701
|
-
type: "string",
|
|
702
|
-
required: true,
|
|
703
|
-
desc: "Save operation mode: save_feature, save_traffic_layer, save_experiment, or save_metric."
|
|
704
|
-
}
|
|
705
|
-
],
|
|
706
|
-
risk: "read",
|
|
707
|
-
validate: (ctx) => {
|
|
708
|
-
const mode = ctx.str("operation-mode");
|
|
709
|
-
if (!["save_feature", "save_traffic_layer", "save_experiment", "save_metric"].includes(mode)) {
|
|
710
|
-
throw new Error("Flag --operation-mode must be one of: save_feature, save_traffic_layer, save_experiment, save_metric");
|
|
711
|
-
}
|
|
712
|
-
},
|
|
713
|
-
buildInput: (ctx) => ({
|
|
714
|
-
project_id: ctx.num("project-id"),
|
|
715
|
-
operation_mode: ctx.str("operation-mode")
|
|
716
|
-
})
|
|
717
|
-
});
|
|
718
|
-
|
|
719
|
-
// src/commands/te-experiment/save/validate.ts
|
|
720
|
-
var saveValidate = createExperimentCapabilityCommand({
|
|
721
|
-
resource: "save",
|
|
722
|
-
command: "validate",
|
|
723
|
-
capabilityId: "experiment.save.validate",
|
|
724
|
-
description: "Dry-run validation for feature, traffic layer, experiment, or metric save requests. WARNING: valid=true is not a final-save schema pass; snake_case req keys (e.g. exp_name) can still fail on experiment \u2026 save. Always pass camelCase --req. Do not copy example_args.req key casing from this response.",
|
|
725
|
-
flags: [
|
|
726
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
727
|
-
{
|
|
728
|
-
name: "operation-mode",
|
|
729
|
-
type: "string",
|
|
730
|
-
required: true,
|
|
731
|
-
desc: "Save operation mode: save_feature, save_traffic_layer, save_experiment, or save_metric."
|
|
732
|
-
},
|
|
733
|
-
{
|
|
734
|
-
name: "req",
|
|
735
|
-
type: "json",
|
|
736
|
-
required: true,
|
|
737
|
-
desc: "Candidate camelCase save request object (expName/metricId/\u2026). Never use snake_case DTO keys."
|
|
738
|
-
}
|
|
739
|
-
],
|
|
740
|
-
risk: "read",
|
|
741
|
-
validate: (ctx) => {
|
|
742
|
-
const mode = ctx.str("operation-mode");
|
|
743
|
-
if (!["save_feature", "save_traffic_layer", "save_experiment", "save_metric"].includes(mode)) {
|
|
744
|
-
throw new Error("Flag --operation-mode must be one of: save_feature, save_traffic_layer, save_experiment, save_metric");
|
|
745
|
-
}
|
|
746
|
-
readRequiredObject(ctx, "req");
|
|
747
|
-
},
|
|
748
|
-
buildInput: (ctx) => ({
|
|
749
|
-
project_id: ctx.num("project-id"),
|
|
750
|
-
operation_mode: ctx.str("operation-mode"),
|
|
751
|
-
req: readRequiredObject(ctx, "req")
|
|
752
|
-
})
|
|
753
|
-
});
|
|
754
|
-
|
|
755
|
-
// src/commands/te-experiment/report/metric-trend.ts
|
|
756
|
-
var reportMetricTrend = createExperimentCapabilityCommand({
|
|
757
|
-
resource: "report",
|
|
758
|
-
command: "metric-trend",
|
|
759
|
-
capabilityId: "experiment.report.metric-trend",
|
|
760
|
-
description: "Query an experiment metric trend report for a date range.",
|
|
761
|
-
flags: [
|
|
762
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
763
|
-
{ name: "exp-id", type: "string", required: true, desc: "Experiment ID." },
|
|
764
|
-
{ name: "metric-id", type: "string", required: true, desc: "Metric ID." },
|
|
765
|
-
{ name: "start-time", type: "string", required: true, desc: "Start date in yyyy-MM-dd format." },
|
|
766
|
-
{ name: "end-time", type: "string", required: true, desc: "End date in yyyy-MM-dd format." },
|
|
767
|
-
{
|
|
768
|
-
name: "request-id",
|
|
769
|
-
type: "string",
|
|
770
|
-
required: false,
|
|
771
|
-
desc: "Optional caller-supplied cli_<32 lowercase hex> lifecycle ID. ae-cli generates and prints one before dispatch when omitted."
|
|
772
|
-
},
|
|
773
|
-
{ name: "force-refresh", type: "boolean", required: false, desc: "Force refresh report data." }
|
|
774
|
-
],
|
|
775
|
-
risk: "read",
|
|
776
|
-
buildInput: (ctx) => {
|
|
777
|
-
const input = {
|
|
778
|
-
project_id: ctx.num("project-id"),
|
|
779
|
-
exp_id: ctx.str("exp-id"),
|
|
780
|
-
metric_id: ctx.str("metric-id"),
|
|
781
|
-
start_time: ctx.str("start-time"),
|
|
782
|
-
end_time: ctx.str("end-time")
|
|
783
|
-
};
|
|
784
|
-
addOptionalString(input, "request_id", ctx.str("request-id"));
|
|
785
|
-
addOptionalBoolean(input, ctx, "force-refresh", "force_refresh");
|
|
786
|
-
return input;
|
|
787
|
-
}
|
|
788
|
-
});
|
|
789
|
-
|
|
790
|
-
// src/commands/te-experiment/report/sample-size.ts
|
|
791
|
-
var reportSampleSize = createExperimentCapabilityCommand({
|
|
792
|
-
resource: "report",
|
|
793
|
-
command: "sample-size",
|
|
794
|
-
capabilityId: "experiment.report.sample-size",
|
|
795
|
-
description: "Query an experiment sample-size report for a date range.",
|
|
796
|
-
flags: [
|
|
797
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
798
|
-
{ name: "exp-id", type: "string", required: true, desc: "Experiment ID." },
|
|
799
|
-
{ name: "start-time", type: "string", required: true, desc: "Start date in yyyy-MM-dd format." },
|
|
800
|
-
{ name: "end-time", type: "string", required: true, desc: "End date in yyyy-MM-dd format." },
|
|
801
|
-
{
|
|
802
|
-
name: "request-id",
|
|
803
|
-
type: "string",
|
|
804
|
-
required: false,
|
|
805
|
-
desc: "Optional caller-supplied cli_<32 lowercase hex> lifecycle ID. ae-cli generates and prints one before dispatch when omitted."
|
|
806
|
-
},
|
|
807
|
-
{ name: "force-refresh", type: "boolean", required: false, desc: "Force refresh report data." },
|
|
808
|
-
{ name: "by-hour", type: "boolean", required: false, desc: "Break results down by hour." }
|
|
809
|
-
],
|
|
810
|
-
risk: "read",
|
|
811
|
-
buildInput: (ctx) => {
|
|
812
|
-
const input = {
|
|
813
|
-
project_id: ctx.num("project-id"),
|
|
814
|
-
exp_id: ctx.str("exp-id"),
|
|
815
|
-
start_time: ctx.str("start-time"),
|
|
816
|
-
end_time: ctx.str("end-time")
|
|
817
|
-
};
|
|
818
|
-
addOptionalString(input, "request_id", ctx.str("request-id"));
|
|
819
|
-
addOptionalBoolean(input, ctx, "force-refresh", "force_refresh");
|
|
820
|
-
addOptionalBoolean(input, ctx, "by-hour", "by_hour");
|
|
821
|
-
return input;
|
|
822
|
-
}
|
|
823
|
-
});
|
|
824
|
-
|
|
825
|
-
// src/commands/te-experiment/report/summary.ts
|
|
826
|
-
var reportSummary = createExperimentCapabilityCommand({
|
|
827
|
-
resource: "report",
|
|
828
|
-
command: "summary",
|
|
829
|
-
capabilityId: "experiment.report.summary",
|
|
830
|
-
description: "Query an experiment report summary.",
|
|
831
|
-
flags: [
|
|
832
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
833
|
-
{ name: "exp-id", type: "string", required: true, desc: "Experiment ID." },
|
|
834
|
-
{ name: "force-refresh", type: "boolean", required: false, desc: "Force refresh report data." }
|
|
835
|
-
],
|
|
836
|
-
risk: "read",
|
|
837
|
-
buildInput: (ctx) => {
|
|
838
|
-
const input = {
|
|
839
|
-
project_id: ctx.num("project-id"),
|
|
840
|
-
exp_id: ctx.str("exp-id")
|
|
841
|
-
};
|
|
842
|
-
addOptionalBoolean(input, ctx, "force-refresh", "force_refresh");
|
|
843
|
-
return input;
|
|
844
|
-
}
|
|
845
|
-
});
|
|
846
|
-
|
|
847
|
-
// src/commands/te-experiment/traffic-layer/batch-delete.ts
|
|
848
|
-
var trafficLayerBatchDelete = createExperimentCapabilityCommand({
|
|
849
|
-
resource: "traffic-layer",
|
|
850
|
-
command: "batch-delete",
|
|
851
|
-
capabilityId: "experiment.traffic-layer.batch-delete",
|
|
852
|
-
description: "Batch delete traffic layers.",
|
|
853
|
-
flags: [
|
|
854
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
855
|
-
{ name: "layer-ids", type: "json", required: true, desc: "Traffic layer IDs as a JSON string array." }
|
|
856
|
-
],
|
|
857
|
-
risk: "high-risk-write",
|
|
858
|
-
validate: (ctx) => {
|
|
859
|
-
readRequiredStringArray(ctx, "layer-ids");
|
|
860
|
-
},
|
|
861
|
-
buildInput: (ctx) => ({
|
|
862
|
-
project_id: ctx.num("project-id"),
|
|
863
|
-
layer_ids: readRequiredStringArray(ctx, "layer-ids")
|
|
864
|
-
})
|
|
865
|
-
});
|
|
866
|
-
|
|
867
|
-
// src/commands/te-experiment/traffic-layer/get.ts
|
|
868
|
-
var trafficLayerGet = createExperimentCapabilityCommand({
|
|
869
|
-
resource: "traffic-layer",
|
|
870
|
-
command: "get",
|
|
871
|
-
capabilityId: "experiment.traffic-layer.get",
|
|
872
|
-
description: "Get one traffic layer by ID.",
|
|
873
|
-
flags: [
|
|
874
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
875
|
-
{ name: "layer-id", type: "string", required: true, desc: "Traffic layer ID." }
|
|
876
|
-
],
|
|
877
|
-
risk: "read",
|
|
878
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id"), layer_id: ctx.str("layer-id") })
|
|
879
|
-
});
|
|
880
|
-
|
|
881
|
-
// src/commands/te-experiment/traffic-layer/list.ts
|
|
882
|
-
var trafficLayerList = createExperimentCapabilityCommand({
|
|
883
|
-
resource: "traffic-layer",
|
|
884
|
-
command: "list",
|
|
885
|
-
capabilityId: "experiment.traffic-layer.list",
|
|
886
|
-
description: "List traffic layers in a project.",
|
|
887
|
-
flags: [{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." }],
|
|
888
|
-
risk: "read",
|
|
889
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id") })
|
|
890
|
-
});
|
|
891
|
-
|
|
892
|
-
// src/commands/te-experiment/traffic-layer/save.ts
|
|
893
|
-
var trafficLayerSave = createExperimentCapabilityCommand({
|
|
894
|
-
resource: "traffic-layer",
|
|
895
|
-
command: "save",
|
|
896
|
-
capabilityId: "experiment.traffic-layer.save",
|
|
897
|
-
description: "Create or update a traffic layer.",
|
|
898
|
-
flags: [
|
|
899
|
-
{ name: "project-id", type: "number", required: true, alias: "p", desc: "Numeric project ID." },
|
|
900
|
-
{ name: "req", type: "json", required: true, desc: "Native camelCase traffic layer save request object." }
|
|
901
|
-
],
|
|
902
|
-
risk: "write",
|
|
903
|
-
validate: (ctx) => {
|
|
904
|
-
readRequiredObject(ctx, "req");
|
|
905
|
-
},
|
|
906
|
-
buildInput: (ctx) => ({ project_id: ctx.num("project-id"), req: readRequiredObject(ctx, "req") })
|
|
907
|
-
});
|
|
908
|
-
|
|
909
|
-
// src/commands/te-experiment/index.ts
|
|
910
|
-
registerCapabilityGatewayRoute("experiment", { gatewayDomain: "engage" });
|
|
911
|
-
var commands = [
|
|
912
|
-
experimentSave,
|
|
913
|
-
experimentList,
|
|
914
|
-
experimentListArchived,
|
|
915
|
-
experimentGet,
|
|
916
|
-
experimentReadyCheck,
|
|
917
|
-
experimentConflictCheck,
|
|
918
|
-
experimentManage,
|
|
919
|
-
experimentUpdateGroup,
|
|
920
|
-
experimentUpdateMetrics,
|
|
921
|
-
experimentBatchDelete,
|
|
922
|
-
operationLogQuery,
|
|
923
|
-
saveBuildGuide,
|
|
924
|
-
saveValidate,
|
|
925
|
-
trafficLayerSave,
|
|
926
|
-
trafficLayerGet,
|
|
927
|
-
trafficLayerList,
|
|
928
|
-
trafficLayerBatchDelete,
|
|
929
|
-
reportSummary,
|
|
930
|
-
reportSampleSize,
|
|
931
|
-
reportMetricTrend,
|
|
932
|
-
metricSave,
|
|
933
|
-
metricGet,
|
|
934
|
-
metricList,
|
|
935
|
-
metricDelete,
|
|
936
|
-
featureSave,
|
|
937
|
-
featureUpdateStatus,
|
|
938
|
-
featureGet,
|
|
939
|
-
featureList,
|
|
940
|
-
featureVersionList,
|
|
941
|
-
featureOperationLogQuery,
|
|
942
|
-
featureBatchDelete,
|
|
943
|
-
featureWhitelistList,
|
|
944
|
-
featureWhitelistSave,
|
|
945
|
-
featureWhitelistUpdateStatus,
|
|
946
|
-
featureWhitelistBatchDelete,
|
|
947
|
-
bucketList
|
|
948
|
-
];
|
|
949
|
-
var te_experiment_default = commands;
|
|
950
|
-
export {
|
|
951
|
-
bucketList,
|
|
952
|
-
te_experiment_default as default,
|
|
953
|
-
experimentBatchDelete,
|
|
954
|
-
experimentConflictCheck,
|
|
955
|
-
experimentGet,
|
|
956
|
-
experimentList,
|
|
957
|
-
experimentListArchived,
|
|
958
|
-
experimentManage,
|
|
959
|
-
experimentReadyCheck,
|
|
960
|
-
experimentSave,
|
|
961
|
-
experimentUpdateGroup,
|
|
962
|
-
experimentUpdateMetrics,
|
|
963
|
-
featureBatchDelete,
|
|
964
|
-
featureGet,
|
|
965
|
-
featureList,
|
|
966
|
-
featureOperationLogQuery,
|
|
967
|
-
featureSave,
|
|
968
|
-
featureUpdateStatus,
|
|
969
|
-
featureVersionList,
|
|
970
|
-
featureWhitelistBatchDelete,
|
|
971
|
-
featureWhitelistList,
|
|
972
|
-
featureWhitelistSave,
|
|
973
|
-
featureWhitelistUpdateStatus,
|
|
974
|
-
metricDelete,
|
|
975
|
-
metricGet,
|
|
976
|
-
metricList,
|
|
977
|
-
metricSave,
|
|
978
|
-
operationLogQuery,
|
|
979
|
-
reportMetricTrend,
|
|
980
|
-
reportSampleSize,
|
|
981
|
-
reportSummary,
|
|
982
|
-
saveBuildGuide,
|
|
983
|
-
saveValidate,
|
|
984
|
-
trafficLayerBatchDelete,
|
|
985
|
-
trafficLayerGet,
|
|
986
|
-
trafficLayerList,
|
|
987
|
-
trafficLayerSave
|
|
988
|
-
};
|