@freeticket/cli 0.1.0 → 0.1.1
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 +80 -80
- package/dist/index.js +40 -42
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -9,169 +9,169 @@
|
|
|
9
9
|
|
|
10
10
|
# FreeTicket CLI
|
|
11
11
|
|
|
12
|
-
**
|
|
12
|
+
**Your event platform, from the terminal.**
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Events, sales, tickets, memberships, venues, staff, and reports — one command away.
|
|
15
15
|
|
|
16
16
|
[](https://www.npmjs.com/package/@freeticket/cli)
|
|
17
17
|
[](https://github.com/AppFreeticket/freeticket-cli/actions/workflows/ci.yml)
|
|
18
18
|
[](./LICENSE)
|
|
19
|
-
[](#
|
|
19
|
+
[](#requirements)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## What it is
|
|
26
26
|
|
|
27
|
-
`ft`
|
|
28
|
-
**
|
|
29
|
-
dashboard:
|
|
30
|
-
|
|
27
|
+
`ft` is the official command-line client for **FreeTicket**. It consumes the
|
|
28
|
+
**B2B REST API v1** and lets you inspect and operate your workspace without
|
|
29
|
+
opening the dashboard: list events, review sales, export buyers, check KPIs,
|
|
30
|
+
and use readable output or `--json` for pipelines and scripts.
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
endpoint
|
|
32
|
+
The client is **generated from the backend OpenAPI 3.1 contract**, so every
|
|
33
|
+
endpoint exposed by the API exists as a command and never drifts out of sync.
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Installation
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
# global (
|
|
38
|
+
# global install (recommended)
|
|
39
39
|
npm install -g @freeticket/cli
|
|
40
40
|
|
|
41
|
-
#
|
|
41
|
+
# or run without installing
|
|
42
42
|
npx @freeticket/cli whoami
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Check that it was installed:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
48
|
ft --version
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
##
|
|
51
|
+
## Quickstart
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
# 1.
|
|
55
|
-
# pnpm api:key
|
|
56
|
-
#
|
|
54
|
+
# 1. Issue an API key in the backend (server side):
|
|
55
|
+
# pnpm api:key you@example.com
|
|
56
|
+
# -> returns an ft_live_xxxxx key (shown only once)
|
|
57
57
|
|
|
58
|
-
# 2.
|
|
58
|
+
# 2. Log in (stores the key in ~/.freeticket/config.json and verifies it)
|
|
59
59
|
ft login --key ft_live_xxxxx
|
|
60
60
|
|
|
61
|
-
# 3.
|
|
61
|
+
# 3. Who am I, and which workspaces can I access?
|
|
62
62
|
ft whoami
|
|
63
63
|
|
|
64
|
-
# 4.
|
|
64
|
+
# 4. Start exploring
|
|
65
65
|
ft events list
|
|
66
66
|
ft reports summary --period 30d
|
|
67
67
|
ft sales list --status CONFIRMED --json
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
##
|
|
70
|
+
## Commands
|
|
71
71
|
|
|
72
|
-
|
|
|
72
|
+
| Command | What it does | Minimum role |
|
|
73
73
|
|---|---|---|
|
|
74
|
-
| `ft login --key <key>` |
|
|
75
|
-
| `ft whoami` |
|
|
76
|
-
| `ft config` · `ft logout` |
|
|
77
|
-
| `ft events list` · `get <id>` |
|
|
78
|
-
| `ft ticket-types list` · `get <id>` |
|
|
79
|
-
| `ft sales list` · `get <id>` |
|
|
80
|
-
| `ft plans list` · `get <id>` |
|
|
74
|
+
| `ft login --key <key>` | Stores and verifies your API key | VIEWER |
|
|
75
|
+
| `ft whoami` | Active user and accessible workspaces | VIEWER |
|
|
76
|
+
| `ft config` · `ft logout` | Show config (masked key) · remove key | — |
|
|
77
|
+
| `ft events list` · `get <id>` | Workspace events | VIEWER |
|
|
78
|
+
| `ft ticket-types list` · `get <id>` | Ticket types (`--event-date-id`) | VIEWER |
|
|
79
|
+
| `ft sales list` · `get <id>` | Sales (`--status`) | STAFF |
|
|
80
|
+
| `ft plans list` · `get <id>` | Membership plans | VIEWER |
|
|
81
81
|
| `ft venues list` · `get <id>` | Venues | VIEWER |
|
|
82
|
-
| `ft staff list` |
|
|
82
|
+
| `ft staff list` | Workspace staff | ADMIN |
|
|
83
83
|
| `ft reports summary` | KPIs (`--period 7d\|30d\|90d\|1y`) | VIEWER |
|
|
84
|
-
| `ft reports export buyers\|subscribers` |
|
|
84
|
+
| `ft reports export buyers\|subscribers` | Export buyers / subscribers | ADMIN |
|
|
85
85
|
|
|
86
|
-
>
|
|
87
|
-
>
|
|
86
|
+
> **Write operations** (create/update/delete) are declared in the contract but
|
|
87
|
+
> currently return `501`. They are planned for **phase 2**.
|
|
88
88
|
|
|
89
|
-
###
|
|
89
|
+
### Common flags
|
|
90
90
|
|
|
91
|
-
| Flag |
|
|
91
|
+
| Flag | Applies to | Description |
|
|
92
92
|
|---|---|---|
|
|
93
|
-
| `--json` |
|
|
94
|
-
| `--workspace <id>` |
|
|
95
|
-
| `--limit <n>` `--cursor <id>` |
|
|
93
|
+
| `--json` | all commands | Raw JSON output, ideal for `jq` and scripts |
|
|
94
|
+
| `--workspace <id>` | all commands | Run the command against another workspace |
|
|
95
|
+
| `--limit <n>` `--cursor <id>` | list commands | Cursor pagination (1-100, default 20) |
|
|
96
96
|
|
|
97
|
-
##
|
|
97
|
+
## Configuration
|
|
98
98
|
|
|
99
|
-
`ft`
|
|
99
|
+
`ft` resolves configuration in this precedence order:
|
|
100
100
|
|
|
101
101
|
```
|
|
102
|
-
flags > variables
|
|
102
|
+
flags > environment variables > ~/.freeticket/config.json > defaults
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
| Variable | Default |
|
|
105
|
+
| Variable | Default | Description |
|
|
106
106
|
|---|---|---|
|
|
107
|
-
| `FT_API_URL` | `https://admin.appfreeticket.com` | base
|
|
108
|
-
| `FT_API_KEY` | — |
|
|
109
|
-
| `FT_WORKSPACE_ID` | *home* |
|
|
107
|
+
| `FT_API_URL` | `https://admin.appfreeticket.com` | API base URL (without `/api/v1`) |
|
|
108
|
+
| `FT_API_KEY` | — | Your `ft_live_...` key |
|
|
109
|
+
| `FT_WORKSPACE_ID` | *home* | Default active workspace |
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
The `~/.freeticket/config.json` file is created with `0600` permissions (only
|
|
112
|
+
your user can read it) because it stores the API key. See [`.env.example`](./.env.example).
|
|
113
113
|
|
|
114
|
-
##
|
|
114
|
+
## Pagination, errors, and money
|
|
115
115
|
|
|
116
|
-
- **
|
|
117
|
-
|
|
118
|
-
- **
|
|
119
|
-
|
|
120
|
-
- **
|
|
121
|
-
- **
|
|
116
|
+
- **Pagination:** list responses include `page.nextCursor`. The CLI prints the
|
|
117
|
+
`--cursor <id>` hint to *stderr* so `--json` stays clean on *stdout*.
|
|
118
|
+
- **Errors:** uniform format `{ error: { code, message, details } }`. The CLI
|
|
119
|
+
translates `401/403/404/501` into actionable messages and exits with code `1`.
|
|
120
|
+
- **Money:** number in the resource currency (`currency`, usually `COP`).
|
|
121
|
+
- **Dates:** ISO 8601 UTC.
|
|
122
122
|
|
|
123
|
-
##
|
|
123
|
+
## Development
|
|
124
124
|
|
|
125
125
|
```bash
|
|
126
126
|
pnpm install
|
|
127
|
-
pnpm generate #
|
|
128
|
-
pnpm build #
|
|
127
|
+
pnpm generate # generates src/client/ from openapi.json
|
|
128
|
+
pnpm build # bundles dist/ with tsup
|
|
129
129
|
pnpm test # vitest
|
|
130
130
|
pnpm lint # biome
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
###
|
|
133
|
+
### Keeping the client in sync with the backend
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
The contract is committed in [`openapi.json`](./openapi.json). When the backend
|
|
136
|
+
API changes:
|
|
137
137
|
|
|
138
138
|
```bash
|
|
139
139
|
FT_OPENAPI_URL=https://admin.appfreeticket.com/api/v1/openapi.json pnpm sync-openapi
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
This downloads the spec, rewrites `openapi.json` (the diff becomes the explicit
|
|
143
|
+
contract between teams), and regenerates `src/client/`. If an `operationId`
|
|
144
|
+
disappears, TypeScript fails during compilation so the breaking change is visible
|
|
145
|
+
before merge.
|
|
146
146
|
|
|
147
|
-
> `src/client/`
|
|
148
|
-
> build
|
|
147
|
+
> `src/client/` is **generated** and listed in `.gitignore`: it is rebuilt on
|
|
148
|
+
> every build and in CI. Do not edit it by hand.
|
|
149
149
|
|
|
150
|
-
##
|
|
150
|
+
## Structure
|
|
151
151
|
|
|
152
152
|
```
|
|
153
153
|
freeticket-cli/
|
|
154
|
-
├── openapi.json #
|
|
154
|
+
├── openapi.json # contract — versioned source of truth
|
|
155
155
|
├── src/
|
|
156
|
-
│ ├── client/ #
|
|
156
|
+
│ ├── client/ # generated by @hey-api (gitignored)
|
|
157
157
|
│ ├── commands/ # auth, resource (factory), reports
|
|
158
158
|
│ ├── lib/ # config, api, output, banner
|
|
159
|
-
│ └── index.ts #
|
|
159
|
+
│ └── index.ts # registers commands (commander)
|
|
160
160
|
├── scripts/sync-openapi.ts
|
|
161
|
-
└── .claude/agents/ #
|
|
161
|
+
└── .claude/agents/ # review and integration subagents
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
-
##
|
|
164
|
+
## Agents
|
|
165
165
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
The repo includes Claude Code subagents in [`.claude/agents/`](./.claude/agents)
|
|
167
|
+
for continuous review and integration: TypeScript/CLI reviewer, OpenAPI sync,
|
|
168
|
+
CLI QA, and release/devops. See the [agents README](./.claude/agents/README.md).
|
|
169
169
|
|
|
170
|
-
##
|
|
170
|
+
## Requirements
|
|
171
171
|
|
|
172
|
-
- Node.js
|
|
173
|
-
-
|
|
172
|
+
- Node.js **>= 20**
|
|
173
|
+
- A FreeTicket API key (`ft_live_...`)
|
|
174
174
|
|
|
175
|
-
##
|
|
175
|
+
## License
|
|
176
176
|
|
|
177
177
|
[MIT](./LICENSE) © FreeTicket
|
package/dist/index.js
CHANGED
|
@@ -6,9 +6,9 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@freeticket/cli",
|
|
9
|
-
version: "0.1.
|
|
10
|
-
description: "
|
|
11
|
-
keywords: ["freeticket", "cli", "ticketing", "
|
|
9
|
+
version: "0.1.1",
|
|
10
|
+
description: "Official FreeTicket CLI \u2014 consumes the B2B REST API for events, sales, tickets, memberships, venues, staff, and reports.",
|
|
11
|
+
keywords: ["freeticket", "cli", "ticketing", "events", "api"],
|
|
12
12
|
homepage: "https://github.com/AppFreeticket/freeticket-cli#readme",
|
|
13
13
|
bugs: "https://github.com/AppFreeticket/freeticket-cli/issues",
|
|
14
14
|
repository: {
|
|
@@ -285,9 +285,7 @@ function saveConfig(patch) {
|
|
|
285
285
|
function configureClient(workspaceOverride) {
|
|
286
286
|
const cfg = loadConfig();
|
|
287
287
|
if (!cfg.apiKey) {
|
|
288
|
-
fail(
|
|
289
|
-
"No hay API key configurada. Ejecuta `ft login` o exporta FT_API_KEY."
|
|
290
|
-
);
|
|
288
|
+
fail("No API key configured. Run `ft login` or export FT_API_KEY.");
|
|
291
289
|
}
|
|
292
290
|
const workspaceId = workspaceOverride ?? cfg.workspaceId;
|
|
293
291
|
client.setConfig({
|
|
@@ -304,24 +302,26 @@ function unwrap(res) {
|
|
|
304
302
|
const err = res.error?.error;
|
|
305
303
|
if (err) {
|
|
306
304
|
const lines = [
|
|
307
|
-
`Error ${status ?? ""} [${err.code ?? "?"}]: ${err.message ?? "
|
|
305
|
+
`Error ${status ?? ""} [${err.code ?? "?"}]: ${err.message ?? "unknown failure"}`.trim()
|
|
308
306
|
];
|
|
309
307
|
for (const d of err.details ?? [])
|
|
310
308
|
lines.push(` \xB7 ${d.path ?? ""}: ${d.message ?? ""}`.trimEnd());
|
|
311
309
|
fail(lines.join("\n"), hintFor(status));
|
|
312
310
|
}
|
|
313
|
-
fail(
|
|
311
|
+
fail(
|
|
312
|
+
`The API responded with ${status ?? "an error"} without a readable body.`
|
|
313
|
+
);
|
|
314
314
|
}
|
|
315
315
|
function hintFor(status) {
|
|
316
316
|
switch (status) {
|
|
317
317
|
case 401:
|
|
318
|
-
return "
|
|
318
|
+
return "Invalid, revoked, or expired API key. Run `ft login`.";
|
|
319
319
|
case 403:
|
|
320
|
-
return "
|
|
320
|
+
return "Your role or workspace does not allow this action.";
|
|
321
321
|
case 404:
|
|
322
|
-
return "
|
|
322
|
+
return "The resource does not exist or belongs to another workspace.";
|
|
323
323
|
case 501:
|
|
324
|
-
return "
|
|
324
|
+
return "Write operation: planned for CLI phase 2.";
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
function fail(message, hint) {
|
|
@@ -342,7 +342,7 @@ function print(data, opts = {}) {
|
|
|
342
342
|
}
|
|
343
343
|
if (Array.isArray(data) && data.every(isPlainRow)) {
|
|
344
344
|
if (data.length === 0) {
|
|
345
|
-
console.log(chalk.dim("(
|
|
345
|
+
console.log(chalk.dim("(no results)"));
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
348
|
const cols = opts.columns ?? Object.keys(data[0]);
|
|
@@ -359,7 +359,7 @@ function print(data, opts = {}) {
|
|
|
359
359
|
function printNextCursor(page) {
|
|
360
360
|
if (page?.nextCursor) {
|
|
361
361
|
console.error(chalk.dim(`
|
|
362
|
-
|
|
362
|
+
More results: --cursor ${page.nextCursor}`));
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
function isPlainRow(v) {
|
|
@@ -373,15 +373,13 @@ function fmt(v) {
|
|
|
373
373
|
|
|
374
374
|
// src/commands/auth.ts
|
|
375
375
|
function registerAuth(program2) {
|
|
376
|
-
program2.command("login").description(
|
|
377
|
-
"Guarda la API key y el workspace en ~/.freeticket/config.json"
|
|
378
|
-
).requiredOption(
|
|
376
|
+
program2.command("login").description("Store the API key and workspace in ~/.freeticket/config.json").requiredOption(
|
|
379
377
|
"--key <ft_live_\u2026>",
|
|
380
|
-
"API key
|
|
378
|
+
"API key issued in the backend (pnpm api:key)"
|
|
381
379
|
).option(
|
|
382
380
|
"--url <url>",
|
|
383
|
-
"base URL
|
|
384
|
-
).option("--workspace <id>", "
|
|
381
|
+
"API base URL (default: https://admin.appfreeticket.com)"
|
|
382
|
+
).option("--workspace <id>", "default active workspace").action(async (opts) => {
|
|
385
383
|
saveConfig({
|
|
386
384
|
apiKey: opts.key,
|
|
387
385
|
...opts.url ? { apiUrl: opts.url } : {},
|
|
@@ -390,22 +388,22 @@ function registerAuth(program2) {
|
|
|
390
388
|
configureClient(opts.workspace);
|
|
391
389
|
const me = unwrap(await getMe({})).data;
|
|
392
390
|
console.log(
|
|
393
|
-
`${chalk2.green("\u2713")}
|
|
391
|
+
`${chalk2.green("\u2713")} Session saved in ${chalk2.dim(CONFIG_PATH)}`
|
|
394
392
|
);
|
|
395
393
|
print(me, {});
|
|
396
394
|
});
|
|
397
|
-
program2.command("whoami").description("
|
|
395
|
+
program2.command("whoami").description("Show the authenticated user and workspaces (GET /me)").option("--json", "raw JSON output").action(async (opts) => {
|
|
398
396
|
configureClient();
|
|
399
397
|
const me = unwrap(await getMe({})).data;
|
|
400
398
|
print(me, { json: opts.json });
|
|
401
399
|
});
|
|
402
|
-
program2.command("logout").description("
|
|
400
|
+
program2.command("logout").description("Remove the stored API key").action(() => {
|
|
403
401
|
saveConfig({ apiKey: void 0 });
|
|
404
402
|
console.log(
|
|
405
|
-
`${chalk2.green("\u2713")} API key
|
|
403
|
+
`${chalk2.green("\u2713")} API key removed from ${chalk2.dim(CONFIG_PATH)}`
|
|
406
404
|
);
|
|
407
405
|
});
|
|
408
|
-
program2.command("config").description("
|
|
406
|
+
program2.command("config").description("Show active configuration (the API key is masked)").action(() => {
|
|
409
407
|
const cfg = loadConfig();
|
|
410
408
|
print(
|
|
411
409
|
{
|
|
@@ -420,20 +418,20 @@ function registerAuth(program2) {
|
|
|
420
418
|
|
|
421
419
|
// src/commands/reports.ts
|
|
422
420
|
function registerReports(program2) {
|
|
423
|
-
const root = program2.command("reports").description("KPIs
|
|
424
|
-
root.command("summary").description("
|
|
421
|
+
const root = program2.command("reports").description("KPIs and exports");
|
|
422
|
+
root.command("summary").description("Workspace KPI summary").option("--period <p>", "7d | 30d | 90d | 1y", "30d").option("--workspace <id>", "workspace override").option("--json", "raw JSON output").action(async (opts) => {
|
|
425
423
|
configureClient(opts.workspace);
|
|
426
424
|
const body = unwrap(
|
|
427
425
|
await getReportsSummary({ query: { period: opts.period } })
|
|
428
426
|
);
|
|
429
427
|
print(body.data, { json: opts.json });
|
|
430
428
|
});
|
|
431
|
-
const exp = root.command("export").description("
|
|
429
|
+
const exp = root.command("export").description("Export buyers or subscribers (CSV)");
|
|
432
430
|
for (const [name, fn, label] of [
|
|
433
|
-
["buyers", getReportsExportsBuyers, "
|
|
434
|
-
["subscribers", getReportsExportsSubscribers, "
|
|
431
|
+
["buyers", getReportsExportsBuyers, "buyers"],
|
|
432
|
+
["subscribers", getReportsExportsSubscribers, "subscribers"]
|
|
435
433
|
]) {
|
|
436
|
-
exp.command(name).description(`
|
|
434
|
+
exp.command(name).description(`Export ${label}`).option("--workspace <id>", "workspace override").option("--json", "raw JSON output").action(async (opts) => {
|
|
437
435
|
configureClient(opts.workspace);
|
|
438
436
|
const body = unwrap(await fn({}));
|
|
439
437
|
print(body.data ?? body, { json: opts.json });
|
|
@@ -446,7 +444,7 @@ function registerResource(program2, spec) {
|
|
|
446
444
|
const root = program2.command(spec.name).description(spec.describe);
|
|
447
445
|
if (spec.list) {
|
|
448
446
|
const list = spec.list;
|
|
449
|
-
const cmd = root.command("list").description(`
|
|
447
|
+
const cmd = root.command("list").description(`List ${spec.name} from the active workspace`).option("--limit <n>", "results per page (1-100)", "20").option("--cursor <id>", "pagination cursor").option("--workspace <id>", "workspace override").option("--json", "raw JSON output");
|
|
450
448
|
for (const f of spec.listFlags ?? []) cmd.option(f.flag, f.describe);
|
|
451
449
|
cmd.action(async (opts) => {
|
|
452
450
|
configureClient(opts.workspace);
|
|
@@ -465,7 +463,7 @@ function registerResource(program2, spec) {
|
|
|
465
463
|
}
|
|
466
464
|
if (spec.get) {
|
|
467
465
|
const get = spec.get;
|
|
468
|
-
root.command("get <id>").description(`
|
|
466
|
+
root.command("get <id>").description(`Get one ${spec.name.replace(/s$/, "")} by id`).option("--workspace <id>", "workspace override").option("--json", "raw JSON output").action(async (id, opts) => {
|
|
469
467
|
configureClient(opts.workspace);
|
|
470
468
|
const body = unwrap(await get({ path: { id } }));
|
|
471
469
|
print(body.data, { json: opts.json });
|
|
@@ -489,49 +487,49 @@ var ART = String.raw`
|
|
|
489
487
|
function banner() {
|
|
490
488
|
return [
|
|
491
489
|
c.hex(YELLOW)(ART),
|
|
492
|
-
c.hex(YELLOW)(" \u25CF ") + c.hex(YELLOW).bold("FreeTicket") + c.hex(YELLOW)(" \u2014
|
|
490
|
+
c.hex(YELLOW)(" \u25CF ") + c.hex(YELLOW).bold("FreeTicket") + c.hex(YELLOW)(" \u2014 events, tickets, and sales from your terminal"),
|
|
493
491
|
""
|
|
494
492
|
].join("\n");
|
|
495
493
|
}
|
|
496
494
|
|
|
497
495
|
// src/index.ts
|
|
498
496
|
var program = new Command();
|
|
499
|
-
program.name("ft").description("
|
|
497
|
+
program.name("ft").description("Official FreeTicket CLI").version(package_default.version, "-v, --version").addHelpText("beforeAll", banner());
|
|
500
498
|
registerAuth(program);
|
|
501
499
|
registerResource(program, {
|
|
502
500
|
name: "events",
|
|
503
|
-
describe: "
|
|
501
|
+
describe: "Events",
|
|
504
502
|
list: getEvents,
|
|
505
503
|
get: getEventsId,
|
|
506
504
|
columns: ["id", "name", "status", "startsAt"]
|
|
507
505
|
});
|
|
508
506
|
registerResource(program, {
|
|
509
507
|
name: "sales",
|
|
510
|
-
describe: "
|
|
508
|
+
describe: "Sales",
|
|
511
509
|
list: getSales,
|
|
512
510
|
get: getSalesId,
|
|
513
511
|
columns: ["id", "reference", "status", "total", "currency", "createdAt"],
|
|
514
512
|
listFlags: [
|
|
515
|
-
{ flag: "--status <s>", describe: "
|
|
513
|
+
{ flag: "--status <s>", describe: "filter by status", query: "status" }
|
|
516
514
|
]
|
|
517
515
|
});
|
|
518
516
|
registerResource(program, {
|
|
519
517
|
name: "ticket-types",
|
|
520
|
-
describe: "
|
|
518
|
+
describe: "Ticket types",
|
|
521
519
|
list: getTicketTypes,
|
|
522
520
|
get: getTicketTypesId,
|
|
523
521
|
columns: ["id", "name", "price", "currency", "stock"],
|
|
524
522
|
listFlags: [
|
|
525
523
|
{
|
|
526
524
|
flag: "--event-date-id <id>",
|
|
527
|
-
describe: "
|
|
525
|
+
describe: "filter by event date",
|
|
528
526
|
query: "eventDateId"
|
|
529
527
|
}
|
|
530
528
|
]
|
|
531
529
|
});
|
|
532
530
|
registerResource(program, {
|
|
533
531
|
name: "plans",
|
|
534
|
-
describe: "
|
|
532
|
+
describe: "Membership plans",
|
|
535
533
|
list: getMembershipPlans,
|
|
536
534
|
get: getMembershipPlansId,
|
|
537
535
|
columns: ["id", "name", "price", "currency", "interval"]
|
|
@@ -545,7 +543,7 @@ registerResource(program, {
|
|
|
545
543
|
});
|
|
546
544
|
registerResource(program, {
|
|
547
545
|
name: "staff",
|
|
548
|
-
describe: "
|
|
546
|
+
describe: "Workspace staff",
|
|
549
547
|
list: getStaff,
|
|
550
548
|
columns: ["id", "name", "email", "role"]
|
|
551
549
|
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@freeticket/cli",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
5
|
-
"keywords": ["freeticket", "cli", "ticketing", "
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Official FreeTicket CLI — consumes the B2B REST API for events, sales, tickets, memberships, venues, staff, and reports.",
|
|
5
|
+
"keywords": ["freeticket", "cli", "ticketing", "events", "api"],
|
|
6
6
|
"homepage": "https://github.com/AppFreeticket/freeticket-cli#readme",
|
|
7
7
|
"bugs": "https://github.com/AppFreeticket/freeticket-cli/issues",
|
|
8
8
|
"repository": {
|