@sendhoney/cli 0.1.12 → 0.1.13

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 +13 -11
  2. package/bin/sendhoney +2 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -11,7 +11,9 @@ SendHoney platform CLI for authenticated API, CRUD, release, and ThunderCompute
11
11
  npm install -g @sendhoney/cli
12
12
 
13
13
  # npm (pinned)
14
- npm install -g @sendhoney/cli@0.1.12
14
+ npm install -g @sendhoney/cli@0.1.13
15
+
16
+ sendhoney --version # should print 0.1.13
15
17
 
16
18
  # Homebrew
17
19
  brew tap sendhoney/tap && brew install sendhoney
@@ -110,7 +112,7 @@ sendhoney widget install --org-id ORG_ID --widget-type both --file ./dist/index.
110
112
 
111
113
  ## Authentication
112
114
 
113
- `sendhoney login` uses Keycloak Authorization Code + PKCE and refreshes expired access tokens automatically. Use `SENDHONEY_TOKEN` for CI / service accounts.
115
+ `sendhoney login` uses Keycloak Authorization Code + PKCE and refreshes expired access tokens automatically. On success it prints the authenticated user, resolved `orgId`, and organization data. Use `SENDHONEY_TOKEN` for CI / service accounts.
114
116
 
115
117
  Credentials are stored in `$XDG_CONFIG_HOME/sendhoney/config.json` (or `~/.config/sendhoney/config.json`) with mode `0600`; tokens are never printed by the CLI. After browser login, the CLI exchanges the PKCE code, hydrates the Keycloak user profile and current organization, and stores the resolved `orgId` in the local session. `sendhoney widget install` can therefore use the saved organization without a second ID lookup.
116
118
 
@@ -131,7 +133,7 @@ The expert interface is the Go program in `apps/sendhoney-tui`. It shares this c
131
133
  ## Publishing
132
134
 
133
135
  Maintained in the `sendhoney-api-monorepo-oatpp-v2` repo under `apps/sendhoney-cli`.
134
- Publish to npmjs using the `staging` dist-tag so `latest` remains unchanged:
136
+ Publish through npm staged packages. Staging does not use a `staging` dist-tag:
135
137
 
136
138
  1. Stage the package (uploaded to npm staging, not yet public):
137
139
  ```bash
@@ -139,19 +141,19 @@ Publish to npmjs using the `staging` dist-tag so `latest` remains unchanged:
139
141
  cd apps/sendhoney-cli
140
142
  ./scripts/publish-sendhoney-cli.sh
141
143
  ```
142
- 2. Verify the staged version:
143
- ```bash
144
- npm view @sendhoney/cli dist-tags versions
145
- ```
146
- 3. Promote the verified version:
144
+ 2. Review and approve the stage at:
145
+ https://www.npmjs.com/settings/sendhoney/staged-packages
146
+
147
+ 3. After approval, install the released version:
147
148
  ```bash
148
- npm dist-tag add @sendhoney/cli@VERSION latest
149
+ npm install -g @sendhoney/cli@VERSION
150
+ npm view @sendhoney/cli version
149
151
  ```
150
152
 
151
- Alternatively, run the publish script which stages and prints the promotion link:
153
+ The repository script stages the package, verifies the returned stage ID, and prints the review link:
152
154
 
153
155
  ```bash
154
156
  ./scripts/publish-sendhoney-cli.sh
155
157
  ```
156
158
 
157
- npm disallows republishing an already-published version, so always bump `version` in `package.json` before staging.
159
+ npm disallows republishing an already-published version, so always bump `version` in `package.json` before staging. Do not run `npm publish` or `npm dist-tag add` for staged releases.
package/bin/sendhoney CHANGED
@@ -89,7 +89,7 @@ async function browserLogin(args, config) {
89
89
  openBrowser(loginUrl)
90
90
  stdout.write(`Opening Keycloak login in your browser (${callback})\n`)
91
91
  })
92
- return json({ ok: true, authenticated: true, orgId: result.session.orgId || undefined, apiUrl: result.session.apiUrl })
92
+ return json({ ok: true, authenticated: true, user: result.session.user, organization: result.session.organization, orgId: result.session.orgId || undefined, apiUrl: result.session.apiUrl })
93
93
  }
94
94
 
95
95
  async function refreshToken(config) {
@@ -414,7 +414,7 @@ async function login(args) {
414
414
  const body = await response.json().catch(() => ({}))
415
415
  if (!response.ok || !body.access_token) die(`login failed (${response.status}): ${body.error_description || body.error || 'no access token'}`)
416
416
  const session = await persistLoginSession(config, args, { authUrl, realm, clientId }, body)
417
- json({ ok: true, username, authenticated: true, orgId: session.orgId || undefined, apiUrl: session.apiUrl })
417
+ json({ ok: true, username, authenticated: true, user: session.user, organization: session.organization, orgId: session.orgId || undefined, apiUrl: session.apiUrl })
418
418
  }
419
419
 
420
420
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendhoney/cli",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "SendHoney platform CLI for authenticated API, CRUD, release, and ThunderCompute operations.",
5
5
  "private": false,
6
6
  "bin": { "sendhoney": "bin/sendhoney" },