@framedash/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/dist/commands/alerts.d.ts +2 -0
- package/dist/commands/alerts.d.ts.map +1 -0
- package/dist/commands/alerts.js +171 -0
- package/dist/commands/alerts.js.map +1 -0
- package/dist/commands/auth.d.ts +2 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +20 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/content.d.ts +2 -0
- package/dist/commands/content.d.ts.map +1 -0
- package/dist/commands/content.js +104 -0
- package/dist/commands/content.js.map +1 -0
- package/dist/commands/dashboard.d.ts +2 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +22 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/funnel.d.ts +2 -0
- package/dist/commands/funnel.d.ts.map +1 -0
- package/dist/commands/funnel.js +43 -0
- package/dist/commands/funnel.js.map +1 -0
- package/dist/commands/map-capture.d.ts +17 -0
- package/dist/commands/map-capture.d.ts.map +1 -0
- package/dist/commands/map-capture.js +200 -0
- package/dist/commands/map-capture.js.map +1 -0
- package/dist/commands/maps.d.ts +2 -0
- package/dist/commands/maps.d.ts.map +1 -0
- package/dist/commands/maps.js +38 -0
- package/dist/commands/maps.js.map +1 -0
- package/dist/commands/query.d.ts +2 -0
- package/dist/commands/query.d.ts.map +1 -0
- package/dist/commands/query.js +70 -0
- package/dist/commands/query.js.map +1 -0
- package/dist/commands/retention.d.ts +2 -0
- package/dist/commands/retention.d.ts.map +1 -0
- package/dist/commands/retention.js +22 -0
- package/dist/commands/retention.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +20 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/config.d.ts +47 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +114 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/create-client.d.ts +3 -0
- package/dist/lib/create-client.d.ts.map +1 -0
- package/dist/lib/create-client.js +30 -0
- package/dist/lib/create-client.js.map +1 -0
- package/dist/lib/formatters.d.ts +4 -0
- package/dist/lib/formatters.d.ts.map +1 -0
- package/dist/lib/formatters.js +71 -0
- package/dist/lib/formatters.js.map +1 -0
- package/dist/lib/logger.d.ts +9 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +15 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/metadata.d.ts +36 -0
- package/dist/lib/metadata.d.ts.map +1 -0
- package/dist/lib/metadata.js +40 -0
- package/dist/lib/metadata.js.map +1 -0
- package/dist/lib/run-command.d.ts +28 -0
- package/dist/lib/run-command.d.ts.map +1 -0
- package/dist/lib/run-command.js +53 -0
- package/dist/lib/run-command.js.map +1 -0
- package/dist/lib/uploader.d.ts +19 -0
- package/dist/lib/uploader.d.ts.map +1 -0
- package/dist/lib/uploader.js +61 -0
- package/dist/lib/uploader.js.map +1 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Crane Valley LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @framedash/cli
|
|
2
|
+
|
|
3
|
+
Framedash CLI tool for CI/CD pipelines, analytics queries, and coding agent integration.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
| Command | Description |
|
|
8
|
+
|---------|-------------|
|
|
9
|
+
| `framedash auth` | Authenticate with API key |
|
|
10
|
+
| `framedash query` | Run SQL analytics queries against ClickHouse |
|
|
11
|
+
| `framedash dashboard` | Fetch dashboard KPI summary |
|
|
12
|
+
| `framedash retention` | Fetch retention cohort data |
|
|
13
|
+
| `framedash funnel` | Fetch funnel conversion data |
|
|
14
|
+
| `framedash alerts` | Manage alert rules and channels |
|
|
15
|
+
| `framedash maps` | List and manage map overlays |
|
|
16
|
+
| `framedash content` | Manage content registry entries |
|
|
17
|
+
| `framedash status` | Check project ingestion status |
|
|
18
|
+
| `framedash map-capture` | Upload captured map images |
|
|
19
|
+
|
|
20
|
+
## Environment
|
|
21
|
+
|
|
22
|
+
API commands require an API key from `--api-key-file` (which supports `-` for
|
|
23
|
+
piped stdin), `--api-key`, or `FRAMEDASH_API_KEY`. Prefer files or piped stdin
|
|
24
|
+
over `--api-key` for local runs so raw keys do not appear in shell history.
|
|
25
|
+
|
|
26
|
+
Project-scoped commands such as `dashboard` also require a project ID from
|
|
27
|
+
`--project-id` or `FRAMEDASH_PROJECT_ID`. The `auth` command only requires an
|
|
28
|
+
API key.
|
|
29
|
+
|
|
30
|
+
For the local examples below, keep the API key in `../../framedash.key` and set
|
|
31
|
+
`FRAMEDASH_PROJECT_ID` to the target project UUID before running project-scoped
|
|
32
|
+
commands.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
export FRAMEDASH_PROJECT_ID="<project-uuid>"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
Build the CLI workspace and its dependencies from the repository root:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pnpm --filter @framedash/cli... build
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
After completing the Environment setup, run these commands from `packages/cli`:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cd packages/cli
|
|
50
|
+
|
|
51
|
+
node . --help
|
|
52
|
+
node . auth --api-key-file ../../framedash.key
|
|
53
|
+
cat ../../framedash.key | node . auth --api-key-file -
|
|
54
|
+
node . dashboard --api-key-file ../../framedash.key --format json
|
|
55
|
+
node . dashboard --api-key-file ../../framedash.key --format table
|
|
56
|
+
node . dashboard --api-key-file ../../framedash.key --format csv
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Development
|
|
60
|
+
|
|
61
|
+
Run these commands from `packages/cli`:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pnpm build # Compile TypeScript
|
|
65
|
+
pnpm test # Run tests
|
|
66
|
+
pnpm type-check # Type check
|
|
67
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../src/commands/alerts.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,MAAM,mCAKjB,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { parseNumber, parsePositiveInt } from "../lib/config.js";
|
|
2
|
+
import { formatOutput } from "../lib/formatters.js";
|
|
3
|
+
import { error, log, success } from "../lib/logger.js";
|
|
4
|
+
import { runCommand, withSubcommands } from "../lib/run-command.js";
|
|
5
|
+
const HELP = `Usage: framedash alerts <subcommand> [options]
|
|
6
|
+
|
|
7
|
+
Manage alert rules.
|
|
8
|
+
|
|
9
|
+
Subcommands:
|
|
10
|
+
list List alert rules
|
|
11
|
+
create Create a new alert rule
|
|
12
|
+
update <id> Update an alert rule
|
|
13
|
+
delete <id> Delete an alert rule
|
|
14
|
+
|
|
15
|
+
Run 'framedash alerts <subcommand> --help' for more info.`;
|
|
16
|
+
const CREATE_HELP = `Usage: framedash alerts create [options]
|
|
17
|
+
|
|
18
|
+
Create a new alert rule.
|
|
19
|
+
|
|
20
|
+
Required:
|
|
21
|
+
--name <name> Alert rule name
|
|
22
|
+
--map-id <uuid> Map ID
|
|
23
|
+
--threshold-profile-id <uuid> Threshold profile ID
|
|
24
|
+
--metric <metric> Metric name
|
|
25
|
+
--threshold-level <level> Threshold level
|
|
26
|
+
--fail-percentage <n> Failure percentage (0-100)
|
|
27
|
+
--evaluation-days <n> Evaluation period in days
|
|
28
|
+
--cell-size <n> Cell size
|
|
29
|
+
--cooldown-minutes <n> Cooldown period in minutes
|
|
30
|
+
|
|
31
|
+
Optional:
|
|
32
|
+
--channel-ids <id1,id2,...> Notification channel IDs (comma-separated)`;
|
|
33
|
+
export const alerts = withSubcommands("alerts", HELP, {
|
|
34
|
+
list: alertsList,
|
|
35
|
+
create: alertsCreate,
|
|
36
|
+
update: alertsUpdate,
|
|
37
|
+
delete: alertsDelete,
|
|
38
|
+
});
|
|
39
|
+
async function alertsList(args) {
|
|
40
|
+
await runCommand({ args, help: "Usage: framedash alerts list [--format json|table|csv] [global options]" }, async ({ client, config }) => {
|
|
41
|
+
const data = await client.get(client.projectPath("alerts"));
|
|
42
|
+
log(formatOutput(data, config.format));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async function alertsCreate(args) {
|
|
46
|
+
await runCommand({
|
|
47
|
+
args,
|
|
48
|
+
help: CREATE_HELP,
|
|
49
|
+
options: {
|
|
50
|
+
name: { type: "string" },
|
|
51
|
+
"map-id": { type: "string" },
|
|
52
|
+
"threshold-profile-id": { type: "string" },
|
|
53
|
+
metric: { type: "string" },
|
|
54
|
+
"threshold-level": { type: "string" },
|
|
55
|
+
"fail-percentage": { type: "string" },
|
|
56
|
+
"evaluation-days": { type: "string" },
|
|
57
|
+
"cell-size": { type: "string" },
|
|
58
|
+
"cooldown-minutes": { type: "string" },
|
|
59
|
+
"channel-ids": { type: "string" },
|
|
60
|
+
},
|
|
61
|
+
}, async ({ client, config, values }) => {
|
|
62
|
+
const required = [
|
|
63
|
+
"name",
|
|
64
|
+
"map-id",
|
|
65
|
+
"threshold-profile-id",
|
|
66
|
+
"metric",
|
|
67
|
+
"threshold-level",
|
|
68
|
+
"fail-percentage",
|
|
69
|
+
"evaluation-days",
|
|
70
|
+
"cell-size",
|
|
71
|
+
"cooldown-minutes",
|
|
72
|
+
];
|
|
73
|
+
for (const flag of required) {
|
|
74
|
+
if (!values[flag]) {
|
|
75
|
+
error(`--${flag} is required`);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const body = {
|
|
80
|
+
name: values.name,
|
|
81
|
+
mapId: values["map-id"],
|
|
82
|
+
thresholdProfileId: values["threshold-profile-id"],
|
|
83
|
+
metric: values.metric,
|
|
84
|
+
thresholdLevel: values["threshold-level"],
|
|
85
|
+
failPercentage: parseNumber(values["fail-percentage"], "fail-percentage"),
|
|
86
|
+
evaluationDays: parsePositiveInt(values["evaluation-days"], "evaluation-days"),
|
|
87
|
+
cellSize: parsePositiveInt(values["cell-size"], "cell-size"),
|
|
88
|
+
cooldownMinutes: parsePositiveInt(values["cooldown-minutes"], "cooldown-minutes"),
|
|
89
|
+
};
|
|
90
|
+
if (values["channel-ids"]) {
|
|
91
|
+
body.channelIds = parseChannelIds(values["channel-ids"]);
|
|
92
|
+
}
|
|
93
|
+
const data = await client.post(client.projectPath("alerts"), body);
|
|
94
|
+
success("Alert rule created");
|
|
95
|
+
log(formatOutput(data, config.format));
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
async function alertsUpdate(args) {
|
|
99
|
+
await runCommand({
|
|
100
|
+
args,
|
|
101
|
+
help: "Usage: framedash alerts update <alert-id> [--name ...] [--is-active true|false] [--channel-ids id1,id2]",
|
|
102
|
+
options: {
|
|
103
|
+
name: { type: "string" },
|
|
104
|
+
"is-active": { type: "string" },
|
|
105
|
+
"channel-ids": { type: "string" },
|
|
106
|
+
"fail-percentage": { type: "string" },
|
|
107
|
+
"evaluation-days": { type: "string" },
|
|
108
|
+
"cooldown-minutes": { type: "string" },
|
|
109
|
+
},
|
|
110
|
+
allowPositionals: true,
|
|
111
|
+
}, async ({ client, config, values, positionals }) => {
|
|
112
|
+
const alertId = positionals[0];
|
|
113
|
+
if (!alertId) {
|
|
114
|
+
error("Alert ID is required: framedash alerts update <alert-id>");
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
const body = {};
|
|
118
|
+
if (values.name)
|
|
119
|
+
body.name = values.name;
|
|
120
|
+
if (values["is-active"]) {
|
|
121
|
+
const v = values["is-active"];
|
|
122
|
+
if (v !== "true" && v !== "false") {
|
|
123
|
+
error(`--is-active must be "true" or "false", got: ${v}`);
|
|
124
|
+
process.exit(1);
|
|
125
|
+
}
|
|
126
|
+
body.isActive = v === "true";
|
|
127
|
+
}
|
|
128
|
+
if (values["channel-ids"])
|
|
129
|
+
body.channelIds = parseChannelIds(values["channel-ids"]);
|
|
130
|
+
if (values["fail-percentage"])
|
|
131
|
+
body.failPercentage = parseNumber(values["fail-percentage"], "fail-percentage");
|
|
132
|
+
if (values["evaluation-days"])
|
|
133
|
+
body.evaluationDays = parsePositiveInt(values["evaluation-days"], "evaluation-days");
|
|
134
|
+
if (values["cooldown-minutes"])
|
|
135
|
+
body.cooldownMinutes = parsePositiveInt(values["cooldown-minutes"], "cooldown-minutes");
|
|
136
|
+
if (Object.keys(body).length === 0) {
|
|
137
|
+
error("At least one field to update is required");
|
|
138
|
+
process.exit(1);
|
|
139
|
+
}
|
|
140
|
+
const data = await client.patch(client.projectPath(`alerts/${encodeURIComponent(alertId)}`), body);
|
|
141
|
+
success("Alert rule updated");
|
|
142
|
+
log(formatOutput(data, config.format));
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
async function alertsDelete(args) {
|
|
146
|
+
await runCommand({
|
|
147
|
+
args,
|
|
148
|
+
help: "Usage: framedash alerts delete <alert-id> [global options]",
|
|
149
|
+
allowPositionals: true,
|
|
150
|
+
}, async ({ client, positionals }) => {
|
|
151
|
+
const alertId = positionals[0];
|
|
152
|
+
if (!alertId) {
|
|
153
|
+
error("Alert ID is required: framedash alerts delete <alert-id>");
|
|
154
|
+
process.exit(1);
|
|
155
|
+
}
|
|
156
|
+
await client.delete(client.projectPath(`alerts/${encodeURIComponent(alertId)}`));
|
|
157
|
+
success(`Alert rule ${alertId} deleted`);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function parseChannelIds(raw) {
|
|
161
|
+
const ids = raw
|
|
162
|
+
.split(",")
|
|
163
|
+
.map((s) => s.trim())
|
|
164
|
+
.filter(Boolean);
|
|
165
|
+
if (ids.length === 0) {
|
|
166
|
+
error("--channel-ids must contain at least one ID");
|
|
167
|
+
process.exit(1);
|
|
168
|
+
}
|
|
169
|
+
return ids;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=alerts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alerts.js","sourceRoot":"","sources":["../../src/commands/alerts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,sBA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AI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMxD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { formatOutput } from "../lib/formatters.js";
|
|
2
|
+
import { log, success } from "../lib/logger.js";
|
|
3
|
+
import { runCommand } from "../lib/run-command.js";
|
|
4
|
+
export async function auth(args) {
|
|
5
|
+
await runCommand({ args, help: HELP, noProject: true }, async ({ client, config }) => {
|
|
6
|
+
const projects = await client.get("/api/v1/projects");
|
|
7
|
+
success("API key is valid");
|
|
8
|
+
log(formatOutput(projects, config.format));
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
const HELP = `Usage: framedash auth [options]
|
|
12
|
+
|
|
13
|
+
Verify your API key and show the project bound to it.
|
|
14
|
+
|
|
15
|
+
Options:
|
|
16
|
+
--api-key <key> API key (or FRAMEDASH_API_KEY env)
|
|
17
|
+
--base-url <url> API base URL (default: https://app.framedash.dev)
|
|
18
|
+
--format <fmt> Output format: json, table, csv (default: json)
|
|
19
|
+
-h, --help Show help`;
|
|
20
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAAc;IACxC,MAAM,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE;QACpF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAiC,kBAAkB,CAAC,CAAC;QACtF,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAC5B,GAAG,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,IAAI,GAAG;;;;;;;;mCAQsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/commands/content.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,OAAO,mCAIlB,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { formatOutput } from "../lib/formatters.js";
|
|
3
|
+
import { error, log, success } from "../lib/logger.js";
|
|
4
|
+
import { runCommand, withSubcommands } from "../lib/run-command.js";
|
|
5
|
+
const HELP = `Usage: framedash content <subcommand> [options]
|
|
6
|
+
|
|
7
|
+
Manage content registry entries.
|
|
8
|
+
|
|
9
|
+
Subcommands:
|
|
10
|
+
list List content entries
|
|
11
|
+
import <file.json> Import content entries from JSON
|
|
12
|
+
delete <id> Delete by UUID, or use --type + --content-id
|
|
13
|
+
|
|
14
|
+
Run 'framedash content <subcommand> --help' for more info.`;
|
|
15
|
+
const DELETE_HELP = `Usage: framedash content delete <uuid> [global options]
|
|
16
|
+
framedash content delete --type <type> --content-id <id> [global options]
|
|
17
|
+
|
|
18
|
+
Delete a content entry by UUID or by type + content ID pair.`;
|
|
19
|
+
export const content = withSubcommands("content", HELP, {
|
|
20
|
+
list: contentList,
|
|
21
|
+
import: contentImport,
|
|
22
|
+
delete: contentDelete,
|
|
23
|
+
});
|
|
24
|
+
async function contentList(args) {
|
|
25
|
+
await runCommand({
|
|
26
|
+
args,
|
|
27
|
+
help: "Usage: framedash content list [--type <content-type>] [--format json|table|csv] [global options]",
|
|
28
|
+
options: { type: { type: "string" } },
|
|
29
|
+
}, async ({ client, config, values }) => {
|
|
30
|
+
const params = values.type ? `?${new URLSearchParams({ type: values.type })}` : "";
|
|
31
|
+
const data = await client.get(`/api/v1/content${params}`);
|
|
32
|
+
log(formatOutput(data, config.format));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async function contentImport(args) {
|
|
36
|
+
await runCommand({
|
|
37
|
+
args,
|
|
38
|
+
help: "Usage: framedash content import <file.json> [global options]",
|
|
39
|
+
allowPositionals: true,
|
|
40
|
+
}, async ({ client, config, positionals }) => {
|
|
41
|
+
const filePath = positionals[0];
|
|
42
|
+
if (!filePath) {
|
|
43
|
+
error("JSON file path is required: framedash content import <file.json>");
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
let raw;
|
|
47
|
+
try {
|
|
48
|
+
raw = await readFile(filePath, "utf-8");
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
const msg = err instanceof Error ? err.message : "unknown error";
|
|
52
|
+
error(`Failed to read file: ${filePath} (${msg})`);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
let entries;
|
|
56
|
+
try {
|
|
57
|
+
entries = JSON.parse(raw);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
error("Invalid JSON file");
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
// Accept both { entries: [...] } and plain [...]
|
|
64
|
+
const payload = Array.isArray(entries) ? { entries } : entries;
|
|
65
|
+
const data = await client.post("/api/v1/content", payload);
|
|
66
|
+
success("Content imported");
|
|
67
|
+
log(formatOutput(data, config.format));
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async function contentDelete(args) {
|
|
71
|
+
await runCommand({
|
|
72
|
+
args,
|
|
73
|
+
help: DELETE_HELP,
|
|
74
|
+
options: {
|
|
75
|
+
type: { type: "string" },
|
|
76
|
+
"content-id": { type: "string" },
|
|
77
|
+
},
|
|
78
|
+
allowPositionals: true,
|
|
79
|
+
}, async ({ client, values, positionals }) => {
|
|
80
|
+
const id = positionals[0];
|
|
81
|
+
if (id && (values.type || values["content-id"])) {
|
|
82
|
+
error("Cannot combine <uuid> with --type/--content-id. Choose one mode.");
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
if (id) {
|
|
86
|
+
const params = new URLSearchParams({ id });
|
|
87
|
+
await client.delete(`/api/v1/content?${params}`);
|
|
88
|
+
success(`Content entry ${id} deleted`);
|
|
89
|
+
}
|
|
90
|
+
else if (values.type && values["content-id"]) {
|
|
91
|
+
const params = new URLSearchParams({
|
|
92
|
+
contentType: values.type,
|
|
93
|
+
contentId: values["content-id"],
|
|
94
|
+
});
|
|
95
|
+
await client.delete(`/api/v1/content?${params}`);
|
|
96
|
+
success("Content entry deleted");
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
error("Provide <uuid> or both --type and --content-id");
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/commands/content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEpE,MAAM,IAAI,GAAG;;;;;;;;;2DAS8C,CAAC;AAE5D,MAAM,WAAW,GAAG;;;6DAGyC,CAAC;AAE9D,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,SAAS,EAAE,IAAI,EAAE;IACvD,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,aAAa;CACrB,CAAC,CAAC;AAEH,KAAK,UAAU,WAA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AC,kEAAkE,CAAC,CAAC;YAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;QACD,IAAI,EAAE,EAAE,CAAC;YACR,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YAC3C,MAAM,MAAM,CAAC,MAAM,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;YACjD,OAAO,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;QACxC,CAAC;aAAM,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;YAChD,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;gBAClC,WAAW,EAAE,MAAM,CAAC,IAAc;gBAClC,SAAS,EAAE,MAAM,CAAC,YAAY,CAAW;aACzC,CAAC,CAAC;YACH,MAAM,MAAM,CAAC,MAAM,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;YACjD,OAAO,CAAC,uBAAuB,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACP,KAAK,CAAC,gDAAgD,CAAC,CAAC;YACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":"AAIA,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAS7D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { formatOutput } from "../lib/formatters.js";
|
|
2
|
+
import { log } from "../lib/logger.js";
|
|
3
|
+
import { runCommand } from "../lib/run-command.js";
|
|
4
|
+
export async function dashboard(args) {
|
|
5
|
+
await runCommand({ args, help: HELP, options: { days: { type: "string" } } }, async ({ client, config, values }) => {
|
|
6
|
+
const params = new URLSearchParams({ days: values.days ?? "30" });
|
|
7
|
+
const data = await client.get(client.projectPath(`dashboard?${params}`));
|
|
8
|
+
log(formatOutput(data, config.format));
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
const HELP = `Usage: framedash dashboard [options]
|
|
12
|
+
|
|
13
|
+
Show project dashboard metrics.
|
|
14
|
+
|
|
15
|
+
Options:
|
|
16
|
+
--days <n> Time period in days: 1, 7, 14, 30 (default: 30)
|
|
17
|
+
--api-key <key> API key (or FRAMEDASH_API_KEY env)
|
|
18
|
+
--project-id <uuid> Project ID (or FRAMEDASH_PROJECT_ID env)
|
|
19
|
+
--base-url <url> API base URL (default: https://app.framedash.dev)
|
|
20
|
+
--format <fmt> Output format: json, table, csv (default: json)
|
|
21
|
+
-h, --help Show help`;
|
|
22
|
+
//# sourceMappingURL=dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAc;IAC7C,MAAM,UAAU,CACf,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,EAC3D,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE;QACpC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,IAAI,EAAG,MAAM,CAAC,IAAe,IAAI,IAAI,EAAE,CAAC,CAAC;QAC9E,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,MAAM,EAAE,CAAC,CAAC,CAAC;QACzE,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACxC,CAAC,CACD,CAAC;AACH,CAAC;AAED,MAAM,IAAI,GAAG;;;;;;;;;;mCAUsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"funnel.d.ts","sourceRoot":"","sources":["../../src/commands/funnel.ts"],"names":[],"mappings":"AAIA,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0B1D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { formatOutput } from "../lib/formatters.js";
|
|
2
|
+
import { error, log } from "../lib/logger.js";
|
|
3
|
+
import { runCommand } from "../lib/run-command.js";
|
|
4
|
+
export async function funnel(args) {
|
|
5
|
+
await runCommand({
|
|
6
|
+
args,
|
|
7
|
+
help: HELP,
|
|
8
|
+
options: {
|
|
9
|
+
steps: { type: "string" },
|
|
10
|
+
days: { type: "string" },
|
|
11
|
+
window: { type: "string" },
|
|
12
|
+
},
|
|
13
|
+
}, async ({ client, config, values }) => {
|
|
14
|
+
if (!values.steps) {
|
|
15
|
+
error('--steps is required (comma-separated event names, e.g. "login,tutorial,purchase")');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
const params = new URLSearchParams();
|
|
19
|
+
params.set("steps", values.steps);
|
|
20
|
+
if (values.days)
|
|
21
|
+
params.set("days", values.days);
|
|
22
|
+
if (values.window)
|
|
23
|
+
params.set("window", values.window);
|
|
24
|
+
const data = await client.get(client.projectPath(`funnels?${params}`));
|
|
25
|
+
log(formatOutput(data, config.format));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const HELP = `Usage: framedash funnel [options]
|
|
29
|
+
|
|
30
|
+
Analyze event funnels.
|
|
31
|
+
|
|
32
|
+
Required:
|
|
33
|
+
--steps <events> Comma-separated event names (2-8 steps)
|
|
34
|
+
|
|
35
|
+
Options:
|
|
36
|
+
--days <n> Time period in days: 1, 7, 14, 30 (default: 30)
|
|
37
|
+
--window <seconds> Conversion window: 3600, 21600, 86400, 604800 (default: 86400)
|
|
38
|
+
--api-key <key> API key (or FRAMEDASH_API_KEY env)
|
|
39
|
+
--project-id <uuid> Project ID (or FRAMEDASH_PROJECT_ID env)
|
|
40
|
+
--base-url <url> API base URL (default: https://app.framedash.dev)
|
|
41
|
+
--format <fmt> Output format: json, table, csv (default: json)
|
|
42
|
+
-h, --help Show help`;
|
|
43
|
+
//# sourceMappingURL=funnel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"funnel.js","sourceRoot":"","sources":["../../src/commands/funnel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAc;IAC1C,MAAM,UAAU,CACf;QACC,IAAI;QACJ,IAAI,EAAE,IAAI;QACV,OAAO,EAAE;YACR,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC1B;KACD,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE;QACpC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACnB,KAAK,CAAC,mFAAmF,CAAC,CAAC;YAC3F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAe,CAAC,CAAC;QAC5C,IAAI,MAAM,CAAC,IAAI;YAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,IAAc,CAAC,CAAC;QAC3D,IAAI,MAAM,CAAC,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAgB,CAAC,CAAC;QAEjE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,MAAM,EAAE,CAAC,CAAC,CAAC;QACvE,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACxC,CAAC,CACD,CAAC;AACH,CAAC;AAED,MAAM,IAAI,GAAG;;;;;;;;;;;;;;mCAcsB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** CLI entry point for map-capture — parses args then delegates to mapCapture(). */
|
|
2
|
+
export declare function mapCaptureCommand(args: string[]): Promise<void>;
|
|
3
|
+
export type MapCaptureOptions = {
|
|
4
|
+
inputDir: string | undefined;
|
|
5
|
+
upload: boolean | undefined;
|
|
6
|
+
dryRun: boolean | undefined;
|
|
7
|
+
apiKey: string | undefined;
|
|
8
|
+
projectId: string | undefined;
|
|
9
|
+
baseUrl: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
export type MapCaptureResult = {
|
|
12
|
+
ok: boolean;
|
|
13
|
+
successCount: number;
|
|
14
|
+
errorCount: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function mapCapture(opts: MapCaptureOptions): Promise<MapCaptureResult>;
|
|
17
|
+
//# sourceMappingURL=map-capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-capture.d.ts","sourceRoot":"","sources":["../../src/commands/map-capture.ts"],"names":[],"mappings":"AAyCA,oFAAoF;AACpF,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCrE;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAsB,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA+InF"}
|