@freeticket/cli 0.8.0 → 0.10.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.
Files changed (3) hide show
  1. package/README.md +36 -15
  2. package/dist/index.js +1921 -688
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -29,8 +29,9 @@ Events, sales, tickets, memberships, venues, staff, and reports — one command
29
29
  opening the dashboard: list events, review sales, export buyers, check KPIs,
30
30
  and use readable output or `--json` for pipelines and scripts.
31
31
 
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.
32
+ The client is **generated from the backend OpenAPI 3.1 contract**, so the
33
+ commands never drift from the API they call: types, parameters and enums all
34
+ come from the spec, and a contract change is picked up by regenerating.
34
35
 
35
36
  ## Installation
36
37
 
@@ -58,10 +59,19 @@ ft login
58
59
  # CI / automation: skip the browser with a backend-issued key instead.
59
60
  # ft login --key ft_live_xxxxx
60
61
 
61
- # 2. Who am I, and which workspaces can I access?
62
+ # More than one FreeTicket login? Each `ft login` ADDS an account (named after
63
+ # its email, or `--account <name>`); the others stay.
64
+ # ft login --account agency
65
+
66
+ # 2. Who am I, and which workspaces can I access? (one row per account)
62
67
  ft whoami
63
68
 
64
- # 3. Pick the workspace you want to operate on (persisted locally).
69
+ # 3. Optional: narrow it down (persisted locally). Without this, the lists and
70
+ # the row-shaped reports read EVERY account and EVERY workspace each one
71
+ # reaches, tagging each row with `workspaceName` (and `account` when there
72
+ # are several). `ft workspace clear` / `ft account clear` unpin.
73
+ ft account list
74
+ ft account use agency
65
75
  ft workspace list
66
76
  ft workspace use my-workspace-slug
67
77
 
@@ -75,11 +85,12 @@ ft sales list --status CONFIRMED --json
75
85
 
76
86
  | Command | What it does | Minimum role |
77
87
  |---|---|---|
78
- | `ft login` | Browser login (device flow); `--key <key>` for CI | VIEWER |
79
- | `ft whoami` | Active user and accessible workspaces | VIEWER |
80
- | `ft config` · `ft logout` | Show config (masked key) · remove key | — |
81
- | `ft workspace list` · `use <id\|slug>` · `show` | List, switch, and show the active workspace | VIEWER |
82
- | `ft events list` · `get <id>` | Workspace events | VIEWER |
88
+ | `ft login` | Add an account: browser login (device flow), `--key <key>` for CI, `--account <name>` to name it (default: its email) | VIEWER |
89
+ | `ft whoami` | User and accessible workspaces of every account in scope | VIEWER |
90
+ | `ft account list` · `use <name>` · `clear` · `remove <name>` | Stored accounts: list, pin one, unpin (read all), remove | — |
91
+ | `ft config` · `ft logout` | Show config (masked keys) · remove the pinned/only account (`--account <name>`, `--all`) | — |
92
+ | `ft workspace list` · `use <id\|slug>` · `clear` · `show` | List workspaces of every account, pin one (and its account), unpin, show the current one | VIEWER |
93
+ | `ft events list` · `get <id>` | Workspace events (`--q` `--status` `--with-total`) | VIEWER |
83
94
  | `ft events create` · `update <id>` · `delete <id>` | Manage events (`--data <json>`) | ADMIN |
84
95
  | `ft events publish <id>` | Publish an event | ADMIN |
85
96
  | `ft event-dates list` · `create` · `update` · `delete` | Event dates | ADMIN |
@@ -87,7 +98,7 @@ ft sales list --status CONFIRMED --json
87
98
  | `ft ticket-types create` · `update <id>` · `delete <id>` | Manage ticket types (`--data <json>`) | ADMIN |
88
99
  | `ft sales list` · `get <id>` | Sales (filters: `--status` `--channel` `--event` `--event-date` `--reference` `--buyer` `--from` `--to`) | STAFF |
89
100
  | `ft sales create` | Create a sale/order — comps & programmatic sales (`--data <json>`) | ADMIN |
90
- | `ft sales cancel <id>` · `refund <id>` | Cancel / refund a sale (`--data` for partial refund) | ADMIN |
101
+ | `ft sales cancel <id>` · `refund <id>` | Cancel / refund a sale (`--data` for the `acknowledge_open_payment` / `acknowledge_manual` flags) | ADMIN |
91
102
  | `ft sales tickets <id>` | List the individual tickets/attendees of a sale | STAFF |
92
103
  | `ft tickets access <code>` | Read a ticket's access status (no admit) | STAFF |
93
104
  | `ft tickets checkin <code>` | Admit a ticket at the door (idempotent) | STAFF |
@@ -100,10 +111,14 @@ ft sales list --status CONFIRMED --json
100
111
  | `ft webhooks list` · `create` · `delete <id>` | Webhook endpoints, HMAC-signed delivery (`--data <json>`) | ADMIN |
101
112
  | `ft venues list` · `get <id>` | Venues | VIEWER |
102
113
  | `ft venues create` · `update <id>` · `delete <id>` | Manage venues (`--data <json>`) | ADMIN |
103
- | `ft staff list` · `create` · `set-role <id>` | Workspace staff (`--data <json>`) | ADMIN |
114
+ | `ft staff list` · `create` · `set-role <id>` | Workspace staff (`--workspace-ids <ids>` lists up to 25 workspaces in one call; `--data <json>`) | ADMIN |
104
115
  | `ft reports summary` | KPIs (`--period 7d\|30d\|90d\|1y`) | VIEWER |
105
116
  | `ft reports by-event` · `timeseries` · `inventory` | Revenue/tickets by event, over time, and capacity/availability | VIEWER |
106
- | `ft reports export buyers\|attendees\|subscribers` | Export buyers / attendees / subscribers (CSV; filters `--event` `--event-date` `--from` `--to` `--status`) | ADMIN |
117
+ | `ft reports export buyers\|attendees\|subscribers\|reconciliation` | Exports as CSV (filters `--event` `--event-date` `--from` `--to` `--status`) | ADMIN |
118
+ | `ft reports reconciliation` · `financials` | CFO reconciliation (Mercado Pago vs sale vs Siigo invoice) · per-function P&L | ADMIN |
119
+ | `ft settlements list` · `document <id>` | Settlements paid to the organizer · signed download URL for the PDF, 5 min TTL (`--proof <fileName>` for a payment proof) | ADMIN |
120
+ | `ft api-keys create <name>` · `list` · `revoke <id>` | Self-service API keys (the secret is shown once, never stored) | ADMIN |
121
+ | `ft admin login` · `me` · `workspaces` · `users` · `plans` · `feature-flags` · `tokens` · `audit-log` | Superadmin, cross-tenant — needs a SUPER_ADMIN session, not an API key. Includes `admin workspaces plan <id>` (assisted plan assignment) and `webTemplate` / `customDomain` on `update` | SUPER_ADMIN |
107
122
 
108
123
  > **Write operations** (`create`/`update`/`delete` and actions like `publish`,
109
124
  > `cancel`, `refund`) send a JSON body via `--data <inline-json>` or
@@ -114,8 +129,9 @@ ft sales list --status CONFIRMED --json
114
129
  | Flag | Applies to | Description |
115
130
  |---|---|---|
116
131
  | `--json` | all commands | Raw JSON, ideal for `jq`/scripts. On **lists this is the data array only** — use `--raw` for the paginated envelope |
117
- | `--workspace <id>` | all commands | Run the command against another workspace |
118
- | `--limit <n>` `--cursor <id>` | list commands | Cursor pagination (1-100, default 20) |
132
+ | `--workspace <id>` | all commands | Read only this workspace. Lists and row-shaped reports otherwise cover **every workspace you can access**, tagging rows with `workspaceId`/`workspaceName` |
133
+ | `--account <name>` | all commands | Use only this stored account. Lists otherwise read **every account** (rows get an `account` column); commands that are not lists need exactly one account, so with several stored they fail until you pass `--account` or `ft account use <name>` |
134
+ | `--limit <n>` `--cursor <id>` | list commands | Cursor pagination (1-100, default 20). Across workspaces the limit is split between them; `--cursor` needs a single workspace, since a cursor from one means nothing in another |
119
135
  | `--all` | list commands | Auto-paginate: fetch every page (ignores `--cursor`) |
120
136
  | `--raw` | list commands | JSON `{ data, page }` envelope, including `page.nextCursor` for scripted pagination |
121
137
  | `--columns <a,b,c>` `--full` | list commands | Pick specific columns · show every field |
@@ -133,10 +149,15 @@ flags > environment variables > ~/.freeticket/config.json > defaults
133
149
  | Variable | Default | Description |
134
150
  |---|---|---|
135
151
  | `FT_API_URL` | `https://admin.appfreeticket.com` | API base URL (without `/api/v1`) |
136
- | `FT_API_KEY` | — | CI/headless only — a backend-issued `ft_live_...` token. Browser login (`ft login`) needs no key |
152
+ | `FT_API_KEY` | — | CI/headless only — a backend-issued `ft_live_...` token. Browser login (`ft login`) needs no key. When set it is the **only** account: stored logins are ignored, nothing fans out across them, and `--account` is rejected. A workspace pinned with `ft workspace use` still applies |
137
153
  | `FT_WORKSPACE_ID` | *home* | Default active workspace |
138
154
  | `FT_NO_UPDATE_CHECK` | — | Set to disable the "update available" notice |
139
155
 
156
+ Logins are stored per account under `accounts` in `~/.freeticket/config.json`
157
+ (`activeAccount` is the one pinned with `ft account use`). A file written by an
158
+ older CLI, with a single top-level `apiKey`, is read as the account `default`
159
+ and rewritten in the new layout on the next save.
160
+
140
161
  The `~/.freeticket/config.json` file is created with `0600` permissions (only
141
162
  your user can read it) because it stores your credentials. See [`.env.example`](./.env.example).
142
163