@freeticket/cli 0.9.0 → 0.11.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 +40 -19
  2. package/dist/index.js +1602 -537
  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,39 +85,44 @@ 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 |
88
+ | `ft signup --email <e> --name <n>` | Create an account (`--workspace-name` also creates the first workspace); verify via email, then `ft login` | — |
89
+ | `ft login` | Add an account: browser login (device flow), `--key <key>` for CI, `--account <name>` to name it (default: its email) | VIEWER |
90
+ | `ft whoami` | User and accessible workspaces of every account in scope | VIEWER |
91
+ | `ft account list` · `use <name>` · `clear` · `remove <name>` | Stored accounts: list, pin one, unpin (read all), remove | — |
92
+ | `ft config` · `ft logout` | Show config (masked keys) · remove the pinned/only account (`--account <name>`, `--all`) | — |
93
+ | `ft workspace list` · `use <id\|slug>` · `clear` · `show` | List workspaces of every account, pin one (and its account), unpin, show the current one | VIEWER |
94
+ | `ft workspace create --name <n> --slug <s>` | Create your own workspace; you become its ADMIN (plan quota applies) | — |
82
95
  | `ft events list` · `get <id>` | Workspace events (`--q` `--status` `--with-total`) | VIEWER |
83
96
  | `ft events create` · `update <id>` · `delete <id>` | Manage events (`--data <json>`) | ADMIN |
84
- | `ft events publish <id>` | Publish an event | ADMIN |
97
+ | `ft events publish <id>` · `cancel <id>` | Publish an event · cancel it and all its dates, keeping sales and tickets (no refunds; `--yes` skips the prompt) | ADMIN |
85
98
  | `ft event-dates list` · `create` · `update` · `delete` | Event dates | ADMIN |
86
99
  | `ft ticket-types list` · `get <id>` | Ticket types (`--event-date-id`) | VIEWER |
87
100
  | `ft ticket-types create` · `update <id>` · `delete <id>` | Manage ticket types (`--data <json>`) | ADMIN |
88
101
  | `ft sales list` · `get <id>` | Sales (filters: `--status` `--channel` `--event` `--event-date` `--reference` `--buyer` `--from` `--to`) | STAFF |
89
102
  | `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 the partial amount and for the `acknowledge_open_payment` / `acknowledge_manual` flags) | ADMIN |
91
- | `ft sales tickets <id>` | List the individual tickets/attendees of a sale | STAFF |
103
+ | `ft sales cancel <id>` · `refund <id>` | Cancel / refund a sale (`--data` for the `acknowledge_open_payment` / `acknowledge_manual` flags) | ADMIN |
104
+ | `ft sales tickets <id>` · `attempts <id>` | Tickets/attendees of a sale · its payment attempt history (why it did not go through) | STAFF |
92
105
  | `ft tickets access <code>` | Read a ticket's access status (no admit) | STAFF |
93
106
  | `ft tickets checkin <code>` | Admit a ticket at the door (idempotent) | STAFF |
94
107
  | `ft tickets resend <code>` | Resend the ticket's confirmation email (QR) | ADMIN |
108
+ | `ft tickets reassign <code>` | Move a sold ticket to another date and/or type (`--data '{"eventDateId":"…"}'`; no price difference charged/refunded) | ADMIN |
95
109
  | `ft plans list` · `get <id>` | Membership plans | VIEWER |
96
110
  | `ft plans create` · `update <id>` · `delete <id>` | Manage membership plans (`--data <json>`) | ADMIN |
97
111
  | `ft plans subscribers <id>` | List a plan's subscribers/members | VIEWER |
98
112
  | `ft subscriptions cancel <id>` | Cancel a subscription | ADMIN |
99
113
  | `ft discounts list` · `create` · `update <id>` · `delete <id>` | Discount codes / coupons (`--event` `--active`; `--data <json>`) | ADMIN |
100
- | `ft webhooks list` · `create` · `delete <id>` | Webhook endpoints, HMAC-signed delivery (`--data <json>`) | ADMIN |
114
+ | `ft webhooks list` · `create` · `update <id>` · `delete <id>` | Webhook endpoints, HMAC-signed delivery (`--data <json>`) | ADMIN |
101
115
  | `ft venues list` · `get <id>` | Venues | VIEWER |
102
116
  | `ft venues create` · `update <id>` · `delete <id>` | Manage venues (`--data <json>`) | ADMIN |
103
- | `ft staff list` · `create` · `set-role <id>` | Workspace staff (`--workspace-ids <ids>` lists up to 25 workspaces in one call; `--data <json>`) | ADMIN |
117
+ | `ft staff list` · `get <id>` · `create` · `set-role <id>` · `delete <id>` | Workspace staff (`--workspace-ids <ids>` lists up to 25 workspaces in one call; `--data <json>`) | ADMIN |
104
118
  | `ft reports summary` | KPIs (`--period 7d\|30d\|90d\|1y`) | VIEWER |
105
119
  | `ft reports by-event` · `timeseries` · `inventory` | Revenue/tickets by event, over time, and capacity/availability | VIEWER |
106
120
  | `ft reports export buyers\|attendees\|subscribers\|reconciliation` | Exports as CSV (filters `--event` `--event-date` `--from` `--to` `--status`) | ADMIN |
107
121
  | `ft reports reconciliation` · `financials` | CFO reconciliation (Mercado Pago vs sale vs Siigo invoice) · per-function P&L | ADMIN |
108
- | `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 |
122
+ | `ft settlements list` · `get <id>` · `document <id>` | Settlements paid to the organizer · signed download URL for the PDF, 5 min TTL (`--proof <fileName>` for a payment proof) | ADMIN |
123
+ | `ft content-videos list` · `content-posts list\|create` · `content-lives list\|get\|playback-token` | Organization content; `content-posts create --data` publishes a post or article | ADMIN |
109
124
  | `ft api-keys create <name>` · `list` · `revoke <id>` | Self-service API keys (the secret is shown once, never stored) | ADMIN |
110
- | `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 |
125
+ | `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), `plan-show <id>` (current plan) and `delete <id>` (soft delete; suspend first) and `webTemplate` / `customDomain` on `update` | SUPER_ADMIN |
111
126
 
112
127
  > **Write operations** (`create`/`update`/`delete` and actions like `publish`,
113
128
  > `cancel`, `refund`) send a JSON body via `--data <inline-json>` or
@@ -118,8 +133,9 @@ ft sales list --status CONFIRMED --json
118
133
  | Flag | Applies to | Description |
119
134
  |---|---|---|
120
135
  | `--json` | all commands | Raw JSON, ideal for `jq`/scripts. On **lists this is the data array only** — use `--raw` for the paginated envelope |
121
- | `--workspace <id>` | all commands | Run the command against another workspace |
122
- | `--limit <n>` `--cursor <id>` | list commands | Cursor pagination (1-100, default 20) |
136
+ | `--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` |
137
+ | `--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>` |
138
+ | `--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 |
123
139
  | `--all` | list commands | Auto-paginate: fetch every page (ignores `--cursor`) |
124
140
  | `--raw` | list commands | JSON `{ data, page }` envelope, including `page.nextCursor` for scripted pagination |
125
141
  | `--columns <a,b,c>` `--full` | list commands | Pick specific columns · show every field |
@@ -137,9 +153,14 @@ flags > environment variables > ~/.freeticket/config.json > defaults
137
153
  | Variable | Default | Description |
138
154
  |---|---|---|
139
155
  | `FT_API_URL` | `https://admin.appfreeticket.com` | API base URL (without `/api/v1`) |
140
- | `FT_API_KEY` | — | CI/headless only — a backend-issued `ft_live_...` token. Browser login (`ft login`) needs no key |
156
+ | `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 |
141
157
  | `FT_WORKSPACE_ID` | *home* | Default active workspace |
142
- | `FT_NO_UPDATE_CHECK` | — | Set to disable the "update available" notice |
158
+ | `FT_NO_UPDATE_CHECK` | — | Set to disable the "update available" notice (checked at most once a day; also off in CI, without a TTY, and with `--json`/`--raw`/`--csv`) |
159
+
160
+ Logins are stored per account under `accounts` in `~/.freeticket/config.json`
161
+ (`activeAccount` is the one pinned with `ft account use`). A file written by an
162
+ older CLI, with a single top-level `apiKey`, is read as the account `default`
163
+ and rewritten in the new layout on the next save.
143
164
 
144
165
  The `~/.freeticket/config.json` file is created with `0600` permissions (only
145
166
  your user can read it) because it stores your credentials. See [`.env.example`](./.env.example).