@freeticket/cli 0.9.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 +29 -12
  2. package/dist/index.js +1371 -622
  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,10 +85,11 @@ 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 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 |
82
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 |
@@ -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 the partial amount and for the `acknowledge_open_payment` / `acknowledge_manual` flags) | 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 |
@@ -118,8 +129,9 @@ ft sales list --status CONFIRMED --json
118
129
  | Flag | Applies to | Description |
119
130
  |---|---|---|
120
131
  | `--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) |
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 |
123
135
  | `--all` | list commands | Auto-paginate: fetch every page (ignores `--cursor`) |
124
136
  | `--raw` | list commands | JSON `{ data, page }` envelope, including `page.nextCursor` for scripted pagination |
125
137
  | `--columns <a,b,c>` `--full` | list commands | Pick specific columns · show every field |
@@ -137,10 +149,15 @@ flags > environment variables > ~/.freeticket/config.json > defaults
137
149
  | Variable | Default | Description |
138
150
  |---|---|---|
139
151
  | `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 |
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 |
141
153
  | `FT_WORKSPACE_ID` | *home* | Default active workspace |
142
154
  | `FT_NO_UPDATE_CHECK` | — | Set to disable the "update available" notice |
143
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
+
144
161
  The `~/.freeticket/config.json` file is created with `0600` permissions (only
145
162
  your user can read it) because it stores your credentials. See [`.env.example`](./.env.example).
146
163